Skip to content

feat(mvn): add Maven filter module — test, build, dependency:tree#1089

Open
mariuszs wants to merge 1 commit intortk-ai:developfrom
mariuszs:feat/mvn-rust-module
Open

feat(mvn): add Maven filter module — test, build, dependency:tree#1089
mariuszs wants to merge 1 commit intortk-ai:developfrom
mariuszs:feat/mvn-rust-module

Conversation

@mariuszs
Copy link
Copy Markdown

@mariuszs mariuszs commented Apr 8, 2026

Summary

Adds a Rust filter module for Maven (mvn) commands, replacing the old mvn-build.toml declarative filter with a state-machine parser that achieves 90-99%+ token savings on real-world output.

Subcommands

  • mvn test — State-machine parser (Preamble → Testing → Summary → Done) extracts failure names, assertion details, and run counts. Caps output to 10 failures with truncated lines. Handles multi-module builds, ANSI-heavy output, and large suites (3000+ tests).
  • mvn build (compile/package/clean/install/verify) — Line filter strips [INFO] noise, download progress, and Testcontainers chatter. Keeps errors, BUILD result, and total time.
  • mvn dependency:tree — Strips boilerplate, "omitted for duplicate" lines, and "version managed from" annotations. Preserves tree structure and conflict markers.
  • Other goals — Streaming passthrough via cmd.status() (safe for long-running goals like spring-boot:run), with usage tracking.

Routing

Clap Mvn sub-enum with Test, Build, DepTree, and #[command(external_subcommand)] Other variants. Build-like goals in Other are auto-routed to the build filter. Auto-detects mvnw wrapper.

Token savings (measured on real project logs)

mvn test

Scenario Tests Lines in Savings
Single-module, all pass 183 OK 41 97%
Real Spring Boot project, all pass 959 OK, 9 skipped 10,070 100%
Single-module, 2 assertion failures 5 run, 2 failed 3,380 99.7%
Multi-module (4 modules), JGit errors 860 run, 4 errors 7,039 99.7%
Large suite, mixed errors (assertions + compilation) 3,262 run, 23 failed 40,760 99.9%

mvn dependency:tree

Scenario Lines in Savings
Simple project (4 direct deps) 23 ~40%
Spring Boot project (36 direct deps, 652 tree lines) 652 60%+

Output examples

Success: mvn test: 950 passed, 9 skipped (01:32 min)

Failure:

mvn test: 5 run, 2 failed (23.819 s)
BUILD FAILURE

Failures:
1. EmailParserTest.should_extract_domain_from_email
   org.opentest4j.AssertionFailedError:
   expected: "broken.example.com"
   but was: "user.example.com"
2. ScoreTypeTest.shouldMapToRole
   org.opentest4j.AssertionFailedError:
   expected: "app:BROKEN"
   but was: "app:all"

Tests

21 tests against 8 real-world fixtures (1310 lines total):

  • Pass/fail/multi-module/large suite/ANSI scenarios for mvn test
  • Simple/conflict/large dependency trees with duplicate stripping
  • Token savings assertions (≥60-95% depending on scenario)
  • Edge cases: empty input, no test section

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 8, 2026

CLA assistant check
All committers have signed the CLA.

@mariuszs mariuszs changed the base branch from master to develop April 8, 2026 20:11
@mariuszs mariuszs force-pushed the feat/mvn-rust-module branch from 45f64f3 to 290958d Compare April 8, 2026 20:12
State-machine parser for mvn test (Preamble → Testing → Summary → Done),
line filter for build goals, and dependency:tree filter stripping duplicates
and version-managed annotations. Streaming passthrough for unrecognized goals.

Replaces mvn-build.toml with Rust module achieving 90-99%+ token savings.
21 tests against 8 real-world fixtures.
@mariuszs mariuszs force-pushed the feat/mvn-rust-module branch from 290958d to d22f22b Compare April 8, 2026 20:42
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.

2 participants