sync: import technique closure packets round 2
This commit is contained in:
@@ -39,6 +39,10 @@ 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")
|
||||
raman_replay = _load(ORACLE / "raman_shadbala_raw_replay_and_input_drift_2026_07_22.json")
|
||||
shadbala_component_queue = _load(ORACLE / "shadbala_component_arbitration_queue_v2_2026_07_22.json")
|
||||
rectification_external_parity = _load(ORACLE / "ul_a7_a10_kp_cusp_three_engine_parity_gap_2026_07_22.json")
|
||||
rectification_same_input_probe = _load(ORACLE / "ul_a7_a10_kp_cusp_same_input_parity_probe_2026_07_22.json")
|
||||
holdout = _load(ROOT / "references/real_case_calibration/day_level_holdout_v3_human_annotation_packet_2026_07_19.json")
|
||||
|
||||
full_scoring = []
|
||||
@@ -85,6 +89,27 @@ def build_report() -> dict[str, Any]:
|
||||
"evidence": full_scoring,
|
||||
"claim_boundary": "KP, Muhurta, advanced Ashtakavarga and advanced compatibility have registries/probes, but full scoring remains blocked or partial.",
|
||||
},
|
||||
{
|
||||
"gate_id": "raman_shadbala_raw_identity",
|
||||
"status": "blocked",
|
||||
"evidence": raman_replay,
|
||||
"claim_boundary": "Raman Shadbala remains blocked because the declared 2026-06-27 stdout is absent and fresh replay proves input-contract drift.",
|
||||
},
|
||||
{
|
||||
"gate_id": "shadbala_component_arbitration",
|
||||
"status": "partial",
|
||||
"evidence": shadbala_component_queue,
|
||||
"claim_boundary": "Only Naisargika is same-unit closed; Chesta, Dig, Drik, Kala and Sthana remain component arbitration items.",
|
||||
},
|
||||
{
|
||||
"gate_id": "rectification_external_parity",
|
||||
"status": "blocked",
|
||||
"evidence": {
|
||||
"gap_packet": rectification_external_parity,
|
||||
"same_input_probe": rectification_same_input_probe,
|
||||
},
|
||||
"claim_boundary": "UL/A7/A10/KP cusp same-input external three-engine parity is not closed, so rectification can use these as local candidate signals only.",
|
||||
},
|
||||
]
|
||||
|
||||
return {
|
||||
@@ -117,6 +142,21 @@ def build_report() -> dict[str, Any]:
|
||||
"blocked_by": ["full_scoring_contracts", "external_numeric_oracle", "independent_negative_holdout"],
|
||||
"target": "KP/Muhurta/AV/compatibility scoring",
|
||||
},
|
||||
{
|
||||
"action": "recapture_or_replace_raman_shadbala_sample",
|
||||
"blocked_by": ["raman_shadbala_raw_identity"],
|
||||
"target": "raw-backed third Shadbala case for D3/Sapta/Sthana audits",
|
||||
},
|
||||
{
|
||||
"action": "arbitrate_shadbala_components",
|
||||
"blocked_by": ["shadbala_component_arbitration", "external_numeric_oracle"],
|
||||
"target": "Chesta mean-motion/retrograde/Seeghrochcha plus Dig/Drik/Kala/Sthana variants",
|
||||
},
|
||||
{
|
||||
"action": "capture_ul_a7_a10_kp_cusp_external_parity",
|
||||
"blocked_by": ["rectification_external_parity"],
|
||||
"target": "same-input UL/A7/A10/KP cusp external raw and field comparison",
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Replay the missing Raman Shadbala raw artifact through installed PyJHora.
|
||||
|
||||
This is a black-box observation runner. It imports the installed `jhora`
|
||||
package, records stdout-like raw values and hashes, and compares them to the
|
||||
pending Raman packet. It does not copy PyJHora implementation code.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
PENDING = ROOT / "references/oracle/artifacts/pending_packets/external_template_synthetic_north_china_shadbala_raman_pyjhora_20260627.json"
|
||||
ARTIFACT = ROOT / "references/oracle/artifacts/pyjhora_synthetic_north_china_shadbala_raman_stdout_20260722.txt"
|
||||
PACKET = ROOT / "references/oracle/raman_shadbala_raw_replay_and_input_drift_2026_07_22.json"
|
||||
PLANETS = ["Sun", "Moon", "Mars", "Mercury", "Jupiter", "Venus", "Saturn"]
|
||||
COMPONENTS = ["sthana", "kala", "dig", "chesta", "naisargika", "drik"]
|
||||
|
||||
|
||||
def _sha256_text(text: str) -> str:
|
||||
return hashlib.sha256(text.encode("utf-8")).hexdigest()
|
||||
|
||||
|
||||
def _round_rupa(raw: list[list[float]]) -> dict[str, dict[str, float]]:
|
||||
out: dict[str, dict[str, float]] = {}
|
||||
for planet_index, planet in enumerate(PLANETS):
|
||||
row = {}
|
||||
for component_index, component in enumerate(COMPONENTS):
|
||||
row[component] = round(float(raw[component_index][planet_index]) / 60.0, 4)
|
||||
row["total_rupa"] = round(float(raw[6][planet_index]) / 60.0, 4)
|
||||
out[planet] = row
|
||||
return out
|
||||
|
||||
|
||||
def _replay_case(case: dict[str, Any]) -> dict[str, Any]:
|
||||
from jhora import utils
|
||||
from jhora.panchanga import drik
|
||||
from jhora.horoscope.chart import strength
|
||||
|
||||
drik.set_ayanamsa_mode("Raman")
|
||||
jd = utils.julian_day_number(
|
||||
(case["year"], case["month"], case["day"]),
|
||||
(case["hour"], case["minute"], case.get("second", 0)),
|
||||
)
|
||||
place = drik.Place(case["label"], case["lat"], case["lon"], case["tz"])
|
||||
raw = strength.shad_bala(jd, place)
|
||||
chesta_new = strength._cheshta_bala_new(jd, place) # black-box call; no implementation copied
|
||||
try:
|
||||
chesta_legacy = strength._cheshta_bala(jd, place)
|
||||
legacy_status = {"status": "ok", "values": chesta_legacy}
|
||||
except Exception as exc: # noqa: BLE001 - artifact should capture exact black-box failure type
|
||||
legacy_status = {"status": "error", "error_type": type(exc).__name__, "error": str(exc)}
|
||||
return {
|
||||
"case": case,
|
||||
"julian_day": jd,
|
||||
"ayanamsa_value": drik.get_ayanamsa_value(jd),
|
||||
"raw_virupa": raw,
|
||||
"component_rupa": _round_rupa(raw),
|
||||
"chesta_new": chesta_new,
|
||||
"chesta_legacy": legacy_status,
|
||||
}
|
||||
|
||||
|
||||
def _diff_against_pending(component_rupa: dict[str, dict[str, float]], pending: dict[str, Any]) -> dict[str, Any]:
|
||||
target = pending["target_placeholders"]["target.shadbala_components"]
|
||||
diffs = []
|
||||
for planet in PLANETS:
|
||||
for component in ["sthana", "dig", "kala", "chesta", "naisargika", "drik", "total_rupa"]:
|
||||
observed = component_rupa[planet][component]
|
||||
expected = target[planet][component]
|
||||
diffs.append({
|
||||
"planet": planet,
|
||||
"component": component,
|
||||
"observed": observed,
|
||||
"pending_expected": expected,
|
||||
"abs_diff": round(abs(observed - expected), 4),
|
||||
})
|
||||
return {
|
||||
"max_abs_diff": max(row["abs_diff"] for row in diffs),
|
||||
"within_0001_count": sum(row["abs_diff"] <= 0.0001 for row in diffs),
|
||||
"row_count": len(diffs),
|
||||
"diffs": diffs,
|
||||
}
|
||||
|
||||
|
||||
def build() -> dict[str, Any]:
|
||||
pending = json.loads(PENDING.read_text(encoding="utf-8"))
|
||||
birth = pending["birth"]
|
||||
cases = [
|
||||
{"label": "declared_packet_coordinates", **birth},
|
||||
{
|
||||
"label": "handan_candidate_coordinates",
|
||||
"year": birth["year"],
|
||||
"month": birth["month"],
|
||||
"day": birth["day"],
|
||||
"hour": birth["hour"],
|
||||
"minute": birth["minute"],
|
||||
"second": birth.get("second", 0),
|
||||
"lat": 36.6,
|
||||
"lon": 114.5,
|
||||
"tz": birth["tz"],
|
||||
},
|
||||
]
|
||||
replays = [_replay_case(case) for case in cases]
|
||||
artifact_body = "\n".join(
|
||||
[
|
||||
"SOURCE_ENV installed jhora black-box import; AGPL implementation not copied",
|
||||
"CAPTURE_DATE 2026-07-22",
|
||||
"PENDING_PACKET references/oracle/artifacts/pending_packets/external_template_synthetic_north_china_shadbala_raman_pyjhora_20260627.json",
|
||||
"NOTE Replays declared packet coordinates and Handan candidate coordinates because existing packet metadata conflicts with case naming/history.",
|
||||
"REPLAY_JSON " + json.dumps(replays, ensure_ascii=False, sort_keys=True),
|
||||
]
|
||||
) + "\n"
|
||||
ARTIFACT.write_text(artifact_body, encoding="utf-8")
|
||||
comparisons = [
|
||||
{
|
||||
"case_label": replay["case"]["label"],
|
||||
"pending_diff": _diff_against_pending(replay["component_rupa"], pending),
|
||||
}
|
||||
for replay in replays
|
||||
]
|
||||
return {
|
||||
"scope": "raman_shadbala_raw_replay_and_input_drift",
|
||||
"created_at": "2026-07-22",
|
||||
"claim_status": "blocked",
|
||||
"truth_matrix_allowed": False,
|
||||
"production_tuning_allowed": False,
|
||||
"pending_packet": str(PENDING.relative_to(ROOT)),
|
||||
"replay_artifact": str(ARTIFACT.relative_to(ROOT)),
|
||||
"replay_artifact_sha256": hashlib.sha256(ARTIFACT.read_bytes()).hexdigest(),
|
||||
"summary": {
|
||||
"replay_case_count": len(replays),
|
||||
"pending_declared_artifact_found": (ROOT / pending["metadata"]["source_artifact"]).exists(),
|
||||
"best_case_label_by_max_diff": min(comparisons, key=lambda row: row["pending_diff"]["max_abs_diff"])["case_label"],
|
||||
"complete_match_count": sum(row["pending_diff"]["max_abs_diff"] <= 0.0001 for row in comparisons),
|
||||
"can_promote_raman_sample": False,
|
||||
},
|
||||
"comparisons": comparisons,
|
||||
"chesta_variant_observation": {
|
||||
"legacy_api_status": replays[0]["chesta_legacy"]["status"],
|
||||
"new_api_present": True,
|
||||
"boundary": "PyJHora exposes at least two Chesta paths; this replay records behavior but does not choose a formula truth.",
|
||||
},
|
||||
"boundary": (
|
||||
"Raman Shadbala sample is not promoted: the declared raw artifact is "
|
||||
"absent and fresh black-box replay does not exactly match the pending "
|
||||
"target values under the declared coordinates. Handan-like coordinates "
|
||||
"are closer, proving an input-contract drift that needs human/source review."
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def main() -> int:
|
||||
packet = build()
|
||||
PACKET.write_text(json.dumps(packet, ensure_ascii=False, indent=2, sort_keys=True) + "\n", encoding="utf-8")
|
||||
print(json.dumps(packet, ensure_ascii=False, indent=2, sort_keys=True))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -0,0 +1,123 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Build Shadbala component arbitration queue v2 from same-unit joined rows."""
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
from collections import Counter, defaultdict
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
JOINED = ROOT / "references/oracle/shadbala_component_joined_closure_packet_2026_07_21.json"
|
||||
OUTPUT = ROOT / "references/oracle/shadbala_component_arbitration_queue_v2_2026_07_22.json"
|
||||
|
||||
|
||||
COMPONENT_POLICY = {
|
||||
"naisargika": {
|
||||
"status": "component_closed_same_unit",
|
||||
"next": "preserve regression coverage; no formula change",
|
||||
},
|
||||
"dig": {
|
||||
"status": "formula_model_arbitration_required",
|
||||
"next": "compare angular-distance, house-midpoint and bhava-madhya models against more raw-backed cases",
|
||||
},
|
||||
"drik": {
|
||||
"status": "aspect_model_arbitration_required",
|
||||
"next": "fix graha drishti/aspect strength scale and benefic-malefic aggregation source",
|
||||
},
|
||||
"kala": {
|
||||
"status": "subcomponent_arbitration_required",
|
||||
"next": "split natonnata, paksha, ayana, day/night and hora subcomponents before tuning",
|
||||
},
|
||||
"sthana": {
|
||||
"status": "saptavarga_dignity_arbitration_required",
|
||||
"next": "resolve Sapta/D3/D4/D7/D12/D30 dignity branches only with raw-backed third case",
|
||||
},
|
||||
"chesta": {
|
||||
"status": "method_variant_arbitration_required",
|
||||
"next": "compare mean-motion, retrograde/stationary and Seeghrochcha variants without copying AGPL code",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def _stable_json(data: Any) -> str:
|
||||
return json.dumps(data, ensure_ascii=False, sort_keys=True, separators=(",", ":"))
|
||||
|
||||
|
||||
def build() -> dict[str, Any]:
|
||||
joined = json.loads(JOINED.read_text(encoding="utf-8"))
|
||||
rows = joined["joined_rows"]
|
||||
by_component: dict[str, list[dict[str, Any]]] = defaultdict(list)
|
||||
for row in rows:
|
||||
by_component[row["component"]].append(row)
|
||||
|
||||
component_rows = []
|
||||
for component in sorted(by_component):
|
||||
component_items = by_component[component]
|
||||
buckets = Counter(row["closure_bucket"] for row in component_items)
|
||||
policy = COMPONENT_POLICY[component]
|
||||
unresolved = sum(
|
||||
count for bucket, count in buckets.items()
|
||||
if bucket not in {"within_tolerance", "component_closed_same_unit"}
|
||||
)
|
||||
component_rows.append({
|
||||
"component": component,
|
||||
"row_count": len(component_items),
|
||||
"closure_bucket_counts": dict(sorted(buckets.items())),
|
||||
"unresolved_row_count": unresolved,
|
||||
"arbitration_status": policy["status"],
|
||||
"next_evidence": policy["next"],
|
||||
"sample_tickets": [row["ticket_id"] for row in component_items[:3]],
|
||||
})
|
||||
|
||||
summary = {
|
||||
"component_count": len(component_rows),
|
||||
"same_unit_row_count": len(rows),
|
||||
"component_closed_count": sum(
|
||||
1 for row in component_rows if row["arbitration_status"] == "component_closed_same_unit"
|
||||
),
|
||||
"arbitration_required_count": sum(
|
||||
1 for row in component_rows if row["arbitration_status"] != "component_closed_same_unit"
|
||||
),
|
||||
"absolute_truth_upgrade_count": 0,
|
||||
}
|
||||
report = {
|
||||
"scope": "shadbala_component_arbitration_queue_v2",
|
||||
"created_at": "2026-07-22",
|
||||
"claim_status": "partial",
|
||||
"truth_matrix_allowed": False,
|
||||
"production_tuning_allowed": False,
|
||||
"source_packet": str(JOINED.relative_to(ROOT)),
|
||||
"source_packet_sha256": hashlib.sha256(JOINED.read_bytes()).hexdigest(),
|
||||
"oss_reference_candidates": [
|
||||
{
|
||||
"id": "dashaflow_shadbala",
|
||||
"path": "references/open_source_sources/dashaflow/shadbala.py",
|
||||
"use": "permissive/reference candidate only",
|
||||
"boundary": "Simplified Chesta/Dig/Saptavarga model; do not treat as numeric oracle truth.",
|
||||
}
|
||||
],
|
||||
"summary": summary,
|
||||
"component_rows": component_rows,
|
||||
"queue_hash": hashlib.sha256(_stable_json(component_rows).encode("utf-8")).hexdigest(),
|
||||
"boundary": (
|
||||
"This queue makes component-level blockers explicit. Naisargika is "
|
||||
"same-unit closed; Dig/Drik/Kala/Sthana/Chesta remain arbitration "
|
||||
"items and do not upgrade absolute Shadbala truth."
|
||||
),
|
||||
}
|
||||
return report
|
||||
|
||||
|
||||
def main() -> int:
|
||||
report = build()
|
||||
rendered = json.dumps(report, ensure_ascii=False, indent=2, sort_keys=True)
|
||||
OUTPUT.write_text(rendered + "\n", encoding="utf-8")
|
||||
print(rendered)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import math
|
||||
import os
|
||||
@@ -35,6 +37,15 @@ def _load_oracle(path: str) -> dict[str, Any]:
|
||||
return oracle_boundary_audit._load_oracle(str(resolved))
|
||||
|
||||
|
||||
def _resolve_path(path: str) -> Path:
|
||||
candidate = Path(path)
|
||||
return candidate if candidate.is_absolute() else ROOT / candidate
|
||||
|
||||
|
||||
def _sha256(path: Path) -> str:
|
||||
return hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
|
||||
|
||||
def _iter_external_verified_template_cases(oracle: dict[str, Any]) -> list[dict[str, Any]]:
|
||||
out: list[dict[str, Any]] = []
|
||||
for case in oracle.get("template_cases", []):
|
||||
@@ -102,6 +113,7 @@ def _best_bhava_madhya_lon(chart: dict[str, Any], planet: str) -> float:
|
||||
def build_report(oracle_file: str) -> dict[str, Any]:
|
||||
oracle = _load_oracle(oracle_file)
|
||||
cases = _iter_external_verified_template_cases(oracle)
|
||||
resolved_oracle = _resolve_path(oracle_file)
|
||||
rows: list[dict[str, Any]] = []
|
||||
model_diffs: dict[str, list[float]] = {name: [] for name in MODEL_NAMES}
|
||||
|
||||
@@ -153,6 +165,22 @@ def build_report(oracle_file: str) -> dict[str, Any]:
|
||||
"scope": "shadbala_dig_source_of_truth_audit",
|
||||
"schema_version": 1,
|
||||
"candidate_models": MODEL_NAMES,
|
||||
"inputs": {
|
||||
"oracle_file": str(resolved_oracle.relative_to(ROOT)),
|
||||
"oracle_file_sha256": _sha256(resolved_oracle),
|
||||
"external_case_count": len(cases),
|
||||
"external_case_sources": [
|
||||
{
|
||||
"case_id": case.get("id") or case.get("case_id"),
|
||||
"source_artifact": case.get("evidence_packet", {}).get("metadata", {}).get("source_artifact", ""),
|
||||
"source_artifact_sha256": _sha256(source_path)
|
||||
if (source_artifact := case.get("evidence_packet", {}).get("metadata", {}).get("source_artifact"))
|
||||
and (source_path := _resolve_path(source_artifact)).exists()
|
||||
else None,
|
||||
}
|
||||
for case in cases
|
||||
],
|
||||
},
|
||||
"summary": {
|
||||
"case_count": len(cases),
|
||||
"row_count": len(rows),
|
||||
@@ -168,8 +196,18 @@ def build_report(oracle_file: str) -> dict[str, Any]:
|
||||
|
||||
|
||||
def main() -> None:
|
||||
report = build_report("references/oracle/dasha_shadbala_oracle_cases.json")
|
||||
print(json.dumps(report, ensure_ascii=False, indent=2))
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument(
|
||||
"--oracle-file",
|
||||
default="references/oracle/dasha_shadbala_oracle_cases.json",
|
||||
)
|
||||
parser.add_argument("--output", help="Optional JSON snapshot path.")
|
||||
args = parser.parse_args()
|
||||
report = build_report(args.oracle_file)
|
||||
rendered = json.dumps(report, ensure_ascii=False, indent=2)
|
||||
if args.output:
|
||||
Path(args.output).write_text(rendered + "\n", encoding="utf-8")
|
||||
print(rendered)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Build same-input parity packet for UL/A7/A10/KP cusp fields.
|
||||
|
||||
The packet deliberately separates local runtime observations from external
|
||||
parity. It does not claim three-engine parity unless each field has enough
|
||||
same-input external raw rows.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
from typing import Any
|
||||
|
||||
from scripts.active_rectification_questions import recast_candidate_layers
|
||||
from scripts.vedicastro_kp_house_cusp_probe import build as build_vedicastro_kp
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
OUTPUT = ROOT / "references/oracle/ul_a7_a10_kp_cusp_same_input_parity_probe_2026_07_22.json"
|
||||
|
||||
|
||||
def stable(data: Any) -> str:
|
||||
return json.dumps(data, ensure_ascii=False, sort_keys=True, separators=(",", ":"), default=str)
|
||||
|
||||
|
||||
def _local_observation(args: argparse.Namespace) -> dict[str, Any]:
|
||||
candidate = datetime(args.year, args.month, args.day, args.hour, args.minute, args.second)
|
||||
recast = recast_candidate_layers(
|
||||
candidate,
|
||||
lat=args.latitude,
|
||||
lon=args.longitude,
|
||||
tz=args.tz_offset,
|
||||
ayanamsa=args.local_ayanamsa,
|
||||
)
|
||||
if not recast:
|
||||
return {"status": "error", "error": "local recast returned null"}
|
||||
arudha = recast.get("arudha") or {}
|
||||
return {
|
||||
"status": "complete",
|
||||
"engine": "local",
|
||||
"fields": {
|
||||
"UL": arudha.get("UL"),
|
||||
"A7": arudha.get("A7"),
|
||||
"A10": arudha.get("A10"),
|
||||
"KP_cusps": recast.get("kp_cusps"),
|
||||
},
|
||||
"raw_hash": hashlib.sha256(stable(recast).encode("utf-8")).hexdigest(),
|
||||
"raw": recast,
|
||||
}
|
||||
|
||||
|
||||
def _vedicastro_observation(args: argparse.Namespace) -> dict[str, Any]:
|
||||
try:
|
||||
payload = build_vedicastro_kp(SimpleNamespace(
|
||||
year=args.year,
|
||||
month=args.month,
|
||||
day=args.day,
|
||||
hour=args.hour,
|
||||
minute=args.minute,
|
||||
second=args.second,
|
||||
latitude=args.latitude,
|
||||
longitude=args.longitude,
|
||||
timezone=args.timezone,
|
||||
ayanamsa=args.kp_ayanamsa,
|
||||
house_system=args.house_system,
|
||||
))
|
||||
return {
|
||||
"status": "complete",
|
||||
"engine": "VedicAstro",
|
||||
"fields": {
|
||||
"KP_cusps": payload.get("raw", {}).get("houses"),
|
||||
},
|
||||
"raw_hash": payload.get("raw_hash"),
|
||||
"schema_fingerprint": payload.get("schema_fingerprint"),
|
||||
"raw": payload.get("raw"),
|
||||
"boundary": payload.get("boundary"),
|
||||
}
|
||||
except Exception as exc: # noqa: BLE001 - packet must capture exact runtime blocker
|
||||
return {
|
||||
"status": "blocked_runtime_error",
|
||||
"engine": "VedicAstro",
|
||||
"error_type": type(exc).__name__,
|
||||
"error": str(exc),
|
||||
}
|
||||
|
||||
|
||||
def build(args: argparse.Namespace) -> dict[str, Any]:
|
||||
request = {
|
||||
"year": args.year,
|
||||
"month": args.month,
|
||||
"day": args.day,
|
||||
"hour": args.hour,
|
||||
"minute": args.minute,
|
||||
"second": args.second,
|
||||
"latitude": args.latitude,
|
||||
"longitude": args.longitude,
|
||||
"timezone": args.timezone,
|
||||
"tz_offset": args.tz_offset,
|
||||
"local_ayanamsa": args.local_ayanamsa,
|
||||
"kp_ayanamsa": args.kp_ayanamsa,
|
||||
"house_system": args.house_system,
|
||||
}
|
||||
observations = [
|
||||
_local_observation(args),
|
||||
_vedicastro_observation(args),
|
||||
{
|
||||
"status": "not_captured",
|
||||
"engine": "PyJHora",
|
||||
"missing_fields": ["UL", "A7", "A10", "KP_cusps"],
|
||||
"boundary": "AGPL black-box capture required; no same-input raw packet exists.",
|
||||
},
|
||||
{
|
||||
"status": "no_field_contract",
|
||||
"engine": "jyotishganit",
|
||||
"missing_fields": ["UL", "A7", "A10", "KP_cusps"],
|
||||
"boundary": "No mapped same-input Arudha/KP cusp field contract exists.",
|
||||
},
|
||||
]
|
||||
field_rows = []
|
||||
for field in ["UL", "A7", "A10", "KP_cusps"]:
|
||||
external_ready = [
|
||||
obs["engine"]
|
||||
for obs in observations
|
||||
if obs["engine"] != "local"
|
||||
and obs["status"] == "complete"
|
||||
and (obs.get("fields") or {}).get(field)
|
||||
]
|
||||
field_rows.append({
|
||||
"field": field,
|
||||
"local_ready": observations[0]["status"] == "complete" and bool((observations[0].get("fields") or {}).get(field)),
|
||||
"external_ready_engines": external_ready,
|
||||
"external_ready_count": len(external_ready),
|
||||
"three_engine_parity_status": "blocked",
|
||||
"claim_boundary": f"{field} remains observation-only until same-input external raw from at least two independent legal sources is captured.",
|
||||
})
|
||||
return {
|
||||
"scope": "ul_a7_a10_kp_cusp_same_input_parity_probe",
|
||||
"created_at": "2026-07-22",
|
||||
"claim_status": "blocked",
|
||||
"truth_matrix_allowed": False,
|
||||
"production_tuning_allowed": False,
|
||||
"request": request,
|
||||
"summary": {
|
||||
"field_count": len(field_rows),
|
||||
"local_ready_count": sum(row["local_ready"] for row in field_rows),
|
||||
"three_engine_parity_ready_count": 0,
|
||||
"external_ready_field_count": sum(row["external_ready_count"] > 0 for row in field_rows),
|
||||
},
|
||||
"observations": observations,
|
||||
"field_rows": field_rows,
|
||||
"packet_hash": hashlib.sha256(stable({"request": request, "field_rows": field_rows}).encode("utf-8")).hexdigest(),
|
||||
"boundary": "Same-input probe only. UL/A7/A10/KP cusp external three-engine parity remains blocked.",
|
||||
}
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--year", type=int, default=1955)
|
||||
parser.add_argument("--month", type=int, default=2)
|
||||
parser.add_argument("--day", type=int, default=24)
|
||||
parser.add_argument("--hour", type=int, default=19)
|
||||
parser.add_argument("--minute", type=int, default=15)
|
||||
parser.add_argument("--second", type=int, default=0)
|
||||
parser.add_argument("--latitude", type=float, default=37.3382)
|
||||
parser.add_argument("--longitude", type=float, default=-122.0383)
|
||||
parser.add_argument("--timezone", default="America/Los_Angeles")
|
||||
parser.add_argument("--tz-offset", type=float, default=-8)
|
||||
parser.add_argument("--local-ayanamsa", default="lahiri")
|
||||
parser.add_argument("--kp-ayanamsa", default="Krishnamurti")
|
||||
parser.add_argument("--house-system", default="Placidus")
|
||||
parser.add_argument("--output", default=str(OUTPUT))
|
||||
args = parser.parse_args()
|
||||
packet = build(args)
|
||||
text = json.dumps(packet, ensure_ascii=False, indent=2, sort_keys=True)
|
||||
Path(args.output).write_text(text + "\n", encoding="utf-8")
|
||||
print(text)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user