Commit Graph
6 Commits
Author SHA1 Message Date
Aman TahilianiandClaude Opus 5.5 09bbccff93 fix(championship): drop cancelled rounds and declare a clinched title (#110)
* fix(championship): drop cancelled rounds and declare a clinched title

The championship hub counted cancelled meetings (2026 Bahrain/Saudi) as
rounds, reporting 25 total / 6 left instead of 23 / 4. Title math then used
6 x 25 = 150 pts as the ceiling, so a 119-pt gap still looked "alive" after
Antonelli had mathematically clinched the title.

- Skip cancelled meetings and cancelled Race/Sprint sessions in both the
  local (query) and OpenF1 aggregation paths.
- Track pending sprints and return sprints_left + max_points_left
  (25/race + 8/sprint) so title math is sprint-aware.
- Frontend: use max_points_left for alive/out, gap annotations and the
  simulator; show a CHAMPION state, "has clinched" title math, and a
  Champion stat tile once P2 cannot catch the leader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(championship): resolve ties on countback in title math

Review feedback:
- Local standings broke points ties by driver number, so a season ending
  level could crown the wrong driver. Order ties by FIA countback (most GP
  wins, then P2s, ...) before falling back to driver number.
- An exact-gap lead was always treated as open. It is a clinch when the
  leader still wins the countback even if the rival takes every remaining
  GP. Every rival, not just P2, is now checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 18:40:37 -08:00
Aman Tahiliani 16d82afad5 fix(championship): include Sprint points in standings
- GetChampionshipInputs now sums Race + Sprint sessions per meeting
- Bahrain 1282 / Saudi 1283 cancelled (Force Majeure) - intentional Round 9/24
- 2026 sprints up to British GP: 11240 Chinese, 11275 Miami, 11286 Canadian, 11321 British
  Totals ANT +21, RUS +26, HAM +18 etc.
- Adds regression test TestGetChampionshipInputsIncludesSprintPoints (25+8=33)
- Fixes #57
2026-07-10 23:32:12 -04:00
AmanTahiliani 127628e4dd Speed up championship hub loading 2026-07-03 01:11:31 -04:00
AmanTahiliani 1661f8dec3 Add local navigation API 2026-05-25 02:25:06 -04:00
AmanTahiliani c7438f0ed8 Add analytics data foundation 2026-05-25 02:04:16 -04:00
AmanTahiliani e08255db70 Add local-first race hub API 2026-05-25 00:49:13 -04:00