Serve NFL game-details starters from live ESPN depth charts #118
All Vouch review confidence checks passed
Residual risk 0.33 = Change Risk (0.57) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #118"
general
weight: 0.35
cursor[bot]
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
What changed
The NFL Starting Lineups block on game details (
NFLRosterSection→GET /api/nfl/roster?action=game-starters) was readingNFLRosterEntryviagetGameStarters/getTeamStarters. That table is a one-time ESPN snapshot from Nov 7, 2025 (season hardcoded2025, every Active player stored asdepthOrder1), so a 2026 game likeNYG_at_IND_2026-11-29showed the 2025 Giants with Russell Wilson, Jaxson Dart, and Jameis Winston all as starting QBs.This PR makes that path fetch live ESPN depth-chart starters at request time. It does not fall back to
NFLRosterEntry. No Prisma schema changes, migrations, DB writes, new npm dependencies, or env vars.lib/nfl-live-starters.jsmapsNFL_19/ abbrs through existingresolveEspnTeamId, fetches roster + depth chart for each team, and returns QB1, RB1, WR1–3, TE1, K, plus first-string defense.injuries[]and is flagged on the card.NFLRosterSectionshows Lineups unavailable right now when ESPN fails or times out.depthOrder: 1and must not be run as-is.Prop eligibility, published picks, and MLB/NHL game details are untouched.
ESPN endpoints
Used site.api.espn.com (current season, no hardcoded year):
https://site.api.espn.com/apis/site/v2/sports/football/nfl/teams/{espnTeamId}/rosterhttps://site.api.espn.com/apis/site/v2/sports/football/nfl/teams/{espnTeamId}/depthchartssports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/{year}/teams/{id}/depthchartsalso works but only returns athlete$refs (no names or injuries), so this path uses the site.api depthcharts payload.Team ids (
NFL_19→ ESPN 19) reuseresolveEspnTeamIdfromlib/event-roster-eligibility.js/ESPN_TEAM_IDS.Caching
fetchusescache: 'no-store'(not Nextrevalidate). A 45-minute Data Cache would pin an empty 200 and keep the UI on "unavailable" after the 60s failure TTL expired. Next 14.2 also caches unoptioned fetches for a year, so the cache mode is set explicitly.Fallback
If ESPN fails, times out, or the depth chart has no QB starter, the API returns
{ starters: null | { unavailable: true, … }, unavailable: true, error: 'Lineups unavailable right now' }. The UI shows that copy.NFLRosterEntryis never queried on this path.How to test locally
Manual: open game details for NYG at IND 2026-11-29 (
/game/NYG_at_IND_2026-11-29). Starting Lineups should list J.J. McCarthy as NYG QB1 (jersey 18 on live ESPN today) and Anthony Richardson Sr. as IND QB1 — not Wilson/Dart/Winston as co-starters. If ESPN is down, the block should say Lineups unavailable right now.Follow-ups (not in this PR)
Optional scheduled
NFLRosterEntryrefresh for the current season with real depth order (not every Active player as 1). That needs a dry run and owner approval; do not runscripts/populate-nfl-rosters*.jsas-is.Test results
npx jest --no-coverage: 132 suites, 1978 tests passed.Live site.api payloads (2026-11-29) parsed with the production selector: NYG QB1 J.J. McCarthy #18; IND QB1 Anthony Richardson Sr. #5; Wilson / Winston / Dart excluded.
<!-- CURSOR_AGENT_PR_BODY_END -->
<div><a href="https://cursor.com/agents/bc-3d9d92d1-ab62-58ca-9e3f-b17d14b7a77a?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-3d9d92d1-ab62-58ca-9e3f-b17d14b7a77a&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div>
<!-- CURSOR_SUMMARY -->
---
<!-- /CURSOR_SUMMARY -->