Display filter for diff severity #2

Closed
opened 2026-08-16 16:05:37 +00:00 by bjoern · 0 comments
Owner

Hide diffs below a configurable severity threshold in the terminal / TUI output

Goal

The comparison output (aptester run diff section, aptester compare,
aptester report, and the TUI Compare screen) always shows all detected
diffs, including low-signal info findings (e.g. metric drift, build hash
changes). Users want to hide findings below a threshold in the display,
independent of the notification threshold (severity.min_notification_severity,
which only filters ntfy/webhook messages).

This plan adds a display-only severity threshold that filters which diffs
are rendered, while keeping the full diff list in the stored JSON result file.

Scope decisions (confirmed)

  • New config key: reporting.min_display_severity (default null = show all).
  • Applies to every diff rendering path:
    • run diff table (runner.pyprint_diffs)
    • aptester compare and aptester report (CLI)
    • TUI Compare screen
  • The result file (run.diffs) is never filtered; only the rendering.
  • When diffs exist but all are below the threshold, print a short dim note
    explaining that changes were suppressed, instead of "No changes detected."
  • Shared severity-filter helper lives in severity.py and is reused by
    notifier.py, reporter.py, and tui.py (removes duplicated rank logic).

Steps

  • Add reporting.min_display_severity to ReportingConfig.
  • Add severity.filter_diffs_by_severity() shared helper.
  • Apply filter in print_diffs() (+ suppressed-note message).
  • Reuse helper in notifier.py.
  • Wire filter into runner.py, cli.py (compare/report), tui.py Compare screen.
  • Document in config/default.sample.yaml, config/default.yaml, docs/04-severity-guide.md.
  • Update CHANGELOG.md.
  • Add tests (reporter filtering, config parsing).
  • Verify with ruff, mypy, pytest.
# Hide diffs below a configurable severity threshold in the terminal / TUI output ## Goal The comparison output (`aptester run` diff section, `aptester compare`, `aptester report`, and the TUI Compare screen) always shows **all** detected diffs, including low-signal `info` findings (e.g. metric drift, build hash changes). Users want to hide findings below a threshold in the *display*, independent of the notification threshold (`severity.min_notification_severity`, which only filters ntfy/webhook messages). This plan adds a **display-only** severity threshold that filters which diffs are rendered, while keeping the full diff list in the stored JSON result file. ## Scope decisions (confirmed) - New config key: `reporting.min_display_severity` (default `null` = show all). - Applies to every diff rendering path: - `run` diff table (`runner.py` → `print_diffs`) - `aptester compare` and `aptester report` (CLI) - TUI Compare screen - The result file (`run.diffs`) is **never** filtered; only the rendering. - When diffs exist but all are below the threshold, print a short dim note explaining that changes were suppressed, instead of "No changes detected." - Shared severity-filter helper lives in `severity.py` and is reused by `notifier.py`, `reporter.py`, and `tui.py` (removes duplicated rank logic). ## Steps - [x] Add `reporting.min_display_severity` to `ReportingConfig`. - [x] Add `severity.filter_diffs_by_severity()` shared helper. - [x] Apply filter in `print_diffs()` (+ suppressed-note message). - [x] Reuse helper in `notifier.py`. - [x] Wire filter into `runner.py`, `cli.py` (compare/report), `tui.py` Compare screen. - [x] Document in `config/default.sample.yaml`, `config/default.yaml`, `docs/04-severity-guide.md`. - [x] Update `CHANGELOG.md`. - [x] Add tests (reporter filtering, config parsing). - [x] Verify with `ruff`, `mypy`, `pytest`.
bjoern self-assigned this 2026-08-16 16:05:37 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Depends on
#1 Severity levels for run comparisons
bjoern/bizzfed-activitypub-tester
Reference
bjoern/bizzfed-activitypub-tester#2
No description provided.