chore(store): close warm_router routing-family dichotomy contract BUILDER-2026-10-14T23:05:18Z-0b44ed-factory-heavy-wr-route (parity 9102fc2b)

This commit is contained in:
Nick committed 2026-10-15 00:09:28 +01:00
1 parent 9102fc2be6
commit 349068164d
4 files changed
+6112

No files matched your search

@@ -0,0 +1,158 @@
#!/usr/bin/env python3
"""Close the #2479 dichotomy-wave warm_router routing-family gap
contract (GO port, builder factory-heavy-wr-route). Full lifecycle walk
in ONE process (shared-store clobber hazard). The final step is
iface.close() with contract_quality observed_evidence (the bare
`transition -> closed` is rejected by the quality gate). Safe to re-run:
pass the existing contract id to resume an interrupted walk.
Carries the already-pushed parity SHA as evidence:
feat 1f0cb4bb close PARTIAL gaps — dichotomy wave (family 11/16 -> 16/16)
Usage: close_contract_warm_router_routing.py [contract_id]
"""
import json
import os
import sys
from pathlib import Path
os.environ.setdefault(
"CS_RUST_LIB",
str(Path(__file__).resolve().parents[1] / "src" / "rust" / "capability_scoring"
/ "target" / "release" / "libcapability_scoring.so"),
)
os.environ.setdefault(
"MS_RUST_LIB",
str(Path(__file__).resolve().parents[1] / "src" / "rust" / "memory_scoring"
/ "target" / "release" / "libmemory_scoring.so"),
)
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
from rune.construction_interface import ConstructionInterface
PARITY_SHA = "1f0cb4bb"
EVIDENCE = f"parity {PARITY_SHA}"
NEED = (
"warm_router dichotomy gap-close (GO, routing/activation/scoring "
"family): name-preserving port of the five audit-missing functions "
"into src/go/warm-router/gaps_routing.go — BaseLevelActivation "
"(cold-start -2.0 + ACT-R delegation), PrimedAssociations "
"(neighbour slugs x 0.5, primed excluded), AssociatedNeuronBodies "
"(seen-set skip with empty-body slug burn, summary-or-text bodies, "
"rune-count tokens, BREAK on budget overflow, round-half-even "
"strength, empty slug -> assoc), GraphContext (dict/list payload "
"shapes, facts[:limit] with Python negative-slice semantics, bare "
"header on limit-0-with-facts), RenderFired (via_association "
"outranks compressed) — plus the gap-cli JSON parity surface. TWO "
"latent defects fixed with proof: (1) warm_router.py "
"_primed_associations bound only (limit,) for a statement with "
"len(ids)+1 placeholders — every call raised ProgrammingError and "
"returned [], the association-neighbour priming walk was dead code "
"in production (now binds (*ids, limit)); (2) main.go "
"baseLevelFromUses parsed nowISO with a literal-Z layout so +00:00 "
"stamps fell back to the wall clock (now RFC3339 first — the "
"frozen battery caught it). Frozen truth 34 rows via the shared "
"freeze_truth harness under scripts/wr_freeze_seams (hermetic "
"RUNE_MEMORY_DIR rig, idempotent sitecustomize so the graph_memory "
"subprocess shares the fixtures, RUNE_GRAPH_MEMORY_CORE=python pin, "
"live MS_RUST_LIB delegation — the retired Python fallback recurses "
"to -2.0 and is NOT the math contract), byte-identical across "
"repeated --verify runs; battery truth_gap_test.go replays all 34 "
"rows (mirrored gathers documented from the rig fixtures); live "
"parity scripts/check_warm_router_gap_parity.py 60/60 (oracle "
"end-to-end vs Go binary fed the oracle's own gather SQL, fixture "
"extension beyond the frozen corpus); go build/vet/gofmt clean; "
"Python tests/test_warm_router_correctness.py 5/5 on the "
"delegation pin, python-pin failures pre-exist on the stashed tree "
"(retired-fallback degradation; Go-only lane). Family coverage "
"11/16 -> 16/16; module 17/33 -> 22/33 (remaining 11 fns are other "
"families' files). Delivered on gitea/master: feat " + PARITY_SHA + "."
)
iface = ConstructionInterface(builder="factory-heavy-wr-route")
if len(sys.argv) > 1:
cid = sys.argv[1]
print("resuming contract:", cid)
else:
r = iface.submit_need(NEED, 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)
def phase_of(cid):
doc = iface.scaffold.load()
e = iface.scaffold.contract(doc, cid)
return e.get("phase") if e else "MISSING"
phase = phase_of(cid)
print("current phase:", phase)
for want in ("approved", "building", "verifying"):
if phase == want or phase in ("verifying", "closed"):
break
t = iface.transition(cid, want, evidence_ref=EVIDENCE)
ok = t.get("success")
print(f"transition->{want}:", "ok" if ok else json.dumps(t)[:300])
if not ok:
sys.exit(1)
phase = want
c = iface.close(
cid,
observed_evidence=[{
"kind": "port_evidence",
"detail": "warm_router routing-family dichotomy completion — "
f"parity {PARITY_SHA} feat(warm_router): close PARTIAL "
"gaps — dichotomy wave; pushed gitea/master (fetch-"
"verified). Go port at src/go/warm-router/"
"gaps_routing.go closes the family gaps name-preserving "
"(BaseLevelActivation, PrimedAssociations, "
"AssociatedNeuronBodies, GraphContext, RenderFired — "
"16/16 family coverage; module 22/33, remaining fns in "
"other families). Generator scripts/"
"gen_warm_router_gap_truth.py: 34-row frozen truth "
"(shared freeze_truth harness under scripts/"
"wr_freeze_seams — hermetic memory root, idempotent "
"sitecustomize shared with the graph_memory subprocess, "
"live MS_RUST_LIB delegation) regenerates "
"byte-identical; freeze_truth --verify OK. Battery "
"truth_gap_test.go replays the truth verbatim in order "
"(mirrored gathers documented from the rig fixtures); "
"live parity scripts/check_warm_router_gap_parity.py "
"60/60; go build/vet/gofmt clean; Python suite green "
"on the delegation pin (python-pin failures pre-exist "
"on the stashed base — retired-fallback -2.0 "
"degradation). Oracle bug fixed with proof: "
"_primed_associations binding-count ProgrammingError "
"(dead association-neighbour priming walk; now binds "
"(*ids, limit)); latent Go wall-clock fallback in "
"baseLevelFromUses now-parse fixed (RFC3339 first). "
"Divergences (documented in verification/"
"summary-wr-family.md): bare graph header on "
"limit-0-with-facts; incoming-edge facts append "
"without dedupe (mirrored verbatim).",
}],
scope_files=[
"src/go/warm-router/gaps_routing.go",
"src/go/warm-router/truth_gap.json",
"src/go/warm-router/truth_gap_test.go",
"src/go/warm-router/main.go",
"src/rune/warm_router.py",
"scripts/wr_freeze_seams/sitecustomize.py",
"scripts/gen_warm_router_gap_truth.py",
"scripts/check_warm_router_gap_parity.py",
],
)
print("close:", json.dumps(c)[:400])
final = phase_of(cid)
print("FINAL PHASE:", final)
ok = c.get("success") and final == "closed"
print("CLOSED" if ok else "CLOSE_FAILED", cid)
sys.exit(0 if ok else 1)
@@ -0,0 +1,24 @@
# Contract BUILDER-2026-10-14T23:05:18Z-0b44ed-factory-heavy-wr-route
**Phase:** closed · **Mode:** n/a · **Depth:** n/a
## What was built
warm_router dichotomy gap-close (GO, routing/activation/scoring family): name-preserving port of the five audit-missing functions into src/go/warm-router/gaps_routing.go — BaseLevelActivation (cold-start -2.0 + ACT-R delegation), PrimedAssociations (neighbour slugs x 0.5, primed excluded), AssociatedNeuronBodies (seen-set skip with empty-body slug burn, summary-or-text bodies, rune-count tokens, BREAK on budget overflow, round-half-even strength, empty slug -> assoc), GraphContext (dict/list payload shapes, facts[:limit] with Python negative-slice semantics, bare header on limit-0-with-facts), RenderFired (via_association outranks compressed) — plus the gap-cli JSON parity surface. TWO latent defects fixed with proof: (1) warm_router.py _primed_associations bound only (limit,) for a statement with len(ids)+1 placeholders — every call raised ProgrammingError and returned [], the association-neighbour priming walk was dead code in production (now binds (*ids, limit)); (2) main.go baseLevelFromUses parsed nowISO with a literal-Z layout so +00:00 stamps fell back to the wall clock (now RFC3339 first — the frozen battery caught it). Frozen truth 34 rows via the shared freeze_truth harness under scripts/wr_freeze_seams (hermetic RUNE_MEMORY_DIR rig, idempotent sitecustomize so the graph_memory subprocess shares the fixtures, RUNE_GRAPH_MEMORY_CORE=python pin, live MS_RUST_LIB delegation — the retired Python fallback recurses to -2.0 and is NOT the math contract), byte-identical across repeated --verify runs; battery truth_gap_test.go replays all 34 rows (mirrored gathers documented from the rig fixtures); live parity scripts/check_warm_router_gap_parity.py 60/60 (oracle end-to-end vs Go binary fed the oracle's own gather SQL, fixture extension beyond the frozen corpus); go build/vet/gofmt clean; Python tests/test_warm_router_correctness.py 5/5 on the delegation pin, python-pin failures pre-exist on the stashed tree (retired-fallback degradation; Go-only lane). Family coverage 11/16 -> 16/16; module 17/33 -> 22/33 (remaining 11 fns are other families' files). Delivered on gitea/master: feat 1f0cb4bb.
## 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:07:32Z", "contract": "BUILDER-2026-10-14T23:05:18Z-0b44ed-factory-heavy-wr-route", "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_gap_parity.py", "scripts/gen_warm_router_gap_truth.py", "scripts/wr_freeze_seams/sitecustomize.py", "src/go/warm-router/gaps_routing.go", "src/go/warm-router/main.go", "src/go/warm-router/truth_gap.json", "src/go/warm-router/truth_gap_test.go", "src/rune/warm_router.py"], "reason": "contract has no approved scope", "verdict": "unknown"}}.
## Evidence
- parity 1f0cb4bb
- parity 1f0cb4bb
- parity 1f0cb4bb
- closure-record
@@ -6702,3 +6702,8 @@
{"builder": "factory-gap-dt", "detail": "BUILDER-2026-10-14T20:12:04Z-d4f7b5-factory-gap-dt \u2192 building", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T20:13:25Z", "operation": "transition"}
{"builder": "factory-gap-dt", "detail": "BUILDER-2026-10-14T20:12:04Z-d4f7b5-factory-gap-dt \u2192 verifying", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T20:13:57Z", "operation": "transition"}
{"builder": "factory-gap-dt", "detail": "BUILDER-2026-10-14T20:12:04Z-d4f7b5-factory-gap-dt closed", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T20:14:24Z", "operation": "close"}
{"builder": "factory-heavy-wr-route", "detail": "need-2026-10-14T23:05:16Z-factory-heavy-wr-route \u2192 REUSE", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T23:05:18Z", "operation": "submit_need"}
{"builder": "factory-heavy-wr-route", "detail": "BUILDER-2026-10-14T23:05:18Z-0b44ed-factory-heavy-wr-route \u2192 approved", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T23:05:51Z", "operation": "transition"}
{"builder": "factory-heavy-wr-route", "detail": "BUILDER-2026-10-14T23:05:18Z-0b44ed-factory-heavy-wr-route \u2192 building", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T23:06:22Z", "operation": "transition"}
{"builder": "factory-heavy-wr-route", "detail": "BUILDER-2026-10-14T23:05:18Z-0b44ed-factory-heavy-wr-route \u2192 verifying", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T23:06:57Z", "operation": "transition"}
{"builder": "factory-heavy-wr-route", "detail": "BUILDER-2026-10-14T23:05:18Z-0b44ed-factory-heavy-wr-route closed", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T23:07:32Z", "operation": "close"}