Every failure this project hit is compiled into a check that runs inside the coding agent’s harness. Not a document it might read — a denial it cannot skip.
const tomorrow = Date.now() + 24 * 60 * 60 * 1000Deriving today's date from a UTC timestamp rolls the day over early for anyone west of UTC.
distilled-015 · recorded 5× · runs on every edit
const day = formatLocalDate(new Date())✓ the flagged line is gone the next time that file is written
75% of what it sees is refused. A near-zero refusal rate here would be the defect, not the goal.
Counts from the ledger — reported, never gated
Denies a change until a recall has covered it — and asks after five files read with no recall behind them, because review and diagnosis produce no write to gate on at all.
Runs every checkable lesson against every edit, unattended. A lesson with a grep-able form promotes here — not to a command someone has to remember to run.
Arms on a debug-shaped task, then denies after three tool calls with no theory recorded. The stopping rule, as a mechanism rather than as advice.
Denies a subagent launch whose prompt carries no instruction to consult. Gates bind the context they run in, and delegation leaves that context — so the instruction has to travel with the work.
Denies a write that asserts what a reference system does, with no citation and no recorded premise behind it.
Catches the inverse of a guess: a contract declined as unknowable that a couple of greps would have answered.
Asks once, at the end of a substantial session, whether it left a lesson behind.
Asks for a verdict on every lesson a session was handed and never reported on. Unreported lessons never rise or sink.
Denies a commit no turn requested, or one carrying an AI attribution trailer. Committing is a decision, not a close-out step.
Holds four destructive git commands until the session has actually run a status.
Sends a long cross-repo check to the background instead of letting it block the session. The work still runs.
The operator’s stop button: denies the next tool call of a session someone halted, capped and expiring.
Every gate fails open on every error path, and stands down after one to four denials until the next task begins. An unreachable knowledge base must never become an unwritable repo — a gate that can lock you out gets deleted, and then there is no gate.
Three steps, all inside the session
It writes down what happened — cause, fix, lesson. Most solved problems leave nothing behind; a surprise leaves an entry.
Written from the mechanism rather than the incident, so it transfers to a codebase that shares nothing with the original. Most candidates are refused.
A lesson naming a form you can grep for runs on every edit. The rest are ranked and recalled — 274 documents, about a thousand tokens an answer.
Zero runtime dependencies. It links the skills, installs the gates, builds the index and registers the tool server. Idempotent — run it again any time.
$ git clone https://github.com/lumen202/unified-brain.git && cd unified-brain && ./install.shThe console runs the real ranking in your browser — the same modules the tool server imports, so what you see cannot drift from what an agent receives. It is the half that remembers; the gates above are the half that intervenes.