Publish consistent measured drive activity (#89)

Repair the collection-to-display path so each successful acquisition
publishes correct read/write deltas through the observation store and
visible dashboard.

Fixes:
- derive.py: accumulate bytes_read_delta on same-hour hour_observation
  merge (was silently dropped)
- collector.py: rebuild day_aggregates from hour observations after
  each collection run (previously only populated for cross-hour intervals)
- day_aggregate.py: add persist_day_aggregate upsert helper
- tui.py: query and display both read and write deltas in daily and
  hourly readouts, constrained summaries, and graph data queries

Tests:
- Add 14 integration tests (test_measured_activity.py) exercising the
  full collector→store→reader→display path with real fixtures and
  injected time
- Update constrained-layout assertion to match new W/R format

Closes #89
This commit is contained in:
xavierk
2026-09-17 17:43:31 +05:30
parent 54cd56e4ec
commit 366c2f55b7
6 changed files with 693 additions and 49 deletions
+1 -1
View File
@@ -1179,7 +1179,7 @@ class TestConstrainedLayout:
summary_text = str(summary.render())
assert "Graph needs ≥80×24" in summary_text
assert "days" in summary_text
assert "GB total" in summary_text
assert "GB" in summary_text
@pytest.mark.asyncio
async def test_constrained_below_24_height(self, tmp_path):