fix: feed current dasha into web marriage path and keep chart fences on failure (BUG-609, BUG-610, BUG-611)

Consultation was passing the birth mahadasha into event-class splits, so marriage hits stayed empty and timing still said 缔结. Read live MD/AD from dasha_sub_periods, derive activation copy from the split, and isolate fence failures so one bad varga cannot 500 the whole report.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-09-09 16:58:46 +08:00
co-authored by Cursor
parent ee6173e887
commit 7d3bb0c5ed
15 changed files with 573 additions and 25 deletions
+49
View File
@@ -9445,3 +9445,52 @@
- 相关记录:`TASK-upstream-sync2-20260909.md`;上游 09-04 婚恋触发审计
- 复发自:无(上游审计结论在本仓补登记)
- 修复版本:待发布
## BUG-609 | 网页咨询婚恋路径喂的是出生大运,事件类 hits 恒空
- 状态:resolved
- 首次发现:2026-09-09
- 最近更新:2026-09-09
- 影响面:`/api/consultation_workflow` 婚恋主题、`_thematic_dasha_info``report_orchestrator` 婚恋 `timing`
- 用户现象:问结婚时机时,心动 / 成对 / 领证拆分没有大运命中;时间标签可能出现 `Unknown`,并仍写出「缔结或调整伴侣关系的关键期」。
- 触发条件:网页咨询走复用 chart 模块的婚恋主题,chart 模块 dasha 没有 `vimshottari_analysis`
- 根因:`_thematic_dasha_info` 只从 full-reading 的 `vimshottari_analysis` 取当前 MD/AD。咨询路径 09-06 起复用 chart 模块后这个字段不存在,于是只剩出生时 `current_md`。BUG-608 把 `dasha_info` 接上后,断链第一次变成空 hits。激活句也不看 `event_class_split`
- 修复:当前 MD/AD/PD 改从 `chart.modules.dasha_sub_periods.current` 读取,缺了再回退 `vimshottari_analysis`;婚恋 `activation_description` 按事件类出句;AD 缺失时 `dasha_period` 只写 MD。
- 验证:`tests/test_thematic_dasha_info_source.py``tests/test_report_orchestrator_marriage_timing.py``tests/test_relationship_event_class_evidence.py` 咨询形黄金件。
- 防复发:上述测试列入 `CORE_PYTEST_TARGETS`。咨询契约只增不改。感情分析模块逻辑未改,只修喂数。
- 相关记录:BUG-608、BUG-555、`TASK-upstream-sync2-fix-20260909.md`
- 复发自:无(BUG-608 接入后的喂数断链)
- 修复版本:待发布
## BUG-610 | 分盘围栏构造失败会让整份长报告 500
- 状态:resolved
- 首次发现:2026-09-09
- 最近更新:2026-09-09
- 影响面:`render_pl9_markdown``/api/reports/<id>/professional-reference``pl9-export`
- 用户现象:某一张分盘上升星座名不在英文十二星座内时,专业参考 Markdown 与导出一起失败。
- 触发条件:分盘 `Ascendant.sign` 缺失或为中文星座名,围栏 `build_chart_block` / `_sign_name``ValueError`
- 根因:南印度 SVG 在 `try` 内,失败只写「图盘生成失败」;紧接着的围栏构造在 `try` 外,一张分盘出错就中断整份报告。
- 修复:围栏失败只丢掉该张围栏、保留 SVG,并打一条不含用户串的 warning。
- 验证:`tests/test_report_chart_block.py` 中文上升名用例:Markdown 仍含 `<svg`,该处无 `jyotish-chart` 围栏。
- 防复发:该文件已在 `CORE_PYTEST_TARGETS`。失败路径不加围栏,也不再打断报告。
- 相关记录:BUG-607、`TASK-upstream-sync2-fix-20260909.md`
- 复发自:无(BUG-607 围栏成功路径未覆盖失败分支)
- 修复版本:待发布
## BUG-611 | `/api/health` 的 version 写死旧 Skill 号
- 状态:resolved
- 首次发现:2026-09-09
- 最近更新:2026-09-09
- 影响面:`GET /api/health`、chart 成功/回退响应里的 `version`
- 用户现象:健康检查报的 Skill 版本与 `jyotish_vedic.__version__` 不一致。
- 触发条件:访问 `/api/health` 或读取 chart 响应 `version`
- 根因:版本字符串散落三处硬编码,没有从 `jyotish_vedic.__version__` 读。
- 修复:三处改为读取 `__version__`;回退路径保留 `-fallback` 后缀。
- 验证:`tests/test_api_server_security.py::test_health_endpoint_exposes_runtime_accuracy_metadata`
- 防复发:健康检查断言 `version == jyotish_api_server.__version__`
- 相关记录:`TASK-upstream-sync2-fix-20260909.md`
- 复发自:无
- 修复版本:待发布
@@ -0,0 +1,38 @@
# PROGRESS · 上游同步二修复单(网页婚恋 dasha_info / 围栏 / 版本号,2026-09-09
- 工作树:`.worktrees/upstream-sync2-fix-20260909`
- 分支:`codex/upstream-sync2-fix-20260909`track `origin/staging`
- 基线:`origin/staging` @ `ee6173e8`(含任务书 `26ef220f`
- BUG**BUG-609 / 610 / 611**
- 未改 `.gitea/workflows/**`,不提升 `main`,未 push
## 做了什么
| 任务 | 状态 | 说明 |
| --- | --- | --- |
| 1 喂正确 MD/AD | 完成 | `_thematic_dasha_info` 先读 `dasha_sub_periods.current`,再回退 `vimshottari_analysis`;咨询路径把 `full_modules` 并进 chart。当前 AD 补进 timeline,避免 `Saturn-Unknown` |
| 2 婚恋 activation 句 | 完成 | `report_orchestrator``event_class_split` 出句;legal 才写「缔结」;romantic/formation 写「不等于领证」;无命中写「本期无婚恋事件类命中」。AD 缺失只写 MD |
| 3 围栏失败不打断 | 完成 | `_render_south_chart` 围栏 `try/except`,失败返回 SVGwarning 只带 chart id |
| 4 版本字符串 | 完成 | health / chart / fallback 三处读 `jyotish_vedic.__version__` |
| 5 记录 | 完成 | BUG-609/610/611、CHANGELOG、本文件、走查清单补 MD/AD 一致 |
`scripts/jyotish_api_server.py` `wc -l` = 11313(基线 11300,净增 13,上限 15)。前端未改。
## 测试
| 项 | 结果 |
| --- | --- |
| `tests/test_thematic_dasha_info_source.py` | 绿 |
| `tests/test_report_orchestrator_marriage_timing.py` | 绿 |
| `tests/test_relationship_event_class_evidence.py` | 绿(含 1990 虚构咨询形黄金件) |
| `tests/test_report_chart_block.py` | 绿(含中文上升名保留 SVG) |
| `tests/test_api_server_security.py::test_health_endpoint_exposes_runtime_accuracy_metadata` | 绿 |
| `tests/test_api_server_growth_contract.py` | 绿 |
| `tests/test_consultation_workflow_domains.py` | 绿 |
| in-process 咨询形 thematic `theme=marriage` | `Romantic-activation` hits `5L_dasha``Relationship-formation` hits `7L_dasha``dasha_period=Saturn-Jupiter`activation 为「不等于领证」 |
虚构盘说明:Leo 上升,5L=Jupiter7L=Saturn,月亮在 7 宫;当前 Saturn MD / Jupiter AD,所以 5L 与 7L 都会命中。未换出生。
## 偏离
没有砍让步项。时间轴原先只有 MD 行、AD 为 `Unknown`;为满足「不再含 Unknown」且与当前小运一致,把 `dasha_sub_periods.current` 的 AD 填回对应 MD 行。没有从 `dasha.periods` 手算日期。
+1 -1
View File
@@ -151,7 +151,7 @@
| `TASK-upstream-sync-20260903.md` | `PROGRESS-upstream-sync-20260903.md`、`PROGRESS-upstream-capabilities-20260903.md` | 上游快照推进到 `a6f47abd`、引擎三方合并、health 三窗 / VedAstro REST 桥 / 专业报告导出 / 新字段接聊天与报告 / 校正解冻三项 | 已验收 | 0/1/2/4/6`45d13258`、`f2241463`、`734d2059`3/5/7`c2f23131``6063c1f7`BUG-514)。staging 已部署 `6063c1f7`。修复单 `4ee79210` 已验收 |
| `TASK-upstream-sync-fix-20260903.md` | `PROGRESS-upstream-sync-fix-20260903.md` | 非原生主题恢复 `degraded`、finance Yogi/D11/confidence cap、模板注册表引用、VedAstro/MCP finance 路由与 quick CORE 扩列 | 已验收 | `4ee79210`BUG-515);staging health 已到该 SHA;十主题 e2e 合同全对,Python 红 90→69 无新增 |
| `TASK-upstream-sync2-20260909.md` | `PROGRESS-upstream-sync2-20260909.md` | 上游活跃分支 `b9a0ef8f`(未进 main):婚恋三层触发模型(punarphoo / event_class_split 进证据链)+ 十套条件大运接 full reading 与长报告时间系统表;快照锁推进;Skill 6.9.16;不取 shadbala profile / PL9 用户版 / 校正泄漏项 | 已验收(04ad3325):定向 176 通过、quick 门 708/1 env 失败、pl9 时间系统表 5+10 行;1 P1(网页咨询路径 `dasha_info` 无 MD/AD,事件类拆分空转)→ 修复单 `TASK-upstream-sync2-fix-20260909.md` | 分支 `codex/upstream-sync2-20260909`BUG-608 |
| `TASK-upstream-sync2-fix-20260909.md` | | 修复单:`_thematic_dasha_info` 改读 `dasha_sub_periods.current`、婚恋 activation 句按事件类出、`_render_south_chart` 围栏失败不打断报告、health 版本读 `__version__` | 待领取 | 分支 `codex/upstream-sync2-fix-20260909`BUG-609611 |
| `TASK-upstream-sync2-fix-20260909.md` | `PROGRESS-upstream-sync2-fix-20260909.md` | 修复单:`_thematic_dasha_info` 改读 `dasha_sub_periods.current`、婚恋 activation 句按事件类出、`_render_south_chart` 围栏失败不打断报告、health 版本读 `__version__` | 待验收 | 分支 `codex/upstream-sync2-fix-20260909`BUG-609611 |
## 命名与归档
+2 -1
View File
@@ -1,6 +1,6 @@
# 婚恋三层与条件大运:真实环境走查清单(2026-09-09BUG-608
自动化替代证据见 `tests/test_punarphoo_observation.py``tests/test_relationship_event_class_evidence.py``tests/test_full_reading_conditional_dashas.py`。下面每一条都需要一位有真实账号的人在 staging 上对照。
自动化替代证据见 `tests/test_punarphoo_observation.py``tests/test_relationship_event_class_evidence.py``tests/test_full_reading_conditional_dashas.py``tests/test_thematic_dasha_info_source.py``tests/test_report_orchestrator_marriage_timing.py`。下面每一条都需要一位有真实账号的人在 staging 上对照。
前置:staging 已部署含本轮改动的 SHA;账号点数足以问一句婚恋并生成一份个人长报告。
@@ -11,6 +11,7 @@
- [ ] 回答把心动、成对、领证分开说,不会合成一句「婚恋机会」。
- [ ] 心动层如果出现,语气是观察,没有写成「会结婚」或「领证窗口」。
- [ ] 没有给出细到某一个月的更细一层(PD)日期当结婚月。
- [ ] 回答里的大运名与页面时间轴当前 MD/AD 一致,且不出现 `Unknown`
## 2. 长报告时间系统表