"""Refresh one leaf of the report density fixture from the real engine (BUG-1209). `frontend/tests/fixtures/report-density-fictional-engine.json` is a 2026-09-23 real-engine snapshot without a capture script. The Ashtakavarga reduction moved to the standard Trikona -> Ekadhipatya chain, so only `worksheets.strengths_and_scores.ashtakavarga` is recaptured here, from the fixture's own recorded input (fictional, 2000-01-01 12:00 UT, 0/0); every other leaf stays byte-identical. PYTHONHASHSEED=0 python3 scripts/research/refresh_density_fixture_ashtakavarga.py """ from __future__ import annotations import json import sys from pathlib import Path ROOT = Path(__file__).resolve().parents[2] sys.path[:0] = [str(ROOT), str(ROOT / "scripts")] from scripts.jyotish_engine import build_professional_report_reference_packet, cmd_full_reading # noqa: E402 from scripts.professional_report_reference import _export_args # noqa: E402 FIXTURE = ROOT / "frontend/tests/fixtures/report-density-fictional-engine.json" def main() -> int: text = FIXTURE.read_text(encoding="utf-8") fixture = json.loads(text) case = dict(fixture["fixtureProvenance"]["input"]) case.setdefault("age", int(case["target_year"]) - int(case["year"])) packet = build_professional_report_reference_packet(cmd_full_reading(type("Args", (), dict(case))()), _export_args(dict(case)), []) fixture["worksheets"]["strengths_and_scores"]["ashtakavarga"] = packet["worksheets"]["strengths_and_scores"]["ashtakavarga"] fixture["fixtureProvenance"]["refreshed"] = { "leaf": "worksheets.strengths_and_scores.ashtakavarga", "reason": "BUG-1209 standard Sodhita chain (TASK-astrologer-rulings-batch1-20261003 T7)", "generator": "scripts/research/refresh_density_fixture_ashtakavarga.py", } indent = 2 if text.startswith("{\n ") else None FIXTURE.write_text(json.dumps(fixture, ensure_ascii=False, indent=indent) + ("\n" if text.endswith("\n") else ""), encoding="utf-8") return 0 if __name__ == "__main__": raise SystemExit(main())