Files
rune/scripts/open_contract_night_mode.py

39 lines
1.4 KiB
Python

#!/usr/bin/env python3
"""Open the #2479 dichotomy-wave construction contract for night_mode.
Full lifecycle 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-nm")
r = iface.submit_need(
"Close the night_mode dichotomy PARTIAL gaps (audit-named): Go port "
"of _ctx_budget, get_night_mode, start_night_mode, stop_night_mode, "
"get_status, get_report, to_dict, _load, _save, _run_loop, _run_sleep, "
"_run_evaluation (name-preserving, logic 1:1) in src/go/night-mode; "
"pure/IO split law with injectable clock/sleeper/runner/HTTP seams; "
"frozen-oracle truth battery via shared freeze_truth.py embedded "
"VERBATIM in Go tests; live parity 100% on new fns; Python facade "
"stays fully functional (RUNE_NIGHT_MODE_CORE=python pin + auto "
"both green).",
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("PENDING_CONTRACT", cid)