#!/usr/bin/env python3 """Close the #2479 dichotomy-wave construction contract for self_model with SHA evidence.""" import json import sys from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src")) from rune.construction_interface import ConstructionInterface cid = "BUILDER-2026-10-13T00:23:43Z-53857a-factory-batch-i" iface = ConstructionInterface(builder="factory-batch-i") c = iface.close(cid, observed_evidence=[{ "kind": "port_evidence", "detail": "self_model dichotomy completion — parity dac4889c " "feat(self_model): port to FULL Rust — dichotomy wave; " "Phase B 99bde7ba refactor(self_model): Phase B " "language-advantage pass — dichotomy wave (ASCII byte " "fast-path token estimate); store register e1904eb1 (all " "pushed gitea/master). Battery 2 tests replay the 26-case " "frozen oracle truth VERBATIM (estimate_tokens boundaries " "incl. unicode; compile incl. exact-fit, evidence overflow, " "key defaults, stable weight ties, zero/negative budgets; " "why_question incl. statement/evidence matches, " "case-insensitivity, empty topic/model); live parity " "926/926 (26 frozen + 300 fuzz seeds x 3 fns, kernel vs " "RUNE_SMM_CORE=python); pytest test_p2_quintet 16 passed " "BOTH ways (kernel auto + python pin); clippy -D warnings " "clean. Documented FFI boundary: pyjson numbers are f64 " "(int-vs-float weight distinction crosses as value-equal; " "truth corpus uses float weights).", }], scope_files=[ "src/rune/self_model.py", "src/rune/smm_loader.py", "src/rust/self_model/src/lib.rs", "src/rust/self_model/src/branch_battery.rs", "src/rust/self_model/frozen_sm_truth.json", "scripts/gen_self_model_truth.py", "scripts/walk_contract_self_model.py", "scripts/close_contract_self_model.py", ]) print("close:", json.dumps(c)[:300]) print("CONTRACT", cid, "closed" if c.get("success") else "CLOSE_FAILED")