The interface was about to restore the lie: null confidence rendered as 0%

The backend already refuses to state a probability it cannot certify. The card
did not. `gradeAdapter.js:59` read

    input.confidence != null ? Math.round(Number(input.confidence)) : 0

and `GradeResultCard` printed `{d.confidence}% confidence` unconditionally, so
an UNCERTIFIED Read — which by contract carries no exact probability — would
have rendered "0% CONFIDENCE" to a user. That is `Number(null) === 0`, the
standing fabrication bug in this codebase, arriving at the last surface before
the eye.

Found by running two REAL production rows (model_snapshots 453021 and 453033
from proven cohort 27ce152f) through the real serving seam and the real adapter,
before rendering anything.

Repaired at the two places it lives, presentation only:
  - the adapter carries null through instead of coercing;
  - the card renders "Confidence unavailable" as TEXT when there is no number.

Wording follows the house pattern already in `readHistory.js` ("History
unavailable") — no dash, no dimmed zero, no icon-only state, and no engineering
language: a test forbids isotonic / artifact / probability_contract /
UNCERTIFIED / certification_version reaching the card.

A second, narrower correction: the derived-field withdrawal was
`if (f in out) out[f] = null`, so it depended on whether the input happened to
carry the key and a field added by a later merge would have arrived
un-withdrawn. An uncertified row now DECLARES each probability-derived claim
null rather than merely lacking it.

The uncertified fixture is the strong case, not a convenient one: Luis Robert
carries value:true and ev_pct 38.5 on the raw row, so the contract has a live
VALUE badge to withdraw rather than an absent one to leave absent. Verified
withdrawn, while grade B+, the side, the Read and the market (book -160,
fair -135) all survive.

The certified case moves the number materially and visibly: raw 0.798 -> served
0.638, and EV is recomputed from the served probability, not carried from raw.

PriceTriplet needed no change — it already renders an absent leg as a dash and
was documented never to print a zero.

Suite 407/407, 5,691 passed. Teeth 45/45 + 10/10 + 23/23. Live OFF.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQJeAG8vcDoL5zkiaJyVb8
This commit is contained in:
Kev
2026-09-04 17:13:17 -04:00
parent 84f1fc075c
commit 355615d27e
6 changed files with 181 additions and 7 deletions
File diff suppressed because one or more lines are too long