One binary. Three seams of value.
Detritus is a single, embeddable Go server that speaks the Model Context Protocol. It carries a curated knowledge base of engineering doctrine, a set of zero-setup tools for reading a codebase, and a layer of slash commands that move real work through one pipeline — plan → build → review → deliver — either inside your session or handed off to a separate multi-agent sidecar.
The genuinely unusual bet: the docs are the product, and the Go is the delivery mechanism. Everything a human touches installs itself into whatever coding tool you already use — and no flow ever merges on its own. The human merge stays the gate.
// the kb_* seam
A knowledge base tuned for a machine reader
The corpus is markdown, split one chunk per ## section, enriched at build time with TF-IDF keyword triggers, and frozen into a deterministic data.gob — sorted and tie-broken so the same docs compile to the same bytes on any machine. At runtime it's a title-weighted bleve index reranked with MMR.
kb:// resource links instead of dumping whole files.## section — the token-economy path an agent uses after it knows what it wants.kb_get before spending context.Every response is shaped for the consumer that reads it: an AI, not a person. Search punts identifier-shaped queries straight to code_graph rather than answering them badly. That restraint is the design.
// the code_* seam · zero-setup
Live code intelligence, no index to build
No pack, no config, no stored index — the tools read the repo live and auto-discover the project root (go.mod > .git > language marker). .gitignore honoured, binaries sniffed, and a per-file, mtime-keyed, atomically-written parse cache means the first pass pays and the rest is fast.
go/types + go/packages: who-calls, reachable-from, impacted-by (blast radius) and the tests that break — or interface implementers.go/ast signatures for Go; a fast regex pass for JS/TS, Python, Rust, Java, C# and C/C++.code_graph is the best-engineered code in the tree. It canonicalizes the package/test-variant duplicates that Tests:true produces, gates its fallback on production packages only (a broken _test.go won't degrade your impact analysis mid-edit), keeps test funcs from crowding real dependents out of the cap, and never truncates silently — it even looks one hop past the depth bound to tell you a caller is out there. Each of those is a subtle bug a naive version gets wrong, and each is pinned by a named regression test.
// learned long-term memory
A lesson is a pull request
The learned-memory subsystem was deleted and redesigned into nothing — and that's the clever part. There is no local store, no agent-write API, no LRU, no dedup pass, no recall-miss counter. A lesson is just a markdown doc under docs/lessons/, shipped by a reviewed PR, distributed by detritus --update, and retrieved by the same kb_search as everything else.
"The trust boundary is the review, not a runtime firewall." A shared agent-written store is a shared attack surface; here the surface is a code review. An entire category of runtime complexity was replaced by a workflow that already existed — the exact "if removing it doesn't break anything, it shouldn't exist" move the project's own doctrine preaches.
// candyland · out-of-process delivery
When one session isn't enough: candyland
For work too big for a single agent, detritus hands off to candyland — a long-running REST sidecar it launches and correctly detaches (new session on Unix, new process group on Windows) so it outlives the session that started it. A tech-lead partitions the work, coders build concurrently in git worktrees, a reviewer loops fix→re-review until clean, then it delivers. (That engine lives in its own repo — what ships here is the launcher and the classifier.)
Before launching, detritus reads live gh state and decides whether your input means open a PR, address feedback, or review — and which PR. Its sharpest idea is telling a hand-off ("act on #97") from a citation (a plan that merely mentions #97 in prose), so a URL buried in a spec can't hijack delivery. Unaddressed change-requests beat review-intent; a later approval supersedes an older change-request; gh being down degrades honestly and says so. An ~18-row truth table locks all of it.
// docs/flows · one source, many surfaces
Doctrine that installs itself
A doc is a command if and only if it lives under docs/flows/. From that single rule, one binary generates skills, prompt files, sub-agents, router instructions, the README table and marketplace shims — then registers itself as an MCP server across Claude Code, VS Code/Copilot, Cursor, Windsurf, Codex and Verdent. The generated shim is a stable kb_get indirection, so editing a doc ships new behaviour with nothing to regenerate client-side. Drift tests fail the build if the surface and the docs ever disagree.
- truthseeker — always active. Prove before acting; reject fragility; make the invisible visible; push back on the user when the evidence demands it.
- review-rigor — forbidden-action tables with IDs, mandatory checks R1–R11, closed-enum verdicts (
approve|changes), and hedge-words banned outright. No "approve with reservations." - the universal pipeline — every flow runs plan → build → review-with-rework → deliver, and no flow may skip a stage.
/babysitmerges only when an approval's commit matches HEAD — a push invalidates it. - todoguard — a PreToolUse hook that trusts Claude's
agent_id, deliberately distrusts the spoofableagent_type, and fails open. A small, honest threat model.