sync: import closure and audit queue utilities

This commit is contained in:
732642856
2026-07-21 19:21:02 +08:00
parent c9ef2ee093
commit 508e499bce
11 changed files with 738 additions and 1 deletions
@@ -5,7 +5,7 @@
"production_tuning_allowed": false,
"boundary": "Index of current governance packets only. Raw oracle artifacts remain in references/oracle/artifacts and are not all duplicated here.",
"summary": {
"packet_count": 121,
"packet_count": 122,
"blocked_or_partial_count": 52,
"human_review_required_count": 3
},
@@ -977,6 +977,14 @@
"claim_status": "open_queue",
"consumer_policy": "research_observation_only",
"claim_boundary": "Triage ledger for stale WorkBuddy candidate fragments only; no runtime truth, no bulk-copy permission, and no commercial technique upgrade until each entry is separately reviewed."
},
{
"packet_id": "workbuddy_round4_candidate_ledger_2026_07_21",
"path": "references/oracle/workbuddy_round4_candidate_ledger_2026_07_21.json",
"domain": "fragment_migration",
"claim_status": "open_queue",
"consumer_policy": "research_observation_only",
"claim_boundary": "Round4 triage confirms round3 was non-exhaustive: 858 unindexed WorkBuddy filename-signal files were detected and 20 high-value candidates were classified; no truth upgrade or bulk-copy permission."
}
]
}
@@ -0,0 +1,230 @@
{
"scope": "WorkBuddy round4 candidate ledger after round3 was found non-exhaustive",
"created_at": "2026-07-21",
"source_roots": [
"/Users/wuyongnaren/WorkBuddy",
"/Users/wuyongnaren/.workbuddy"
],
"claim_status": "fragment_audit_only",
"status": "partial_non_exhaustive",
"summary": {
"round3_indexed_entries": 30,
"unindexed_filename_signal_total": 858,
"round4_entries": 20,
"decisions": {
"migrate_to_registry": 8,
"migrate_to_test": 4,
"reference_only": 6,
"forbidden_private_or_obsolete": 2
}
},
"allowed_decisions": [
"migrate_to_registry",
"migrate_to_test",
"reference_only",
"forbidden_private_or_obsolete"
],
"entries": [
{
"candidate_id": "wb_round4_sahams_execution_guide",
"domain": "tajika_saham",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/sahams-execution-guide.md",
"sha256": "0848ee1bb946cd81a034f6fe1025d599b7ff78631f016297a9cf35bb08db90ce",
"size_bytes": 1867,
"current_repo_same_name": "references/sahams-execution-guide.md",
"decision": "reference_only",
"reason": "Already present in the research repo by filename; use only as duplicate/supersession evidence unless runtime invocation is separately proven."
},
{
"candidate_id": "wb_round4_varga_system_quick_reference",
"domain": "varga",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/varga-system-quick-reference.md",
"sha256": "3b9503b5c5e6651226ace1770b8021b7e33744737cdd150d66da2c1f476cc3a6",
"size_bytes": 10468,
"current_repo_same_name": "references/varga-system-quick-reference.md",
"decision": "reference_only",
"reason": "Already present in research references; next step is invocation audit, not content copying."
},
{
"candidate_id": "wb_round4_varga_divisional_quick_reference",
"domain": "varga",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/varga-divisional-charts-quick-reference.md",
"sha256": "081814f256677cf12cc91a44d83e6ac7f587cb83fa8276d8815f517e8d93d5bf",
"size_bytes": 14961,
"current_repo_same_name": "references/varga-divisional-charts-quick-reference.md",
"decision": "reference_only",
"reason": "Already present in research references; keep as duplicate candidate until D1-D60 invocation audit closes."
},
{
"candidate_id": "wb_round4_ashtakavarga_complete_system",
"domain": "ashtakavarga",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/ashtakavarga-complete-system.md",
"sha256": "a37203762fbe4e2ecf358abb6104d0ee9ef07ca542d6d10ca6060133f657c574",
"size_bytes": 8651,
"current_repo_same_name": "references/ashtakavarga-complete-system.md",
"decision": "reference_only",
"reason": "Already present; high-level reference cannot upgrade AV component truth without numeric oracle packets."
},
{
"candidate_id": "wb_round4_dasha_shadbala_oracle_cases",
"domain": "shadbala_oracle",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/oracle/dasha_shadbala_oracle_cases.json",
"sha256": "0e08fa9d593f89ac5762d6b2952f93a17f5e831ad556aea365cce9dfa601794d",
"size_bytes": 21415,
"current_repo_same_name": "references/oracle/dasha_shadbala_oracle_cases.json",
"decision": "reference_only",
"reason": "Already present; use only through existing oracle validators."
},
{
"candidate_id": "wb_round4_tajika_annual_oracle_cases",
"domain": "tajika_oracle",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/oracle/tajika_annual_oracle_cases.json",
"sha256": "b28c320134357f54e6a42248f6ce8d49dfd773475c55f39d09f57f48f51aa3db",
"size_bytes": 21232,
"current_repo_same_name": "references/oracle/tajika_annual_oracle_cases.json",
"decision": "reference_only",
"reason": "Already present; no new migration until numeric field validation is rerun."
},
{
"candidate_id": "wb_round4_event_judgment_examples",
"domain": "event_judgment",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/event_judgment_examples.md",
"sha256": "2e4d8c630dc7faf299089fdf9a029448ed85b6ffadbd7cb4820409d3a5ff5447",
"size_bytes": 2525,
"current_repo_same_name": "references/event_judgment_examples.md",
"decision": "migrate_to_registry",
"reason": "Already present as reference, but not proven as a formal rule-family registry."
},
{
"candidate_id": "wb_round4_birth_time_rectification_cases",
"domain": "birth_time_rectification",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/birth-time-rectification-cases.md",
"sha256": "40a6e856672a275c91e09a4aa7ae776f37696fcdff31dc34f3b00c3766b62793",
"size_bytes": 11540,
"current_repo_same_name": "references/birth-time-rectification-cases.md",
"decision": "migrate_to_test",
"reason": "Useful for local UI journey and claim-boundary tests; do not use as truth labels without public provenance."
},
{
"candidate_id": "wb_round4_birth_time_rectification_advanced",
"domain": "birth_time_rectification",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/birth-time-rectification-advanced.md",
"sha256": "da25c979a94945d2990ad78b7ccc95bd0609e1458643382734fb920617182083",
"size_bytes": 13581,
"current_repo_same_name": "references/birth-time-rectification-advanced.md",
"decision": "migrate_to_registry",
"reason": "Needs rule-family registry extraction for rectification techniques; no bulk copy."
},
{
"candidate_id": "wb_round4_event_judgment_career",
"domain": "event_judgment",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/event_judgment_career.md",
"sha256": "16ad9e0e832b83f0610c4790ef558d807f44031d59d647da225adda80868d22b",
"size_bytes": 4334,
"current_repo_same_name": "references/event_judgment_career.md",
"decision": "migrate_to_registry",
"reason": "Candidate for event judgment rule-family registry, especially career domain."
},
{
"candidate_id": "wb_round4_event_judgment_wealth",
"domain": "event_judgment",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/event_judgment_wealth.md",
"sha256": "e690fa3d753a169dc50bb7773a687e4aa71d267cd82f536ea6096afe2fda9218",
"size_bytes": 5440,
"current_repo_same_name": "references/event_judgment_wealth.md",
"decision": "migrate_to_registry",
"reason": "Candidate for event judgment rule-family registry, especially wealth domain."
},
{
"candidate_id": "wb_round4_event_judgment_skeleton",
"domain": "event_judgment",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/event_judgment_skeleton.md",
"sha256": "8c627aea6cb00a9c067f2bab0b2080cd229ba5ab498daf4dc728ec21cbd2755f",
"size_bytes": 4535,
"current_repo_same_name": "references/event_judgment_skeleton.md",
"decision": "migrate_to_registry",
"reason": "Candidate skeleton for normalizing event-judgment registry fields."
},
{
"candidate_id": "wb_round4_kp_practical_event_timing",
"domain": "kp_precision_timing",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/kp-practical-event-timing.md",
"sha256": "9525d289288da13b94aa16299ffa2de902f702d236f4433af291ebe29336586b",
"size_bytes": 303,
"current_repo_same_name": "references/kp-practical-event-timing.md",
"decision": "migrate_to_registry",
"reason": "Small KP timing note; useful only as a registry pointer, not as oracle."
},
{
"candidate_id": "wb_round4_muhurta_complete_guide",
"domain": "muhurta",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/muhurta-complete-guide.md",
"sha256": "77caf0180f1d054b218433e5e57b9e0f2c8da17c9188cc56b4911737ffb3b3d0",
"size_bytes": 1348,
"current_repo_same_name": "references/muhurta-complete-guide.md",
"decision": "migrate_to_registry",
"reason": "Candidate for Muhurta factor registry; not enough for verdict scoring."
},
{
"candidate_id": "wb_round4_tajika_yoga_complete_guide",
"domain": "tajika_saham",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/tajika-yoga-complete-guide.md",
"sha256": "8054b0752da77d1e101551f982b5c7d8d8a5d9cffe449a3c171eff87332c8e58",
"size_bytes": 11850,
"current_repo_same_name": "references/tajika-yoga-complete-guide.md",
"decision": "migrate_to_registry",
"reason": "Candidate for Tajika yoga registry and annual chart claim-boundary mapping."
},
{
"candidate_id": "wb_round4_saham_rules",
"domain": "tajika_saham",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/saham_rules.json",
"sha256": "374f5725212742f331199351b77121235c08b266798f0528f9e5f040558a0848",
"size_bytes": 2065,
"current_repo_same_name": "references/saham_rules.json",
"decision": "migrate_to_test",
"reason": "Use for formula schema tests after public numeric oracle packets are attached."
},
{
"candidate_id": "wb_round4_user_1993_shadbala_pending_packet",
"domain": "shadbala_private",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/oracle/artifacts/pending_packets/external_template_user_1993_shadbala_lahiri_pyjhora_20260627.json",
"sha256": "841bd71a78fb4d0ca6b0eba800eaddc9cbee8bd9cbadd60cc4357bcc5b91e21a",
"size_bytes": 3275,
"current_repo_same_name": null,
"decision": "forbidden_private_or_obsolete",
"reason": "Private/person-specific pending packet; not for truth source, commercial claim, or public release."
},
{
"candidate_id": "wb_round4_handan_shadbala_pending_packet",
"domain": "shadbala_private",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/oracle/artifacts/pending_packets/external_template_handan_shadbala_raman.json",
"sha256": "2163eeecb9aef353d39c42ae6b02f2bf45cf1df758c6399a8feaf1c1bb0896b0",
"size_bytes": 2563,
"current_repo_same_name": null,
"decision": "forbidden_private_or_obsolete",
"reason": "Private/source-insufficient pending packet; keep quarantined."
},
{
"candidate_id": "wb_round4_pyjhora_steve_jobs_shadbala_stdout",
"domain": "shadbala_oracle",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/oracle/artifacts/pyjhora_steve_jobs_shadbala_lahiri_stdout_20260627.txt",
"sha256": "2b8c5c76a4a369ff066b0160701c9f443d891832f6d2f811a983ca8326b002a7",
"size_bytes": 2980,
"current_repo_same_name": "references/oracle/artifacts/pyjhora_steve_jobs_shadbala_lahiri_stdout_20260627.txt",
"decision": "migrate_to_test",
"reason": "Already present; use only through reproducible parser/hash tests."
},
{
"candidate_id": "wb_round4_tajika_steve_jobs_1984_first_packet",
"domain": "tajika_oracle",
"source_path": "/Users/wuyongnaren/WorkBuddy/2026-07-05-19-03-49/yinduzhanxing/references/oracle/evidence_packet_templates/tajika_steve_jobs_1984_first_packet.json",
"sha256": "26a7231bd06f60bde2097352dc35793220c7c73f7ad32fb21fe6d35f12042d9e",
"size_bytes": 1783,
"current_repo_same_name": "references/oracle/evidence_packet_templates/tajika_steve_jobs_1984_first_packet.json",
"decision": "migrate_to_test",
"reason": "Already present; eligible for numeric packet tests only after provenance fields are verified."
}
],
"boundary": "This ledger proves round3 was non-exhaustive. It does not authorize copying WorkBuddy runtime code or upgrading any candidate to truth. Private/source-insufficient pending packets remain quarantined."
}
@@ -0,0 +1,50 @@
#!/usr/bin/env python3
"""Evaluate a requested claim against every indexed evidence domain."""
from __future__ import annotations
import argparse
import json
from pathlib import Path
from typing import Any
from scripts.claim_audit_runtime_gate import evaluate_claim
ROOT = Path(__file__).resolve().parents[1]
DEFAULT_INDEX = ROOT / "references/oracle/evidence_packet_index_2026_07_19.json"
def build(index_path: Path, requested_claim: str) -> dict[str, Any]:
index = json.loads(index_path.read_text(encoding="utf-8"))
domains = sorted({row["domain"] for row in index["packets"]})
rows = [evaluate_claim(index_path, domain, requested_claim) for domain in domains]
decisions = {name: sum(1 for row in rows if row["decision"] == name) for name in {"allow", "block", "degrade"}}
return {
"scope": "claim_audit_runtime_gate_report",
"created_at": "2026-07-19",
"requested_claim": requested_claim,
"source_index": str(index_path.relative_to(ROOT)) if index_path.is_relative_to(ROOT) else str(index_path),
"summary": {
"domain_count": len(rows),
"blocked_count": decisions["block"],
"degraded_count": decisions["degrade"],
"allowed_count": decisions["allow"],
"production_tuning_allowed_count": sum(1 for row in rows if row["production_tuning_allowed"] is True),
},
"domains": rows,
"boundary": "Batch gate report only; every high claim still resolves through per-domain evidence packets.",
}
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--index", type=Path, default=DEFAULT_INDEX)
parser.add_argument("--claim", default="production_ready")
args = parser.parse_args()
print(json.dumps(build(args.index, args.claim), ensure_ascii=False, indent=2, sort_keys=True))
return 0
if __name__ == "__main__":
raise SystemExit(main())
@@ -0,0 +1,53 @@
#!/usr/bin/env python3
"""Expected-value-only replay readiness for Prashna Sphuta candidates."""
from __future__ import annotations
import argparse, json, re
from pathlib import Path
from scripts.prashna_sphuta import calculate_sphuta_evidence
ROOT = Path(__file__).resolve().parents[1]
QUEUE = ROOT / "references/oracle/prashna_numeric_oracle_packet_queue_2026_07_20.json"
OUT = ROOT / "references/oracle/prashna_sphuta_candidate_replay_readiness_2026_07_20.json"
PAT = re.compile(r"(?P<sign>\d+)s\s*(?P<deg>\d+)°(?:\s*(?P<min>\d+)')?(?:\s*(?P<sec>\d+)\")?")
def parse_dms(value: str) -> float:
m = PAT.search(value)
if not m: raise ValueError(value)
sign=int(m.group('sign')); deg=int(m.group('deg')); minute=int(m.group('min') or 0); sec=int(m.group('sec') or 0)
return (sign*30 + deg + minute/60 + sec/3600) % 360
def close(a,b,tol=0.02): return abs(((a-b+180)%360)-180) <= tol
def build(date: str):
q=json.load(open(QUEUE))
rows=[]
for cand in q['rows']:
ev={k:parse_dms(v) for k,v in cand['expected_values'].items()}
calc=calculate_sphuta_evidence(ascendant_longitude=ev['lagna'], planet_longitudes={'Sun':ev['sun'],'Moon':ev['moon'],'Rahu':ev['rahu']}, gulika_longitude=ev['gulika'])
pts=calc['points']
computed={'trisphuta': pts['trisphuta'], 'chatusphuta': pts['catusphuta'], 'panchasphuta': pts['pancasphuta']}
pass_formula=all(close(computed[k], ev[k]) for k in ['trisphuta','chatusphuta','panchasphuta'])
rows.append({
'source_id': cand['source_id'],
'url': cand['url'],
'expected_degrees': ev,
'computed_from_expected_degrees': computed,
'local_formula_consistency': 'pass' if pass_formula else 'mismatch',
'replay_status': 'blocked_missing_complete_input',
'missing_for_true_replay': ['question_datetime_local','location','timezone','ayanamsa','node_mode','raw_capture_hash','legal_external_replay'],
'upgrade_status': 'not_oracle_ready',
'claim_boundary': 'Checks arithmetic consistency of published expected values only; not a true local ephemeris replay.',
})
data={
'scope':'prashna_sphuta_candidate_replay_readiness','created_at':date,'status':'replay_readiness_ready','claim_status':'tooling_observation_only',
'production_tuning_allowed':False,'truth_matrix_allowed':False,
'summary':{'candidate_count':len(rows),'local_formula_check_pass_count':sum(r['local_formula_consistency']=='pass' for r in rows),'oracle_ready_count':0},
'rows':rows,'boundary':'Expected-value arithmetic only; complete Prashna inputs are still required for oracle replay.'
}
return data
def main():
ap=argparse.ArgumentParser(); ap.add_argument('--date',default='2026-07-20'); args=ap.parse_args()
data=build(args.date); OUT.write_text(json.dumps(data,ensure_ascii=False,indent=2,sort_keys=True)+'\n'); print(json.dumps(data,ensure_ascii=False,indent=2,sort_keys=True))
if __name__=='__main__': main()
@@ -0,0 +1,39 @@
#!/usr/bin/env python3
"""Arbitrate Prashna Sphuta expected-value mismatches without truth upgrade."""
from __future__ import annotations
import argparse, json
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
REPLAY = ROOT / "references/oracle/prashna_sphuta_candidate_replay_readiness_2026_07_20.json"
OUT = ROOT / "references/oracle/prashna_sphuta_mismatch_arbitration_2026_07_20.json"
def status(row, key, tol=0.02):
exp=row['expected_degrees'][key]; got=row['computed_from_expected_degrees'][key]
return 'matches' if abs(((got-exp+180)%360)-180) <= tol else 'mismatch'
def build(date: str):
replay=json.load(open(REPLAY))
rows=[]
for row in replay['rows']:
rows.append({
'source_id': row['source_id'], 'url': row['url'],
'trisphuta_status': status(row,'trisphuta'),
'chatusphuta_status': status(row,'chatusphuta'),
'panchasphuta_status': status(row,'panchasphuta'),
'candidate_causes': ['formula_variant','source_transcription','chatusphuta_catusphuta_naming','incomplete_input_settings'],
'next_evidence_owner': 'worked_example_collection',
'next_evidence': ['raw scan/page capture','complete example input','independent translation/transcription check','legal external replay'],
'upgrade_status': 'not_oracle_ready',
'claim_boundary': 'Mismatch queue only; do not tune formulas or upgrade Prashna truth from this packet.',
})
sources=[
{'source_id':'vedastro_prasna_marga_ch5_sphuta_example','url':'https://vedastro.org/book/PrasnaMarga/Chapter5','source_role':'numeric_candidate','upgrade_status':'candidate_not_oracle'},
{'source_id':'internet_archive_prasna_marga_bv_raman_sphuta_fragment','url':'https://archive.org/details/PrasnaMarga/','source_role':'public_formula_numeric_fragment_candidate','upgrade_status':'candidate_not_oracle'},
]
return {'scope':'prashna_sphuta_mismatch_arbitration','created_at':date,'status':'arbitration_queue_ready','claim_status':'open_queue','production_tuning_allowed':False,'truth_matrix_allowed':False,'summary':{'mismatch_count':sum(r['chatusphuta_status']=='mismatch' or r['panchasphuta_status']=='mismatch' for r in rows),'source_candidate_count':len(sources),'oracle_ready_count':0},'rows':rows,'source_candidates':sources,'boundary':'Queue records candidate causes; closure requires raw source and replay evidence.'}
def main():
ap=argparse.ArgumentParser(); ap.add_argument('--date',default='2026-07-20'); args=ap.parse_args()
data=build(args.date); OUT.write_text(json.dumps(data,ensure_ascii=False,indent=2,sort_keys=True)+'\n'); print(json.dumps(data,ensure_ascii=False,indent=2,sort_keys=True))
if __name__=='__main__': main()
@@ -0,0 +1,152 @@
#!/usr/bin/env python3
"""Build field-level Shadbala component closure tickets from same-unit 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]
SAME_UNIT = ROOT / "references/oracle/shadbala_same_unit_normalizer_2026_07_19.json"
SOURCE_KB = ROOT / "references/oracle/formula_source_knowledge_base_2026_07_19.json"
def stable_json(data: Any) -> str:
return json.dumps(data, ensure_ascii=False, sort_keys=True, separators=(",", ":"), default=str)
def source_by_component() -> dict[str, dict[str, Any]]:
raw = json.loads(SOURCE_KB.read_text(encoding="utf-8"))
out: dict[str, dict[str, Any]] = {}
for formula in raw.get("formulas", []):
if formula.get("family") == "Shadbala" and formula.get("component") not in {"total", None}:
out[formula["component"]] = formula
return out
def owner_for(classification: str) -> str:
if classification == "within_1_virupa_observation":
return "ready_for_tolerance_freeze"
if classification == "method_variant":
return "method_variant_decision"
if classification == "formula_or_unit_mismatch":
return "formula_source_arbitration"
return "worked_example_numeric_oracle"
def closure_for(classification: str) -> str:
if classification == "within_1_virupa_observation":
return "same_unit_observation_ready_tolerance_not_frozen"
if classification == "method_variant":
return "method_variant_unresolved"
if classification == "formula_or_unit_mismatch":
return "formula_or_unit_mismatch_unresolved"
return "insufficient_numeric_sources"
def required_evidence(classification: str) -> list[str]:
common = [
"public numeric worked example with birth data/settings",
"explicit Virupa/Rupa unit declaration",
]
if classification == "method_variant":
return common + ["variant selection note: preserve method_variant if authoritative sources diverge"]
if classification == "formula_or_unit_mismatch":
return common + ["component formula/source arbitration across local, jyotishganit, Xalen, VP Jain"]
if classification == "within_1_virupa_observation":
return common + ["freeze tolerance and add second public case before parity upgrade"]
return common + ["recover missing numeric raw/hash"]
def build() -> dict[str, Any]:
same_unit = json.loads(SAME_UNIT.read_text(encoding="utf-8"))
sources = source_by_component()
tickets: list[dict[str, Any]] = []
for row in same_unit["rows"]:
component = row["component"]
source = sources.get(component, {})
classification = row["classification"]
tickets.append(
{
"ticket_id": f"shadbala.{row['planet'].lower()}.{component}",
"planet": row["planet"],
"component": component,
"canonical_component": row["canonical_component"],
"same_unit_classification": classification,
"closure_status": closure_for(classification),
"next_evidence_owner": owner_for(classification),
"unit_contract": source.get("unit_contract", "Virupa/Rupa unit source required."),
"known_variants": source.get("known_variants", []),
"source_evidence": source.get("source_evidence", []),
"required_evidence": required_evidence(classification),
"normalized_values_virupa": {
"jyotishganit": row.get("jyotishganit_virupa"),
"xalen": row.get("xalen_virupa"),
"local": row.get("local_from_xalen_report_virupa"),
"vp_jain_published": row.get("vp_jain_published_virupa"),
"vp_jain_local": row.get("vp_jain_local_virupa"),
},
"claim_boundary": (
"Do not promote this component row to absolute parity until formula variant, "
"unit contract, and public numeric worked example all close."
),
}
)
counts = Counter(ticket["same_unit_classification"] for ticket in tickets)
by_component: dict[str, Counter[str]] = defaultdict(Counter)
for ticket in tickets:
by_component[ticket["component"]][ticket["same_unit_classification"]] += 1
component_hotspots = []
for component in sorted(by_component):
c = by_component[component]
component_hotspots.append(
{
"component": component,
"ticket_count": sum(c.values()),
"within_1_virupa_observation_count": c["within_1_virupa_observation"],
"method_variant_count": c["method_variant"],
"formula_or_unit_mismatch_count": c["formula_or_unit_mismatch"],
"insufficient_numeric_sources_count": c["insufficient_numeric_sources"],
}
)
return {
"scope": "shadbala_component_closure_queue_v2",
"created_at": "2026-07-19",
"status": "field_level_queue_ready",
"claim_status": "partial",
"production_tuning_allowed": False,
"truth_matrix_allowed": False,
"sources": {
"same_unit_matrix": str(SAME_UNIT.relative_to(ROOT)),
"formula_source_knowledge_base": str(SOURCE_KB.relative_to(ROOT)),
},
"summary": {
"ticket_count": len(tickets),
"within_1_virupa_observation_count": counts["within_1_virupa_observation"],
"method_variant_count": counts["method_variant"],
"formula_or_unit_mismatch_count": counts["formula_or_unit_mismatch"],
"insufficient_numeric_sources_count": counts["insufficient_numeric_sources"],
"absolute_parity_ready_count": 0,
},
"queue_hash": hashlib.sha256(stable_json(tickets).encode("utf-8")).hexdigest(),
"component_hotspots": component_hotspots,
"tickets": tickets,
"boundary": "Field-level Shadbala closure queue only; no majority-vote truth or production tuning upgrade.",
}
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,37 @@
import json
import subprocess
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def test_claim_gate_report_covers_all_index_domains_for_high_claim() -> None:
data = json.loads(
subprocess.check_output(
["python3", "scripts/claim_audit_runtime_gate_report.py", "--claim", "production_ready"],
cwd=ROOT,
text=True,
)
)
assert data["scope"] == "claim_audit_runtime_gate_report"
assert data["requested_claim"] == "production_ready"
assert data["summary"]["domain_count"] >= 20
assert data["summary"]["blocked_count"] >= 1
assert data["summary"]["degraded_count"] >= 1
assert data["summary"]["production_tuning_allowed_count"] == 0
def test_claim_gate_report_keeps_known_blockers_and_partials_visible() -> None:
data = json.loads(
subprocess.check_output(
["python3", "scripts/claim_audit_runtime_gate_report.py", "--claim", "production_ready"],
cwd=ROOT,
text=True,
)
)
domains = {row["domain"]: row for row in data["domains"]}
assert domains["timing_holdout"]["decision"] == "block"
assert "day_level_holdout_readiness_ledger" in domains["timing_holdout"]["blocking_packets"]
assert domains["shadbala_component_closure"]["decision"] == "degrade"
assert domains["worked_example_collection"]["decision"] == "block"
@@ -0,0 +1,36 @@
import json
import subprocess
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
ARTIFACT = ROOT / "references/oracle/prashna_sphuta_candidate_replay_readiness_2026_07_20.json"
INDEX = ROOT / "references/oracle/evidence_packet_index_2026_07_19.json"
def test_prashna_sphuta_candidate_replay_parses_expected_values_without_truth_upgrade():
data = json.loads(subprocess.check_output(["python3", "scripts/prashna_sphuta_candidate_replay.py", "--date", "2026-07-20"], cwd=ROOT, text=True))
assert data["scope"] == "prashna_sphuta_candidate_replay_readiness"
assert data["claim_status"] == "tooling_observation_only"
assert data["summary"]["candidate_count"] == 1
assert data["summary"]["local_formula_check_pass_count"] == 0
assert data["summary"]["oracle_ready_count"] == 0
row = data["rows"][0]
assert row["replay_status"] == "blocked_missing_complete_input"
assert row["local_formula_consistency"] == "mismatch"
assert abs(row["computed_from_expected_degrees"]["trisphuta"] - row["expected_degrees"]["trisphuta"]) < 0.01
assert abs(row["computed_from_expected_degrees"]["chatusphuta"] - row["expected_degrees"]["chatusphuta"]) > 1
def test_prashna_sphuta_candidate_replay_keeps_missing_inputs_visible():
data = json.loads(ARTIFACT.read_text(encoding="utf-8"))
row = data["rows"][0]
assert "question_datetime_local" in row["missing_for_true_replay"]
assert "location" in row["missing_for_true_replay"]
assert "ayanamsa" in row["missing_for_true_replay"]
assert row["upgrade_status"] == "not_oracle_ready"
def test_prashna_sphuta_candidate_replay_is_indexed():
packets = {row["packet_id"]: row for row in json.loads(INDEX.read_text(encoding="utf-8"))["packets"]}
packet = packets["prashna_sphuta_candidate_replay_readiness_2026_07_20"]
assert packet["claim_status"] == "tooling_observation_only"
@@ -0,0 +1,32 @@
import json
import subprocess
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
ARTIFACT = ROOT / "references/oracle/prashna_sphuta_mismatch_arbitration_2026_07_20.json"
INDEX = ROOT / "references/oracle/evidence_packet_index_2026_07_19.json"
def test_prashna_sphuta_mismatch_arbitration_records_formula_and_transcription_candidates():
data = json.loads(subprocess.check_output(["python3", "scripts/prashna_sphuta_mismatch_arbitration.py", "--date", "2026-07-20"], cwd=ROOT, text=True))
assert data["scope"] == "prashna_sphuta_mismatch_arbitration"
assert data["claim_status"] == "open_queue"
assert data["summary"]["mismatch_count"] >= 1
row = data["rows"][0]
assert row["trisphuta_status"] == "matches"
assert row["chatusphuta_status"] == "mismatch"
assert "formula_variant" in row["candidate_causes"]
assert "source_transcription" in row["candidate_causes"]
assert row["next_evidence_owner"] == "worked_example_collection"
def test_prashna_sphuta_mismatch_arbitration_adds_second_public_formula_candidate():
data = json.loads(ARTIFACT.read_text(encoding="utf-8"))
sources = {row["source_id"] for row in data["source_candidates"]}
assert "internet_archive_prasna_marga_bv_raman_sphuta_fragment" in sources
assert all(row["upgrade_status"] == "candidate_not_oracle" for row in data["source_candidates"])
def test_prashna_sphuta_mismatch_arbitration_is_indexed():
packets = {row["packet_id"]: row for row in json.loads(INDEX.read_text(encoding="utf-8"))["packets"]}
assert packets["prashna_sphuta_mismatch_arbitration_2026_07_20"]["claim_status"] == "open_queue"
@@ -0,0 +1,54 @@
import json
import subprocess
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
ARTIFACT = ROOT / "references/oracle/shadbala_component_closure_queue_v2_2026_07_19.json"
INDEX = ROOT / "references/oracle/evidence_packet_index_2026_07_19.json"
def test_queue_generator_builds_42_field_level_tickets():
data = json.loads(
subprocess.check_output(
["python3", "scripts/shadbala_component_closure_queue_v2.py"],
cwd=ROOT,
text=True,
)
)
assert data["scope"] == "shadbala_component_closure_queue_v2"
assert data["claim_status"] == "partial"
assert data["production_tuning_allowed"] is False
assert data["summary"]["ticket_count"] == 42
assert data["summary"]["formula_or_unit_mismatch_count"] == 27
assert data["summary"]["method_variant_count"] == 8
assert data["summary"]["within_1_virupa_observation_count"] == 7
def test_queue_artifact_attaches_source_unit_variant_and_owner():
data = json.loads(ARTIFACT.read_text(encoding="utf-8"))
ticket = next(row for row in data["tickets"] if row["planet"] == "Sun" and row["component"] == "dig")
assert ticket["unit_contract"]
assert ticket["known_variants"]
assert ticket["next_evidence_owner"] in {
"worked_example_numeric_oracle",
"formula_source_arbitration",
"method_variant_decision",
"ready_for_tolerance_freeze",
}
assert ticket["closure_status"] != "absolute_parity_ready"
assert ticket["claim_boundary"].startswith("Do not promote")
def test_queue_has_component_hotspot_summary():
data = json.loads(ARTIFACT.read_text(encoding="utf-8"))
hotspots = {row["component"]: row for row in data["component_hotspots"]}
assert set(hotspots) == {"sthana", "dig", "kala", "chesta", "naisargika", "drik"}
assert hotspots["naisargika"]["within_1_virupa_observation_count"] == 7
assert hotspots["dig"]["formula_or_unit_mismatch_count"] >= 1
def test_evidence_index_registers_queue_v2():
index = json.loads(INDEX.read_text(encoding="utf-8"))
packets = {row["packet_id"]: row for row in index["packets"]}
assert packets["shadbala_component_closure_queue_v2"]["claim_status"] == "partial"
@@ -0,0 +1,46 @@
import json
from pathlib import Path
LEDGER = Path("references/oracle/workbuddy_round4_candidate_ledger_2026_07_21.json")
ALLOWED = {
"migrate_to_registry",
"migrate_to_test",
"reference_only",
"forbidden_private_or_obsolete",
}
def _load():
return json.loads(LEDGER.read_text())
def test_round4_ledger_records_non_exhaustive_workbuddy_scan():
data = _load()
assert data["claim_status"] == "fragment_audit_only"
assert data["status"] == "partial_non_exhaustive"
assert data["summary"]["round3_indexed_entries"] == 30
assert data["summary"]["unindexed_filename_signal_total"] >= 858
assert len(data["entries"]) == data["summary"]["round4_entries"]
def test_round4_decisions_are_bounded():
data = _load()
decisions = [entry["decision"] for entry in data["entries"]]
assert set(decisions) <= ALLOWED
for decision, expected in data["summary"]["decisions"].items():
assert decisions.count(decision) == expected
def test_private_or_source_insufficient_packets_are_quarantined():
data = _load()
quarantined = [
entry
for entry in data["entries"]
if entry["decision"] == "forbidden_private_or_obsolete"
]
assert quarantined
for entry in quarantined:
lowered = (entry["source_path"] + " " + entry["reason"]).lower()
assert "private" in lowered or "source-insufficient" in lowered
assert entry["current_repo_same_name"] is None