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
2026-03-03 00:51:53 -05:00
2026-03-03 00:51:53 -05:00
2026-05-24 20:56:00 -04:00

box-box

"Box, box. Box, box." Every F1 race engineer, ever.

box-box is an unofficial F1 race-weekend command center: live timing, Race Hub analytics, championship context, paddock briefing feeds, and local historical data in one Go + React app, with a preserved Bubble Tea TUI.

Live demo: box-box.amantahiliani.com

box-box Command Center

What It Does

  • Command Center: current race-weekend home with GP identity, live status, schedule, championship leaders, and direct analysis links.
  • Race Hub: session workspace for overview, race story, strategy, laps, weather, race control, and dataset coverage.
  • Live Timing: official F1 SignalR feed bridged through the Go server to the browser via SSE.
  • Championship View: standings, form, teammate context, cumulative points, and a simulator.
  • Paddock Briefing: RSS/Atom news ingestion for a local race-weekend briefing surface.
  • Local-first history: OpenF1 data ingested into a SQLite domain database for fast historical browsing.
  • Terminal Mode: Bubble Tea TUI with standings, calendar, driver profiles, live timing, track map, battles, pit window, and replay.

Quickstart

git clone https://github.com/AmanTahiliani/box-box.git
cd box-box

npm install
npm install --prefix frontend

npm run build --prefix frontend
go run ./cmd/main.go --web
# http://localhost:8080

For a local frontend development loop with seeded data, see docs/getting-started.md.

Project Shape

Area What lives there
cmd/main.go Entry point for TUI, web server, and ingestion CLI
internal/web/ Go REST API, SSE live bridge, SPA serving
internal/live/ Official F1 SignalR client shared by Web and TUI
internal/store/, internal/ingest/, internal/query/ Local SQLite domain database, ingestion, and read models
internal/ui/ Bubble Tea TUI
frontend/ React + Vite + TypeScript web app
tests/ Playwright e2e and visual coverage

The Web UI is local-first and should call the Go APIs under /api/v1/...; it should not read OpenF1 directly.

Documentation

  • Getting Started: install, build, run modes, TUI keybindings, and web routes.
  • Data and Operations: ingestion, environment variables, local files, and live timing notes.
  • Testing: Go, frontend, e2e, and visual regression commands.
  • Architecture Notes: deeper design rationale, data-source decisions, and phase history.

Status

Pre-beta and actively developed. The Web UI is the primary surface; the TUI is preserved and still useful for terminal workflows. Live timing depends on F1 broadcasting timing data, so it is only fully active during live sessions.

License

MIT © Aman Tahiliani

Unofficial project; not associated with Formula 1 or the FIA.

S
Description
No description provided
Readme
69 MiB
0 Stars 1 Watchers 0 Forks
Languages
Go 44.1%
TypeScript 41.4%
CSS 9.4%
JavaScript 2.9%
HTML 1%
Other 1.2%