Files
rune/scripts/open_contract_gap_cb.py
T
Nick 1a35b4ce2d feat(capability_broker): close PARTIAL gaps — dichotomy wave
Port the 10 audit-missing fns name-preserving into the existing Rust
crate (gap.rs): _native_tool_schemas, load_registry, _cards_are_stale,
load_cards, generate_card, build_cards, _cs_core, _py_score_card,
match_capabilities, handle_hook. Doc-envelope cb_* FFI entries (lib.rs,
cs_free_string stays with capability_scoring), ctypes loader bindings
(broker_loader.py), facade delegation under the
RUNE_CAPABILITY_BROKER_CORE=python pin (capability_broker.py), and a
cfg(test) battery (gap_battery.rs) replaying the shared freeze_truth.py
frozen corpus VERBATIM via include_str. synthesize_card capabilities list
pinned to the oracle law ([name]). Module audit 10/19 PARTIAL -> 19/19
FULL. Ladder evidence lands with the Phase B commit. Contract
BUILDER-2026-10-13T16:01:25Z-9b9389-factory-gap-cb.
2026-10-14 04:24:32 +01:00

45 lines
1.7 KiB
Python

#!/usr/bin/env python3
"""Open the #2479 dichotomy-wave gap-closing construction contract for
capability_broker (PARTIAL → 20/20 fn coverage). Walks draft→approved→
building in ONE process (shared-store clobber hazard). Close happens after
the two landings are pushed, with SHA evidence (close_contract_gap_cb.py).
Usage: open_contract_gap_cb.py
"""
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-cb")
r = iface.submit_need(
"Close capability_broker PARTIAL gaps (dichotomy wave, issue #2479 "
"tranche): port the 10 audit-missing functions name-preserving into "
"the existing Rust crate (_native_tool_schemas, load_registry, "
"_cards_are_stale, load_cards, generate_card, build_cards, _cs_core, "
"_py_score_card, match_capabilities, handle_hook) with doc-envelope "
"FFI cb_* (cs_free_string shared via capability_scoring, never "
"re-exported), ctypes loader mirroring broker_loader.py, facade "
"delegation with RUNE_CAPABILITY_BROKER_CORE=python pin; frozen-truth "
"battery via the shared freeze_truth.py harness replayed VERBATIM in "
"a cfg(test) battery; live parity 100% on the new fns; Phase B "
"language-advantage pass.",
origin="builder",
)
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)