Skip to content

v1.4.2

Choose a tag to compare

@ppgranger ppgranger released this 23 Feb 19:43
· 153 commits to production since this release

Release v1.4.2

Highlights

File content processor rewrite - Source code and sensitive config files are now never compressed. Lock files, JSON, YAML, TOML, and XML are compressed with structure-preserving strategies. This eliminates the risk of missing lines causing wrong patches.

37 processor audit fixes - Systematic fixes across all 15 processors improving compression quality, coverage, and precision.

Aggressive thresholds - Compression triggers from the first token saved (min_input_length=1, min_compression_ratio=0.0), with all thresholds precision-tested to safe minimums.

What's New

File Content: Two-Category Dispatch

Category Extensions Behavior
Never compress .py, .js, .ts, .tsx, .jsx, .go, .rs, .java, .kt, .scala, .c, .cpp, .h, .hpp, .cs, .rb, .php, .swift, .sh, .bash, .zsh, .sql, .tf, .hcl, .env, .ini, .cfg, .conf, + 20 more Pass through byte-for-byte
Lock files package-lock.json, yarn.lock, poetry.lock, Cargo.lock, composer.lock, Pipfile.lock, go.sum Dependency names + versions only
Structured data .json, .yaml, .yml, .toml, .xml Preserve keys and structure hierarchy
Logs .log Error-focused with context lines
CSV/TSV .csv, .tsv Header + head/tail rows
Documentation .md, .rst Head/tail truncation
Unknown everything else Conservative generic truncation

Processor Fixes

  • build_output: warning samples preserved, bun support, duplicate regex fix
  • cloud_cli: important key preservation at depth (InstanceId, ResourceName)
  • test_output: accurate Jest test counts, tighter Go test boundary detection
  • git: git status -sb branch header detection
  • lint_output: oxlint, deno lint, golangci-lint, rubocop parser support
  • search: extensionless file handling
  • network: inverted wget filter (keep useful lines only)
  • db_query: stricter psql table detection (| count >= 2)
  • terraform: validate and fmt subcommand support
  • gh: api subcommand routing, shared diff compression
  • generic: digit threshold raised to 30% (fewer false positives on tabular data)

Engine Improvements

  • Processor passthrough respected: when a processor explicitly returns output unchanged, no generic fallback applied
  • Size guard: compression only reported when output actually gets smaller

Session Tracking

  • TOKEN_SAVER_SESSION embedded in rewritten commands for per-session aggregation
  • Safe trailing pipe allowlist (head, tail, grep, sort, uniq, cut)

Shared Utilities

  • New src/processors/utils.py: compress_diff(), compress_json_value(), group_files_by_dir() used across multiple processors

Quality

  • 430 tests passing (39 precision tests)
  • 0 lint errors (ruff)
  • 26 files changed, +1580 / -457

Upgrade

No configuration changes required. All new defaults are backward-compatible. Existing ~/.token-saver/config.json overrides continue to work.