Skip to content

feat: move filter metrics from Phase 3 to Phase 1 #442

@bug-ops

Description

@bug-ops

Parent

Epic #426, Original issue #434, Plan: .local/plan/m26.1-output-filtering-improvements.md
Priority: P0 (development feedback)

Problem

No data during Phase 1-2 filter development. Cannot validate claimed 60-90% token savings or detect regressions until Phase 3.

Design

Phase 1 (P0): basic in-memory metrics with periodic logging.

pub struct FilterMetrics {
    pub total_commands: usize,
    pub filtered_commands: usize,
    pub raw_chars_total: usize,
    pub filtered_chars_total: usize,
    pub confidence_distribution: HashMap<FilterConfidence, usize>,
}
  • Store in registry as Arc<Mutex<FilterMetrics>>
  • Record in apply() after each filter result
  • Log every 100 commands
  • CLI /metrics command displays stats

Dependencies

Acceptance Criteria

  • FilterMetrics struct with record() and savings_percent()
  • Registry stores and records metrics
  • Periodic log every 100 commands
  • Unit tests for metrics recording
  • Integration test: verify metrics after filtering 10 commands

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