builtbykev
bbfce05b94
Resolver hardening: ESPN team-roster index as primary NBA/WNBA name→id source
...
Wave 0 shipped NBA/WNBA grading off ESPN per-athlete gamelogs, but name→id
resolution went only through the v2 /search endpoint, which is unreliable at
the edges. Live probing surfaced the real coverage gap: search actually
resolves the right id for most names, but dual-league athletes (WNBA + NCAA —
e.g. Napheesa Collier, Brionna Jones) get a filters-only gamelog until a
`?season=` is supplied, so they silently returned insufficient_data despite a
full season of games.
Two fixes:
1. buildAthleteRosterIndex(sport) — aggregates every team roster for nba/wnba
into a complete { nameKey → {id, displayName, teamId} } map (canonical
accent-folded keys via playerName.nameKey). Bounded concurrency (6) over the
~15-30 team fetches, Redis `espnroster:{sport}` (24h) + in-memory mirror,
fully defensive (a failing team is skipped → partial index, never throws;
grouped OR flat athletes[] shapes handled; non-numeric ids dropped). This is
now the PRIMARY resolver in resolveAthleteId/getPlayerGameLog; the v2 search
stays as a backstop on a roster miss. A unique roster hit wins (S59 doctrine)
— a missing name beats guessing another player's id.
2. getPlayerGameLog retries the gamelog with candidate seasons (current +
previous calendar year) ONLY when the first parse comes back empty
(filters-only), unlocking the dual-league athletes. The common path is
untouched.
MLB path (statsapi) unchanged; settlement/snapshot/frontend untouched.
Live probe: WNBA roster index = 206 players (Collier id 3917450 / Lynx team 8,
Brionna Jones id 3058895 present); NBA index = 544. Collier now resolves
end-to-end with 20 gamelog rows (was NOT FOUND); Brionna Jones likewise; all
previously-working players (A'ja Wilson, Ionescu, Clark, Stewart, Plum) still
resolve. NBA hyphen names (Gilgeous-Alexander) resolve via nameKey folding.
Tests: tests/unit/espnRosterIndex.test.js (9, fail-then-pass on base adapter).
Full backend suite 3183 green; web build exit 0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-07-14 00:21:59 -04:00
..
2026-06-08 18:35:13 -04:00
2026-06-11 03:48:07 -04:00
2026-03-21 14:21:34 -04:00
2026-06-10 13:24:11 -04:00
2026-07-10 21:34:26 -04:00
2026-07-10 21:34:26 -04:00
2026-06-10 19:41:37 -04:00
2026-06-18 20:15:38 -04:00
2026-06-18 20:15:38 -04:00
2026-07-12 23:41:13 -04:00
2026-07-13 03:48:58 -04:00
2026-06-13 12:37:08 -04:00
2026-07-11 14:28:18 -04:00
2026-07-11 14:28:18 -04:00
2026-07-13 13:22:49 -04:00
2026-07-12 13:42:18 -04:00
2026-03-21 14:21:34 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-07-12 19:34:12 -04:00
2026-07-13 16:58:22 -04:00
2026-07-13 16:58:22 -04:00
2026-07-13 16:58:22 -04:00
2026-07-11 14:29:31 -04:00
2026-06-11 16:21:18 -04:00
2026-06-10 14:50:13 -04:00
2026-06-08 18:35:13 -04:00
2026-06-13 21:30:57 -04:00
2026-06-13 21:30:57 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-03-21 12:45:15 -04:00
2026-06-18 20:15:38 -04:00
2026-06-18 20:15:38 -04:00
2026-07-12 19:25:32 -04:00
2026-07-13 00:07:06 -04:00
2026-07-12 19:45:07 -04:00
2026-07-13 03:48:58 -04:00
2026-07-10 20:17:49 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-06-18 15:38:06 -04:00
2026-07-13 11:44:15 -04:00
2026-07-13 18:44:57 -04:00
2026-07-13 18:12:31 -04:00
2026-07-14 00:21:59 -04:00
2026-07-13 13:18:59 -04:00
2026-07-13 18:12:31 -04:00
2026-07-11 00:47:01 -04:00
2026-06-08 18:35:13 -04:00
2026-07-13 18:44:57 -04:00
2026-06-10 19:41:37 -04:00
2026-06-10 14:50:13 -04:00
2026-06-08 18:35:13 -04:00
2026-07-13 23:27:19 -04:00
2026-07-13 23:33:26 -04:00
2026-06-10 19:41:37 -04:00
2026-06-10 03:37:07 -04:00
2026-07-13 14:36:28 -04:00
2026-06-15 18:21:32 -04:00
2026-06-08 18:35:13 -04:00
2026-07-13 13:18:59 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-06-12 11:16:58 -04:00
2026-07-13 15:26:48 -04:00
2026-06-10 22:24:40 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-06-10 20:45:05 -04:00
2026-07-11 20:08:24 -04:00
2026-03-21 11:41:18 -04:00
2026-06-18 20:15:38 -04:00
2026-07-11 20:08:24 -04:00
2026-07-11 19:32:22 -04:00
2026-07-13 13:58:01 -04:00
2026-03-21 14:21:34 -04:00
2026-06-08 18:35:13 -04:00
2026-06-13 12:37:08 -04:00
2026-07-12 00:45:29 -04:00
2026-07-12 00:45:29 -04:00
2026-07-13 14:59:44 -04:00
2026-07-11 14:31:35 -04:00
2026-03-21 14:21:34 -04:00
2026-06-08 18:35:13 -04:00
2026-06-11 16:21:18 -04:00
2026-06-08 18:35:13 -04:00
2026-06-19 01:45:36 -04:00
2026-06-18 23:56:26 -04:00
2026-07-13 03:48:58 -04:00
2026-07-11 00:59:17 -04:00
2026-06-19 15:45:07 -04:00
2026-06-19 10:20:55 -04:00
2026-06-19 02:42:13 -04:00
2026-06-18 15:38:06 -04:00
2026-07-13 22:30:50 -04:00
2026-07-11 14:29:22 -04:00
2026-07-13 23:33:26 -04:00
2026-07-13 23:27:19 -04:00
2026-06-15 18:21:32 -04:00
2026-06-10 03:37:07 -04:00
2026-03-22 05:11:42 -04:00
2026-06-08 18:35:13 -04:00
2026-07-13 16:58:22 -04:00
2026-07-13 23:33:26 -04:00
2026-06-08 18:35:13 -04:00
2026-06-12 02:41:51 -04:00
2026-06-14 22:29:01 -04:00
2026-06-12 02:41:51 -04:00
2026-06-19 10:20:55 -04:00
2026-06-08 18:35:13 -04:00
2026-07-11 14:34:45 -04:00
2026-07-13 22:30:50 -04:00
2026-07-10 17:00:29 -04:00
2026-07-13 14:59:44 -04:00
2026-06-11 16:21:18 -04:00
2026-06-11 16:21:18 -04:00
2026-06-12 02:06:22 -04:00
2026-06-19 15:45:07 -04:00
2026-03-21 12:45:15 -04:00
2026-07-13 14:36:28 -04:00
2026-06-19 11:25:14 -04:00
2026-06-10 09:28:30 -04:00
2026-06-13 12:37:08 -04:00
2026-07-11 14:28:18 -04:00
2026-07-11 14:28:18 -04:00
2026-06-08 18:35:13 -04:00
2026-03-22 05:11:42 -04:00
2026-03-22 05:11:42 -04:00
2026-07-10 17:00:29 -04:00
2026-07-10 22:24:47 -04:00
2026-07-13 16:02:16 -04:00
2026-06-18 20:15:38 -04:00
2026-06-18 23:56:26 -04:00
2026-06-18 20:15:38 -04:00
2026-06-19 01:45:36 -04:00
2026-06-18 23:56:26 -04:00
2026-06-18 20:15:38 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-06-18 23:56:26 -04:00
2026-06-19 02:42:13 -04:00
2026-07-11 14:24:41 -04:00
2026-06-14 22:29:01 -04:00
2026-06-08 18:35:13 -04:00
2026-07-11 19:38:37 -04:00
2026-06-12 00:54:39 -04:00
2026-06-12 11:16:58 -04:00
2026-07-11 19:32:22 -04:00
2026-06-13 10:57:49 -04:00
2026-06-12 02:06:22 -04:00
2026-06-08 18:35:13 -04:00
2026-06-10 03:12:20 -04:00
2026-06-10 01:22:55 -04:00
2026-06-11 21:22:59 -04:00
2026-06-08 18:35:13 -04:00
2026-06-12 17:58:55 -04:00
2026-07-12 00:45:29 -04:00
2026-07-13 16:02:16 -04:00
2026-07-12 19:25:32 -04:00
2026-07-11 14:24:41 -04:00
2026-03-21 10:58:58 -04:00
2026-06-08 18:35:13 -04:00
2026-07-11 20:08:24 -04:00
2026-06-08 18:35:13 -04:00
2026-06-10 20:45:05 -04:00
2026-06-18 11:12:24 -04:00
2026-06-18 15:38:06 -04:00
2026-06-18 20:15:38 -04:00
2026-06-18 11:12:24 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-03-21 11:41:18 -04:00
2026-06-08 18:35:13 -04:00
2026-07-11 14:28:18 -04:00
2026-07-10 22:24:47 -04:00
2026-06-18 20:15:38 -04:00
2026-07-11 19:32:17 -04:00
2026-06-18 23:56:26 -04:00
2026-06-19 13:55:39 -04:00
2026-07-13 13:18:59 -04:00
2026-06-10 14:50:13 -04:00
2026-06-10 20:45:05 -04:00
2026-06-10 14:50:13 -04:00
2026-06-16 14:37:07 -04:00
2026-06-10 14:50:13 -04:00
2026-06-11 18:15:25 -04:00
2026-06-19 14:25:05 -04:00
2026-07-13 16:58:22 -04:00
2026-06-08 18:35:13 -04:00
2026-06-12 15:45:19 -04:00
2026-06-12 11:16:58 -04:00
2026-06-08 18:35:13 -04:00
2026-06-18 11:12:24 -04:00
2026-07-11 00:39:18 -04:00
2026-06-12 11:16:58 -04:00
2026-06-11 16:21:18 -04:00
2026-06-08 18:35:13 -04:00
2026-07-11 14:34:45 -04:00
2026-06-11 10:06:49 -04:00
2026-06-12 11:16:58 -04:00
2026-06-10 19:41:37 -04:00
2026-06-11 16:21:18 -04:00
2026-07-13 00:31:35 -04:00
2026-06-19 15:45:07 -04:00
2026-06-08 18:35:13 -04:00
2026-06-19 01:45:36 -04:00
2026-06-18 21:34:29 -04:00
2026-06-10 13:24:11 -04:00
2026-07-13 13:58:01 -04:00
2026-07-11 14:24:41 -04:00
2026-06-08 18:35:13 -04:00
2026-06-10 14:50:13 -04:00
2026-03-21 12:45:15 -04:00
2026-07-10 20:17:49 -04:00
2026-07-11 14:31:53 -04:00
2026-07-13 00:31:35 -04:00
2026-07-10 22:24:47 -04:00
2026-07-12 19:28:17 -04:00
2026-06-16 01:04:37 -04:00
2026-07-10 20:17:49 -04:00
2026-06-11 16:21:18 -04:00
2026-06-08 18:35:13 -04:00
2026-06-08 18:35:13 -04:00
2026-06-10 14:50:13 -04:00