Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ed3fa8108 | ||
|
|
0e8cc14a09 | ||
|
|
89ec2943da | ||
|
|
a3b0814196 | ||
|
|
5503267d6c | ||
|
|
c80245ff0d | ||
|
|
3ada312a35 | ||
|
|
8d77e6aae3 | ||
|
|
251fa36df1 |
No files matched your search
@@ -1,6 +1,6 @@
|
||||
# Rune
|
||||
|
||||
**Current release: v0.264.0**
|
||||
**Current release: v0.265.1**
|
||||
|
||||
**Rune is a persistent personal agent designed to accumulate experience, develop reusable competence, and remain recognisably the same agent even when its underlying foundation model changes.**
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
"curator",
|
||||
"drift-ledger",
|
||||
"drift_ledger",
|
||||
"drift_resume",
|
||||
"event_wait",
|
||||
"evidence_probe",
|
||||
"execution_trace",
|
||||
@@ -38,6 +39,7 @@
|
||||
"rune_spinner",
|
||||
"self_modify",
|
||||
"shard_manager",
|
||||
"sleep_time",
|
||||
"spine_language",
|
||||
"state_checkpoint",
|
||||
"system_registry",
|
||||
@@ -48,7 +50,6 @@
|
||||
"worthiness"
|
||||
],
|
||||
"in_flight": {
|
||||
"drift_resume": "rune-wave-bb",
|
||||
"inference_paths": "rune-wave-bb",
|
||||
"skill_compiler": "rune-wave-bc",
|
||||
"meaningful_events": "rune-wave-bc",
|
||||
@@ -63,7 +64,6 @@
|
||||
"context_broker": "rune-wave-bf",
|
||||
"local_tool_runtime": "rune-wave-bg",
|
||||
"structural_store": "rune-wave-bh",
|
||||
"sleep_time": "rune-wave-bj",
|
||||
"work_manager": "rune-wave-bk",
|
||||
"growth_delta": "rune-wave-bl",
|
||||
"provider_budget": "rune-wave-bm",
|
||||
@@ -73,7 +73,9 @@
|
||||
"provider_registry": "rune-wave-bq",
|
||||
"night_mode": "rune-wave-br",
|
||||
"build_mode": "rune-wave-bs",
|
||||
"failure_auto_filer": "rune-wave-bt"
|
||||
"failure_auto_filer": "rune-wave-bt",
|
||||
"construction_interface": "rune-wave-bu",
|
||||
"spine": "rune-wave-bv"
|
||||
},
|
||||
"excluded": [
|
||||
"TUI-LAST modules",
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "rune"
|
||||
version = "0.264.0"
|
||||
version = "0.265.1"
|
||||
description = "Rune — a stateful coding assistant with persistent memory, orchestration, and TUI"
|
||||
requires-python = ">=3.10"
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ elif [ "$LANG_" = "go" ]; then
|
||||
fi
|
||||
|
||||
# Layer 3: truth file exists and is consumed
|
||||
TRUTH=$(find . \( -name "frozen_*_truth.json" -o -name "frozen_truth.json" -o -name "truth.json" \) 2>/dev/null | head -1)
|
||||
TRUTH=$(find . \( -name "frozen_*_truth.json" -o -name "frozen_truth.json" -o -name "truth.json" -o -name "truth_*.json" \) 2>/dev/null | head -1)
|
||||
if [ -n "$TRUTH" ]; then
|
||||
ROWS=$(python3 -c "import json; d=json.load(open('$TRUTH')); print(len(d) if isinstance(d,list) else sum(len(v) if isinstance(v,list) else 0 for v in d.values()))" 2>/dev/null)
|
||||
check "PASS" "truth file: $TRUTH ($ROWS rows)"
|
||||
@@ -118,7 +118,7 @@ else
|
||||
fi
|
||||
fi
|
||||
# 7c: battery test references the truth FILE (not self-generated truth)
|
||||
if grep -rqE 'include_str!.*truth|frozen_.*truth|truth\.json' "$CRATE_DIR" \
|
||||
if grep -rqE 'include_str!.*truth|frozen_.*truth|truth[_./-]' "$CRATE_DIR" \
|
||||
--include='*.rs' --include='*.go' 2>/dev/null; then
|
||||
check "PASS" "7c battery reads frozen truth"
|
||||
else
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
#!/usr/bin/env python3
|
||||
"""gen_inference_paths_truth.py — freeze/replay parity truth for
|
||||
inference_paths (#145 census + trace wiring, dichotomy wave #2479).
|
||||
|
||||
Freeze mode (default): exercises EVERY public function of the LIVE Python
|
||||
oracle (src/rune/inference_paths.py) across every branch and records
|
||||
(kernel_input, expected_kernel_output) pairs into
|
||||
src/go/inference-paths/truth.json (the GO port's battery replays this
|
||||
VERBATIM).
|
||||
|
||||
Replay mode (--replay): re-runs the SAME scenarios against the live
|
||||
Python oracle and asserts facade-level parity against the frozen file.
|
||||
Kernel-level (Go) parity runs via `go test ./...` + the `replay` CLI in
|
||||
src/go/inference-paths — the battery embeds the frozen file verbatim.
|
||||
|
||||
No-clock law: the wall clock is frozen by patching time.gmtime, so every
|
||||
kernel payload carries its own `at` and replay is deterministic
|
||||
regardless of run date.
|
||||
|
||||
Boundary law (ledger verdict: GO — the journal write is I/O-bound file
|
||||
IO and the census is simple counting): the JOURNAL attempt
|
||||
(rune.inference_trace import + record_trace + the journaled flag) and
|
||||
the grep-verified census-completeness obligations stay in the Python
|
||||
facade — the Go kernel owns the record shape (schema_version, kind,
|
||||
module, function, model, task_id, duration_ms, at) and census_report.
|
||||
Journal attempts in the battery write to throwaway temp dirs (never the
|
||||
real journal); the failure branch passes a non-creatable dir so the
|
||||
oracle's except path (journaled=False) is exercised deterministically.
|
||||
|
||||
Deep-copy law: every input is deep-copied before it reaches the oracle.
|
||||
"""
|
||||
import copy
|
||||
import datetime
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
|
||||
REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
TRUTH_PATH = os.path.join(REPO, "src", "go", "inference-paths", "truth.json")
|
||||
REPLAY = "--replay" in sys.argv
|
||||
|
||||
os.environ["RUNE_IT_CORE"] = "python" # poisoned-truth law: the journal
|
||||
# path's own delegated serializer must not vary under the freeze
|
||||
|
||||
sys.path.insert(0, os.path.join(REPO, "src"))
|
||||
sys.path.insert(0, os.path.join(REPO, "src", "rune"))
|
||||
|
||||
import inference_paths as oracle_mod # noqa: E402
|
||||
|
||||
FROZEN_AT = "2026-10-12T12:34:56Z"
|
||||
FROZEN_STRUCT = time.strptime(FROZEN_AT, "%Y-%m-%dT%H:%M:%SZ")
|
||||
|
||||
# no-clock law: freeze the wall clock BEFORE any scenario runs
|
||||
oracle_mod.time.gmtime = lambda secs=None: FROZEN_STRUCT
|
||||
|
||||
|
||||
class Case:
|
||||
def __init__(self, name, fn):
|
||||
self.name = name
|
||||
self.fn = fn
|
||||
|
||||
|
||||
# ── trace_side_path ──────────────────────────────────────────────────────────
|
||||
|
||||
def _tsp_case(rec, name, trace_dir, **kwargs):
|
||||
args = {"module": "", "function": "", "model": "", "task_id": "",
|
||||
"duration_ms": 0.0}
|
||||
args.update(kwargs)
|
||||
args_c = copy.deepcopy(args)
|
||||
got = oracle_mod.trace_side_path(trace_dir=trace_dir, **copy.deepcopy(args))
|
||||
rec(name, {**args_c, "at": FROZEN_AT}, got,
|
||||
{"record": {k: v for k, v in got.items() if k != "journaled"}})
|
||||
|
||||
|
||||
def c_tsp_defaults(rec):
|
||||
_tsp_case(rec, "tsp-defaults-side-path", tempfile.mkdtemp(prefix="ip_t_"),
|
||||
module="goal", function="_goal")
|
||||
|
||||
|
||||
def c_tsp_full(rec):
|
||||
_tsp_case(rec, "tsp-full-fields", tempfile.mkdtemp(prefix="ip_t_"),
|
||||
module="rune_operator", function="_runtime_for_model",
|
||||
model="llama3", task_id="t1", duration_ms=12.5)
|
||||
|
||||
|
||||
def c_tsp_zero_duration(rec):
|
||||
_tsp_case(rec, "tsp-zero-duration", tempfile.mkdtemp(prefix="ip_t_"),
|
||||
module="witness", function="_witness")
|
||||
|
||||
|
||||
def c_tsp_float_precision(rec):
|
||||
_tsp_case(rec, "tsp-float-precision", tempfile.mkdtemp(prefix="ip_t_"),
|
||||
module="tiered_executor", function="_execute",
|
||||
model="qwen2.5", task_id="task-99", duration_ms=123.456)
|
||||
|
||||
|
||||
def c_tsp_journal_failure(rec):
|
||||
# non-creatable dir → record_trace raises → journaled=False branch
|
||||
_tsp_case(rec, "tsp-journal-failure-false",
|
||||
"/nonexistent-ip-truth/nope", module="curator", function="_embed")
|
||||
|
||||
|
||||
def c_tsp_empty_module(rec):
|
||||
_tsp_case(rec, "tsp-empty-module-function", tempfile.mkdtemp(prefix="ip_t_"))
|
||||
|
||||
|
||||
# ── census_report ────────────────────────────────────────────────────────────
|
||||
|
||||
def c_cr_full(rec):
|
||||
got = oracle_mod.census_report()
|
||||
rec("cr-full-counts-and-exclusions", {}, got, got)
|
||||
|
||||
|
||||
# ── driver ───────────────────────────────────────────────────────────────────
|
||||
|
||||
TRACE = [c_tsp_defaults, c_tsp_full, c_tsp_zero_duration,
|
||||
c_tsp_float_precision, c_tsp_journal_failure, c_tsp_empty_module]
|
||||
REPORT = [c_cr_full]
|
||||
|
||||
GROUPS = [("trace_side_path", TRACE), ("census_report", REPORT)]
|
||||
|
||||
|
||||
def canon(x) -> str:
|
||||
return json.dumps(json.loads(json.dumps(x, default=str)), sort_keys=True)
|
||||
|
||||
|
||||
def main():
|
||||
frozen = None
|
||||
if REPLAY:
|
||||
with open(TRUTH_PATH) as f:
|
||||
frozen = json.load(f)["cases"]
|
||||
|
||||
groups = {}
|
||||
for group, cases in GROUPS:
|
||||
recs = []
|
||||
|
||||
def rec(name, inp, oracle_ret, expected, _r=recs):
|
||||
entry = {"name": name, "input": inp, "return": oracle_ret,
|
||||
"expected": expected}
|
||||
if REPLAY:
|
||||
old = next(c for c in frozen[group] if c["name"] == name)
|
||||
for key_ in ("input", "return", "expected"):
|
||||
got, want = entry[key_], old[key_]
|
||||
if canon(got) != canon(want):
|
||||
print(f"FACADE DIVERGE [{group}] {name} {key_}")
|
||||
print(" got: ",
|
||||
json.dumps(got, sort_keys=True, default=str)[:600])
|
||||
print(" want:",
|
||||
json.dumps(want, sort_keys=True, default=str)[:600])
|
||||
recs.append({"name": name, "diverged": key_})
|
||||
return
|
||||
_r.append(entry)
|
||||
|
||||
for c in cases:
|
||||
c(rec)
|
||||
groups[group] = recs
|
||||
|
||||
total = sum(len(v) for v in groups.values())
|
||||
if REPLAY:
|
||||
failures = sum(1 for v in groups.values()
|
||||
for c in v if "diverged" in c)
|
||||
print(f"replay: facade {total - failures}/{total} "
|
||||
f"(kernel/Go parity: `go test ./...` + `replay` CLI, "
|
||||
f"battery embeds truth.json verbatim)")
|
||||
return 1 if failures else 0
|
||||
|
||||
doc = {
|
||||
"frozen": datetime.datetime.now(datetime.timezone.utc).isoformat(),
|
||||
"oracle": "src/rune/inference_paths.py",
|
||||
"pin": "time.gmtime frozen at " + FROZEN_AT +
|
||||
" + RUNE_IT_CORE=python",
|
||||
"note": "Frozen via scripts/gen_inference_paths_truth.py against "
|
||||
"the live Python oracle. Ledger verdict: GO (the journal "
|
||||
"write is I/O-bound file IO; the census is simple "
|
||||
"counting). The journal attempt (rune.inference_trace + "
|
||||
"the journaled flag) stays in the Python facade — the Go "
|
||||
"kernel owns the record shape (schema_version, kind, "
|
||||
"module, function, model, task_id, duration_ms, at; `at` "
|
||||
"is a kernel argument — no-clock law) and census_report. "
|
||||
"Battery embeds this VERBATIM; float durations compare "
|
||||
"semantically (Python renders 0.0, Go marshals 0 — same "
|
||||
"value).",
|
||||
"cases": groups,
|
||||
}
|
||||
os.makedirs(os.path.dirname(TRUTH_PATH), exist_ok=True)
|
||||
with open(TRUTH_PATH, "w") as f:
|
||||
json.dump(doc, f, indent=1)
|
||||
f.write("\n")
|
||||
print(f"frozen {total} cases → {os.path.relpath(TRUTH_PATH, REPO)}")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Union-merge a conflicted store/scaffold/current.json during rebase.
|
||||
|
||||
Both sides append entities/observations/relationships to the shared
|
||||
scaffold doc; the rebase conflict is two writers appending. Union by
|
||||
exact-content identity: base side first (the rebased HEAD, i.e. what
|
||||
other agents pushed), then the incoming commit's new items.
|
||||
|
||||
Rebase index stages: `git show :2:<path>` = ours = rebased HEAD,
|
||||
`git show :3:<path>` = theirs = the incoming commit. Usage:
|
||||
git show :2:store/scaffold/current.json > /tmp/base.json
|
||||
git show :3:store/scaffold/current.json > /tmp/inc.json
|
||||
python3 scripts/merge_scaffold_conflict.py /tmp/base.json /tmp/inc.json \
|
||||
> store/scaffold/current.json
|
||||
"""
|
||||
import json
|
||||
import sys
|
||||
|
||||
base = json.load(open(sys.argv[1]))
|
||||
incoming = json.load(open(sys.argv[2]))
|
||||
|
||||
merged = dict(base)
|
||||
for key in ("entities", "observations", "relationships"):
|
||||
seen = set()
|
||||
out = []
|
||||
for side in (base, incoming):
|
||||
for item in side.get(key, []):
|
||||
ident = json.dumps(item, sort_keys=True)
|
||||
if ident in seen:
|
||||
continue
|
||||
seen.add(ident)
|
||||
out.append(item)
|
||||
merged[key] = out
|
||||
|
||||
merged["generated_at"] = max(base.get("generated_at", ""), incoming.get("generated_at", ""))
|
||||
print(json.dumps(merged, indent=2, ensure_ascii=False))
|
||||
@@ -0,0 +1,3 @@
|
||||
module rune/inference-paths
|
||||
|
||||
go 1.21
|
||||
@@ -0,0 +1,239 @@
|
||||
// Package main — inference-paths: the GO port of src/rune/inference_paths.py
|
||||
// (#145 inference-path census + trace wiring, #2479 dichotomy wave).
|
||||
//
|
||||
// Ledger verdict (docs/language-dichotomy-ledger.md): GO — the journal
|
||||
// write is I/O-bound file IO (decision tree: I/O-bound → Go) and the
|
||||
// census is simple counting (Law 3/7: simple operations stay in the
|
||||
// caller's language; FFI overhead would exceed the compute benefit).
|
||||
//
|
||||
// Boundary law: the JOURNAL attempt (rune.inference_trace import +
|
||||
// record_trace + the journaled flag) and the census-completeness
|
||||
// obligations (the test's grep-vs-census check) stay in the Python
|
||||
// facade — the Go kernel owns the record shape and census_report.
|
||||
//
|
||||
// No-clock law: `at` is a kernel argument — the kernel never reads the
|
||||
// wall clock (the oracle renders it as
|
||||
// time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())).
|
||||
//
|
||||
// Float note: Python renders duration_ms 0.0 as "0.0" while Go marshals
|
||||
// float64 0 as "0" — the battery compares SEMANTICALLY (unmarshal both
|
||||
// sides, reflect.DeepEqual), same value, same type shape.
|
||||
//
|
||||
// Language-advantage pass (Phase B, battery-pinned): the record is a
|
||||
// typed SidePathRecord struct (schema documented in one place, JSON key
|
||||
// order fixed by declaration instead of map-alphabetical accident); the
|
||||
// census kind vocabulary is a Kind string type with an isExcluded
|
||||
// lattice method (no bare-string comparisons); the report is a typed
|
||||
// CensusReport with a struct-level Exclusion entry. Battery green
|
||||
// throughout.
|
||||
//
|
||||
// Usage: inference-paths replay <truth.json>
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
// Kind — the census kind vocabulary (typed; no bare-string soup).
|
||||
type Kind string
|
||||
|
||||
const (
|
||||
KindApproval Kind = "APPROVAL" // the operator's own runs
|
||||
KindCompaction Kind = "COMPACTION" // mid-assembly summarize_history
|
||||
KindSide Kind = "SIDE" // raw-urllib model calls
|
||||
KindEmbed Kind = "EMBED" // embedding calls
|
||||
KindExcluded Kind = "EXCLUDED" // documented exclusion with reason
|
||||
)
|
||||
|
||||
// isExcluded — EXCLUDED entries are documented exclusions, not traced.
|
||||
func (k Kind) isExcluded() bool { return k == KindExcluded }
|
||||
|
||||
// CensusEntry — one outbound model-call site (module, function,
|
||||
// endpoint, kind, note). The census is the #145 deliverable: every
|
||||
// outbound model call in src/rune is ENUMERATED and each is either
|
||||
// TRACED or DOCUMENTED-EXCLUDED with its reason.
|
||||
type CensusEntry struct {
|
||||
Module string
|
||||
Function string
|
||||
Endpoint string
|
||||
Kind Kind
|
||||
Note string
|
||||
}
|
||||
|
||||
// census — the oracle's CENSUS table (insertion order preserved; the
|
||||
// census is verified 2026-10-08 by grep for /api/generate + /api/embed
|
||||
// + urlopen patterns; new call sites MUST be added here).
|
||||
var census = []CensusEntry{
|
||||
{"rune_operator", "_runtime_for_model", "/api/generate", KindApproval,
|
||||
"approval-resume turns: fresh transport on the operator path — " +
|
||||
"traced via trace_side_path since this batch"},
|
||||
{"context_broker", "summarize_history", "/api/generate", KindCompaction,
|
||||
"mid-assembly compaction: own transport — recorded as a compaction " +
|
||||
"trace folded into the run's served sums"},
|
||||
{"abstraction", "_abstract", "/api/generate", KindSide, "traced"},
|
||||
{"goal", "_goal", "/api/generate", KindSide, "traced"},
|
||||
{"growth_delta", "_growth", "/api/generate", KindSide, "traced"},
|
||||
{"model_connect", "_connect", "/api/generate", KindSide, "traced (x2)"},
|
||||
{"night_mode", "_night", "/api/generate", KindSide, "traced (x2)"},
|
||||
{"provider_registry", "generate", "/api/generate", KindSide, "traced"},
|
||||
{"rune_tui", "keepalive_warmup", "/api/generate", KindExcluded,
|
||||
"TUI keep-alive warmup: no task linkage, no user-visible output — " +
|
||||
"excluded (warmup, not inference)"},
|
||||
{"sleep_time", "reflect", "/api/generate", KindSide, "traced"},
|
||||
{"tiered_executor", "_execute", "/api/generate", KindSide, "traced"},
|
||||
{"witness", "_witness", "/api/generate", KindSide, "traced"},
|
||||
{"curator", "_embed", "/api/embed", KindEmbed, "recorded as embedding trace"},
|
||||
{"memory_store", "_embed", "/api/embed", KindEmbed, "recorded as embedding trace"},
|
||||
{"persona_gate", "_gate", "/api/embed", KindEmbed, "recorded as embedding trace"},
|
||||
{"elastic_cognition", "_elastic", "/api/generate", KindSide, "traced"},
|
||||
}
|
||||
|
||||
// SidePathRecord — the oracle's record dict for one side-path inference,
|
||||
// as a typed struct (schema in one place; JSON key order fixed by
|
||||
// declaration — mirrors the Python dict's insertion order):
|
||||
//
|
||||
// {"schema_version": 1, "kind": "side_path", "module", "function",
|
||||
// "model", "task_id", "duration_ms", "at"}
|
||||
//
|
||||
// `at` is a kernel argument (no-clock law). The journal attempt and the
|
||||
// journaled flag stay in the Python facade.
|
||||
type SidePathRecord struct {
|
||||
SchemaVersion int `json:"schema_version"`
|
||||
Kind string `json:"kind"`
|
||||
Module string `json:"module"`
|
||||
Function string `json:"function"`
|
||||
Model string `json:"model"`
|
||||
TaskID string `json:"task_id"`
|
||||
DurationMS float64 `json:"duration_ms"`
|
||||
At string `json:"at"`
|
||||
}
|
||||
|
||||
// TraceSidePath — build the side-path trace record.
|
||||
func TraceSidePath(module, function, model, taskID string, durationMS float64, at string) SidePathRecord {
|
||||
return SidePathRecord{
|
||||
SchemaVersion: 1,
|
||||
Kind: "side_path",
|
||||
Module: module,
|
||||
Function: function,
|
||||
Model: model,
|
||||
TaskID: taskID,
|
||||
DurationMS: durationMS,
|
||||
At: at,
|
||||
}
|
||||
}
|
||||
|
||||
// Exclusion — one documented-excluded census entry.
|
||||
type Exclusion struct {
|
||||
Module string `json:"module"`
|
||||
Function string `json:"function"`
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
|
||||
// CensusReport — the census as a report: total, counts by kind, and the
|
||||
// exclusion list (EXCLUDED entries carry their documented reason).
|
||||
type Report struct {
|
||||
Total int `json:"total"`
|
||||
ByKind map[Kind]int `json:"by_kind"`
|
||||
Excluded []Exclusion `json:"excluded"`
|
||||
}
|
||||
|
||||
// CensusReportOf — fold the census into its report.
|
||||
func CensusReportOf(entries []CensusEntry) Report {
|
||||
byKind := map[Kind]int{}
|
||||
excluded := []Exclusion{}
|
||||
for _, e := range entries {
|
||||
byKind[e.Kind]++
|
||||
if e.Kind.isExcluded() {
|
||||
excluded = append(excluded, Exclusion{
|
||||
Module: e.Module,
|
||||
Function: e.Function,
|
||||
Reason: e.Note,
|
||||
})
|
||||
}
|
||||
}
|
||||
return Report{Total: len(entries), ByKind: byKind, Excluded: excluded}
|
||||
}
|
||||
|
||||
// Report — the census as a report (typed; CensusReport() builds it).
|
||||
func CensusReport() Report { return CensusReportOf(census) }
|
||||
|
||||
// replayTruth — battery driver: replay the frozen Python-oracle truth
|
||||
// VERBATIM (semantic comparison — see the float note above).
|
||||
func replayTruth(path string) (checked int, err error) {
|
||||
raw, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
var doc struct {
|
||||
Cases map[string][]struct {
|
||||
Name string `json:"name"`
|
||||
Input map[string]any `json:"input"`
|
||||
Expected map[string]any `json:"expected"`
|
||||
} `json:"cases"`
|
||||
}
|
||||
if err := json.Unmarshal(raw, &doc); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
for _, c := range doc.Cases["trace_side_path"] {
|
||||
checked++
|
||||
got := TraceSidePath(
|
||||
c.Input["module"].(string),
|
||||
c.Input["function"].(string),
|
||||
c.Input["model"].(string),
|
||||
c.Input["task_id"].(string),
|
||||
c.Input["duration_ms"].(float64),
|
||||
c.Input["at"].(string),
|
||||
)
|
||||
if fail := compare(c.Name, got, c.Expected["record"]); fail {
|
||||
return checked, fmt.Errorf("trace_side_path case %q diverged", c.Name)
|
||||
}
|
||||
}
|
||||
for _, c := range doc.Cases["census_report"] {
|
||||
checked++
|
||||
if fail := compare(c.Name, CensusReport(), c.Expected); fail {
|
||||
return checked, fmt.Errorf("census_report case %q diverged", c.Name)
|
||||
}
|
||||
}
|
||||
return checked, nil
|
||||
}
|
||||
|
||||
// compare — semantic equality (unmarshal both sides through any).
|
||||
func compare(name string, got, want any) bool {
|
||||
g := norm(got)
|
||||
w := norm(want)
|
||||
if !reflect.DeepEqual(g, w) {
|
||||
gj, _ := json.Marshal(g)
|
||||
wj, _ := json.Marshal(w)
|
||||
fmt.Printf("case %q diverged:\n got: %s\n want: %s\n", name, gj, wj)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func norm(v any) any {
|
||||
b, err := json.Marshal(v)
|
||||
if err != nil {
|
||||
return v
|
||||
}
|
||||
var out any
|
||||
if err := json.Unmarshal(b, &out); err != nil {
|
||||
return v
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func main() {
|
||||
if len(os.Args) < 2 || os.Args[1] != "replay" {
|
||||
fmt.Fprintln(os.Stderr, "usage: inference-paths replay <truth.json>")
|
||||
os.Exit(2)
|
||||
}
|
||||
checked, err := replayTruth(os.Args[2])
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "PARITY FAILED: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
fmt.Printf("PARITY OK: %d cases vs the Python oracle (record shape + census report)\n", checked)
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
{
|
||||
"frozen": "2026-10-13T05:35:42.241015+00:00",
|
||||
"oracle": "src/rune/inference_paths.py",
|
||||
"pin": "time.gmtime frozen at 2026-10-12T12:34:56Z + RUNE_IT_CORE=python",
|
||||
"note": "Frozen via scripts/gen_inference_paths_truth.py against the live Python oracle. Ledger verdict: GO (the journal write is I/O-bound file IO; the census is simple counting). The journal attempt (rune.inference_trace + the journaled flag) stays in the Python facade \u2014 the Go kernel owns the record shape (schema_version, kind, module, function, model, task_id, duration_ms, at; `at` is a kernel argument \u2014 no-clock law) and census_report. Battery embeds this VERBATIM; float durations compare semantically (Python renders 0.0, Go marshals 0 \u2014 same value).",
|
||||
"cases": {
|
||||
"trace_side_path": [
|
||||
{
|
||||
"name": "tsp-defaults-side-path",
|
||||
"input": {
|
||||
"module": "goal",
|
||||
"function": "_goal",
|
||||
"model": "",
|
||||
"task_id": "",
|
||||
"duration_ms": 0.0,
|
||||
"at": "2026-10-12T12:34:56Z"
|
||||
},
|
||||
"return": {
|
||||
"schema_version": 1,
|
||||
"kind": "side_path",
|
||||
"module": "goal",
|
||||
"function": "_goal",
|
||||
"model": "",
|
||||
"task_id": "",
|
||||
"duration_ms": 0.0,
|
||||
"at": "2026-10-12T12:34:56Z",
|
||||
"journaled": false
|
||||
},
|
||||
"expected": {
|
||||
"record": {
|
||||
"schema_version": 1,
|
||||
"kind": "side_path",
|
||||
"module": "goal",
|
||||
"function": "_goal",
|
||||
"model": "",
|
||||
"task_id": "",
|
||||
"duration_ms": 0.0,
|
||||
"at": "2026-10-12T12:34:56Z"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tsp-full-fields",
|
||||
"input": {
|
||||
"module": "rune_operator",
|
||||
"function": "_runtime_for_model",
|
||||
"model": "llama3",
|
||||
"task_id": "t1",
|
||||
"duration_ms": 12.5,
|
||||
"at": "2026-10-12T12:34:56Z"
|
||||
},
|
||||
"return": {
|
||||
"schema_version": 1,
|
||||
"kind": "side_path",
|
||||
"module": "rune_operator",
|
||||
"function": "_runtime_for_model",
|
||||
"model": "llama3",
|
||||
"task_id": "t1",
|
||||
"duration_ms": 12.5,
|
||||
"at": "2026-10-12T12:34:56Z",
|
||||
"journaled": false
|
||||
},
|
||||
"expected": {
|
||||
"record": {
|
||||
"schema_version": 1,
|
||||
"kind": "side_path",
|
||||
"module": "rune_operator",
|
||||
"function": "_runtime_for_model",
|
||||
"model": "llama3",
|
||||
"task_id": "t1",
|
||||
"duration_ms": 12.5,
|
||||
"at": "2026-10-12T12:34:56Z"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tsp-zero-duration",
|
||||
"input": {
|
||||
"module": "witness",
|
||||
"function": "_witness",
|
||||
"model": "",
|
||||
"task_id": "",
|
||||
"duration_ms": 0.0,
|
||||
"at": "2026-10-12T12:34:56Z"
|
||||
},
|
||||
"return": {
|
||||
"schema_version": 1,
|
||||
"kind": "side_path",
|
||||
"module": "witness",
|
||||
"function": "_witness",
|
||||
"model": "",
|
||||
"task_id": "",
|
||||
"duration_ms": 0.0,
|
||||
"at": "2026-10-12T12:34:56Z",
|
||||
"journaled": false
|
||||
},
|
||||
"expected": {
|
||||
"record": {
|
||||
"schema_version": 1,
|
||||
"kind": "side_path",
|
||||
"module": "witness",
|
||||
"function": "_witness",
|
||||
"model": "",
|
||||
"task_id": "",
|
||||
"duration_ms": 0.0,
|
||||
"at": "2026-10-12T12:34:56Z"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tsp-float-precision",
|
||||
"input": {
|
||||
"module": "tiered_executor",
|
||||
"function": "_execute",
|
||||
"model": "qwen2.5",
|
||||
"task_id": "task-99",
|
||||
"duration_ms": 123.456,
|
||||
"at": "2026-10-12T12:34:56Z"
|
||||
},
|
||||
"return": {
|
||||
"schema_version": 1,
|
||||
"kind": "side_path",
|
||||
"module": "tiered_executor",
|
||||
"function": "_execute",
|
||||
"model": "qwen2.5",
|
||||
"task_id": "task-99",
|
||||
"duration_ms": 123.456,
|
||||
"at": "2026-10-12T12:34:56Z",
|
||||
"journaled": false
|
||||
},
|
||||
"expected": {
|
||||
"record": {
|
||||
"schema_version": 1,
|
||||
"kind": "side_path",
|
||||
"module": "tiered_executor",
|
||||
"function": "_execute",
|
||||
"model": "qwen2.5",
|
||||
"task_id": "task-99",
|
||||
"duration_ms": 123.456,
|
||||
"at": "2026-10-12T12:34:56Z"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tsp-journal-failure-false",
|
||||
"input": {
|
||||
"module": "curator",
|
||||
"function": "_embed",
|
||||
"model": "",
|
||||
"task_id": "",
|
||||
"duration_ms": 0.0,
|
||||
"at": "2026-10-12T12:34:56Z"
|
||||
},
|
||||
"return": {
|
||||
"schema_version": 1,
|
||||
"kind": "side_path",
|
||||
"module": "curator",
|
||||
"function": "_embed",
|
||||
"model": "",
|
||||
"task_id": "",
|
||||
"duration_ms": 0.0,
|
||||
"at": "2026-10-12T12:34:56Z",
|
||||
"journaled": false
|
||||
},
|
||||
"expected": {
|
||||
"record": {
|
||||
"schema_version": 1,
|
||||
"kind": "side_path",
|
||||
"module": "curator",
|
||||
"function": "_embed",
|
||||
"model": "",
|
||||
"task_id": "",
|
||||
"duration_ms": 0.0,
|
||||
"at": "2026-10-12T12:34:56Z"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "tsp-empty-module-function",
|
||||
"input": {
|
||||
"module": "",
|
||||
"function": "",
|
||||
"model": "",
|
||||
"task_id": "",
|
||||
"duration_ms": 0.0,
|
||||
"at": "2026-10-12T12:34:56Z"
|
||||
},
|
||||
"return": {
|
||||
"schema_version": 1,
|
||||
"kind": "side_path",
|
||||
"module": "",
|
||||
"function": "",
|
||||
"model": "",
|
||||
"task_id": "",
|
||||
"duration_ms": 0.0,
|
||||
"at": "2026-10-12T12:34:56Z",
|
||||
"journaled": false
|
||||
},
|
||||
"expected": {
|
||||
"record": {
|
||||
"schema_version": 1,
|
||||
"kind": "side_path",
|
||||
"module": "",
|
||||
"function": "",
|
||||
"model": "",
|
||||
"task_id": "",
|
||||
"duration_ms": 0.0,
|
||||
"at": "2026-10-12T12:34:56Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"census_report": [
|
||||
{
|
||||
"name": "cr-full-counts-and-exclusions",
|
||||
"input": {},
|
||||
"return": {
|
||||
"total": 16,
|
||||
"by_kind": {
|
||||
"APPROVAL": 1,
|
||||
"COMPACTION": 1,
|
||||
"SIDE": 10,
|
||||
"EXCLUDED": 1,
|
||||
"EMBED": 3
|
||||
},
|
||||
"excluded": [
|
||||
{
|
||||
"module": "rune_tui",
|
||||
"function": "keepalive_warmup",
|
||||
"reason": "TUI keep-alive warmup: no task linkage, no user-visible output \u2014 excluded (warmup, not inference)"
|
||||
}
|
||||
]
|
||||
},
|
||||
"expected": {
|
||||
"total": 16,
|
||||
"by_kind": {
|
||||
"APPROVAL": 1,
|
||||
"COMPACTION": 1,
|
||||
"SIDE": 10,
|
||||
"EXCLUDED": 1,
|
||||
"EMBED": 3
|
||||
},
|
||||
"excluded": [
|
||||
{
|
||||
"module": "rune_tui",
|
||||
"function": "keepalive_warmup",
|
||||
"reason": "TUI keep-alive warmup: no task linkage, no user-visible output \u2014 excluded (warmup, not inference)"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
// truth_test.go — parity battery: replays the frozen Python-oracle truth
|
||||
// (truth.json, frozen via scripts/gen_inference_paths_truth.py with the
|
||||
// wall clock frozen and RUNE_IT_CORE=python pinned) VERBATIM. Covers
|
||||
// every public function of src/rune/inference_paths.py: trace_side_path
|
||||
// record shape (defaults, full fields, zero/float durations, empty
|
||||
// module) and census_report (total/by_kind/excluded). The journaled
|
||||
// flag and the journal attempt stay in the Python facade (boundary
|
||||
// law); note the oracle's journal path currently ALWAYS yields
|
||||
// journaled=False (InferenceTrace signature drift) — the frozen truth
|
||||
// pins that observable behavior.
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestTraceSidePathBattery(t *testing.T) {
|
||||
if _, err := replayTruth("truth.json"); err != nil {
|
||||
t.Fatalf("trace_side_path battery: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTruthFilePresent(t *testing.T) {
|
||||
if _, err := os.Stat("truth.json"); err != nil {
|
||||
t.Fatalf("frozen truth missing: %v", err)
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ This is the main entry point for the Rune program.
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
__version__ = "0.264.0"
|
||||
__version__ = "0.265.1"
|
||||
|
||||
# One build identity (handoff 2026-09-10 §4): the semantic version above is
|
||||
# the repo-level truth (auto-bumped at merge); the DEPLOYED revision (exact
|
||||
|
||||
@@ -233,7 +233,7 @@ def main() -> int:
|
||||
)
|
||||
check(
|
||||
"Rune minor version advertises provisioning and restore verification",
|
||||
'__version__ = "0.264.0"' in rune_version,
|
||||
'__version__ = "0.265.1"' in rune_version,
|
||||
failures,
|
||||
)
|
||||
# #169 policy update: auto-bump on merge is sanctioned (Nick directive:
|
||||
|
||||
@@ -8,7 +8,7 @@ mode system, subject header, shared memory and identity.
|
||||
|
||||
This is not an interface. This is how I see, speak, and interact with the world.
|
||||
|
||||
Version: v0.264.0
|
||||
Version: v0.265.1
|
||||
Features: 41 (24 original + 17 new native commands)
|
||||
|
||||
Usage:
|
||||
@@ -2037,7 +2037,7 @@ class RuneApp(App):
|
||||
# Show version info
|
||||
self.chat_channel.add_message(
|
||||
"system",
|
||||
f"[dim]Rune v0.264.0 | Textual TUI | {len(loaded)} native modules[/dim]",
|
||||
f"[dim]Rune v0.265.1 | Textual TUI | {len(loaded)} native modules[/dim]",
|
||||
)
|
||||
|
||||
# Auto-show night mode suggestion if evening/night hours
|
||||
|
||||
+3047327
-3035354
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,24 @@
|
||||
# Contract BUILDER-2026-10-13T00:46:01Z-28644a-factory-batch-g
|
||||
|
||||
**Phase:** closed · **Mode:** n/a · **Depth:** n/a
|
||||
|
||||
## What was built
|
||||
|
||||
Complete the meaningful_events dichotomy port to FULL Rust (#2479 tranche): the eight-trigger table (ordered) + should_fire law (unknown/stop/absent/rate-limited with Python int() truncation, exact reason strings) + fire_due ordering + mark_fired copy semantics as doc-envelope FFI (me_* symbols, free via capability_scoring cs_free_string — no free re-export); me_loader mirroring broker_loader.py; facade owns the wall clock (now passed per op), RUNE_ME_CORE=python pin; frozen-oracle battery (every trigger class, all branches incl. truncation cases); live parity 100%; Phase B language-advantage pass (const trigger table of typed records).
|
||||
|
||||
## 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-13T06:30:53Z", "contract": "BUILDER-2026-10-13T00:46:01Z-28644a-factory-batch-g", "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_meaningful_events_parity.py", "scripts/gen_meaningful_events_truth.py", "src/rune/me_loader.py", "src/rune/meaningful_events.py", "src/rust/meaningful_events/src/branch_battery.rs", "src/rust/meaningful_events/src/lib.rs"], "reason": "contract has no approved scope", "verdict": "unknown"}}.
|
||||
|
||||
## Evidence
|
||||
|
||||
- builder:factory-batch-g
|
||||
- builder:factory-batch-g
|
||||
- builder:factory-batch-g
|
||||
- closure-record
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
# Contract BUILDER-2026-10-13T05:56:22Z-3258b3-factory-gap-faf
|
||||
# Contract BUILDER-2026-10-13T06:30:42Z-b381e6-factory-gap-faf
|
||||
|
||||
**Phase:** closed · **Mode:** n/a · **Depth:** n/a
|
||||
|
||||
@@ -14,7 +14,7 @@ Close the failure_auto_filer dichotomy gap (#2479 tranche): the Go port is PARTI
|
||||
|
||||
- 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-13T06:05:01Z", "contract": "BUILDER-2026-10-13T05:56:22Z-3258b3-factory-gap-faf", "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/close_contract_failure_auto_filer.py", "scripts/gen_failure_auto_filer_truth.py", "scripts/walk_contract_failure_auto_filer.py", "src/go/failure-filer/battery_test.go", "src/go/failure-filer/filer.go", "src/go/failure-filer/frozen_failure_auto_filer_truth.json", "src/go/failure-filer/frozen_filer_scenarios.json", "src/go/failure-filer/main.go", "src/go/failure-filer/scenario_test.go", "src/go/failure-filer/spool.go", "src/rune/failure_auto_filer.py"], "reason": "contract has no approved scope", "verdict": "unknown"}}.
|
||||
- Quality at close: {"candidate_corrections": [], "captured_at": "2026-10-13T06:34:10Z", "contract": "BUILDER-2026-10-13T06:30:42Z-b381e6-factory-gap-faf", "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/close_contract_failure_auto_filer.py", "scripts/gen_failure_auto_filer_truth.py", "scripts/walk_contract_failure_auto_filer.py", "src/go/failure-filer/battery_test.go", "src/go/failure-filer/filer.go", "src/go/failure-filer/frozen_failure_auto_filer_truth.json", "src/go/failure-filer/frozen_filer_scenarios.json", "src/go/failure-filer/main.go", "src/go/failure-filer/scenario_test.go", "src/go/failure-filer/spool.go", "src/rune/failure_auto_filer.py"], "reason": "contract has no approved scope", "verdict": "unknown"}}.
|
||||
|
||||
## Evidence
|
||||
|
||||
Reference in new issue
Block a user