Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65d3ffd3e0 | ||
|
|
d18b20ed0b | ||
|
|
6b95896c4a | ||
|
|
f6338f1143 |
No files matched your search
@@ -0,0 +1,145 @@
|
||||
"""Admission dispatch for wave second-pass-verification (Gitea #2596).
|
||||
|
||||
classify + activate + admit (the headless scaffolding entry law,
|
||||
scripts/admit_fuzz_boundary_decoder.py pattern): the adversarial
|
||||
re-verification of the 10 remaining general-34 facades after the wiring
|
||||
wave landed — the cache-catch standard (fresh -count=1 batteries,
|
||||
serving-path probes, mutation spot-checks on different lines than the
|
||||
landing battery killed, red-first fixes per catch).
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))
|
||||
|
||||
from rune import construction_activation as cact # noqa: E402
|
||||
from rune import construction_admission as cadm # noqa: E402
|
||||
from rune import construction_mode as cmode # noqa: E402
|
||||
from rune import scaffold as sc # noqa: E402
|
||||
|
||||
ROOT = os.path.join(os.path.dirname(__file__), "..")
|
||||
|
||||
MODULES = [
|
||||
"openai_compat_transport", "forge_client", "microkernel", "goal",
|
||||
"message_queue", "abstraction", "auto_context", "voicebox", "paths",
|
||||
"pins",
|
||||
]
|
||||
|
||||
OBJECTIVE = (
|
||||
"Second-pass adversarial verification of the 10 remaining general-34 "
|
||||
"facades at the cache-catch standard (cache 53ab710e is the worked "
|
||||
"example): per module — (1) fresh battery at -count=1 (go -race "
|
||||
"-short + the pytest live-parity suite); (2) serving-path probes the "
|
||||
"battery may not cover: cross-invocation state, empty stores, "
|
||||
"unicode keys/content, malformed input (bad JSON, missing fields), "
|
||||
"concurrent access, missing-binary fail-loud (RUNE_*_BIN=/nonexistent "
|
||||
"must raise typed RuntimeError), and the atexit/deferred-flush class "
|
||||
"on every eval surface (any per-process in-memory accumulation); "
|
||||
"(3) mutation spot-checks on lines different from the landing "
|
||||
"battery's kills — flip, confirm the battery catches, revert "
|
||||
"byte-identical; (4) fix red-first per catch, commit per module; "
|
||||
"(5) clean-bill receipt with the probes used, so 'verified' names "
|
||||
"its evidence. Scope: src/go/**, src/rune/**, tests/**, + this "
|
||||
"script. Zero new Python beyond tests."
|
||||
)
|
||||
AFFECTED = (
|
||||
[f"src/go/{m}/" for m in MODULES]
|
||||
+ [
|
||||
"src/rune/message_queue.py",
|
||||
"src/rune/abstraction.py",
|
||||
"src/rune/goal.py",
|
||||
"src/rune/voicebox.py",
|
||||
"src/rune/paths.py",
|
||||
"src/rune/forge_client.py",
|
||||
"src/rune/auto_context.py",
|
||||
"src/rune/microkernel.py",
|
||||
"src/rune/openai_compat_transport.py",
|
||||
"tests/",
|
||||
]
|
||||
+ ["scripts/admit_wave_second_pass.py"]
|
||||
)
|
||||
|
||||
EVIDENCE = [
|
||||
"src/go/goal/truth_test.go (TestSaveFailsLoudOnUnwritableStore — the "
|
||||
"serving-path catch: silent store-save data loss, fixed fail-loud)",
|
||||
"src/go/goal/truth_test.go (TestSetGoalDefaultVerificationMethod pin)",
|
||||
"src/go/abstraction/default_limit_test.go (TestListBeliefsDefaultLimitIs20)",
|
||||
"src/go/forge_client/truth_test.go (TestEvalRequestConnectErrorKind)",
|
||||
"verification/integrated/*-integrated.json (landing receipts)",
|
||||
]
|
||||
|
||||
VERIFICATION = [
|
||||
"go test -race -short -count=1 ./... green in each of the 9 Go "
|
||||
"engine modules",
|
||||
"pytest tests/test_*_go_parity.py green (106 tests)",
|
||||
"serving-path probes: malformed eval JSON loud (rc!=0) on all 9 "
|
||||
"engines; missing-binary typed RuntimeError on all 9 facades; "
|
||||
"unicode round-trips through message_queue and goal stores across "
|
||||
"invocations; empty-store behavior; corrupt message_queue store "
|
||||
"stays loud; no atexit/deferred-flush accumulator on any of the 10 "
|
||||
"eval surfaces (the cache-bug class is cache-only, already fixed)",
|
||||
"mutation spot-checks: 9 flips — 6 caught by landed batteries "
|
||||
"(microkernel now_iso, message_queue detect weight, voicebox "
|
||||
"empty-event validation, paths rune_home, auto_context "
|
||||
"active-task filter, openai_compat tool type), 3 gaps closed with "
|
||||
"red-first pins (goal default method, abstraction default limit, "
|
||||
"forge_client live ConnectError kind)",
|
||||
"pins verdict-only: boundary audit confirmed — no Go wiring; "
|
||||
"verdict battery green (src/go/pins carries recall-kernel parity "
|
||||
"artifact only)",
|
||||
]
|
||||
|
||||
|
||||
def main() -> int:
|
||||
store = os.path.join(ROOT, "store", "scaffold")
|
||||
scaffold = sc.Scaffold(store, "rune")
|
||||
|
||||
md = cmode.classify_mode(
|
||||
OBJECTIVE,
|
||||
target_project="rune",
|
||||
project_exists=True,
|
||||
affected_surface=AFFECTED,
|
||||
)
|
||||
print("classified mode:", md.mode)
|
||||
|
||||
need = {
|
||||
"need_id": "need-second-pass-verification",
|
||||
"objective": OBJECTIVE,
|
||||
"origin": "worker",
|
||||
"project": "rune",
|
||||
"task_ref": "second-pass-verification",
|
||||
"affected_surface": AFFECTED,
|
||||
"evidence_refs": EVIDENCE,
|
||||
}
|
||||
act = cact.activate(md, need=need, scaffold=scaffold,
|
||||
builder="second-pass-verification")
|
||||
print("activated:", act.get("activated"), act.get("mode"))
|
||||
|
||||
env = cadm.admit(
|
||||
act,
|
||||
objective=OBJECTIVE,
|
||||
builder="second-pass-verification",
|
||||
affected_surface=AFFECTED,
|
||||
evidence_refs=EVIDENCE,
|
||||
origin="worker",
|
||||
task_ref="second-pass-verification",
|
||||
expected_new_entities=[
|
||||
"src/go/goal/truth_test.go (fail-loud save catch + default-method pin)",
|
||||
"src/go/abstraction/default_limit_test.go (default-limit pin)",
|
||||
"src/go/forge_client/truth_test.go (live-path kind pin)",
|
||||
"scripts/admit_wave_second_pass.py",
|
||||
],
|
||||
expected_runtime_effects=[],
|
||||
verification_obligations=VERIFICATION,
|
||||
approval_ref="user:#2596 second-pass verification dispatch",
|
||||
contract_id="ADMIT-wave-second-pass",
|
||||
project_store=store,
|
||||
project_id="rune",
|
||||
)
|
||||
print(json.dumps(env, indent=2, default=str)[:2400])
|
||||
return 0 if env.get("success") else 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,53 @@
|
||||
// Default-limit pin (second-pass serving-path verification): the Go
|
||||
// list_beliefs op falls back to limit=20 when the op carries none — the
|
||||
// frozen truth rows always pass an explicit limit, so flipping the
|
||||
// default survived the battery. The facade always sends an explicit
|
||||
// limit, but the eval CLI is a public serving surface; the default is
|
||||
// pinned to the oracle's list_beliefs(limit=20).
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestListBeliefsDefaultLimitIs20(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
t.Setenv("RUNE_MEMORY_DIR", dir)
|
||||
if err := seedDatabase(filepath.Join(dir, "abstraction.db"), nil); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
seed := make([]any, 0, 25)
|
||||
for i := 0; i < 25; i++ {
|
||||
seed = append(seed, map[string]any{
|
||||
"claim": "claim-" + string(rune('a'+i)) + " padding text",
|
||||
"confidence": float64(i) / 100.0,
|
||||
"state": "active",
|
||||
"formed_at": "2026-01-01T00:00:00+00:00",
|
||||
})
|
||||
}
|
||||
dbPath := filepath.Join(dir, "abstraction.db")
|
||||
if err := os.Remove(dbPath); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := seedDatabase(dbPath, map[string][]any{"beliefs": seed}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defaulted, emsg := abstractionEvalOp("list_beliefs", map[string]any{})
|
||||
if emsg != "" {
|
||||
t.Fatal(emsg)
|
||||
}
|
||||
exact20, emsg := abstractionEvalOp("list_beliefs", map[string]any{"limit": float64(20)})
|
||||
if emsg != "" {
|
||||
t.Fatal(emsg)
|
||||
}
|
||||
dl := defaulted.([]any)
|
||||
if len(dl) != 20 {
|
||||
t.Fatalf("default list_beliefs returned %d rows, want 20 (the oracle's limit=20 default)", len(dl))
|
||||
}
|
||||
e20 := exact20.([]any)
|
||||
if len(e20) != len(dl) {
|
||||
t.Fatalf("default (%d) != explicit limit 20 (%d)", len(dl), len(e20))
|
||||
}
|
||||
}
|
||||
@@ -283,3 +283,30 @@ func TestBatteryRetryAsymmetry(t *testing.T) {
|
||||
func TestMain(m *testing.M) {
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
// TestEvalRequestConnectErrorKind — mutation spot-check pin (second
|
||||
// pass): a real transport failure must project its typed httpx kind
|
||||
// through the eval surface. The truth rows only exercise fake-sender
|
||||
// branches, so a kind rename on the live error path survived the
|
||||
// battery. Pinned against an unroutable local port (fast, closed).
|
||||
func TestEvalRequestConnectErrorKind(t *testing.T) {
|
||||
if testing.Short() && os.Getenv("RUNE_FORGE_NET_PROBE") == "" {
|
||||
t.Skip("network probe (local closed port)")
|
||||
}
|
||||
out, emsg := evalRequest(map[string]any{
|
||||
"method": "GET",
|
||||
"url": "http://127.0.0.1:1/unreachable",
|
||||
"retries": float64(0),
|
||||
"timeout": float64(2),
|
||||
})
|
||||
if emsg != "" {
|
||||
t.Fatal(emsg)
|
||||
}
|
||||
m, ok := out.(map[string]any)
|
||||
if !ok {
|
||||
t.Fatalf("unexpected eval result type %T", out)
|
||||
}
|
||||
if m["error_kind"] != "httpx.ConnectError" {
|
||||
t.Fatalf("error_kind = %v, want httpx.ConnectError", m["error_kind"])
|
||||
}
|
||||
}
|
||||
@@ -60,3 +60,21 @@ func TestSaveFailsLoudOnUnwritableStore(t *testing.T) {
|
||||
}()
|
||||
m.SetGoal("probe goal", []string{"done"}, "manual")
|
||||
}
|
||||
|
||||
// TestSetGoalDefaultVerificationMethod — mutation spot-check pin (second
|
||||
// pass): SetGoal's default verification_method is "manual" (op-passed
|
||||
// empty → "manual"); the frozen truth rows never exercise the empty-method
|
||||
// default, so flipping it survived the battery. Pinned now.
|
||||
func TestSetGoalDefaultVerificationMethod(t *testing.T) {
|
||||
store := filepath.Join(t.TempDir(), "goals.json")
|
||||
out, emsg := runGoalEval([]map[string]any{
|
||||
{"op": "set_goal", "storage_path": store, "description": "pin default method", "stop_conditions": []any{}},
|
||||
})
|
||||
if emsg != "" {
|
||||
t.Fatal(emsg)
|
||||
}
|
||||
gm, _ := out[0].(map[string]any)
|
||||
if gm["verification_method"] != "manual" {
|
||||
t.Fatalf("default verification_method = %v, want manual", gm["verification_method"])
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user