You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
filters: universal no-bloat guard — never emit output larger than raw #95
Several filters produce output larger than the raw command output — negative savings. Measured from the production tracking DB (30d):
Bucket
Calls
Savings
tsc -b
5
−94%
pytest --verbose
26
−75%
gh pr create
5
−23%
git push -u
5
−7%
small grep results
many
negative (header overhead exceeds tiny raw output; a no-match grep emits "0 matches for…" ≈ 13 tokens where raw grep emits 0)
Same root class as #89 (git add recorded −1300%): a filter adds framing/summary to a command whose raw output was already small or empty.
Fix
A single guard in the filter dispatch path — after a filter produces its output, before emitting and tracking:
// A filter must never cost more than it saves. If the filtered form is// larger than the raw output, emit raw — the wrapper has nothing to add here.let final_output = if filtered.len() >= raw.len(){&raw }else{&filtered };
Apply at the common dispatch site so it covers every filter (Rust command filters AND the TOML-filter path), not per-filter. Track against final_output so the dashboard reflects reality.
Caveats
The grep no-match case ("0 matches for…") is arguably useful signal even though it's larger than empty. Decide: either let the guard emit raw-empty (agent sees nothing, same as bare grep), or special-case a 1-token marker. Recommend: emit raw — consistency over a 13-token convenience.
Don't let the guard mask a filter that's supposed to summarise (e.g. git add's --stat baseline from git add: tracking records -1300% savings (filter adds info to silent command) #89 is intentionally informational) — those track against a synthetic baseline, not raw, so they won't trip the guard. Verify the guard sits after baseline selection.
Acceptance
No command bucket in contextcrawler gain shows negative savings.
tsc -b, gh pr create, git push, small/no-match grep all show 0% (passthrough) rather than negative.
A regression test: feed a filter input where the filtered form would be larger, assert raw is emitted.
Activity
fix(filters): universal no-bloat guard so filters never cost more tha…
fix(git): no-bloat guard must not silence no-op `git add`
fix(go): don't report build success on a failed build (upstream f69ad6e)
fix(tracking): record true inflation_tokens (was clamped to 0 before …