squeez 0.3.2 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +236 -0
  2. package/README.md +21 -21
  3. package/package.json +1 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,236 @@
1
+ # Changelog
2
+
3
+ All notable changes to squeez are documented here.
4
+
5
+ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
+ This project uses [Semantic Versioning](https://semver.org/).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.4.0] - 2026-04-16
11
+
12
+ ### Added
13
+ - feat(opus47): dual-model cost table in benchmark — Sonnet 4.6 ($3/MTok) + Opus 4.7 ($5/MTok)
14
+ - feat(opus47): protocol now educates LLM on xhigh thinking-block overhead (~2× budget burn)
15
+
16
+ ### Changed
17
+ - feat(opus47): compact_threshold_tokens 120k → 90k (earlier compaction trigger for new tokenizer)
18
+ - feat(opus47): agent_spawn_cost 270k → 350k (xhigh subagents burn more tokens)
19
+ - feat(opus47): burn_rate_warn_calls 20 → 30 (wider pre-exhaustion warning window)
20
+ - feat(opus47): state_warn_calls 5 → 10 (more runway to save session state)
21
+ - feat(opus47): ultra_trigger_pct 0.72 → 0.65 (go Ultra compression earlier)
22
+ - feat(opus47): MCP context_pressure thresholds — use_state_first ≥90%→≥75%, compact_soon ≥70%→≥55%
23
+ - fix: DEFAULT_AGENT_SPAWN_COST constant synced to config default (200k → 270k)
24
+
25
+ ## [0.3.2] - 2026-04-16
26
+
27
+ ### Added
28
+ - feat(setup): auto-detect lang from CLAUDE.md/locale + stderr update notification (#29)
29
+ - v0.3.0 — token economy, pt-BR caveman, aggressive defaults, full hook install
30
+ - structured session memory, cross-session search, error snippets, configurable tunables
31
+ - feat(setup): create config.ini on first install
32
+ - feat(i18n): locale-aware compress-md with pt-BR support (#25)
33
+ - fuzzy dedup, adaptive intensity, benign summarize, MCP server, temporal memory, protocol payload
34
+ - Windows setup via cargo/npm + squeez update fix
35
+ - feat(benchmark): add squeez benchmark command with 19-scenario test suite
36
+ - feat(ci): re-add promote-develop workflow with correct registration
37
+ - feat(init): inject persona into ~/.claude/CLAUDE.md on every session start
38
+ - feat(npm+crates): add npm package and publish jobs to release workflow
39
+ - feat(statusline): add statusline.sh to repo; install via install.sh; show all-time stats
40
+ - compress-md, caveman persona, squeez update, track-result hook
41
+ - feat(context): adaptive intensity always picks Ultra
42
+ - feat(context): aggressive token-engine — adaptive intensity, redundancy cache, summarize fallback
43
+ - add Windows support to install.sh and release.yml
44
+ - add home_dir() helper with USERPROFILE fallback for Windows
45
+ - cross-platform wrap — shell_command() helper, cfg(unix) signal gates, libc unix-only
46
+ - add GitHub Copilot CLI support
47
+ - add OpenCode plugin for automatic Bash compression
48
+ - add universal installer support for macOS and Linux
49
+ - expand benchmarks, edge-case tests, and README polish
50
+ - add SessionStart + PostToolUse hooks, update install.sh and README
51
+ - wrap.rs — artifact capture (files/errors/git/tests) + compact warning header
52
+ - squeez init — session start, prior memory banner, session finalization (TDD)
53
+ - squeez track — token accumulation + session event log (TDD)
54
+ - memory.rs — Summary, read_last_n, write_summary, prune_old (TDD)
55
+ - session.rs — CurrentSession, append_event, date math (TDD)
56
+ - json_util helpers + compact_threshold_tokens, memory_retention_days config
57
+ - benchmark system — all fixtures passing
58
+ - build.sh compiles + installs squeez, registers hook
59
+ - PreToolUse hook script
60
+ - fs and runtime handlers — all handler tests passing
61
+ - cloud, database, network handlers (TDD)
62
+ - typescript and build handlers (TDD)
63
+ - package_mgr and test_runner handlers (TDD)
64
+ - git and docker handlers (TDD)
65
+ - wrap subcommand — sh -c, 120s timeout, signal forwarding, bypass check
66
+ - Handler trait with cmd+config, generic handler, command router, filter_stdin
67
+ - truncation strategy (TDD) — all strategy tests passing
68
+ - grouping strategy (TDD)
69
+ - dedup strategy (TDD)
70
+ - smart_filter strategy with node_modules frame removal (TDD)
71
+ - implement config.ini parser (TDD)
72
+
73
+ ### Changed
74
+ - chore: bump version to 0.3.2
75
+ - docs: add shields.io badge for changelog link
76
+ - chore: bump version to 0.3.1
77
+ - chore: bump version to 0.2.3
78
+ - docs: update README with 11 MCP tools, structured memory, and advanced tunables
79
+ - chore: bump version to 0.2.2
80
+ - docs: rewrite README with full install instructions (curl/npm/cargo) and all commands
81
+ - chore: refresh bench/report.md from latest run [skip release]
82
+ - chore(ci): remove promote-develop workflow (re-adding to fix broken registration)
83
+ - chore: bump version to 0.2.1 + auto-release on merge to main [skip release]
84
+ - chore: bump version to 0.2.0; add Cargo.toml metadata
85
+ - ci: PR template, linked-issue enforcement, no-claude-trailer check
86
+ - docs: update README with PR1+PR2 features, fresh benchmarks, changelog
87
+ - ci: auto-delete branches after PR merge
88
+ - docs: update Windows installation instructions and prerequisites in README
89
+ - docs: add Windows support and Rust install instructions to README
90
+ - refactor: use session::home_dir() in config and init (Windows compat)
91
+ - ci: trigger promote workflow (test)
92
+ - ci(workflow): avoid failing promote job when PR creation is not permitted; add PR_CREATION_TOKEN guidance
93
+ - docs(readme): add changelog, contribution workflow, and benchmark notes
94
+ - ci(workflow): create/update PR from develop to main on push
95
+ - chore: add .worktrees/ to gitignore
96
+ - chore: add docs/ to gitignore (local design specs)
97
+ - docs: update README for GitHub Copilot CLI support
98
+ - security: fix remaining LOW findings in wrap.rs
99
+ - security: fix 2 follow-up findings from second audit
100
+ - security: fix all 8 findings from security audit
101
+ - ci: build and install binary before running benchmarks
102
+ - chore: add GitHub sponsor button
103
+ - chore: ignore .omc/ directory, remove from tracking
104
+ - chore: update benchmark report (7/7 passing)
105
+ - docs: update README — real benchmarks, Phase 2 config, how it works
106
+ - style: cargo fmt on session.rs and test_session.rs
107
+ - chore: open source files — README, LICENSE, CI/release workflows, install.sh
108
+ - chore: scaffold squeez Rust project
109
+
110
+ ### Fixed
111
+ - fix(ci): run update-docs even if publish jobs fail (already published)
112
+ - fix(ci): continue-on-error for publish jobs so update-docs always runs
113
+ - fix(ci): add pull-requests write permission to update-docs job
114
+ - fix(update): cargo-managed self-update + Windows deferred install + session update check (#27)
115
+ - fix(ci): update-docs creates PR instead of pushing directly to protected main
116
+ - fix(npm): copy README.md into npm package before publish; add readme field
117
+ - fix(ci): add toolchain: stable to all dtolnay/rust-toolchain steps
118
+ - fix(ci): handle no previous tags in generate-changelog.sh (pipefail + grep -v)
119
+ - fix(ci): dispatch release.yml from auto-release to bypass GITHUB_TOKEN chain limit [skip release]
120
+ - fix(ci): fix flaky test tmp dir collision + simplify auto-release
121
+ - fix(bench): exclude synthetic fixtures from filter-mode bench/run.sh
122
+ - fix(ci): remove secrets in step if-conditions — check token inside script instead
123
+ - fix(ci): rename promote-develop → promote-to-main to fix broken workflow registration
124
+ - fix(ci): bump github-script to v7 in promote-develop to force workflow re-registration
125
+ - fix(compress_md): use byte slice comparison to avoid UTF-8 char boundary panic
126
+ - fix(statusline): remove Ctx% — show only squeez compression metrics
127
+ - fix(statusline): green ✓, proper capitalization, real-time context %, all metrics
128
+ - resolve gap analysis — new handlers, wider redundancy window, token budget
129
+ - install.sh — clarify PostToolUse no-matcher intent, guard version echo
130
+ - wrap.rs — safe git hex check, O(n) dedup, full cmd in event log
131
+ - use ends_with for files_committed check in init finalize
132
+ - json_util — guard extract_u64 empty digit, add json_util test coverage
133
+ - add pre-flight binary check to bench/run.sh
134
+ - atomic settings.json write + uninstall safety guards
135
+ - harden pretooluse hook (shlex.quote, error handling, single path source)
136
+ - wrap — process_group(0) for correct signal forwarding, tighten is_streaming
137
+
138
+ ### Fixed
139
+ - `squeez update` on Windows now detects cargo-managed installs and delegates to `cargo install squeez` automatically, avoiding exe-lock issues
140
+ - `install_target_path()` uses `current_exe()` instead of hardcoded `~/.claude/squeez/bin`, so the correct binary is always updated regardless of install method
141
+ - Windows self-update fallback spawns a detached `cmd.exe` to move the staged binary after process exit, instead of requiring manual `move /Y`
142
+ - `install_atomic` now returns `Ok(bool)` distinguishing immediate vs deferred installs; success message no longer appears when install was only staged
143
+
144
+ ### Added
145
+ - `session-start.sh`: rate-limited daily update check — prints `[squeez] Update available` to stderr (visible in terminal) when a new version is detected
146
+ - `squeez setup`: auto-detects user language from `~/.claude/CLAUDE.md` and system locale (`LANG`/`LC_ALL`) and writes correct `lang =` into `config.ini` on first install
147
+
148
+ ## [0.3.0] - 2026-04-14
149
+
150
+ ### Added
151
+ - Token economy layer: sub-agent cost tracking via PostToolUse hook (~200K tokens/spawn estimate)
152
+ - Context pressure prediction: sliding-window burn rate with `[budget: ~N calls left]` header
153
+ - Session efficiency scoring: compression ratio, tool choice, context reuse, budget conservation (basis points)
154
+ - Tool result size budgets: per-tool output caps via PreToolUse hook (`read_max_lines`, `grep_max_results`)
155
+ - Auto-calibration on install: `squeez calibrate` runs benchmarks and generates optimized `config.ini`
156
+ - 2 new MCP tools: `squeez_agent_costs`, `squeez_session_efficiency` (11 → 13 total)
157
+ - 2 new CLI commands: `squeez calibrate`, `squeez budget-params <tool>`
158
+ - 5 new config keys: `agent_warn_threshold_pct`, `burn_rate_warn_calls`, `agent_spawn_cost`, `read_max_lines`, `grep_max_results`
159
+ - 29 new economy module unit tests
160
+ - `src/economy/` module: `agent_tracker.rs`, `burn_rate.rs`, `efficiency.rs`, `calibrate.rs`, `budget.rs`
161
+
162
+ ### Changed
163
+ - PreToolUse hook now matches all tools (was Bash-only) for budget enforcement
164
+ - `build.sh` runs `squeez calibrate` automatically after install
165
+ - Wrap header now shows burn rate and agent cost warnings
166
+ - Session finalization computes and stores efficiency scores in `memory/summaries.jsonl`
167
+ - `SessionContext` extended with agent tracking and burn window fields
168
+
169
+ ## [0.2.3] - 2026-04-10
170
+
171
+ ### Added
172
+ - Structured session memory: `investigated`, `learned`, `completed`, `next_steps` fields in summaries
173
+ - Cross-session search: `squeez_search_history`, `squeez_file_history` MCP tools
174
+ - Error snippets: first 128 chars stored alongside FNV fingerprints
175
+ - Configurable tunables: `max_call_log`, `recent_window`, `similarity_threshold`, `ultra_trigger_pct`
176
+ - `squeez_seen_error_details`, `squeez_session_detail`, `squeez_session_stats` MCP tools (6 → 11 total)
177
+ - Locale-aware `compress-md` with pt-BR support (`lang = pt` in config or `--lang pt`)
178
+ - `config.ini` auto-created on first install via `squeez setup`
179
+
180
+ ### Changed
181
+ - MCP tool count: 6 → 11
182
+ - README rewritten with full install instructions and all commands
183
+
184
+ ### Fixed
185
+ - Windows setup via cargo/npm + `squeez update` fix
186
+ - CI: dispatch `release.yml` from `auto-release` to bypass GITHUB_TOKEN chain limit
187
+
188
+ ## [0.2.2] - 2026-03-28
189
+
190
+ ### Added
191
+ - `squeez benchmark` command: 19-scenario reproducible benchmark suite with quality scoring
192
+ - JSON output mode (`--json`) and scenario filtering (`--scenario`)
193
+
194
+ ### Changed
195
+ - README rewritten with full install instructions (curl/npm/cargo)
196
+
197
+ ### Fixed
198
+ - Flaky test tmp dir collision in CI
199
+ - `bench/run.sh` excludes synthetic fixtures (filter-mode only)
200
+ - CI workflow registration fixes for `promote-develop`
201
+
202
+ ## [0.2.1] - 2026-03-20
203
+
204
+ ### Added
205
+ - Persona injection into `~/.claude/CLAUDE.md` on every session start
206
+ - npm package and crates.io publish jobs in release workflow
207
+ - Statusline with real-time compression metrics
208
+
209
+ ### Fixed
210
+ - `compress_md`: byte slice comparison to avoid UTF-8 char boundary panic
211
+ - Statusline: proper capitalization, green checkmark, real-time context %
212
+
213
+ ## [0.2.0] - 2026-03-15
214
+
215
+ ### Added
216
+ - Context engine: adaptive intensity, redundancy cache, summarize fallback
217
+ - `compress-md` command: pure-Rust markdown compressor
218
+ - Caveman persona prompt injection
219
+ - `squeez update` self-update command
220
+ - `track-result` PostToolUse hook for file/error tracking
221
+ - Cloud CLI handlers (kubectl, gh, aws, gcloud, az)
222
+ - Database handlers (psql, prisma, mysql)
223
+ - Data tool handlers (jq, yq, terraform)
224
+ - Windows support in `install.sh` and `release.yml`
225
+
226
+ ### Changed
227
+ - Wider redundancy window, token budget improvements
228
+ - CI: PR template, linked-issue enforcement
229
+
230
+ [Unreleased]: https://github.com/claudioemmanuel/squeez/compare/v0.3.2...HEAD
231
+ [0.3.0]: https://github.com/claudioemmanuel/squeez/compare/v0.2.3...v0.3.0
232
+ [0.2.3]: https://github.com/claudioemmanuel/squeez/compare/v0.2.2...v0.2.3
233
+ [0.2.2]: https://github.com/claudioemmanuel/squeez/compare/v0.2.1...v0.2.2
234
+ [0.2.1]: https://github.com/claudioemmanuel/squeez/compare/v0.2.0...v0.2.1
235
+ [0.2.0]: https://github.com/claudioemmanuel/squeez/releases/tag/v0.2.0
236
+ [0.3.2]: https://github.com/claudioemmanuel/squeez/releases/tag/v0.3.2
package/README.md CHANGED
@@ -98,25 +98,25 @@ Measured on macOS (Apple Silicon). Token count = `chars / 4` (matches Claude's ~
98
98
 
99
99
  | Scenario | Before | After | Reduction | Latency |
100
100
  |----------|--------|-------|-----------|---------|
101
- | `summarize_huge` | 82,257 tk | 420 tk | **-99%** | 62.9 ms |
102
- | `repetitive_output` | 4,692 tk | 37 tk | **-99%** | 102 µs |
103
- | `ps_aux` | 40,373 tk | 2,352 tk | **-94%** | 702 µs |
104
- | `git_log_200` | 2,692 tk | 289 tk | **-89%** | 75 µs |
105
- | `tsc_errors` | 731 tk | 101 tk | **-86%** | 20 µs |
106
- | `cargo_build_noisy` | 2,106 tk | 452 tk | **-79%** | 75 µs |
107
- | `docker_logs` | 665 tk | 186 tk | **-72%** | 16 µs |
108
- | `find_deep` | 424 tk | 134 tk | **-68%** | 29 µs |
109
- | `git_status` | 50 tk | 16 tk | **-68%** | 5 µs |
110
- | `verbose_app_log` | 4,957 tk | 1,991 tk | **-60%** | 93 µs |
111
- | `npm_install` | 524 tk | 232 tk | **-56%** | 16 µs |
112
- | `crosscall_redundancy_3x` | 486 tk | 241 tk | **-50%** | 57.7 ms |
113
- | `ls_la` | 1,782 tk | 886 tk | **-50%** | 52 µs |
114
- | `env_dump` | 441 tk | 287 tk | **-35%** | 9 µs |
115
- | `git_copilot` | 640 tk | 421 tk | **-34%** | 28 µs |
116
- | `md_prose` | 187 tk | 138 tk | **-26%** | 251 µs |
117
- | `md_claude_md` | 316 tk | 247 tk | **-22%** | 299 µs |
118
- | `git_diff` | 502 tk | 497 tk | **-1%** | 17 µs |
119
- | `kubectl_pods` | 1,513 tk | 1,513 tk | **-0%** | 20 µs |
101
+ | `summarize_huge` | 82,257 tk | 420 tk | **-99%** | 55.9 ms |
102
+ | `repetitive_output` | 4,692 tk | 37 tk | **-99%** | 205 µs |
103
+ | `ps_aux` | 40,373 tk | 2,352 tk | **-94%** | 2.3 ms |
104
+ | `git_log_200` | 2,692 tk | 289 tk | **-89%** | 153 µs |
105
+ | `tsc_errors` | 731 tk | 101 tk | **-86%** | 25 µs |
106
+ | `cargo_build_noisy` | 2,106 tk | 452 tk | **-79%** | 218 µs |
107
+ | `docker_logs` | 665 tk | 186 tk | **-72%** | 34 µs |
108
+ | `find_deep` | 424 tk | 134 tk | **-68%** | 71 µs |
109
+ | `git_status` | 50 tk | 16 tk | **-68%** | 13 µs |
110
+ | `verbose_app_log` | 4,957 tk | 1,991 tk | **-60%** | 232 µs |
111
+ | `npm_install` | 524 tk | 232 tk | **-56%** | 41 µs |
112
+ | `crosscall_redundancy_3x` | 486 tk | 241 tk | **-50%** | 51.5 ms |
113
+ | `ls_la` | 1,782 tk | 886 tk | **-50%** | 155 µs |
114
+ | `env_dump` | 441 tk | 287 tk | **-35%** | 19 µs |
115
+ | `git_copilot` | 640 tk | 421 tk | **-34%** | 99 µs |
116
+ | `md_prose` | 187 tk | 138 tk | **-26%** | 679 µs |
117
+ | `md_claude_md` | 316 tk | 247 tk | **-22%** | 932 µs |
118
+ | `git_diff` | 502 tk | 497 tk | **-1%** | 36 µs |
119
+ | `kubectl_pods` | 1,513 tk | 1,513 tk | **-0%** | 28 µs |
120
120
 
121
121
  ### Aggregate
122
122
 
@@ -127,8 +127,8 @@ Measured on macOS (Apple Silicon). Token count = `chars / 4` (matches Claude's ~
127
127
  | Markdown / context files | **-23.5%** |
128
128
  | Wrap / cross-call engine | **-99.2%** |
129
129
  | Quality (signal terms preserved) | **19 / 19 pass** |
130
- | Latency p50 (filter mode) | **6.4 ms** |
131
- | Latency p95 (incl. wrap/summarize) | **63 ms** |
130
+ | Latency p50 (filter mode) | **5.9 ms** |
131
+ | Latency p95 (incl. wrap/summarize) | **56 ms** |
132
132
 
133
133
  ### Estimated cost savings — Claude Sonnet 4.6 · $3.00 / MTok input
134
134
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squeez",
3
- "version": "0.3.2",
3
+ "version": "0.4.1",
4
4
  "description": "Hook-based token compressor for Claude Code, Copilot CLI, and OpenCode. Compresses bash output up to 95%, collapses redundant calls, injects caveman persona.",
5
5
  "keywords": [
6
6
  "claude-code",