Compute the projection core: baseline precedence, provenance, and the confidence rule table #25

Closed
opened 2026-08-31 18:24:30 +00:00 by xavierk · 1 comment
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

The read path's core as a pure function: a synthetic observation store plus an injected clock produce the complete projection contract — confidence state, contributing facts, headline remaining time when one exists, the scenario-range slot, the Percentage-Used context line, and the disclosure text — recomputed on read, never stored. The endurance baseline is chosen by precedence (verified override → unverified override → implied → unavailable) with full provenance and validation semantics: mandatory provenance fields (URL, revision, entry date, model, nominal capacity); one active row replaced on edit; verification derived at read — machine match or recorded attestation, never a stored boolean; the acknowledged unverified tier for incomplete provenance; entry-time validation rules (normalized model containment with interactive confirm recorded as validated_by = user, capacity within ± 1 %); read-time applicability as a model match against the current controller segment, a mismatch retained — never auto-deleted — leaving the projection Unavailable. Arithmetic is exactly the fixed formulas (rated TBW × 10¹²; implied only for 1 ≤ p ≤ 254; max(E − W, 0) / rate); the implied tier is eligible only after ≥ 2 Percentage-Used increments in the current segment; Percentage Used renders as a vendor-wear context line with a note when it disagrees with the observed write rate by more than a factor of 2 — never a second projection. The confidence rule table holds verbatim; zero rate renders the fixed phrase; confidence is state plus facts, never a percentage.

Acceptance criteria

  • Exactly one projection from the precedence-chosen baseline; Percentage Used is context only with the >2× disagreement note; no regression or capacity-synthesis anywhere (PR-1)
  • Confidence rule table holds verbatim — Unavailable / Supported / Limited with all Supported conjuncts; state plus contributing facts, never a percentage (PR-8)
  • Implied baseline eligible only after ≥ 2 Percentage-Used increments in the current segment, else Unavailable with the fixed phrase (PR-10)
  • Zero rate renders "no finite projection from this history"; the scenario range is the only spread; no statistical interval anywhere (PR-11)
  • The contract hands over exactly: state, facts, headline when one exists, scenario range, wear context line, disclosure text — recomputed on read, never stored (PR-12)
  • Baseline provenance and validation per the register: mandatory fields, derived verification, unverified tier behind explicit acknowledgment, entry-time sysfs validation (containment, ± 1 %, validated_by), read-time applicability with mismatch retained (PR-13)
  • Arithmetic is exactly E_rated = entered_TBW × 10¹², E_implied = 100 · W_t / p for 1 ≤ p ≤ 254 only, projected = max(E_baseline − W_t, 0) / rate (PR-17)

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 The read path's core as a pure function: a synthetic observation store plus an injected clock produce the complete projection contract — confidence state, contributing facts, headline remaining time when one exists, the scenario-range slot, the Percentage-Used context line, and the disclosure text — recomputed on read, never stored. The endurance baseline is chosen by precedence (verified override → unverified override → implied → unavailable) with full provenance and validation semantics: mandatory provenance fields (URL, revision, entry date, model, nominal capacity); one active row replaced on edit; verification derived at read — machine match or recorded attestation, never a stored boolean; the acknowledged unverified tier for incomplete provenance; entry-time validation rules (normalized model containment with interactive confirm recorded as `validated_by = user`, capacity within ± 1 %); read-time applicability as a model match against the current controller segment, a mismatch retained — never auto-deleted — leaving the projection Unavailable. Arithmetic is exactly the fixed formulas (rated TBW × 10¹²; implied only for 1 ≤ p ≤ 254; `max(E − W, 0) / rate`); the implied tier is eligible only after ≥ 2 Percentage-Used increments in the current segment; Percentage Used renders as a vendor-wear context line with a note when it disagrees with the observed write rate by more than a factor of 2 — never a second projection. The confidence rule table holds verbatim; zero rate renders the fixed phrase; confidence is state plus facts, never a percentage. ## Acceptance criteria - [ ] Exactly one projection from the precedence-chosen baseline; Percentage Used is context only with the >2× disagreement note; no regression or capacity-synthesis anywhere (PR-1) - [ ] Confidence rule table holds verbatim — Unavailable / Supported / Limited with all Supported conjuncts; state plus contributing facts, never a percentage (PR-8) - [ ] Implied baseline eligible only after ≥ 2 Percentage-Used increments in the current segment, else Unavailable with the fixed phrase (PR-10) - [ ] Zero rate renders "no finite projection from this history"; the scenario range is the only spread; no statistical interval anywhere (PR-11) - [ ] The contract hands over exactly: state, facts, headline when one exists, scenario range, wear context line, disclosure text — recomputed on read, never stored (PR-12) - [ ] Baseline provenance and validation per the register: mandatory fields, derived verification, unverified tier behind explicit acknowledgment, entry-time sysfs validation (containment, ± 1 %, `validated_by`), read-time applicability with mismatch retained (PR-13) - [ ] Arithmetic is exactly `E_rated = entered_TBW × 10¹²`, `E_implied = 100 · W_t / p` for 1 ≤ p ≤ 254 only, `projected = max(E_baseline − W_t, 0) / rate` (PR-17) ## Blocked by - [Derive hour observations, day aggregates, and monitoring periods](https://git.bongbetic.com/xavierk/Fenris/issues/22) - [Segment observation history by controller identity](https://git.bongbetic.com/xavierk/Fenris/issues/23)
xavierk added the ready-for-agent label 2026-08-31 18:25:19 +00:00
xavierk added this to the Build: Fenris persistent TUI monitoring redesign milestone 2026-08-31 18:25:21 +00:00
xavierk added a new dependency 2026-08-31 18:25:43 +00:00
xavierk self-assigned this 2026-09-01 17:45:05 +00:00
Author
Owner

Implemented: projection core pure function\n\n### What was built\n — the read-path core as a pure function per spec §6.\n\nEntry point: \n\nRecomputes the complete projection contract on every read, never stores anything derived. Takes a read-only observation store connection and an injected clock.\n\n### Coverage by acceptance criterion\n\n| Criterion | Status | Notes |\n|-----------|--------|-------|\n| PR-1 | ✅ | Exactly one projection from precedence-chosen baseline; PU is context only |\n| PR-8 | ✅ | Confidence rule table holds verbatim: Unavailable/Supported/Limited with all conjuncts; state + facts, never percentage |\n| PR-10 | ✅ | Implied baseline eligible only after ≥2 PU increments in current segment |\n| PR-11 | ✅ | Zero rate renders "no finite projection from this history"; scenario range is only spread |\n| PR-12 | ✅ | Contract hands over: state, facts, headline, scenario range, PU context line, disclosure text |\n| PR-13 | ✅ | Baseline provenance/validated per register: mandatory fields, derived verification, model mismatch retained not deleted |\n| PR-17 | ✅ | Arithmetic exactly: E_rated = TBW × 10¹², E_implied = 100·W/p (1≤p≤254), projected = max(E−W,0)/rate |\n\n### Supporting tests\n — 19 tests covering baseline precedence, confidence rule table, implied baseline gate, zero rate phrase, contract handoff, provenance model mismatch, and arithmetic correctness.\n\nAll 110 tests pass (19 new + 91 existing, zero regressions).

## Implemented: projection core pure function\n\n### What was built\n — the read-path core as a pure function per spec §6.\n\n**Entry point:** \n\nRecomputes the complete projection contract on every read, never stores anything derived. Takes a read-only observation store connection and an injected clock.\n\n### Coverage by acceptance criterion\n\n| Criterion | Status | Notes |\n|-----------|--------|-------|\n| PR-1 | ✅ | Exactly one projection from precedence-chosen baseline; PU is context only |\n| PR-8 | ✅ | Confidence rule table holds verbatim: Unavailable/Supported/Limited with all conjuncts; state + facts, never percentage |\n| PR-10 | ✅ | Implied baseline eligible only after ≥2 PU increments in current segment |\n| PR-11 | ✅ | Zero rate renders "no finite projection from this history"; scenario range is only spread |\n| PR-12 | ✅ | Contract hands over: state, facts, headline, scenario range, PU context line, disclosure text |\n| PR-13 | ✅ | Baseline provenance/validated per register: mandatory fields, derived verification, model mismatch retained not deleted |\n| PR-17 | ✅ | Arithmetic exactly: E_rated = TBW × 10¹², E_implied = 100·W/p (1≤p≤254), projected = max(E−W,0)/rate |\n\n### Supporting tests\n — 19 tests covering baseline precedence, confidence rule table, implied baseline gate, zero rate phrase, contract handoff, provenance model mismatch, and arithmetic correctness.\n\nAll 110 tests pass (19 new + 91 existing, zero regressions).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: xavierk/Fenris#25