fix(report): period connections use route, not path, in the reading facts (BUG-2126 follow-up)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
This commit is contained in:
2026-11-21 19:20:27 +08:00
co-authored by Claude Opus 5.5
parent 450150c975
commit d151b02cb0
5 changed files with 8 additions and 5 deletions
+1
View File
@@ -28700,6 +28700,7 @@
- 防复发:测试断言这一块没有 activated / score / votes / count 这类字段。
- 关联记录:BUG-2121、BUG-2106、BUG-2117、BUG-2098。
- 修复版本:`claude/period-connections-2126`。
- 补充(2026-11-21):事实里每条关联路径的键 `path` / `path_zh` 改名为 `route` / `route_zh`——`tests/test_report_reading_facts.py::test_reading_facts_are_packet_leaves` 规定写作输入里不出现 `"path"` 键(内部叶子路径不进模型),BUG-2126 提交时没跑这个文件,staging 上它一直失败(BUG-2130 的后台任务发现)。提问材料同时读新旧两个键,已存的事实照常显示。
## BUG-2124 | 自定义条件的格局只写「满足自定义条件」,说不出实际成立的是哪一支
@@ -193,7 +193,7 @@ function connectionLines(facts: Row, only?: readonly number[]): string[] {
for (const item of list(record(raw).paths)) {
const path = record(item);
const fact = text(path.text_zh);
if (fact) out.push(`第 ${house} 宫和当前这段时间的主星有联系(${text(path.path_zh) || "路径未标明"},这是索引,不是「被激活」的判定):${fact}`);
if (fact) out.push(`第 ${house} 宫和当前这段时间的主星有联系(${text(path.route_zh ?? path.path_zh) || "路径未标明"},这是索引,不是「被激活」的判定):${fact}`);
}
}
return out;
@@ -17,7 +17,7 @@ const facts = {
period_connections: {
status: "computed",
houses: {
"7": { house_lord: "Venus", paths: [{ path: "direct", path_zh: "直接(是这一宫的宫主,或落在这一宫)",
"7": { house_lord: "Venus", paths: [{ route: "direct", route_zh: "直接(是这一宫的宫主,或落在这一宫)",
lords: [{ lord: "Venus", levels: ["md"] }], text_zh: "金星(大运主星)是第 7 宫宫主" }] },
"10": { house_lord: "Mars", paths: [{ path: "dispositor_chain", path_zh: "定位链(宫主所在星座的主星,一步步往下找)",
lords: [{ lord: "Venus", levels: ["md"] }], text_zh: "火星在天秤座→金星在金牛座:第 1 步到金星(大运主星)" }] },
+4 -2
View File
@@ -1310,8 +1310,10 @@ def _period_connections(working: dict) -> dict[str, Any] | None:
levels = hit_lords.setdefault(hit["lord"], [])
levels.extend(level for level in hit.get("levels") or [] if level not in levels)
matched.append({
"path": name,
"path_zh": _CONNECTION_PATH_ZH.get(name, name),
# BUG-2126 follow-up: "route", not "path" — the facts never carry a "path" key
# (test_reading_facts_are_packet_leaves keeps internal leaf paths out of the model input).
"route": name,
"route_zh": _CONNECTION_PATH_ZH.get(name, name),
"lords": [{"lord": lord, "levels": levels} for lord, levels in hit_lords.items()],
"text_zh": path_cell(path, "zh"),
})
+1 -1
View File
@@ -44,7 +44,7 @@ def test_only_matched_paths_are_carried_each_with_its_own_lords() -> None:
for house, row in block["houses"].items():
assert row["paths"], house
for path in row["paths"]:
assert path["path"] in ("direct", "same_sign_or_aspect", "sign_exchange", "dispositor_chain", "topic_varga")
assert path["route"] in ("direct", "same_sign_or_aspect", "sign_exchange", "dispositor_chain", "topic_varga")
assert path["lords"] and all(item["levels"] for item in path["lords"])
assert path["text_zh"] and "未对上" not in path["text_zh"] and "未判定" not in path["text_zh"]
# No score, count or boolean "activated" field anywhere in the block.