3.1 KiB
3.1 KiB
id, title, status, wave, depends_on, plan, requirements, acceptance_criteria, system_design
| id | title | status | wave | depends_on | plan | requirements | acceptance_criteria | system_design | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 02-progressive-overview-state | Add progressive overview state | done | 2 |
|
plan.md |
|
|
|
Task 02: Add Progressive Overview State
Summary
Make storage overview reads nonblocking. Add single-flight progress state, stale-while-revalidate snapshots, safe notifications, timing metadata, logs, and metrics.
In scope
- Add progressive source callbacks to
storageOverview. - Extend
OverviewCachewith nonblocking state reads and generation fencing. - Extend the storage response with snapshot, progress, and timing fields.
- Publish
system.storage.analysis.updatedwithout storage details. - Add gateway wiring and focused observability.
- Preserve manual Analyze run history and job behavior.
Out of scope
- Frontend rendering and polling.
- Persistent cache storage.
- Cleanup provider changes.
Acceptance
- A blocked cold provider cannot block the initial HTTP response.
- Expired and failed refreshes keep the last successful snapshot unchanged.
- Concurrent reads, Analyze, invalidation, and late progress obey one generation-fenced flight.
Verification
(cd apps/backend && go test -race ./internal/system/storage ./internal/backendapp ./internal/gateway/websocket)
Files likely touched
apps/backend/internal/system/storage/overview_cache.goapps/backend/internal/system/storage/overview_cache_test.goapps/backend/internal/system/storage/handler.goapps/backend/internal/system/storage/handler_test.goapps/backend/internal/system/storage/types.goapps/backend/internal/system/storage/operations.goapps/backend/internal/backendapp/storage_maintenance.goapps/backend/internal/backendapp/storage_maintenance_test.goapps/backend/internal/events/types.goapps/backend/internal/gateway/websocket/system_notifications.goapps/backend/pkg/websocket/actions.go
Dependencies
Task 01 supplies bounded progress callbacks.
Risks
- Manual Analyze can accidentally create a second scan or job.
- Publishing while the cache mutex is locked can deadlock event consumers.
- A late callback can replace current state without generation checks.
Parallelism
sequential
Inputs
storage-analysis-progress.mdsections "Analysis state", "Cache flow", and "Progress delivery".- ADR
2026-09-05-bounded-progressive-storage-analysis.
Results
Implemented the progressive cache/API contract, generation-fenced single-flight refreshes, WebSocket notifications, structured completion logging, and storage scan metrics. The exact race suite passed: 1,423 tests across storage, backendapp, and gateway/websocket.