Total grade cutover + the ceiling stated as a position
PHASE 0 caught my own repeat of the failure I diagnosed one order ago.
91927a4 attached `served_grade` BESIDE the old letter and left `grade`
alone -- so the honest grade reached nobody, exactly as gradeBands had
been built-correct-and-unread. grep showed served_grade appearing in one
file (where I set it) and all 14+ consumers -- scan route, dashboard,
parlay, newsletter, desk, content templates, retention -- still reading
`.grade`, i.e. still the dishonest letter.
CUTOVER IS NOW TOTAL: legacy.grade IS the honest letter. Overwriting the
one field every consumer already reads cuts every surface over at once
instead of editing fourteen call sites and missing one. engine1's index is
preserved as `engine_grade` and verified read by ZERO serving code.
Confidence follows the letter: it came from a grade-band midpoint of the
OLD letter, so leaving it would have paired a served B+ with a C's
confidence. Both now derive from p_win, kept on the existing 0-100 scale.
MEASURED BLAST RADIUS before shipping: 303 of 47,991 non-refused
snapshots (0.6%) have a grade but no p_win, and now render NO READ instead
of a letter. That is correct -- their old letter came from the retired
index carrying 0.48% resolution, i.e. noise -- and NO READ is a rendered
state with a reason, so never-blank holds.
PHASE 1 — the ceiling is now a STATED POSITION, not a confusing absence.
servedGrade.SCALE_LEGEND plus web GradeScaleLegend.tsx say it plainly: we
do not issue A grades, no band has hit at a rate that would justify one,
our honest ceiling is a strong B+ (~66% realized vs ~60% baseline), and if
the model earns an A the legend changes and we say why. The
separates_from_base_rate flag renders per band -- C+/C/C- are labelled
"we cannot separate this from the baseline", which is most of any slate.
PHASE 3 hand-verified across every state: B+ with 3 factors (basis
forecast_plus_matchup_factors), B+ with none (forecast_only), C flagged
not-separable, F, and three refusal states rendering NO READ with reasons.
never-blank PASS, no-manufactured-A PASS.
Test fallout was real and is documented rather than papered over: engine
BEHAVIOUR assertions moved to engine_grade, suppression assertions stayed
on grade (a suppressed prop has no letter either way), and the confidence
78 -> 95 change is the grade-band midpoint being replaced by p_win.
No A-threshold loosening. No calibrated number leaks (deployed set empty).
p_win never mutated. Ten frozen modules verified unchanged including
engine1 and probabilityEstimator. No Bonferroni slot.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W1sivYNqY2TS5ftykmHBU9
This commit is contained in:
@@ -586,13 +586,37 @@ async function analyzeViaEngine1(rawProp = {}) {
|
||||
// what a user should see.
|
||||
try {
|
||||
const sg = require('../model/servedGrade');
|
||||
legacy.engine_grade = legacy.grade;
|
||||
legacy.served_grade = sg.gradeFor({
|
||||
const served = sg.gradeFor({
|
||||
p_win: legacy.p_win,
|
||||
refused: legacy.refused || legacy.insufficient_data,
|
||||
refusal_reason: legacy.refusal_reason,
|
||||
factor_adjustment: factorTrace,
|
||||
});
|
||||
legacy.served_grade = served;
|
||||
|
||||
// ── TOTAL CUTOVER, NOT A PARALLEL GRADE ────────────────────────────
|
||||
// `legacy.grade` IS the honest letter now. Attaching served_grade beside
|
||||
// the old one and leaving `grade` alone would have repeated the exact
|
||||
// failure diagnosed for gradeBands: built, correct, and read by nobody.
|
||||
// Fourteen-plus consumers (scan route, dashboard, parlay, newsletter,
|
||||
// desk, content templates, retention) all read `.grade`, so overwriting
|
||||
// it here cuts every surface over at once instead of editing each.
|
||||
//
|
||||
// The original index is preserved as `engine_grade` for comparison and is
|
||||
// read by no serving code.
|
||||
legacy.engine_grade = legacy.grade;
|
||||
if (served.letter) {
|
||||
legacy.grade = served.letter;
|
||||
// Confidence must not contradict the letter. It previously came from a
|
||||
// grade-band midpoint of the OLD letter, so leaving it would have paired
|
||||
// a B+ with a C's confidence. Both now derive from p_win -- kept on the
|
||||
// existing 0-100 scale, since every consumer and every stored row uses it.
|
||||
legacy.confidence = Math.round(legacy.p_win * 100);
|
||||
legacy.confidence_basis = 'p_win';
|
||||
} else {
|
||||
// A refusal has no letter, and consumers test `!grade` for exactly that.
|
||||
legacy.grade = null;
|
||||
}
|
||||
} catch { /* the grade surface must never break the read */ }
|
||||
|
||||
if (factorTrace) {
|
||||
|
||||
Reference in New Issue
Block a user