Files
rune/scripts/open_contract_batch_a.py

44 lines
1.4 KiB
Python

#!/usr/bin/env python3
"""Open the #2479 dichotomy-wave construction contract for the BATCH-A
modules (iteration, subconscious_pass, rune_profiler, subsystem_health).
Walks draft→approved→building in ONE process (shared-store clobber hazard).
Usage: open_contract_batch_a.py <module> [contract_id]
"""
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
module = sys.argv[1]
sym = {"iteration": "IT", "subconscious_pass": "SP",
"rune_profiler": "RP", "subsystem_health": "SH"}[module]
iface = ConstructionInterface(builder="factory-batch-a")
cid = sys.argv[2] if len(sys.argv) > 2 else None
r = iface.submit_need(
f"Port src/rune/{module}.py to FULL Rust (dichotomy factory, issue "
f"#2479 tranche): doc-envelope FFI, ctypes loader, facade delegation "
f"with RUNE_{sym}_CORE=python pin, frozen-truth battery, live parity "
f"100%, Phase B language-advantage pass.",
origin="builder",
contract_id=cid,
)
print("submit_need:", json.dumps(r)[:400])
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"):
t = iface.transition(c, phase)
print(f"transition->{phase}:", json.dumps(t)[:300])
if not t.get("success"):
sys.exit(1)
print("OPENED", c)