ADR 0009: Add a dreaming pass - the kit applying its own sources to itself

decision

ADR 0009: Add a dreaming pass - the kit applying its own sources to itself

About this note
Field Value
Status accepted
Date 260731
Deciders chamin
On this pageContextDecisionAlternatives consideredConsequences

Context#

Ingesting the memory pair (S6 OpenAI, S7 Anthropic) produced a diagnosis that turned out to describe this repo, not just the products the sources were selling.

Both sources independently found that memory written during work is locally optimal and globally suboptimal: each individual write is defensible, the aggregate duplicates, fragments and drifts, and nothing ever reconciles it because the writer was busy doing something else (../topics/memory.md, S7 n10; claim 59).

That is exactly how brain/ is written. Ingest updates topic notes while finishing a source - it merges into the note in front of it and never asks whether the claim it just added contradicts one promoted three sources ago.

Two things already exist and neither covers it:

The gap is not hypothetical - it has already produced a defect. memory.md shipped carrying "this topic has no measurements at all", which became false when S6's eval charts were recovered hours later. It survived one full ingest and needed a dedicated fix: commit (51dcb23). Nothing in the kit was looking for it, because nothing in the kit reads across the brain asking whether what it says is still true.

A third source sharpened the framing. Karpathy's LLM Wiki gist describes this same pattern (raw sources / maintained wiki / schema) and names three operations: ingest, query, lint. The kit has all three. What it does not have is what S6 and S7 both argue is the load-bearing one - a maintenance pass that runs on its own clock rather than inside the ingest.

⚠️ The last sentence of that paragraph is wrong, and is corrected by ADR-0010. The gist was cited here from a review, not an ingest. Once ingested as S8 (2026-07-31), §Lint turns out to be the out-of-band maintenance pass - four of its six defect classes are verbatim members of the eight below. The error was matching the word "lint" to validate.py. The decision below stands and is better supported than it appears here; only this reading of the third source changes. Left in place rather than edited: an ADR records what was decided and why at the time.

Decision#

Add a dream stage: a global reconciliation pass over brain/ itself, triggered on request, writing a permanent note to brain/dreams/<NNNN>-<YYMMDD>.md.

Contract in AGENTS.md § "Dreaming on request"; Claude Code wrapper in .claude/commands/dream.md; note structure in brain/dreams/README.md. Persona: architect + fact-checker.

It works eight classes: contradiction, duplication, stale confidence, stale status, orphans, closed open questions, superseded framing, drift from source.

The design follows what the sources actually established, point for point:

S6 / S7 finding How the stage implements it
Curation must be decoupled from the work loop (claim 59 - objective conflict) Never runs as part of an ingest. Separate invocation, own objective.
Out of band means it can afford to be expensive (S7 n12) Reads the whole brain, no sampling. That is the one thing an ingest cannot do.
Output is a reviewable diff agents "can choose to adopt" (S7 n11, n21) Applies clear defects; proposes judgement calls and asks. git revert is the undo.
The pass must be recorded, not ephemeral One permanent note per pass, numbered.

The decoupling is the whole point and is worth stating as a rule rather than a preference. An agent finishing a source holds two objectives - land this source, keep the brain coherent - and it will trade the second against the first silently, because only the first has a visible finish line. This is the same argument that separates the generator from the evaluator (claim 33), and the same one S7 gives for putting dreaming outside the agent loop.

Alternatives considered#

Consequences#

Not yet run. This ADR records the decision to add the stage. The first pass will be brain/dreams/0001-*.md, and it should be expected to find real drift - seven sources have been compounded with no reconciliation, and one defect is already known to have slipped through.