Project from the sustained regime: habit change, scenario range, and evidence gates #26
Notifications
Due Date
No due date set.
Reference: xavierk/Fenris#26
Reference in New Issue
Block a user
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
Regime dynamics on top of the projection core. The headline rate comes from the most recent sustained regime — the full observation history capped at 90 days by default. A habit change is declared when the trailing 7-day mean stays ≥ 2× (or ≤ 0.5×) the preceding 28-day mean for 3 consecutive days; the new regime starts at the first divergence day, is adopted automatically, and renders labeled "usage habit changed N days ago"; a regime younger than 7 days caps confidence at Limited. The 7-, 28-, and 90-day scenario-range rates compute independently of the regime, showing only horizons the history actually covers — no placeholders. Warming up renders as facts until 14 distinct UTC day aggregates of which at most 2 fall below 50 % coverage, with the projection still rendering while warming. A newest day aggregate older than 48 hours drops confidence one level as a shown fact. Segment breaks behave per the axes: a DUW decrease re-warms without quarantining; an identity change quarantines prior history entirely. A degraded current segment caps confidence at Limited with the fixed contributing fact in every state, combining idempotently with the staleness drop; ephemeral markers never render as confidence facts.
Acceptance criteria
Blocked by
Resolved in commit
b99ebfe.Changes
Bug fixes in
Warming gate (PR-6): Fixed to check instead of just . The old check was too strict — it required 14 days with ≥50% coverage, but the spec only requires 14 total days with at most 2 below 50%.
Habit change detection (PR-3): Rewrote to correctly scan backwards checking the ratio at each day position and count consecutive days going backwards. The old algorithm's inner loop checked wrong window positions.
Horizon rate coverage (PR-2): Fixed to require the history to span the full horizon (earliest day ≤ cutoff). Previously showed placeholder rates for 28/90-day horizons even with only 10 days of history.
New tests (29 tests added)
139 total tests passing, zero regressions.