WNBA truth correction + THE p_win FLIP (live, rollback armed)

PART A -- WNBA TRUTH CORRECTION (no behaviour change).
WNBA does not "abstain" and is not "anti-predictive". The -0.12 that
produced those words was NBA-template machinery run on WNBA data -- WNBA
has never had its own archetypes, variables, conditions or calibration,
which is precisely the "sport stubbed in on another sport's template"
CLAUDE.md forbids. That is an UNBUILT MODEL'S EXPECTED FAILURE, not a
verdict on the sport; reading it as a verdict would quietly retire a sport
we never actually attempted. Its own build is QUEUED, after MLB.

The guard CODE is unchanged -- FORECAST_RANKED_SPORTS = {'mlb'} and the
inheritance test are correct live safety either way. Only the meaning is
corrected, and generalised into the doctrine-as-a-gate: a sport ranks on
p_win ONLY once its OWN model is built and shown to predict (calibration
AND resolution on its own holdout). Others are held out as NOT-BUILT,
never as failed. Re-labelled across gradeRanking, snapshot route, tests,
MASTER-PLAN and the challenger report.

PART B -- THE FLIP, gated on a full-slate re-run.

The re-run found something better than a bigger sample. An induced
snapshot graded 7 props: gradeAndCacheSlate runs with DEFAULT_LIMIT = 25
and ~72% of those refuse for insufficient_data, while 546 props are
gradeable. So 8 props IS the board, structurally -- not a small sample of
it. Logged as its own finding; the cap is a separate order.

For a statistically meaningful delta I used 11 real historical boards
(n=328, board sizes 14-57): 79.9% of rows move, mean 5.16 places per
board, TOP READ CHANGES ON 9 OF 11 BOARDS. The re-ordering holds at real
board size. Query committed.

FLIPPED:
- rankGrades drops its edge key (safe for every sport: removes a
  non-predictive tiebreak without putting p_win in front).
- selectTopGrades leads on forecast_rank, edge key removed.
- flattenToEdgeBoard sorts on forecastRank, not edge -- this board had
  edge as its PRIMARY key, so the whole mobile board was ordered by a
  quantity measured not to predict.
- forecast_rank threaded onto strip props.

Sports whose model is not built supply no forecast_rank, so their boards
fall through to the unchanged grade chain -- the fallback is the guard.

ROLLBACK ARMED: boards sort by forecast_rank WHEN PRESENT, so
FORECAST_RANK=0 reverts every surface on the next response -- no deploy,
no client release.

Edge is still computed, stored, carried and displayed as a labelled
diagnostic. Retired from ranking, not deleted.

Eight superseded tests updated to strictly stronger INVERSE properties --
they now fail if edge is ever re-introduced as a ranking key, which the
originals could not detect.

Gates: 4,045 tests / 323 suites green; next build exit 0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QJs13VsyiSKYQP6rj3NNmc
This commit is contained in:
Kev
2026-08-01 01:55:43 -04:00
parent ef4ac60b81
commit 6c97f59546
9 changed files with 222 additions and 90 deletions
+26 -12
View File
@@ -67,10 +67,14 @@ function descNullsLast(a, b) {
/**
* rankGrades — "top GRADES" order: grade tier → confidence → takeable-gated
* p_win → SIGNED edge → stable input order. Nulls sort LAST on both signals.
* p_win → stable input order.
*
* SCALES ARE NEVER MIXED: p_win (0..1) is only ever compared against p_win and
* edge (%) only against edge. Comparing 0.62 against 62 is not a comparison.
* EDGE KEY REMOVED 2026-08-01. It used to be the 4th key. Measured on n=200
* settled MLB rows, corr(edge, outcome) = -0.010 under the incumbent ruler and
* -0.022 under the consensus ruler — it does not predict, so it must not break
* ties either. Removing it is safe for EVERY sport: it takes a non-predictive
* signal out, it does not put p_win in front (that is `rankByForecast`, gated
* to sports whose own model has passed).
*
* Rows without a grade are dropped (a board of ungraded rows is not a board).
* `limit` omitted → the whole ranked list (callers slice).
@@ -83,12 +87,10 @@ function rankGrades(grades, limit) {
rank: gradeRankOf(g.grade),
conf: strictNum(g.confidence) == null ? -1 : strictNum(g.confidence),
pWin: takeablePWin(g),
edge: strictNum(g.edge != null ? g.edge : g.edge_pct),
}));
scored.sort((a, b) => a.rank - b.rank
|| b.conf - a.conf
|| descNullsLast(a.pWin, b.pWin)
|| descNullsLast(a.edge, b.edge)
|| a.idx - b.idx);
const out = scored.map((s) => s.g);
return limit == null ? out : out.slice(0, Math.max(0, limit));
@@ -142,15 +144,27 @@ function rankByForecast(grades, limit) {
}
/**
* WHICH SPORTS MAY RANK ON THE FORECAST — per-sport doctrine, enforced in code.
* WHICH SPORTS MAY RANK ON THE FORECAST — the per-sport doctrine, as a GATE.
*
* MLB only. WNBA's p_win is ANTI-PREDICTIVE on its own data (it abstains), so
* ranking WNBA by p_win would sort that board by a signal measured to point the
* wrong way — worse than the incumbent, not better. A comment would not have
* stopped a future flip from applying this globally; this does.
* A sport ranks on p_win ONLY once its OWN model is built and shown to
* predict — calibration AND resolution holding on its own holdout. MLB is the
* only sport that has passed. Every other sport is held out as NOT-BUILT,
* never as FAILED.
*
* A sport joins this set only by passing its OWN holdout: honest calibration
* AND surviving resolution. Never by inheriting MLB's result.
* WNBA IS NOT "ANTI-PREDICTIVE" AND DOES NOT "ABSTAIN" (corrected 2026-08-01).
* The -0.12 result that produced those words was NBA-template machinery run on
* WNBA data. WNBA has never had its own archetypes, variables, conditions or
* calibration — it is precisely the "sport stubbed in on another sport's
* template" that CLAUDE.md forbids. So -0.12 is the EXPECTED FAILURE OF AN
* UNBUILT MODEL, not a verdict on the sport. Reading it as a verdict would
* quietly retire a sport we never actually attempted.
*
* WNBA's own model-build is QUEUED as its own sport, after MLB is finished.
*
* The live consequence is identical either way — an unbuilt sport must not rank
* on a signal that has not been shown to hold for it — which is why this set is
* UNCHANGED. Only its meaning is corrected. A comment would not have stopped a
* future flip from going global; this does.
*/
const FORECAST_RANKED_SPORTS = Object.freeze(new Set(['mlb']));
const ranksOnForecast = (sport) => FORECAST_RANKED_SPORTS.has(String(sport || '').toLowerCase());