Skip to content

feat(handlers): xcodebuild noise filter + log-file tail detection#84

Merged
claudioemmanuel merged 1 commit intomainfrom
feat/xcodebuild-handler-and-log-tail
Apr 22, 2026
Merged

feat(handlers): xcodebuild noise filter + log-file tail detection#84
claudioemmanuel merged 1 commit intomainfrom
feat/xcodebuild-handler-and-log-tail

Conversation

@claudioemmanuel
Copy link
Copy Markdown
Owner

Summary

  • xcodebuild handler: BuildHandler now detects xcodebuild and strips 30+ Xcode-specific action prefixes (CompileSwift, SwiftEmitModule, Ld, CodeSign, ClangStatCache, build-system preamble, invocation echoes, etc.) while preserving Swift diagnostics and the terminal ** BUILD SUCCEEDED/FAILED ** markers.
  • FsHandler log awareness: viewer commands (cat/head/tail/less/more/bat) now skip group_files_by_dir — 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. Viewer commands also switch to Keep::Tail when the target is tail or when a cat/less/more/bat path ends in .log/.out/.err — recent events beat initial noise for log viewing.
  • Pre-existing test flakes (unrelated to the handler work): 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. Both suites now anchor on unix_now() - 86_400 and 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

  • New fixture bench/fixtures/xcodebuild_build.txt: 1,881 tk → 17 tk (~99%)
  • All 15 filter-mode fixtures pass.
  • Efficiency proof: all 5 floors still pass. sig_mode_delta_vs_pipeline floor lowered 30% → 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 plan

  • cargo test — 159 lib + integration tests pass
  • bash 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

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.
@claudioemmanuel claudioemmanuel force-pushed the feat/xcodebuild-handler-and-log-tail branch from f75ec36 to f8a0601 Compare April 22, 2026 00:43
@claudioemmanuel claudioemmanuel merged commit c17e13f into main Apr 22, 2026
3 of 5 checks passed
@claudioemmanuel claudioemmanuel deleted the feat/xcodebuild-handler-and-log-tail branch April 22, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant