把被逐字锁定的年运函数改回原样,历史清单不再要求已删除的占位文件。
Independent Staging Quality Gate / validate (push) Successful in 14m11s
Independent Staging Quality Gate / publish (push) Successful in 3m43s

年数表字面量留在 calc_mudda_with_dasha_balance 里。调用矩阵测试改为确认这两个路径已删并由现行模块接替。pytest 三条文件 187 通过、1 跳过、0 失败。

Co-Authored-By: Grok (agent loop)
This commit is contained in:
jesse-ux
2026-10-16 09:02:20 +08:00
co-authored by Grok (agent loop)
parent e96de24721
commit fbf04f0b5f
6 changed files with 90 additions and 5 deletions
+9 -1
View File
@@ -67,7 +67,15 @@ BALANCE_ANCHORS = (
("shodashottari_dasha", "PUSHYA_INDEX"),
)
FROZEN_YEAR_TABLES = {"dasha_analyzer.py", "divisional_charts_extended.py"}
# 原值:白名单只有 dasha_analyzer.py、divisional_charts_extended.py
# 新值:加上 tajika.py
# 原因:calc_mudda_with_dasha_balance 被 test_ported_function_is_verbatim 逐字锁定,
# 函数里的年数字面量不能改成共享表引用。其余非白名单文件仍只能命中 dasha_common.py。
FROZEN_YEAR_TABLES = {
"dasha_analyzer.py",
"divisional_charts_extended.py",
"tajika.py",
}
YEAR_TABLE = re.compile(
r"""['"]Ketu['"]\s*:\s*7\b.*?['"]Venus['"]\s*:\s*20\b.*?['"]Mercury['"]\s*:\s*17\b""",
re.DOTALL,
+20 -1
View File
@@ -153,9 +153,28 @@ def test_invocation_matrix_paths_counts_hash_and_boundaries() -> None:
assert all(row == by_id[row["technique_id"]] for row in matrix[key])
for bucket in matrix["migration_batches"].values():
assert all(row == by_id[row["technique_id"]] for row in bucket)
# 原值:矩阵里每个 sample_files 路径都必须存在
# 新值:scripts/extended_dashas.py 必须不存在,由 scripts/dasha_registry.py 接替;
# scripts/conditional_dashas.py 必须不存在,由 dwisaptatisama / shattrimshatsama /
# dwadashottari 三个现行模块接替。其余路径仍必须存在。
# 原因:BUG-1341 删除了这两个占位文件。矩阵是历史归档,不改 JSON,也不把旧文件加回来。
# test_historical_artifacts_are_byte_preserved_not_refreshed 只管另一份封存归档,不管这份清单。
deleted_placeholders = {
"scripts/extended_dashas.py": ("scripts/dasha_registry.py",),
"scripts/conditional_dashas.py": (
"scripts/dwisaptatisama_dasha.py",
"scripts/shattrimshatsama_dasha.py",
"scripts/dwadashottari_dasha.py",
),
}
for row in rows:
for paths in row["sample_files"].values():
assert all((ROOT / path).is_file() for path in paths)
for path in paths:
if path in deleted_placeholders:
assert not (ROOT / path).is_file()
assert all((ROOT / successor).is_file() for successor in deleted_placeholders[path])
else:
assert (ROOT / path).is_file()
for key in ("kp_exact_cusp", "kp_star_sub_sub", "timing_holdout", "saham", "tajika", "gulika", "sphuta", "prashna"):
assert by_id[key]["claim_status"] == "blocked_or_observation_only"
assert by_id[key]["commercial_sync_policy"] == "sync_observation_or_boundary_contract_only"