SIGN IN SIGN UP

Add draft_backtest: replay a real past ESPN draft, round by round

Consolidates the backtest work from this session into a permanent, reusable
tool instead of one-off scripts. Given a league_id and season, it:

- Builds a leak-free board for that season via build_player_table's existing
  season bound -- only data from strictly before it, same discipline
  matchup_backtest uses.
- Replays the real ESPN draft in order (auto-detecting your team and draft
  slot from ESPN_SWID/ESPN_S2, league settings read straight from ESPN via
  the new espn_league_context).
- At each of your picks, reports three things scored on real points from
  that season: what who_should_i_pick's algorithm would have recommended
  given the real board at that exact moment, the true hindsight-optimal
  pick by value over replacement, and what you actually took.

QB is hard-capped at 1 on the optimal side (_OPTIMAL_POSITION_CAPS): a
second quarterback scores zero in a 1-QB starting lineup except bye weeks,
so ranking it by raw points or even league-wide VOR overstates it hugely --
who_should_i_pick already reaches this conclusion live via
_positional_need's BACKUP_DECAY, this just enforces it as a hard cap since
the optimal side isn't running that pipeline.

K/DST aren't modelled anywhere in this tool, so those rounds report your
actual pick with no comparison, and are excluded from the point totals
(comparing your None against algo/optimal's real skill-position pick would
inflate their totals unfairly.

Verified against three real seasons (2023-2025) of an actual ESPN league
during development; numbers match the manual analysis exactly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
EOF
)
Z
zacharytran26 committed
fa7e451bd197de06e51c84b48aa2877da40676b3
Parent: 85f5550