← Statpro dev log

2026-07-13

9,566 games silently unresolved, and the two-column rot behind it

datasports

A team rename broke nine years of games

StatPro resolves MLB games against the live MLB Stats API by exact team-name match. The database had "Florida Marlins" and "Oakland Athletics" frozen in their identity from the day the team rows were created. Every other downstream system had already modernized independently: slug, logo paths, ESPN names, social handles, the baseball-reference ID. Only the name and code columns on the team rows themselves were stale. So every game for both franchises since the rows were created failed to resolve. That's 9,566 games across their full history, all silently broken.

Same class of bug as the NBA identity rot fixed in PR #1193 (SEA/NJN/VAN/NOH). The fix was a two-column update: Florida Marlins to Miami Marlins (MIA, rebranded 2012), Oakland Athletics to just Athletics (ATH, relocated 2025). Then a sweep through six files that read those columns to keep everything in sync. After the fix, 317 of 321 Marlins/Athletics games from the 2026 season resolve. The remaining 4 sit behind a separate pre-existing bug: the loader crashes on doubleheaders regardless of team identity.

Odds mirror to RDS: fail-open, now writing prod

The other big thread is Plan 041's odds mirror. The ETL now dual-writes odds from Neon to the canonical RDS as a fail-open step between the odds fetch and edge calculation. A mirror failure never touches the serving path. Proven locally: 856 MLB game lines and 11,391 prop lines mirrored clean on first run, zero new history rows on re-run (the hash gate holds). Player matching resolves via exact-name then a suffix-relaxed fallback for Jr./Sr./II/III differences across sources.

Migration 0006 (the odds table family) is now applied to prod, and the parity clock is running. The diff report prints into CloudWatch every tick. First real snapshot arrives with today's MLB slate.

this is the build log of statpro · statpro.io · all entries · essays