You liked the NRFI Desk direction — now I'll make it actually live so it grades real games daily. The key upgrade: replace the demo profiles with real data pulled at load time:
- Slate + probable pitchers + posted lineups — MLB Stats API (
schedule with hydrations)
- Pitcher 1st-inning splits — MLB Stats API
statSplits with sitCode i01 (real first-inning ERA/WHIP/runs-per-start)
- Team 1st-inning scoring + YRFI rate — computed from real linescores over the trailing 3 weeks
- Top-4 hitter OBP/OPS/K% — batch people stats once lineups post
- Weather — Open-Meteo per stadium
- Poisson model — each half-inning's expected runs →
e^-λ scoreless probability, exactly how a real NRFI model should work
Let me rewrite the app:
Now add the small CSS additions for the new elements (skeleton loading, warn note, sample note, hint):
Build is clean. NRFI Desk is now live and usable daily. Here's what changed under the hood:
Real data, fetched fresh every time you load or change the date:
- Slate + probable pitchers + posted lineups — MLB Stats API schedule with
team, probablePitcher, lineups, and venue hydrations
- Pitcher 1st-inning splits — real
statSplits with sitCode i01: actual first-inning ERA, WHIP, and runs-allowed-per-start for every probable starter, plus season ERA, K-BB%, HR/9
- Team 1st-inning form — computed from real linescores over the trailing 21 days: 1st-inning runs per game and true YRFI rate for every team, with the league baseline recalculated daily instead of hardcoded
- Top-4 hitters — when the lineup card posts, the actual top four's season OBP, OPS, and K% are pulled and averaged; until then the game carries a "lineup pending" warning
- Weather — current stadium conditions from Open-Meteo for every outdoor venue; roofed parks are marked as controlled environments
The model is now a proper Poisson engine: each half-inning gets an expected-runs λ built from pitcher factor (real 1st-inning runs/start), team form factor, lineup factor, park, and weather — then P(scoreless) = e^−λ, and NRFI = P(top) × P(bottom). The λ values are shown in each game's detail so you can see exactly why a number is what it is.
Daily workflow:
- Open the site → today's slate loads and grades automatically
- Morning: pitchers are announced but lineups aren't → most games sit at Watch
- 2–4 hours before first pitch: hit re-sync → lineups post, top-4 gates activate, games move to Live or Skip
- Your threshold and dark-mode preference persist between visits
Honest edges: umpire assignments aren't in the public feed, so the environment panel explicitly tells you to verify the plate ump manually — that stays a manual check in your routine. If it's offseason or the API is unreachable, it falls back to a clearly-labeled demo slate rather than pretending.
One heads-up: the i01 inning-split sitCode is the standard MLB Stats API convention, but if a pitcher's split comes back empty the model automatically falls back to season ERA and flags the thin sample as a warning — it will never silently pretend it has first-inning data it doesn't have.
Files built: src/App.tsx, src/index.css