v0.1.1 — Bug fixes, test refactor, improved examples
What changed since v0.1.0
Bug Fixes
- Silent data loss in
_shorten_keys—timestampandcreated_atboth mapped tots. When both existed in the same dict, aggressive mode silently dropped one value. Fixed with collision detection. - URL corruption in CodeMinimizer —
https://example.cominside string literals was stripped because the//comment regex had a broken single-char lookbehind. Replaced with a string-aware regex that matches quoted strings first. _shorten_dotted_keyscrash on non-string keys —"." in 1raisedTypeError. Fixed withisinstance(k, str)guard.- DiffMinimizer silently folded
\ No newline at end of file— the backslash marker was treated as context and lost in large diffs. Fixed by adding"\\ "to significant prefixes. - Markdown misdetected as diff — a
---horizontal rule plus any@@mention triggered diff detection. Tightened to requirediff --githeader or---followed by+++. _sample(n=1)causedZeroDivisionError—step = (len-1) / (n-1). Fixed with early-return guards.- ALL CAPS words abbreviated with wrong case —
IMPLEMENTATIONbecameImplinstead ofIMPL. Fixed withword.isupper()check.
Test Suite
Refactored 3 monolithic files (1000+ lines each) into 19 focused modules:
tests/
unit/ # one file per minimizer
adversarial/ # one file per concern (types, unicode, regex, contracts, mutation, concurrency, performance)
real_world/ # tool output tests (pytest, cargo, go test, ruff, git, docker, build errors, pipelines)
New Makefile targets: make test-unit, make test-adversarial, make test-real-world
Examples
Replaced abstract examples with runnable, output-showing demos:
examples/rag_pipeline.py— 3 realistic wiki docs, naive vs ptk context, per-query cost + monthly savingsexamples/langgraph_agent.py— simulated 3-step agent loop with token savings per stepexamples/log_triage.py— 400-line CI log → 19-line error triage (96.5% saved)
Other
- README: lead with before/after, real token counts, cost math
- uv-only CI:
uv sync --locked --only-group <group>per job, built-in caching - Dependabot: switched from
piptouvecosystem (picks upuv.lock+[dependency-groups]) - SECURITY.md added
- CodeQL
continue-on-errorremoved (repo is now public)