MLB F5 Dev Notes
MLB First Five Innings
Development Notes & Changelog
Top 5 Changes from Original F5 Prompt
The original WeBet F5 MLB prompt defined a 9-Layer Sharp Stack where Claude performed all analysis via web search — confirming starters, pulling F5 ERA stats, evaluating park factors, checking umpire zones, and reading line movement. Here are the five most significant architectural departures from that original strategy:

1. Claude demoted from analyst to verifier. The original prompt had Claude running the entire 9-layer analysis autonomously via web search. In production, Claude couldn't reliably find F5-specific data (F5 ERA, first-inning ERA, umpire assignments) through web search alone — it burned 15 search credits across 16 games and came back empty on most layers. The fix: JavaScript now pre-computes all projections, edges, and probabilities using ESPN and Odds API data. Claude only does a pass/fail verification check for late-breaking news (injuries, scratched starters, weather changes). This mirrors the proven /edge-beta architecture.

2. F5-specific historical data requirement removed for early season. The original prompt demanded F5 ERA (ERA through exactly 5 innings), first-inning ERA, last 5 starts F5 ATS record, and first-time-through-the-order stats. None of this exists in the first week of the season. The model now accepts career stats, 2025 season stats, and spring training performance as proxies. A trigger will re-enable the F5-specific requirement once 30+ games of 2026 data accumulate.

3. Edge calibration added (not in original prompt). The original prompt had no mathematical framework for computing edges — it relied on Claude's judgment to determine "dominant edge signals." The production model adds three calibration layers from the proven /edge-beta system: (a) edge discount curve that log-compresses large market disagreements, (b) cover probability caps at 57-60% matching industry benchmarks for sharp models, and (c) market respect blending that weights toward the market when model-market disagreement is large.

4. Tier scoring changed from subjective to mathematical. The original prompt scored layers as "CONFIRMS EDGE / NEUTRAL / CONTRADICTS EDGE" based on Claude's qualitative assessment. The production model computes a numerical edge percentage, Kelly fraction, and z-score for every game. Tier classification now derives from the math: 7+/9 layers confirmed with >2% calibrated edge = Tier 1. This eliminates Claude's tendency to conservatively mark layers as NEUTRAL when data exists but doesn't show a dramatic signal.

5. Data pipeline replaces web search for 7 of 9 layers. The original prompt required web search for all 9 layers. The production pipeline now fills 7 layers programmatically: L1 (ESPN confirmed starters), L2 (ESPN pitcher ERA/record), L3 (team stats: OPS, runs/game, batting avg), L4 (matchup implied by opposing team stats vs pitcher stats), L5 (team runs/game trends), L6 (hardcoded park factors for all 30 venues + temperature adjustment), L7 (ESPN weather data). Only L8 (umpire) and L9 (line movement/sharp signals) still benefit from Claude's web search — and these are the two layers where web search actually adds unique value.
Current Architecture Summary
The MLB F5 machine uses a pre-computed edge architecture mirroring the proven /edge-beta model. JavaScript fetches all data from ESPN (starters, pitcher ERA, team stats, injuries, venue, weather) and The Odds API (moneyline, run line, totals from 40+ books), then computes F5 projections and edges mathematically. Claude receives a ranked candidate table and only performs pass/fail verification via web search for late-breaking injury news, lineup changes, or weather shifts. The model evaluates every game on the daily slate, ranks candidates by edge strength, and selects up to 3 Tier 1 F5 picks per day. Park factors for all 30 MLB venues are hardcoded from 2024-2025 data. Temperature adjustments modulate run projections (cold suppresses, hot elevates). P/L tracking is completely separate from /edge-beta, starting fresh from April 5, 2026.
Data Pipeline
ESPN API: Confirmed starters (name, hand, ERA, W-L record), team records, venue info, weather, injuries for both teams.
The Odds API: Best available odds across 40+ US sportsbooks — full-game (h2h, spreads, totals) AND real F5 markets (h2h_1st_5_innings, spreads_1st_5_innings, totals_1st_5_innings).
BettorEdge API: Real F5 moneyline prices (Market ID 70) from DraftKings, FanDuel, BetMGM, and others. Best odds selected across both sources.
Park Factors: Hardcoded PF for all 30 venues (93-114 range) from 2024-2025 data.
Edge Computation: F5 run projections based on team runs/game, opposing pitcher ERA, park factor, and temperature. Edges computed as model probability minus market implied probability.
Claude (Sonnet): Verification-only role. Web search for injuries, lineup changes, weather updates. Pass/fail on pre-computed candidates.
Changelog
v2.9 Apr 6, 2026 — 9:30 PM
Date-Scoped ESPN Scoreboard — Fix Cross-Day Collisions
Fix Frontend ESPN scoreboard fetch now passes the picks date (?dates=YYYYMMDD) to the ESPN API, ensuring only games from the correct date are returned. Previously, the scoreboard fetched today's games regardless of which date the picks were for, causing cross-day matchup collisions — e.g., if the same two teams played consecutive days, yesterday's completed game could incorrectly appear as a result for today's pick. The picks date is extracted from the API response and threaded through to all score lookups.
v2.8 Apr 6, 2026 — 8:00 PM
F5 Scoring — Grade on First 5 Innings Only
Fix Architecture Critical scoring fix: F5 bets now settle on the score through 5 innings, not the final score. Both the backend results API (get-results-mlb) and the frontend pick cards use ESPN's inning-by-inning linescores to extract the F5 score. Picks are graded as WIN/LOSS as soon as 5 innings are complete — no need to wait for the game to finish. Scorebar on pick cards displays F5 scores. Previously, a game tied after 5 innings but won in the 9th would incorrectly show as a win; now correctly graded as a push or loss depending on the bet type.
v2.7 Apr 6, 2026 — 3:30 PM
Hard Rock Bet Exclusive — BettorEdge Removed
Architecture Removed BettorEdge entirely from the MLB pipeline. Hard Rock Bet is now the sole line source for all edge calculations — moneyline, run line, and totals. No secondary fallback to any other book. When Hard Rock doesn't carry F5-specific markets, the model derives F5 lines from Hard Rock's full-game odds. BettorEdge fetch, token auth, and game matching code all bypassed.
v2.6 Apr 6, 2026 — 3:00 PM
Hard Rock Bet — Single-Book Line Source for MLB
Architecture Data MLB picks now use Hard Rock Bet lines exclusively as the primary odds source. Added us2 region to The Odds API requests to access Hard Rock Bet (bookmaker keys: hardrockbet, hardrockbet_oh). The extractBestOdds function filters to Hard Rock Bet only — all other sportsbooks are ignored for edge calculation. Pick output now includes book and source fields showing exactly which book and data path each line came from. Blob storage updated to dual-write (SDK + REST API) so picks survive deploys.
v2.5 Apr 6, 2026 — 2:00 PM
Odds API Fix — Split Market Requests + P/L Reset
Fix Data Critical fix: v2.4 added F5 market keys (h2h_1st_5_innings, etc.) to the Odds API request, but these are not supported on the standard /odds endpoint — causing an HTTP 422 that silently killed the entire odds fetch. All 13 games rejected with "No odds available" on the first scheduled run. Fix: split into two API calls — standard markets (h2h, spreads, totals) in the primary call, and a separate optional call for alternate/F5 markets. Added _debug metadata to the stored result for future diagnostics. P/L tracking reset to start from April 6, 2026 (first day of verified live picks).
v2.4 Apr 5, 2026 — 5:00 PM
Dual F5 Line Sources — Odds API + BettorEdge
Data Architecture Added real F5 markets from The Odds API (h2h_1st_5_innings, spreads_1st_5_innings, totals_1st_5_innings) as a second source of actual first-five-innings lines. The model now has two independent F5 data feeds: BettorEdge (Market ID 70 — DraftKings, FanDuel, MGM, etc.) and The Odds API (40+ US sportsbooks). For each market type (ML, run line, total), the model uses the best available F5 price across both sources, falling back to full-game derivation only when neither source has F5-specific lines. Note: The F5 market keys caused an HTTP 422 on the standard endpoint — fixed in v2.5.
v2.3 Apr 5, 2026 — 4:15 PM
BettorEdge Real F5 Moneyline Integration
Data Added real F5 moneyline prices from BettorEdge API (Market ID 70). The model was previously using full-game lines as F5 proxies, which caused totals to show as 10-11 instead of realistic F5 ranges (4.5-5.5). BettorEdge provides consensus and best-available F5 ML from DraftKings, FanDuel, BetMGM, and other books. F5 totals now derived from full-game × 0.55, F5 run lines use ±0.5. First pick with real F5 lines: Tigers -0.5 at +158.
v2.2 Apr 5, 2026 — 3:30 PM
Career Stats Regression + Blended ERA
Architecture Data Critical fix for early-season accuracy. The model was using raw current-season ERA (e.g. Parker Messick 12.46 from one bad start, Chris Bassitt 8.31 from one outing) instead of regressing to career averages. Now fetches career pitching stats for every starter via ESPN's athlete stats API (career ERA, WHIP, K/9, IP, GB/FB ratio). Implements Marcel-style weighted blending: 0 GS = 100% career, 5 GS = 50/50, 10+ GS = 80% current season. This is the standard approach used by ZiPS, Steamer, and ATC projection systems. Example: Bassitt's 8.31 season ERA blends to ~3.80 (career 3.68), which is a dramatically more accurate pitcher input for edge computation. Also added started-game exclusion filter using commence_time check — games that have already started are excluded from picks but remain in the slate breakdown.
v2.1 Apr 5, 2026 — 2:30 PM
Calibrated Edge Model + KPI Dashboard
Architecture Data Major calibration upgrade mirroring /edge-beta's proven techniques. Added: (1) edge discount curve — log-compresses edges when model disagrees with market by >0.5 std devs, (2) cover probability caps — MLB ML capped at 60%, Run Line at 57%, Totals at 60%, (3) market respect blending — larger disagreement = more weight to market, (4) explicit Kelly criterion with half-Kelly sizing, (5) cover prob gates — sub-42% capped at 0.5u, sub-50% capped at 1.0u. Added Polymarket and BettorEdge API fetches in parallel. Pick cards now show 5 KPI boxes: Edge%, EV, Model%, Market%, Kelly%. Added starter names, ERA, venue, park factor to each card. Added rule: games that have already started are excluded from picks but shown in slate breakdown.
v2.0 Apr 5, 2026 — 1:00 PM
Pre-computed Edge Architecture (Major Rewrite)
Architecture Complete rewrite from Claude-driven analysis to JS pre-computed edges. ESPN API now feeds pitcher stats (ERA, W-L), team stats (runs/game, OPS, batting avg), injuries, venue, and weather directly into the pipeline. Odds API provides best lines from 40+ books. Edge computation happens in JavaScript using normalCDF probability models. Claude's role reduced to verification-only via web search. This mirrors the proven /edge-beta architecture and is dramatically faster and more reliable.
v1.5 Apr 5, 2026 — 12:15 PM
Early Season Mode + Historical Data Fallback
Fix Removed rigid requirement for 2026 F5-specific stats (F5 ERA, first-inning ERA, F5 ATS record). Added Early Season Mode that accepts career/2025 stats as proxies. Changed "INSUFFICIENT" from valid layer status to forbidden — all layers must be PASS, NEUTRAL, or FAIL. Added rule that Claude must produce an edge estimate for every game even in rejections.
v1.4 Apr 5, 2026 — 11:45 AM
Enriched Rejection Data + Layer Breakdown
Feature Updated Claude output format to include enriched rejection data: awaySP, homeSP, tierScore, bestEdge, layer-by-layer breakdown (L1:PASS L2:FAIL etc.), and specific failure reasons per game. Frontend updated to display this data.
v1.3 Apr 5, 2026 — 11:30 AM
Card Layout for Game Breakdown
Feature Replaced ugly HTML table for game breakdown with clean pick-style cards matching the /edge-beta design language. Each game is now a card with matchup, starters, tier badge, best edge, layer pills (color-coded PASS/NEUTRAL/FAIL), and reasoning. Cards sorted by tier score descending.
v1.2 Apr 5, 2026 — 11:00 AM
ESPN Starter Data Integration
Data Fixed critical data gap: previously Claude had to web-search for confirmed starters and was failing to find them (rejecting all 16 games at Layer 1). Added ESPN scoreboard API integration to pull confirmed starters (name, handedness, ERA, record), venue, weather, and team records. Starters are now pre-confirmed and fed directly to Claude.
v1.1 Apr 5, 2026 — 10:30 AM
Blob Storage Fallback + Analysis Table
Fix Fixed silent failures in background function. Added Netlify API fallback for blob storage when SDK isn't available. Added try/catch wrapper around entire handler. Added analysis breakdown table below picks showing all evaluated games with rejection reasons.
v1.0 Apr 5, 2026 — 9:00 AM
Initial MLB F5 Launch
Architecture Created entirely separate MLB F5 environment at /mlb. Page design mirrors /edge-beta (green/white, Geist Sans, liquid glass cards). Backend: generate-picks-mlb-background.js with full 9-Layer Sharp Stack F5 prompt from the WeBet F5 PDF. Separate blob store (edge-picks-mlb), separate P/L tracking, separate API endpoints. Daily cron at 10am EDT. Manual trigger at POST /api/run-picks-mlb.
v0.9 Apr 5, 2026 — 8:30 AM
API Endpoints + Netlify Config
Feature Created 5 Netlify functions: generate-picks-mlb-background (core engine), get-picks-mlb (API), run-picks-mlb (manual trigger), trigger-picks-mlb (daily cron), get-results-mlb (P/L tracker). Updated netlify.toml with schedule, redirects for /mlb, /api/get-picks-mlb, /api/run-picks-mlb, /api/get-results-mlb.
v0.8 Apr 5, 2026 — 8:00 AM
F5 Prompt Design (9-Layer Sharp Stack)
Architecture Implemented the full 9-Layer Sharp Stack from the WeBet F5 MLB PDF: L1 Confirmed Starters (hard gate), L2 F5 Pitcher Stats, L3 Advanced Metrics, L4 Pitcher vs Lineup, L5 Team Early-Inning Offense, L6 Park Factors, L7 Weather, L8 Umpire Zone, L9 Line Movement. Tier classification: 7+/9 = Tier 1 LOCK, 5-6 = Tier 2 LEAN (no bet), below = PASS. F5-only bet types: Moneyline, Run Line, Total.
v0.7 Apr 5, 2026 — 7:30 AM
Frontend: MLB F5 Page
Feature Built /mlb/index.html with full design system from /edge-beta: pick cards with sport tags, rating badges, live ESPN score integration (MLB-only), bet summary grid, results tracker with expandable day rows, cumulative record/accuracy/profit/ROI. Added MLB-specific features: F5 tag badges, baseball emoji loading state, team name handling for multi-word names (Red Sox, White Sox, Blue Jays).