Skip to content

feat(tui): add compaction probe metrics to TUI dashboard (#2049)#2055

Merged
bug-ops merged 2 commits intomainfrom
feat-2049-probe-metrics
Mar 20, 2026
Merged

feat(tui): add compaction probe metrics to TUI dashboard (#2049)#2055
bug-ops merged 2 commits intomainfrom
feat-2049-probe-metrics

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 20, 2026

Summary

Display compaction probe validation statistics in the TUI memory panel for post-compression context integrity monitoring.

Features:

  • Probe pass rate, soft/hard failure rates, error count (rate distribution line)
  • Last probe verdict (Pass/SoftFail/HardFail/Error) with score (color-coded line)
  • Conditional rendering in memory panel (hidden when no probes run)
  • Color-coded verdict: Green (Pass), Yellow (SoftFail), Red (HardFail), Gray (Error)

Changes

Core

  • zeph-memory: Add ProbeVerdict::Error variant (metrics-only, not used by probe logic)
  • zeph-core/metrics.rs: Add last_probe_verdict: Option<ProbeVerdict> and last_probe_score: Option<f32> fields
  • zeph-core/summarization.rs: Update 4 update_metrics() calls to set new fields; handle Error variant

TUI

  • zeph-tui/widgets/memory.rs: Render probe stats in two-line layout with color-coding and abbreviations (P/S/H/E)
  • Add 3 snapshot tests (Pass, SoftFail/HardFail, Error verdicts; zero-probes edge case)

Design Decisions

Per approved architecture (issue #2049 design review):

  1. Flat fields on MetricsSnapshot (not substruct) — consistent with existing metrics pattern
  2. Render in Memory panel — semantically belongs with memory compaction metrics
  3. Two-line conditional display — fits narrow TUI side panel
  4. Color-coded enum with exhaustive match — compile-time safety vs. string-based matching
  5. Error verdict clears score (Option<f32> = None) — prevents stale/misleading data

Validation

  • ✅ Architect: approved (design v2 addressing critic feedback)
  • ✅ Critic: approved (3 important issues resolved)
  • ✅ Developer: all tests pass (6065/6065), clippy clean, fmt check pass
  • ✅ Tester: test coverage complete (all 9 AC verified)
  • ✅ Perf: +16 bytes to MetricsSnapshot, negligible impact
  • ✅ Security: low risk, no information disclosure
  • ✅ Impl-critic: code quality clean, 1 important finding addressed (debug_assert canary)
  • ✅ Reviewer: approved for merge after debug_assert fix applied

Closes #2049

Display compaction probe validation statistics in the TUI memory panel:
- Probe pass rate, soft/hard failure rates, error count
- Last probe verdict (Pass/SoftFail/HardFail/Error) with score
- Color-coded verdict rendering (Green/Yellow/Red/Gray)

Adds ProbeVerdict enum variant for Error verdicts (metrics-only, not used by probe logic).
Updates MetricsSnapshot with last_probe_verdict and last_probe_score fields.
Implements conditional rendering in memory panel (hidden when no probes run).

All 9 acceptance criteria verified by architect, critic, developer, tester, perf engineer, security engineer, impl-critic, and reviewer.
@github-actions github-actions bot added documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes core zeph-core crate enhancement New feature or request size/M Medium PR (51-200 lines) labels Mar 20, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 20, 2026 15:45
@bug-ops bug-ops merged commit 15b3f07 into main Mar 20, 2026
25 checks passed
@bug-ops bug-ops deleted the feat-2049-probe-metrics branch March 20, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation enhancement New feature or request memory zeph-memory crate (SQLite) rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(tui): add compaction probe metrics to TUI dashboard

1 participant