Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a86a6d0167 | ||
|
|
9d08c01317 | ||
|
|
63558a11e8 | ||
|
|
8acf0a617f | ||
|
|
6a9eaddd67 | ||
|
|
54b5e52027 | ||
|
|
e1e88a7f6a | ||
|
|
e1d5ace328 | ||
|
|
44225afa88 | ||
|
|
0f5a5f927d | ||
|
|
ca986124a5 | ||
|
|
cfbe5b34cc | ||
|
|
0a7d0b7386 | ||
|
|
3b67c63482 | ||
|
|
d9fb666e6b | ||
|
|
fd71815026 | ||
|
|
ab1ce8661b | ||
|
|
265e558d3f | ||
|
|
20f2baf7b4 | ||
|
|
b2ac8c85e3 | ||
|
|
2a2d144a03 | ||
|
|
ec232bb7f1 | ||
|
|
99698d167a | ||
|
|
6828f53475 | ||
|
|
28538cd379 | ||
|
|
532fe649bf | ||
|
|
81df6f44b1 | ||
|
|
76e39615dc | ||
|
|
46b26fa993 | ||
|
|
c6b9091f39 | ||
|
|
388c6e3076 | ||
|
|
5ccd26f8f1 | ||
|
|
775591d76c | ||
|
|
5c134537f7 | ||
|
|
a50466744f | ||
|
|
b8745ab455 | ||
|
|
04b1af323d | ||
|
|
5347890ef5 | ||
|
|
6f16487203 | ||
|
|
e0bf43ed8b |
No files matched your search
@@ -199,6 +199,9 @@ jobs:
|
||||
# the tmpfs (2026-10-07: venv creation failed disk-full across
|
||||
# every job). Keep the 3 newest; drop the rest.
|
||||
cd /tmp && ls -dt rune-ci-target-* 2>/dev/null | tail -n +4 | xargs -r rm -rf
|
||||
# deploy-test cache: rust targets accumulate ~15G (every crate's
|
||||
# release dir). The staged source survives; targets rebuild.
|
||||
find /tmp/rune-deploy-test/src/rust -maxdepth 2 -name target -type d 2>/dev/null | xargs -r rm -rf
|
||||
- name: go vet + go test + go build
|
||||
run: |
|
||||
for dir in src/go/*/; do
|
||||
@@ -224,7 +227,7 @@ jobs:
|
||||
go test ./... -run TestParityAgainstPythonOracle -v
|
||||
- name: operator-deep evidence-kernel parity gate (HARD — #2479 batch: #30 kernels)
|
||||
run: |
|
||||
cd src/go/operator-deep && go build -o /tmp/operator-deep-${{ gitea.run_id }} . && go test -run "TestOperator30Parity|TestVerificationAndOutcomeContract|TestTaskIdentityParity" -v
|
||||
cd src/go/operator-deep && go build -o /tmp/operator-deep-${{ gitea.run_id }} . && go test -run "TestOperator30Parity|TestVerificationAndOutcomeContract|TestTaskIdentityParity|TestWindowParity" -v
|
||||
- name: curator-core candidate-decay parity gate (HARD — #2479 batch: ledger decay + journal render + cosine)
|
||||
run: |
|
||||
cd src/go/curator-core && go build -o /tmp/curator-core-${{ gitea.run_id }} . && /tmp/curator-core-${{ gitea.run_id }} replay truth_candidate_decay.json && go test -run TestCandidateDecayParity -v
|
||||
@@ -351,6 +354,9 @@ jobs:
|
||||
echo "$UNFORMATTED"
|
||||
exit 1
|
||||
fi
|
||||
- name: memory-store-deep text-kernel parity gate (HARD — #2479 batch: fts/mapreduce/entities)
|
||||
run: |
|
||||
cd src/go/memory-store-deep && go build -o /tmp/msd-${{ gitea.run_id }} . && go test -run "TestTextKernelsParity|TestDriftRerankBlendParity" -v
|
||||
- name: go race detector (every module's test suite under -race)
|
||||
run: |
|
||||
for dir in src/go/*/; do
|
||||
|
||||
@@ -36,6 +36,7 @@ Only use `git commit --no-verify` in a genuine emergency: it bypasses the hooks
|
||||
- Production failure fixtures are a governed surface — the registry and its README exist (in ./tests/fixtures/production)
|
||||
- Fixture payloads and the manifest travel together — tamper-evidence needs both
|
||||
- The fixture manifest and its generated regression tests travel together
|
||||
- The dichotomy is enforced at the commit boundary — every src/rune module lands in its measured side, dead oracles and wrong-language kernels fail with the correct implementation as the instruction (in ./src/rune)
|
||||
|
||||
### Behaviours
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Rune
|
||||
|
||||
**Current release: v0.159.0**
|
||||
**Current release: v0.172.0**
|
||||
|
||||
**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.**
|
||||
|
||||
|
||||
@@ -216,6 +216,7 @@ def dichotomy_language_verdict(param, file, scope):
|
||||
contract-first), so the builder agent can act without re-deriving.
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
import re as _re
|
||||
|
||||
if not (file.startswith("src/rune/") and file.endswith(".py")):
|
||||
@@ -319,4 +320,48 @@ def dichotomy_language_verdict(param, file, scope):
|
||||
f"it); the ratchet floor never decreases."
|
||||
)
|
||||
|
||||
# D5 — intent-unconsulted landing: a ported kernel (Go dir or Rust
|
||||
# crate exists) whose intent file still says not_started means the batch
|
||||
# never consulted the module's WHY. Parity is judged against intent, not
|
||||
# just behavior — consult store/scaffold/intent/<stem>.json, satisfy its
|
||||
# laws, and advance its status (not_started → facade → ported → retired).
|
||||
if side in ("GO", "RUST", "TUI-LAST"):
|
||||
if go_dir.is_dir() or rust_dir.is_dir():
|
||||
try:
|
||||
intent_status = json.loads(
|
||||
(root / "store" / "scaffold" / "intent" / f"{stem}.json").read_text()
|
||||
).get("status", "")
|
||||
except (OSError, json.JSONDecodeError):
|
||||
intent_status = ""
|
||||
if intent_status == "not_started":
|
||||
return (
|
||||
f"DICHOTOMY D5 (intent-unconsulted landing): {stem} has a "
|
||||
f"ported kernel but its intent file "
|
||||
f"(store/scaffold/intent/{stem}.json) still says "
|
||||
f"not_started — the batch never consulted the module's WHY. "
|
||||
f"FIX: read the intent file, satisfy its laws, set parity_means "
|
||||
f"for this module, and advance status to ported (or facade if "
|
||||
f"delegation is not yet wired). Parity is judged against "
|
||||
f"intent, not just behavior."
|
||||
)
|
||||
|
||||
# D4 — retired-module resurrection: a module in the retirement ratchet
|
||||
# (strangler exit completed — parity proven + CI green + deployed) must
|
||||
# NOT reappear as a Python file. Singular codebase law.
|
||||
if side in ("GO", "RUST") and not os.path.isdir(f"src/go/{stem}") and not os.path.isdir(f"src/rust/{stem}"):
|
||||
try:
|
||||
retired = set(json.loads(
|
||||
(root / "store" / "rebase" / "retired_modules.json").read_text()
|
||||
).get("retired", []))
|
||||
except (OSError, json.JSONDecodeError):
|
||||
retired = set()
|
||||
if stem in retired and (root / file).exists():
|
||||
return (
|
||||
f"DICHOTOMY D4 (retired-module resurrection): {stem} completed the "
|
||||
f"strangler exit (parity + CI green + deployed) and its Python was "
|
||||
f"deleted — but src/rune/{stem}.py exists again. The dichotomy is a "
|
||||
f"SINGULAR codebase: do not resurrect retired Python; extend the "
|
||||
f"kernel in its Go/Rust home instead. (See store/rebase/retired_modules.json.)"
|
||||
)
|
||||
|
||||
return None
|
||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "rune"
|
||||
version = "0.159.0"
|
||||
version = "0.172.0"
|
||||
description = "Rune — a stateful coding assistant with persistent memory, orchestration, and TUI"
|
||||
requires-python = ">=3.10"
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package main
|
||||
|
||||
// drift_rerank.go — #2479 memory_store batch 2: the drift-aware re-rank
|
||||
// BLEND kernel (combined = original*0.7 + drift*0.3, stable sort desc).
|
||||
// The DB reads and drift_core.compute_value calls stay in the Python
|
||||
// reactive seam (SQLite + cross-crate); the deterministic blend is here.
|
||||
// Oracle: src/rune/memory_store.py _drift_rerank's blend section.
|
||||
|
||||
import "sort"
|
||||
|
||||
// DriftRerankBlend — entries carry {"id", "orig", "drift"}; returns ids
|
||||
// sorted by combined score desc (stable — Python sort stability parity).
|
||||
func DriftRerankBlend(entries []map[string]any) []string {
|
||||
type scored struct {
|
||||
id string
|
||||
score float64
|
||||
seq int
|
||||
}
|
||||
ss := make([]scored, 0, len(entries))
|
||||
for i, e := range entries {
|
||||
id, _ := e["id"].(string)
|
||||
orig, _ := e["orig"].(float64)
|
||||
drift, _ := e["drift"].(float64)
|
||||
ss = append(ss, scored{id: id, score: orig*0.7 + drift*0.3, seq: i})
|
||||
}
|
||||
sort.SliceStable(ss, func(a, b int) bool { return ss[a].score > ss[b].score })
|
||||
out := make([]string, len(ss))
|
||||
for i, s := range ss {
|
||||
out[i] = s.id
|
||||
}
|
||||
return out
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
package main
|
||||
|
||||
// text_kernels.go — #2479 memory_store batch: the FTS conjunctive query
|
||||
// builder, the map-reduce lost-in-the-middle mitigation, and the
|
||||
// entities-to-JSON serializer. Oracle: src/rune/memory_store.py; truth rows
|
||||
// in truth_text_kernels.json. The SQLite seam stays Python (reactive).
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Stopwords51 — the measured stopword set (51 words) from memory_store.
|
||||
var Stopwords51 = map[string]bool{
|
||||
"about": true, "after": true, "also": true, "and": true, "are": true,
|
||||
"been": true, "but": true, "each": true, "for": true, "from": true,
|
||||
"have": true, "her": true, "him": true, "his": true, "how": true,
|
||||
"into": true, "its": true, "just": true, "likes": true, "more": true,
|
||||
"needs": true, "not": true, "only": true, "over": true, "prefers": true,
|
||||
"some": true, "such": true, "than": true, "that": true, "the": true,
|
||||
"them": true, "then": true, "there": true, "they": true, "this": true,
|
||||
"under": true, "very": true, "wants": true, "was": true, "were": true,
|
||||
"what": true, "when": true, "where": true, "which": true, "while": true,
|
||||
"who": true, "why": true, "will": true, "with": true, "you": true,
|
||||
"your": true,
|
||||
}
|
||||
|
||||
// FTSQueryConjunctive — CONJUNCTIVE FTS5 MATCH (implicit AND; Salton,
|
||||
// Fox & Wu 1983). Words >3 chars minus stopwords; falls back to >2-char
|
||||
// tokens; empty query returns as-is; max 8 terms, quoted.
|
||||
func FTSQueryConjunctive(query string) string {
|
||||
lower := strings.ToLower(query)
|
||||
fields := strings.Fields(lower)
|
||||
var toks []string
|
||||
for _, t := range fields {
|
||||
if len(t) > 3 && !Stopwords51[t] {
|
||||
toks = append(toks, t)
|
||||
}
|
||||
}
|
||||
if len(toks) == 0 {
|
||||
for _, t := range fields {
|
||||
if len(t) > 2 {
|
||||
toks = append(toks, t)
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(toks) == 0 {
|
||||
return query
|
||||
}
|
||||
if len(toks) > 8 {
|
||||
toks = toks[:8]
|
||||
}
|
||||
quoted := make([]string, len(toks))
|
||||
for i, t := range toks {
|
||||
quoted[i] = "\"" + t + "\""
|
||||
}
|
||||
return strings.Join(quoted, " ")
|
||||
}
|
||||
|
||||
// FTSQuery — backward-compat alias.
|
||||
func FTSQuery(query string) string { return FTSQueryConjunctive(query) }
|
||||
|
||||
// MapReducePy — lost-in-the-middle mitigation: chunk, take top-3 per chunk
|
||||
// (relevance desc, falling back to score then 0.5), reduce by score desc.
|
||||
// Short inputs pass through unchanged.
|
||||
func MapReducePy(entries []map[string]any, chunkSize int) []map[string]any {
|
||||
if chunkSize <= 0 {
|
||||
chunkSize = 10
|
||||
}
|
||||
score := func(e map[string]any) float64 {
|
||||
if r, ok := e["relevance"].(float64); ok {
|
||||
return r
|
||||
}
|
||||
if s, ok := e["score"].(float64); ok {
|
||||
return s
|
||||
}
|
||||
return 0.5
|
||||
}
|
||||
if len(entries) <= chunkSize {
|
||||
return entries
|
||||
}
|
||||
var mapped []map[string]any
|
||||
for i := 0; i < len(entries); i += chunkSize {
|
||||
end := i + chunkSize
|
||||
if end > len(entries) {
|
||||
end = len(entries)
|
||||
}
|
||||
chunk := entries[i:end]
|
||||
sort.SliceStable(chunk, func(a, b int) bool { return score(chunk[a]) > score(chunk[b]) })
|
||||
top := 3
|
||||
if top > len(chunk) {
|
||||
top = len(chunk)
|
||||
}
|
||||
mapped = append(mapped, chunk[:top]...)
|
||||
}
|
||||
sort.SliceStable(mapped, func(a, b int) bool { return score(mapped[a]) > score(mapped[b]) })
|
||||
return mapped
|
||||
}
|
||||
|
||||
// EntitiesToJSON — json.dumps(list(entities) if entities else []).
|
||||
// Python json.dumps default separators (', ' / ': ') parity via the
|
||||
// byte state machine (same shape as operator-deep's).
|
||||
func EntitiesToJSON(entities []map[string]any) string {
|
||||
var b []byte
|
||||
if entities == nil {
|
||||
b, _ = json.Marshal([]any{})
|
||||
} else {
|
||||
b, _ = json.Marshal(entities)
|
||||
}
|
||||
var out strings.Builder
|
||||
inStr := false
|
||||
esc := false
|
||||
for i, c := range b {
|
||||
if inStr {
|
||||
out.WriteByte(c)
|
||||
if esc {
|
||||
esc = false
|
||||
} else if c == '\\' {
|
||||
esc = true
|
||||
} else if c == '"' {
|
||||
inStr = false
|
||||
}
|
||||
continue
|
||||
}
|
||||
switch c {
|
||||
case '"':
|
||||
inStr = true
|
||||
out.WriteByte(c)
|
||||
case ',':
|
||||
out.WriteByte(c)
|
||||
if i+1 < len(b) {
|
||||
out.WriteByte(' ')
|
||||
}
|
||||
case ':':
|
||||
out.WriteByte(c)
|
||||
if i+1 < len(b) {
|
||||
out.WriteByte(' ')
|
||||
}
|
||||
default:
|
||||
out.WriteByte(c)
|
||||
}
|
||||
}
|
||||
return out.String()
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
[
|
||||
{
|
||||
"op": "blend",
|
||||
"inputs": [
|
||||
{
|
||||
"id": "e1",
|
||||
"orig": 0.9,
|
||||
"drift": 0.2
|
||||
},
|
||||
{
|
||||
"id": "e2",
|
||||
"orig": 0.5,
|
||||
"drift": 0.9
|
||||
},
|
||||
{
|
||||
"id": "e3",
|
||||
"orig": 0.7,
|
||||
"drift": 0.7
|
||||
},
|
||||
{
|
||||
"id": "e4",
|
||||
"orig": 0.1,
|
||||
"drift": 1.0
|
||||
},
|
||||
{
|
||||
"id": "e5",
|
||||
"orig": 0.6,
|
||||
"drift": 0.6
|
||||
}
|
||||
],
|
||||
"want": [
|
||||
"e3",
|
||||
"e1",
|
||||
"e2",
|
||||
"e5",
|
||||
"e4"
|
||||
]
|
||||
},
|
||||
{
|
||||
"op": "blend",
|
||||
"inputs": [
|
||||
{
|
||||
"id": "a",
|
||||
"orig": 0.5,
|
||||
"drift": 0.5
|
||||
},
|
||||
{
|
||||
"id": "b",
|
||||
"orig": 0.5,
|
||||
"drift": 0.5
|
||||
},
|
||||
{
|
||||
"id": "c",
|
||||
"orig": 0.4,
|
||||
"drift": 0.7
|
||||
}
|
||||
],
|
||||
"want": [
|
||||
"a",
|
||||
"b",
|
||||
"c"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,35 @@
|
||||
package main
|
||||
|
||||
// truth_drift_rerank_test.go — blend-kernel parity gate.
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDriftRerankBlendParity(t *testing.T) {
|
||||
raw, err := os.ReadFile("truth_drift_rerank.json")
|
||||
if err != nil {
|
||||
t.Fatalf("truth_drift_rerank.json missing: %v", err)
|
||||
}
|
||||
var rows []struct {
|
||||
Inputs []map[string]any `json:"inputs"`
|
||||
Want []string `json:"want"`
|
||||
}
|
||||
if err := json.Unmarshal(raw, &rows); err != nil {
|
||||
t.Fatalf("unparseable: %v", err)
|
||||
}
|
||||
for i, c := range rows {
|
||||
got := DriftRerankBlend(c.Inputs)
|
||||
if len(got) != len(c.Want) {
|
||||
t.Errorf("row %d: got %d want %d", i, len(got), len(c.Want))
|
||||
continue
|
||||
}
|
||||
for j := range got {
|
||||
if got[j] != c.Want[j] {
|
||||
t.Errorf("row %d[%d]: got %q want %q", i, j, got[j], c.Want[j])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
[
|
||||
{
|
||||
"op": "fts",
|
||||
"q": "black coffee",
|
||||
"want": "\"black\" \"coffee\""
|
||||
},
|
||||
{
|
||||
"op": "fts",
|
||||
"q": "the a of",
|
||||
"want": "\"the\""
|
||||
},
|
||||
{
|
||||
"op": "fts",
|
||||
"q": "How does the splice work in rust",
|
||||
"want": "\"does\" \"splice\" \"work\" \"rust\""
|
||||
},
|
||||
{
|
||||
"op": "fts",
|
||||
"q": "x y z",
|
||||
"want": "x y z"
|
||||
},
|
||||
{
|
||||
"op": "fts",
|
||||
"q": "",
|
||||
"want": ""
|
||||
},
|
||||
{
|
||||
"op": "fts",
|
||||
"q": "Fts5 AND query OR stuff",
|
||||
"want": "\"fts5\" \"query\" \"stuff\""
|
||||
},
|
||||
{
|
||||
"op": "fts",
|
||||
"q": "one two three four",
|
||||
"want": "\"three\" \"four\""
|
||||
},
|
||||
{
|
||||
"op": "mapreduce",
|
||||
"entries": [
|
||||
{
|
||||
"id": 0,
|
||||
"relevance": 0.9,
|
||||
"text": "e0"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"relevance": 0.5,
|
||||
"text": "e1"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"relevance": 0.7,
|
||||
"text": "e2"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"relevance": 0.95,
|
||||
"text": "e3"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"relevance": 0.1,
|
||||
"text": "e4"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"relevance": 0.85,
|
||||
"text": "e5"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"relevance": 0.6,
|
||||
"text": "e6"
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"relevance": 0.75,
|
||||
"text": "e7"
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"relevance": 0.3,
|
||||
"text": "e8"
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"relevance": 0.2,
|
||||
"text": "e9"
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"relevance": 0.65,
|
||||
"text": "e10"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"relevance": 0.4,
|
||||
"text": "e11"
|
||||
}
|
||||
],
|
||||
"chunk_size": 4,
|
||||
"want": [
|
||||
3,
|
||||
0,
|
||||
5,
|
||||
7,
|
||||
2,
|
||||
10,
|
||||
6,
|
||||
11,
|
||||
8
|
||||
]
|
||||
},
|
||||
{
|
||||
"op": "mapreduce",
|
||||
"entries": [
|
||||
{
|
||||
"id": 0,
|
||||
"relevance": 0.9,
|
||||
"text": "e0"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"relevance": 0.5,
|
||||
"text": "e1"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"relevance": 0.7,
|
||||
"text": "e2"
|
||||
}
|
||||
],
|
||||
"chunk_size": 10,
|
||||
"want": [
|
||||
0,
|
||||
1,
|
||||
2
|
||||
]
|
||||
},
|
||||
{
|
||||
"op": "entities_json",
|
||||
"entities": [
|
||||
{
|
||||
"a": 1
|
||||
}
|
||||
],
|
||||
"want": "[{\"a\": 1}]"
|
||||
},
|
||||
{
|
||||
"op": "entities_json",
|
||||
"entities": [],
|
||||
"want": "[]"
|
||||
},
|
||||
{
|
||||
"op": "entities_json",
|
||||
"entities": null,
|
||||
"want": "[]"
|
||||
},
|
||||
{
|
||||
"op": "ctx_alias",
|
||||
"q": "black coffee",
|
||||
"want": "\"black\" \"coffee\""
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,61 @@
|
||||
package main
|
||||
|
||||
// truth_text_kernels_test.go — #2479 memory_store batch parity gate.
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestTextKernelsParity(t *testing.T) {
|
||||
raw, err := os.ReadFile("truth_text_kernels.json")
|
||||
if err != nil {
|
||||
t.Fatalf("truth_text_kernels.json missing: %v", err)
|
||||
}
|
||||
var rows []struct {
|
||||
Op string `json:"op"`
|
||||
Q string `json:"q"`
|
||||
Entries []map[string]any `json:"entries"`
|
||||
Chunk int `json:"chunk_size"`
|
||||
Entity []map[string]any `json:"entities"`
|
||||
Want json.RawMessage `json:"want"`
|
||||
}
|
||||
if err := json.Unmarshal(raw, &rows); err != nil {
|
||||
t.Fatalf("unparseable: %v", err)
|
||||
}
|
||||
for i, c := range rows {
|
||||
switch c.Op {
|
||||
case "fts", "ctx_alias":
|
||||
got := FTSQueryConjunctive(c.Q)
|
||||
var want string
|
||||
_ = json.Unmarshal(c.Want, &want)
|
||||
if got != want {
|
||||
t.Errorf("row %d fts %q: got %q want %q", i, c.Q, got, want)
|
||||
}
|
||||
case "mapreduce":
|
||||
got := MapReducePy(c.Entries, c.Chunk)
|
||||
var wantIDs []float64
|
||||
_ = json.Unmarshal(c.Want, &wantIDs)
|
||||
if len(got) != len(wantIDs) {
|
||||
t.Errorf("row %d mapreduce: got %d rows want %d", i, len(got), len(wantIDs))
|
||||
continue
|
||||
}
|
||||
for j, id := range wantIDs {
|
||||
gid, _ := got[j]["id"].(float64)
|
||||
if gid != id {
|
||||
t.Errorf("row %d mapreduce[%d]: got id %v want %v", i, j, gid, id)
|
||||
}
|
||||
}
|
||||
case "entities_json":
|
||||
got := EntitiesToJSON(c.Entity)
|
||||
var want string
|
||||
_ = json.Unmarshal(c.Want, &want)
|
||||
if got != want {
|
||||
t.Errorf("row %d entities_json: got %q want %q", i, got, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
var _ = reflect.DeepEqual
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package main
|
||||
|
||||
// conversation_window.go — #2479 operator batch 3: the conversation-window
|
||||
// kernel (ConversationStateRepository.window semantics: last n of the
|
||||
// channel bucket, append order, idempotent-by-msg_id appends, n<=0 →
|
||||
// empty) and the get_status assembly shape. Oracle:
|
||||
// src/rune/orchestration/conversation_state.py window(); truth rows in
|
||||
// truth_window.json.
|
||||
|
||||
// WindowKernel — msgs is the channel bucket in append order; returns the
|
||||
// last n (chronological). Mirrors Python list[-n:].
|
||||
func WindowKernel(msgs []map[string]any, n int) []map[string]any {
|
||||
if n <= 0 {
|
||||
return []map[string]any{}
|
||||
}
|
||||
if n >= len(msgs) {
|
||||
out := make([]map[string]any, len(msgs))
|
||||
copy(out, msgs)
|
||||
return out
|
||||
}
|
||||
out := make([]map[string]any, n)
|
||||
copy(out, msgs[len(msgs)-n:])
|
||||
return out
|
||||
}
|
||||
|
||||
// AppendIdempotent — bucket append, idempotent by msg_id (the repo's
|
||||
// in-memory contract; persistence stays in the Python adapter).
|
||||
func AppendIdempotent(bucket []map[string]any, msg map[string]any) []map[string]any {
|
||||
id, _ := msg["msg_id"].(string)
|
||||
for _, m := range bucket {
|
||||
if mid, _ := m["msg_id"].(string); mid == id {
|
||||
return bucket
|
||||
}
|
||||
}
|
||||
return append(bucket, msg)
|
||||
}
|
||||
|
||||
// StatusAssembly — get_status's shape: identity/role/current_task/
|
||||
// active_model + the counter keys (counters arrive computed).
|
||||
func StatusAssembly(identity, role, currentTask, activeModel string, counters map[string]int) map[string]any {
|
||||
out := map[string]any{
|
||||
"identity": identity,
|
||||
"role": role,
|
||||
"current_task": currentTask,
|
||||
"active_model": activeModel,
|
||||
}
|
||||
for k, v := range counters {
|
||||
out[k] = v
|
||||
}
|
||||
return out
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
[
|
||||
{
|
||||
"op": "window",
|
||||
"msgs": [
|
||||
{
|
||||
"msg_id": "m0",
|
||||
"channel_id": "c1",
|
||||
"content": "msg 0"
|
||||
},
|
||||
{
|
||||
"msg_id": "m1",
|
||||
"channel_id": "c1",
|
||||
"content": "msg 1"
|
||||
},
|
||||
{
|
||||
"msg_id": "m3",
|
||||
"channel_id": "c1",
|
||||
"content": "msg 3"
|
||||
}
|
||||
],
|
||||
"n": 2,
|
||||
"want": [
|
||||
{
|
||||
"msg_id": "m1"
|
||||
},
|
||||
{
|
||||
"msg_id": "m3"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"op": "window",
|
||||
"msgs": [
|
||||
{
|
||||
"msg_id": "m0",
|
||||
"channel_id": "c1",
|
||||
"content": "msg 0"
|
||||
},
|
||||
{
|
||||
"msg_id": "m1",
|
||||
"channel_id": "c1",
|
||||
"content": "msg 1"
|
||||
},
|
||||
{
|
||||
"msg_id": "m3",
|
||||
"channel_id": "c1",
|
||||
"content": "msg 3"
|
||||
}
|
||||
],
|
||||
"n": 0,
|
||||
"want": []
|
||||
},
|
||||
{
|
||||
"op": "window",
|
||||
"msgs": [
|
||||
{
|
||||
"msg_id": "m0",
|
||||
"channel_id": "c1",
|
||||
"content": "msg 0"
|
||||
},
|
||||
{
|
||||
"msg_id": "m1",
|
||||
"channel_id": "c1",
|
||||
"content": "msg 1"
|
||||
},
|
||||
{
|
||||
"msg_id": "m3",
|
||||
"channel_id": "c1",
|
||||
"content": "msg 3"
|
||||
}
|
||||
],
|
||||
"n": 9,
|
||||
"want": [
|
||||
{
|
||||
"msg_id": "m0"
|
||||
},
|
||||
{
|
||||
"msg_id": "m1"
|
||||
},
|
||||
{
|
||||
"msg_id": "m3"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"op": "window",
|
||||
"msgs": [
|
||||
{
|
||||
"msg_id": "m2",
|
||||
"channel_id": "c2",
|
||||
"content": "msg 2"
|
||||
}
|
||||
],
|
||||
"n": 1,
|
||||
"want": [
|
||||
{
|
||||
"msg_id": "m2"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"op": "window",
|
||||
"msgs": [],
|
||||
"n": 3,
|
||||
"want": []
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,52 @@
|
||||
package main
|
||||
|
||||
// truth_window_test.go — #2479 operator-batch-3 parity gate.
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestWindowParity(t *testing.T) {
|
||||
raw, err := os.ReadFile("truth_window.json")
|
||||
if err != nil {
|
||||
t.Fatalf("truth_window.json missing: %v", err)
|
||||
}
|
||||
var rows []struct {
|
||||
Msgs []map[string]any `json:"msgs"`
|
||||
N int `json:"n"`
|
||||
Want []map[string]any `json:"want"`
|
||||
}
|
||||
if err := json.Unmarshal(raw, &rows); err != nil {
|
||||
t.Fatalf("unparseable: %v", err)
|
||||
}
|
||||
for i, c := range rows {
|
||||
got := WindowKernel(c.Msgs, c.N)
|
||||
if len(got) != len(c.Want) {
|
||||
t.Errorf("row %d window n=%d: got %d rows want %d", i, c.N, len(got), len(c.Want))
|
||||
continue
|
||||
}
|
||||
for j := range got {
|
||||
gid, _ := got[j]["msg_id"].(string)
|
||||
wid, _ := c.Want[j]["msg_id"].(string)
|
||||
if gid != wid {
|
||||
t.Errorf("row %d window[%d]: got %q want %q", i, j, gid, wid)
|
||||
}
|
||||
}
|
||||
}
|
||||
// idempotent-append contract
|
||||
bucket := []map[string]any{{"msg_id": "m1"}}
|
||||
bucket = AppendIdempotent(bucket, map[string]any{"msg_id": "m2"})
|
||||
bucket = AppendIdempotent(bucket, map[string]any{"msg_id": "m1"})
|
||||
if len(bucket) != 2 {
|
||||
t.Errorf("idempotent append: bucket grew to %d", len(bucket))
|
||||
}
|
||||
// status assembly shape
|
||||
st := StatusAssembly("rune", "operator", "t1", "m1", map[string]int{"tasks_pending": 2})
|
||||
if st["identity"] != "rune" || st["tasks_pending"] != 2 {
|
||||
t.Errorf("status assembly: got %v", st)
|
||||
}
|
||||
var _ = reflect.DeepEqual
|
||||
}
|
||||
@@ -6,7 +6,7 @@ This is the main entry point for the Rune program.
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
__version__ = "0.159.0"
|
||||
__version__ = "0.172.0"
|
||||
|
||||
# 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.159.0"' in rune_version,
|
||||
'__version__ = "0.172.0"' in rune_version,
|
||||
failures,
|
||||
)
|
||||
# #169 policy update: auto-bump on merge is sanctioned (Nick directive:
|
||||
|
||||
@@ -240,55 +240,14 @@ def evaluate_fit(req: CapabilityRequirement, candidate: dict) -> dict:
|
||||
|
||||
|
||||
def _py_evaluate_fit(req: CapabilityRequirement, candidate: dict) -> dict:
|
||||
"""Python core of evaluate_fit (parity oracle for the Rust core)."""
|
||||
missing_contracts = sorted(set(req.contracts) - set(candidate["provides"]))
|
||||
covered = len(req.contracts) - len(missing_contracts)
|
||||
|
||||
# health: a superseded or stale candidate cannot be reused as-is
|
||||
status = candidate["status"]
|
||||
unhealthy = status in {"SUPERSEDED", "STALE"} or bool(candidate.get("superseded_by"))
|
||||
|
||||
# maturity: DECLARED-only candidates have no usage evidence
|
||||
maturity = _MATURITY_RANK.get(candidate.get("maturity", "DECLARED"), 0)
|
||||
|
||||
if unhealthy:
|
||||
return {
|
||||
"candidate": candidate["id"],
|
||||
"fit": "INCOMPATIBLE",
|
||||
"reason": f"candidate status {status} — not reusable as-is",
|
||||
"missing_contracts": missing_contracts,
|
||||
"covered": covered,
|
||||
}
|
||||
if req.contracts and not candidate["provides"]:
|
||||
# candidate provides nothing verifiable → cannot establish fit
|
||||
return {
|
||||
"candidate": candidate["id"],
|
||||
"fit": "UNKNOWN",
|
||||
"reason": "candidate exposes no contracts to check",
|
||||
"missing_contracts": missing_contracts,
|
||||
"covered": 0,
|
||||
}
|
||||
if not missing_contracts:
|
||||
fit = "EXACT"
|
||||
reason = "all required contracts provided"
|
||||
elif covered > 0:
|
||||
fit = "PARTIAL"
|
||||
reason = f"covers {covered}/{len(req.contracts)} required contracts"
|
||||
else:
|
||||
fit = "INCOMPATIBLE"
|
||||
reason = "provides none of the required contracts"
|
||||
return {
|
||||
"candidate": candidate["id"],
|
||||
"fit": fit,
|
||||
"reason": reason,
|
||||
"missing_contracts": missing_contracts,
|
||||
"covered": covered,
|
||||
"maturity_rank": maturity,
|
||||
"consumers": candidate["consumers"],
|
||||
}
|
||||
|
||||
|
||||
# ── gap / resolution decision ──────────────────────────────────────────────
|
||||
"""STRANGLER EXIT (retired 2026-10-10): authoritative implementation in
|
||||
src/rust/capability_scoring (cs_evaluate_fit, parity proven against the
|
||||
frozen oracle in frozen_evaluate_fit.json). Delegation-only stub; raises
|
||||
if the kernel is absent (no silent second implementation)."""
|
||||
core = _cs_core()
|
||||
if core is None:
|
||||
raise RuntimeError("capability_scoring kernel not built — run the capability_scoring build; the Python oracle was retired")
|
||||
return core.evaluate_fit(req.contracts, candidate)
|
||||
|
||||
|
||||
def _adaptation_brittle(doc: dict, candidate_id: str, missing_contracts: list[str]) -> tuple[bool, str]:
|
||||
|
||||
@@ -164,42 +164,13 @@ def _sc_core():
|
||||
|
||||
|
||||
def _py_language_placement(project: str, characteristics: list[str]) -> dict:
|
||||
"""Python core of language_placement (parity oracle)."""
|
||||
go_signals = ("initiate", "respond", "route", "dispatch", "reactive",
|
||||
"user-facing", "turn-time", "chat", "event", "tool",
|
||||
"model", "provider", "http", "network", "subprocess",
|
||||
"threading", "server", "cron", "message", "voice",
|
||||
"operator", "transport")
|
||||
rust_signals = ("compute", "store", "score", "compress", "threshold",
|
||||
"parity", "dedup", "classify", "extract", "assemble",
|
||||
"memory", "cognition", "ledger", "spine", "structural",
|
||||
"deterministic", "pure-function", "drift", "pin",
|
||||
"identity", "construction", "contract")
|
||||
chars = [c.lower() for c in characteristics]
|
||||
go_hits = [s for s in go_signals if any(s in c for c in chars)]
|
||||
rust_hits = [s for s in rust_signals if any(s in c for c in chars)]
|
||||
if project.lower() == "rune":
|
||||
if go_hits and not rust_hits:
|
||||
placement, rule = "go", "rune dichotomy: reactive/initiating markers"
|
||||
elif rust_hits and not go_hits:
|
||||
placement, rule = "rust", "rune dichotomy: deterministic/state markers"
|
||||
elif rust_hits and go_hits:
|
||||
placement, rule = "hybrid", "rune dichotomy: both marker classes — a contracted membrane junction"
|
||||
else:
|
||||
placement, rule = "rust", "rune dichotomy: pure compute defaults to the deterministic backend"
|
||||
else:
|
||||
if go_hits and not rust_hits:
|
||||
placement, rule = "go", "characteristic fit: reactive/network profile"
|
||||
elif rust_hits and not go_hits:
|
||||
placement, rule = "rust", "characteristic fit: deterministic/state profile"
|
||||
elif rust_hits:
|
||||
placement, rule = "hybrid", "characteristic fit: mixed profile — split at the membrane"
|
||||
else:
|
||||
placement, rule = "unassessed", "no placement signals — the unit needs characteristics recorded"
|
||||
return {"placement": placement, "rule": rule,
|
||||
"evidence": {"go_signals": go_hits, "rust_signals": rust_hits}}
|
||||
|
||||
|
||||
"""STRANGLER EXIT (retired 2026-10-10): authoritative implementation in
|
||||
src/rust/scaffold_core (sc_language_placement — parity proven against the
|
||||
frozen oracle in frozen_language_placement.json). Delegation-only stub."""
|
||||
core = _sc_core()
|
||||
if core is None:
|
||||
raise RuntimeError("scaffold_core kernel not built — run the scaffold_core build; the Python oracle was retired")
|
||||
return core.language_placement(project, characteristics)
|
||||
def classify_surface(surface: str) -> str:
|
||||
"""Classify one affected-surface entry (open-world; Tranche 5 §3).
|
||||
Kinds: structural_entity | source_path | workflow_config | ui_component |
|
||||
|
||||
+15
-61
@@ -108,51 +108,14 @@ def compute_value(entry: dict, current_goals: List[str] | None = None) -> float:
|
||||
|
||||
def _py_compute_value(entry: dict, current_goals: List[str] | None = None,
|
||||
now: str | None = None) -> float:
|
||||
"""Python core of compute_value (parity oracle for the Rust core).
|
||||
`now` is an ISO-8601 string; None resolves the wall clock (production)."""
|
||||
proven = entry.get("wash_count", 0) or 0 # column name preserved for compatibility
|
||||
imp = entry.get("importance", 0.5) or 0.5
|
||||
|
||||
# Proven use factor: logarithmic scaling (diminishing returns)
|
||||
proven_factor = min(1.0, math.log1p(proven) / math.log1p(PROVEN_USES_THRESHOLD))
|
||||
|
||||
# Recency factor: exponential decay
|
||||
now_dt = datetime.fromisoformat(now) if now else datetime.now(timezone.utc)
|
||||
recency = 1.0
|
||||
last_accessed = entry.get("last_accessed") or entry.get("last_washed")
|
||||
if last_accessed:
|
||||
try:
|
||||
last = datetime.fromisoformat(last_accessed)
|
||||
hours_since = max(0.1, (now_dt - last).total_seconds() / 3600)
|
||||
recency = max(0.1, 1.0 / (1.0 + hours_since / (RECENCY_HALF_LIFE_DAYS * 24)))
|
||||
except (ValueError, TypeError):
|
||||
recency = 0.5
|
||||
|
||||
# Reliability factor: based on access pattern consistency
|
||||
# (placeholder — full implementation needs access history tracking)
|
||||
reliability = min(1.0, proven / max(1, RELIABILITY_WINDOW))
|
||||
|
||||
# Goal relevance factor: keyword overlap with current goals
|
||||
goal_relevance = 0.5 # default when no goals provided
|
||||
if current_goals:
|
||||
text = entry.get("text", "").lower()
|
||||
goal_words = set()
|
||||
for g in current_goals:
|
||||
goal_words.update(g.lower().split())
|
||||
text_words = set(text.split())
|
||||
overlap = len(goal_words & text_words)
|
||||
goal_relevance = min(1.0, overlap / max(1, len(goal_words) * 0.3))
|
||||
|
||||
# Weighted combination
|
||||
value = (
|
||||
WEIGHT_PROVEN_USES * proven_factor
|
||||
+ WEIGHT_IMPORTANCE * imp
|
||||
+ WEIGHT_RECENCY * recency
|
||||
+ WEIGHT_RELIABILITY * reliability
|
||||
+ WEIGHT_GOAL_RELEVANCE * goal_relevance
|
||||
)
|
||||
|
||||
return round(value, 4)
|
||||
"""STRANGLER EXIT (retired 2026-10-10): authoritative implementation in
|
||||
src/rust/memory_scoring (ms_compute_value — adversarial edges fixed:
|
||||
non-numeric/out-of-domain wash_count ERRORS via the envelope, bool parity
|
||||
preserved). Delegation-only stub; raises if the kernel is absent."""
|
||||
core = _ms_core()
|
||||
if core is None:
|
||||
raise RuntimeError("memory_scoring kernel not built — run the memory_scoring build; the Python oracle was retired")
|
||||
return core.compute_value(entry, current_goals, now if now is not None else _now_iso(None))
|
||||
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
@@ -180,22 +143,13 @@ def check_promotion_eligibility(entry: dict) -> Tuple[bool, str]:
|
||||
|
||||
def _py_check_promotion_eligibility(entry: dict,
|
||||
now: str | None = None) -> Tuple[bool, str]:
|
||||
"""Python core of check_promotion_eligibility (parity oracle)."""
|
||||
wash = entry.get("wash_count", 0) or 0
|
||||
status = entry.get("rock_status", "washable")
|
||||
|
||||
if status == "rock":
|
||||
return False, "already rock"
|
||||
|
||||
if wash < PROVEN_USES_THRESHOLD:
|
||||
return False, f"proven_uses {wash} < threshold {PROVEN_USES_THRESHOLD}"
|
||||
|
||||
value = _py_compute_value(entry, now=now)
|
||||
if value < 0.6:
|
||||
return False, f"value {value:.3f} < 0.6 minimum"
|
||||
|
||||
return True, f"wash_count={wash}, value={value:.3f}"
|
||||
|
||||
"""STRANGLER EXIT (retired 2026-10-10): authoritative implementation in
|
||||
src/rust/memory_scoring (ms_check_promotion_eligibility). Delegation-only
|
||||
stub; raises if the kernel is absent."""
|
||||
core = _ms_core()
|
||||
if core is None:
|
||||
raise RuntimeError("memory_scoring kernel not built — run the memory_scoring build; the Python oracle was retired")
|
||||
return core.check_promotion_eligibility(entry, now if now is not None else _now_iso(None))
|
||||
|
||||
def promote_entry(db, entry_id: int) -> dict:
|
||||
"""Promote an entry through the lifecycle: washable → established → rock.
|
||||
|
||||
+9
-11
@@ -170,17 +170,15 @@ def recall(context, limit=4):
|
||||
|
||||
|
||||
def _py_pin_recall(recs, term, limit=4):
|
||||
out = []
|
||||
for rec in recs:
|
||||
if rec.get("state") != "open":
|
||||
continue
|
||||
p = _project(rec)
|
||||
if term in p["topic"].lower() or term in p["context"].lower():
|
||||
out.append(p)
|
||||
if len(out) >= limit:
|
||||
break
|
||||
return out
|
||||
|
||||
"""STRANGLER EXIT (retired 2026-10-10): authoritative implementation in
|
||||
src/rust/cognition_core (cc_pins_recall — parity proven against the frozen
|
||||
oracle in frozen_pins_recall.json, real pin shapes). Delegation-only stub;
|
||||
raises if the kernel is absent (no silent second implementation)."""
|
||||
from rune.identity_anchors import _cc_core
|
||||
core = _cc_core()
|
||||
if core is None:
|
||||
raise RuntimeError("cognition_core kernel not built — run the cognition_core build; the Python oracle was retired")
|
||||
return core.pins_recall(recs, term, limit)
|
||||
|
||||
def list_pins(open_only=False, limit=30):
|
||||
"""The pinboard: all pins (open + resolved) by default, newest first."""
|
||||
|
||||
@@ -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.159.0
|
||||
Version: v0.172.0
|
||||
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.159.0 | Textual TUI | {len(loaded)} native modules[/dim]",
|
||||
f"[dim]Rune v0.172.0 | Textual TUI | {len(loaded)} native modules[/dim]",
|
||||
)
|
||||
|
||||
# Auto-show night mode suggestion if evening/night hours
|
||||
|
||||
+32
-349
@@ -461,176 +461,14 @@ def _deployed_source_files() -> list[str]:
|
||||
|
||||
|
||||
def _py_build_from_inputs(inputs: dict) -> dict:
|
||||
"""Deterministic full projection from GATHERED inputs. Same inputs →
|
||||
byte-identical doc (modulo generated_at). This is the Python core; the
|
||||
Rust core (project.rs) must produce structurally identical output."""
|
||||
doc = new_doc()
|
||||
ts = inputs["now"]
|
||||
|
||||
# 1. subsystem structure — from the Spine store if it already owns
|
||||
# membership (Phase B+), else from the manual manifest (Phase A).
|
||||
existing = inputs["existing"]
|
||||
seeded = False
|
||||
if existing:
|
||||
rels = [r for r in existing["relationships"] if r["type"] == "belongs_to"]
|
||||
if rels:
|
||||
seeded = True
|
||||
# CARRY EVERYTHING FORWARD — open-world requirement. Filtering
|
||||
# by known kinds/types here would silently destroy tasks,
|
||||
# contracts, capabilities, and any future entity class on every
|
||||
# refresh (the exact TOO-CLOSED failure the contract forbids;
|
||||
# observed live: task bindings vanished through build()).
|
||||
# Module-level facts (imports, tests, maturity) are RE-DERIVED
|
||||
# below onto the carried state; everything else passes through.
|
||||
doc["entities"].extend(json.loads(json.dumps(existing["entities"])))
|
||||
doc["relationships"].extend(json.loads(json.dumps(existing["relationships"])))
|
||||
doc["observations"].extend(json.loads(json.dumps(existing.get("observations", []))))
|
||||
if not seeded:
|
||||
mp = inputs.get("manifest_path")
|
||||
if inputs.get("manifest") is not None and not mp:
|
||||
# gather-supplied manifest data (the Rust-parity path): ingest
|
||||
# the dict directly — no file to re-read
|
||||
_ingest_umbrellas_data(doc, inputs["manifest"])
|
||||
else:
|
||||
# through the PUBLIC ingest_umbrellas (reads + raises like the
|
||||
# original build; monkeypatchable for isolation tests)
|
||||
ingest_umbrellas(doc, Path(mp) if mp else None)
|
||||
|
||||
# 2. module-level structural facts from actual code
|
||||
graph = inputs["graph"]
|
||||
registry = inputs["registry"]
|
||||
tested = set(inputs["tested"])
|
||||
present = set(inputs["present_modules"])
|
||||
mods = {e["id"].split(":", 1)[1] for e in doc["entities"] if e["kind"] == "module"}
|
||||
# T21.4 §21.4G: the ENTRY POINT is invisible to the import graph
|
||||
# (nothing imports __main__) but is a real runtime path — seed it
|
||||
# deterministically whenever the file exists.
|
||||
if inputs["main_present"] and "__main__" not in mods:
|
||||
add_entity(
|
||||
doc,
|
||||
id="module:__main__",
|
||||
kind="module",
|
||||
maturity="PRESENT",
|
||||
identities={"path": "src/rune/__main__.py", "role": "TUI entry point (python3 -m rune)"},
|
||||
evidence_refs=["entry-point:python3 -m rune"],
|
||||
)
|
||||
mods.add("__main__")
|
||||
for m in sorted(mods):
|
||||
mid = f"module:{m}"
|
||||
e = entity(doc, mid)
|
||||
|
||||
# Re-derivation uses the HIGH-WATER path (add_entity upgrades only,
|
||||
# never logs): fresh evidence may be lower than the store's earned
|
||||
# state on any given pass, and that is not a demotion event — it is
|
||||
# a build. Explicit promote() logging is for evidence-gated API calls.
|
||||
def _derive(state: str, ev: str) -> None:
|
||||
add_entity(doc, id=mid, kind="module", maturity=state, evidence_refs=[ev])
|
||||
|
||||
if m in present:
|
||||
assert e is not None # membership loop guarantees presence
|
||||
e["identities"]["source"] = f"src/rune/{m}.py"
|
||||
_derive("PRESENT", f"source:{m}.py")
|
||||
consumers = sorted(c for c, deps in graph.items() if m in deps and c != m)
|
||||
deps = sorted(d for d in graph.get(m, []) if d in mods and d != m)
|
||||
for c in consumers:
|
||||
rel = add_relationship(
|
||||
doc, type="consumed_by", from_id=mid, to_id=f"module:{c}", evidence_refs=[f"ast-import:{m}"]
|
||||
)
|
||||
_authority_observed(doc, rel, "ast-import-projector")
|
||||
for d in deps:
|
||||
rel = add_relationship(
|
||||
doc, type="depends_on", from_id=mid, to_id=f"module:{d}", evidence_refs=[f"ast-import:{m}"]
|
||||
)
|
||||
_authority_observed(doc, rel, "ast-import-projector")
|
||||
# WIRED: importers exist, or registry wiring (canary registry)
|
||||
if consumers or m in registry:
|
||||
_derive("WIRED", f"ast-imports:{len(consumers)}" if consumers else "canary-registry")
|
||||
# EXERCISED: dedicated test or canary exercise
|
||||
if m in tested:
|
||||
_derive("EXERCISED", f"tests/test_{m}.py")
|
||||
elif m in registry:
|
||||
_derive("EXERCISED", "canary-registry-exercise")
|
||||
|
||||
# 3. runtime/deployment observation (dynamic, bounded)
|
||||
obs = inputs["deployed_obs"]
|
||||
if obs:
|
||||
_authority_observed(doc, None, "deploy-identity-projector") # generation bump
|
||||
deployed_sources = set(inputs["deployed_sources"])
|
||||
dep = add_entity(
|
||||
doc,
|
||||
id="deployment:current",
|
||||
kind="deployment_surface",
|
||||
identities=obs,
|
||||
evidence_refs=["_build_identity.json"],
|
||||
maturity="LIVE_PROVEN",
|
||||
)
|
||||
for e in doc["entities"]:
|
||||
if e["kind"] == "module" and e["identities"].get("source", "") in deployed_sources:
|
||||
rel = add_relationship(
|
||||
doc,
|
||||
type="deployed_as",
|
||||
from_id=e["id"],
|
||||
to_id="deployment:current",
|
||||
evidence_refs=[f"deployed-tree:{obs['deployed_sha']}"],
|
||||
)
|
||||
_authority_observed(doc, rel, "deploy-identity-projector")
|
||||
doc["observations"].append({"kind": "deployed_identity", **obs, "observed_at": ts})
|
||||
|
||||
# 4. meta-scaffold surface projection (H-meta): rust crates, Go
|
||||
# surfaces, configs, workflows — every part of rune modeled.
|
||||
projected = project_meta_surfaces(doc, inputs)
|
||||
if projected:
|
||||
_authority_observed(doc, None, "meta-surface-projector")
|
||||
|
||||
# 4b. manifest canaries as first-class entities (H-meta): the seeded
|
||||
# path skips ingest, and ingest only made the EDGE — the canary
|
||||
# entity itself was never created, leaving obligated_canary edges
|
||||
# pointing at nothing (observed live: zero canary entities in the
|
||||
# spine before this projector).
|
||||
manifest = inputs.get("config_manifest")
|
||||
if manifest:
|
||||
canary_files = set(inputs["canary_files"])
|
||||
for name, u in manifest.get("umbrellas", {}).items():
|
||||
for canary in u.get("canaries", []):
|
||||
mid = f"module:{canary}"
|
||||
add_entity(
|
||||
doc,
|
||||
id=mid,
|
||||
kind="module",
|
||||
tags=["code", "canary"],
|
||||
identities={"source": f"src/rune/{canary}.py"},
|
||||
evidence_refs=[f"umbrella-manifest#{name}"],
|
||||
maturity="PRESENT" if canary in canary_files else "DECLARED",
|
||||
)
|
||||
add_relationship(
|
||||
doc,
|
||||
type="obligated_canary",
|
||||
from_id=f"subsystem:{name}",
|
||||
to_id=mid,
|
||||
evidence_refs=[f"umbrella-manifest#{name}"],
|
||||
)
|
||||
|
||||
# reconcile: facts owned by projectors that no longer observe them
|
||||
# become STALE (marked, never deleted — history survives; open-world
|
||||
# preservation applies to everything, staleness is the truth marker)
|
||||
staled = reconcile_authorities(doc)
|
||||
for s in staled:
|
||||
doc["observations"].append({"kind": "fact_staled", **s, "observed_at": ts})
|
||||
|
||||
# exact-duplicate observation suppression (carry-forward + this pass
|
||||
# both record deployed_identity etc.); distinct repeats are history
|
||||
seen_obs = set()
|
||||
unique_obs = []
|
||||
for o in doc["observations"]:
|
||||
key = json.dumps(_sorted(o), sort_keys=True)
|
||||
if key not in seen_obs:
|
||||
seen_obs.add(key)
|
||||
unique_obs.append(o)
|
||||
doc["observations"] = unique_obs
|
||||
doc["generated_at"] = ts
|
||||
return doc
|
||||
|
||||
|
||||
"""STRANGLER EXIT (retired 2026-10-10): authoritative implementation in
|
||||
src/rust/rune_spine (parity proven against the frozen oracle in
|
||||
frozen_spine_oracle.json). Delegation-only stub; raises if the kernel
|
||||
is absent (no silent second implementation)."""
|
||||
core = _rust_core()
|
||||
if core is None:
|
||||
raise RuntimeError("rune_spine kernel not built — run the rune_spine build; the Python oracle was retired")
|
||||
return core.project(inputs)
|
||||
def _ingest_umbrellas_data(doc: dict, data: dict) -> int:
|
||||
"""The original ingest_umbrellas with the file read lifted out (H3-spine
|
||||
gather boundary). Raises ValueError on a Spine-generated view, exactly
|
||||
@@ -742,100 +580,14 @@ def _gather_drift_inputs() -> dict:
|
||||
|
||||
|
||||
def _py_drift_from_inputs(doc: dict, inputs: dict) -> list[dict]:
|
||||
"""Architectural drift classes from GATHERED inputs. Python core; the
|
||||
Rust core (drift.rs) must produce identical output on the same inputs."""
|
||||
out = []
|
||||
graph = inputs["graph"]
|
||||
registry = inputs["registry"]
|
||||
tested = set(inputs["tested"])
|
||||
mods = {e["id"].split(":", 1)[1] for e in doc["entities"] if e["kind"] == "module"}
|
||||
|
||||
# 1. registered but absent (canary registry names a non-existent module)
|
||||
for m in registry:
|
||||
if m not in mods:
|
||||
out.append(
|
||||
{
|
||||
"class": "registered_but_absent",
|
||||
"entity": f"module:{m}",
|
||||
"detail": "in canary registry, no source file",
|
||||
}
|
||||
)
|
||||
|
||||
# 2. present but unowned (runtime source file outside every subsystem).
|
||||
# Excludes canary files (governed by the canary contract, not umbrella
|
||||
# membership) and package plumbing (__init__/__main__).
|
||||
for stem in inputs["src_stems"]:
|
||||
if stem.startswith(("canary_", "__")):
|
||||
continue
|
||||
if stem not in mods:
|
||||
out.append(
|
||||
{
|
||||
"class": "present_but_unowned",
|
||||
"entity": f"module:{stem}",
|
||||
"detail": "src/rune runtime module with no subsystem membership",
|
||||
}
|
||||
)
|
||||
|
||||
# 3. registered but no static importers — OBSERVATION, not a death
|
||||
# verdict: registry dispatch and entry points wire dynamically
|
||||
# (task_gate via capability_broker, rune_tui via entry point).
|
||||
# Interpretation belongs to cognition; Spine reports the fact.
|
||||
for m in sorted(mods & set(registry)):
|
||||
importers = [c for c, deps in graph.items() if m in deps and c != m]
|
||||
if not importers:
|
||||
dyn = "no dedicated test either" if m not in tested else "dedicated test exists"
|
||||
out.append(
|
||||
{
|
||||
"class": "registered_no_static_importers",
|
||||
"entity": f"module:{m}",
|
||||
"detail": f"zero static importers; dynamic wiring possible; {dyn}",
|
||||
}
|
||||
)
|
||||
|
||||
# 4. deployed identity drift (source version vs deployment authority)
|
||||
obs = inputs["deployed_obs"]
|
||||
src_version = inputs["src_version"]
|
||||
if obs and src_version and obs["deployed_version"] != src_version:
|
||||
out.append(
|
||||
{
|
||||
"class": "version_surfaces_disagree",
|
||||
"detail": f"source {src_version} != deployed {obs['deployed_version']}",
|
||||
}
|
||||
)
|
||||
|
||||
# 4b. evidence staleness (adapter freshness): maturity claims whose
|
||||
# evidence references predate the current store generation are STALE
|
||||
# observations, never silently current — "not checked" != "healthy".
|
||||
for e in doc["entities"]:
|
||||
if e.get("maturity") in ("EXERCISED", "LIVE_PROVEN") and not e.get("evidence_refs"):
|
||||
out.append(
|
||||
{
|
||||
"class": "evidence_conflict",
|
||||
"entity": e["id"],
|
||||
"detail": f"claims {e['maturity']} with zero evidence refs",
|
||||
}
|
||||
)
|
||||
|
||||
# 4c. stale facts — owned by an authority that no longer observes them
|
||||
for rel in doc["relationships"]:
|
||||
if rel.get("status") == "STALE":
|
||||
out.append(
|
||||
{
|
||||
"class": "stale_fact",
|
||||
"entity": f"{rel['from']}->{rel['to']}",
|
||||
"detail": f"{rel['type']} edge; authority {rel.get('authority')} no longer observes it",
|
||||
}
|
||||
)
|
||||
|
||||
# 5. relationship disappeared (store claims consumers that no longer import)
|
||||
for r in relationships(doc, type="consumed_by"):
|
||||
m = r["from"].split(":", 1)[1]
|
||||
c = r["to"].split(":", 1)[1]
|
||||
if m not in graph.get(c, set()):
|
||||
out.append({"class": "relationship_disappeared", "detail": f"{c} no longer imports {m} (stale store edge)"})
|
||||
return out
|
||||
|
||||
|
||||
"""STRANGLER EXIT (retired 2026-10-10): authoritative implementation in
|
||||
src/rust/rune_spine (parity proven against the frozen oracle in
|
||||
frozen_spine_oracle.json). Delegation-only stub; raises if the kernel
|
||||
is absent (no silent second implementation)."""
|
||||
core = _rust_core()
|
||||
if core is None:
|
||||
raise RuntimeError("rune_spine kernel not built — run the rune_spine build; the Python oracle was retired")
|
||||
return core.drift(doc, inputs)
|
||||
def drift(doc: dict) -> list[dict]:
|
||||
"""Architectural drift classes. Reuses authorities' verdicts; never
|
||||
duplicates their logic. Deterministic output. H3-spine: gathers the
|
||||
@@ -865,63 +617,14 @@ def snapshot(doc: dict, label: str = "") -> Path:
|
||||
|
||||
|
||||
def _py_export_umbrellas(doc: dict) -> dict:
|
||||
"""Python core of export_umbrellas (H3-spine: the Rust core in query.rs
|
||||
must produce identical output modulo generated_at)."""
|
||||
umbrellas: dict = {}
|
||||
for e in doc["entities"]:
|
||||
if e["kind"] != "subsystem":
|
||||
continue
|
||||
name = e["id"].split(":", 1)[1]
|
||||
umbrellas[name] = {
|
||||
"description": e["identities"].get("description", ""),
|
||||
"modules": [],
|
||||
"depends_on": [],
|
||||
"mirrors": [],
|
||||
}
|
||||
# faithful reproduction: emit canaries only when the ingested
|
||||
# authority carried them (the legacy contract omits empty lists)
|
||||
if e.get("ext", {}).get("canaries"):
|
||||
umbrellas[name]["canaries"] = sorted(e["ext"]["canaries"])
|
||||
for r in doc["relationships"]:
|
||||
if r["type"] == "belongs_to" and r["from"].startswith("module:"):
|
||||
mod = r["from"].split(":", 1)[1]
|
||||
# #416 decision: dunder modules (__init__, __main__) are not
|
||||
# umbrella-coverage surface — the coverage gate excludes
|
||||
# canary_/test_/__-prefixed stems, and the view must agree with
|
||||
# the gate or regeneration stays an unrunnable repair.
|
||||
if mod.startswith("_"):
|
||||
continue
|
||||
sub = r["to"].split(":", 1)[1]
|
||||
if sub in umbrellas:
|
||||
umbrellas[sub]["modules"].append(r["from"].split(":", 1)[1])
|
||||
elif r["type"] == "depends_on" and r["from"].startswith("subsystem:"):
|
||||
sub = r["from"].split(":", 1)[1]
|
||||
if sub in umbrellas:
|
||||
umbrellas[sub]["depends_on"].append(r["to"].split(":", 1)[1])
|
||||
elif r["type"] == "mirrors" and r["from"].startswith("subsystem:"):
|
||||
sub = r["from"].split(":", 1)[1]
|
||||
if sub in umbrellas:
|
||||
umbrellas[sub]["mirrors"].append(r["to"].split(":", 1)[1])
|
||||
elif r["type"] == "obligated_canary" and r["from"].startswith("subsystem:"):
|
||||
sub = r["from"].split(":", 1)[1]
|
||||
if sub in umbrellas:
|
||||
umbrellas[sub]["canaries"].append(r["to"].split(":", 1)[1])
|
||||
for u in umbrellas.values():
|
||||
u["modules"].sort()
|
||||
u["depends_on"].sort()
|
||||
u["mirrors"].sort()
|
||||
if "canaries" in u:
|
||||
u["canaries"].sort()
|
||||
return {
|
||||
"_comment": "GENERATED by rune.spine — compatibility view for legacy "
|
||||
"umbrella consumers. DO NOT EDIT: structural truth lives in "
|
||||
"store/spine/current.json; edits here are flagged by spine drift.",
|
||||
GENERATED_VIEW_MARKER: True,
|
||||
"generated_at": now(),
|
||||
"umbrellas": dict(sorted(umbrellas.items())),
|
||||
}
|
||||
|
||||
|
||||
"""STRANGLER EXIT (retired 2026-10-10): authoritative implementation in
|
||||
src/rust/rune_spine (parity proven against the frozen oracle in
|
||||
frozen_spine_oracle.json). Delegation-only stub; raises if the kernel
|
||||
is absent (no silent second implementation)."""
|
||||
core = _rust_core()
|
||||
if core is None:
|
||||
raise RuntimeError("rune_spine kernel not built — run the rune_spine build; the Python oracle was retired")
|
||||
return core.export_umbrellas(doc, now())
|
||||
def export_umbrellas(doc: dict) -> dict:
|
||||
"""Generate the legacy umbrella view FROM Spine. Output only — the old
|
||||
consumers (CI gate, henxels) read this during migration. Never ingest.
|
||||
@@ -978,34 +681,14 @@ def query(doc: dict, entity_id: str) -> dict:
|
||||
|
||||
|
||||
def _py_query(doc: dict, entity_id: str) -> dict:
|
||||
"""Python core of query (parity oracle for the Rust core)."""
|
||||
e = entity(doc, entity_id)
|
||||
if e is None:
|
||||
return {"error": "not found", "id": entity_id}
|
||||
return {
|
||||
"id": entity_id,
|
||||
"uri": spine_uri(entity_id),
|
||||
"kind": e["kind"],
|
||||
"owner": [r["to"] for r in relationships(doc, from_id=entity_id, type="belongs_to")],
|
||||
"dependencies": sorted({r["to"] for r in relationships(doc, from_id=entity_id, type="depends_on")}),
|
||||
"consumers": sorted(
|
||||
{r["to"] for r in relationships(doc, from_id=entity_id, type="consumed_by")}
|
||||
| {r["from"] for r in relationships(doc, to_id=entity_id, type="consumed_by")}
|
||||
),
|
||||
"contracts_implements": sorted(r["to"] for r in relationships(doc, from_id=entity_id, type="implements")),
|
||||
"contracts_consumes": sorted(r["to"] for r in relationships(doc, from_id=entity_id, type="consumes")),
|
||||
"state": {
|
||||
"maturity": e.get("maturity"),
|
||||
"observed_at": e.get("observed_at"),
|
||||
"resolved_status": resolve_status(e),
|
||||
"superseded_by": e.get("superseded_by"),
|
||||
"aliases": e.get("aliases", []),
|
||||
},
|
||||
"evidence": e.get("evidence_refs", []),
|
||||
"impact_frontier": impact_frontier(doc, [entity_id]),
|
||||
}
|
||||
|
||||
|
||||
"""STRANGLER EXIT (retired 2026-10-10): authoritative implementation in
|
||||
src/rust/rune_spine (parity proven against the frozen oracle in
|
||||
frozen_spine_oracle.json). Delegation-only stub; raises if the kernel
|
||||
is absent (no silent second implementation)."""
|
||||
core = _rust_core()
|
||||
if core is None:
|
||||
raise RuntimeError("rune_spine kernel not built — run the rune_spine build; the Python oracle was retired")
|
||||
return core.query(doc, entity_id)
|
||||
# ── authority/projector ownership + reconciliation (hardening T3/T4) ──────
|
||||
#
|
||||
# A projected fact carries `authority` = the projector that owns it. On
|
||||
|
||||
+15
-15
@@ -322,24 +322,24 @@ def _tc_core():
|
||||
|
||||
|
||||
def _py_estimate_tokens(text: str) -> int:
|
||||
"""Estimate token count (rough: 1 token ≈ 4 chars) — parity oracle."""
|
||||
return len(text) // 4
|
||||
"""STRANGLER EXIT (retired 2026-10-10): the authoritative implementation
|
||||
lives in src/rust/token_counting (tc_estimate_tokens, parity proven 26/26
|
||||
against the frozen oracle in frozen_oracle.json). This stub exists ONLY so
|
||||
old imports don't crash; it delegates to the kernel and raises if the
|
||||
kernel is absent (no silent second implementation)."""
|
||||
core = _tc_core()
|
||||
if core is None:
|
||||
raise RuntimeError("token_counting kernel not built — run the token_counting build; the Python oracle was retired")
|
||||
return core.estimate_tokens(text)
|
||||
|
||||
|
||||
def _py_compress_context(context: str) -> str:
|
||||
"""Compress context to reduce tokens — parity oracle."""
|
||||
# Remove multiple newlines
|
||||
compressed = re.sub(r"\n{3,}", "\n\n", context)
|
||||
|
||||
# Remove redundant spaces
|
||||
compressed = re.sub(r" {2,}", " ", compressed)
|
||||
|
||||
# Shorten common patterns
|
||||
compressed = compressed.replace("User:", "U:")
|
||||
compressed = compressed.replace("Assistant:", "A:")
|
||||
compressed = compressed.replace("System:", "S:")
|
||||
|
||||
return compressed.strip()
|
||||
"""STRANGLER EXIT (retired 2026-10-10): authoritative implementation in
|
||||
src/rust/token_counting (tc_compress_context). Same delegation-only rule."""
|
||||
core = _tc_core()
|
||||
if core is None:
|
||||
raise RuntimeError("token_counting kernel not built — run the token_counting build; the Python oracle was retired")
|
||||
return core.compress_context(context)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -116,60 +116,6 @@ def verify(result: dict, verifier_type: str) -> VerificationResult:
|
||||
return _rust_verify(result, verifier_type)
|
||||
|
||||
|
||||
def test_verification():
|
||||
"""Test the verification layer."""
|
||||
print("Testing Verification Layer...")
|
||||
|
||||
# Test exit code verification
|
||||
result = {"exit_code": 0}
|
||||
vr = verify(result, "exit_code")
|
||||
print(f"Exit code 0: passed={vr.passed}")
|
||||
assert vr.passed
|
||||
|
||||
result = {"exit_code": 1}
|
||||
vr = verify(result, "exit_code")
|
||||
print(f"Exit code 1: passed={vr.passed}")
|
||||
assert not vr.passed
|
||||
|
||||
# Test unit test verification
|
||||
result = {"tests_passed": 10, "tests_failed": 0, "tests_total": 10}
|
||||
vr = verify(result, "unit_test")
|
||||
print(f"All tests pass: passed={vr.passed}")
|
||||
assert vr.passed
|
||||
|
||||
result = {"tests_passed": 8, "tests_failed": 2, "tests_total": 10}
|
||||
vr = verify(result, "unit_test")
|
||||
print(f"2 tests fail: passed={vr.passed}")
|
||||
assert not vr.passed
|
||||
|
||||
# Test schema verification
|
||||
result = {"schema_valid": True, "schema_errors": []}
|
||||
vr = verify(result, "schema")
|
||||
print(f"Schema valid: passed={vr.passed}")
|
||||
assert vr.passed
|
||||
|
||||
# Test file exists verification
|
||||
result = {"file_path": "/tmp/test_file"}
|
||||
vr = verify(result, "file_exists")
|
||||
print(f"File exists: passed={vr.passed}")
|
||||
# File doesn't exist, so should fail
|
||||
assert not vr.passed, "Non-existent file should fail verification"
|
||||
|
||||
print("✅ All tests passed!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "test":
|
||||
test_verification()
|
||||
elif len(sys.argv) > 3 and sys.argv[1] == "verify":
|
||||
result = json.loads(sys.argv[2])
|
||||
verifier_type = sys.argv[3]
|
||||
vr = verify(result, verifier_type)
|
||||
print(json.dumps(vr.to_dict(), indent=2))
|
||||
else:
|
||||
print("Usage:")
|
||||
print(" verification_layer.py test — run tests")
|
||||
print(" verification_layer.py verify <result_json> <verifier_type> — verify result")
|
||||
|
||||
|
||||
def handle_hook(event, data=None):
|
||||
|
||||
+21
-50
@@ -186,10 +186,14 @@ def extract_topic(text):
|
||||
|
||||
|
||||
def _py_extract_topic(text):
|
||||
"""Python parity oracle (W3.4)."""
|
||||
words = re.findall(r"\w+", text.lower())
|
||||
return [w for w in words if len(w) > 3 and w not in _STOPWORDS][:5]
|
||||
|
||||
"""STRANGLER EXIT (retired 2026-10-10): authoritative implementation in
|
||||
src/rust/cognition_core (cc_witness_extract_topic). Delegation-only stub."""
|
||||
core = _core()
|
||||
if core is None:
|
||||
raise RuntimeError("cognition_core kernel not built — run the cognition_core build; the Python oracle was retired")
|
||||
from rune import cc_loader as _cl
|
||||
raw = _cl.witness_extract_topic(text, _stopwords())
|
||||
return list(raw) if isinstance(raw, list) else list(raw or [])
|
||||
|
||||
def detect_signals(message, tool_error=None, task_status=None, recent_topics=None):
|
||||
"""Tier 1: Reflex — extract signals from the turn. Pure Python, <1ms.
|
||||
@@ -215,52 +219,19 @@ def detect_signals(message, tool_error=None, task_status=None, recent_topics=Non
|
||||
|
||||
def _py_detect_signals(message, tool_error=None, task_status=None,
|
||||
recent_topics=None):
|
||||
"""Python parity oracle (W3.4). Local tables via the gather seam."""
|
||||
signals = {}
|
||||
|
||||
# Error signal
|
||||
if tool_error:
|
||||
signals["error"] = True
|
||||
signals["error_text"] = tool_error[:200]
|
||||
|
||||
# Correction signal
|
||||
if message and is_correction(message):
|
||||
signals["correction"] = True
|
||||
signals["corrected_topic"] = extract_topic(message)
|
||||
|
||||
# Completion signal
|
||||
if task_status in ("done", "abandoned", "failed"):
|
||||
signals["completion"] = task_status
|
||||
|
||||
# Topic drift signal
|
||||
if message and recent_topics:
|
||||
current_topics = set(extract_topic(message))
|
||||
recent_set = set(recent_topics)
|
||||
overlap = current_topics & recent_set
|
||||
if len(current_topics) > 0 and len(overlap) / len(current_topics) < 0.3:
|
||||
signals["topic_drift"] = True
|
||||
signals["new_topics"] = list(current_topics - recent_set)[:3]
|
||||
|
||||
# Commitment detection (tables live in _tables() — the gather seam;
|
||||
# the oracle reads the SAME table data the kernel receives)
|
||||
for signal_name, table_name in (
|
||||
("commitment_detected", "commitment"),
|
||||
("preference_detected", "preference"),
|
||||
("urgency_detected", "urgency"),
|
||||
("learning_opportunity", "learning"),
|
||||
):
|
||||
if message:
|
||||
for pattern in _tables().get(table_name, []):
|
||||
if re.search(pattern, message, re.IGNORECASE):
|
||||
signals[signal_name] = True
|
||||
break
|
||||
|
||||
# Contradiction signal (simple: message contains "but" or "however" after a statement)
|
||||
if message and re.search(r"\b(but|however|actually|wait|that contradicts)\b", message.lower()):
|
||||
signals["possible_contradiction"] = True
|
||||
|
||||
return signals
|
||||
|
||||
"""STRANGLER EXIT (retired 2026-10-10): authoritative implementation in
|
||||
src/rust/cognition_core (cc_witness_signals — completion gate + deterministic
|
||||
order fixed pre-exit). Delegation-only stub."""
|
||||
core = _core()
|
||||
if core is None:
|
||||
raise RuntimeError("cognition_core kernel not built — run the cognition_core build; the Python oracle was retired")
|
||||
from rune import cc_loader as _cl
|
||||
raw = _cl.witness_signals(message, _tables(), tool_error or "",
|
||||
task_status or "", recent_topics or [])
|
||||
if isinstance(raw, dict):
|
||||
return {k: v for k, v in raw.items() if v not in (False, "")}
|
||||
# non-dict → cannot serve; the kernel is authoritative so raise, never guess
|
||||
raise RuntimeError("cognition_core witness_signals returned non-dict")
|
||||
|
||||
def witness_reflect(signals, context=""):
|
||||
"""Tier 2: Witness — local model reflection on signals. Only called when signals non-empty.
|
||||
|
||||
@@ -16,6 +16,7 @@ Run: python3 src/rust/capability_scoring/canary_capability_scoring.py
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -165,15 +166,15 @@ def main() -> int:
|
||||
return 1
|
||||
|
||||
from rune import capability_broker # noqa: E402
|
||||
from rune import capability_fit # noqa: E402
|
||||
from rune import capability_fit # noqa: E402 — CapabilityRequirement class only; kernel expectations frozen below
|
||||
from rune import cs_loader # noqa: E402
|
||||
frozen = json.loads((Path(__file__).parent / "frozen_evaluate_fit.json").read_text(encoding="utf-8"))
|
||||
frozen_rows = {r["name"]: r["want"] for r in frozen["rows"]}
|
||||
|
||||
# ── 2. evaluate_fit parity ────────────────────────────────────────────
|
||||
print("\n--- 2. evaluate_fit parity ---")
|
||||
for name, contracts, candidate in fit_battery():
|
||||
req = capability_fit.CapabilityRequirement("test objective",
|
||||
contracts=contracts)
|
||||
py = capability_fit._py_evaluate_fit(req, candidate)
|
||||
py = frozen_rows[name]
|
||||
rs = cs_loader.evaluate_fit(contracts, candidate)
|
||||
test(f"fit: {name}", py == rs,
|
||||
f"py={py!r}\n rs={rs!r}")
|
||||
|
||||
@@ -0,0 +1,452 @@
|
||||
{
|
||||
"_doc": "FROZEN ORACLE (capability_fit exit): from live _py_evaluate_fit 2026-10-10.",
|
||||
"rows": [
|
||||
{
|
||||
"name": "exact",
|
||||
"contracts": [
|
||||
"a",
|
||||
"b"
|
||||
],
|
||||
"candidate": {
|
||||
"id": "c1",
|
||||
"provides": [
|
||||
"a",
|
||||
"b",
|
||||
"c"
|
||||
],
|
||||
"status": "LIVE",
|
||||
"maturity": "WIRED",
|
||||
"consumers": []
|
||||
},
|
||||
"want": {
|
||||
"candidate": "c1",
|
||||
"fit": "EXACT",
|
||||
"reason": "all required contracts provided",
|
||||
"missing_contracts": [],
|
||||
"covered": 2,
|
||||
"maturity_rank": 2,
|
||||
"consumers": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "partial",
|
||||
"contracts": [
|
||||
"a",
|
||||
"b",
|
||||
"c"
|
||||
],
|
||||
"candidate": {
|
||||
"id": "c2",
|
||||
"provides": [
|
||||
"a"
|
||||
],
|
||||
"status": "LIVE",
|
||||
"maturity": "WIRED",
|
||||
"consumers": []
|
||||
},
|
||||
"want": {
|
||||
"candidate": "c2",
|
||||
"fit": "PARTIAL",
|
||||
"reason": "covers 1/3 required contracts",
|
||||
"missing_contracts": [
|
||||
"b",
|
||||
"c"
|
||||
],
|
||||
"covered": 1,
|
||||
"maturity_rank": 2,
|
||||
"consumers": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "incompatible-none",
|
||||
"contracts": [
|
||||
"a",
|
||||
"b"
|
||||
],
|
||||
"candidate": {
|
||||
"id": "c3",
|
||||
"provides": [
|
||||
"x"
|
||||
],
|
||||
"status": "LIVE",
|
||||
"maturity": "WIRED",
|
||||
"consumers": []
|
||||
},
|
||||
"want": {
|
||||
"candidate": "c3",
|
||||
"fit": "INCOMPATIBLE",
|
||||
"reason": "provides none of the required contracts",
|
||||
"missing_contracts": [
|
||||
"a",
|
||||
"b"
|
||||
],
|
||||
"covered": 0,
|
||||
"maturity_rank": 2,
|
||||
"consumers": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "incompatible-superseded",
|
||||
"contracts": [
|
||||
"a"
|
||||
],
|
||||
"candidate": {
|
||||
"id": "c4",
|
||||
"provides": [
|
||||
"a"
|
||||
],
|
||||
"status": "SUPERSEDED",
|
||||
"maturity": "WIRED",
|
||||
"consumers": []
|
||||
},
|
||||
"want": {
|
||||
"candidate": "c4",
|
||||
"fit": "INCOMPATIBLE",
|
||||
"reason": "candidate status SUPERSEDED \u2014 not reusable as-is",
|
||||
"missing_contracts": [],
|
||||
"covered": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "incompatible-stale",
|
||||
"contracts": [
|
||||
"a"
|
||||
],
|
||||
"candidate": {
|
||||
"id": "c5",
|
||||
"provides": [
|
||||
"a"
|
||||
],
|
||||
"status": "STALE",
|
||||
"maturity": "WIRED",
|
||||
"consumers": []
|
||||
},
|
||||
"want": {
|
||||
"candidate": "c5",
|
||||
"fit": "INCOMPATIBLE",
|
||||
"reason": "candidate status STALE \u2014 not reusable as-is",
|
||||
"missing_contracts": [],
|
||||
"covered": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "unknown-empty",
|
||||
"contracts": [
|
||||
"a"
|
||||
],
|
||||
"candidate": {
|
||||
"id": "c6",
|
||||
"provides": [],
|
||||
"status": "LIVE",
|
||||
"maturity": "WIRED",
|
||||
"consumers": []
|
||||
},
|
||||
"want": {
|
||||
"candidate": "c6",
|
||||
"fit": "UNKNOWN",
|
||||
"reason": "candidate exposes no contracts to check",
|
||||
"missing_contracts": [
|
||||
"a"
|
||||
],
|
||||
"covered": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "empty-req",
|
||||
"contracts": [],
|
||||
"candidate": {
|
||||
"id": "c7",
|
||||
"provides": [
|
||||
"a"
|
||||
],
|
||||
"status": "LIVE",
|
||||
"maturity": "WIRED",
|
||||
"consumers": []
|
||||
},
|
||||
"want": {
|
||||
"candidate": "c7",
|
||||
"fit": "EXACT",
|
||||
"reason": "all required contracts provided",
|
||||
"missing_contracts": [],
|
||||
"covered": 0,
|
||||
"maturity_rank": 2,
|
||||
"consumers": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "maturity-declared",
|
||||
"contracts": [
|
||||
"a"
|
||||
],
|
||||
"candidate": {
|
||||
"id": "c8",
|
||||
"provides": [
|
||||
"a"
|
||||
],
|
||||
"status": "LIVE",
|
||||
"maturity": "DECLARED",
|
||||
"consumers": []
|
||||
},
|
||||
"want": {
|
||||
"candidate": "c8",
|
||||
"fit": "EXACT",
|
||||
"reason": "all required contracts provided",
|
||||
"missing_contracts": [],
|
||||
"covered": 1,
|
||||
"maturity_rank": 0,
|
||||
"consumers": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "EXACT all covered",
|
||||
"contracts": [
|
||||
"contract:a",
|
||||
"contract:b"
|
||||
],
|
||||
"candidate": {
|
||||
"id": "cap:x",
|
||||
"provides": [
|
||||
"contract:a",
|
||||
"contract:b"
|
||||
],
|
||||
"status": "CURRENT",
|
||||
"maturity": "WIRED",
|
||||
"consumers": [
|
||||
"module:y"
|
||||
]
|
||||
},
|
||||
"want": {
|
||||
"candidate": "cap:x",
|
||||
"fit": "EXACT",
|
||||
"reason": "all required contracts provided",
|
||||
"missing_contracts": [],
|
||||
"covered": 2,
|
||||
"maturity_rank": 2,
|
||||
"consumers": [
|
||||
"module:y"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "PARTIAL some covered",
|
||||
"contracts": [
|
||||
"contract:a",
|
||||
"contract:b",
|
||||
"contract:c"
|
||||
],
|
||||
"candidate": {
|
||||
"id": "cap:x",
|
||||
"provides": [
|
||||
"contract:a"
|
||||
],
|
||||
"status": "CURRENT",
|
||||
"maturity": "DECLARED",
|
||||
"consumers": []
|
||||
},
|
||||
"want": {
|
||||
"candidate": "cap:x",
|
||||
"fit": "PARTIAL",
|
||||
"reason": "covers 1/3 required contracts",
|
||||
"missing_contracts": [
|
||||
"contract:b",
|
||||
"contract:c"
|
||||
],
|
||||
"covered": 1,
|
||||
"maturity_rank": 0,
|
||||
"consumers": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "INCOMPATIBLE none covered",
|
||||
"contracts": [
|
||||
"contract:a"
|
||||
],
|
||||
"candidate": {
|
||||
"id": "cap:x",
|
||||
"provides": [
|
||||
"contract:zzz"
|
||||
],
|
||||
"status": "CURRENT",
|
||||
"maturity": "PRESENT",
|
||||
"consumers": []
|
||||
},
|
||||
"want": {
|
||||
"candidate": "cap:x",
|
||||
"fit": "INCOMPATIBLE",
|
||||
"reason": "provides none of the required contracts",
|
||||
"missing_contracts": [
|
||||
"contract:a"
|
||||
],
|
||||
"covered": 0,
|
||||
"maturity_rank": 1,
|
||||
"consumers": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "UNKNOWN no provides",
|
||||
"contracts": [
|
||||
"contract:a"
|
||||
],
|
||||
"candidate": {
|
||||
"id": "cap:x",
|
||||
"provides": [],
|
||||
"status": "CURRENT",
|
||||
"maturity": "DECLARED",
|
||||
"consumers": []
|
||||
},
|
||||
"want": {
|
||||
"candidate": "cap:x",
|
||||
"fit": "UNKNOWN",
|
||||
"reason": "candidate exposes no contracts to check",
|
||||
"missing_contracts": [
|
||||
"contract:a"
|
||||
],
|
||||
"covered": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "unhealthy SUPERSEDED",
|
||||
"contracts": [
|
||||
"contract:a"
|
||||
],
|
||||
"candidate": {
|
||||
"id": "cap:x",
|
||||
"provides": [
|
||||
"contract:a"
|
||||
],
|
||||
"status": "SUPERSEDED",
|
||||
"maturity": "WIRED",
|
||||
"consumers": []
|
||||
},
|
||||
"want": {
|
||||
"candidate": "cap:x",
|
||||
"fit": "INCOMPATIBLE",
|
||||
"reason": "candidate status SUPERSEDED \u2014 not reusable as-is",
|
||||
"missing_contracts": [],
|
||||
"covered": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "unhealthy STALE",
|
||||
"contracts": [
|
||||
"contract:a"
|
||||
],
|
||||
"candidate": {
|
||||
"id": "cap:x",
|
||||
"provides": [
|
||||
"contract:a"
|
||||
],
|
||||
"status": "STALE",
|
||||
"maturity": "WIRED",
|
||||
"consumers": []
|
||||
},
|
||||
"want": {
|
||||
"candidate": "cap:x",
|
||||
"fit": "INCOMPATIBLE",
|
||||
"reason": "candidate status STALE \u2014 not reusable as-is",
|
||||
"missing_contracts": [],
|
||||
"covered": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "unhealthy superseded_by set",
|
||||
"contracts": [
|
||||
"contract:a"
|
||||
],
|
||||
"candidate": {
|
||||
"id": "cap:x",
|
||||
"provides": [
|
||||
"contract:a"
|
||||
],
|
||||
"status": "CURRENT",
|
||||
"superseded_by": "cap:newer",
|
||||
"maturity": "WIRED",
|
||||
"consumers": []
|
||||
},
|
||||
"want": {
|
||||
"candidate": "cap:x",
|
||||
"fit": "INCOMPATIBLE",
|
||||
"reason": "candidate status CURRENT \u2014 not reusable as-is",
|
||||
"missing_contracts": [],
|
||||
"covered": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "no contracts required -> EXACT",
|
||||
"contracts": [],
|
||||
"candidate": {
|
||||
"id": "cap:x",
|
||||
"provides": [
|
||||
"contract:a"
|
||||
],
|
||||
"status": "CURRENT",
|
||||
"maturity": "LIVE_PROVEN",
|
||||
"consumers": [
|
||||
"a",
|
||||
"b"
|
||||
]
|
||||
},
|
||||
"want": {
|
||||
"candidate": "cap:x",
|
||||
"fit": "EXACT",
|
||||
"reason": "all required contracts provided",
|
||||
"missing_contracts": [],
|
||||
"covered": 0,
|
||||
"maturity_rank": 5,
|
||||
"consumers": [
|
||||
"a",
|
||||
"b"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "unknown maturity ranks zero",
|
||||
"contracts": [
|
||||
"contract:a"
|
||||
],
|
||||
"candidate": {
|
||||
"id": "cap:x",
|
||||
"provides": [
|
||||
"contract:a"
|
||||
],
|
||||
"status": "CURRENT",
|
||||
"maturity": "WEIRD",
|
||||
"consumers": []
|
||||
},
|
||||
"want": {
|
||||
"candidate": "cap:x",
|
||||
"fit": "EXACT",
|
||||
"reason": "all required contracts provided",
|
||||
"missing_contracts": [],
|
||||
"covered": 1,
|
||||
"maturity_rank": 0,
|
||||
"consumers": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "duplicate provides dedup via set math",
|
||||
"contracts": [
|
||||
"contract:a"
|
||||
],
|
||||
"candidate": {
|
||||
"id": "cap:x",
|
||||
"provides": [
|
||||
"contract:a",
|
||||
"contract:a"
|
||||
],
|
||||
"status": "CURRENT",
|
||||
"maturity": "EXERCISED",
|
||||
"consumers": []
|
||||
},
|
||||
"want": {
|
||||
"candidate": "cap:x",
|
||||
"fit": "EXACT",
|
||||
"reason": "all required contracts provided",
|
||||
"missing_contracts": [],
|
||||
"covered": 1,
|
||||
"maturity_rank": 4,
|
||||
"consumers": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
{
|
||||
"_doc": "FROZEN ORACLE (pins exit) \u2014 REAL pin shapes (context inside details).",
|
||||
"recs": [
|
||||
{
|
||||
"item_id": "alpha exit",
|
||||
"state": "open",
|
||||
"details": "{\"question\": \"q1\", \"outcome\": \"o1\", \"context\": \"ctx one\", \"reason\": \"\", \"source\": \"session\"}"
|
||||
},
|
||||
{
|
||||
"item_id": "beta",
|
||||
"state": "resolved",
|
||||
"details": "{\"question\": \"q2\", \"outcome\": \"o2\", \"context\": \"exit here\", \"reason\": \"\", \"source\": \"session\"}"
|
||||
},
|
||||
{
|
||||
"item_id": "gamma",
|
||||
"state": "open",
|
||||
"details": "{\"question\": \"q3\", \"outcome\": \"o3\", \"context\": \"\", \"reason\": \"\", \"source\": \"session\"}"
|
||||
},
|
||||
{
|
||||
"item_id": "delta",
|
||||
"state": "open",
|
||||
"details": "{\"question\": \"q4\", \"outcome\": \"o4\", \"context\": \"exit context here\", \"reason\": \"\", \"source\": \"session\"}"
|
||||
}
|
||||
],
|
||||
"rows": [
|
||||
{
|
||||
"term": "exit",
|
||||
"limit": 4,
|
||||
"want": [
|
||||
{
|
||||
"topic": "alpha exit",
|
||||
"question": "q1",
|
||||
"outcome": "o1",
|
||||
"context": "ctx one",
|
||||
"status": "open",
|
||||
"reason": ""
|
||||
},
|
||||
{
|
||||
"topic": "delta",
|
||||
"question": "q4",
|
||||
"outcome": "o4",
|
||||
"context": "exit context here",
|
||||
"status": "open",
|
||||
"reason": ""
|
||||
}
|
||||
],
|
||||
"rust": [
|
||||
{
|
||||
"topic": "alpha exit",
|
||||
"question": "q1",
|
||||
"outcome": "o1",
|
||||
"context": "ctx one",
|
||||
"status": "open",
|
||||
"reason": ""
|
||||
},
|
||||
{
|
||||
"topic": "delta",
|
||||
"question": "q4",
|
||||
"outcome": "o4",
|
||||
"context": "exit context here",
|
||||
"status": "open",
|
||||
"reason": ""
|
||||
}
|
||||
],
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"term": "exit",
|
||||
"limit": 1,
|
||||
"want": [
|
||||
{
|
||||
"topic": "alpha exit",
|
||||
"question": "q1",
|
||||
"outcome": "o1",
|
||||
"context": "ctx one",
|
||||
"status": "open",
|
||||
"reason": ""
|
||||
}
|
||||
],
|
||||
"rust": [
|
||||
{
|
||||
"topic": "alpha exit",
|
||||
"question": "q1",
|
||||
"outcome": "o1",
|
||||
"context": "ctx one",
|
||||
"status": "open",
|
||||
"reason": ""
|
||||
}
|
||||
],
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"term": "alpha",
|
||||
"limit": 4,
|
||||
"want": [
|
||||
{
|
||||
"topic": "alpha exit",
|
||||
"question": "q1",
|
||||
"outcome": "o1",
|
||||
"context": "ctx one",
|
||||
"status": "open",
|
||||
"reason": ""
|
||||
}
|
||||
],
|
||||
"rust": [
|
||||
{
|
||||
"topic": "alpha exit",
|
||||
"question": "q1",
|
||||
"outcome": "o1",
|
||||
"context": "ctx one",
|
||||
"status": "open",
|
||||
"reason": ""
|
||||
}
|
||||
],
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"term": "zzz",
|
||||
"limit": 4,
|
||||
"want": [],
|
||||
"rust": [],
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"term": "context",
|
||||
"limit": 4,
|
||||
"want": [
|
||||
{
|
||||
"topic": "delta",
|
||||
"question": "q4",
|
||||
"outcome": "o4",
|
||||
"context": "exit context here",
|
||||
"status": "open",
|
||||
"reason": ""
|
||||
}
|
||||
],
|
||||
"rust": [
|
||||
{
|
||||
"topic": "delta",
|
||||
"question": "q4",
|
||||
"outcome": "o4",
|
||||
"context": "exit context here",
|
||||
"status": "open",
|
||||
"reason": ""
|
||||
}
|
||||
],
|
||||
"match": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
{
|
||||
"_doc": "FROZEN ORACLE (witness exit).",
|
||||
"topics": [
|
||||
{
|
||||
"text": "the quick brown fox jumps over the lazy dog",
|
||||
"want": [
|
||||
"quick",
|
||||
"brown",
|
||||
"jumps",
|
||||
"over",
|
||||
"lazy"
|
||||
],
|
||||
"rust": [
|
||||
"quick",
|
||||
"brown",
|
||||
"jumps",
|
||||
"over",
|
||||
"lazy"
|
||||
],
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"text": "fix the memory leak in retrieval",
|
||||
"want": [
|
||||
"memory",
|
||||
"leak",
|
||||
"retrieval"
|
||||
],
|
||||
"rust": [
|
||||
"memory",
|
||||
"leak",
|
||||
"retrieval"
|
||||
],
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"text": "hello",
|
||||
"want": [
|
||||
"hello"
|
||||
],
|
||||
"rust": [
|
||||
"hello"
|
||||
],
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"text": "",
|
||||
"want": [],
|
||||
"rust": [],
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"text": "Rust kernels and Python oracles must agree exactly",
|
||||
"want": [
|
||||
"rust",
|
||||
"kernels",
|
||||
"python",
|
||||
"oracles",
|
||||
"must"
|
||||
],
|
||||
"rust": [
|
||||
"rust",
|
||||
"kernels",
|
||||
"python",
|
||||
"oracles",
|
||||
"must"
|
||||
],
|
||||
"match": true
|
||||
}
|
||||
],
|
||||
"signals": [
|
||||
{
|
||||
"msg": "plain hello",
|
||||
"terr": null,
|
||||
"tstat": null,
|
||||
"rt": null,
|
||||
"want": {},
|
||||
"rust": {},
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"msg": "I made an error fixing this",
|
||||
"terr": "traceback line 5",
|
||||
"tstat": null,
|
||||
"rt": null,
|
||||
"want": {
|
||||
"error": true,
|
||||
"error_text": "traceback line 5"
|
||||
},
|
||||
"rust": {
|
||||
"error": true,
|
||||
"error_text": "traceback line 5"
|
||||
},
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"msg": "looks good, ship it",
|
||||
"terr": null,
|
||||
"tstat": "completed",
|
||||
"rt": [
|
||||
"rust kernels"
|
||||
],
|
||||
"want": {
|
||||
"topic_drift": true,
|
||||
"new_topics": [
|
||||
"looks",
|
||||
"good",
|
||||
"ship"
|
||||
]
|
||||
},
|
||||
"rust": {
|
||||
"topic_drift": true,
|
||||
"new_topics": [
|
||||
"looks",
|
||||
"good",
|
||||
"ship"
|
||||
]
|
||||
},
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"msg": "looks good, ship it",
|
||||
"terr": null,
|
||||
"tstat": "done",
|
||||
"rt": [
|
||||
"rust kernels"
|
||||
],
|
||||
"want": {
|
||||
"completion": "done",
|
||||
"topic_drift": true,
|
||||
"new_topics": [
|
||||
"looks",
|
||||
"good",
|
||||
"ship"
|
||||
]
|
||||
},
|
||||
"rust": {
|
||||
"completion": "done",
|
||||
"topic_drift": true,
|
||||
"new_topics": [
|
||||
"looks",
|
||||
"good",
|
||||
"ship"
|
||||
]
|
||||
},
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"msg": "",
|
||||
"terr": null,
|
||||
"tstat": null,
|
||||
"rt": null,
|
||||
"want": {},
|
||||
"rust": {},
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"msg": "fix fix fix the bug now",
|
||||
"terr": "err",
|
||||
"tstat": "running",
|
||||
"rt": [],
|
||||
"want": {
|
||||
"error": true,
|
||||
"error_text": "err",
|
||||
"urgency_detected": true
|
||||
},
|
||||
"rust": {
|
||||
"error": true,
|
||||
"error_text": "err",
|
||||
"urgency_detected": true
|
||||
},
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"msg": "task abandoned yesterday",
|
||||
"terr": null,
|
||||
"tstat": "abandoned",
|
||||
"rt": null,
|
||||
"want": {
|
||||
"completion": "abandoned"
|
||||
},
|
||||
"rust": {
|
||||
"completion": "abandoned"
|
||||
},
|
||||
"match": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -769,8 +769,13 @@ pub fn witness_signals(
|
||||
witness_extract_topic(message, &sw, 5),
|
||||
));
|
||||
}
|
||||
// ORACLE PARITY (frozen witness oracle): completion fires ONLY for the
|
||||
// frozen triple ("done", "abandoned", "failed"). Other statuses
|
||||
// ("completed", "running", ...) are NOT completion signals.
|
||||
if let Some(st) = task_status {
|
||||
sig.push(("completion".into(), Json::Str(st.to_string())));
|
||||
if st == "done" || st == "abandoned" || st == "failed" {
|
||||
sig.push(("completion".into(), Json::Str(st.to_string())));
|
||||
}
|
||||
}
|
||||
if !message.is_empty() && !recent_topics.is_empty() {
|
||||
let sw: Vec<Json> = match get(tables, "stopwords") {
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
{
|
||||
"_doc": "FROZEN ORACLE (drift_core exit).",
|
||||
"rows": [
|
||||
{
|
||||
"name": "cv0",
|
||||
"entry": {
|
||||
"wash_count": 0,
|
||||
"importance": 0.5,
|
||||
"last_accessed": null
|
||||
},
|
||||
"want": 0.375,
|
||||
"rust": 0.375,
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"name": "cv1",
|
||||
"entry": {
|
||||
"wash_count": 25,
|
||||
"importance": 0.9,
|
||||
"last_accessed": "2026-10-09T00:00:00+00:00"
|
||||
},
|
||||
"want": 0.8405,
|
||||
"rust": 0.8405,
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"name": "cv2",
|
||||
"entry": {
|
||||
"wash_count": 5,
|
||||
"importance": 0.3,
|
||||
"last_accessed": "2026-06-01T00:00:00+00:00",
|
||||
"text": "memory about rust kernels"
|
||||
},
|
||||
"want": 0.3537,
|
||||
"rust": 0.3537,
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"name": "cv3",
|
||||
"entry": {
|
||||
"wash_count": 100,
|
||||
"importance": 1.0,
|
||||
"last_accessed": "2026-10-10T11:00:00+00:00",
|
||||
"text": "rust kernels and memory"
|
||||
},
|
||||
"want": 0.9497,
|
||||
"rust": 0.9497,
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"name": "cv_goals",
|
||||
"entry": {
|
||||
"wash_count": 5,
|
||||
"importance": 0.3,
|
||||
"last_accessed": "2026-06-01T00:00:00+00:00",
|
||||
"text": "memory about rust kernels"
|
||||
},
|
||||
"goals": [
|
||||
"rust kernels"
|
||||
],
|
||||
"want": 0.4037,
|
||||
"rust": 0.4037,
|
||||
"match": true
|
||||
}
|
||||
],
|
||||
"promotion_rows": [
|
||||
{
|
||||
"name": "pe_0_washable",
|
||||
"entry": {
|
||||
"wash_count": 0,
|
||||
"rock_status": "washable",
|
||||
"importance": 0.7,
|
||||
"last_accessed": "2026-10-09T00:00:00+00:00"
|
||||
},
|
||||
"want": [
|
||||
false,
|
||||
"proven_uses 0 < threshold 20"
|
||||
],
|
||||
"rust": [
|
||||
false,
|
||||
"proven_uses 0 < threshold 20"
|
||||
],
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"name": "pe_5_washable",
|
||||
"entry": {
|
||||
"wash_count": 5,
|
||||
"rock_status": "washable",
|
||||
"importance": 0.7,
|
||||
"last_accessed": "2026-10-09T00:00:00+00:00"
|
||||
},
|
||||
"want": [
|
||||
false,
|
||||
"proven_uses 5 < threshold 20"
|
||||
],
|
||||
"rust": [
|
||||
false,
|
||||
"proven_uses 5 < threshold 20"
|
||||
],
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"name": "pe_25_washable",
|
||||
"entry": {
|
||||
"wash_count": 25,
|
||||
"rock_status": "washable",
|
||||
"importance": 0.7,
|
||||
"last_accessed": "2026-10-09T00:00:00+00:00"
|
||||
},
|
||||
"want": [
|
||||
true,
|
||||
"wash_count=25, value=0.790"
|
||||
],
|
||||
"rust": [
|
||||
true,
|
||||
"wash_count=25, value=0.790"
|
||||
],
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"name": "pe_10_rock",
|
||||
"entry": {
|
||||
"wash_count": 10,
|
||||
"rock_status": "rock",
|
||||
"importance": 0.7,
|
||||
"last_accessed": "2026-10-09T00:00:00+00:00"
|
||||
},
|
||||
"want": [
|
||||
false,
|
||||
"already rock"
|
||||
],
|
||||
"rust": [
|
||||
false,
|
||||
"already rock"
|
||||
],
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"name": "pe_30_washable",
|
||||
"entry": {
|
||||
"wash_count": 30,
|
||||
"rock_status": "washable",
|
||||
"importance": 0.7,
|
||||
"last_accessed": "2026-10-09T00:00:00+00:00"
|
||||
},
|
||||
"want": [
|
||||
true,
|
||||
"wash_count=30, value=0.805"
|
||||
],
|
||||
"rust": [
|
||||
true,
|
||||
"wash_count=30, value=0.805"
|
||||
],
|
||||
"match": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -70,6 +70,9 @@ pub extern "C" fn ms_compute_value(arg: *const c_char) -> *mut c_char {
|
||||
let now = get_str(&a, "now").ok_or("arg.now required")?.to_string();
|
||||
let goals = get(&a, "goals").cloned();
|
||||
let v = scoring::compute_value(&entry, goals.as_ref(), &now);
|
||||
if !v.is_finite() {
|
||||
return Err("compute_value: non-numeric or out-of-domain wash_count (oracle: TypeError/ValueError)".to_string());
|
||||
}
|
||||
Ok(pyjson::Json::Num(v))
|
||||
});
|
||||
envelope(result)
|
||||
|
||||
@@ -37,6 +37,9 @@ fn obj_get<'a>(v: &'a Json, key: &str) -> Option<&'a Json> {
|
||||
fn as_num(v: Option<&Json>) -> Option<f64> {
|
||||
match v {
|
||||
Some(Json::Num(n)) => Some(*n),
|
||||
// Python bool IS int (True==1): log1p(True) works. Parity demands it.
|
||||
Some(Json::Bool(true)) => Some(1.0),
|
||||
Some(Json::Bool(false)) => Some(0.0),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -148,9 +151,26 @@ pub fn parse_iso(s: &str) -> Option<f64> {
|
||||
// ── compute_value ───────────────────────────────────────────────────────────
|
||||
|
||||
pub fn compute_value(entry: &Json, goals: Option<&Json>, now_iso: &str) -> f64 {
|
||||
// TYPE PARITY: Python raises TypeError on non-numeric wash_count
|
||||
// (log1p on a str). A string/bool/object wash_count must error, not
|
||||
// silently default to 0.0.
|
||||
if let Some(wc) = obj_get(entry, "wash_count") {
|
||||
match wc {
|
||||
Json::Num(_) | Json::Null | Json::Bool(_) => {}
|
||||
_ => return f64::NAN,
|
||||
}
|
||||
}
|
||||
let proven = num_or(obj_get(entry, "wash_count"), 0.0);
|
||||
let imp = num_or(obj_get(entry, "importance"), 0.5);
|
||||
|
||||
// ORACLE PARITY (adversarial edges, test_constitutional_adversarial):
|
||||
// Python log1p raises TypeError on non-numbers and ValueError on
|
||||
// proven <= -1. The envelope must ERROR, never silently score.
|
||||
// (NaN.min(1.0) == 1.0 in Rust would INVERT the edge: negative wash
|
||||
// counts would score proven_factor=MAX. Fail loud instead.)
|
||||
if !proven.is_finite() || proven <= -1.0 {
|
||||
return f64::NAN; // sentinel: the FFI layer converts to Err
|
||||
}
|
||||
let proven_factor = (proven.ln_1p() / PROVEN_USES_THRESHOLD.ln_1p()).min(1.0);
|
||||
|
||||
let mut recency = 1.0;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -190,7 +190,9 @@ def main() -> int:
|
||||
|
||||
# ── 6. language placement (the protocol's dichotomy intelligence) ─────
|
||||
print("\n--- 6. Language placement ---")
|
||||
from rune import construction_decision as cd_mod # noqa: E402
|
||||
from rune import construction_decision as cd_mod # noqa: E402 — public delegation probe only; kernel expectations frozen below
|
||||
frozen_lp = json.loads((Path(__file__).parent / "frozen_language_placement.json").read_text(encoding="utf-8"))
|
||||
frozen_lp_rows = {(r["project"], tuple(r["chars"])): r["want"] for r in frozen_lp["rows"]}
|
||||
|
||||
placement_cases = [
|
||||
("rune", ["network", "reactive"], "go"),
|
||||
@@ -211,7 +213,10 @@ def main() -> int:
|
||||
("RUNE", ["Reactive"], "go"), # case-insensitive
|
||||
]
|
||||
for project, chars, want in placement_cases:
|
||||
py = cd_mod._py_language_placement(project, chars)
|
||||
py = frozen_lp_rows.get((project, tuple(chars)))
|
||||
if py is None:
|
||||
# case not in frozen oracle: compute via public delegation (kernel live)
|
||||
py = cd_mod.language_placement(project, chars)
|
||||
rs = sc_loader.language_placement(project, chars)
|
||||
test(f"placement {project} {chars} -> {want}",
|
||||
py == rs and rs["placement"] == want,
|
||||
|
||||
@@ -0,0 +1,462 @@
|
||||
{
|
||||
"_doc": "FROZEN ORACLE (language_placement exit).",
|
||||
"rows": [
|
||||
{
|
||||
"project": "rune",
|
||||
"chars": [
|
||||
"route",
|
||||
"dispatch",
|
||||
"chat"
|
||||
],
|
||||
"want": {
|
||||
"placement": "go",
|
||||
"rule": "rune dichotomy: reactive/initiating markers",
|
||||
"evidence": {
|
||||
"go_signals": [
|
||||
"route",
|
||||
"dispatch",
|
||||
"chat"
|
||||
],
|
||||
"rust_signals": []
|
||||
}
|
||||
},
|
||||
"rust": {
|
||||
"placement": "go",
|
||||
"rule": "rune dichotomy: reactive/initiating markers",
|
||||
"evidence": {
|
||||
"go_signals": [
|
||||
"route",
|
||||
"dispatch",
|
||||
"chat"
|
||||
],
|
||||
"rust_signals": []
|
||||
}
|
||||
},
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"project": "rune",
|
||||
"chars": [
|
||||
"compute",
|
||||
"store",
|
||||
"ledger"
|
||||
],
|
||||
"want": {
|
||||
"placement": "rust",
|
||||
"rule": "rune dichotomy: deterministic/state markers",
|
||||
"evidence": {
|
||||
"go_signals": [],
|
||||
"rust_signals": [
|
||||
"compute",
|
||||
"store",
|
||||
"ledger"
|
||||
]
|
||||
}
|
||||
},
|
||||
"rust": {
|
||||
"placement": "rust",
|
||||
"rule": "rune dichotomy: deterministic/state markers",
|
||||
"evidence": {
|
||||
"go_signals": [],
|
||||
"rust_signals": [
|
||||
"compute",
|
||||
"store",
|
||||
"ledger"
|
||||
]
|
||||
}
|
||||
},
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"project": "rune",
|
||||
"chars": [
|
||||
"route",
|
||||
"compute"
|
||||
],
|
||||
"want": {
|
||||
"placement": "hybrid",
|
||||
"rule": "rune dichotomy: both marker classes \u2014 a contracted membrane junction",
|
||||
"evidence": {
|
||||
"go_signals": [
|
||||
"route"
|
||||
],
|
||||
"rust_signals": [
|
||||
"compute"
|
||||
]
|
||||
}
|
||||
},
|
||||
"rust": {
|
||||
"placement": "hybrid",
|
||||
"rule": "rune dichotomy: both marker classes \u2014 a contracted membrane junction",
|
||||
"evidence": {
|
||||
"go_signals": [
|
||||
"route"
|
||||
],
|
||||
"rust_signals": [
|
||||
"compute"
|
||||
]
|
||||
}
|
||||
},
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"project": "rune",
|
||||
"chars": [
|
||||
"zzz_no_signals"
|
||||
],
|
||||
"want": {
|
||||
"placement": "rust",
|
||||
"rule": "rune dichotomy: pure compute defaults to the deterministic backend",
|
||||
"evidence": {
|
||||
"go_signals": [],
|
||||
"rust_signals": []
|
||||
}
|
||||
},
|
||||
"rust": {
|
||||
"placement": "rust",
|
||||
"rule": "rune dichotomy: pure compute defaults to the deterministic backend",
|
||||
"evidence": {
|
||||
"go_signals": [],
|
||||
"rust_signals": []
|
||||
}
|
||||
},
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"project": "other",
|
||||
"chars": [
|
||||
"http",
|
||||
"server"
|
||||
],
|
||||
"want": {
|
||||
"placement": "go",
|
||||
"rule": "characteristic fit: reactive/network profile",
|
||||
"evidence": {
|
||||
"go_signals": [
|
||||
"http",
|
||||
"server"
|
||||
],
|
||||
"rust_signals": []
|
||||
}
|
||||
},
|
||||
"rust": {
|
||||
"placement": "go",
|
||||
"rule": "characteristic fit: reactive/network profile",
|
||||
"evidence": {
|
||||
"go_signals": [
|
||||
"http",
|
||||
"server"
|
||||
],
|
||||
"rust_signals": []
|
||||
}
|
||||
},
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"project": "other",
|
||||
"chars": [
|
||||
"deterministic",
|
||||
"pure-function"
|
||||
],
|
||||
"want": {
|
||||
"placement": "rust",
|
||||
"rule": "characteristic fit: deterministic/state profile",
|
||||
"evidence": {
|
||||
"go_signals": [],
|
||||
"rust_signals": [
|
||||
"deterministic",
|
||||
"pure-function"
|
||||
]
|
||||
}
|
||||
},
|
||||
"rust": {
|
||||
"placement": "rust",
|
||||
"rule": "characteristic fit: deterministic/state profile",
|
||||
"evidence": {
|
||||
"go_signals": [],
|
||||
"rust_signals": [
|
||||
"deterministic",
|
||||
"pure-function"
|
||||
]
|
||||
}
|
||||
},
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"project": "other",
|
||||
"chars": [
|
||||
"http",
|
||||
"compute"
|
||||
],
|
||||
"want": {
|
||||
"placement": "hybrid",
|
||||
"rule": "characteristic fit: mixed profile \u2014 split at the membrane",
|
||||
"evidence": {
|
||||
"go_signals": [
|
||||
"http"
|
||||
],
|
||||
"rust_signals": [
|
||||
"compute"
|
||||
]
|
||||
}
|
||||
},
|
||||
"rust": {
|
||||
"placement": "hybrid",
|
||||
"rule": "characteristic fit: mixed profile \u2014 split at the membrane",
|
||||
"evidence": {
|
||||
"go_signals": [
|
||||
"http"
|
||||
],
|
||||
"rust_signals": [
|
||||
"compute"
|
||||
]
|
||||
}
|
||||
},
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"project": "other",
|
||||
"chars": [
|
||||
"zzz"
|
||||
],
|
||||
"want": {
|
||||
"placement": "unassessed",
|
||||
"rule": "no placement signals \u2014 the unit needs characteristics recorded",
|
||||
"evidence": {
|
||||
"go_signals": [],
|
||||
"rust_signals": []
|
||||
}
|
||||
},
|
||||
"rust": {
|
||||
"placement": "unassessed",
|
||||
"rule": "no placement signals \u2014 the unit needs characteristics recorded",
|
||||
"evidence": {
|
||||
"go_signals": [],
|
||||
"rust_signals": []
|
||||
}
|
||||
},
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"project": "RUNE",
|
||||
"chars": [
|
||||
"MODEL",
|
||||
"Provider"
|
||||
],
|
||||
"want": {
|
||||
"placement": "go",
|
||||
"rule": "rune dichotomy: reactive/initiating markers",
|
||||
"evidence": {
|
||||
"go_signals": [
|
||||
"model",
|
||||
"provider"
|
||||
],
|
||||
"rust_signals": []
|
||||
}
|
||||
},
|
||||
"rust": {
|
||||
"placement": "go",
|
||||
"rule": "rune dichotomy: reactive/initiating markers",
|
||||
"evidence": {
|
||||
"go_signals": [
|
||||
"model",
|
||||
"provider"
|
||||
],
|
||||
"rust_signals": []
|
||||
}
|
||||
},
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"project": "rune",
|
||||
"chars": [],
|
||||
"want": {
|
||||
"placement": "rust",
|
||||
"rule": "rune dichotomy: pure compute defaults to the deterministic backend",
|
||||
"evidence": {
|
||||
"go_signals": [],
|
||||
"rust_signals": []
|
||||
}
|
||||
},
|
||||
"rust": {
|
||||
"placement": "rust",
|
||||
"rule": "rune dichotomy: pure compute defaults to the deterministic backend",
|
||||
"evidence": {
|
||||
"go_signals": [],
|
||||
"rust_signals": []
|
||||
}
|
||||
},
|
||||
"match": true
|
||||
},
|
||||
{
|
||||
"project": "rune",
|
||||
"chars": [
|
||||
"network",
|
||||
"reactive"
|
||||
],
|
||||
"want": {
|
||||
"placement": "go",
|
||||
"rule": "rune dichotomy: reactive/initiating markers",
|
||||
"evidence": {
|
||||
"go_signals": [
|
||||
"reactive",
|
||||
"network"
|
||||
],
|
||||
"rust_signals": []
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"project": "rune",
|
||||
"chars": [
|
||||
"storage",
|
||||
"deterministic"
|
||||
],
|
||||
"want": {
|
||||
"placement": "rust",
|
||||
"rule": "rune dichotomy: deterministic/state markers",
|
||||
"evidence": {
|
||||
"go_signals": [],
|
||||
"rust_signals": [
|
||||
"deterministic"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"project": "rune",
|
||||
"chars": [
|
||||
"network",
|
||||
"storage"
|
||||
],
|
||||
"want": {
|
||||
"placement": "go",
|
||||
"rule": "rune dichotomy: reactive/initiating markers",
|
||||
"evidence": {
|
||||
"go_signals": [
|
||||
"network"
|
||||
],
|
||||
"rust_signals": []
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"project": "rune",
|
||||
"chars": [
|
||||
"network",
|
||||
"store"
|
||||
],
|
||||
"want": {
|
||||
"placement": "hybrid",
|
||||
"rule": "rune dichotomy: both marker classes \u2014 a contracted membrane junction",
|
||||
"evidence": {
|
||||
"go_signals": [
|
||||
"network"
|
||||
],
|
||||
"rust_signals": [
|
||||
"store"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"project": "rune",
|
||||
"chars": [
|
||||
"pure compute"
|
||||
],
|
||||
"want": {
|
||||
"placement": "rust",
|
||||
"rule": "rune dichotomy: deterministic/state markers",
|
||||
"evidence": {
|
||||
"go_signals": [],
|
||||
"rust_signals": [
|
||||
"compute"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"project": "other-proj",
|
||||
"chars": [
|
||||
"http",
|
||||
"server"
|
||||
],
|
||||
"want": {
|
||||
"placement": "go",
|
||||
"rule": "characteristic fit: reactive/network profile",
|
||||
"evidence": {
|
||||
"go_signals": [
|
||||
"http",
|
||||
"server"
|
||||
],
|
||||
"rust_signals": []
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"project": "other-proj",
|
||||
"chars": [
|
||||
"memory",
|
||||
"ledger"
|
||||
],
|
||||
"want": {
|
||||
"placement": "rust",
|
||||
"rule": "characteristic fit: deterministic/state profile",
|
||||
"evidence": {
|
||||
"go_signals": [],
|
||||
"rust_signals": [
|
||||
"memory",
|
||||
"ledger"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"project": "other-proj",
|
||||
"chars": [
|
||||
"memory",
|
||||
"network"
|
||||
],
|
||||
"want": {
|
||||
"placement": "hybrid",
|
||||
"rule": "characteristic fit: mixed profile \u2014 split at the membrane",
|
||||
"evidence": {
|
||||
"go_signals": [
|
||||
"network"
|
||||
],
|
||||
"rust_signals": [
|
||||
"memory"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"project": "other-proj",
|
||||
"chars": [],
|
||||
"want": {
|
||||
"placement": "unassessed",
|
||||
"rule": "no placement signals \u2014 the unit needs characteristics recorded",
|
||||
"evidence": {
|
||||
"go_signals": [],
|
||||
"rust_signals": []
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"project": "RUNE",
|
||||
"chars": [
|
||||
"Reactive"
|
||||
],
|
||||
"want": {
|
||||
"placement": "go",
|
||||
"rule": "rune dichotomy: reactive/initiating markers",
|
||||
"evidence": {
|
||||
"go_signals": [
|
||||
"reactive"
|
||||
],
|
||||
"rust_signals": []
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -16,6 +16,7 @@ Run: python3 src/rust/token_counting/canary_token_counting.py
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -107,19 +108,20 @@ def main() -> int:
|
||||
return 1
|
||||
|
||||
from rune import tc_loader # noqa: E402
|
||||
from rune import token_optimizer # noqa: E402
|
||||
from rune import token_optimizer # noqa: E402 — class surface only (delegation probe); kernel expectations frozen below
|
||||
frozen = json.loads((Path(__file__).parent / "frozen_oracle.json").read_text(encoding="utf-8"))
|
||||
|
||||
# ── 2. estimate_tokens parity ─────────────────────────────────────────
|
||||
print("\n--- 2. estimate_tokens parity ---")
|
||||
for name, text in token_cases():
|
||||
py = token_optimizer._py_estimate_tokens(text)
|
||||
py = frozen["estimate"][name]
|
||||
rs = tc_loader.estimate_tokens(text)
|
||||
test(f"tokens: {name}", py == rs, f"py={py!r} rs={rs!r}")
|
||||
|
||||
# ── 3. _compress_context parity ───────────────────────────────────────
|
||||
print("\n--- 3. _compress_context parity ---")
|
||||
for name, text in compress_cases():
|
||||
py = token_optimizer._py_compress_context(text)
|
||||
py = frozen["compress"][name]
|
||||
rs = tc_loader.compress_context(text)
|
||||
test(f"compress: {name}", py == rs, f"py={py!r} rs={rs!r}")
|
||||
|
||||
@@ -128,11 +130,11 @@ def main() -> int:
|
||||
opt = token_optimizer.TokenOptimizer(storage_path="/tmp/tc-canary-store.json")
|
||||
test("public estimate_tokens matches core",
|
||||
opt.estimate_tokens("héllo wörld — ünïcode")
|
||||
== token_optimizer._py_estimate_tokens("héllo wörld — ünïcode"),
|
||||
== frozen["extra_estimate"]["héllo wörld — ünïcode"],
|
||||
"mismatch")
|
||||
test("public _compress_context matches core",
|
||||
opt._compress_context("User: a\n\n\n\nAssistant: b")
|
||||
== token_optimizer._py_compress_context("User: a\n\n\n\nAssistant: b"),
|
||||
== frozen["extra_compress"]["User: a\n\n\n\nAssistant: b"],
|
||||
"mismatch")
|
||||
|
||||
print(f"\n{'=' * 47}")
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"_doc": "FROZEN ORACLE (token_optimizer strangler exit): expectations generated from the live Python _py_* on 2026-10-10, the last day they existed. The canary asserts Rust against these, not against imports — parity stays provable after deletion.",
|
||||
"estimate": {
|
||||
"empty": 0,
|
||||
"three chars floor zero": 0,
|
||||
"exactly four": 1,
|
||||
"five floors one": 1,
|
||||
"long ascii": 250,
|
||||
"unicode code points not bytes": 5,
|
||||
"emoji counts as code point(s)": 4,
|
||||
"newlines counted": 2
|
||||
},
|
||||
"compress": {
|
||||
"empty": "",
|
||||
"no-op plain": "simple context",
|
||||
"triple newline collapses": "a\n\nb",
|
||||
"many newlines to two": "a\n\nb",
|
||||
"double newline preserved": "a\n\nb",
|
||||
"space run collapses": "a b",
|
||||
"double space collapses": "a b",
|
||||
"single space preserved": "a b",
|
||||
"tab not a space": "a\t\tb",
|
||||
"prefix shortening all three": "U: hi\nA: yo\nS: note",
|
||||
"prefix mid-word untouched": "Abuser: stays",
|
||||
"strip trailing": "padded",
|
||||
"combined chaos": "U: a\n\nA: b c",
|
||||
"unicode preserved": "héllo wörld\n\n— ünïcode"
|
||||
},
|
||||
"extra_estimate": {
|
||||
"héllo wörld — ünïcode": 5
|
||||
},
|
||||
"extra_compress": {
|
||||
"User: a\n\n\n\nAssistant: b": "U: a\n\nA: b"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"_doc": "Strangler-exit record: Python modules whose kernels landed and whose Python source was DELETED (Wave 5 retirement sweep, tranche plan \u00a7Wave 5: parity proven + CI green + deployed one cycle). A retired module reappearing as Python fails the dichotomy henxel gate (D4).",
|
||||
"retired": [
|
||||
{
|
||||
"module": "token_optimizer",
|
||||
"commit": "532fe649",
|
||||
"evidence": "frozen_oracle.json 22 rows + canary 26/26 + 40 shims + 78 slice + clippy 0",
|
||||
"date": "2026-10-10"
|
||||
},
|
||||
{
|
||||
"module": "capability_fit",
|
||||
"commit": "99698d16",
|
||||
"evidence": "frozen_evaluate_fit.json 18 rows + canary 24/24 + 85 regression incl. live consumer",
|
||||
"date": "2026-10-10"
|
||||
},
|
||||
{
|
||||
"module": "verification_layer",
|
||||
"commit": "b2ac8c85",
|
||||
"evidence": "fully delegated pre-exit (33/33 parity) + demo retired to tests + 12 regression",
|
||||
"date": "2026-10-10"
|
||||
},
|
||||
{
|
||||
"module": "drift_core",
|
||||
"commit": "fd718150",
|
||||
"evidence": "adversarial divergence FIXED pre-exit (NaN.min inversion + silent str default) + frozen 10 rows + 15/15 adversarial + 138 regression",
|
||||
"date": "2026-10-10"
|
||||
},
|
||||
{
|
||||
"module": "pins",
|
||||
"commit": "0a7d0b73",
|
||||
"evidence": "frozen real-shape oracle 5/5 + 207 regression",
|
||||
"date": "2026-10-10"
|
||||
},
|
||||
{
|
||||
"module": "behavior",
|
||||
"commit": "pending",
|
||||
"evidence": "no duplicated logic (math in habitmath.rs, SQL in Python) + parity_behavior 16/16",
|
||||
"date": "2026-10-10"
|
||||
},
|
||||
{
|
||||
"module": "spine",
|
||||
"commit": "44225afa",
|
||||
"evidence": "frozen full-doc oracle (327 entities) + canary 21/21 + 110 spine/shims + 327 lines deleted",
|
||||
"date": "2026-10-10"
|
||||
},
|
||||
{
|
||||
"module": "witness",
|
||||
"commit": "6a9eaddd",
|
||||
"evidence": "completion-gate + order divergences FIXED pre-exit + frozen 12 rows + 58 regression",
|
||||
"date": "2026-10-10"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"_doc": "RETIREMENT RATCHET (strangler exit, Wave 5): Python modules whose kernels have landed AND delegate \u2014 the deletion debt. The list ONLY SHRINKS: each entry retires when parity proven + CI green + deployed one cycle (the tranche plan's strangler-exit law). Floor never increases; a module reappearing here after retirement fails the dichotomy henxel gate (D3). CANDIDACY LAW (Nick 2026-10-10, tightened): a module earns deletion candidacy only when (a) the ENTIRE consumed Python surface has kernel counterparts, (b) the kernel exposes FFI externs or a live loader seam actually called by the adapter, (c) canaries prove the kernel matches AND beats the Python capabilities, (d) the tranche-plan exit law holds (parity + CI green + deployed one cycle). Partial ports like claim_audit (1 of 12 fns, no FFI externs) are NOT candidates \u2014 they are PARITY DEBT.",
|
||||
"updated": "2026-10-10",
|
||||
"py_lines_of_debt": 7496,
|
||||
"candidates": []
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for __init__ \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "__init__",
|
||||
"why": "Rune \u2014 stateful coding assistant with elastic cognition.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "package init: version/build-info reads only (deterministic metadata)",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for __main__ \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "__main__",
|
||||
"why": "Rune TUI \u2014 the body. Entry point for `python3 -m rune`.\"\"\"",
|
||||
"side": "RETIRES",
|
||||
"side_evidence": "bootstrap glue subsumed by the Go runtime env contract",
|
||||
"laws": [
|
||||
"retired \u2014 no replacement; consumers must not import"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for abstraction \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "abstraction",
|
||||
"why": "Abstraction pipeline \u2014 converts raw episodes into reusable knowledge.",
|
||||
"side": "GO",
|
||||
"side_evidence": "RE-CLASSIFIED (Nick's dichotomy): sqlite3 (storage-backed); network/concurrency imports: ['urllib']; deterministic/state domain. Network/threading is the primary purpose \u2014 this module initiates, responds, or routes. Reactive \u2192 Go.",
|
||||
"laws": [
|
||||
"reactive/entry surface (no deterministic kernels hiding here)",
|
||||
"oracle-first truth battery (generated from the live Python oracle)",
|
||||
"HARD CI parity gate (replay + in-package test, not swallowable)",
|
||||
"construction contract FIRST (absolute-scaffolding law)",
|
||||
"parity + improvement note (defect fixed, measured gain, or honest parity-only)"
|
||||
],
|
||||
"parity_means": "Audited 2026-10-10: LLM-first reactive orchestrator (GO by design); Go abstraction dir is the parity twin; cc kernel fallback via cc_loader. The Python IS the adapter \u2014 no exit candidacy, correctly placed.",
|
||||
"status": "ported"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for adaptive_router \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "adaptive_router",
|
||||
"why": "adaptive_router.py \u2014 canonical adaptive route authority (ADAPT-2, #291;\nrevised per handoff 2026-09-10 \u00a73\u2013\u00a77: progressive evidence routing).",
|
||||
"side": "GO",
|
||||
"side_evidence": "reactive/initiating domain",
|
||||
"laws": [
|
||||
"reactive/entry surface (no deterministic kernels hiding here)",
|
||||
"oracle-first truth battery (generated from the live Python oracle)",
|
||||
"HARD CI parity gate (replay + in-package test, not swallowable)",
|
||||
"construction contract FIRST (absolute-scaffolding law)",
|
||||
"parity + improvement note (defect fixed, measured gain, or honest parity-only)"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for attention_capsule \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "attention_capsule",
|
||||
"why": "Attention Capsule \u2014 compact working set for cognitive work.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "no network/reactive markers \u2014 pure compute defaults to the deterministic backend",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "NOT parity: kernel exists but the Python module never delegates. Parity means the adapter delegates through the kernel (tier_manager pattern) with both paths pinned by tests.",
|
||||
"status": "facade"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for audit_ledger \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "audit_ledger",
|
||||
"why": "audit_ledger.py \u2014 HMAC-chained tamper-evident promotion ledger.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "deterministic/state domain",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "Audited 2026-10-10: _compute_hash is a 3-line seam (JSON-encode + ep call, hash math in Rust, parity proven True); verify/append delegate. No duplicated logic \u2014 the seam stays by design.",
|
||||
"status": "ported"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for auto_context \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "auto_context",
|
||||
"why": "Auto-context plugin \u2014 runs memory recall on every user message and writes\nresults to a context file that can be injected into the model's view.",
|
||||
"side": "GO",
|
||||
"side_evidence": "network/concurrency imports: ['subprocess']",
|
||||
"laws": [
|
||||
"reactive/entry surface (no deterministic kernels hiding here)",
|
||||
"oracle-first truth battery (generated from the live Python oracle)",
|
||||
"HARD CI parity gate (replay + in-package test, not swallowable)",
|
||||
"construction contract FIRST (absolute-scaffolding law)",
|
||||
"parity + improvement note (defect fixed, measured gain, or honest parity-only)"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for auto_tasks \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "auto_tasks",
|
||||
"why": "Automatic task extraction \u2014 conversation becomes tracked tasks.",
|
||||
"side": "GO",
|
||||
"side_evidence": "sqlite3 (storage-backed); network/concurrency imports: ['subprocess']",
|
||||
"laws": [
|
||||
"reactive/entry surface (no deterministic kernels hiding here)",
|
||||
"oracle-first truth battery (generated from the live Python oracle)",
|
||||
"HARD CI parity gate (replay + in-package test, not swallowable)",
|
||||
"construction contract FIRST (absolute-scaffolding law)",
|
||||
"parity + improvement note (defect fixed, measured gain, or honest parity-only)"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for behavior \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "behavior",
|
||||
"why": "Behavioral patterns \u2014 scoped corrections and habit formation.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "sqlite3 (storage-backed); deterministic/state domain",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "Strangler exit 2026-10-10: no Python-owned decision math (habitmath.rs authoritative, SQL stays Python); parity_behavior 16/16.",
|
||||
"status": "retired"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for behaviour_ledger \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "behaviour_ledger",
|
||||
"why": "behaviour_ledger.py \u2014 T19 \u00a719F/19G/19I: the canonical Behaviour\nValidation Ledger.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "deterministic/state domain",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "Parity claimed via oracle-first truth battery + HARD CI gate; deletion earned under the retirement law (parity + CI green + deployed one cycle).",
|
||||
"status": "ported"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for build_basis \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "build_basis",
|
||||
"why": "build_basis.py \u2014 T18 \u00a718C: durable versioned RESEARCH BASIS for\nconstruction (V1 rule F: RESEARCH INFORMS STRUCTURE).",
|
||||
"side": "RUST",
|
||||
"side_evidence": "no network/reactive markers \u2014 pure compute defaults to the deterministic backend",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "NOT parity: kernel exists but the Python module never delegates. Parity means the adapter delegates through the kernel (tier_manager pattern) with both paths pinned by tests.",
|
||||
"status": "facade"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for build_mode \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "build_mode",
|
||||
"why": "build_mode.py \u2014 Build mode orchestrator for Rune TUI.",
|
||||
"side": "GO",
|
||||
"side_evidence": "network/concurrency imports: ['subprocess']",
|
||||
"laws": [
|
||||
"reactive/entry surface (no deterministic kernels hiding here)",
|
||||
"oracle-first truth battery (generated from the live Python oracle)",
|
||||
"HARD CI parity gate (replay + in-package test, not swallowable)",
|
||||
"construction contract FIRST (absolute-scaffolding law)",
|
||||
"parity + improvement note (defect fixed, measured gain, or honest parity-only)"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for builder_bridge \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "builder_bridge",
|
||||
"why": "builder_bridge.py \u2014 MiMo builder bridge (thin adapter over Rune Core).",
|
||||
"side": "GO",
|
||||
"side_evidence": "reactive/initiating domain",
|
||||
"laws": [
|
||||
"reactive/entry surface (no deterministic kernels hiding here)",
|
||||
"oracle-first truth battery (generated from the live Python oracle)",
|
||||
"HARD CI parity gate (replay + in-package test, not swallowable)",
|
||||
"construction contract FIRST (absolute-scaffolding law)",
|
||||
"parity + improvement note (defect fixed, measured gain, or honest parity-only)"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for builder_bridge_cli \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "builder_bridge_cli",
|
||||
"why": "builder_bridge_cli.py \u2014 CLI wrapper around rune.builder_bridge.preflight.",
|
||||
"side": "GO",
|
||||
"side_evidence": "reactive/initiating domain",
|
||||
"laws": [
|
||||
"reactive/entry surface (no deterministic kernels hiding here)",
|
||||
"oracle-first truth battery (generated from the live Python oracle)",
|
||||
"HARD CI parity gate (replay + in-package test, not swallowable)",
|
||||
"construction contract FIRST (absolute-scaffolding law)",
|
||||
"parity + improvement note (defect fixed, measured gain, or honest parity-only)"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for cache \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "cache",
|
||||
"why": "Cache system \u2014 event-driven, write-once-derive-twice, compression for context not display.",
|
||||
"side": "GO",
|
||||
"side_evidence": "sqlite3 (storage-backed); network/concurrency imports: ['threading']",
|
||||
"laws": [
|
||||
"reactive/entry surface (no deterministic kernels hiding here)",
|
||||
"oracle-first truth battery (generated from the live Python oracle)",
|
||||
"HARD CI parity gate (replay + in-package test, not swallowable)",
|
||||
"construction contract FIRST (absolute-scaffolding law)",
|
||||
"parity + improvement note (defect fixed, measured gain, or honest parity-only)"
|
||||
],
|
||||
"parity_means": "NOT parity: kernel exists but the Python module never delegates. Parity means the adapter delegates through the kernel (tier_manager pattern) with both paths pinned by tests.",
|
||||
"status": "facade"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_audit_ledger \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_audit_ledger",
|
||||
"why": "canary_audit_ledger.py \u2014 Python canary for slice-2 ports 1-6.",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_cognitive_strata \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_cognitive_strata",
|
||||
"why": "Cognitive strata canary: no-change suppression + toggle independence.",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_context_broker \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_context_broker",
|
||||
"why": "Context-broker canary: admission, fail-loud, absence proof, compaction.",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_conversation_state \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_conversation_state",
|
||||
"why": "Conversation-state canary: canonical task + message ledgers stay alive.",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_full_system \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_full_system",
|
||||
"why": "canary_full_system.py \u2014 Full system canary with all wiring.",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_gitea_automation \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_gitea_automation",
|
||||
"why": "Contract canary for Gitea templates, labels, and backups.\"\"\"",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_gitea_delegation \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_gitea_delegation",
|
||||
"why": "Gitea delegation canary: offline round trip, no network access.\"\"\"",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_gitea_pipeline \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_gitea_pipeline",
|
||||
"why": "Contract canary for the mandatory Gitea push pipeline.\"\"\"",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_memory_synthesis \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_memory_synthesis",
|
||||
"why": "Memory and synthesis canary: item-ID cursor + cumulative chain.\"\"\"",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_native \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_native",
|
||||
"why": "Canary \u2014 verifies all native imports work correctly.",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_orchestration_foundation \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_orchestration_foundation",
|
||||
"why": "Foundation canary: one spine, one authority, deterministic chain.\"\"\"",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_p0_04 \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_p0_04",
|
||||
"why": "P0-04 pipeline-removal canary (#20).",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_p0_05 \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_p0_05",
|
||||
"why": "P0-05 native-tools canary (#21).",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_p0_07 \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_p0_07",
|
||||
"why": "P0-07 inference-trace canary (#23).",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_p1_01 \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_p1_01",
|
||||
"why": "P1-01 capability-authority canary (#24).",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_p1_02 \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_p1_02",
|
||||
"why": "P1-02 capsule-fidelity canary (#25).",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_p1_03 \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_p1_03",
|
||||
"why": "P1-03 memory-selection canary (#26).",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_p1_06 \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_p1_06",
|
||||
"why": "P1-06 model/provider-routing canary (#29).",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_p1_07 \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_p1_07",
|
||||
"why": "P1-07 runtime-objects canary (#30).",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_query_memory \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_query_memory",
|
||||
"why": "canary_query_memory.py \u2014 Canary for query memory system.",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_resource_authority \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_resource_authority",
|
||||
"why": "Resource authority canary: unknown rejected, outage deterministic, one authority.\"\"\"",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_rune_entry \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_rune_entry",
|
||||
"why": "canary_rune_entry.py \u2014 H1 canary for the Go first-call shim.",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_rune_serve \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_rune_serve",
|
||||
"why": "canary_rune_serve.py \u2014 H2 parity battery (T4.3, contract\nBUILDER-2026-10-04T08:32:43Z-cli).",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_schema_migration \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_schema_migration",
|
||||
"why": "Schema-migration canary: migrate once, idempotent re-run, wiring proof.",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_spine_meta \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_spine_meta",
|
||||
"why": "canary_spine_meta.py \u2014 meta-scaffold canary (H-meta).",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_surface_parity \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_surface_parity",
|
||||
"why": "Surface parity canary: same root for every entry path, offline.\"\"\"",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_tui_drift \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_tui_drift",
|
||||
"why": "canary_tui_drift.py \u2014 Canary for TUI drift system wiring.",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_tui_transport \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_tui_transport",
|
||||
"why": "canary_tui_transport.py \u2014 H4 slice 1 battery (T4.5, contract\nBUILDER-2026-10-04T10:32:00Z-cli).",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for canary_unbounded \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "canary_unbounded",
|
||||
"why": "canary_unbounded.py \u2014 Canary for unbounded memory system.",
|
||||
"side": "TEST-INFRA",
|
||||
"side_evidence": "canary/test module",
|
||||
"laws": [
|
||||
"test/canary only \u2014 never a production dependency"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for capability_broker \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "capability_broker",
|
||||
"why": "Capability broker \u2014 maps user intent to relevant plugins.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "deterministic/state domain",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "Parity claimed via oracle-first truth battery + HARD CI gate; deletion earned under the retirement law (parity + CI green + deployed one cycle).",
|
||||
"status": "ported"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for capability_fit \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "capability_fit",
|
||||
"why": "capability_fit.py \u2014 Requirement-fit capability discovery + gap decision.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "deterministic/state domain",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "Strangler exit 2026-10-10 (99698d16): _py_evaluate_fit deleted, Rust authoritative, frozen oracle + 24/24 canary.",
|
||||
"status": "retired"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for capability_ledger \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "capability_ledger",
|
||||
"why": "capability_ledger.py \u2014 T19 \u00a719D: compact versioned Capability\nLedgers \u2014 local re-entry context packets.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "deterministic/state domain",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "NOT parity: kernel exists but the Python module never delegates. Parity means the adapter delegates through the kernel (tier_manager pattern) with both paths pinned by tests.",
|
||||
"status": "facade"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for cc_loader \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "cc_loader",
|
||||
"why": "ctypes loader for the Rust cognition_core (R2 W3.1).",
|
||||
"side": "RUST",
|
||||
"side_evidence": "ctypes FFI binding to libcognition_core (deterministic kernel membrane; no network imports)",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for chat_bubble \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "chat_bubble",
|
||||
"why": "Chat Bubble Widget \u2014 styled message bubbles for the TUI.",
|
||||
"side": "TUI-LAST",
|
||||
"side_evidence": "textual/rich imports: ['rich', 'textual']",
|
||||
"laws": [
|
||||
"stays Textual until Wave 7 (Bubble Tea LAST by law)",
|
||||
"no deterministic kernels in the TUI layer"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for claim_audit \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "claim_audit",
|
||||
"why": "ACTIVE claim-audit layer \u2014 prevents unsupported strong claims at generation.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "sqlite3 (storage-backed); deterministic/state domain",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "Parity claimed via oracle-first truth battery + HARD CI gate; deletion earned under the retirement law (parity + CI green + deployed one cycle).",
|
||||
"status": "ported"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for cognitive_budgeter \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "cognitive_budgeter",
|
||||
"why": "Cognitive Budgeter \u2014 decides how much cognition an event deserves.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "deterministic/state domain",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "NOT parity: kernel exists but the Python module never delegates. Parity means the adapter delegates through the kernel (tier_manager pattern) with both paths pinned by tests.",
|
||||
"status": "facade"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for connection_pool \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "connection_pool",
|
||||
"why": "Connection Pool \u2014 reuse database connections instead of creating new ones.",
|
||||
"side": "GO",
|
||||
"side_evidence": "sqlite3 (storage-backed); network/concurrency imports: ['threading']",
|
||||
"laws": [
|
||||
"reactive/entry surface (no deterministic kernels hiding here)",
|
||||
"oracle-first truth battery (generated from the live Python oracle)",
|
||||
"HARD CI parity gate (replay + in-package test, not swallowable)",
|
||||
"construction contract FIRST (absolute-scaffolding law)",
|
||||
"parity + improvement note (defect fixed, measured gain, or honest parity-only)"
|
||||
],
|
||||
"parity_means": "Not yet ported. Parity means: kernel in its measured side, oracle-first truth battery, HARD CI gate, delegation wired, then retirement earned.",
|
||||
"status": "not_started"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for construction_activation \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "construction_activation",
|
||||
"why": "construction_activation.py \u2014 the activation dispatcher.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "deterministic/state domain",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "NOT parity: kernel exists but the Python module never delegates. Parity means the adapter delegates through the kernel (tier_manager pattern) with both paths pinned by tests.",
|
||||
"status": "facade"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for construction_commands \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "construction_commands",
|
||||
"why": "construction_commands.py \u2014 T16 \u00a716J: bounded validated inbound\ncommand interface for future Substrate integration.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "deterministic/state domain",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "NOT parity: kernel exists but the Python module never delegates. Parity means the adapter delegates through the kernel (tier_manager pattern) with both paths pinned by tests.",
|
||||
"status": "facade"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for construction_decision \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "construction_decision",
|
||||
"why": "construction_decision.py \u2014 live Need \u2192 Decision \u2192 Construction Contract.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "deterministic/state domain",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "Parity claimed via oracle-first truth battery + HARD CI gate; deletion earned under the retirement law (parity + CI green + deployed one cycle).",
|
||||
"status": "ported"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for construction_depth \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "construction_depth",
|
||||
"why": "construction_depth.py \u2014 proportional Scaffolding depth selection.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "deterministic/state domain",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "NOT parity: kernel exists but the Python module never delegates. Parity means the adapter delegates through the kernel (tier_manager pattern) with both paths pinned by tests.",
|
||||
"status": "facade"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for construction_intent \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "construction_intent",
|
||||
"why": "construction_intent.py \u2014 T17 \u00a717J-\u00a717N: the conversational\ninterpretation layer of contextual construction.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "deterministic/state domain",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "NOT parity: kernel exists but the Python module never delegates. Parity means the adapter delegates through the kernel (tier_manager pattern) with both paths pinned by tests.",
|
||||
"status": "facade"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for construction_interface \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "construction_interface",
|
||||
"why": "construction_interface.py \u2014 the stable builder-facing Construction\nInterface (SCAFFOLD-TRANCHE-007).",
|
||||
"side": "RUST",
|
||||
"side_evidence": "deterministic/state domain",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "NOT parity: kernel exists but the Python module never delegates. Parity means the adapter delegates through the kernel (tier_manager pattern) with both paths pinned by tests.",
|
||||
"status": "facade"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for construction_mode \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "construction_mode",
|
||||
"why": "construction_mode.py \u2014 contextual construction classification.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "deterministic/state domain",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "NOT parity: kernel exists but the Python module never delegates. Parity means the adapter delegates through the kernel (tier_manager pattern) with both paths pinned by tests.",
|
||||
"status": "facade"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"_doc": "INTENT LEDGER (scaffolding, Nick 2026-10-10): the WHY for construction_pattern \u2014 what it exists FOR, what side it belongs on, what laws its port must satisfy, and what 'parity' means for it. Parity is judged against intent, not just behavior.",
|
||||
"module": "construction_pattern",
|
||||
"why": "construction_pattern.py \u2014 reusable evidence about HOW a class of thing\nis normally built.",
|
||||
"side": "RUST",
|
||||
"side_evidence": "deterministic/state domain",
|
||||
"laws": [
|
||||
"deterministic pure kernel (no wall clock \u2014 inputs carry time)",
|
||||
"no file IO in kernels (adapter owns persistence)",
|
||||
"FFI envelope ABI (read_arg/arg_json/envelope)",
|
||||
"oracle-first truth battery (Python truth generated FIRST)",
|
||||
"llvm-cov branch coverage + clippy 0"
|
||||
],
|
||||
"parity_means": "NOT parity: kernel exists but the Python module never delegates. Parity means the adapter delegates through the kernel (tier_manager pattern) with both paths pinned by tests.",
|
||||
"status": "facade"
|
||||
}
|
||||
Loaded 100 of 223 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user