108 lines
5.4 KiB
Python
108 lines
5.4 KiB
Python
#!/usr/bin/env python3
|
|
"""Close the #2479 dichotomy-wave contract for the rune_operator
|
|
routing/transport/execution family in ONE process (submit → approved →
|
|
building → verifying → closed), with SHA evidence. Run with CS_RUST_LIB
|
|
pointing at a built capability_scoring .so."""
|
|
import json
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))
|
|
|
|
PARITY_SHA = sys.argv[1] if len(sys.argv) > 1 else ""
|
|
if not PARITY_SHA:
|
|
sys.exit("usage: walk_close_contract_rune_operator_exec.py <parity_sha>")
|
|
|
|
from rune.construction_interface import ConstructionInterface
|
|
|
|
iface = ConstructionInterface(builder="factory-heavy-ro-exec")
|
|
|
|
r = iface.submit_need(
|
|
"Port the rune_operator routing/transport/execution family to FULL "
|
|
"Go (#2479 dichotomy tranche, GO verdict — module was 29/68 PARTIAL, "
|
|
"family lane): the 25 audit-named missing fns name-preserving 1:1 in "
|
|
"src/go/operator-deep/gaps_execution.go — both _build_model_router "
|
|
"defs (module seam + per-run method, tier-1 health degrade), "
|
|
"_sorted_tool_names (set-dedup + non-str drop + non-iterable floor), "
|
|
"_filter_safety_noise, _transport_for (provider-prefix rule "
|
|
"is_cloud_pinned imported-not-copied: non-ollama/local prefixes ride "
|
|
"the [OI]-compat wire), _runtime_for_model (pending exposed_tools "
|
|
"win, deterministic re-selection, full-TOOLS degrade), "
|
|
"_capability_selection (per-description cache, empty/raise degrade "
|
|
"with reason propagation), _conversation_messages (completed-only "
|
|
"canonical ledger, PAST TASK context-only labeling, limit*2 cap), "
|
|
"_attach_runtime_objects + the frozen _verification_and_outcome "
|
|
"method contract, _apply_runtime_result (canonical-first ordering, "
|
|
"awaiting_approval persistence, assistant-turn append, task.failed "
|
|
"emission), _ensure_canonical backfill, _channel_for_task, "
|
|
"_response_envelope (asdict-order byte parity incl. the pending "
|
|
"needs_confirm/tool_call/tool_result projection), _context_broker "
|
|
"(bucket-order contributor registration, build-once), the six "
|
|
"_contributor_* blocks (persona verbatim incl. SHA-pinned "
|
|
"_PERSONA_PROMPT, tools with find_capability escape hatch, "
|
|
"fail-closed memory with session abstention ledger, model profile, "
|
|
"history, routed user), _execute_on_model (profile-tier baseline, "
|
|
"trace-backed token accounting, size-class timeouts, refusal-"
|
|
"escalation tier loop, nested _fold_attempt usage-delta folding, "
|
|
"pending-state capsule embedding with per-block content, "
|
|
"calibration, degraded surfacing, first-class runtime objects, the "
|
|
"ordered inference-trace record + routing-profile merge-back, crash-"
|
|
"parity failure envelope), _finalize_runtime_response (valid-final "
|
|
"recording), _log_token_usage (10MB rotation), _wire_auto_filer "
|
|
"(composition-root wiring, AUTOFILE_OFF gate, never-raises) and "
|
|
"_reconcile_guarded. IO behind ExecEnv seams (journal + OD ordered-"
|
|
"dict emission with Python json.dumps byte parity: insertion order, "
|
|
"', '/': ' separators, integral floats N.0). Frozen truth 72 rows "
|
|
"(truth_execution.json via scripts/roexec_freeze.py — pinned "
|
|
"clock/uuid/monotonic ladders, hermetic HOME, journaling seam "
|
|
"fakes, runtime-object id placeholder law) regenerated "
|
|
"byte-identical x3 (sha256 866f958e); Go battery 72/72 + the full "
|
|
"operator-deep suite green; live parity frozen == regenerated "
|
|
"(scripts/check_ro_exec_parity.py, exit 0); gofmt/vet/go build "
|
|
"clean; pytest 53 passed BOTH pins (RUNE_OPERATOR_CORE pin proven "
|
|
"vacuous, 0 loader refs); audit rune_operator 29/68 PARTIAL → "
|
|
"56/68 FULL (GO), wave 128/192 FULL.",
|
|
origin="builder",
|
|
)
|
|
print("submit_need:", json.dumps(r)[:200])
|
|
if not r.get("success"):
|
|
sys.exit(1)
|
|
cid = r["ids"]["contract_id"]
|
|
print("contract_id:", cid)
|
|
|
|
for phase in ("approved", "building", "verifying"):
|
|
t = iface.transition(cid, phase)
|
|
if not t.get("success"):
|
|
print(f"transition->{phase} FAILED:", json.dumps(t)[:300])
|
|
sys.exit(1)
|
|
print("walked to verifying")
|
|
|
|
c = iface.close(cid, observed_evidence=[{
|
|
"kind": "port_evidence",
|
|
"detail": (
|
|
f"rune_operator execution-family GO dichotomy completion — parity "
|
|
f"commit {PARITY_SHA}; fn coverage 29/68 PARTIAL -> 56/68 FULL "
|
|
"(82.4%, audit CURRENT instrument, docs/dichotomy-rebase-honest-"
|
|
"audit.md regenerated at that commit); frozen-truth battery "
|
|
"replays 72 rows (src/go/operator-deep/truth_execution.json, "
|
|
"generated from the live oracle under scripts/roexec_freeze.py — "
|
|
"byte-identical regen x3, sha256 866f958e); live parity "
|
|
"scripts/check_ro_exec_parity.py exit 0; gofmt/vet/build clean; "
|
|
"pytest 53 passed both pins; evidence verification/roexec-*.exit "
|
|
"+ summary-roexec.md (logs gitignored)."
|
|
),
|
|
}], scope_files=[
|
|
"src/rune/rune_operator.py",
|
|
"src/go/operator-deep/gaps_execution.go",
|
|
"src/go/operator-deep/truth_execution.json",
|
|
"src/go/operator-deep/truth_execution_test.go",
|
|
"scripts/roexec_freeze.py",
|
|
"scripts/check_ro_exec_parity.py",
|
|
"scripts/walk_close_contract_rune_operator_exec.py",
|
|
"verification/summary-roexec.md",
|
|
])
|
|
print("close:", json.dumps(c)[:300])
|
|
print("CONTRACT", cid, "closed" if c.get("success") else "CLOSE_FAILED")
|
|
if not c.get("success"):
|
|
sys.exit(1)
|