From da39033e815dc30daef39cd910f989069e781979 Mon Sep 17 00:00:00 2001 From: asepharyana Date: Thu, 16 Jul 2026 03:33:49 +0700 Subject: [PATCH] docs(specs): kecualikan tool read dari squash Ditemukan saat menulis plan: kompresi JSON pada hasil read akan merusak byte-exactness yang dibutuhkan untuk edit selanjutnya jika file yang dibaca kebetulan berformat JSON (package.json, tsconfig.json, dst). Co-Authored-By: Claude Sonnet 5 --- .../2026-07-16-context-compaction-overhaul-design.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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