Skip to content

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

Merged
mariuszs merged 18 commits intomasterfrom
feat/mvn-rust-module
Apr 10, 2026
Merged

feat(mvn): add Maven filter module — test, build, dependency:tree#2
mariuszs merged 18 commits intomasterfrom
feat/mvn-rust-module

Conversation

@mariuszs
Copy link
Copy Markdown
Owner

@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

TropicalDog17 and others added 16 commits April 3, 2026 14:17
Creates docs/README.md (interface contract defining 3-tab structure,
required frontmatter, and conventions) and 4 stub pages with valid
frontmatter for docs/guide/, docs/reference/, and docs/architecture/.
These are the prerequisites for the prepare-docs.mjs pipeline (Plan B)
and for Adrien's Phase 1 content work.

No existing files modified.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
Creates the complete user-facing guide for the docs website:

Getting started:
- quick-start.md: 5-minute walkthrough (init, first commands, rtk gain)
- supported-agents.md: Claude Code, Cursor, Copilot, Gemini, Cline, Windsurf,
  Codex, OpenCode — integration tiers, install commands, graceful degradation

Commands (adapted from FEATURES.md, English, --help-first format):
- git.md: status/log/diff/show/add/commit/push/pull/branch + gh CLI
- cargo.md: test/nextest/build/check/clippy/install + generic test/err wrappers
- files.md: ls/read/grep/find/diff/wc/smart with before/after examples
- javascript.md: vitest/playwright/tsc/eslint/prettier/next/pnpm/npm/npx/prisma
- python.md: pytest/ruff/mypy/pip/deps

Reference:
- filters/using-filters.md: 8-stage pipeline, lookup priority, TOML DSL reference,
  Mermaid diagram (adapted from docs/filter-workflow.md)
- analytics/gain.md: rtk gain flags, daily/weekly/monthly breakdowns, export
  formats, token estimation, database management (from docs/AUDIT_GUIDE.md)
- configuration.md: full config.toml reference, env vars, tee system, telemetry
- troubleshooting.md: common issues and fixes (from docs/TROUBLESHOOTING.md)

All pages carry valid frontmatter (title, description, sidebar.order).
No existing files modified.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
…mmands

Guide — 10 new command and analytics pages:
- commands/go.md: go test (NDJSON), golangci-lint
- commands/ruby.md: rspec, rubocop, rake
- commands/dotnet.md: dotnet build/test, binlog, format
- commands/containers.md: docker ps/images/logs/compose, kubectl pods/services/logs
- commands/github-cli.md: gh pr/issue/run, Graphite gt commands
- commands/data.md: json, env, log, curl, wget, aws, psql, summary
- commands/utilities.md: proxy passthrough, global flags, RTK_DISABLED
- filters/creating-filters.md: TOML DSL guide, field reference, inline tests
- analytics/discover.md: rtk discover — missed savings analysis
- analytics/economics.md: rtk cc-economics — dollar savings vs ccusage

Reference tab (9 pages):
- contributing/guide.md: design philosophy, PR process, TOML vs Rust decision
- contributing/security.md: vulnerability reporting, dangerous patterns, dep criteria
- contributing/coding-standards.md: Rust rules, error handling, lazy_static, fallback pattern
- contributing/testing.md: snapshot tests, token accuracy, cross-platform, benchmarks
- internals/command-routing.md: 6-phase lifecycle, exit codes, verbosity, module map
- internals/filter-pipeline.md: 12 filtering strategies, TOML stages, savings by ecosystem
- internals/tracking-system.md: SQLite schema, data flow, token estimation, Tracker API
- internals/hook-engine.md: rewrite registry, compound commands, exit code contract, rtk init
- toml-dsl/specification.md: complete field reference, pipeline order, build compilation

Architecture tab (4 pages):
- diagrams/command-flow.md: end-to-end Mermaid — hook → RTK → LLM
- diagrams/filter-pipeline.md: build pipeline + 8-stage runtime Mermaid
- decisions/why-no-async.md: ADR — single-threaded, <10ms startup constraint
- decisions/proxy-architecture.md: ADR — why CLI proxy over aliases/LD_PRELOAD/hooks-only

All pages carry valid frontmatter (title, description, sidebar.order).
No existing files modified.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
…flat docs

- Remove docs/reference/ (10 files): duplicates CONTRIBUTING.md, SECURITY.md,
  ARCHITECTURE.md, src/*/README.md (distributed pattern from PR rtk-ai#869)
- Remove docs/architecture/ (5 files): duplicates ARCHITECTURE.md ADRs and diagrams
- Remove docs/guide/commands/ (12 files): showed rtk <cmd> syntax users never type
  (hooks rewrite transparently); content was derived from FEATURES.md
- Remove docs/guide/filters/ (2 files): contributor content, belongs with src/filters/
- Remove docs/guide/analytics/discover.md, economics.md: implementation details
- Remove legacy flat docs/ (6 files): FEATURES.md (FR), TECHNICAL.md, TROUBLESHOOTING.md,
  AUDIT_GUIDE.md, tracking.md, filter-workflow.md — all superseded by guide/ rewrites
  or codebase distributed docs

- Add docs/guide/what-rtk-covers.md: replaces 12 command pages with one user-facing
  overview of 60+ commands by ecosystem, no rtk <cmd> syntax
- Enrich docs/guide/analytics/gain.md: absorb advanced workflows from AUDIT_GUIDE.md
  (CI integration, pandas analysis, cron snapshots)
- Adapt docs/guide/getting-started/quick-start.md: remove rtk <cmd> examples,
  explain hook transparency instead
- Update docs/README.md: single-tab contract, pointer to codebase for technical docs
- Update docs/guide/index.md: clean navigation matching final structure
- Add Mermaid diagrams to src/filters/README.md: build pipeline + filter lookup
  (preserves content from filter-workflow.md in its natural home)

Result: 9 files in docs/guide/ (was 39), zero legacy flat docs, zero duplicates.
Codebase distributed docs (ARCHITECTURE.md, CONTRIBUTING.md, src/*/README.md)
remain the source of truth for technical and contributor content.

Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
Structure:
- Move docs/README.md → .github/docs-pipeline-contract.md (interface
  contract is not user-facing content)
- Rewrite docs/guide/index.md as a proper landing page with RTK intro,
  flow diagram, and navigation (replaces empty nav stub)
- Move configuration.md → getting-started/configuration.md (sidebar order 4,
  after supported-agents per Adrien's suggestion)

Missing content:
- Add docs/guide/analytics/discover.md: rtk discover (missed savings analysis)
  and rtk session (adoption tracking across sessions)
- Add uninstall instructions to installation.md (rtk init -g --uninstall,
  cargo uninstall, brew uninstall)
- Add global flags section to what-rtk-covers.md (-u/--ultra-compact,
  -v/--verbose)
- Add rtk smart command to what-rtk-covers.md Files section

Agents:
- Update supported-agents.md: 10 agents (was 9)
- Add OpenClaw (TypeScript plugin, before_tool_call)
- Add Mistral Vibe (planned, issue rtk-ai#800)
- Fix GitHub Copilot: VS Code = transparent rewrite via PreToolUse,
  Copilot CLI = deny-with-suggestion (upstream limitation)

Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
fix(ls): filter quality wrong truncation
- Fix broken links: docs/TROUBLESHOOTING.md and docs/AUDIT_GUIDE.md were
  removed in previous commit; update nav header and Documentation section
- Condense Supported AI Tools: keep the summary table, replace 12 per-agent
  detail blocks with a single link to rtk-ai.app/guide/supported-agents
- Condense Configuration: keep essential snippet and tee recovery example,
  link to rtk-ai.app/guide/configuration for full reference
- Update Documentation section: lead with rtk-ai.app/guide as primary entry,
  keep INSTALL.md, ARCHITECTURE.md, CONTRIBUTING.md, SECURITY.md

Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
docs: consolidate to user-facing guide only (removes duplicates and legacy flat docs)
@mariuszs mariuszs changed the title feat(mvn): add dedicated Rust module for Maven test filtering feat(mvn): add Maven filter module — test, build, dependency:tree Apr 8, 2026
@mariuszs mariuszs force-pushed the feat/mvn-rust-module branch 2 times, most recently 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
@mariuszs mariuszs merged commit 58bf329 into master Apr 10, 2026
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.

4 participants