#!/usr/bin/env python3 """Open + walk the #2479 gap-closing construction contract for failure_auto_filer to verifying. Full lifecycle in ONE process.""" 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-faf") r = iface.submit_need( "Close the failure_auto_filer dichotomy gap (#2479 tranche): the Go " "port is PARTIAL (11 fns) — port the missing worker/pipeline half " "(_error_text, JsonlSpool append/unconsumed/mark_consumed, " "FailureAutoFiler __call__/submit/drain/file/reconcile/_write/" "_write_once/_spool/_run_worker/_process_batch/_flush_group/" "_drain_once) name-preserving with logic 1:1, forge IO + journal IO " "+ clock behind injectable seams, no goroutine spawns in test paths " "(wait=True synchronous mode mirrors the oracle). Freeze oracle " "truth via the shared scripts/freeze_truth.py harness (every public " "function and branch) and embed it VERBATIM in the Go battery; live " "parity 100% on the new fns; all existing tests stay green.", origin="builder", ) print("submit_need:", json.dumps(r)[:300]) 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)[:150]) if not t.get("success"): sys.exit(1) print("CONTRACT", cid, "verifying")