Skip to content

Comments

feat(zeph-tools): add declarative TOML-based output filter engine#734

Merged
bug-ops merged 6 commits intomainfrom
feat/declarative-output-filters
Feb 21, 2026
Merged

feat(zeph-tools): add declarative TOML-based output filter engine#734
bug-ops merged 6 commits intomainfrom
feat/declarative-output-filters

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 21, 2026

Summary

  • Add hybrid declarative TOML-based output filter engine with 9 strategy types
  • Migrate all 6 hardcoded filters (cargo_build, test_output, clippy, git, dir_listing, log_dedup) into the declarative engine as named built-in strategies
  • Expand default-filters.toml from 10 to 19 rules covering cargo, git, docker, npm, pip, make, pytest, go, terraform, kubectl, brew, ls, journalctl
  • Simplify FilterConfig by removing 6 per-filter config structs (breaking change, pre-1.0)
  • Delete 6 obsolete filter modules, gate CommandMatcher::Custom to tests only
  • Security hardening: RegexBuilder size_limit, pattern cap, HashMap pre-allocation, NormalizeEntry validation

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --workspace -- -D warnings (0 warnings)
  • cargo nextest run --workspace --lib --bins (2284 passed)
  • Unit tests for all 9 strategies (success, fallback, edge cases)
  • Snapshot tests (cargo build, clippy, git status/diff, test summary)
  • Proptest fuzz (strip_noise, truncate, test_summary, dedup)
  • Integration tests (registry, custom TOML override, disabled rules)
  • Compile-time validation tests (regex limits, empty patterns, file size)
  • Compound command matching tests

Introduce a hybrid declarative filter system where generic strategies
(strip_noise, truncate) are configured via TOML rules and compiled at
startup. Hardcoded filters remain for complex logic; declarative rules
cover common CLI tools (docker, npm, pip, make, pytest, go, terraform,
kubectl, brew).

- DeclarativeFilter implementing OutputFilter trait with compiled regexes
- Embedded default-filters.toml with 10 pre-configured rules
- User override via filters_path in FilterConfig
- RegexBuilder with size_limit (1 MiB) and pattern length cap (512 chars)
- File size limit (1 MiB) on user-provided filters.toml
@github-actions github-actions bot added documentation Improvements or additions to documentation rust dependencies enhancement New feature or request size/XL labels Feb 21, 2026
…ngine

Unify the output filter system by migrating all 6 hardcoded filters
(cargo_build, test_output, clippy, git, dir_listing, log_dedup) into
the declarative TOML-based engine as named built-in strategy types.

Add 7 new strategies: keep_matching, strip_annotated, test_summary,
group_by_rule, git_status, git_diff, dedup. Expand default-filters.toml
from 10 to 19 rules. Simplify FilterConfig by removing 6 per-filter
config structs.

Security hardening: HashMap pre-allocation for dedup, NormalizeEntry
replacement validation, empty patterns rejection, slice index guards.

BREAKING: FilterConfig sub-structs (TestFilterConfig, GitFilterConfig,
etc.) removed — filter parameters now live in TOML strategy fields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core dependencies documentation Improvements or additions to documentation enhancement New feature or request rust size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant