feat: sync oracle closure probes
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Append one independent day-level holdout annotation."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--manifest", type=Path, required=True)
|
||||
parser.add_argument("--case-id", required=True)
|
||||
parser.add_argument("--domain", required=True)
|
||||
parser.add_argument("--label", choices=["target_event", "no_target_event"], required=True)
|
||||
parser.add_argument("--start", required=True)
|
||||
parser.add_argument("--end", required=True)
|
||||
parser.add_argument("--source-url", required=True)
|
||||
parser.add_argument("--adjudicator", required=True)
|
||||
parser.add_argument("--event-description", default="")
|
||||
parser.add_argument("--event-absent-assertion", default="")
|
||||
parser.add_argument("--source-quote-or-summary", default="")
|
||||
parser.add_argument("--time-uncertainty-days", type=int, default=0)
|
||||
args = parser.parse_args()
|
||||
|
||||
data = json.loads(args.manifest.read_text(encoding="utf-8"))
|
||||
row = {
|
||||
"case_id": args.case_id,
|
||||
"domain": args.domain,
|
||||
"label": args.label,
|
||||
"start": args.start,
|
||||
"end": args.end,
|
||||
"event_description": args.event_description,
|
||||
"event_absent_assertion": args.event_absent_assertion,
|
||||
"source_url": args.source_url,
|
||||
"source_quote_or_summary": args.source_quote_or_summary,
|
||||
"adjudicator": args.adjudicator,
|
||||
"time_uncertainty_days": args.time_uncertainty_days,
|
||||
"independent_human_reviewed": True,
|
||||
"frozen_before_scoring": True,
|
||||
"source_path": "",
|
||||
"notes": "",
|
||||
}
|
||||
data.setdefault("annotations", []).append(row)
|
||||
data["status"] = "awaiting_independent_labels"
|
||||
data["production_tuning_allowed"] = False
|
||||
args.manifest.write_text(json.dumps(data, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
|
||||
print(json.dumps({"status": "appended", "annotation_count": len(data["annotations"]), "production_tuning_allowed": False}, ensure_ascii=False))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -0,0 +1,130 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Aggregate high-rigor closure gates.
|
||||
|
||||
This script is intentionally conservative: it reports what is blocked or
|
||||
partial from existing governance artifacts. It does not compute predictions.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ORACLE = ROOT / "references/oracle"
|
||||
|
||||
|
||||
def _load(path: Path) -> dict[str, Any]:
|
||||
return json.loads(path.read_text(encoding="utf-8"))
|
||||
|
||||
|
||||
def _gap_items(path: str, domain: str) -> list[dict[str, Any]]:
|
||||
data = _load(ORACLE / path)
|
||||
return [
|
||||
{
|
||||
"domain": domain,
|
||||
"technique_id": item["technique_id"],
|
||||
"local_code_status": item["local_code_status"],
|
||||
"external_oracle_status": item["external_oracle_status"],
|
||||
"commercial_sync_status": item["commercial_sync_status"],
|
||||
"claim_boundary": item["claim_boundary"],
|
||||
}
|
||||
for item in data["items"]
|
||||
]
|
||||
|
||||
|
||||
def build_report() -> dict[str, Any]:
|
||||
kp_contract = _load(ORACLE / "kp_cusp_precision_contract_2026_07_19.json")
|
||||
prashna_packet = _load(ORACLE / "prashna_tajika_saham_gulika_sphuta_oracle_packet_2026_07_19.json")
|
||||
formula_kb = _load(ORACLE / "formula_source_knowledge_base_2026_07_19.json")
|
||||
holdout = _load(ROOT / "references/real_case_calibration/day_level_holdout_v3_human_annotation_packet_2026_07_19.json")
|
||||
|
||||
full_scoring = []
|
||||
full_scoring.extend(_gap_items("kp_precision_timing_gap_registry_2026_07_19.json", "kp_precision_timing"))
|
||||
full_scoring.extend(_gap_items("muhurta_full_system_gap_registry_2026_07_19.json", "muhurta"))
|
||||
full_scoring.extend(_gap_items("ashtakavarga_advanced_usage_gap_registry_2026_07_19.json", "ashtakavarga_advanced_usage"))
|
||||
full_scoring.extend(_gap_items("compatibility_full_system_gap_registry_2026_07_19.json", "compatibility"))
|
||||
|
||||
external_oracle_blockers = [
|
||||
{
|
||||
"artifact": "prashna_tajika_saham_gulika_sphuta_oracle_packet",
|
||||
"status": prashna_packet.get("status"),
|
||||
"claim_boundary": prashna_packet.get("boundary"),
|
||||
},
|
||||
{
|
||||
"artifact": "formula_source_knowledge_base",
|
||||
"status": formula_kb.get("status"),
|
||||
"claim_boundary": formula_kb.get("boundary"),
|
||||
},
|
||||
]
|
||||
|
||||
gates = [
|
||||
{
|
||||
"gate_id": "external_numeric_oracle",
|
||||
"status": "blocked",
|
||||
"evidence": external_oracle_blockers,
|
||||
"claim_boundary": "External numeric worked examples are incomplete for Prashna/Tajika/Saham/Gulika/Sphuta and formula/unit disputed components.",
|
||||
},
|
||||
{
|
||||
"gate_id": "independent_negative_holdout",
|
||||
"status": "blocked",
|
||||
"evidence": holdout,
|
||||
"claim_boundary": "Independent human-labeled negative windows are required before verified day/month timing claims.",
|
||||
},
|
||||
{
|
||||
"gate_id": "kp_exact_cusp",
|
||||
"status": "blocked",
|
||||
"evidence": kp_contract,
|
||||
"claim_boundary": kp_contract["claim_boundary"],
|
||||
},
|
||||
{
|
||||
"gate_id": "full_scoring_contracts",
|
||||
"status": "partial",
|
||||
"evidence": full_scoring,
|
||||
"claim_boundary": "KP, Muhurta, advanced Ashtakavarga and advanced compatibility have registries/probes, but full scoring remains blocked or partial.",
|
||||
},
|
||||
]
|
||||
|
||||
return {
|
||||
"scope": "high_rigor_closure_gate",
|
||||
"created_at": "2026-07-19",
|
||||
"overall_status": "blocked",
|
||||
"production_tuning_allowed": False,
|
||||
"verified_day_month_timing_allowed": False,
|
||||
"birth_time_truth_allowed": False,
|
||||
"commercial_sync_allowed": False,
|
||||
"gates": gates,
|
||||
"next_actions": [
|
||||
{
|
||||
"action": "collect_public_numeric_oracle_packets",
|
||||
"blocked_by": ["external_numeric_oracle"],
|
||||
"target": "Prashna/Tajika/Saham/Gulika/Sphuta and Shadbala/AV disputed components",
|
||||
},
|
||||
{
|
||||
"action": "pre_register_independent_negative_holdout",
|
||||
"blocked_by": ["independent_negative_holdout"],
|
||||
"target": "day/month timing blind ranking",
|
||||
},
|
||||
{
|
||||
"action": "pin_exact_kp_cusp_oracle",
|
||||
"blocked_by": ["kp_exact_cusp"],
|
||||
"target": "KP cusp longitude + star/sub/sub-sub worked example",
|
||||
},
|
||||
{
|
||||
"action": "promote_full_scoring_only_after_oracle",
|
||||
"blocked_by": ["full_scoring_contracts", "external_numeric_oracle", "independent_negative_holdout"],
|
||||
"target": "KP/Muhurta/AV/compatibility scoring",
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
def main() -> int:
|
||||
print(json.dumps(build_report(), ensure_ascii=False, indent=2, sort_keys=True))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Report hash status for the external KP sub-lord division table."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
TABLE = ROOT / "references/open_source_sources/VedicAstro/vedicastro/data/KP_SL_Divisions.csv"
|
||||
|
||||
|
||||
def build_report() -> dict:
|
||||
base = {
|
||||
"scope": "kp_external_table_hash_manifest",
|
||||
"created_at": "2026-07-19",
|
||||
"production_tuning_allowed": False,
|
||||
"table_id": "VedicAstro_KP_SL_Divisions",
|
||||
"expected_path": str(TABLE.relative_to(ROOT)),
|
||||
"source_candidate": "https://github.com/diliprk/VedicAstro",
|
||||
"claim_boundary": "This manifest fixes or blocks the external KP sub/sub-lord table hash; it does not prove exact KP cusp or timing truth.",
|
||||
}
|
||||
if not TABLE.exists():
|
||||
return {
|
||||
**base,
|
||||
"status": "fixture_missing",
|
||||
"claim_status": "blocked_fixture_missing",
|
||||
"sha256": None,
|
||||
"row_count": 0,
|
||||
}
|
||||
raw = TABLE.read_bytes()
|
||||
text = raw.decode("utf-8-sig")
|
||||
rows = [line for line in text.splitlines() if line.strip()]
|
||||
return {
|
||||
**base,
|
||||
"status": "fixed_hash",
|
||||
"claim_status": "oracle_fixture_hash_fixed_not_truth",
|
||||
"sha256": hashlib.sha256(raw).hexdigest(),
|
||||
"row_count": max(0, len(rows) - 1),
|
||||
}
|
||||
|
||||
|
||||
def main() -> int:
|
||||
print(json.dumps(build_report(), ensure_ascii=False, indent=2, sort_keys=True))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -18,6 +18,7 @@ from kp_system import calc_kp_analysis, get_kp_lords
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
KP_CUSP_CONTRACT = ROOT / "references/oracle/kp_cusp_precision_contract_2026_07_19.json"
|
||||
|
||||
|
||||
CANONICAL_PLANETS = {
|
||||
@@ -57,6 +58,22 @@ def _kp_ruling_planets(moment: datetime, asc_longitude: float, moon_longitude: f
|
||||
}
|
||||
|
||||
|
||||
def _kp_cusp_contract_summary() -> dict[str, Any]:
|
||||
if not KP_CUSP_CONTRACT.exists():
|
||||
return {
|
||||
"exact_cusp_status": "blocked_missing_contract",
|
||||
"current_runtime_cusp_mode": "whole_sign_house_center_probe",
|
||||
"significator_policy": "supporting_probe_only",
|
||||
}
|
||||
data = json.loads(KP_CUSP_CONTRACT.read_text(encoding="utf-8"))
|
||||
return {
|
||||
"exact_cusp_status": data.get("exact_cusp_status"),
|
||||
"current_runtime_cusp_mode": data.get("current_runtime_cusp_mode"),
|
||||
"significator_policy": data.get("kp_significator_runtime_policy"),
|
||||
"contract_path": str(KP_CUSP_CONTRACT.relative_to(ROOT)),
|
||||
}
|
||||
|
||||
|
||||
def build_probe() -> dict[str, Any]:
|
||||
raw = calc_kp_analysis(CANONICAL_PLANETS, asc_sign="Aries")
|
||||
ruling_planets = _kp_ruling_planets(CANONICAL_MOMENT, CANONICAL_ASC_LONGITUDE, CANONICAL_MOON_LONGITUDE)
|
||||
@@ -94,6 +111,7 @@ def build_probe() -> dict[str, Any]:
|
||||
},
|
||||
"kp_lords_by_planet": kp_lords_by_planet,
|
||||
"ruling_planets": ruling_planets,
|
||||
"kp_cusp_contract": _kp_cusp_contract_summary(),
|
||||
"planet_significators": planet_significators,
|
||||
"house_significators": house_significators,
|
||||
"raw_sha256": _stable_hash(raw),
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Muhurta factor probe: observation only, no electional verdict."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
from datetime import datetime
|
||||
|
||||
from cmd_muhurta import _get_sun_moon_lons, _weekday_to_vara
|
||||
from muhurta import calc_panchanga, calc_abhijit_muhurta
|
||||
|
||||
|
||||
def _tarabala(birth_moon_nakshatra_index: int | None, current_nakshatra_index: int) -> dict:
|
||||
if birth_moon_nakshatra_index is None:
|
||||
return {"status": "missing_birth_moon_nakshatra", "claim": "not_computed"}
|
||||
tara_pos = ((current_nakshatra_index - birth_moon_nakshatra_index) % 27) + 1
|
||||
tara_class = ((tara_pos - 1) % 9) + 1
|
||||
favorable = tara_class in {2, 4, 6, 8, 9}
|
||||
return {"status": "computed_rule_probe", "tara_position": tara_pos, "tara_class": tara_class, "favorable": favorable}
|
||||
|
||||
|
||||
def _chandrabala(birth_moon_sign_index: int | None, current_moon_lon: float) -> dict:
|
||||
if birth_moon_sign_index is None:
|
||||
return {"status": "missing_birth_moon_sign", "claim": "not_computed"}
|
||||
current_sign = int((current_moon_lon % 360) // 30)
|
||||
relative_house = ((current_sign - birth_moon_sign_index) % 12) + 1
|
||||
favorable = relative_house not in {6, 8, 12}
|
||||
return {"status": "computed_rule_probe", "relative_house": relative_house, "favorable": favorable}
|
||||
|
||||
|
||||
def build_probe(date_text: str, birth_moon_nakshatra_index: int | None, birth_moon_sign_index: int | None) -> dict:
|
||||
dt = datetime.strptime(date_text, "%Y-%m-%d")
|
||||
sun_lon, moon_lon, has_swiss = _get_sun_moon_lons(dt.year, dt.month, dt.day, 12)
|
||||
weekday = _weekday_to_vara(dt.weekday())
|
||||
panchanga = calc_panchanga(sun_lon=sun_lon, moon_lon=moon_lon, weekday=weekday, hour_from_sunrise=6.0)
|
||||
factors = {
|
||||
"panchanga": panchanga,
|
||||
"tarabala": _tarabala(birth_moon_nakshatra_index, panchanga["nakshatra"]["nakshatra_idx"]),
|
||||
"chandrabala": _chandrabala(birth_moon_sign_index, moon_lon),
|
||||
"rahu_kalam": panchanga.get("rahu_kala"),
|
||||
"abhijit_muhurta": calc_abhijit_muhurta(),
|
||||
}
|
||||
signals = []
|
||||
blockers = []
|
||||
if factors["tarabala"].get("favorable") is True:
|
||||
signals.append("Tarabala")
|
||||
elif factors["tarabala"].get("favorable") is False:
|
||||
blockers.append("Tarabala")
|
||||
if factors["chandrabala"].get("favorable") is True:
|
||||
signals.append("Chandrabala")
|
||||
elif factors["chandrabala"].get("favorable") is False:
|
||||
blockers.append("Chandrabala")
|
||||
if factors["abhijit_muhurta"]:
|
||||
signals.append("Abhijit")
|
||||
return {
|
||||
"scope": "muhurta_factor_probe",
|
||||
"created_at": "2026-07-19",
|
||||
"date": date_text,
|
||||
"production_tuning_allowed": False,
|
||||
"claim_status": "exploratory_muhurta_candidate",
|
||||
"verified_muhurta_verdict": False,
|
||||
"full_scoring_status": "blocked_until_oracle",
|
||||
"ephemeris_source": "swisseph" if has_swiss else "approximate_fallback",
|
||||
"factors": factors,
|
||||
"candidate_windows": [
|
||||
{
|
||||
"label": "abhijit_reference_window",
|
||||
"signals": signals,
|
||||
"blockers": blockers,
|
||||
"confidence_cap": "low",
|
||||
"claim_status": "exploratory_muhurta_candidate"
|
||||
}
|
||||
],
|
||||
"boundary": "Muhurta factors are observations only;未通过完整 worked examples 与负样本验证,不能作为确定择日承诺。"
|
||||
}
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--date", required=True)
|
||||
parser.add_argument("--birth-moon-nakshatra-index", type=int)
|
||||
parser.add_argument("--birth-moon-sign-index", type=int)
|
||||
args = parser.parse_args()
|
||||
print(json.dumps(build_probe(args.date, args.birth_moon_nakshatra_index, args.birth_moon_sign_index), ensure_ascii=False, indent=2, sort_keys=True))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user