Skip to content

v0.1.1 — Bug fixes, test refactor, improved examples

Choose a tag to compare

@amahi2001 amahi2001 released this 12 Apr 06:29
· 21 commits to main since this release

What changed since v0.1.0

Bug Fixes

  • Silent data loss in _shorten_keystimestamp and created_at both mapped to ts. When both existed in the same dict, aggressive mode silently dropped one value. Fixed with collision detection.
  • URL corruption in CodeMinimizerhttps://example.com inside 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_keys crash on non-string keys"." in 1 raised TypeError. Fixed with isinstance(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 require diff --git header or --- followed by +++ .
  • _sample(n=1) caused ZeroDivisionErrorstep = (len-1) / (n-1). Fixed with early-return guards.
  • ALL CAPS words abbreviated with wrong caseIMPLEMENTATION became Impl instead of IMPL. Fixed with word.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 savings
  • examples/langgraph_agent.py — simulated 3-step agent loop with token savings per step
  • examples/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 pip to uv ecosystem (picks up uv.lock + [dependency-groups])
  • SECURITY.md added
  • CodeQL continue-on-error removed (repo is now public)