P2-9: leaderboard stat labels (SB/ER/TB) + FLAG the grade-degradation root cause

DISPLAY FIX (shipped): the league leaderboard rendered raw snake_case
("stolen_bases U0.5", "earned_runs U2.5"). New canonical short-label lib
web/src/lib/statAbbrev.js (one source, CommonJS + unit-tested) maps stat_type
to SB/ER/TB/HR/K/PTS/… and ExploreHub routes through it. Unknown ids upper-case
their words so raw snake_case can never leak again.

FLAG (reported, NOT silently changed — per the audit's instruction): the "B at
45% confidence" is a BACKEND grading issue, diagnosed against live snapshot:
- 25/25 grades mismatch their own confidence vs grade_thresholds.json (B shown
  at conf 55 = the B- band; a systematic one-sub-tier gap on every prop). The
  surfaced `confidence` is not the probability that derived the letter (likely
  the data-sufficiency penalty applied to display-only).
- 9/25 have projection=0 — the MLB feature path feeds 0 instead of refusing
  (S58 insufficient_data), which also produces the P1-7 broken edge_pct.
Full write-up + do-not list: specs/audit-data/mlb-grade-degradation.md. NOT
re-lettering or shifting thresholds on the frontend — that would hide the bug.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kev
2026-07-17 01:42:03 -04:00
parent 00537eb84c
commit 77e8937a56
4 changed files with 110 additions and 1 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ import SportBadge from '@/components/vyndr/SportBadge';
import GradeBadge from '@/components/vyndr/GradeBadge';
import { playerHref } from '@/lib/playerHref';
import { dedupeLeaders } from '@/lib/playerGrouping';
import { statAbbrev } from '@/lib/statAbbrev';
/**
* ExploreHub (Session 42 leaders; Session 60 night2/C — THE AGGREGATOR).
@@ -147,7 +148,7 @@ export default function ExploreHub() {
<span style={{ fontWeight: 700, fontSize: 13, color: '#fff', whiteSpace: 'nowrap' }}>{r.player}</span>
{r.team && <span className="mono" style={{ fontSize: 10, color: 'var(--text-1)' }}>{r.team}</span>}
</div>
<div className="mono" style={{ textAlign: 'right', fontSize: 12, color: '#C8CCD6' }}>{r.stat} {r.side}{r.line}</div>
<div className="mono" style={{ textAlign: 'right', fontSize: 12, color: '#C8CCD6' }}>{statAbbrev(r.stat)} {r.side}{r.line}</div>
<div className="mono" style={{ textAlign: 'right', fontSize: 13, fontWeight: 600, color: 'var(--text-0)' }}>{r.confidence != null ? `${r.confidence}%` : '—'}</div>
<div style={{ display: 'flex', justifyContent: 'center' }}><GradeBadge grade={r.grade} size="sm" /></div>
</a>