feat(CORE-001D3B): surface alert history degraded state

This commit is contained in:
Bu5hm4nn
2026-03-26 15:12:04 +01:00
parent 09e03f96a8
commit ff76e326b1
8 changed files with 138 additions and 15 deletions

View File

@@ -25,6 +25,7 @@ priority_queue:
- OPS-001
- BT-003
recently_completed:
- CORE-001D3B
- CORE-001D3A
- UX-001
- CORE-002
@@ -66,6 +67,7 @@ states:
- CORE-001D2A
- CORE-001D2B
- CORE-001D3A
- CORE-001D3B
- CORE-002
- CORE-002A
- CORE-002B

View File

@@ -18,6 +18,7 @@ technical_notes:
- `CORE-001D2A` is complete: DataService quote/provider cache normalization is now a named boundary adapter with explicit symbol mismatch rejection and GLD quote-unit repair.
- `CORE-001D2B` is complete: option expirations and options-chain payloads now use explicit normalization boundaries with malformed cached payload discard/retry behavior.
- `CORE-001D3A` is complete: alert evaluation and settings save-status entrypoints now normalize float-heavy boundary values through explicit named adapters.
- `CORE-001D3B` is complete: corrupt alert-history storage now surfaces as an explicit degraded state with logging and route-visible notices instead of silently appearing as empty history.
- Remaining focus is the rest of `CORE-001D2` provider/cache normalization plus follow-on `CORE-001D3` service entrypoint tightening.
- Pre-launch policy: unit-aware schema changes may be breaking until persistence is considered live; old flat payloads may fail loudly instead of being migrated.
- See `docs/CORE-001D_BOUNDARY_CLEANUP_PLAN.md` for the current hotspot inventory and proposed sub-slices.

View File

@@ -0,0 +1,19 @@
id: CORE-001D3B
title: Alert History Degraded State Handling
status: done
priority: P2
effort: S
depends_on:
- CORE-001D3A
tags:
- core
- alerts
- persistence
- ux
summary: Corrupt or unreadable alert-history storage now surfaces as an explicit degraded state instead of silently appearing as empty history.
completed_notes:
- Added `AlertHistoryLoadError` in `app/models/alerts.py` so corrupt or unreadable alert-history storage is an explicit failure mode.
- `AlertService.evaluate(...)` now logs history load failures and returns `history_unavailable` / `history_notice` metadata instead of silently treating corruption as an empty history list.
- `/overview` and `/{workspace_id}/settings` now render a visible degraded-history notice when alert history storage is unavailable.
- Added focused regression coverage in `tests/test_alerts.py` for corrupt-history load failures in both persisted and preview paths.
- Validated with focused pytest coverage, local Docker, and browser-driven checks on overview and settings with an intentionally corrupted `/app/data/alert_history.json`.