@superbased/observer 1.7.23 → 1.7.24

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 (2) hide show
  1. package/README.md +75 -20
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -551,7 +551,7 @@ a content-aware compressor. Six compressors:
551
551
  | Mechanism | What it does | When it fires |
552
552
  |-----------|--------------|---------------|
553
553
  | **json** | Replaces every scalar value with a type sentinel (`"<string>"`, `"<number>"`, …) preserving structure (keys, arrays, nesting). Arrays of length > 1 collapse to one element with `_len: N`. | API responses, structured logs, telemetry exports. JSON tool_results are usually the biggest savings target. |
554
- | **code** | Heuristic skeleton: keeps top-of-file imports + signature lines (function / method / class / struct / interface / type), drops bodies. | Source code files. **Opt-in only** (excluded from default `compress_types`) because the model often needs to read full code. |
554
+ | **code** | Heuristic skeleton: keeps top-of-file imports + signature lines (function / method / class / struct / interface / type), drops bodies. | Source code files. **On by default** as of v1.7.23 for the `claude-code` recipe (V7-24 empirical winner). |
555
555
  | **logs** | Two-pass: collapses adjacent identical lines to `<line> [×N]`, then head+tail-truncates to 200 lines if still long. | Log-shaped output — `go test ./...`, `npm run build`, polling/retry loops. Lossless on distinct lines; only the truncate pass is lossy. |
556
556
  | **text** | Catch-all for content not classified as code/json/logs/diff/html. Head+tail truncation: keeps 40 + 40 lines on inputs over 80 lines. | Markdown bodies, README excerpts, narrative descriptions. |
557
557
  | **diff** | Strips unified-diff context beyond ±1 line of each change. Keeps every header, every `+`/`-` line, drops the rest with elision markers. | `git diff`, patch tool outputs. Lossless on changes; lossy only on the cheap-to-rebuild context. |
@@ -640,6 +640,53 @@ summary model: `summary_model` for Anthropic, `openai_summary_model` for
640
640
  OpenAI/Codex), and `[compression.conversation.compaction]`. The full knob
641
641
  reference lives in `docs/compression-modes.md`.
642
642
 
643
+ ### Measured savings (v1.7.23)
644
+
645
+ We A/B every shipped recipe against an OFF baseline on a real refactor
646
+ workload (`lumen` TypeScript codebase, 408-line Zustand store →
647
+ 4 domain sub-stores) on the v1.7.22 binary tip. The numbers below are
648
+ the **most recent statistically-meaningful measurements**.
649
+
650
+ **Pick a recipe based on which model you're running:**
651
+
652
+ | Recipe | Use when your model is… | Workload | n | Δ vs OFF (mean cost) | What's compressed |
653
+ |---|---|---|---|---|---|
654
+ | **`claude-code`** *(default)* | Any Anthropic Claude model — `claude-sonnet-4-6`, `claude-opus-4-7`, `claude-haiku-4-5`, … | Refactor, Claude Sonnet 4.6 via Claude Code 2.1.158 | n=8 B vs n=4 OFF | **−6.9%** (CV 7.6%; tighter than OFF's 7.5%) | json + logs + code bodies; cache-aware; stash disabled |
655
+ | **`codex-variant`** | OpenAI's `-codex` reasoning fork — `gpt-5.3-codex`, `gpt-5.4-codex`, `gpt-5-codex-agent`, anything matching `*-codex*` | Refactor, gpt-5.3-codex | n=10 B vs n=10 OFF | **−10%** ($0.270 vs $0.300) | Tools-defs trim; cache-aware; no per-type compression |
656
+ | **`codex-safe`** | Plain OpenAI GPT under the codex CLI — `gpt-5.4`, `gpt-5.4-mini`, `gpt-5.5`, `gpt-4o`, any non-`-codex` | Refactor, gpt-5.4 + `apply_patch` | n=3 B vs n=4 OFF | not statistically distinguishable on this workload | logs only; cache-aware |
657
+
658
+ The word **"variant"** in `codex-variant` refers to the *model variant* (the `-codex` reasoning fork of GPT), NOT a variant of the codex CLI. Both codex recipes are for the codex CLI; they differ only in which model family they assume. `codex-safe` is so named because plain GPT models tolerate logs trimming safely — it's not "safer than codex-variant."
659
+
660
+ **Honest caveats:**
661
+
662
+ - **Workload-dependent.** The `codex-safe` row on gpt-5.4 was
663
+ inconclusive because the test workload used `apply_patch` (classified
664
+ as `code`, not `logs`) so `compress_types=["logs"]` never fired —
665
+ the proxy was a functional no-op and the cost variance was session
666
+ noise. A Bash-heavy workload would tell a different story.
667
+ - **`claude-code` requires `ENABLE_TOOL_SEARCH=true`** in your shell.
668
+ Without it, Claude Code's SDK disables ToolSearch under
669
+ `ANTHROPIC_BASE_URL` and eager-inlines all MCP schemas (~+21K
670
+ tokens per turn). The proxy then becomes a net loss instead of
671
+ the −6.9% above. Setup steps cover this; verify with
672
+ `printenv ENABLE_TOOL_SEARCH`.
673
+ - **`stash` stays disabled by default for Anthropic** (V7-25 finding:
674
+ +25% cost on n=1 due to prefix-cache miss; stash markers break
675
+ Anthropic's content-hash cache). Operators can opt in for a measured
676
+ workload but should A/B their own.
677
+ - **Historic claims of higher savings are retracted.** The v1.4.38
678
+ release notes cited −14.8%; the project itself walked that back
679
+ after a deeper repro showed it was within noise. The numbers above
680
+ are the post-retraction floor.
681
+
682
+ **Reproduce it yourself:**
683
+
684
+ ```bash
685
+ # Full methodology, raw arm data, per-arm cost rows, and a reproducer
686
+ # script live in this repo:
687
+ docs/v1.7.23-compression-savings-empirical-2026-06-01.md
688
+ ```
689
+
643
690
 
644
691
  ## Cost and token math
645
692
 
@@ -981,25 +1028,33 @@ port = 8082 # in config.toml
981
1028
 
982
1029
  ## Security and privacy
983
1030
 
984
- - **No telemetry**. The observer never makes outbound network calls
985
- except: (a) the proxy forwarding to the upstream API on your
986
- behalf, (b) optional codegraph-MCP integration if you've configured
987
- it. Both are explicit.
988
- - **Local-only HTTP**. The proxy and dashboard bind to
989
- `127.0.0.1` by default. Don't bind to `0.0.0.0` unless you've
990
- thought about it — there's no auth.
991
- - **Secrets scrubbing**. Tool inputs and outputs are passed through
992
- a configurable scrubber (`internal/scrub`) that redacts API keys,
993
- bearer tokens, and other obvious secrets before persistence. Not a
994
- guarantee review the rules in `~/.observer/config.toml` for your
995
- own secret formats.
996
- - **Database**. `~/.observer/observer.db` is a SQLite file. Owns
997
- the same security as your `~/.claude/` and `~/.codex/` session
998
- logs (which already contain the same content). Encrypt the disk
999
- if your threat model needs that.
1000
- - **Logs**. `~/.observer/logs/` carries operational logs (start /
1001
- stop, errors, retention). Not request bodies those are in the
1002
- DB only.
1031
+ **Local-only. No telemetry. No remote anything.** The watcher, hook
1032
+ handler, dashboard, MCP server, and CLI never make an outbound network
1033
+ call on observer's behalf. The only code paths that touch the network
1034
+ are the optional API proxy (which forwards **your** requests unchanged
1035
+ to the AI provider you already use) and a handful of explicit opt-in
1036
+ features (message-summary LLM, codegraph MCP, Teams org-server).
1037
+
1038
+ The full privacy statement what observer stores, what it reads,
1039
+ what it never stores, the explicit list of outbound-network call sites
1040
+ gated behind config, and how to verify "no telemetry" yourself with
1041
+ `grep`, `strings`, and a network-namespaced shell lives in
1042
+ [`PRIVACY.md`](https://github.com/marmutapp/superbased-observer/blob/main/PRIVACY.md).
1043
+
1044
+ Operational shorthand:
1045
+
1046
+ - **Local-only HTTP.** The proxy and dashboard bind to `127.0.0.1`
1047
+ by default. Don't bind to `0.0.0.0` unless you've thought about
1048
+ itthere's no auth.
1049
+ - **Secrets scrubbing.** Tool inputs and outputs pass through
1050
+ `internal/scrub/` before persistence; review the regex set if your
1051
+ secrets follow non-default formats.
1052
+ - **Database.** `~/.observer/observer.db` is a SQLite file with the
1053
+ same security posture as your `~/.claude/` and `~/.codex/` session
1054
+ logs (which already hold the same content). Encrypt the disk if
1055
+ your threat model needs that.
1056
+ - **Full delete.** `rm -rf ~/.observer/` removes everything observer
1057
+ ever stored — no traces elsewhere on your system.
1003
1058
 
1004
1059
 
1005
1060
  ## Source, contributing, license
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superbased/observer",
3
- "version": "1.7.23",
3
+ "version": "1.7.24",
4
4
  "description": "SuperBased Observer — capture, normalize, compress, and analyze AI coding tool activity across Claude Code, Codex, Cursor, Cline/Roo, and Copilot.",
5
5
  "keywords": [
6
6
  "ai",
@@ -36,11 +36,11 @@
36
36
  "LICENSE"
37
37
  ],
38
38
  "optionalDependencies": {
39
- "@superbased/observer-linux-x64": "1.7.23",
40
- "@superbased/observer-linux-arm64": "1.7.23",
41
- "@superbased/observer-darwin-x64": "1.7.23",
42
- "@superbased/observer-darwin-arm64": "1.7.23",
43
- "@superbased/observer-win32-x64": "1.7.23"
39
+ "@superbased/observer-linux-x64": "1.7.24",
40
+ "@superbased/observer-linux-arm64": "1.7.24",
41
+ "@superbased/observer-darwin-x64": "1.7.24",
42
+ "@superbased/observer-darwin-arm64": "1.7.24",
43
+ "@superbased/observer-win32-x64": "1.7.24"
44
44
  },
45
45
  "scripts": {
46
46
  "test": "node bin/observer.js --version"