feat(cli): show last anomaly in status (#91) - #101
Merged
rbmuller merged 1 commit intoSep 28, 2026
Merged
Conversation
status() fetches the latest anomaly per table with one window-function query and renders it as a Last Anomaly column (text) and last_anomaly record (JSON).
Owner
|
Tested it end to end against On the 8 failures you mentioned: they don't reproduce here — One small follow-up I'll track separately: in the text table, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #91.
What changed: ProfileStore gains get_latest_anomaly_per_table(), one window-function query returning the latest anomaly per table (highest detected_at, id tie-break, no 30-day window). status() calls it once and attaches last_anomaly ({type, severity, detected_at} or null) to each record. Text output gains a Last Anomaly column ( · , e.g. volume_drop · 2h ago, empty when none); JSON keeps all existing keys. _table_health, persistence, schemas, and connectors untouched.
Tests: pytest tests/test_store.py tests/test_cli.py — 41 passed. Full pytest — 457 passed; 8 failures in test_demo/test_duckdb/test_mcp_server are pre-existing on clean main (verified via stash: identical 8 fail without this change; duckdb/MCP environment issues). ruff check src/ tests/ — all checks passed.