Fold SPEC/maven/ROADMAP into DESIGN.md and drop the stale session logs

15 root markdown files, ~4,900 lines against ~33,000 lines of Go, with at least
three pairs contradicting each other. When five documents describe the
architecture, the code becomes the only trustworthy one — which defeats the
point of having them. That drift is why the resident-model question had four
incompatible answers.

SPEC.md, maven.md and ROADMAP.md are deduped into DESIGN.md rather than
concatenated, with a "Superseded" section carrying eight retired decisions and
what replaced each: classifier-owns-the-route (the cascade is still the live
path, but as a stopgap, not a design to extend), faster-whisper/vosk/silero,
the small-model phrasing claim, sqlcipher, the Kotlin/Spring sketches,
obsidian->chroma, script deployment, and FloorEnrollment. Superseded material
is kept and marked rather than deleted, so it cannot read as current.

SESSION-05/06-07-2026.md and PLANS.md are removed outright — git history holds
them, and both were verified tracked before deletion.

Go doc comments citing the deleted files are repointed to the equivalent
DESIGN.md sections. Several asserted designs that were already retired, so the
claims are corrected and not just relinked: stt.go named faster-whisper as
production (it is whisper.cpp), tts.go named silero (it is piper), intent.go
still described the classifier as owning the route, and stale vosk/chroma
vocabulary is replaced. ECOSYSTEM-SPEC.md references are deliberately
untouched — that is a different document, and a naive grep for SPEC.md matches
it.

Root markdown drops from 4,880 to ~3,700 lines. The review's ~1,500 target is
not reachable while keeping the files it also said to keep — those alone are
2,553 lines — so trimming further needs a separate decision on
MAVEN_ECOSYSTEM_ARCHITECTURE.md and PROGRESS.md.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X5JApcrCRVGmqrxnhynSik
This commit is contained in:
kami
2026-07-30 23:39:56 +04:00
parent 691c3660d2
commit e0d0244fa9
17 changed files with 845 additions and 2003 deletions
+19 -11
View File
@@ -1,17 +1,24 @@
// Package router is maven's reactive path — the cascade that turns a free-form
// utterance into a deterministic Decision.
//
// Spec contract (from maven.md § reactive path — router):
// Spec contract (from DESIGN.md § Reactive path — routing):
//
// - routing is a DECISION, and every decision in maven stays deterministic.
// a classifier owns the route; the SLM stays in its phrasing lane. same
// boundary as "rules decide, llm phrases," extended to the reactive path.
// - a CASCADE, not classifier-vs-deterministic — layers:
// - the TARGET design is LLM-as-router: the resident model (Qwen3-1.7B)
// emits GBNF-constrained structured JSON for the route, and the same
// model phrases replies; the embedder is a RAG hint, not a routing gate.
// the classifier/embedder cascade below is the committed default today,
// but it is an interim stopgap (DESIGN.md § Superseded, "classifier-owns-
// the-route") and the known cause of weak RU query handling — not a
// design to extend.
// - a CASCADE, not one decider — layers:
// stage 0 — exact match (regex/grammar). wake-word + known command
// grammar. "maven, restart nginx" hits the allowlist directly,
// skips the classifier. lowest latency — the vosk command path.
// stage 1 — intent classifier. embed utterance, nearest-centroid over
// labeled intents. one forward pass, ~30ms cpu, similarity score.
// skips the classifier. lowest latency — the client-side wake-word/
// command-grammar path (cmd/mavwaked).
// stage 1 — route decision. the resident model (target), else the
// nearest-centroid classifier over embedded labeled intents (today's
// stopgap: one forward pass, ~30ms cpu, similarity score). any LLM
// error falls through to the classifier so a turn never breaks.
// stage 2 — slot extraction, per intent. classification gives *what kind*,
// not *the args*. reminders need a datetime, acts need fn+params.
// stage 3 — confidence gate. below threshold → clarify, don't guess.
@@ -28,14 +35,15 @@ package router
import "time"
// Intent — the six save-where labels from the spec's routing table. The
// Intent — the seven save-where labels from DESIGN.md's routing table. The
// discriminator is "does the loop evaluate a predicate against it?":
//
// - act: command now, not stored (function call into the allowlist)
// - reminder: has a fire-time → reminders table (sqlite). bypasses the gate
// - fact: structured state the loop reasons over → facts (sqlite)
// - note: recall/preference, no predicate touches it → chroma
// - query: answer, don't store → slm reads sqlite or chroma (RAG)
// - note: recall/preference, no predicate touches it → semantic store
// - query: answer, don't store → the resident model reads sqlite or the
// semantic store (RAG)
// - chat: conversational, no store side-effect — LLM replies from
// dialogue history + general knowledge
//