Files
rune/scripts/walk_close_contract_memory_selector.py
Nick cd51159660
deploy / deploy (push) Skipped
CI Pipeline / lint (push) Canceled after 0s
CI Pipeline / unit-tests (push) Canceled after 0s
CI Pipeline / go-surface (push) Canceled after 0s
CI Pipeline / rust-surface (push) Canceled after 0s
CI Pipeline / canary (push) Canceled after 0s
CI Pipeline / best-practices (push) Canceled after 0s
CI Pipeline / documentation (push) Canceled after 0s
CI Pipeline / type-check (push) Canceled after 0s
CI Pipeline / gitea-offline (push) Canceled after 0s
CI Pipeline / required-checks (push) Canceled after 0s
CI Pipeline / CI Pipeline / notify-event-bridge (push) Canceled after 0s
chore(store): close memory_selector dichotomy contract BUILDER-2026-10-13T17:33:39Z-236e93-factory-gap-ms (parity 6bdd2852, phase B f2ff903e)
One-process walk (submit -> approved -> building -> verifying -> close,
the shared-store clobber pattern): audit 11/14 PARTIAL -> 14/14 FULL.
2026-10-13 18:36:35 +01:00

75 lines
3.3 KiB
Python

#!/usr/bin/env python3
"""Walk + close the #2479 dichotomy-wave contract for memory_selector on the
FRESH master store (one process, per the shared-store clobber pattern)."""
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
PARITY_SHA = sys.argv[1] if len(sys.argv) > 1 else ""
PHASEB_SHA = sys.argv[2] if len(sys.argv) > 2 else ""
if not (PARITY_SHA and PHASEB_SHA):
sys.exit("usage: walk_close_contract_memory_selector.py <parity_sha> <phaseb_sha>")
iface = ConstructionInterface(builder="factory-gap-ms")
r = iface.submit_need(
"Close the PARTIAL gaps in src/rust/memory_selector against the "
"src/rune/memory_selector.py oracle (dichotomy wave, issue #2479 "
"tranche): the three audit-named functions (add_source registry "
"kernel — position-preserving replace; _source_store persona-lane "
"gate through mse_persona_wanted + merge through mse_store_project; "
"_mse_core probe contract frozen under the RUNE_MSE_CORE=python pin), "
"frozen-truth battery generated against the live oracle through the "
"ms_freeze_seams rig (FTS-seeded hermetic store, byte-identical "
"--verify), Rust battery + clippy -D warnings clean, live parity "
"536/536 (frozen FFI rows, fuzz registry ops, dual-mode facade), "
"Python oracle tests green under both pins, Phase B language-advantage "
"pass.",
origin="builder",
)
print("submit_need:", json.dumps(r)[:200])
if not r.get("success"):
sys.exit(1)
cid = r["ids"]["contract_id"]
print("contract_id:", cid)
for phase in ("approved", "building", "verifying"):
t = iface.transition(cid, phase)
if not t.get("success"):
print(f"transition->{phase} FAILED:", json.dumps(t)[:300])
sys.exit(1)
print(f"transition->{phase}: ok")
print("walked to verifying")
c = iface.close(cid, observed_evidence=[{
"kind": "port_evidence",
"detail": (
f"memory_selector RUST dichotomy gap-close — parity commit {PARITY_SHA}, "
f"Phase B commit {PHASEB_SHA}; dichotomy audit fn coverage 11/14 PARTIAL "
"-> 14/14 FULL (missing list emptied); 10-row frozen gap truth "
"(scripts/gen_memory_selector_truth.py under scripts/ms_freeze_seams — "
"byte-identical across generation and --verify runs), Rust battery 9/9 "
"with the gap truth embedded via include_str!, live parity 536/536 "
"(frozen FFI replay + 522 fuzz registry ops vs the oracle dict + "
"dual-mode facade on RUNE_MSE_CORE=python vs live core), cargo clippy "
"--all-targets -D warnings 0, Python tests both pins (test_p1_03 66 "
"passed + 2 pre-existing worktree-only cached_recall failures verified "
"identical on the stashed base; test_context_broker 18/18 both pins)."
),
}], scope_files=[
"src/rune/memory_selector.py",
"src/rune/mse_loader.py",
"src/rust/memory_selector/src/lib.rs",
"src/rust/memory_selector/src/branch_battery.rs",
"src/rust/memory_selector/frozen_truth.json",
"scripts/gen_memory_selector_truth.py",
"scripts/ms_freeze_seams/sitecustomize.py",
"scripts/check_memory_selector_parity.py",
])
print("close:", json.dumps(c)[:300])
print("CONTRACT", cid, "closed" if c.get("success") else "CLOSE_FAILED")