Fix projection divergences from ADR 0002 #104

Open
opened 2026-10-03 02:42:52 +00:00 by xavierk · 0 comments
Owner

Problem

The projection diverges from ADR 0002, and its tests do not catch it:

  • Lifetime writes ignored. projection.py:648 computes max(E_baseline − regime_bytes, 0). ADR 0002 §2 specifies W_t, the lifetime written bytes. Remaining life is overstated on every drive with writes before the window. The implied formula at :642 has the same mistake.
  • Implied baseline unreachable. _resolve_baseline never returns BaselineTier.IMPLIED. _get_pu_increments_in_segment is never called. ADR 0002 §10's gate fact, "vendor wear estimate too coarse to imply endurance", never renders.
  • Horizon gate too strict. projection.py:389 fails Supported unless at least 2 horizons exist. ADR 0002 §8 judges agreement across existing horizons.
  • Vacuous tests. test_projected_formula, test_wearing_rate_proportional and test_headline_rate_from_regime guard their asserts with if headline is not None. Their fixtures never insert a complete local day, so nothing is asserted. test_projected_formula also encodes the regime_bytes mistake.

Acceptance criteria

  • Headline uses lifetime written bytes from the current controller segment's newest published sample, for verified, unverified and implied baselines.
  • Implied baseline selected after at least 2 Percentage Used increments in the current segment. Before that, the gate fact renders.
  • Horizon agreement judged across existing horizons; one horizon passes.
  • The three tests assert unconditionally, with fixtures that satisfy every gate. Implied-baseline gating (PR-10) gets a test through compute_projection.
  • Tests written first and seen failing.

Architecture review 2026-10-02.

## Problem The projection diverges from ADR 0002, and its tests do not catch it: - **Lifetime writes ignored.** `projection.py:648` computes `max(E_baseline − regime_bytes, 0)`. ADR 0002 §2 specifies `W_t`, the lifetime written bytes. Remaining life is overstated on every drive with writes before the window. The implied formula at `:642` has the same mistake. - **Implied baseline unreachable.** `_resolve_baseline` never returns `BaselineTier.IMPLIED`. `_get_pu_increments_in_segment` is never called. ADR 0002 §10's gate fact, "vendor wear estimate too coarse to imply endurance", never renders. - **Horizon gate too strict.** `projection.py:389` fails Supported unless at least 2 horizons exist. ADR 0002 §8 judges agreement across *existing* horizons. - **Vacuous tests.** `test_projected_formula`, `test_wearing_rate_proportional` and `test_headline_rate_from_regime` guard their asserts with `if headline is not None`. Their fixtures never insert a complete local day, so nothing is asserted. `test_projected_formula` also encodes the `regime_bytes` mistake. ## Acceptance criteria - [ ] Headline uses lifetime written bytes from the current controller segment's newest published sample, for verified, unverified and implied baselines. - [ ] Implied baseline selected after at least 2 Percentage Used increments in the current segment. Before that, the gate fact renders. - [ ] Horizon agreement judged across existing horizons; one horizon passes. - [ ] The three tests assert unconditionally, with fixtures that satisfy every gate. Implied-baseline gating (PR-10) gets a test through `compute_projection`. - [ ] Tests written first and seen failing. Architecture review 2026-10-02.
xavierk added the ready-for-agent label 2026-10-03 02:42:52 +00:00
xavierk added a new dependency 2026-10-03 02:43:10 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: xavierk/Fenris#104