8010245981
Default ayanamsa to Raman with true_pushya support, attach governed Raman packets, restore Path C questionnaires and eight-method verification copy, and keep unique-minute confirmation blocked. Co-authored-by: Cursor <cursoragent@cursor.com>
101 lines
4.0 KiB
Python
101 lines
4.0 KiB
Python
#!/usr/bin/env python3
|
|
"""Raman ayanamsa default and support-observation contracts."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
SCRIPTS = os.path.join(os.path.dirname(__file__), "..", "scripts")
|
|
if SCRIPTS not in sys.path:
|
|
sys.path.insert(0, SCRIPTS)
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
PACKET_DIR = ROOT / "references" / "oracle" / "raman_2026_08_20"
|
|
|
|
from ayanamsa_utils import ( # noqa: E402
|
|
ACTIVE_AYANAMSA_NAME,
|
|
UnsupportedAyanamsaError,
|
|
is_supported_ayanamsa_name,
|
|
normalize_ayanamsa_name,
|
|
supported_ayanamsa_names,
|
|
)
|
|
from raman_support_observations import ( # noqa: E402
|
|
BLOCKED_PACKET_PREFIXES,
|
|
build_raman_support_observations,
|
|
sieve_yogas_for_routes,
|
|
)
|
|
|
|
|
|
def test_default_ayanamsa_is_raman_and_true_pushya_is_supported() -> None:
|
|
assert ACTIVE_AYANAMSA_NAME == "raman"
|
|
assert normalize_ayanamsa_name(None) == "raman"
|
|
assert normalize_ayanamsa_name("") == "raman"
|
|
assert is_supported_ayanamsa_name("true_pushya")
|
|
assert "true_pushya" in supported_ayanamsa_names()
|
|
assert normalize_ayanamsa_name("true_pushya") == "true_pushya"
|
|
assert normalize_ayanamsa_name("lahiri") == "lahiri"
|
|
|
|
|
|
def test_unknown_ayanamsa_does_not_silently_become_lahiri() -> None:
|
|
with pytest.raises(UnsupportedAyanamsaError, match="unsupported ayanamsa"):
|
|
normalize_ayanamsa_name("not_a_real_school")
|
|
|
|
|
|
def test_whitelist_packets_are_present_and_blocked_prefixes_are_absent() -> None:
|
|
names = {path.name for path in PACKET_DIR.glob("*.json")}
|
|
assert "raman_house_judgment_core_subrules_packet_2026_08_20.json" in names
|
|
assert "raman_bvr_wealth_core_batch_closure_packet_2026_08_20.json" in names
|
|
assert "raman_dasha_core_subrules_packet_2026_08_20.json" in names
|
|
for prefix in BLOCKED_PACKET_PREFIXES:
|
|
assert not any(name.startswith(prefix) for name in names)
|
|
|
|
|
|
def test_domain_yoga_sieve_lists_hits_and_misses() -> None:
|
|
detected = [{"name": "Sunaphaa Yoga", "planets": ["Mars"]}]
|
|
result = sieve_yogas_for_routes(detected, {"career"})
|
|
names = {row["name"] for row in result["yogas"]}
|
|
assert "Sunaphaa Yoga" in names
|
|
hit = next(row for row in result["hits"] if row["name"] == "Sunaphaa Yoga")
|
|
assert hit["hit"] is True
|
|
assert any(row["hit"] is False for row in result["misses"])
|
|
assert "Dharidhra Yoga" not in names
|
|
|
|
|
|
def test_house_six_step_marks_core_executed_and_later_steps_methodology() -> None:
|
|
chart = {
|
|
"houses": {
|
|
"house_10": {"cusp_sign": "Leo", "lord": "Sun"},
|
|
},
|
|
"planets": {
|
|
"Sun": {"sign": "Aries", "house": 6, "status": "exalted"},
|
|
"Moon": {"sign": "Taurus", "house": 7},
|
|
"Jupiter": {"sign": "Sagittarius", "house": 2},
|
|
},
|
|
}
|
|
packet = build_raman_support_observations(chart, [], {"career"})
|
|
house = packet["houses"][0]
|
|
assert house["house"] == 10
|
|
assert house["executable_core"]["house_itself_assessment"]["status"] == "executed"
|
|
assert house["executable_core"]["house_lord_assessment"]["lord"] == "Sun"
|
|
assert house["executable_core"]["karaka_assessment"]["karaka"] == "Sun"
|
|
assert house["methodology"]["navamsa_confirmation"]["status"] == "methodology_only"
|
|
assert house["methodology"]["integrated_synthesis"]["status"] == "methodology_only"
|
|
assert packet["claim_boundary"] == "governed_support_only_candidate_ready"
|
|
assert "raman_bvr_health_adversity" in packet["blocked_packets"]
|
|
engine_source = (ROOT / "scripts" / "active_rectification_event_engine.py").read_text(encoding="utf-8")
|
|
assert "AYANAMSA: Final = DEFAULT_AYANAMSA_NAME" in engine_source
|
|
assert 'AYANAMSA: Final = "lahiri"' not in engine_source
|
|
|
|
|
|
def test_blocked_raman_packets_are_not_loaded_as_domain_support() -> None:
|
|
from raman_support_observations import DOMAIN_PACKETS
|
|
|
|
loaded = {name for names in DOMAIN_PACKETS.values() for name in names}
|
|
for prefix in BLOCKED_PACKET_PREFIXES:
|
|
assert not any(name.startswith(prefix) for name in loaded)
|