Auto-capture decisions & mistakes → Brain
Epic 1.0 — Memory- 1thinkingPlanner reads the constitution + mistake ledger, then decides on an LLM-free heuristic detector.
PLANNER (claude.ai browser) reads CONSTITUTION + MISTAKES_LEDGER + Brain memory first. Decision recorded to Brain: capture decisions/mistakes with a deterministic regex/heuristic detector — no per-session API cost, confidence always "candidate" so it never over-claims.
- 3buildExecutor runs four sonnet sub-agents: recon → detector → exporter → adversarial verify.reconsonnet · explorebuild-asonnet · detectorbuild-bsonnet · exporterverifysonnet · adversarial
recon reads the existing violation-detector + api-client before any new module. build-a writes claude-fuse/collector decision-mistake-detector.js (regex/heuristic catalogue, +357). build-b writes brain-exporter.js (cursor-tracked, error-resilient, +327) + the brain-api POST /api/memories route (Bearer→user_id scoped, additive INSERT, body user_id ignored, +42). 9 files changed, +1744 lines.
- 4verifyAdversarial + edge-case passes; one blocker found and fixed before done.verifysonnet · edge-case-hunter
BLOCKER: a summary could carry an unmasked secret before POST — fixed by masking first4****last4 at the collector boundary and never POSTing raw evidence (evidence stays local, SEC-05). NOTE: collector/package.json left uncommitted (unrelated prior WIP) — deliberately scoped out of this story.
- 5commitOwner reviews and commits locally. Not pushed — consent-gated.
One commit for the story, co-authored, local only. No deploy, no push — pushing requires a fresh, explicit owner yes (consent-gated).
- Secrets masked first4****last4 before any summary leaves the collector; raw evidence never POSTed.
- Additive-only: a write with no key never upserts; never deletes or overwrites existing memories.
- Per-user isolation: Bearer → user_id; a POST body user_id is ignored.
- Brain unreachable → log + continue; the hook never crashes.
- BRAIN_AUTO_CAPTURE=false opt-out honoured; the collector never reads data/ (SEC-05).