fix(report): keep monthly KP headings and readable timing sources

Heading-ensure only covered empty packets, so present KP months still dropped MD/AD titles and sanitizer blanked source_path. Also lock the quality gate onto the new contracts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-09-06 23:00:01 +08:00
co-authored by Cursor
parent 5aa05bf0d0
commit e4d16b7545
10 changed files with 213 additions and 20 deletions
+17
View File
@@ -8677,4 +8677,21 @@
- 复发自:无
- 修复版本:`ebc8380f`
## BUG-564 | 长报告 heading-ensure 之后仍丢逐月 KP 标题、时间来源与分钟排行
- 状态:resolved
- 首次发现:2026-09-06
- 最近更新:2026-09-06
- 影响面:`scripts/jyotish_engine.py` pl9 长报告、`scripts/flexible_birth_time_report_section.py``scripts/run_quality_gate.py` 快速门
- 用户现象:有 KP 月份数据时,事业/财务/关系三条「逐月 MD/AD 支持」标题仍不见;时间节点归因表的来源列被脱敏成空;校时附录没有分钟排行。快速门也不跑 gaps2 合同。
- 触发条件:`kp_monthly_report.months` 非空;professional 路径 sanitize 掉 `source_path`;候选窗存在但渲染层不读 `candidate_times`
- 根因:`_kp_monthly_theme_brief` 成功路径不写标题,空包才靠文末 heading-ensure 补 blocked 标题;parity_gates 用 `source_path`sanitize 会剥掉任何 `_path` 键;CLI provenance 只读显式 `uncertainty_minutes`;分钟排行未装配。顺带 `d1_d60_ledger` / `support_topics.kp` 为 None 时 `.get` 会在有月份数据的渲染里炸掉。
- 修复:逐月 brief 始终输出标题,空数据走 blockedparity_gates 改 `source_label`;窗口宽度回填 uncertainty;校时附录列出候选分钟;None 守卫;快速门列入 gaps2 / parity / timing / flexible 合同。
- 验证:`tests/test_report_longform_gaps2.py``tests/test_flexible_birth_time_report_contract.py``tests/test_timing_precision_contract.py`
- 防复发:有月份数据时三条逐月标题必须各出现一次,且不得靠文末 blocked 标题顶替;sanitize 后 Markdown 仍须保留可读 source_label;快速门必须跑上述四个测试文件。
- 相关记录:BUG-561、BUG-562
- 复发自:BUG-561`cfcd369d` 的 heading-ensure 只覆盖空包缺席,未覆盖成功路径漏标题)
- 修复版本:待本提交 SHA