Session 57: Phase 0 — Kill the Lies (2309 tests)

Work-order Phase 0 (Jul 10 live audit): every fabricated UI element deleted
or rewired to real data. Deletion sprint — no new product features.

0.1 Fake NBA game: root cause was scheduleService fetching the ESPN
    scoreboard with no ?dates= param or date filter — off-season ESPN
    returns the NEAREST slate (Jun 13 NYK@SA Finals rendered as tonight).
    Now pinned to the requested ET date + defensive filter; undated events
    dropped. Honest month-aware per-sport empty states (lib/emptyState.js).
0.2 Fake header counters: liveTick stripped to a bare 1s pulse (the
    auto-incrementing "247 graded", sin-driven brain-%, aPlus/cascades are
    dead). New GET /api/snapshot/summary (cache-only, before /:sport) +
    Next proxy; HeartbeatBar shows the real graded count and SYNC =
    elapsed since the last pipeline run (amber past 5 min).
0.3 Ticker: hardcoded fallback items deleted (real snapshot exhaust only);
    MOVE kept — computeLineDeltas is real movement. <4 real items → no
    ticker; bar publishes --ticker-h so the fixed header collapses cleanly.
0.4 /terminal retired: route redirects to /dashboard; VVI/injury-wire/
    leaders layouts preserved unrouted as §12 content-engine templates.
    Nav PRIMARY = Slate/Scan/Ledger; BottomTabBar Terminal→Explore; PWA
    shortcut Terminal→Ledger; #terminal alias → /dashboard.
0.5 ›Query nav pill deleted (duplicate /scan link).

Backend 2289 → 2309 tests (199 suites), web build exit 0.
Spec: specs/phase-0-kill-the-lies.md. Next: work-order Phase 1 (ledger
persistence + settlement).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Kev
2026-07-10 20:17:49 -04:00
parent 2ae8a5697e
commit c8790fde55
27 changed files with 891 additions and 311 deletions
+49
View File
@@ -0,0 +1,49 @@
/* ============================================================
Session 57 (Phase 0) — honest per-sport empty-slate copy (spec §6).
A sport with zero games must say WHY instead of showing a fixture game or
passive "waiting" language. Month-aware: an off-season sport names its
return window; an in-season sport calls it an off-day. CommonJS so both the
.tsx surfaces (allowJs) and the plain-JS Jest suite can load it.
============================================================ */
// Off-season months per sport (0-indexed). Deliberately conservative: only
// months where the league is CERTAINLY dark, so an early/late season edge day
// reads as an off-day rather than falsely claiming the league is done.
const OFF_SEASON = {
nba: { months: [6, 7, 8], returns: 'October' }, // JulSep
wnba: { months: [10, 11, 0, 1, 2, 3], returns: 'May' }, // NovApr
mlb: { months: [11, 0, 1], returns: 'spring' }, // DecFeb
};
const LABEL = { nba: 'NBA', wnba: 'WNBA', mlb: 'MLB', soccer: 'Soccer' };
/**
* Copy for an empty slate. `sport` is lowercase ('nba'|'wnba'|'mlb'|'soccer'
* |'all'); anything else falls back to the generic line.
* Returns { title, body }.
*/
function emptyStateCopy(sport, date = new Date()) {
const sp = String(sport || '').toLowerCase();
const month = date.getMonth();
const off = OFF_SEASON[sp];
if (off && off.months.includes(month)) {
return {
title: `${LABEL[sp]} returns in ${off.returns}.`,
body: 'The offseason board is dark. The model is running the live slates in the meantime.',
};
}
if (LABEL[sp]) {
return {
title: `No ${LABEL[sp]} games today.`,
body: 'Off-day. The board refills with the next slate.',
};
}
return {
title: 'No games on the board today.',
body: 'The board refills with the next slate.',
};
}
module.exports = { emptyStateCopy, OFF_SEASON };
+10 -14
View File
@@ -1,16 +1,22 @@
/* ============================================================
VYNDR 2.0 — living-layer tick engine (§8).
ONE interval, many subscribers (fan-out). Drives HeartbeatBar,
LiveNumber, NeuralBrain. Plain CommonJS so the React hook imports it
ONE interval, many subscribers (fan-out). Drives HeartbeatBar's
elapsed-since-snapshot clock. Plain CommonJS so the React hook imports it
AND Jest drives it manually via tick().
Does NOT auto-start on import (would run in SSR/tests). The React hook
calls start() on mount; tests call tick() directly. Animations are gated
behind reduced-motion in the CSS layer (Session 33), not here — the tick
only updates data.
Session 57 (Phase 0) — the fake counters are DEAD. This used to carry a
cosmetically auto-incrementing graded count, a sin-driven brain-%, and
invented aPlus/cascades counts. All deleted: real numbers now come from
/api/snapshot/summary (see LiveLayer). The tick survives ONLY as the 1s
re-render pulse. Do not add display data back here.
============================================================ */
const INITIAL = { tick: 0, graded: 247, neural: 96, aPlus: 6, cascades: 11 };
const INITIAL = { tick: 0 };
const liveTick = {
listeners: new Set(),
@@ -28,17 +34,7 @@ const liveTick = {
/** Advance one tick. New state object so React subscribers re-render. */
tick() {
const prev = this.state;
const t = prev.tick + 1;
this.state = {
tick: t,
// graded count creeps up roughly every ~7s
graded: prev.graded + (t % 7 === 0 ? 1 : 0),
// neural % "breathes" 9098 deterministically (sin-driven, test-safe)
neural: 94 + Math.round(Math.sin(t / 3) * 4),
aPlus: prev.aPlus + (t % 23 === 0 ? 1 : 0),
cascades: prev.cascades,
};
this.state = { tick: this.state.tick + 1 };
this._notify();
return this.state;
},
+3 -2
View File
@@ -26,12 +26,13 @@ const GATED_ROUTES = [
];
/* Open — reachable without auth (marketing + the free funnel + auth itself). */
/* Session 57 (Phase 0): '/terminal' removed — the route now server-redirects
to /dashboard (fabricated surface retired), so it needs no gate exemption. */
const OPEN_ROUTES = [
'/',
'/dashboard',
'/slate',
'/scan',
'/terminal',
'/compare',
'/game',
'/pricing',
@@ -59,7 +60,7 @@ const HASH_ALIASES = {
'#slate': '/dashboard',
'#dashboard': '/dashboard',
'#scan': '/scan',
'#terminal': '/terminal',
'#terminal': '/dashboard', // retired surface (Session 57) — old links land on the slate
'#compare': '/compare',
'#ledger': '/ledger',
'#tracker': '/tracker',