Surface baseline maintenance status in the dashboard

Retention and per-field value capping already ran automatically every poll
cycle, but the dashboard showed only a single "DB size" line — no
visibility into what got deleted, which fields are hitting the
max-values-per-field cap, or whether disk space is reclaimable, without
SSHing in. baseline.py's maintenance() now also reports the specific
(stream, entity, field) rows it trimmed for exceeding the cap, surfaced in
a new Baseline Maintenance dashboard panel alongside size/reclaimable bytes
and rows deleted last cycle. Deliberately no live-vacuum button: VACUUM
needs the service stopped first, so the dashboard only shows when it's
worth doing and points at the existing offline CLI command.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
larssand
2026-09-24 16:35:09 +02:00
parent 36516faf9a
commit e61403d7f6
6 changed files with 79 additions and 3 deletions

View File

@@ -105,7 +105,18 @@ Goal: make findings more accurate before adding more integrations.
state (`BaselineStore.detector_readiness()`, mirroring the existing
per-field `profile_readiness()`) and a plain-language "what triggers
this" reference — all surfaced in a new Detector Health dashboard panel.
- [ ] Add baseline maintenance tooling in the dashboard for retention, high-cardinality fields, and database compaction status.
- [x] Add baseline maintenance tooling in the dashboard for retention,
high-cardinality fields, and database compaction status. Retention itself
already ran automatically every poll cycle; the gap was pure visibility —
the dashboard showed only a single "DB size" line, with no way to see
what got deleted, which fields are hitting the per-field value cap, or
whether disk space is reclaimable without SSHing in. New Baseline
Maintenance panel shows size/reclaimable bytes, retention settings, rows
deleted last cycle, and the specific `(stream, entity, field)` rows that
got trimmed for exceeding the max-values-per-field cap. No live-vacuum
button added deliberately — vacuum needs the service stopped first (the
existing How To guidance already says so), so the dashboard only surfaces
when it's worth doing and points at the offline CLI command.
- [x] Add observed-field profile recommendations so streams can get suggested entity, time, categorical, numeric, and detector settings.
- [x] Add optional Ollama profile advisor with validated JSON output for semantic field mapping.
- [x] Let the dashboard's Ollama analyst note reason about a small, bounded