Fix futures odds being ignored when stale Elo exists #109
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "claude/determined-einstein-dzzjtk"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When an admin entered futures (preseason) odds for a season that already
had Elo ratings stored, the simulator kept using the old Elo and silently
ignored the new odds. This affected any Elo-based simulator (e.g. NHL).
Root cause: resolveSourceElos() ranks a direct sourceElo above the
sourceOdds -> convertFuturesToElo branch, but batchSaveFuturesOddsForSimulator()
only cleared the bracket-seeding
rating/ratingMethod— never the stalesourceElo/sourceEloMethod. A manually entered Elo (method "direct") is nottreated as generated, so it survived and short-circuited the resolver.
Fix:
sourceEloMethod (both the pre-update and upsert-conflict paths), so the
existing futures -> Elo conversion drives the run.
(mirroring resolveRatings), so a lone-odds season falls through to the
configured missing-Elo strategy instead of getting a flat ~1500.
futures_odds so the elo-ratings page won't resurrect a stale rating.
Adds unit coverage for odds-derived Elo, the single-participant guard, the
post-clear regression, generated-vs-direct sourceElo suppression, and the
new clearing behavior in batchSaveFuturesOddsForSimulator.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01YNfUEd9RzD3zm84oLHBHUH