Files
Jyotisha/docs/tasks/FIX-rect-layer-alias-3.md
T

4.0 KiB
Raw Blame History

#184 验收退回(第 2 次):真实“只缺小运”路径仍是 not_reducible(2026-11-09,Claude)

本文件补充 TASK-rect-layer-alias-20261109.md、FIX-rect-layer-alias-1.md、FIX-rect-layer-alias-2.md,冲突时以本文件为准。验收的是 446420d7。

已核对通过(保留,不要改)

  • 引擎行 contributions:七个字段齐全,非空 points 之和等于 score,layer_points 与 contributions 一一对应;只追加字段。
  • missing_mandatory_layers: [{candidate_time, layer, event_ids}]:排序、[] 永不 null、旧形状行 event_ids: null + event_ids_source;reasons 条件正确。
  • top_candidate_count / top_segment_count / unique_time;层名对照只在整件缺失时套用,并记 layer_aliases_applied。
  • can_apply / confidence / top_score / winning_segment 在既有用例上不变;52 条测试通过。

问题:FIX-2 第 2 条没有生效

FIX-2 第 2 条要求:拆不开的 (e, dasha_varga_core) 对所有候选一起拿掉,再按剩下的共同覆盖比较。现在代码确实把单元拿掉了,但 assess_leader_comparability 之后仍把该候选 missing_layers 里的 Narayana_AD 算作 unexplained,于是直接走 not_reducible 分支;这个分支还不输出 excluded_contributions。

Claude 实测(真实形状行:两个候选都有 e1–e5 的 layer_points 与 contributions,12:01 的 e5 dasha_varga_core 为 decomposable: false、missing_reason: "Narayana_AD_unresolved"、missing_layers: ["Narayana_AD"]):

字段 现在 应该
coverage_comparison.comparison not_reducible common_coverage
unreducible_layers ["Narayana_AD"] 不出现
excluded_contributions 不出现 [{"event_id": "e5", "layer": "dasha_varga_core", "reason": "md_ad_not_decomposable"}]
comparable_leader null 按剩余共同覆盖算出(可以是 comparable_tied)

也就是说她要的“真实部分缺失路径给出可比结果,或带理由的明确排除”,现在两样都没有。

要做的

  1. 在 assess_leader_comparability 里:某个差异层 L,如果每个带 L 的候选,其 contributions 中所有 missing_reason == f"{L}_unresolved" 的项都已被 excluded_contributions 覆盖(同一 event_id 的 dasha_varga_core),并且该候选没有别的未解释缺失,则 L 视为已由排除解释,不进 unexplained。没有 contributions 的旧形状行不适用,仍按原逻辑(旧行仍 not_reducible)。
  2. excluded_contributions 在 not_reducible 分支里也要输出(只要非空)。
  3. 测试(写进 tests/test_rectification_layer_alias_bug1827.py,不弱化已有断言;若已有断言“产品 Narayana_AD 仍 not_reducible”与本条冲突,只对带 contributions 的真实形状行改期望,并写三栏注释,原因 占星师第七轮 P1:拆不开的 MD/AD 合分对所有候选一致排除后按共同覆盖比较(BUG-1827,FIX-3)):
    • 上表的真实形状例:common_coverage、excluded_contributions 如上、common_scores 不含 e5 的 dasha_varga_core;
    • 同一例里 e5 另有一层也缺失且不可拆分 → 仍 not_reducible,且输出 excluded_contributions;
    • 旧形状行(无 contributions、missing_layers: ["Narayana_AD"]、事件都在)→ 仍 not_reducible,不出现 excluded_contributions;
    • 带负分贡献的真实形状例(FIX-1 反例清单):排除后共同覆盖得分按剩余单元计算,负分照计;
    • can_apply、confidence 在上述各例与改前相同(用测试锁住)。
  4. PROGRESS 补“第 2 次打回”一节;BUG-1827 补一行“验收退回:排除后未按共同覆盖比较”(只改这一条)。

不要碰

前三份任务书的“不要碰”清单继续有效;active_rectification_event_engine.py 本轮不再改。不得自行写“产品决定/裁定”;任务书没写到的取舍一律选需拍板。