# Memory System Memory in BeadBoard is operational policy, not journal notes. ## Core Rule - Reusable rule -> canonical memory bead (`type=decision`) - One-off context -> task notes on active bead Canonical memory is active when it is closed and labeled canonical. ## Domain Anchors (Use These IDs) - Architecture: `beadboard-76p` - Workflow Protocol: `beadboard-nq9` - Agent Operations: `beadboard-5r1` - UI/UX: `beadboard-fld` - Reliability and Errors: `beadboard-8st` ## Canonical Memory Contract Required labels: - `memory` - `mem-canonical` - `mem-hard` or `mem-soft` - `memory-` Required description sections: - `Scope:` - `Out of Scope:` - `Rule:` - `Rationale:` - `Failure Mode:` Required acceptance format: - Given/When/Then invariant - Verification commands ## WHEN to Query Memory Query memory at: 1. Session start 2. Before claiming new work 3. When entering a new domain (arch/workflow/agent/ui/reliability) ## Injection Playbook (Steps 1-7) Step 1: Select primary domain ```bash # choose one: # memory-arch | memory-workflow | memory-ux | memory-agent | memory-reliability ``` Step 2: Query canonical memory for that domain ```bash bd query "label=memory AND label=mem-canonical AND label= AND status=closed" --sort updated --reverse ``` Step 2b: Validate provenance before trusting it ```bash bd show bd dep list ``` Step 3: Query hard constraints subset ```bash bd query "label=memory AND label=mem-canonical AND label=mem-hard AND label= AND status=closed" --sort updated --reverse ``` Step 4: Attach memory to active work ```bash bd dep relate ``` Step 5: Optional hard-contract bead (for non-negotiable rules) ```bash bd create --title "[MEMORY-CONTRACT] " --type task --label "memory-contract,mem-hard," --description "Contract for " bd dep relate bd dep add ``` Step 6: Record acknowledgement on active task ```bash bd update --notes "Memory injection: related ; hard contracts ." ``` Step 7: Preserve provenance evidence in notes ```bash bd update --append-notes "Memory provenance verified via bd show/dep list for ." ``` ## Ratification Rule "Ratified by closing" means: - A decision bead is only an active canonical memory after it is closed. - Open decision beads are drafts/proposals, not mandatory policy. ## Noise Budget and Promotion Policy Noise budget: - Per active task: 3-7 related memory nodes - Per active task: 0-2 blocker contracts - Per canonical memory: 1 primary anchor domain - Per canonical memory: 2-5 source-bead provenance links Promotion policy: 1. Incident repeats 2+ times -> candidate `mem-soft` 2. Workaround survives release window -> candidate `mem-hard` or stable `mem-soft` 3. Obsolete memory -> supersede, do not rewrite history Supersession command: ```bash bd supersede --with ``` ## Anti-Patterns - Writing policy in markdown without canonical bead - Using blocker edges to index memory (use `bd dep relate`) - Creating duplicate canonical memory for same rule - Skipping provenance check before applying a rule