fix(reading): hold Niryaana Shoola and drop the root helper
Independent Staging Quality Gate / validate (push) Successful in 14m30s
Independent Staging Quality Gate / publish (push) Successful in 3m54s

The two upstream files stay verbatim in scripts/. The path helper moved into a subdirectory so the root file budget rises by only those two. Niryaana Shoola is a placeholder until its rule is corrected. Targeted tests passed.

Co-Authored-By: Grok (agent loop)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jesse-ux
2026-10-19 00:19:57 +08:00
co-authored by Grok (agent loop) Cursor
parent a0122251be
commit 2130682d43
8 changed files with 82 additions and 32 deletions
+16 -5
View File
@@ -15,9 +15,12 @@ from scripts.punarphoo import detect_punarphoo
from scripts.rashi_dashas_native import SIGN_LORDS, navamsha_sign
ROOT = Path(__file__).resolve().parents[1]
# 原值:docs/research/upstream_full_synastry_bde5d615/.../validate_full_synastry_packets.py.txt
# 新值:docs/research/upstream_full_synastry_7a773d13/.../validate_full_synastry_packets.py.txt
# 原因:修改单 M3。新校验器把 Niryaana Shoola 固定判为 not_applicable,合盘不用这套大运。
VALIDATOR = (
ROOT
/ "docs/research/upstream_full_synastry_bde5d615/skill/scripts/validate_full_synastry_packets.py.txt"
/ "docs/research/upstream_full_synastry_7a773d13/skill/scripts/validate_full_synastry_packets.py.txt"
)
# Baseline full-reading keys on origin/staging b3ef2d815, plus the five keys this
@@ -97,9 +100,12 @@ def _goel_method_1_first(d9_lagna: int, lord_sign_by_sign: dict[int, int]) -> tu
def test_unified_western_reading_module_imports() -> None:
assert not (ROOT / "scripts" / "_script_root.py").exists()
import classical_astrology
import unified_western_reading
assert callable(unified_western_reading.build_unified_western_reading)
assert callable(classical_astrology.build_classical_astrology_packet)
def test_engine_does_not_import_the_retired_niryaana_file() -> None:
@@ -141,8 +147,10 @@ def test_secondary_dashas_use_native_profiles_and_match_goel_method_1(reports) -
niryaana = modules["niryaana_shoola_dasha"]
assert navamsha["status"] == "parameter_sensitive"
assert navamsha["profile_id"] == "goel_method_1_v1"
assert niryaana["status"] == "parameter_sensitive"
assert niryaana["profile_id"] == "goel_nirayana_shoola_v1"
assert niryaana == {
"execution_status": "blocked",
"reason": "口径更正中,见 TASK-niryaana-shoola-pvr-20261018",
}
assert navamsha["native_result"]["status"] == "listed"
first = navamsha["periods"][0]
d9 = modules["varga_full"]["D9_Navamsa"]
@@ -173,8 +181,11 @@ def test_synastry_validator_accepts_the_secondary_dashas(reports) -> None:
validator = _validator()
receipt = validator.build_execution_receipt(reports["pitt"], reports["jolie"])
rows = {row["technique"]: row for row in receipt["individual_technique_audit"]}
for label in ("Navamsha Dasha", "Niryaana Shoola Dasha"):
assert rows[label]["status"] in {"executed", "parameter_sensitive"}
assert rows["Navamsha Dasha"]["status"] in {"executed", "parameter_sensitive"}
# 原值:Niryaana Shoola 必须是 executed 或 parameter_sensitive
# 新值:not_applicable
# 原因:修改单 M3。上游 7a773d13 校验器对这一行固定判不适用,合盘任务不因它 blocked。
assert rows["Niryaana Shoola Dasha"]["status"] == "not_applicable"
tasks = {row["task"]: row for row in receipt["pair_execution_tasks"]}
assert tasks["secondary-dasha convergence and disagreement review"]["status"] != "blocked"
+13 -2
View File
@@ -11,8 +11,18 @@ SCRIPTS = ROOT / "scripts"
# Measured at the end of TASK-python-hygiene-20261013. New silent handlers
# must log or carry ``# noqa: BLE001`` with a reason. New research scripts
# belong in scripts/audit or scripts/research.
SILENT_EXCEPT_BUDGET = 0
ROOT_PY_BUDGET = 446
# 原值:0
# 新值:1
# 原因:产品 2026-10-18(issue #81 选 A)要求 classical_astrology.py 保持上游原文。
# 其中 scripts/classical_astrology.py:12558 是 except Exception: continue。本单不得改这个文件。
# 本地新写的静默处理仍不得出现;允许的命中只有这一处。
SILENT_EXCEPT_BUDGET = 1
UPSTREAM_SILENT_EXCEPT = "scripts/classical_astrology.py:12558"
# 原值:446
# 新值:448
# 原因:产品 2026-10-18(issue #81 选 A):上游原样文件按上游路径放在 scripts/ 根目录,
# classical_astrology.py、unified_western_reading.py 两个;本地新写的文件仍不得增加。
ROOT_PY_BUDGET = 448
def _silent_handlers() -> list[str]:
@@ -45,6 +55,7 @@ def _silent_handlers() -> list[str]:
def test_silent_except_budget_does_not_grow() -> None:
hits = _silent_handlers()
assert hits == [UPSTREAM_SILENT_EXCEPT]
assert len(hits) <= SILENT_EXCEPT_BUDGET, hits