ADR: Squad memory and state model (API boundary, history.md, archive policy, Scribe)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github, typescript
- Domain
- developer-experience, tooling
Research direction
Start with the proposed order and the listed validation tests; the issue names templates/after-agent-reference.md, packages/squad-sdk/src/client/adapters/coordinator.ts, templates/spawn-reference.md, and squad.agent.md as surfaces for D5. Read the charter and the existing tests first. Done means the five decisions are implemented in sequence, each validation passes, and bug-fix tests are shown failing against the pre-fix state.
Written by the indexing model from the issue text.
Description
Purpose
One decision record for Squad's memory and state model, replacing five overlapping issues (#1243, #1268, #1269, #1270, #2321) and absorbing the hot/cold requirement from closed #600. Prior consolidation notes on #1268 and #1243 already named #1270 as canonical; this issue makes that explicit and puts the open decisions in one place. Nothing here is committed work.
The decisions that need an owner
D1: API boundary (from #1270). Today squad_state_* (raw file ops) and memory.* (classified, audited, indexed) are parallel, not layered, over the same StorageProvider. Options: (a) layer squad_state_* under memory.* so governance runs by default, with an explicit opt-out; (b) keep both, document when to use which; (c) retire memory.* governance. Proposed: (a), because every downstream gap below follows from governance running only at first write.
D2: history.md authority (from #1243). Options: (a) direct authored state, size-capped; (b) derived from governed memory; (c) class-aware bounded context with a hot (always loaded, recent plus active-issue entries) and cold (archive, on demand) split. Proposed: (c), which also carries #600's measured problem (history files of 34-74KB, 82-96% stale). The GitHub Wiki layer from #600 is cut.
D3: Archive policy (from #1269). Archival today is time-only (decisions.md at 20KB/50KB, history at 15KB) and ignores class and loadGuidance, so a POLICY entry can age out like a throwaway note. Proposed: archival must read class and loadGuidance; entries with loadGuidance: ALWAYS are never archived by age alone.
D4: Scribe lifecycle (from #1268). Scribe runs inbox merge, archival, summarization and cross-agent propagation through squad_state_*, so classification and audit never re-run. Proposed: decided after D1; Scribe operations emit audit records (promote, delete, write) once the boundary is layered.
D5: One Scribe definition (from #2321). Since #2030 the charter says Scribe only merges accepted decisions, but templates/after-agent-reference.md, the host digest in packages/squad-sdk/src/client/adapters/coordinator.ts, the decision-hygiene watch capability, templates/spawn-reference.md, squad.agent.md and five docs pages still describe the older broad job, and the original issue also reports an install problem. Proposed: the charter is the single source; every other surface either links to it or is corrected. This is independent of D1-D4 and can ship first.
Proposed order
- D5 (pure consistency, no design risk).
- D1 (unblocks the rest).
- D3 and D2 (can proceed in parallel once D1 lands).
- D4 last.
Validation (every phase testable)
| Decision | Test that proves it |
|---|---|
| D5 | A test that scans shipped templates, host digest and docs for the retired Scribe duties and fails on any match; it must fail on the pre-fix tree. |
| D1 | Contract test: a squad_state_write to a governed path produces a classification and an audit row; the opt-out path produces neither and is explicit. |
| D3 | Fixture with a 60-day-old POLICY entry and a 60-day-old LOCAL note over the size threshold: only the LOCAL note is archived. Fails on current behavior. |
| D2 | Spawn-context test: hot layer only is loaded by default; token count at spawn compared against the baseline in #600 for the same agents. |
| D4 | Each Scribe lifecycle step yields an audit record with provenance. |
Each bug-fix style test must be shown red against the pre-fix state before merge.
Out of scope
Backend-specific failures (orphan or two-layer backends, #2229, #2231, #2320, #2378) are tracked separately and are bug work, not part of this decision.
Closed in favor of this issue
#1243, #1268, #1269, #1270, #2321, and earlier #600.
- Dominant language
- TypeScript
- Stars
- 3.4k
- Forks
- 516
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 116
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/squad
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
ilan-pinto/roaring-lions#1552 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug: [React Native/Android] KeepAliveService never starts when CAMERA is not granted (Android 14+)Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudflare/realtimekit-ui#208 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
usebruno/bruno-vscode#235 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day