chore(store): close layout_contract dichotomy contract BUILDER-2026-10-14T05:21:12Z-4723a5-factory-gap-lc (parity 4bbed58d)

Walk draft->approved->building->verifying in one process; final entry
via close() per the quality-gate law (predicted-vs-observed
contract_quality computed; raw closed-transition refused — the first
walk attempt hit exactly that gate and completed through close()).
This commit is contained in:
Nick committed 2026-10-14 06:25:44 +01:00
1 parent ea7b9a0ca3
commit 4402c4284b
7 files changed
+6091

No files matched your search

+73
View File
@@ -0,0 +1,73 @@
#!/usr/bin/env python3
"""Close the #2479 dichotomy-wave layout_contract gap contract (Rust port).
Full lifecycle walk in ONE process (shared-store clobber hazard; segment
transitions take ~60s each — do NOT split across processes). Carries the
already-pushed parity SHA as evidence:
feat 9ed9a7a2 close PARTIAL gaps — dichotomy wave-5
Usage: close_contract_layout_contract.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 = "9ed9a7a2"
EVIDENCE = f"parity {PARITY_SHA}"
iface = ConstructionInterface(builder="factory-gap-lc")
r = iface.submit_need(
"layout_contract dichotomy gap-close (Rust): name-preserving port "
"of the 4 audit-missing functions (define_region, bind_component, "
"amend_layout_contract, record_layout_observation) into "
"src/rust/layout_contract/src/kernels.rs as pure doc-in/doc-out "
"kernels (now is an argument; structural_store merge law "
"replicated), FFI lc_define_region/lc_bind_component/"
"lc_amend_layout_contract/lc_record_observation + lc_replay, facade "
"delegation with ValueError translation and identity-preserving "
"absorb, freeze rig scripts/lc_freeze_seams (blanket + EXPLICIT "
"core pins, frozen clock on both now seams, doc-carrying wrappers), "
"35-case frozen corpus frozen_lc_gap_truth.json via the shared "
"harness verified byte-identical, gap_battery 10/10 (verbatim "
"replay + FFI roundtrip + branch proofs), clippy -D warnings clean, "
"live parity 35/35 + byte-identical re-freeze "
"(scripts/check_layout_contract_parity.py), layout+consumer tests "
"64/64 BOTH pins. Ladder caught and fixed 4 real divergences "
"pre-commit: re-bind assigns a fresh amendments ledger; identities "
"merge is wholesale key assignment (add_entity .update() law); "
"framework detail rides **framework_attrs (no named param); "
"serde_json preserve_order for insertion-order stability. Dichotomy "
"audit 2/6 PARTIAL -> 6/6 FULL (RUST). 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", "closed"):
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)
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,59 @@
#!/usr/bin/env python3
"""Complete the layout_contract dichotomy close: the walk reached
'verifying' (BUILDER-2026-10-14T05:21:12Z-4723a5-factory-gap-lc); the
final step must enter via close() — the quality-gate law (2026-10-13)
requires the predicted-vs-observed contract_quality computation, not a
raw transition. One process, no interleaved writers.
Usage: complete_close_contract_layout_contract.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 = "9ed9a7a2"
EVIDENCE = f"parity {PARITY_SHA}"
CID = "BUILDER-2026-10-14T05:21:12Z-4723a5-factory-gap-lc"
iface = ConstructionInterface(builder="factory-gap-lc")
r = iface.close(
CID,
observed_evidence=[
{"kind": "port_evidence", "detail": "parity " + PARITY_SHA,
"entity": "module:layout_contract"},
{"kind": "port_evidence", "detail":
"frozen corpus 35 cases byte-identical (frozen_lc_gap_truth.json); "
"gap_battery 10/10; clippy -D warnings clean",
"entity": "module:layout_contract"},
{"kind": "port_evidence", "detail":
"live parity 35/35 + byte-identical re-freeze "
"(scripts/check_layout_contract_parity.py); layout+consumer tests "
"64/64 BOTH pins",
"entity": "module:layout_contract"},
{"kind": "port_evidence", "detail":
"dichotomy audit 2/6 PARTIAL -> 6/6 FULL (RUST)",
"entity": "module:layout_contract"},
],
)
print("close:", json.dumps(r)[:400])
if not r.get("success"):
print("CLOSE FAILED — aborting")
sys.exit(1)
doc = iface.scaffold.load()
e = iface.scaffold.contract(doc, CID)
print("FINAL PHASE:", e.get("phase") if e else "MISSING")
if not e or e.get("phase") != "closed":
sys.exit(1)
print("CLOSED", CID)
@@ -0,0 +1,24 @@
# Contract BUILDER-2026-10-14T05:21:12Z-4723a5-factory-gap-lc
**Phase:** closed · **Mode:** n/a · **Depth:** n/a
## What was built
layout_contract dichotomy gap-close (Rust): name-preserving port of the 4 audit-missing functions (define_region, bind_component, amend_layout_contract, record_layout_observation) into src/rust/layout_contract/src/kernels.rs as pure doc-in/doc-out kernels (now is an argument; structural_store merge law replicated), FFI lc_define_region/lc_bind_component/lc_amend_layout_contract/lc_record_observation + lc_replay, facade delegation with ValueError translation and identity-preserving absorb, freeze rig scripts/lc_freeze_seams (blanket + EXPLICIT core pins, frozen clock on both now seams, doc-carrying wrappers), 35-case frozen corpus frozen_lc_gap_truth.json via the shared harness verified byte-identical, gap_battery 10/10 (verbatim replay + FFI roundtrip + branch proofs), clippy -D warnings clean, live parity 35/35 + byte-identical re-freeze (scripts/check_layout_contract_parity.py), layout+consumer tests 64/64 BOTH pins. Ladder caught and fixed 4 real divergences pre-commit: re-bind assigns a fresh amendments ledger; identities merge is wholesale key assignment (add_entity .update() law); framework detail rides **framework_attrs (no named param); serde_json preserve_order for insertion-order stability. Dichotomy audit 2/6 PARTIAL -> 6/6 FULL (RUST). Delivered on gitea/master: feat 9ed9a7a2.
## 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": [{"entity": "module:layout_contract", "note": "genuinely unexpected new surface \u2014 evidence required before store update", "status": "CANDIDATE"}], "captured_at": "2026-10-14T05:24:41Z", "contract": "BUILDER-2026-10-14T05:21:12Z-4723a5-factory-gap-lc", "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": ["module:layout_contract"], "missed": ["module:layout_contract"], "needless": ["module:deploy_qualify"], "observed": ["module:layout_contract"], "observed_existing": [], "observed_new": ["module:layout_contract"], "predicted_but_unaffected": ["module:deploy_qualify"], "predicted_existing_affected": ["module:deploy_qualify"]}.
## Evidence
- parity 9ed9a7a2
- parity 9ed9a7a2
- parity 9ed9a7a2
- closure-record
@@ -6567,3 +6567,12 @@
{"builder": "factory-gap-stm", "detail": "BUILDER-2026-10-14T05:01:34Z-f0cd1b-factory-gap-stm \u2192 building", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T05:02:08Z", "operation": "transition"}
{"builder": "factory-gap-stm", "detail": "BUILDER-2026-10-14T05:01:34Z-f0cd1b-factory-gap-stm \u2192 verifying", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T05:02:23Z", "operation": "transition"}
{"builder": "factory-gap-stm", "detail": "BUILDER-2026-10-14T05:01:34Z-f0cd1b-factory-gap-stm closed", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T05:02:43Z", "operation": "close"}
{"builder": "factory-gap-lc", "detail": "need-2026-10-14T05:21:09Z-factory-gap-lc \u2192 REUSE", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T05:21:12Z", "operation": "submit_need"}
{"builder": "factory-gap-lc", "detail": "BUILDER-2026-10-14T05:21:12Z-4723a5-factory-gap-lc \u2192 approved", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T05:21:43Z", "operation": "transition"}
{"builder": "factory-gap-lc", "detail": "BUILDER-2026-10-14T05:21:12Z-4723a5-factory-gap-lc \u2192 building", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T05:22:13Z", "operation": "transition"}
{"builder": "factory-gap-lc", "detail": "BUILDER-2026-10-14T05:21:12Z-4723a5-factory-gap-lc \u2192 verifying", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T05:22:50Z", "operation": "transition"}
{"authority": "", "detail": "parity 9ed9a7a2", "entity": "module:layout_contract", "kind": "observed_consequence", "observed_at": "2026-10-14T05:24:41Z", "source": "unattributed", "task": "BUILDER-2026-10-14T05:21:12Z-4723a5-factory-gap-lc"}
{"authority": "", "detail": "frozen corpus 35 cases byte-identical (frozen_lc_gap_truth.json); gap_battery 10/10; clippy -D warnings clean", "entity": "module:layout_contract", "kind": "observed_consequence", "observed_at": "2026-10-14T05:24:41Z", "source": "unattributed", "task": "BUILDER-2026-10-14T05:21:12Z-4723a5-factory-gap-lc"}
{"authority": "", "detail": "live parity 35/35 + byte-identical re-freeze (scripts/check_layout_contract_parity.py); layout+consumer tests 64/64 BOTH pins", "entity": "module:layout_contract", "kind": "observed_consequence", "observed_at": "2026-10-14T05:24:41Z", "source": "unattributed", "task": "BUILDER-2026-10-14T05:21:12Z-4723a5-factory-gap-lc"}
{"authority": "", "detail": "dichotomy audit 2/6 PARTIAL -> 6/6 FULL (RUST)", "entity": "module:layout_contract", "kind": "observed_consequence", "observed_at": "2026-10-14T05:24:41Z", "source": "unattributed", "task": "BUILDER-2026-10-14T05:21:12Z-4723a5-factory-gap-lc"}
{"builder": "factory-gap-lc", "detail": "BUILDER-2026-10-14T05:21:12Z-4723a5-factory-gap-lc closed", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T05:24:41Z", "operation": "close"}
+1
View File
@@ -0,0 +1 @@
exit=1
+1
View File
@@ -0,0 +1 @@
exit=0