Grading binds opponent features to the REAL game, not ESPN's "today"
Order 1.6 Phase 1. This is a MODEL-OUTPUT fix, not bookkeeping. computeFeatures.lookupTodayGame called the ESPN scoreboard with NO date param and took whatever ESPN calls "today". Renamed to lookupGameOnDate and now sends ?dates=YYYYMMDD from the prop's BOUND game — the same game the ledger, retention and settlement use, so all four finally agree. PROVEN against live ESPN (before/after, same instant): dateless "today" CLE->PIT NYY->LAD LAD->NYY (Jul 19 card) bound to 2026-07-20 CLE->MIN NYY->PIT LAD->PHI (the real games) bound to 2026-07-19 CLE->PIT NYY->LAD LAD->NYY (reproduces OLD) Every opponent was wrong. opponentAbbr feeds opp_rank_stat (a +/-1.0 factor) and isHome feeds home_away (+0.5), so late-slot grades were scored against the wrong matchup. Note the window is WIDER than the 01:00/03:00 UTC slots: this ran at 07:5x UTC = 03:5x ET and ESPN's dateless scoreboard was STILL returning the previous day's card. HONEST DEGRADATION: with no bound game date the grader does NOT fall back to a dateless lookup — it records 'no_bound_game_date' and leaves opponentAbbr/isHome/gameId null, so engine1 simply omits the opponent and home/away factors rather than scoring a wrong matchup. Tests assert both directions. Same class of bug fixed alongside: the Tank01 augmentation used TODAY's UTC date for its cache key; it now uses the bound game date. gradeSlateService threads game_date/game_time/home_team/away_team into the grader so the binding reaches computeFeatures at all. Audited the rest of the feature path for dateless/"today" lookups — none remain (weather is current-conditions by venue, park/pace are static). Suite 282/3383 green, build exit 0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SmNjJAwEnqHPtXbvSZR8kA
This commit is contained in:
@@ -59,6 +59,15 @@ async function gradeBestSide(grade, prop, sport, opts = {}) {
|
||||
// quarter-Kelly sizing can compute from actual prices (or not at all).
|
||||
over_odds: prop.over_odds ?? null,
|
||||
under_odds: prop.under_odds ?? null,
|
||||
// Session 64 (Order 1.6) — carry the BOUND game through to grading so
|
||||
// opponent/home-away features resolve against the RIGHT game. Without this
|
||||
// the grader fell back to ESPN's dateless "today", which at the late slots
|
||||
// is the previous day's card — binding yesterday's opponent into
|
||||
// opp_rank_stat and the home/away factor.
|
||||
game_date: prop.game_date ?? null,
|
||||
game_time: prop.game_time ?? null,
|
||||
home_team: prop.home_team ?? null,
|
||||
away_team: prop.away_team ?? null,
|
||||
};
|
||||
const sides = await Promise.all([
|
||||
Promise.resolve()
|
||||
|
||||
Reference in New Issue
Block a user