DOSSIERSBODHI-MLB-TEMPORAL-REPLAY
github.com/bet-bodhi-public

MLB Temporal Replay & Polymarket Historical Index

5,107-game no-lookahead backtest with 98.4% closed-market match rate

Published: 2026-06-30  |  Project: Bet Bodhi  |  Discipline: Quantitative Engineering & Microstructure

Author: Nicholas Alexander MacAskill — Founder & CTO, Flocano Labs  |  Canonical: https://www.nicholasmacaskill.com/dossier/bodhi-mlb-temporal-replay

games_replayed
5,107
Verified Invariant
2025_poly_match_rate
98.4%
Verified Invariant
fast_mode_speedup
5–10×
Verified Invariant
grading_metric
binary W/L
Verified Invariant

Temporal replay architecture

Runner: scripts/mlb-historical-backtest.ts

Each final game replays through the live stack with zero lookahead:

MLB final game
  → getHydratedAnalysisData()   [stats as-of first pitch]
  → PillarAnalyzer.analyzeGame() [current production weights]
  → resolveHistoricalMoneyline() [2025 only]
  → grade valueTeam vs winner
  → write BacktestRow to cache
  → summarize + concentration table

Methodology guardrails

RuleImplementation
No lookaheadSeason stats, standings, form, and series frozen to game date
No agent memoryAgentMemory disabled — backtest = pure model, not live fades
Pick populationEvery final game where valueTeam is set
ConcentrationPost-process: per calendar day, rank and slice top 1 / 3 / 5

Closed Polymarket historical index

Problem 1 — 0% match on 2025: Gamma query= search broken for closed MLB markets.

Fix: Paginate GET /events?closed=true&tag_slug=mlb|sports|baseball, bulk-load 4,000+ markets once at startup, build date index → 98.4% match (2,509 / 2,551 games).

Problem 2 — False positives: Series Winner, O/U, spreads matched as moneylines.

Fix — isMoneylineMarket(): Rejects series/playoff props, non two-outcome contracts, and non Team A vs Team B questions.

2024: Polymarket historical MLB moneylines unavailable — season run with --skip-poly (technical signal only, 59.5% WR).

2025: Gamma close prices + optional CLOB prices-history at kickoff.

Runtime & cache

Bulk closed-market load, date-indexed O(day) lookup, parallel game workers (--concurrency), and incremental row cache cut full-season 2025 from ~72 min to 5–10× faster in --fast mode. Cached rows enable instant re-slicing without re-hitting APIs.

Live pipeline validation

Jun 16–20, 2025 forward test: replay harness and daily scanner pipeline operated correctly; that week's model output underperformed — confirms infrastructure works independently of any single soft regime.

Reproduce

BASHPRODUCTION RUNTIME
npx tsx scripts/mlb-historical-backtest.ts --season 2024 --skip-poly
npx tsx scripts/mlb-historical-backtest.ts --season 2025
npx tsx scripts/mlb-historical-backtest.ts --season 2025 --fast --concurrency 4 --quiet

Artifacts: data/backtest_cache/rows_2024_poly0.json, rows_2025_poly1.json, dossier_stats.json

SIGNAL_DETECTED:"system online // first dossier lesson logged"//TARGET:sovereign layer////////////////////////
Flocano Labs
ARCHITECTURELAYER
Memoirs
TASTELAYER
Nicholas Alexander MacAskill
IDENTITYLAYER
Biography
ABOUTFOUNDER