feat(handlers): xcodebuild noise filter + log-file tail detection#84
Merged
claudioemmanuel merged 1 commit intomainfrom Apr 22, 2026
Merged
Conversation
Driven by an iOS development session where xcodebuild was the top bash command (~18 invocations) and squeez was routing it through the generic BuildHandler with only Gradle/Maven filters. Xcode-specific action lines (CompileSwift, SwiftEmitModule, Ld, CodeSign, etc.) plus build-system preamble and invocation echoes all survived compression. Changes - BuildHandler now detects xcodebuild and drops 30+ Xcode-specific action prefixes and continuation patterns while preserving the terminal `** BUILD SUCCEEDED/FAILED **` markers and Swift diagnostic lines. - FsHandler skips `group_files_by_dir` for viewer commands (cat/head/ tail/less/more/bat). The grouping step was collapsing non-path file content into a single `./ N modified` summary — a latent bug that masqueraded as extreme compression on markdown/log fixtures. - FsHandler uses `Keep::Tail` for `tail` (always) and for `cat`/`less`/ `more`/`bat` on `.log`/`.out`/`.err` paths. Recent events matter more than initial noise for log viewing. Benchmarks - New fixture `bench/fixtures/xcodebuild_build.txt`: 1,881 tk -> 17 tk (~99% reduction). All 15 filter-mode fixtures pass. - Efficiency proof: all 5 floors still pass. `sig_mode_delta_vs_pipeline` floor lowered from 30% to 10% with a comment explaining the adjustment — the previous floor was measured against the grouping bug above. - Aggregate benchmark: 91.6% reduction (152,961 tk -> 12,886 tk), within normal variance of the prior 91.9%. README block refreshed. Test flake fixes (pre-existing, unrelated to handlers) - `test_init_finalizes_prior_session_to_memory` and the four structured- memory tests in `test_memory_structured.rs` hardcoded a 2026-03-22 session timestamp that fell outside the default 30-day retention window once wall-clock time drifted past 2026-04-21. Switched both suites to `unix_now() - 86_400` and derive the date string from the same timestamp so the tests remain valid indefinitely.
f75ec36 to
f8a0601
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CompileSwift,SwiftEmitModule,Ld,CodeSign,ClangStatCache, build-system preamble, invocation echoes, etc.) while preserving Swift diagnostics and the terminal** BUILD SUCCEEDED/FAILED **markers.cat/head/tail/less/more/bat) now skipgroup_files_by_dir— the grouping step was collapsing non-path file content into a single./ N modifiedsummary, a latent bug that masqueraded as extreme compression on markdown/log fixtures. Viewer commands also switch toKeep::Tailwhen the target istailor when acat/less/more/batpath ends in.log/.out/.err— recent events beat initial noise for log viewing.test_init_finalizes_prior_session_to_memoryand the four structured-memory tests intest_memory_structured.rshardcoded a 2026-03-22 session timestamp that fell outside the default 30-day retention window once wall-clock time drifted past 2026-04-21. Both suites now anchor onunix_now() - 86_400and derive the date string from the same timestamp.Motivation
Driven by an iOS development session where xcodebuild was the top bash command (~18 invocations) and squeez was routing it through the generic BuildHandler with only Gradle/Maven filters. Xcode-specific action noise survived compression unchanged — a clear gap for Swift/iOS workloads.
Benchmarks
bench/fixtures/xcodebuild_build.txt: 1,881 tk → 17 tk (~99%)sig_mode_delta_vs_pipelinefloor lowered 30% → 10% with a comment explaining the adjustment — the previous floor was measured against the grouping bug above.Test plan
cargo test— 159 lib + integration tests passbash bench/run.sh— 15/15 fixtures pass./target/release/squeez benchmark— 23 scenarios, no quality regressions./target/release/squeez benchmark --efficiency-proof— all 5 floors pass