Skip to content

feat: composable FilterPipeline for chained output filters #441

@bug-ops

Description

@bug-ops

Parent

Epic #426, Plan: .local/plan/m26.1-output-filtering-improvements.md
Priority: P1 (before Phase 2)

Problem

Current "first matching filter wins" logic cannot combine ANSI stripping + test filtering + deduplication. Multi-command pipelines have undefined behavior.

Design

pub struct FilterPipeline {
    stages: Vec<Box<dyn OutputFilter>>,
}

Registry builds pipelines instead of applying single filter. Hard-coded order: ANSI -> content-specific -> deduplication. Confidence aggregation: Fallback > Partial > Full.

Acceptance Criteria

  • FilterPipeline struct with add_stage() and run()
  • Registry builds pipelines instead of single filter
  • ANSI filter always runs first
  • Unit tests: empty, single, multi-stage pipelines
  • Integration test: ANSI + test filter composition
  • Confidence aggregation logic

Metadata

Metadata

Assignees

No one assigned

    Labels

    toolsTool execution and MCP integration

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions