Fix the doubled /leaderboard path — the fielding feed 404'd silently

BASE already ends in /leaderboard, so the new feed built
.../leaderboard/leaderboard/outs_above_average and 404'd. Because a failing
feed degrades to an EMPTY index by design -- correct behaviour, so one broken
source cannot fail the whole mechanism pull -- it surfaced as 'fielding_oaa: 0
rows' rather than as an error, which reads exactly like 'Statcast has no
fielding data'. Worth noting as a class: graceful degradation makes a wiring
bug look like an honest absence.

Verified: 514 fielders, 31 teams. Cubs +56 OAA, Mariners -29.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W1sivYNqY2TS5ftykmHBU9
This commit is contained in:
Kev
2026-08-03 22:07:40 -04:00
parent 010a876b3c
commit 25e36c0257
+4 -1
View File
@@ -71,7 +71,10 @@ const FEEDS = Object.freeze({
// other six feeds measures fielding at all, and the obvious substitutes // other six feeds measures fielding at all, and the obvious substitutes
// (a team's pitchers' hits-allowed) conflate pitching WITH defence and would // (a team's pitchers' hits-allowed) conflate pitching WITH defence and would
// validate the wrong skill. Measured live 2026-08-03: 513 fielders. // validate the wrong skill. Measured live 2026-08-03: 513 fielders.
fielding_oaa: (y) => `${BASE}/leaderboard/outs_above_average?type=Fielder&startYear=${y}&endYear=${y}&split=no&team=&range=year&min=1&pos=&roles=&viz=hide&csv=true`, // NOTE: BASE already ends in /leaderboard — do not repeat it here (a doubled
// path 404s, and because a failed feed degrades to an EMPTY index by design,
// it reports as "0 fielders" rather than as an error).
fielding_oaa: (y) => `${BASE}/outs_above_average?type=Fielder&startYear=${y}&endYear=${y}&split=no&team=&range=year&min=1&pos=&roles=&viz=hide&csv=true`,
}); });
/** statsapi — free, no key. Two calls that complete the Tier-A joins. /** statsapi — free, no key. Two calls that complete the Tier-A joins.