Repository navigation
Description
Original Linear description
Platform / the-brain. Three agents (agent-a, agent-b, agent-c) have never written a single reflection - their long-term memory layer is empty, which is why agent-c "keeps forgetting" across sessions. the maintainer flagged high ("let's get the reflections sorted!!!").
Root cause (verified, corrects the first hypothesis)
maintainer's first hypothesis was a size-cliff in reflect.sh. Verified-before-cutting: that bug is real but latent, not the cause. Actual cause is a bootstrap gap:
- agent-a/agent-b/agent-c have no
~/.the-brain/agents/<name>/MEMORY.mdand nomemory/live-state.json. observe.sh:130callsbuild-context.shun-backgrounded underset -e.build-context.sh:60hard-exits 1 when MEMORY.md is missing →set -ekillsobserve.shbefore the reflect trigger (observe.sh:158/166). Reflection never fires; the unprocessed count ratchets up forever.- Source:
bootstrap-new-agentSKILL.md Step 3 wrongly says MEMORY.md is "auto-created by hooks / don't pre-seed". It isn't - build-context requires it and creates nothing. The 5 older agents got it from the historical anchor migration; the 3 newest followed the skill and broke.
Evidence: agent-b's backlog (60k tok) is well under haiku's 200k so the size-cliff can't fail her; reflect.sh "enter" events = 0 for all three vs 234–308 for healthy agents; threshold-cross events = 0 for all three; running build-context.sh for each returns EXIT=1 - MEMORY.md not found.
Also explains the maintainer's Q2 (obs-on-disk 4,402 vs io-observations 2,908): observe.sh dies at :130 before the auto-index at :144, so the three agents' 645 obs were never indexed (plus the 11-day dry-run window).
Fix (layered)
- A - bootstrap MEMORY.md (+anchors) + live-state.json for the three (unblocks the chain).
- B - harden
reflect.sh: batch cap, decrement-not-reset, don't strand count on failure, parameterise the hardcoded "maintainer's deeper memory consciousness" prompt by $AGENT_NAME (latent size-cliff - needed so recovery doesn't faceplant on the 315 backlog). - C -
observe.sh:130→|| log warn; a context-render failure must never silently kill memory consolidation. - Source fix - rewrite bootstrap skill Step 3 to seed the files; belt-and-braces:
build-context.shself-creates a skeleton on first run. - Tests - vitest, incl. the regression that would've caught it ("agent with N obs and lastReflectionAt=null is a failure").
health-check.sh- currently loops only maintainer/agent-d/agent-g/agent-h/agent-f (blind to the three). Extend to all agents + death-spiral/bootstrap/index-drift signatures; FAIL DMs coordinator.- Recovery (held for the maintainer's go - only spend step) - capped reflect drain (full batched backfill, agreed) + obs reindex. Requires a separately approved bounded recovery budget and breaker.
- brain-memory-rebuild skill - wrap the recovery runbook as one command.
SPEC: ~/io-projects/the-brain/.notes/fix-reflect-death-spiral/REFLECT-DEATH-SPIRAL-SPEC.md
Branch: fix/reflect-death-spiral
Diagnosed by agent-d; routed via maintainer for the maintainer's cut green light.
Origin
Migrated from Linear: INK-418. The original wording is retained except the disclosed privacy and rendering edits below.
Current scope and qualifications
The description above is the original Linear account, including its historical findings and scope. It is not a fresh claim that every described defect still exists.
Current Linear state is Backlog. Prior source review recorded partial, with this remaining scope:
- Resolve recovery batching/failure retention, render isolation, self-bootstrap, generalized health/regression and rebuild workflow; separately establish prior authorized recovery without spending.
Publication transfers the task; it does not authorise live recovery, deployment, spending or configuration changes.
Transfer edits
- Historical principal names are aliased in prose; artificial shell-filename web links are rendered as code where present.
- Historical fleet identities are aliased; code identifiers and permitted source paths remain references.
- A specific private recovery budget reference is generalised; its separate approval gate remains.
- Public punctuation is normalised.
- Additional transfer edits: rendering cleanup: artificial filename HTTP link; fleet prose aliases; fleet prose alias.
Activity