chore(store): close warm_router STATE-family dichotomy contract BUILDER-2026-10-14T23:20:26Z-8e363b-factory-heavy-wr-state (parity 0f7df7db)

One-process walk (approved → building → verifying → closed) via
ConstructionInterface(builder='factory-heavy-wr-state'), closed through
iface.close() with the port evidence + family scope files. Close-walk
exit evidence: verification/wrs-close-walk.exit (the walk script was
executed a second time for exit-code evidence — its duplicate contract
artifacts were NOT committed; the store carries the single 8e363b walk).
This commit is contained in:
Nick committed 2026-10-15 00:32:34 +01:00
1 parent 094fa2d99c
commit f050ba8aca
5 files changed
+6065

No files matched your search

+111
View File
@@ -0,0 +1,111 @@
#!/usr/bin/env python3
"""Close the #2479 dichotomy-wave warm_router STATE-family gap contract
(GO port, builder factory-heavy-wr-state). Full lifecycle walk in ONE
process (shared-store clobber hazard). Carries the already-pushed SHA:
feat 7656f422 close STATE-family gaps — dichotomy wave
Usage: close_contract_warm_router_state.py
"""
import json
import os
import sys
from pathlib import Path
os.environ.setdefault(
"CS_RUST_LIB",
"/mnt/workdrive/rune/src/rust/capability_scoring/target/release/libcapability_scoring.so",
)
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
from rune.construction_interface import ConstructionInterface
PARITY_SHA = "7656f422"
EVIDENCE = f"parity {PARITY_SHA}"
iface = ConstructionInterface(builder="factory-heavy-wr-state")
r = iface.submit_need(
"warm_router STATE-family dichotomy gap-close (GO): name-preserving "
"port of the 11 unmatched DB/STATE/PERSISTENCE functions "
"(_ensure_use_history_table, record_outcome, record_neuron_fire, _db, "
"_aaak, write_neuron, _touch, _session_state, load_state, save_state, "
"_derive_triggers, list_neurons, promote_active, handle_hook; main "
"mirror via the state-scenario subcommand) into "
"src/go/warm-router/gaps_state.go. SQLite stays facade-side per the "
"landed crate seams: verbatim SQL text + parameter tuples + the "
"decisions between them are the Go contract; connections are "
"injected SQLExecer seams. list_neurons honors the str[:n] quirk law "
"(RUNE-safe 80-char summary truncation, CHAR-based token cost) and "
"Python or-falsiness defaults (importance None/0 -> 0.5, slug '' -> "
"'warm'); handle_hook ports the message or-chain with the >2-char "
"gate, 120-CHAR error truncation and the AttributeError crash-class "
"marker for truthy non-string messages; _touch/_derive_triggers pin "
"insertion-order semantics (literal key order, first-occurrence tie "
"break, [:8] cap); write_neuron's upsert plan carries the full "
"18-column INSERT tuple verbatim. Frozen truth: 46-case envelope via "
"the shared freeze harness + scripts/gen_warm_router_state_truth.py "
"wrapper shims (recording sqlite3.connect; clock pinned from row "
"args — _touch's module-level datetime binding pinned directly) — "
"byte-identical --verify AND sha-stable fresh regen, no absolute "
"paths (STATE_STORE_DB placeholder). Battery truth_state_test.go "
"replays every row through the SAME runStateOp the CLI rides; live "
"parity 46/46 via scripts/check_warm_router_state_parity.py "
"(order-sensitive rendered JSON). go build/gofmt/vet/test clean "
"(both families in-package post-rebase); module pytest green "
"delegation-live; pinned-python divergence identical to the main "
"checkout (memory_scoring fallback retired — control evidence "
"verification/wrs-pytest-pinned-control-main). dichotomy audit "
"warm_router 28/33 state-lane (17/33 pre) + routing-lane 1f0cb4bb = "
"33/33 FULL. Delivered on gitea/master: feat " + PARITY_SHA + ".",
origin="builder",
)
print("submit_need:", json.dumps(r)[:300])
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", "verifying"):
t = iface.transition(c, phase, evidence_ref=EVIDENCE)
ok = t.get("success")
print(f"transition->{phase}:", "ok" if ok else json.dumps(t)[:300])
if not ok:
sys.exit(1)
cres = iface.close(c, observed_evidence=[{
"kind": "port_evidence",
"detail": (
f"warm_router GO STATE-family dichotomy gap-close — parity commit "
f"{PARITY_SHA}; dichotomy audit fn coverage 17/33 -> 28/33 (this "
f"lane; module 33/33 FULL with routing-lane 1f0cb4bb); 46-case "
f"frozen state-family truth (scripts/gen_warm_router_state_truth."
f"py wrapper shims — byte-identical --verify AND sha-stable fresh "
f"regen), battery 46/46 green + latch/rune unit pins, gofmt/vet/"
f"build clean, live parity 46/46 via scripts/check_warm_router_"
f"state_parity.py (order-sensitive rendered JSON, same runStateOp "
f"execution path as the battery), module pytest green delegation-"
f"live; pinned-python divergence identical to the main checkout "
f"(retired memory_scoring fallback — control evidence committed). "
f"Evidence: verification/wrs-* (exit codes + summary committed)."
),
}], scope_files=[
"src/rune/warm_router.py",
"src/go/warm-router/gaps_state.go",
"src/go/warm-router/main.go",
"src/go/warm-router/truth_state.json",
"src/go/warm-router/truth_state_test.go",
"scripts/gen_warm_router_state_truth.py",
"scripts/check_warm_router_state_parity.py",
])
print("close:", json.dumps(cres)[:300])
if not cres.get("success"):
sys.exit(1)
doc = iface.scaffold.load()
e = iface.scaffold.contract(doc, c)
print("FINAL PHASE:", e.get("phase") if e else "MISSING")
if not e or e.get("phase") != "closed":
sys.exit(1)
print("CLOSED", c)
@@ -0,0 +1,24 @@
# Contract BUILDER-2026-10-14T23:20:26Z-8e363b-factory-heavy-wr-state
**Phase:** closed · **Mode:** n/a · **Depth:** n/a
## What was built
warm_router STATE-family dichotomy gap-close (GO): name-preserving port of the 11 unmatched DB/STATE/PERSISTENCE functions (_ensure_use_history_table, record_outcome, record_neuron_fire, _db, _aaak, write_neuron, _touch, _session_state, load_state, save_state, _derive_triggers, list_neurons, promote_active, handle_hook; main mirror via the state-scenario subcommand) into src/go/warm-router/gaps_state.go. SQLite stays facade-side per the landed crate seams: verbatim SQL text + parameter tuples + the decisions between them are the Go contract; connections are injected SQLExecer seams. list_neurons honors the str[:n] quirk law (RUNE-safe 80-char summary truncation, CHAR-based token cost) and Python or-falsiness defaults (importance None/0 -> 0.5, slug '' -> 'warm'); handle_hook ports the message or-chain with the >2-char gate, 120-CHAR error truncation and the AttributeError crash-class marker for truthy non-string messages; _touch/_derive_triggers pin insertion-order semantics (literal key order, first-occurrence tie break, [:8] cap); write_neuron's upsert plan carries the full 18-column INSERT tuple verbatim. Frozen truth: 46-case envelope via the shared freeze harness + scripts/gen_warm_router_state_truth.py wrapper shims (recording sqlite3.connect; clock pinned from row args — _touch's module-level datetime binding pinned directly) — byte-identical --verify AND sha-stable fresh regen, no absolute paths (STATE_STORE_DB placeholder). Battery truth_state_test.go replays every row through the SAME runStateOp the CLI rides; live parity 46/46 via scripts/check_warm_router_state_parity.py (order-sensitive rendered JSON). go build/gofmt/vet/test clean (both families in-package post-rebase); module pytest green delegation-live; pinned-python divergence identical to the main checkout (memory_scoring fallback retired — control evidence verification/wrs-pytest-pinned-control-main). dichotomy audit warm_router 28/33 state-lane (17/33 pre) + routing-lane 1f0cb4bb = 33/33 FULL. Delivered on gitea/master: feat 7656f422.
## What it connects to
(no affected surface recorded)
## How to update those connections
- Open a NEW construction contract (scaffolding is absolute) scoped to the same surface.
- Evidence trail: 4 checkpoint(s) recorded on the contract entity.
- Quality at close: {"candidate_corrections": [], "captured_at": "2026-10-14T23:23:47Z", "contract": "BUILDER-2026-10-14T23:20:26Z-8e363b-factory-heavy-wr-state", "correctly_predicted": [], "evidence_sources": ["unattributed"], "expected_new_entities": [], "expected_new_missing": [], "expected_new_observed": [], "expected_runtime_effects": [], "expected_runtime_missing": [], "expected_runtime_observed": [], "genuinely_unexpected_new": [], "missed": [], "needless": ["module:deploy_qualify"], "observed": [], "observed_existing": [], "observed_new": [], "predicted_but_unaffected": ["module:deploy_qualify"], "predicted_existing_affected": ["module:deploy_qualify"], "scope_check": {"in_scope": [], "out_of_scope": ["scripts/check_warm_router_state_parity.py", "scripts/gen_warm_router_state_truth.py", "src/go/warm-router/gaps_state.go", "src/go/warm-router/main.go", "src/go/warm-router/truth_state.json", "src/go/warm-router/truth_state_test.go", "src/rune/warm_router.py"], "reason": "contract has no approved scope", "verdict": "unknown"}}.
## Evidence
- parity 7656f422
- parity 7656f422
- parity 7656f422
- closure-record
@@ -6712,3 +6712,8 @@
{"builder": "factory-heavy-te-fs", "detail": "BUILDER-2026-10-14T23:06:56Z-13f0bb-factory-heavy-te-fs \u2192 building", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T23:08:09Z", "operation": "transition"}
{"builder": "factory-heavy-te-fs", "detail": "BUILDER-2026-10-14T23:06:56Z-13f0bb-factory-heavy-te-fs \u2192 verifying", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T23:08:45Z", "operation": "transition"}
{"builder": "factory-heavy-te-fs", "detail": "BUILDER-2026-10-14T23:06:56Z-13f0bb-factory-heavy-te-fs closed", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T23:09:18Z", "operation": "close"}
{"builder": "factory-heavy-wr-state", "detail": "need-2026-10-14T23:20:22Z-factory-heavy-wr-state \u2192 REUSE", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T23:20:26Z", "operation": "submit_need"}
{"builder": "factory-heavy-wr-state", "detail": "BUILDER-2026-10-14T23:20:26Z-8e363b-factory-heavy-wr-state \u2192 approved", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T23:21:27Z", "operation": "transition"}
{"builder": "factory-heavy-wr-state", "detail": "BUILDER-2026-10-14T23:20:26Z-8e363b-factory-heavy-wr-state \u2192 building", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T23:22:24Z", "operation": "transition"}
{"builder": "factory-heavy-wr-state", "detail": "BUILDER-2026-10-14T23:20:26Z-8e363b-factory-heavy-wr-state \u2192 verifying", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T23:23:09Z", "operation": "transition"}
{"builder": "factory-heavy-wr-state", "detail": "BUILDER-2026-10-14T23:20:26Z-8e363b-factory-heavy-wr-state closed", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T23:23:47Z", "operation": "close"}
+1
View File
@@ -0,0 +1 @@
0