Imprevista

Deploy Log

← Back to Deploy Log
|Sports Dashboard|DEPLOYED

Swap set-piece + shot-xG signals to Supabase sofascore data

Round-3 audit left 5 signals below ceiling because their source data (understat-shots) was Big-5 only and frozen at 2024. The inventory review turned up sofascore_shots in Supabase with 368k shots across

Round-3 audit left 5 signals below ceiling because their source data (understat-shots) was Big-5 only and frozen at 2024. The inventory review turned up sofascore_shots in Supabase with 368k shots across 24 leagues × 2025-26 fully populated — every league we bet in, and the situation field includes the set-piece categories we need.

Changes:

  • New loadSofascoreShots() reads sofascore_shots + sofascore_xg for a

(league, season) pair, runs the v1 pre-shot xG model per shot, and returns an array of shots with computed xG, team, date, is-goal.

  • preloadSofascoreData() runs once at main() startup — one query per

unique (league, season) in the ledger, all in parallel. Everything downstream reads the in-memory cache so the bet loop stays sync.

  • loadSetPieceData() (SP-xGA) now tries sofascore first, understat

second. Big-5 gate on the signal dropped: now runs league-wide where data is available.

  • loadSetPieceMismatchData() (SP-Mismatch) same treatment — Big-5 gate

dropped, sofascore preferred, understat + fotmob as fallback.

  • loadXGDataFromShotFiles() (ShotXG) now tries sofascore first. Covers

arg/brazil/austria/mls/jLeague/etc. which fotmob-shots never had.

  • get{Sp,SetPiece}* lookups route team-name resolution through

findTeamInMap so sofascore's "Leicester City" matches ledger's "Leicester" etc.

  • .dockerignore: narrowed data/xg-model/ exclusion to keep just the

xg_pre_shot_v1_compact.json model file (696KB) needed at runtime.

Expected coverage lift:

  • SP-xGA: 0/181 → ~150/181 (all AH bets in sofascore-covered leagues)
  • SP-Mismatch: 56/181 (Big-5 only) → ~170/181
  • ShotXG: 141/181 → ~175/181 (gains on SA + minor European leagues)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Files Changed

Commit:9d346bc