diff --git a/references/oracle/evidence_packet_index_2026_07_19.json b/references/oracle/evidence_packet_index_2026_07_19.json index c21bd957..d77d9854 100644 --- a/references/oracle/evidence_packet_index_2026_07_19.json +++ b/references/oracle/evidence_packet_index_2026_07_19.json @@ -657,13 +657,21 @@ "claim_status": "open_queue", "consumer_policy": "research_to_commercial_contract_only", "claim_boundary": "Groups KP, Muhurta, and Shadbala worked-example candidates into intake queues; no candidate is upgraded until numeric expected values, raw/hash, and replay comparison are archived." + }, + { + "packet_id": "public_worked_example_source_triage_2026_07_20", + "path": "references/oracle/public_worked_example_source_triage_2026_07_20.json", + "domain": "worked_example_collection", + "claim_status": "source_intake_only", + "consumer_policy": "research_observation_only", + "claim_boundary": "Triage of public KP, Muhurta, and Shadbala source candidates; no source is oracle-ready until raw capture, exact settings, expected values, hash, and replay comparison are archived." } ], "production_tuning_allowed": false, "scope": "evidence_packet_index", "status": "active_index_v1", "summary": { - "packet_count": 82, + "packet_count": 83, "blocked_or_partial_count": 55, "human_review_required_count": 2 } diff --git a/references/oracle/public_worked_example_source_triage_2026_07_20.json b/references/oracle/public_worked_example_source_triage_2026_07_20.json new file mode 100644 index 00000000..8f8f66a6 --- /dev/null +++ b/references/oracle/public_worked_example_source_triage_2026_07_20.json @@ -0,0 +1,123 @@ +{ + "boundary": "Public source triage only. Numeric candidates require raw capture and replay before becoming oracle packets.", + "claim_status": "source_intake_only", + "created_at": "2026-07-20", + "production_tuning_allowed": false, + "scope": "public_worked_example_source_triage", + "sources": [ + { + "claim_boundary": "Source triage only; do not upgrade until raw page capture, exact settings, expected numeric values, hash, and replay comparison are archived.", + "domain": "muhurta_factor_scoring", + "missing_for_oracle": [ + "raw_capture_hash", + "exact_date_selection", + "timezone", + "sunrise", + "formula_weight_contract" + ], + "numeric_fields_present": true, + "observation_hash": "d57a30a4da43bb5ee92f16b6d8e2f6df099854a1cab1a2f95f72efea16dd9671", + "observed_numeric_fields": [ + "tarabalam periods", + "chandrabalam periods", + "nakshatra", + "rasi", + "tithi", + "yoga", + "karana" + ], + "source_id": "mypanchang_edison_2025_panchangam", + "source_role": "numeric_candidate", + "topic": "Tarabala/Chandrabala/Panchangam daily factors", + "upgrade_status": "candidate_not_oracle", + "url": "https://www.mypanchang.com/phppanchang.php?cityhead=&cityname=Edison-NJ&mn=04&monthtype=1&yr=2025" + }, + { + "claim_boundary": "Source triage only; do not upgrade until raw page capture, exact settings, expected numeric values, hash, and replay comparison are archived.", + "domain": "muhurta_factor_scoring", + "missing_for_oracle": [ + "raw_capture_hash", + "sunrise", + "sunset", + "timezone", + "calculation_rule_replay" + ], + "numeric_fields_present": true, + "observation_hash": "a7a4c1f5ba3fe872af645cddab962eba9fe4e0f697eee5d3bfca73951a571a8a", + "observed_numeric_fields": [ + "rahu kalam interval", + "weekday", + "city/date scoped daily table" + ], + "source_id": "drikpanchang_mumbai_rahu_2026_07_20", + "source_role": "numeric_candidate", + "topic": "Rahu Kalam daily interval", + "upgrade_status": "candidate_not_oracle", + "url": "https://www.drikpanchang.com/muhurat/rahu-kalam.html?date=20/07/2026&geoname-id=1275339" + }, + { + "claim_boundary": "Source triage only; do not upgrade until raw page capture, exact settings, expected numeric values, hash, and replay comparison are archived.", + "domain": "muhurta_factor_scoring", + "missing_for_oracle": [ + "birth_moon_nakshatra", + "current_moon_nakshatra", + "worked_numeric_example", + "raw_capture_hash" + ], + "numeric_fields_present": false, + "observation_hash": "26b314e3d7d2fb1dfa91e82e4d92e966a3aa3f43a04f423a9a36c08cf1b0925f", + "observed_numeric_fields": [], + "source_id": "mypanchang_tarabalam_chakra", + "source_role": "formula_reference", + "topic": "Tarabalam/Chandrabalam formula reference", + "upgrade_status": "candidate_not_oracle", + "url": "https://www.mypanchang.com/tarabalam.php" + }, + { + "claim_boundary": "Source triage only; do not upgrade until raw page capture, exact settings, expected numeric values, hash, and replay comparison are archived.", + "domain": "kp_precision_timing", + "missing_for_oracle": [ + "public_birth_or_query_input", + "cusp_longitude", + "star_lord", + "sub_lord", + "sub_sub_lord", + "raw_capture_hash" + ], + "numeric_fields_present": false, + "observation_hash": "bae793bb25145c8f716937c4c4dd575c60307dc1eb0a01f007b452e1907c0705", + "observed_numeric_fields": [], + "source_id": "astrosage_kp_cuspal_sub_lord", + "source_role": "runtime_or_reference_candidate", + "topic": "KP cuspal sub lord calculator/reference", + "upgrade_status": "candidate_not_oracle", + "url": "https://www.astrosage.com/kp/cuspal-sub-lord.asp" + }, + { + "claim_boundary": "Source triage only; do not upgrade until raw page capture, exact settings, expected numeric values, hash, and replay comparison are archived.", + "domain": "shadbala_component_closure", + "missing_for_oracle": [ + "complete_birth_input", + "component_virupa_table", + "method_variant", + "raw_capture_hash" + ], + "numeric_fields_present": false, + "observation_hash": "70f17bcba9f127e2fe46a42c3830abc05acaf250085e796e0e21506fe099d160", + "observed_numeric_fields": [], + "source_id": "astrojyoti_shadbala_formula", + "source_role": "formula_reference", + "topic": "Shadbala formula reference", + "upgrade_status": "candidate_not_oracle", + "url": "https://www.astrojyoti.com/shadbala.htm" + } + ], + "status": "source_triage_ready", + "summary": { + "formula_reference_count": 2, + "numeric_candidate_count": 2, + "oracle_ready_count": 0, + "source_count": 5 + }, + "truth_matrix_allowed": false +} diff --git a/scripts/public_worked_example_source_triage.py b/scripts/public_worked_example_source_triage.py new file mode 100644 index 00000000..890b98dc --- /dev/null +++ b/scripts/public_worked_example_source_triage.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python3 +"""Triage public worked-example sources before numeric oracle capture.""" + +from __future__ import annotations + +import argparse +import hashlib +import json +from pathlib import Path +from typing import Any + + +ROOT = Path(__file__).resolve().parents[1] +OUT = ROOT / "references/oracle/public_worked_example_source_triage_2026_07_20.json" + + +def obs_hash(row: dict[str, Any]) -> str: + payload = json.dumps({k: row[k] for k in sorted(row) if k != "observation_hash"}, sort_keys=True, ensure_ascii=False) + return hashlib.sha256(payload.encode("utf-8")).hexdigest() + + +def source(**row: Any) -> dict[str, Any]: + base = { + "numeric_fields_present": False, + "upgrade_status": "candidate_not_oracle", + "missing_for_oracle": [], + "claim_boundary": "Source triage only; do not upgrade until raw page capture, exact settings, expected numeric values, hash, and replay comparison are archived.", + } + base.update(row) + base["observation_hash"] = obs_hash(base) + return base + + +def build(date: str) -> dict[str, Any]: + rows = [ + source( + source_id="mypanchang_edison_2025_panchangam", + domain="muhurta_factor_scoring", + topic="Tarabala/Chandrabala/Panchangam daily factors", + url="https://www.mypanchang.com/phppanchang.php?cityhead=&cityname=Edison-NJ&mn=04&monthtype=1&yr=2025", + source_role="numeric_candidate", + numeric_fields_present=True, + observed_numeric_fields=["tarabalam periods", "chandrabalam periods", "nakshatra", "rasi", "tithi", "yoga", "karana"], + missing_for_oracle=["raw_capture_hash", "exact_date_selection", "timezone", "sunrise", "formula_weight_contract"], + ), + source( + source_id="drikpanchang_mumbai_rahu_2026_07_20", + domain="muhurta_factor_scoring", + topic="Rahu Kalam daily interval", + url="https://www.drikpanchang.com/muhurat/rahu-kalam.html?date=20/07/2026&geoname-id=1275339", + source_role="numeric_candidate", + numeric_fields_present=True, + observed_numeric_fields=["rahu kalam interval", "weekday", "city/date scoped daily table"], + missing_for_oracle=["raw_capture_hash", "sunrise", "sunset", "timezone", "calculation_rule_replay"], + ), + source( + source_id="mypanchang_tarabalam_chakra", + domain="muhurta_factor_scoring", + topic="Tarabalam/Chandrabalam formula reference", + url="https://www.mypanchang.com/tarabalam.php", + source_role="formula_reference", + numeric_fields_present=False, + observed_numeric_fields=[], + missing_for_oracle=["birth_moon_nakshatra", "current_moon_nakshatra", "worked_numeric_example", "raw_capture_hash"], + ), + source( + source_id="astrosage_kp_cuspal_sub_lord", + domain="kp_precision_timing", + topic="KP cuspal sub lord calculator/reference", + url="https://www.astrosage.com/kp/cuspal-sub-lord.asp", + source_role="runtime_or_reference_candidate", + numeric_fields_present=False, + observed_numeric_fields=[], + missing_for_oracle=["public_birth_or_query_input", "cusp_longitude", "star_lord", "sub_lord", "sub_sub_lord", "raw_capture_hash"], + ), + source( + source_id="astrojyoti_shadbala_formula", + domain="shadbala_component_closure", + topic="Shadbala formula reference", + url="https://www.astrojyoti.com/shadbala.htm", + source_role="formula_reference", + numeric_fields_present=False, + observed_numeric_fields=[], + missing_for_oracle=["complete_birth_input", "component_virupa_table", "method_variant", "raw_capture_hash"], + ), + ] + return { + "scope": "public_worked_example_source_triage", + "created_at": date, + "status": "source_triage_ready", + "claim_status": "source_intake_only", + "production_tuning_allowed": False, + "truth_matrix_allowed": False, + "summary": { + "source_count": len(rows), + "numeric_candidate_count": sum(1 for row in rows if row["numeric_fields_present"]), + "formula_reference_count": sum(1 for row in rows if row["source_role"] == "formula_reference"), + "oracle_ready_count": 0, + }, + "sources": rows, + "boundary": "Public source triage only. Numeric candidates require raw capture and replay before becoming oracle packets.", + } + + +def main() -> int: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--date", default="2026-07-20") + args = parser.parse_args() + print(json.dumps(build(args.date), ensure_ascii=False, indent=2, sort_keys=True)) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tests/test_public_worked_example_source_triage.py b/tests/test_public_worked_example_source_triage.py new file mode 100644 index 00000000..b5db18dc --- /dev/null +++ b/tests/test_public_worked_example_source_triage.py @@ -0,0 +1,43 @@ +import json +import subprocess +from pathlib import Path + + +ROOT = Path(__file__).resolve().parents[1] +ARTIFACT = ROOT / "references" / "oracle" / "public_worked_example_source_triage_2026_07_20.json" +INDEX = ROOT / "references" / "oracle" / "evidence_packet_index_2026_07_19.json" + + +def test_public_worked_example_source_triage_classifies_web_sources(): + data = json.loads( + subprocess.check_output( + ["python3", "scripts/public_worked_example_source_triage.py", "--date", "2026-07-20"], + cwd=ROOT, + text=True, + ) + ) + assert data["scope"] == "public_worked_example_source_triage" + assert data["claim_status"] == "source_intake_only" + assert data["summary"]["source_count"] >= 5 + assert data["summary"]["numeric_candidate_count"] >= 2 + assert data["summary"]["oracle_ready_count"] == 0 + by_id = {row["source_id"]: row for row in data["sources"]} + assert by_id["mypanchang_edison_2025_panchangam"]["numeric_fields_present"] is True + assert by_id["drikpanchang_mumbai_rahu_2026_07_20"]["numeric_fields_present"] is True + assert by_id["mypanchang_tarabalam_chakra"]["source_role"] == "formula_reference" + + +def test_public_worked_example_source_triage_preserves_boundaries_and_hashes(): + data = json.loads(ARTIFACT.read_text(encoding="utf-8")) + assert all(row["observation_hash"] for row in data["sources"]) + assert all(row["upgrade_status"] != "oracle_ready" for row in data["sources"]) + rahu = next(row for row in data["sources"] if row["source_id"] == "drikpanchang_mumbai_rahu_2026_07_20") + assert "sunrise" in rahu["missing_for_oracle"] + assert "raw_capture_hash" in rahu["missing_for_oracle"] + + +def test_public_worked_example_source_triage_is_indexed(): + packets = {row["packet_id"]: row for row in json.loads(INDEX.read_text(encoding="utf-8"))["packets"]} + packet = packets["public_worked_example_source_triage_2026_07_20"] + assert packet["domain"] == "worked_example_collection" + assert packet["claim_status"] == "source_intake_only"