diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ca0558..ab05bf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,48 @@ # Changelog +## v0.5.0 + +### Upgrade notes + +- **The Bash hook is retired.** Claude Code checks permission rules against the command a + PreToolUse hook returns, and the hook rewrote every Bash command to `secondwind exec -c '...'` + while answering "allow", so Bash deny rules stopped matching and prompts were skipped. `secondwind + hook` now passes every command through unchanged, `setup --hook` installs nothing, plain + `secondwind setup` removes a hook an earlier version installed, and `secondwind check` warns while + one is still there. Use the Claude Code mod instead (below). +- **Offloading depends on where a block came from.** When a caller names the tool and command (MCP + `optimize` takes optional `tool` and `command`; `exec` uses its own), output that is usually read + in full, such as a large `cat` or `Read`, stays in view and only inline codecs apply. Callers that + name nothing behave as before. +- **Figures read from recorded sessions drop.** The trace reader counted images and PDFs as base64 + text and wrapped every tool result in JSON the model never saw. On the author's sessions that + made tool output look seven times larger than it is, so `cache-savings` and the audit report less. + +### Security + +- The retired Bash hook let Bash commands run without the user's deny rules or prompts (above). + +### Added + +- `secondwind eval` replays your recorded sessions through the optimizer and reports, per tool and + command, what was offloaded, how often the model later needed it, net tokens, and whether every + block came back intact. `--learn` fits reopen rates on half your sessions, replays the other half + with and without the gate, and writes `~/.secondwind/policy.json`; `--gate` and `--query` replay + with the gate or with your latest message as the query; `--blocks` writes one line per result. +- A reopen policy per command class and size decides whether a block may be offloaded. The + built-in table comes from 1,491 real sessions; a learned `policy.json` replaces it. On held-out + sessions the learned gate cut reopens per session from 23.6 to 4.8, and no block of 138,209 came + back different from the original. +- Claude Code mod 0.2.0: sends the command with each block, so a large `cat` stays in view, and + compresses from 512 bytes instead of 6 KB. For Bash on held-out sessions it saves 9.7% of all + tool output instead of 6.6%, with fewer extra turns. Tests now pin the pane's off, empty, win and + loss states. + +### Fixed + +- `optimize`'s `query` description no longer claims it helps text; it applies to JSON record + arrays. + ## v0.4.0 ### Upgrade notes diff --git a/Cargo.lock b/Cargo.lock index b79f21d..9edd94d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1351,7 +1351,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "secondwind" -version = "0.4.0" +version = "0.5.0" dependencies = [ "axum", "base64 0.22.1", @@ -1377,7 +1377,7 @@ dependencies = [ [[package]] name = "secondwind-analyzers" -version = "0.4.0" +version = "0.5.0" dependencies = [ "secondwind-core", "serde", @@ -1385,7 +1385,7 @@ dependencies = [ [[package]] name = "secondwind-core" -version = "0.4.0" +version = "0.5.0" dependencies = [ "serde", "serde_json", @@ -1393,7 +1393,7 @@ dependencies = [ [[package]] name = "secondwind-ffi" -version = "0.4.0" +version = "0.5.0" dependencies = [ "secondwind-ledger", "secondwind-optimize", @@ -1402,7 +1402,7 @@ dependencies = [ [[package]] name = "secondwind-ledger" -version = "0.4.0" +version = "0.5.0" dependencies = [ "secondwind-core", "serde", @@ -1411,7 +1411,7 @@ dependencies = [ [[package]] name = "secondwind-optimize" -version = "0.4.0" +version = "0.5.0" dependencies = [ "blake3", "bpe-openai", @@ -1429,7 +1429,7 @@ dependencies = [ [[package]] name = "secondwind-redact" -version = "0.4.0" +version = "0.5.0" dependencies = [ "regex", "secondwind-analyzers", @@ -1439,7 +1439,7 @@ dependencies = [ [[package]] name = "secondwind-report" -version = "0.4.0" +version = "0.5.0" dependencies = [ "secondwind-analyzers", "secondwind-core", @@ -1450,7 +1450,7 @@ dependencies = [ [[package]] name = "secondwind-sources" -version = "0.4.0" +version = "0.5.0" dependencies = [ "secondwind-core", "serde", @@ -1460,7 +1460,7 @@ dependencies = [ [[package]] name = "secondwind-tap" -version = "0.4.0" +version = "0.5.0" dependencies = [ "secondwind-analyzers", "secondwind-core", diff --git a/Cargo.toml b/Cargo.toml index 455d8d6..0e4c36d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ members = [ ] [workspace.package] -version = "0.4.0" +version = "0.5.0" edition = "2024" license = "Apache-2.0" repository = "https://github.com/orchetron/secondwind" diff --git a/bindings/node/package.json b/bindings/node/package.json index 139a8db..1cebfff 100644 --- a/bindings/node/package.json +++ b/bindings/node/package.json @@ -1,6 +1,6 @@ { "name": "secondwind", - "version": "0.4.0", + "version": "0.5.0", "description": "Lossless, provable, composable LLM context compression", "type": "module", "exports": { @@ -32,11 +32,11 @@ "koffi": "^3.1.1" }, "optionalDependencies": { - "@orchetron/secondwind-darwin-arm64": "0.4.0", - "@orchetron/secondwind-darwin-x64": "0.4.0", - "@orchetron/secondwind-linux-x64": "0.4.0", - "@orchetron/secondwind-linux-arm64": "0.4.0", - "@orchetron/secondwind-win32-x64": "0.4.0" + "@orchetron/secondwind-darwin-arm64": "0.5.0", + "@orchetron/secondwind-darwin-x64": "0.5.0", + "@orchetron/secondwind-linux-x64": "0.5.0", + "@orchetron/secondwind-linux-arm64": "0.5.0", + "@orchetron/secondwind-win32-x64": "0.5.0" }, "devDependencies": { "@ai-sdk/provider": "^4.0.3", diff --git a/bindings/node/platforms/secondwind-darwin-arm64/package.json b/bindings/node/platforms/secondwind-darwin-arm64/package.json index b07fe72..f4b4286 100644 --- a/bindings/node/platforms/secondwind-darwin-arm64/package.json +++ b/bindings/node/platforms/secondwind-darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@orchetron/secondwind-darwin-arm64", - "version": "0.4.0", + "version": "0.5.0", "description": "secondwind native library for darwin-arm64", "license": "Apache-2.0", "os": [ diff --git a/bindings/node/platforms/secondwind-darwin-x64/package.json b/bindings/node/platforms/secondwind-darwin-x64/package.json index ad0016b..07ebcd2 100644 --- a/bindings/node/platforms/secondwind-darwin-x64/package.json +++ b/bindings/node/platforms/secondwind-darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@orchetron/secondwind-darwin-x64", - "version": "0.4.0", + "version": "0.5.0", "description": "secondwind native library for darwin-x64", "license": "Apache-2.0", "os": [ diff --git a/bindings/node/platforms/secondwind-linux-arm64/package.json b/bindings/node/platforms/secondwind-linux-arm64/package.json index c0cd654..f53865d 100644 --- a/bindings/node/platforms/secondwind-linux-arm64/package.json +++ b/bindings/node/platforms/secondwind-linux-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@orchetron/secondwind-linux-arm64", - "version": "0.4.0", + "version": "0.5.0", "description": "secondwind native library for linux-arm64", "license": "Apache-2.0", "os": [ diff --git a/bindings/node/platforms/secondwind-linux-x64/package.json b/bindings/node/platforms/secondwind-linux-x64/package.json index d92a7a8..598895a 100644 --- a/bindings/node/platforms/secondwind-linux-x64/package.json +++ b/bindings/node/platforms/secondwind-linux-x64/package.json @@ -1,6 +1,6 @@ { "name": "@orchetron/secondwind-linux-x64", - "version": "0.4.0", + "version": "0.5.0", "description": "secondwind native library for linux-x64", "license": "Apache-2.0", "os": [ diff --git a/bindings/node/platforms/secondwind-win32-x64/package.json b/bindings/node/platforms/secondwind-win32-x64/package.json index d28a8ef..35c8344 100644 --- a/bindings/node/platforms/secondwind-win32-x64/package.json +++ b/bindings/node/platforms/secondwind-win32-x64/package.json @@ -1,6 +1,6 @@ { "name": "@orchetron/secondwind-win32-x64", - "version": "0.4.0", + "version": "0.5.0", "description": "secondwind native library for win32-x64", "license": "Apache-2.0", "os": [ diff --git a/bindings/python/pyproject.toml b/bindings/python/pyproject.toml index 7b66cbb..0bc7cbf 100644 --- a/bindings/python/pyproject.toml +++ b/bindings/python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "secondwind" -version = "0.4.0" +version = "0.5.0" description = "Lossless, provable, composable LLM context compression" readme = "README.md" requires-python = ">=3.9" diff --git a/integrations/claude-code/.claude-plugin/plugin.json b/integrations/claude-code/.claude-plugin/plugin.json index 2107186..430743a 100644 --- a/integrations/claude-code/.claude-plugin/plugin.json +++ b/integrations/claude-code/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "secondwind", - "version": "0.1.0", + "version": "0.2.0", "description": "Compress Bash output through secondwind, recover offloaded blocks, and watch net savings in a pane", "types": "./types/index.d.ts" }