feat: sync real case website e2e contract
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import json
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ARTIFACT = ROOT / "references" / "oracle" / "muhurta_numeric_candidate_capture_packet_2026_07_20.json"
|
||||
INDEX = ROOT / "references" / "oracle" / "evidence_packet_index_2026_07_19.json"
|
||||
|
||||
|
||||
def test_muhurta_numeric_candidate_capture_packet_selects_only_numeric_muhurta_sources():
|
||||
data = json.loads(
|
||||
subprocess.check_output(
|
||||
["python3", "scripts/muhurta_numeric_candidate_capture_packet.py", "--date", "2026-07-20"],
|
||||
cwd=ROOT,
|
||||
text=True,
|
||||
)
|
||||
)
|
||||
assert data["scope"] == "muhurta_numeric_candidate_capture_packet"
|
||||
assert data["claim_status"] == "source_intake_only"
|
||||
assert data["summary"]["candidate_count"] == 2
|
||||
assert data["summary"]["oracle_ready_count"] == 0
|
||||
assert data["production_tuning_allowed"] is False
|
||||
ids = {row["source_id"] for row in data["capture_rows"]}
|
||||
assert ids == {"mypanchang_edison_2025_panchangam", "drikpanchang_mumbai_rahu_2026_07_20"}
|
||||
|
||||
|
||||
def test_muhurta_numeric_candidate_capture_packet_has_hashes_and_replay_blockers():
|
||||
data = json.loads(ARTIFACT.read_text(encoding="utf-8"))
|
||||
for row in data["capture_rows"]:
|
||||
assert row["source_observation_hash"]
|
||||
assert row["canonical_request_hash"]
|
||||
assert row["raw_capture_status"] == "pending_raw_page_capture"
|
||||
assert row["upgrade_status"] == "not_oracle_ready"
|
||||
assert "raw_capture_hash" in row["missing_for_oracle"]
|
||||
assert "replay_comparison" in row["missing_for_oracle"]
|
||||
assert row["next_artifact_path"].startswith("references/oracle/artifacts/")
|
||||
|
||||
|
||||
def test_muhurta_numeric_candidate_capture_packet_is_indexed():
|
||||
packets = {row["packet_id"]: row for row in json.loads(INDEX.read_text(encoding="utf-8"))["packets"]}
|
||||
packet = packets["muhurta_numeric_candidate_capture_packet_2026_07_20"]
|
||||
assert packet["domain"] == "muhurta_factor_scoring"
|
||||
assert packet["claim_status"] == "source_intake_only"
|
||||
@@ -0,0 +1,36 @@
|
||||
import json
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
CONTRACT = ROOT / "references/oracle/prashna_input_contract_2026_07_20.json"
|
||||
QUEUE = ROOT / "references/oracle/prashna_numeric_oracle_packet_queue_2026_07_20.json"
|
||||
INDEX = ROOT / "references/oracle/evidence_packet_index_2026_07_19.json"
|
||||
|
||||
|
||||
def test_prashna_contract_requires_time_place_timezone_ayanamsa_node():
|
||||
data = json.loads(subprocess.check_output(["python3", "scripts/prashna_oracle_queue.py", "--date", "2026-07-20"], cwd=ROOT, text=True))
|
||||
contract = data["contract"]
|
||||
assert contract["scope"] == "prashna_input_contract"
|
||||
required = {row["field"] for row in contract["required_fields"]}
|
||||
assert {"question_datetime_local", "location", "timezone", "ayanamsa", "node_mode"}.issubset(required)
|
||||
assert contract["claim_status"] == "ready_contract"
|
||||
|
||||
|
||||
def test_prashna_queue_keeps_public_numeric_examples_candidate_only():
|
||||
queue = json.loads(QUEUE.read_text(encoding="utf-8"))
|
||||
assert queue["scope"] == "prashna_numeric_oracle_packet_queue"
|
||||
assert queue["claim_status"] == "open_queue"
|
||||
assert queue["summary"]["numeric_candidate_count"] >= 1
|
||||
assert queue["summary"]["oracle_ready_count"] == 0
|
||||
example = next(row for row in queue["rows"] if row["source_id"] == "vedastro_prasna_marga_ch5_sphuta_example")
|
||||
assert example["numeric_fields_present"] is True
|
||||
assert "trisphuta" in example["expected_values"]
|
||||
assert "complete_prashna_input" in example["missing_for_oracle"]
|
||||
assert example["upgrade_status"] == "candidate_not_oracle"
|
||||
|
||||
|
||||
def test_prashna_contract_and_queue_are_indexed():
|
||||
packets = {row["packet_id"]: row for row in json.loads(INDEX.read_text(encoding="utf-8"))["packets"]}
|
||||
assert packets["prashna_input_contract_2026_07_20"]["claim_status"] == "ready_contract"
|
||||
assert packets["prashna_numeric_oracle_packet_queue_2026_07_20"]["claim_status"] == "open_queue"
|
||||
@@ -0,0 +1,32 @@
|
||||
import json
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ARTIFACT = ROOT / "references/real_case_calibration/real_case_website_e2e_eval_2026_07_20.json"
|
||||
INDEX = ROOT / "references/oracle/evidence_packet_index_2026_07_19.json"
|
||||
|
||||
|
||||
def test_real_case_website_e2e_eval_builds_twenty_case_contract():
|
||||
data = json.loads(subprocess.check_output(["python3", "scripts/real_case_website_e2e_eval.py"], cwd=ROOT, text=True))
|
||||
assert data["scope"] == "real_case_website_e2e_eval"
|
||||
assert data["case_count"] == 20
|
||||
assert data["claim_status"] == "ready_contract"
|
||||
assert data["truth_matrix_allowed"] is False
|
||||
assert data["production_tuning_allowed"] is False
|
||||
|
||||
|
||||
def test_real_case_website_e2e_eval_requires_core_runtime_context():
|
||||
data = json.loads(ARTIFACT.read_text(encoding="utf-8"))
|
||||
required = {"D1", "Dasha", "functional_benefic_malefic", "claim_boundary", "similar_case_reference_allowed"}
|
||||
assert all(required <= set(case["expected_runtime_context"]) for case in data["cases"])
|
||||
domains = {domain for case in data["cases"] for domain in case["domains"]}
|
||||
assert {"career", "wealth", "marriage", "health", "migration", "family", "education", "timing", "annual"} <= domains
|
||||
|
||||
|
||||
def test_real_case_website_e2e_eval_is_indexed():
|
||||
packets = {row["packet_id"]: row for row in json.loads(INDEX.read_text(encoding="utf-8"))["packets"]}
|
||||
packet = packets["real_case_website_e2e_eval_2026_07_20"]
|
||||
assert packet["claim_status"] == "ready_contract"
|
||||
assert "not an accuracy benchmark" in packet["claim_boundary"]
|
||||
Reference in New Issue
Block a user