sync: import runtime closure oracle packets
This commit is contained in:
@@ -0,0 +1,133 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Run a local jyotishganit same-case raw field probe.
|
||||
|
||||
Observation-only: records raw/hash/schema for D2/D4/D9/D10, Panchanga,
|
||||
BAV/SAV and Shadbala availability without promoting truth.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import sys
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
JYOTISHGANIT_ROOT = ROOT / "references/open_source_sources/jyotishganit"
|
||||
TARGET_VARGAS = ["d2", "d4", "d9", "d10"]
|
||||
|
||||
|
||||
def stable_json(data: Any) -> str:
|
||||
return json.dumps(data, ensure_ascii=False, sort_keys=True, separators=(",", ":"), default=str)
|
||||
|
||||
|
||||
def schema_fingerprint(data: Any) -> Any:
|
||||
if isinstance(data, dict):
|
||||
return {k: schema_fingerprint(v) for k, v in sorted(data.items())}
|
||||
if isinstance(data, list):
|
||||
if not data:
|
||||
return []
|
||||
return [schema_fingerprint(data[0])]
|
||||
return type(data).__name__
|
||||
|
||||
|
||||
def sign_table(chart: dict[str, Any]) -> dict[str, Any]:
|
||||
out: dict[str, Any] = {}
|
||||
for code in TARGET_VARGAS:
|
||||
section = chart.get("divisionalCharts", {}).get(code)
|
||||
if not isinstance(section, dict):
|
||||
out[code.upper()] = {"status": "missing"}
|
||||
continue
|
||||
rows = []
|
||||
for house in section.get("houses", []):
|
||||
for occ in house.get("occupants", []):
|
||||
rows.append(
|
||||
{
|
||||
"planet": occ.get("celestialBody"),
|
||||
"sign": occ.get("sign"),
|
||||
"d1HousePlacement": occ.get("d1HousePlacement"),
|
||||
}
|
||||
)
|
||||
out[code.upper()] = {
|
||||
"status": "present",
|
||||
"ascendant_sign": section.get("ascendant", {}).get("sign"),
|
||||
"planet_signs": sorted(rows, key=lambda r: str(r.get("planet"))),
|
||||
}
|
||||
return out
|
||||
|
||||
|
||||
def build_probe(args: argparse.Namespace) -> dict[str, Any]:
|
||||
sys.path.insert(0, str(JYOTISHGANIT_ROOT))
|
||||
from jyotishganit.main import calculate_birth_chart # type: ignore
|
||||
|
||||
dt = datetime.fromisoformat(args.datetime)
|
||||
chart = calculate_birth_chart(dt, args.latitude, args.longitude, args.timezone, args.location, args.name)
|
||||
raw = chart.to_dict()
|
||||
selected = {
|
||||
"panchanga": raw.get("panchanga"),
|
||||
"varga_sign_table": sign_table(raw),
|
||||
"ashtakavarga": raw.get("ashtakavarga"),
|
||||
"shadbala": raw.get("shadbala"),
|
||||
"strengths": raw.get("strengths"),
|
||||
}
|
||||
payload = {
|
||||
"scope": "jyotishganit_field_probe",
|
||||
"created_at": "2026-07-19",
|
||||
"status": "complete",
|
||||
"claim_status": "observation_only",
|
||||
"production_tuning_allowed": False,
|
||||
"truth_matrix_allowed": False,
|
||||
"engine": {
|
||||
"name": "jyotishganit",
|
||||
"local_path": str(JYOTISHGANIT_ROOT.relative_to(ROOT)),
|
||||
},
|
||||
"request": {
|
||||
"name": args.name,
|
||||
"datetime": args.datetime,
|
||||
"latitude": args.latitude,
|
||||
"longitude": args.longitude,
|
||||
"timezone": args.timezone,
|
||||
"location": args.location,
|
||||
},
|
||||
"coverage": {
|
||||
"panchanga": raw.get("panchanga") is not None,
|
||||
"D2": selected["varga_sign_table"]["D2"]["status"] == "present",
|
||||
"D4": selected["varga_sign_table"]["D4"]["status"] == "present",
|
||||
"D9": selected["varga_sign_table"]["D9"]["status"] == "present",
|
||||
"D10": selected["varga_sign_table"]["D10"]["status"] == "present",
|
||||
"BAV_SAV": isinstance(raw.get("ashtakavarga"), dict)
|
||||
and "sav" in raw.get("ashtakavarga", {}),
|
||||
"Shadbala": raw.get("shadbala") is not None or raw.get("strengths") is not None,
|
||||
},
|
||||
"raw_hash": hashlib.sha256(stable_json(raw).encode("utf-8")).hexdigest(),
|
||||
"selected_hash": hashlib.sha256(stable_json(selected).encode("utf-8")).hexdigest(),
|
||||
"schema_fingerprint": schema_fingerprint(selected),
|
||||
"selected_raw": selected,
|
||||
"boundary": "Raw/hash observation only. Missing Shadbala field or matching signs do not prove formula truth or production timing readiness.",
|
||||
}
|
||||
return payload
|
||||
|
||||
|
||||
def main() -> int:
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("--datetime", default="1955-02-24T19:15:00")
|
||||
ap.add_argument("--latitude", type=float, default=37.3382)
|
||||
ap.add_argument("--longitude", type=float, default=-122.0383)
|
||||
ap.add_argument("--timezone", type=float, default=-8.0)
|
||||
ap.add_argument("--location", default="San Francisco, CA")
|
||||
ap.add_argument("--name", default="Steve Jobs public")
|
||||
ap.add_argument("--output")
|
||||
args = ap.parse_args()
|
||||
payload = build_probe(args)
|
||||
text = json.dumps(payload, ensure_ascii=False, indent=2, sort_keys=True)
|
||||
if args.output:
|
||||
Path(args.output).write_text(text + "\n", encoding="utf-8")
|
||||
print(text)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Classify local vs jyotishganit comparison mismatches without resolving truth."""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
DEFAULT = ROOT / "references/oracle/jyotishganit_vs_local_field_comparison_steve_jobs_2026_07_19.json"
|
||||
|
||||
|
||||
def classify(row: dict) -> dict:
|
||||
section = row["section"]
|
||||
body = row["body"]
|
||||
reason = "needs_formula_variant_review"
|
||||
owner = "varga_formula_attribution"
|
||||
if section == "D4":
|
||||
reason = "schema_alias_or_formula_variant"
|
||||
owner = "D4_Turyamsa_Chaturthamsa_alias_and_formula"
|
||||
if section == "D10" and body in {"Rahu", "Ketu"}:
|
||||
reason = "node_mode_or_shadow_planet_handling"
|
||||
owner = "node_mode_mapping"
|
||||
return {
|
||||
**row,
|
||||
"attribution_status": "queued",
|
||||
"probable_reason": reason,
|
||||
"next_evidence_owner": owner,
|
||||
"claim_boundary": "Do not tune local formula to jyotishganit until source formula, ayanamsa, node mode, and schema aliases are pinned.",
|
||||
}
|
||||
|
||||
|
||||
def build(path: Path = DEFAULT) -> dict:
|
||||
data = json.loads(path.read_text(encoding="utf-8"))
|
||||
mismatches = [classify(r) for r in data["rows"] if r["status"] == "mismatch"]
|
||||
return {
|
||||
"scope": "jyotishganit_mismatch_attribution_queue",
|
||||
"created_at": "2026-07-19",
|
||||
"status": "queue_ready",
|
||||
"claim_status": "partial",
|
||||
"production_tuning_allowed": False,
|
||||
"truth_matrix_allowed": False,
|
||||
"source_comparison": str(path.relative_to(ROOT)),
|
||||
"summary": {
|
||||
"mismatch_count": len(mismatches),
|
||||
"by_reason": {
|
||||
reason: sum(1 for r in mismatches if r["probable_reason"] == reason)
|
||||
for reason in sorted({r["probable_reason"] for r in mismatches})
|
||||
},
|
||||
},
|
||||
"rows": mismatches,
|
||||
"boundary": "This queue classifies mismatch work; it does not settle formula truth.",
|
||||
}
|
||||
|
||||
|
||||
def main() -> int:
|
||||
print(json.dumps(build(), ensure_ascii=False, indent=2, sort_keys=True))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -0,0 +1,116 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Prepare an isolated temporary dependency path for VedicAstro KP probes.
|
||||
|
||||
Installs only under /tmp/vedicastro_flatlib_probe. Never mutates project
|
||||
requirements, venvs, package-locks, or runtime dependencies.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import importlib.metadata
|
||||
import json
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
|
||||
TARGET = Path("/tmp/vedicastro_flatlib_probe")
|
||||
REQUIRED_PACKAGES = {
|
||||
"flatlib": "git+https://github.com/diliprk/flatlib.git@sidereal#egg=flatlib",
|
||||
"polars": "polars",
|
||||
"timezonefinder": "timezonefinder",
|
||||
"pyswisseph": "pyswisseph",
|
||||
}
|
||||
|
||||
|
||||
def stable(data: Any) -> str:
|
||||
return json.dumps(data, ensure_ascii=False, sort_keys=True, separators=(",", ":"), default=str)
|
||||
|
||||
|
||||
def digest_tree(path: Path) -> str | None:
|
||||
if not path.exists():
|
||||
return None
|
||||
h = hashlib.sha256()
|
||||
for file in sorted(p for p in path.rglob("*") if p.is_file()):
|
||||
rel = file.relative_to(path).as_posix()
|
||||
h.update(rel.encode("utf-8"))
|
||||
try:
|
||||
h.update(file.read_bytes())
|
||||
except OSError:
|
||||
continue
|
||||
return h.hexdigest()
|
||||
|
||||
|
||||
def package_versions(target: Path) -> dict[str, str | None]:
|
||||
sys.path.insert(0, str(target))
|
||||
versions: dict[str, str | None] = {}
|
||||
for name in REQUIRED_PACKAGES:
|
||||
try:
|
||||
versions[name] = importlib.metadata.version(name)
|
||||
except importlib.metadata.PackageNotFoundError:
|
||||
versions[name] = None
|
||||
return versions
|
||||
|
||||
|
||||
def install(target: Path) -> dict[str, Any]:
|
||||
target.mkdir(parents=True, exist_ok=True)
|
||||
cmd = [
|
||||
sys.executable,
|
||||
"-m",
|
||||
"pip",
|
||||
"install",
|
||||
"--upgrade",
|
||||
"--target",
|
||||
str(target),
|
||||
*REQUIRED_PACKAGES.values(),
|
||||
]
|
||||
proc = subprocess.run(cmd, text=True, capture_output=True, timeout=180)
|
||||
return {
|
||||
"command": cmd,
|
||||
"returncode": proc.returncode,
|
||||
"stdout_tail": proc.stdout[-4000:],
|
||||
"stderr_tail": proc.stderr[-4000:],
|
||||
}
|
||||
|
||||
|
||||
def build_payload(target: Path, install_result: dict[str, Any] | None = None) -> dict[str, Any]:
|
||||
versions = package_versions(target) if target.exists() else {name: None for name in REQUIRED_PACKAGES}
|
||||
ready = all(versions.values())
|
||||
payload: dict[str, Any] = {
|
||||
"scope": "vedicastro_kp_tmp_env_preparer",
|
||||
"created_at": "2026-07-21",
|
||||
"target": str(target),
|
||||
"project_dependency_mutation_allowed": False,
|
||||
"required_packages": REQUIRED_PACKAGES,
|
||||
"package_versions": versions,
|
||||
"target_tree_hash": digest_tree(target),
|
||||
"claim_status": "runtime_dependency_ready" if ready else "blocked_runtime_dependency",
|
||||
"production_tuning_allowed": False,
|
||||
"truth_matrix_allowed": False,
|
||||
"boundary": "dependency_preparation_only_no_kp_oracle_truth",
|
||||
}
|
||||
if install_result is not None:
|
||||
payload["install_result"] = install_result
|
||||
return payload
|
||||
|
||||
|
||||
def main() -> int:
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("--target", default=str(TARGET))
|
||||
ap.add_argument("--report-only", action="store_true")
|
||||
ap.add_argument("--clean", action="store_true")
|
||||
args = ap.parse_args()
|
||||
target = Path(args.target)
|
||||
if args.clean and target.exists() and str(target).startswith("/tmp/"):
|
||||
shutil.rmtree(target)
|
||||
install_result = None if args.report_only else install(target)
|
||||
payload = build_payload(target, install_result)
|
||||
print(json.dumps(payload, ensure_ascii=False, indent=2, sort_keys=True))
|
||||
return 0 if args.report_only or payload["claim_status"] == "runtime_dependency_ready" else 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -0,0 +1,108 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Audit KP/Gochara/Muhurta/Panchanga fragments and runtime entrypoints."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def _text(path: Path) -> str:
|
||||
return path.read_text(encoding="utf-8", errors="ignore") if path.exists() else ""
|
||||
|
||||
|
||||
def build_audit(root: Path) -> dict:
|
||||
api = _text(root / "scripts/jyotish_api_server.py")
|
||||
research_main_js = _text(root / "jyotish-app/main.js")
|
||||
commercial_page = _text(root / "frontend/src/app/page.tsx")
|
||||
dashaflow_muhurtha = root / "references/open_source_sources/dashaflow/muhurtha.py"
|
||||
panchanga_license = _text(root / "references/open_source_sources/panchanga_api/LICENSE").splitlines()
|
||||
kp_reference = root / "/Users/wuyongnaren/.workbuddy/backups/jyotish-vedic-astrology-20260711-154109/references/kp-astrology-complete-system.md"
|
||||
gochara_template = Path("/tmp/jyotisha-optimize/assets/event_timing_template.md")
|
||||
panchanga_called = (
|
||||
"/api/panchanga_range" in api
|
||||
and (
|
||||
("panchanga-range" in research_main_js and "panchanga-csv" in research_main_js)
|
||||
or ("panchanga-range" in commercial_page and "panchanga-csv" in commercial_page)
|
||||
)
|
||||
)
|
||||
|
||||
items = [
|
||||
{
|
||||
"technique_id": "panchanga_calendar",
|
||||
"current_call_status": "formally_called_in_api_and_web" if panchanga_called else "partial",
|
||||
"main_artifacts": [
|
||||
"scripts/jyotish_api_server.py",
|
||||
"frontend/src/app/page.tsx",
|
||||
"jyotish-app/main.js (research static UI only, absent in commercial repo)",
|
||||
],
|
||||
"external_or_reference_artifacts": ["references/open_source_sources/panchanga_api"],
|
||||
"reuse_decision": "do_not_duplicate_runtime",
|
||||
"source_or_license_boundary": "Existing runtime/UI present; panchanga_api license observed as "
|
||||
+ (panchanga_license[0] if panchanga_license else "unknown")
|
||||
+ ". Treat external panchanga_api as reference unless license/API contract is separately audited.",
|
||||
"next_action": "add panchanga claim/display contract and source/oracle packet for tithi/nakshatra/yoga/karana/rahu-kalam outputs",
|
||||
"claim_boundary": "Panchanga is runtime-visible but still needs field-level external oracle examples for high-rigor claims.",
|
||||
},
|
||||
{
|
||||
"technique_id": "muhurta_dashaflow_candidate",
|
||||
"current_call_status": "oss_reference_not_main_runtime",
|
||||
"main_artifacts": [],
|
||||
"external_or_reference_artifacts": [str(dashaflow_muhurtha)],
|
||||
"reuse_decision": "license_audit_before_reuse",
|
||||
"source_or_license_boundary": "dashaflow/muhurtha.py exists under references/open_source_sources; verify license and formula sources before adapting.",
|
||||
"next_action": "audit dashaflow license, extract formula surface, then compare Tarabala/Chandrabala/Rahu Kalam against local Panchanga.",
|
||||
"claim_boundary": "Muhurta remains reference-only until license, formula, and worked examples close.",
|
||||
},
|
||||
{
|
||||
"technique_id": "kp_astrology",
|
||||
"current_call_status": "reference_only_not_main_runtime",
|
||||
"main_artifacts": [],
|
||||
"external_or_reference_artifacts": [str(kp_reference)],
|
||||
"reuse_decision": "reference_only",
|
||||
"source_or_license_boundary": "KP backup/reference may contain useful notes but must pass privacy/license/source audit; do not copy blindly.",
|
||||
"next_action": "create KP separate track: cusp system, ayanamsa, star lord/sub lord, ruling planets, public oracle examples.",
|
||||
"claim_boundary": "KP is not part of current main Jyotish runtime truth.",
|
||||
},
|
||||
{
|
||||
"technique_id": "gochara_event_timing_template",
|
||||
"current_call_status": "template_reference_not_main_runtime",
|
||||
"main_artifacts": [],
|
||||
"external_or_reference_artifacts": [str(gochara_template)],
|
||||
"reuse_decision": "reference_only",
|
||||
"source_or_license_boundary": "Template in /tmp must be privacy/source reviewed before promotion.",
|
||||
"next_action": "turn Gochara template into scoring contract only after Dasha+Varga+Transit features and negative holdout are ready.",
|
||||
"claim_boundary": "Transit template is not a calibrated timing engine.",
|
||||
},
|
||||
]
|
||||
return {
|
||||
"scope": "technique_promotion_audit_kp_gochara_muhurta",
|
||||
"created_at": "2026-07-19",
|
||||
"truth_policy": "runtime_presence_not_oracle_closure",
|
||||
"production_tuning_allowed": False,
|
||||
"summary": {
|
||||
"items_checked": len(items),
|
||||
"formally_called_count": sum("formally_called" in item["current_call_status"] for item in items),
|
||||
"reference_only_count": sum("not_main_runtime" in item["current_call_status"] or "template_reference" in item["current_call_status"] for item in items),
|
||||
},
|
||||
"items": items,
|
||||
}
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--root", type=Path, default=Path("."))
|
||||
parser.add_argument("--output", type=Path)
|
||||
args = parser.parse_args()
|
||||
audit = build_audit(args.root)
|
||||
text = json.dumps(audit, ensure_ascii=False, indent=2, sort_keys=True) + "\n"
|
||||
if args.output:
|
||||
args.output.parent.mkdir(parents=True, exist_ok=True)
|
||||
args.output.write_text(text, encoding="utf-8")
|
||||
print(text, end="")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -13,9 +13,6 @@ from typing import Any
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
SCRIPTS = ROOT / "scripts"
|
||||
if str(SCRIPTS) not in sys.path:
|
||||
sys.path.insert(0, str(SCRIPTS))
|
||||
|
||||
from benchmarks.jyotish.scripts.run_pyjhora_compare import build_pyjhora_sample
|
||||
from benchmarks.jyotish.scripts.run_skill_baseline import run_sample
|
||||
|
||||
@@ -82,16 +82,52 @@ def arbitrate_manifest(path: str | Path) -> dict[str, Any]:
|
||||
}
|
||||
|
||||
|
||||
def render_markdown_report(report: dict[str, Any]) -> str:
|
||||
lines = [
|
||||
"# Three-engine mismatch arbitration",
|
||||
"",
|
||||
f"manifest: `{report['manifest_path']}`",
|
||||
f"status: `{report['status']}`",
|
||||
f"truth_policy: `{report['truth_policy']}`",
|
||||
"commercial_sync: `status_and_claim_boundary_only`",
|
||||
f"mismatch_count: `{report['mismatch_count']}`",
|
||||
f"classified_count: `{report['classified_count']}`",
|
||||
f"unclassified_count: `{report['unclassified_count']}`",
|
||||
"",
|
||||
"Do not copy raw research debt into commercial runtime. Commercial receives readiness, claim boundary, and user-safe status only.",
|
||||
"",
|
||||
"## Category counts",
|
||||
"",
|
||||
"| category | count |",
|
||||
"|---|---:|",
|
||||
]
|
||||
for category, count in report["category_counts"].items():
|
||||
lines.append(f"| `{category}` | {count} |")
|
||||
lines.extend(["", "## Closure requirements", ""])
|
||||
seen: set[str] = set()
|
||||
for row in report["rows"]:
|
||||
category = row["category"]
|
||||
if category in seen:
|
||||
continue
|
||||
seen.add(category)
|
||||
lines.append(f"- `{category}`: {row['closure_requirement']}")
|
||||
return "\n".join(lines) + "\n"
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("manifest", nargs="?", default="references/oracle/three_engine_parity_replay_manifest.json")
|
||||
parser.add_argument("--output", type=Path)
|
||||
parser.add_argument("--markdown-output", type=Path)
|
||||
args = parser.parse_args()
|
||||
report = arbitrate_manifest(args.manifest)
|
||||
text = json.dumps(report, ensure_ascii=False, indent=2, sort_keys=True) + "\n"
|
||||
if args.output:
|
||||
args.output.parent.mkdir(parents=True, exist_ok=True)
|
||||
args.output.write_text(text, encoding="utf-8")
|
||||
if args.markdown_output:
|
||||
args.markdown_output.parent.mkdir(parents=True, exist_ok=True)
|
||||
args.markdown_output.write_text(render_markdown_report(report), encoding="utf-8")
|
||||
print(text, end="")
|
||||
return 0
|
||||
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Create actionable closure tickets for three-engine mismatch rows."""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
from collections import Counter
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
|
||||
POLICY = {
|
||||
"endpoint_or_varga_semantics": ("P0", "endpoint_contract", "identified endpoint/method contract with ayanamsa, node mode, varga, timezone semantics"),
|
||||
"shadbala_formula_variant": ("P0", "formula_source", "public formula source + unit/cap/floor evidence for the component"),
|
||||
"derived_total_from_component_variants": ("P1", "unit_schema", "component closure before total recomputation; explicit Rupa/Virupa total rule"),
|
||||
"ashtakavarga_table_or_contributor_variant": ("P1", "worked_example", "public worked BAV/SAV table with contributor set, shodhana state, and Lagna inclusion"),
|
||||
}
|
||||
|
||||
|
||||
def build_queue(arbitration_path: str | Path) -> dict[str, Any]:
|
||||
path = Path(arbitration_path)
|
||||
report = json.loads(path.read_text(encoding="utf-8"))
|
||||
tickets = []
|
||||
for index, row in enumerate(report.get("rows") or [], start=1):
|
||||
priority, owner_track, required = POLICY.get(
|
||||
row["category"],
|
||||
("P2", "worked_example", "manual source review and worked example required"),
|
||||
)
|
||||
tickets.append({
|
||||
"ticket_id": f"TEMCQ-{index:03d}",
|
||||
"priority": priority,
|
||||
"owner_track": owner_track,
|
||||
"section": row.get("section"),
|
||||
"field": row.get("field"),
|
||||
"category": row.get("category"),
|
||||
"differing_engines": row.get("differing_engines") or [],
|
||||
"required_evidence": required,
|
||||
"closure_status": "open",
|
||||
"commercial_visibility": "do_not_expose_raw",
|
||||
})
|
||||
return {
|
||||
"scope": "three_engine_mismatch_closure_queue",
|
||||
"source_arbitration": str(path),
|
||||
"status": "open" if tickets else "empty",
|
||||
"truth_policy": "no_majority_vote",
|
||||
"production_tuning_allowed": False,
|
||||
"summary": {
|
||||
"source_mismatch_count": report.get("mismatch_count", 0),
|
||||
"queue_count": len(tickets),
|
||||
"priority_counts": dict(Counter(ticket["priority"] for ticket in tickets)),
|
||||
"owner_track_counts": dict(Counter(ticket["owner_track"] for ticket in tickets)),
|
||||
},
|
||||
"queue": tickets,
|
||||
}
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("arbitration", nargs="?", default="references/oracle/three_engine_mismatch_arbitration_2026_07_19.json")
|
||||
parser.add_argument("--output", type=Path)
|
||||
args = parser.parse_args()
|
||||
queue = build_queue(args.arbitration)
|
||||
text = json.dumps(queue, ensure_ascii=False, indent=2, sort_keys=True) + "\n"
|
||||
if args.output:
|
||||
args.output.parent.mkdir(parents=True, exist_ok=True)
|
||||
args.output.write_text(text, encoding="utf-8")
|
||||
print(text, end="")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user