diff --git a/docs/superpowers/specs/2026-07-16-context-compaction-overhaul-design.md b/docs/superpowers/specs/2026-07-16-context-compaction-overhaul-design.md index 3a859cb..61d70ec 100644 --- a/docs/superpowers/specs/2026-07-16-context-compaction-overhaul-design.md +++ b/docs/superpowers/specs/2026-07-16-context-compaction-overhaul-design.md @@ -135,9 +135,13 @@ Runs every turn, unconditionally, before token counting — not gated on `should pub fn apply(tool_name: &str, output: &str) -> String ``` -Size floor: outputs under 1500 bytes pass through unchanged (compression only pays off on -large output, and touching small results risks losing detail with no token benefit). -Above the floor, dispatch by content shape: +`read` is exempted entirely, always passed through unchanged regardless of size: its output +must stay byte-exact because the agent relies on it for exact-match edits afterward, and a +squashed view of a JSON config file (or any file whose content happens to parse as JSON) +would otherwise be silently altered. Size floor for every other tool: outputs under 1500 +bytes pass through unchanged (compression only pays off on large output, and touching small +results risks losing detail with no token benefit). Above the floor, dispatch by content +shape: - `squash_json(&str) -> String` — hand-rolled JSON tokenizer; structural tokens (keys, brackets, colons, commas, booleans, null) always kept; string values kept if ≤20 chars or