chore(store): close dependency_tracker dichotomy contract BUILDER-2026-10-14T20:12:04Z-d4f7b5-factory-gap-dt (parity 795e4291; phase B e4ff44c0)

One-process walk draft->approved->building->verifying->closed via
iface.close(contract_quality observed_evidence + scope_files). Evidence:
scripts/close_contract_dependency_tracker.py, verification/dt-*
This commit is contained in:
Nick committed 2026-10-14 21:15:55 +01:00
1 parent b965e64107
commit 7001fce0d2
5 files changed
+6114

No files matched your search

@@ -0,0 +1,158 @@
#!/usr/bin/env python3
"""Close the #2479 dichotomy-wave dependency_tracker gap contract (RUST
port). Full lifecycle walk in ONE process (shared-store clobber hazard;
segment transitions take ~60s each — do NOT split across processes). 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 SHAs as evidence:
feat 2c308d90 close PARTIAL gaps — dichotomy wave (2/5 -> 6/6)
refactor a8a6efd7 Phase B language-advantage pass
Usage: close_contract_dependency_tracker.py [contract_id]
"""
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",
)
os.environ.setdefault(
"DT_RUST_LIB",
"/mnt/workdrive/rune-wave-dl/src/rust/dependency_tracker/target/release/libdependency_tracker.so",
)
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
from rune.construction_interface import ConstructionInterface
PARITY_SHA = "2c308d90"
PHASEB_SHA = "a8a6efd7"
EVIDENCE = f"parity {PARITY_SHA}, phase B {PHASEB_SHA}"
NEED = (
"dependency_tracker dichotomy gap-close (RUST): name-preserving port "
"of the 3 audit-missing functions (check_propagation, get_full_map, "
"main) into src/rust/dependency_tracker — and wholesale replacement "
"of the W6-era stub whose get_dependents/propagate were semantically "
"INVERTED (map KEYS collected for value-list hits; transitive BFS "
"where the oracle classifies direct dependents; audit_ledger "
"one-chain precedent). Kernels: get_dependents (posix basename + map "
"lookup), check_propagation, propagate (full classification matrix — "
"propagated-with-reference / not-found / no-direct-reference / "
"IsADirectoryError crash-parity with errno mapping and "
"Display-suffix stripping; dry_run would-update short-circuit), "
"get_full_map (dict INSERTION order — the warm_router dict-literal "
"overwrite quirk: first position, last value), main (CLI mirror, "
"pure fn over argv incl. the frozen argparse help). Facade seam: the "
"4 compute fns delegate via dt_loader (RUNE_DEPENDENCY_TRACKER_CORE="
"python pins the load-bearing Python bodies); SCRIPTS_DIR stays "
"import-time Python and rides the propagate payload; main() stays "
"Python argparse (process boundary); main_cli is the JSON-native "
"stdout+rc capture mirror. New quirk proved and recorded: Python "
"3.14 OSError.__str__ QUOTES the filename (frozen battery row 20). "
"Frozen truth 24 rows via the shared freeze_truth harness under "
"scripts/dt_freeze_seams (HOME='.' + cwd-is-the-rig + deterministic "
"fixture tree; COLUMNS=80 help width pin), byte-identical across "
"repeated --verify runs; cargo battery replays the truth VERBATIM "
"in order (to_string equality pins dict insertion order); live "
"parity 72/72 (pinned facade / live facade / kernel direct); clippy "
"-D warnings + fmt clean; Python suite both pins: failure set "
"byte-identical across pins AND the stashed base (244 pre-existing, "
"none touching this module); ruff clean; spine scope test green. "
"Dichotomy audit 2/5 PARTIAL -> 6/6 FULL (RUST). Delivered on "
"gitea/master: feat " + PARITY_SHA + ", phase B " + PHASEB_SHA + "."
)
iface = ConstructionInterface(builder="factory-gap-dt")
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": "dependency_tracker dichotomy completion — parity "
f"{PARITY_SHA} feat(dependency_tracker): close PARTIAL "
"gaps — dichotomy wave; pushed gitea/master (ancestor-"
"verified). Rust port at src/rust/dependency_tracker "
"closes the audit gaps name-preserving (6/6 FULL: the 5 "
"oracle fns + the main_cli mirror) and REPLACES the "
"inverted W6 stub. Generator scripts/"
"gen_dependency_tracker_truth.py: 24-row frozen truth "
"(shared freeze_truth harness under scripts/"
"dt_freeze_seams — HOME='.' cwd-is-the-rig, "
"deterministic fixture tree, COLUMNS=80) regenerates "
"byte-identical; freeze_truth --verify OK twice against "
"the pinned oracle. Battery gap_battery.rs replays the "
"truth VERBATIM in order (to_string equality pins dict "
"insertion order); live parity "
"scripts/check_dependency_tracker_parity.py 72/72 "
"(pinned facade / live facade / kernel direct); clippy "
"-D warnings + fmt clean; Python both pins: failure set "
"byte-identical across pins and the stashed base (244 "
"pre-existing, none touching this module); ruff clean. "
"New quirk recorded in docs/dichotomy-oracle-quirks."
"json: Python 3.14 OSError.__str__ quotes the filename "
"(proved by frozen battery row 20). Phase B "
f"{PHASEB_SHA}: subcommand enum + exhaustive match "
"dispatch, fmt::Write rendering, shared section() "
"renderer — behavior-identical, battery + parity "
"re-green. Divergences (documented): SCRIPTS_DIR is "
"import-time Python and rides the FFI payload; Rust "
"main mirrors well-formed CLI invocations + the no-cmd "
"help branch (argparse error machinery stays Python — "
"the facade main never delegates); argparse help width "
"pinned at 80 by the rig.",
}],
scope_files=[
"src/rust/dependency_tracker/src/lib.rs",
"src/rust/dependency_tracker/src/gap_battery.rs",
"src/rust/dependency_tracker/src/frozen_dt_truth.json",
"src/rust/dependency_tracker/Cargo.toml",
"src/rune/dependency_tracker.py",
"src/rune/dt_loader.py",
"scripts/dt_freeze_seams/sitecustomize.py",
"scripts/gen_dependency_tracker_truth.py",
"scripts/check_dependency_tracker_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-14T20:12:04Z-d4f7b5-factory-gap-dt
**Phase:** closed · **Mode:** n/a · **Depth:** n/a
## What was built
dependency_tracker dichotomy gap-close (RUST): name-preserving port of the 3 audit-missing functions (check_propagation, get_full_map, main) into src/rust/dependency_tracker — and wholesale replacement of the W6-era stub whose get_dependents/propagate were semantically INVERTED (map KEYS collected for value-list hits; transitive BFS where the oracle classifies direct dependents; audit_ledger one-chain precedent). Kernels: get_dependents (posix basename + map lookup), check_propagation, propagate (full classification matrix — propagated-with-reference / not-found / no-direct-reference / IsADirectoryError crash-parity with errno mapping and Display-suffix stripping; dry_run would-update short-circuit), get_full_map (dict INSERTION order — the warm_router dict-literal overwrite quirk: first position, last value), main (CLI mirror, pure fn over argv incl. the frozen argparse help). Facade seam: the 4 compute fns delegate via dt_loader (RUNE_DEPENDENCY_TRACKER_CORE=python pins the load-bearing Python bodies); SCRIPTS_DIR stays import-time Python and rides the propagate payload; main() stays Python argparse (process boundary); main_cli is the JSON-native stdout+rc capture mirror. New quirk proved and recorded: Python 3.14 OSError.__str__ QUOTES the filename (frozen battery row 20). Frozen truth 24 rows via the shared freeze_truth harness under scripts/dt_freeze_seams (HOME='.' + cwd-is-the-rig + deterministic fixture tree; COLUMNS=80 help width pin), byte-identical across repeated --verify runs; cargo battery replays the truth VERBATIM in order (to_string equality pins dict insertion order); live parity 72/72 (pinned facade / live facade / kernel direct); clippy -D warnings + fmt clean; Python suite both pins: failure set byte-identical across pins AND the stashed base (244 pre-existing, none touching this module); ruff clean; spine scope test green. Dichotomy audit 2/5 PARTIAL -> 6/6 FULL (RUST). Delivered on gitea/master: feat 2c308d90, phase B a8a6efd7.
## 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-14T20:14:24Z", "contract": "BUILDER-2026-10-14T20:12:04Z-d4f7b5-factory-gap-dt", "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_dependency_tracker_parity.py", "scripts/dt_freeze_seams/sitecustomize.py", "scripts/gen_dependency_tracker_truth.py", "src/rune/dependency_tracker.py", "src/rune/dt_loader.py", "src/rust/dependency_tracker/Cargo.toml", "src/rust/dependency_tracker/src/frozen_dt_truth.json", "src/rust/dependency_tracker/src/gap_battery.rs", "src/rust/dependency_tracker/src/lib.rs"], "reason": "contract has no approved scope", "verdict": "unknown"}}.
## Evidence
- parity 2c308d90, phase B a8a6efd7
- parity 2c308d90, phase B a8a6efd7
- parity 2c308d90, phase B a8a6efd7
- closure-record
@@ -6697,3 +6697,8 @@
{"builder": "factory-gap-pd", "detail": "BUILDER-2026-10-14T20:09:13Z-982d85-factory-gap-pd \u2192 building", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T20:10:11Z", "operation": "transition"}
{"builder": "factory-gap-pd", "detail": "BUILDER-2026-10-14T20:09:13Z-982d85-factory-gap-pd \u2192 verifying", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T20:10:38Z", "operation": "transition"}
{"builder": "factory-gap-pd", "detail": "BUILDER-2026-10-14T20:09:13Z-982d85-factory-gap-pd closed", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T20:11:09Z", "operation": "close"}
{"builder": "factory-gap-dt", "detail": "need-2026-10-14T20:12:02Z-factory-gap-dt \u2192 REUSE", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T20:12:04Z", "operation": "submit_need"}
{"builder": "factory-gap-dt", "detail": "BUILDER-2026-10-14T20:12:04Z-d4f7b5-factory-gap-dt \u2192 approved", "kind": "builder_session", "mode": "rune_internal", "observed_at": "2026-10-14T20:12:37Z", "operation": "transition"}
{"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"}
+1
View File
@@ -0,0 +1 @@
0