Files
rune/scripts/close_contract_failure_auto_filer.py
Nick 2fd1a14ac6
CI Pipeline / best-practices (push) Successful in 7s
CI Pipeline / documentation (push) Successful in 4s
CI Pipeline / rust-surface (push) Failing after 14s
CI Pipeline / go-surface (push) Failing after 17s
CI Pipeline / gitea-offline (push) Successful in 17s
Auto-version and Release / release (push) Successful in 43s
CI Pipeline / required-checks (push) Canceled after 0s
CI Pipeline / CI Pipeline / notify-event-bridge (push) Canceled after 0s
CI Pipeline / lint (push) Canceled after 49s
deploy / deploy (push) Canceled after 55s
CI Pipeline / canary (push) Canceled after 50s
CI Pipeline / unit-tests (push) Canceled after 58s
CI Pipeline / type-check (push) Canceled after 46s
chore(store): close failure_auto_filer dichotomy contract BUILDER-2026-10-13T05:56:22Z-3258b3-factory-gap-faf (feat 5cadd401, phase B 8aa48134)
2026-10-13 07:18:27 +01:00

68 lines
3.5 KiB
Python

#!/usr/bin/env python3
"""Close the #2479 dichotomy-wave construction contract for
failure_auto_filer with SHA evidence."""
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
cid = sys.argv[1]
iface = ConstructionInterface(builder="factory-gap-faf")
c = iface.close(cid, observed_evidence=[{
"kind": "port_evidence",
"detail": "failure_auto_filer dichotomy gap-close — feat 5cadd401 "
"feat(failure_auto_filer): close PARTIAL gaps — dichotomy "
"wave; Phase B 8aa48134 refactor(failure_auto_filer): Phase "
"B language-advantage pass — dichotomy wave (both pushed "
"gitea/master). PARTIAL 11-fn Go port extended to 25/28 "
"audit fns (89%; the 3 SpoolJournal protocol declarations "
"are the Go SpoolJournal interface): _error_text, "
"JsonlSpool append/unconsumed/mark_consumed, "
"FailureAutoFiler __call__/submit/drain/file/reconcile/"
"_write/_write_once/_spool/_run_worker/_process_batch/"
"_flush_group/_drain_once — logic 1:1, forge/journal/clock "
"IO behind injectable seams (ForgeClient + SpoolJournal "
"interfaces, monotonic/nowUTC/timeNS vars), no goroutine "
"spawns in test paths (wait=true synchronous mode; "
"runWorker smoke-tested synchronously via shutdown "
"sentinel). Truth frozen via shared scripts/freeze_truth."
"py: 37 pure-fn cases VERIFIED byte-identical against live "
"oracle (PYTHONPATH=src python3 scripts/freeze_truth.py "
"--verify src/go/failure-filer/"
"frozen_failure_auto_filer_truth.json --module "
"rune.failure_auto_filer) + 20 deterministic scenario "
"traces (fake client/journal, pinned _now) replayed "
"verbatim in Go — live parity 20/20 scenarios + 37/37 "
"frozen cases. go test ok (incl. pre-existing "
"TestFilerParity), gofmt + go vet clean. Python tests "
"green both delegation-live and RUNE_FAILURE_AUTO_FILER_"
"CORE=python pinned (73 passed x2). Oracle-fidelity fixes "
"with proof: errorClassOf TrimSuffix→TrimRight (oracle "
"rstrip(':') strips ALL trailing colons), EXCERPT_LEN "
"256→200 (oracle _EXCERPT_LEN), excerpt byte→rune "
"truncation (oracle slices str). Divergence noted: "
"exception-input branches (error_class_of on a "
"BaseException) are covered by Go unit tests — exceptions "
"are not JSON-expressible so they cannot ride the frozen "
"truth; non-ASCII excerpt inputs use ASCII-only frozen "
"cases (rune truncation ported).",
}], scope_files=[
"src/rune/failure_auto_filer.py",
"src/go/failure-filer/main.go",
"src/go/failure-filer/spool.go",
"src/go/failure-filer/filer.go",
"src/go/failure-filer/battery_test.go",
"src/go/failure-filer/scenario_test.go",
"src/go/failure-filer/frozen_failure_auto_filer_truth.json",
"src/go/failure-filer/frozen_filer_scenarios.json",
"scripts/gen_failure_auto_filer_truth.py",
"scripts/walk_contract_failure_auto_filer.py",
"scripts/close_contract_failure_auto_filer.py",
])
print("close:", json.dumps(c)[:300])
print("CONTRACT", cid, "closed" if c.get("success") else "CLOSE_FAILED")