Skip to content

docs(memory): correct history compaction size and mechanism - #2324

Merged
tamirdresher merged 3 commits into
github:devfrom
joslat:joslat/2323-docs-history-15kb
Oct 28, 2026
Merged

tamirdresher merged 3 commits into
github:devfrom
joslat:joslat/2323-docs-history-15kb

Conversation

@joslat

@joslat joslat commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

What

Docs only. This fixes how four pages describe history compaction: the size (15 KB, not ~12 KB) and the mechanism (squad nap moves old sections word for word and doesn't summarize; nothing runs on its own).

Why

Closes #2323

The docs said a history.md over "~12KB" gets "archived into a summary section". The code uses HISTORY_THRESHOLD = 15 * 1024 (nap.ts:49), and squad nap, run by hand, keeps the newest ## sections and moves the older ones verbatim to history-archive.md. context-hygiene.md also called a nap "the same as running /compact" and said "take a nap" makes each agent summarize.

How

  • concepts/memory-and-knowledge.md:
    • "Progressive Summarization" becomes "Keeping history small (15 KB)". It covers what squad nap does and that asking the coordinator for a summary is a separate, AI-driven job.
    • The table now says history compacts only above 15 KB when you run squad nap, and decisions above 20 KB when you run it.
    • Logs older than 7 days are deleted, not archived.
  • features/memory.md: the same correction for the history section.
  • features/context-hygiene.md:
    • What a nap actually does: history trim, log pruning, inbox merge, and decision archival, including the refusal when the archive file is git-ignored.
    • It doesn't summarize, and "Team, take a nap" has no built-in mapping to squad nap.
    • /nap is the command in Squad's interactive shell. /compact belongs to Copilot CLI and only shortens the chat.
    • --deep keeps 3 sections instead of 5.
  • reference/cli.md: the --deep row, and the .squad/ tree now shows history-archive.md inside each agent's folder.

I kept the wording true whether or not #2322 lands: the pages describe Scribe as its charter does (it doesn't touch histories) and don't rely on the old after-agent prompt.

Out of scope, and worth separate issues later: squad nap's history trim is a no-op on the usual ## Learnings + ### layout, and unlike decision archival it has no ignored-destination check.


⚠️ Quick Check

  • If SDK/CLI source files changed: N/A, docs only (no changeset needed)

PR Readiness Checklist

Branch & Commit

  • Branch created from dev (not main)
  • Branch is up to date with dev (9d7dff8)
  • Verified diff contains only intended changes (4 docs pages)
  • PR is not in draft mode
  • Commit history is clean

Build & Test

Docs

  • Docs pages updated (4)

Breaking Changes

None.

Waivers

None.

The docs said history.md is summarized at ~12 KB into a summary section.
The code uses 15 KB, and squad nap (run by hand) moves older ## sections
word for word to history-archive.md without summarizing. Fix the threshold,
describe what squad nap actually does (history trim, log pruning, inbox
merge, decision archival), separate it from asking an agent to summarize,
and correct the --deep description, the /compact comparison and the cli.md
tree.

Closes github#2323
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit b3318b9

PR Scope: 🔧 Infrastructure

⚠️ 3 item(s) to address before review

Status Check Details
❌ Single commit 3 commits — consider squashing before review
✅ Not in draft Ready for review
✅ Branch up to date Up to date with dev
❌ Copilot review No Copilot review yet — it may still be processing
✅ Changeset present No source files changed — changeset not required
✅ Scope clean No .squad/ or docs/proposals/ files
✅ No merge conflicts No merge conflicts
✅ Copilot threads resolved No Copilot review threads
❌ CI passing 11 check(s) still running

Files Changed (4 files, +43 −27)

File +/−
docs/src/content/docs/concepts/memory-and-knowledge.md +12 −7
docs/src/content/docs/features/context-hygiene.md +17 −11
docs/src/content/docs/features/memory.md +7 −2
docs/src/content/docs/reference/cli.md +7 −7

Total: +43 −27


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

@github-actions

Copy link
Copy Markdown
Contributor

🟢 Impact Analysis — PR #2324

Risk tier: 🟢 LOW

📊 Summary

Metric Count
Files changed 4
Files added 0
Files modified 4
Files deleted 0
Modules touched 1

🎯 Risk Factors

  • 4 files changed (≤5 → LOW)
  • 1 module(s) touched (≤1 → LOW)

📦 Modules Affected

docs (4 files)
  • docs/src/content/docs/concepts/memory-and-knowledge.md
  • docs/src/content/docs/features/context-hygiene.md
  • docs/src/content/docs/features/memory.md
  • docs/src/content/docs/reference/cli.md

This report is generated automatically for every PR. See #733 for details.

@tamirdresher

Copy link
Copy Markdown
Collaborator

Thanks Jose! Confirmed against packages/squad-cli/src/cli/core/nap.ts:49 (HISTORY_THRESHOLD = 15 * 1024) and compressHistory (
ap.ts:160) that squad nap moves older ## sections verbatim to history-archive.md at 15 KB rather than summarizing at 12 KB. Also appreciate the note on ### subheadings under a single ## Learnings section. The merge-tree against dev is clean and I approved the CI runs. We are in a release freeze for 2.0.0-preview.2 and will merge this right after the release ships.

@tamirdresher
tamirdresher merged commit 423c43e into github:dev Oct 28, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs say history is summarized at ~12 KB; the code uses 15 KB and squad nap archives without summarizing

2 participants