Derive hour observations, day aggregates, and monitoring periods #22

Closed
opened 2026-08-31 18:24:26 +00:00 by xavierk · 0 comments
Owner

Parent

Implement the Fenris persistent TUI monitoring redesign

Canonical contracts: fenris-redesign spec · acceptance criteria — criterion IDs cited below live in the register.

What to build

Repeated collection runs across a fixture timeline accumulate real habit history in the observation store. Each hour classifies by the named constants — powered-off when the hour's power-on-hours delta is below 90 % of its wall-clock span, active at ≥ 256 MiB written, idle when powered on and sampled below that, unknown otherwise — with the four splits summing to exactly 3600 s. UTC-bounded day aggregates derive monotonically from hour rows (no 23- or 25-hour days ever exist). Coverage — the known share of wall-clock seconds inside monitoring periods — is computed and carried on the rows. Raw samples prune opportunistically to 14 days. Monitoring periods behave: a collection run finding no open period opens one at the run moment, never backdated; wall-clock outside periods is excluded from numerator and denominator; unexplained gaps inside a period keep the aggregate counter delta, remain unknown seconds, and reduce coverage. No absent hour is ever interpolated, estimated, or fabricated.

Acceptance criteria

  • Hour classification uses exactly the named constants and decision order; disabled time is never an hour state (PR-4)
  • The denominator is wall-clock seconds inside monitoring periods including powered-off and unknown time; disabled periods excluded from numerator and denominator (PR-5)
  • Hours and days are UTC-bounded; day derivation from hours is monotonic; no 23/25-hour days (ST-4)
  • Raw samples pruned to 14 days; hour observations and day aggregates retained indefinitely (ST-5)
  • No absent hour is ever interpolated, estimated, or fabricated; gaps stay unknown seconds and reduce coverage (FL-3)
  • A run finding no open monitoring period opens one at the run moment, never backdated (FL-8)

Blocked by

## Parent [Implement the Fenris persistent TUI monitoring redesign](https://git.bongbetic.com/xavierk/Fenris/issues/20) Canonical contracts: [fenris-redesign spec](https://git.bongbetic.com/xavierk/Fenris/src/branch/main/docs/spec/fenris-redesign.md) · [acceptance criteria](https://git.bongbetic.com/xavierk/Fenris/src/branch/main/docs/spec/acceptance-criteria.md) — criterion IDs cited below live in the register. ## What to build Repeated collection runs across a fixture timeline accumulate real habit history in the observation store. Each hour classifies by the named constants — powered-off when the hour's power-on-hours delta is below 90 % of its wall-clock span, active at ≥ 256 MiB written, idle when powered on and sampled below that, unknown otherwise — with the four splits summing to exactly 3600 s. UTC-bounded day aggregates derive monotonically from hour rows (no 23- or 25-hour days ever exist). Coverage — the known share of wall-clock seconds inside monitoring periods — is computed and carried on the rows. Raw samples prune opportunistically to 14 days. Monitoring periods behave: a collection run finding no open period opens one at the run moment, never backdated; wall-clock outside periods is excluded from numerator and denominator; unexplained gaps inside a period keep the aggregate counter delta, remain unknown seconds, and reduce coverage. No absent hour is ever interpolated, estimated, or fabricated. ## Acceptance criteria - [x] Hour classification uses exactly the named constants and decision order; disabled time is never an hour state (PR-4) - [x] The denominator is wall-clock seconds inside monitoring periods including powered-off and unknown time; disabled periods excluded from numerator and denominator (PR-5) - [x] Hours and days are UTC-bounded; day derivation from hours is monotonic; no 23/25-hour days (ST-4) - [x] Raw samples pruned to 14 days; hour observations and day aggregates retained indefinitely (ST-5) - [x] No absent hour is ever interpolated, estimated, or fabricated; gaps stay unknown seconds and reduce coverage (FL-3) - [x] A run finding no open monitoring period opens one at the run moment, never backdated (FL-8) ## Blocked by - [Collector tracer bullet: one collection run from fixtures to the observation store](https://git.bongbetic.com/xavierk/Fenris/issues/21)
xavierk added the ready-for-agent label 2026-08-31 18:25:12 +00:00
xavierk added this to the Build: Fenris persistent TUI monitoring redesign milestone 2026-08-31 18:25:14 +00:00
xavierk added a new dependency 2026-08-31 18:25:41 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: xavierk/Fenris#22