Ports her yinduzhanxing 17a135457ec16b621f86dd57ba3926612ce1b9b8 (docs ee34700357): timing_evidence_packets.py (new), kp_monthly_report_packet / theme_support / vimshottari / transits, kp_system, with her tests. The report path (frozen engine, no timing systems supplied) keeps its earlier packet byte for byte; her profile and window run when the caller supplies the periods it already computed (engine tool kp_timing_packet, cached per chart and window). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbBXp2Vp62Ur3C7yRWQdSq
43 lines
1.9 KiB
Python
43 lines
1.9 KiB
Python
from scripts.timing_evidence_packets import build_timing_evidence_packet, build_transit_evidence_packet
|
|
|
|
|
|
def test_timing_packet_retains_available_dashas_and_marks_missing_systems() -> None:
|
|
packet = build_timing_evidence_packet(
|
|
{"periods": [{"lord": "Saturn", "start": "2020-05-10"}]},
|
|
{"periods": [{"sign": "Leo", "start": "2025-01-01"}]},
|
|
{"events": [{"planet": "Jupiter", "event": "ingress"}]},
|
|
{"ayanamsa": "lahiri", "position_mode": "apparent"},
|
|
)
|
|
|
|
assert packet["status"] == "computed_pending_validation"
|
|
assert packet["raw_results"]["vimshottari"]["periods"][0]["lord"] == "Saturn"
|
|
assert packet["raw_results"]["transit"]["events"][0]["event"] == "ingress"
|
|
assert packet["derived_results"]["chara_dasha"]["status"] == "blocked"
|
|
|
|
|
|
def test_transit_packet_retains_exact_events_without_outcome_claims() -> None:
|
|
packet = build_transit_evidence_packet(
|
|
{"events": [{"planet": "Saturn", "event": "station"}]},
|
|
{"ayanamsa": "lahiri", "position_mode": "apparent"},
|
|
)
|
|
|
|
assert packet["status"] == "computed_pending_validation"
|
|
assert packet["raw_results"]["events"][0]["event"] == "station"
|
|
assert packet["derived_results"]["outcomes"]["status"] == "blocked"
|
|
|
|
|
|
def test_timing_packet_uses_routed_chara_and_ashtottari_results() -> None:
|
|
packet = build_timing_evidence_packet(
|
|
{},
|
|
{},
|
|
{},
|
|
{"ayanamsa": "lahiri"},
|
|
chara_dasha={"current_maha": "Leo"},
|
|
ashtottari={"applicable": True, "current": {"lord": "Venus"}},
|
|
)
|
|
|
|
assert packet["raw_results"]["chara_dasha"]["current_maha"] == "Leo"
|
|
assert packet["raw_results"]["ashtottari"]["current"]["lord"] == "Venus"
|
|
assert packet["derived_results"]["chara_dasha"]["status"] == "available_pending_validation"
|
|
assert packet["derived_results"]["ashtottari"]["status"] == "available_pending_validation"
|