Files
rune/scripts/close_contract_self_modify.py
T
Nick 845cbfb3d0
CI Pipeline / best-practices (push) Successful in 11s
CI Pipeline / documentation (push) Successful in 4s
CI Pipeline / rust-surface (push) Failing after 17s
CI Pipeline / go-surface (push) Failing after 23s
Auto-version and Release / release (push) Successful in 30s
CI Pipeline / gitea-offline (push) Successful in 22s
CI Pipeline / required-checks (push) Canceled after 0s
CI Pipeline / CI Pipeline / notify-event-bridge (push) Canceled after 0s
CI Pipeline / lint (push) Canceled after 51s
CI Pipeline / unit-tests (push) Canceled after 51s
CI Pipeline / type-check (push) Canceled after 36s
CI Pipeline / canary (push) Canceled after 52s
deploy / deploy (push) Canceled after 55s
chore(store): close self_modify dichotomy contract BUILDER-2026-10-12T01:53:04Z-7c7607-factory-wave (parity 1af27dc5, phase B 18052d5e)
2026-10-12 02:55:05 +01:00

50 lines
1.7 KiB
Python

#!/usr/bin/env python3
"""Close the #2479 dichotomy-wave construction contract for self_modify.
Full lifecycle in ONE process (shared-store clobber hazard, see
notes-construction-intent-batch.md)."""
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
iface = ConstructionInterface(builder="factory-wave")
r = iface.submit_need(
"Port src/rune/self_modify.py to FULL Rust (dichotomy factory, issue "
"#2479 tranche): kernel-owned subprocess seam (_run), doc-envelope FFI, "
"ctypes loader, facade delegation with RUNE_SMOD_CORE=python pin, "
"frozen-truth battery with deterministic git fixtures, live parity "
"100%, Phase B language-advantage pass.",
origin="builder",
)
print("submit_need:", json.dumps(r)[:400])
if not r.get("success"):
print("NEED FAILED — aborting")
sys.exit(1)
cid = r["ids"]["contract_id"]
print("contract_id:", cid)
for phase in ("approved", "building", "verifying"):
t = iface.transition(cid, phase)
print(f"transition->{phase}:", json.dumps(t)[:300])
if not t.get("success"):
sys.exit(1)
c = iface.close(cid, observed_evidence=[{
"kind": "port_evidence",
"detail": "self_modify parity port — evidence attached at close (SHAs "
"reported in the builder report)",
}], scope_files=[
"src/rune/self_modify.py",
"src/rune/smod_loader.py",
"src/rust/self_modify/src/lib.rs",
"src/rust/self_modify/src/branch_battery.rs",
"src/rust/self_modify/src/frozen_smod_truth.json",
"scripts/gen_self_modify_truth.py",
])
print("close:", json.dumps(c)[:400])
print("CONTRACT", cid, "closed" if c.get("success") else "CLOSE_FAILED")