70 lines
2.6 KiB
Python
70 lines
2.6 KiB
Python
#!/usr/bin/env python3
|
|
"""Close the #2479 dichotomy-wave model_connect gap contract (GO port).
|
|
Full lifecycle walk in ONE process (shared-store clobber hazard; segment
|
|
transitions take ~60s each — do NOT split across processes). Carries the
|
|
already-pushed parity SHA as evidence:
|
|
feat 1f2fe468 close PARTIAL gaps — dichotomy wave (7/11 -> 11/11)
|
|
|
|
Usage: close_contract_model_connect.py
|
|
"""
|
|
import json
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
os.environ.setdefault(
|
|
"CS_RUST_LIB",
|
|
"/mnt/workdrive/rune/src/rust/capability_scoring/target/release/libcapability_scoring.so",
|
|
)
|
|
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
|
|
|
|
from rune.construction_interface import ConstructionInterface
|
|
|
|
PARITY_SHA = "1f2fe468"
|
|
EVIDENCE = f"parity {PARITY_SHA}"
|
|
|
|
iface = ConstructionInterface(builder="factory-gap-mconn")
|
|
|
|
r = iface.submit_need(
|
|
"model_connect dichotomy gap-close (GO): name-preserving port of "
|
|
"the 4 audit-missing functions (_ctx_budget, _now, "
|
|
"_get_cloud_models, handle_hook) into src/go/model-connect as "
|
|
"CtxBudget / Now / GetCloudModels / HandleHook, wall clock behind "
|
|
"the injectable MCONN_CLOCK seam, hermetic HOME via "
|
|
"scripts/mconn_freeze_seams, frozen-truth battery (truth.json, "
|
|
"40-case envelope) generated against the live Python oracle and "
|
|
"verified byte-identical via freeze_truth.py, embedded VERBATIM in "
|
|
"truth_test.go TestFrozenTruthReplay (3/3); CI replay binary 40/40; "
|
|
"live parity sweep 44/44 "
|
|
"(scripts/check_model_connect_parity.py), gofmt/vet/go build clean, "
|
|
"Python oracle smoke green both pins. Oracle quirks preserved and "
|
|
"frozen: string-blind JSONC // strip (URL corruption -> []), "
|
|
"partial cloud list on mid-provider shape errors, "
|
|
"insertion-order provider/model iteration, live model_registry "
|
|
"constants (OUTPUT_RESERVE default 2048 / TOOL_RESULT_RESERVE "
|
|
"1024). Dichotomy audit 7/11 PARTIAL -> 11/11 FULL. Delivered on "
|
|
"gitea/master: feat " + PARITY_SHA + ".",
|
|
origin="builder",
|
|
)
|
|
print("submit_need:", json.dumps(r)[:300])
|
|
if not r.get("success"):
|
|
print("NEED FAILED — aborting")
|
|
sys.exit(1)
|
|
c = r["ids"]["contract_id"]
|
|
print("contract_id:", c)
|
|
|
|
for phase in ("approved", "building", "verifying", "closed"):
|
|
t = iface.transition(c, phase, evidence_ref=EVIDENCE)
|
|
ok = t.get("success")
|
|
print(f"transition->{phase}:", "ok" if ok else json.dumps(t)[:300])
|
|
if not ok:
|
|
sys.exit(1)
|
|
|
|
doc = iface.scaffold.load()
|
|
e = iface.scaffold.contract(doc, c)
|
|
print("FINAL PHASE:", e.get("phase") if e else "MISSING")
|
|
if not e or e.get("phase") != "closed":
|
|
sys.exit(1)
|
|
print("CLOSED", c)
|