#!/usr/bin/env python3 """Open + walk the gap-closing construction contract for work_manager to verifying. Full lifecycle open in ONE process (builder=factory-gap-wm).""" 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-wm") r = iface.submit_need( "Close the work_manager dichotomy-port PARTIAL gaps (#2479 tranche, " "GO verdict): port the 13 missing functions (group_by_file, " "load_config, save_config, load_batches, save_batches, create_work, " "clear_work, audit_to_work_items, auto_fill_from_audit, load_meta, " "save_meta, update_meta_from_batches + full get_status/get_meta_" "status and TaskMeta with progress/eta) from the Python oracle " "src/rune/work_manager.py into src/go/work-manager name-preserving, " "logic 1:1, file IO behind injectable seams (module-level path " "constants mirrored as seam vars). Freeze shared-harness truth " "(freeze_truth.py, RUNE_WORK_MANAGER_CORE=python pinned, HOME-pinned " "temp work dir, self-seeding deterministic case sequence) embedded " "VERBATIM in the Go battery; all existing tests green; gofmt + vet " "clean; live parity 100% on the new fns (oracle subprocess, " "timestamp-normalized); Phase B language-advantage pass.", 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")