Files
rune/scripts/open_contract_hook_engine.py

40 lines
1.5 KiB
Python

#!/usr/bin/env python3
"""Open the #2479 dichotomy-wave construction contract for hook_engine (GO gap-close).
Full lifecycle walk in ONE process (shared-store clobber hazard)."""
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-gap-he")
r = iface.submit_need(
"Close the PARTIAL gaps in src/go/hook-engine against the "
"src/rune/hook_engine.py oracle (dichotomy wave, issue #2479 "
"tranche): name-preserving 1:1 port of the 5 unmatched functions "
"(discover_functions, tag_function, validate_placements, "
"generate_report, handle_hook plus auto_tag companion), IO behind "
"injectable seams, frozen-truth battery generated against the live "
"Python oracle (RUNE core pinned to python, deep-copied inputs), "
"existing tests green + gofmt/vet clean, live parity 100% on the new "
"functions.",
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)
print("CONTRACT", cid, "IN VERIFYING (close happens at delivery with SHAs)")