Compute the projection core: baseline precedence, provenance, and the confidence rule table #25
Notifications
Due Date
No due date set.
Blocks
Depends on
#23 Segment observation history by controller identity
xavierk/Fenris
Reference: xavierk/Fenris#25
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
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
validated_by), read-time applicability with mismatch retained (PR-13)E_rated = entered_TBW × 10¹²,E_implied = 100 · W_t / pfor 1 ≤ p ≤ 254 only,projected = max(E_baseline − W_t, 0) / rate(PR-17)Blocked by
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).