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
+46
View File
@@ -0,0 +1,46 @@
// Session 57 (Phase 0) — honest per-sport empty-slate copy (spec §6).
// An off-season sport names its return window; an in-season sport calls it an
// off-day. Never fixture games, never passive "waiting" language.
const { emptyStateCopy } = require('../../web/src/lib/emptyState');
const july = new Date('2026-07-10T12:00:00');
const december = new Date('2026-12-10T12:00:00');
const march = new Date('2026-03-10T12:00:00');
describe('emptyStateCopy', () => {
test('NBA in July → off-season, returns in October', () => {
const { title } = emptyStateCopy('nba', july);
expect(title).toBe('NBA returns in October.');
});
test('NBA in December → in-season off-day', () => {
const { title } = emptyStateCopy('nba', december);
expect(title).toBe('No NBA games today.');
});
test('WNBA in March → off-season, returns in May', () => {
expect(emptyStateCopy('wnba', march).title).toBe('WNBA returns in May.');
});
test('WNBA in July → in-season off-day', () => {
expect(emptyStateCopy('wnba', july).title).toBe('No WNBA games today.');
});
test('MLB in December → off-season', () => {
expect(emptyStateCopy('mlb', december).title).toBe('MLB returns in spring.');
});
test('soccer has no off-season branch → off-day copy', () => {
expect(emptyStateCopy('soccer', july).title).toBe('No Soccer games today.');
});
test('unknown sport / "all" tab falls back to the generic line', () => {
expect(emptyStateCopy('all', july).title).toBe('No games on the board today.');
expect(emptyStateCopy(undefined, july).title).toBe('No games on the board today.');
});
test('handles uppercase sport ids (dashboard passes NBA.toLowerCase(), but be safe)', () => {
expect(emptyStateCopy('NBA', july).title).toBe('NBA returns in October.');
});
});
+16 -4
View File
@@ -25,7 +25,7 @@ describe('Phase C — routing config (lib/routes)', () => {
});
it('leaves the landing + free funnel open (dashboard, scan stay public)', () => {
['/', '/dashboard', '/scan', '/pricing', '/blog', '/terminal', '/login'].forEach((r) => {
['/', '/dashboard', '/scan', '/pricing', '/blog', '/login'].forEach((r) => {
expect(routes.isGatedRoute(r)).toBe(false);
});
});
@@ -37,12 +37,17 @@ describe('Phase C — routing config (lib/routes)', () => {
it('resolves hash deep-link aliases to real routes', () => {
expect(routes.resolveHashAlias('#scan')).toBe('/scan');
expect(routes.resolveHashAlias('#terminal')).toBe('/terminal');
// Session 57 (Phase 0) — /terminal retired; old links land on the slate.
expect(routes.resolveHashAlias('#terminal')).toBe('/dashboard');
expect(routes.resolveHashAlias('#slate')).toBe('/dashboard');
expect(routes.resolveHashAlias('#nope')).toBeNull();
expect(routes.resolveHashAlias('')).toBeNull();
});
it('drops the retired /terminal surface from OPEN_ROUTES', () => {
expect(routes.OPEN_ROUTES).not.toContain('/terminal');
});
it('keeps GATED and OPEN route lists disjoint', () => {
const overlap = routes.GATED_ROUTES.filter((r) => routes.OPEN_ROUTES.includes(r));
expect(overlap).toEqual([]);
@@ -77,11 +82,18 @@ describe('Phase C — Nav conversion', () => {
expect(src).toContain("fontFamily: 'var(--mono)'");
expect(src).toContain("'var(--g-a)'");
});
it('exposes the primary Slate/Terminal/Scan/Ledger routes', () => {
['/dashboard', '/terminal', '/scan', '/ledger'].forEach((href) => {
it('exposes the primary Slate/Scan/Ledger routes', () => {
['/dashboard', '/scan', '/ledger'].forEach((href) => {
expect(src).toContain(href);
});
});
// Session 57 (Phase 0) — Terminal (fabricated surface) and the duplicate
// Query pill are gone from the nav. Don't re-add either.
it('does not link /terminal or render the Query duplicate', () => {
expect(src).not.toContain("href: '/terminal'");
expect(src).not.toContain('data-search-trigger');
expect(src).not.toContain('>Query<');
});
});
describe('Phase C — Footer (system voice)', () => {
+15 -9
View File
@@ -124,16 +124,22 @@ describe('Phase D — ClaimMeter', () => {
});
});
describe('Phase D — Terminal page (real intelligence, not a stub)', () => {
const src = read('app/terminal/page.tsx');
it('is no longer a RouteStub', () => {
expect(src).not.toContain('RouteStub');
// Session 57 (Phase 0) the Terminal surface was fabricated sample data
// (Finals-era NBA content rendered as live intelligence). The route now
// redirects to /dashboard; the layouts survive UNROUTED as §12 templates.
describe('Phase 0 — Terminal retired (fabricated surface)', () => {
it('the route redirects to the slate instead of rendering fake intel', () => {
const src = read('app/terminal/page.tsx');
expect(src).toContain("redirect('/dashboard')");
expect(src).not.toContain('INJURY_WIRE');
expect(src).not.toContain('Wembanyama');
});
it('uses the intel-surface and renders the VVI / cascade / leaders sections', () => {
expect(src).toContain('intel-surface');
expect(src).toContain('VOLATILITY INDEX');
expect(src).toContain('INJURY WIRE');
expect(src).toContain('GRADEABLE LEADERS');
it('preserves the VVI / cascade / leaders layouts as unrouted templates', () => {
const tpl = read('components/intel/TerminalTemplates.tsx');
expect(tpl).toContain('NOT ROUTED');
expect(tpl).toContain('VOLATILITY INDEX');
expect(tpl).toContain('INJURY WIRE');
expect(tpl).toContain('GRADEABLE LEADERS');
});
});
+10 -4
View File
@@ -11,13 +11,18 @@ const manifest = require('../../web/public/manifest.json');
describe('Phase F — BottomTabBar (5-tab spec)', () => {
const src = read('components/BottomTabBar.tsx');
// Session 57 (Phase 0) — Terminal tab retired (fabricated surface);
// Explore holds its slot so the bar keeps 5 tabs.
it('renders the five spec tabs', () => {
['Slate', 'Terminal', 'Scan', 'Ledger', 'More'].forEach((label) => {
['Slate', 'Explore', 'Scan', 'Ledger', 'More'].forEach((label) => {
expect(src).toContain(`'${label}'`);
});
});
it('routes the primary tabs to real pages', () => {
['/dashboard', '/terminal', '/scan', '/ledger'].forEach((href) => expect(src).toContain(href));
['/dashboard', '/explore', '/scan', '/ledger'].forEach((href) => expect(src).toContain(href));
});
it('does not link the retired /terminal surface', () => {
expect(src).not.toContain('/terminal');
});
it('makes Scan the prominent (primary) action in grade-green', () => {
expect(src).toContain('primary: true');
@@ -90,11 +95,12 @@ describe('Phase F — PWA manifest + viewport (§11)', () => {
expect(manifest.theme_color.toLowerCase()).toBe('#06060b');
expect(manifest.background_color.toLowerCase()).toBe('#06060b');
});
it('ships deep-link shortcuts for Slate / Scan / Terminal', () => {
it('ships deep-link shortcuts for Slate / Scan / Ledger', () => {
const urls = (manifest.shortcuts || []).map((s) => s.url);
expect(urls).toContain('/dashboard');
expect(urls).toContain('/scan');
expect(urls).toContain('/terminal');
expect(urls).toContain('/ledger');
expect(urls).not.toContain('/terminal'); // retired (Session 57, Phase 0)
});
it('declares its categories', () => {
expect(manifest.categories).toContain('sports');
+3 -2
View File
@@ -54,9 +54,10 @@ describe('QA.5 — wordmark everywhere', () => {
});
describe('QA.11 — mobile parity (5-tab bar)', () => {
it('BottomTabBar declares Slate/Terminal/Scan/Ledger/More', () => {
// Session 57 (Phase 0) — Terminal retired; Explore holds its slot.
it('BottomTabBar declares Slate/Explore/Scan/Ledger/More', () => {
const src = read('components/BottomTabBar.tsx');
['Slate', 'Terminal', 'Scan', 'Ledger', 'More'].forEach((t) => expect(src).toContain(`'${t}'`));
['Slate', 'Explore', 'Scan', 'Ledger', 'More'].forEach((t) => expect(src).toContain(`'${t}'`));
});
});
+20 -2
View File
@@ -130,13 +130,22 @@ describe('Phase G.1 — living-layer tick engine (§8)', () => {
liveTick.tick();
expect(calls).toBe(2); // unsubscribed
});
it('advances tick and creeps the graded count, with a fresh state object', () => {
it('advances tick with a fresh state object', () => {
const first = liveTick.state;
for (let i = 0; i < 7; i++) liveTick.tick();
expect(liveTick.state.tick).toBe(7);
expect(liveTick.state.graded).toBeGreaterThan(first.graded);
expect(liveTick.state).not.toBe(first); // new object → React re-renders
});
// Session 57 (Phase 0) — the fake header counters are dead. The tick engine
// must carry NO display data: no auto-incrementing graded count, no
// sin-driven neural %. Real numbers come from /api/snapshot/summary only.
it('carries no fabricated display counters', () => {
liveTick.tick();
expect(Object.keys(liveTick.state)).toEqual(['tick']);
const src = read('lib/liveTick.js');
expect(src).not.toContain('neural');
expect(src).not.toContain('247');
});
});
describe('Phase G.4 — checkout (§12)', () => {
@@ -155,6 +164,15 @@ describe('Phase G — React glue wired correctly', () => {
expect(src).toContain('ekg-track');
expect(src).toContain('count-tick'); // LiveNumber pop
});
// Session 57 (Phase 0) — the heartbeat's numbers are REAL: graded count +
// sync age come from /api/snapshot/summary; the fake neural % is gone.
it('HeartbeatBar reads /api/snapshot/summary and shows no neural %', () => {
const src = read('components/vyndr/LiveLayer.tsx');
expect(src).toContain('/api/snapshot/summary');
expect(src).not.toContain('neural');
expect(src).toContain('SYNC'); // elapsed-since-snapshot clock
expect(src).toContain('updated_at');
});
it('GlobalHosts registers the design globals + applies prefs on mount', () => {
const src = read('components/vyndr/GlobalHosts.tsx');
expect(src).toContain('window.__prefs');