- tests/: 38 pytest tests (under 10 s, no network) on synthetic races with
known answers: track snapping and lap counting, pit-stop timing (OpenF1's
pit time is the exit), Safety Car codes, the per-lap table, safe file
names, the race simulator (pace, pit loss, traffic, Safety Car laps), the
what-if engine, model data prep, and the server API. 8 deliberately
inserted bugs were each caught by a failing test.
- ci.yml: tests on every push and PR; tested pushes to master are pushed to
the Hugging Face Space (needs an HF_TOKEN secret; skipped with a warning
without it).
- refresh-data.yml: every Tuesday, downloads new races from OpenF1, commits
ml/laps_train.csv and deploys so the Space retrains. Refuses to commit if
the race count drops or the file outgrows Hugging Face's 10 MB limit.
- serve.py: no side effects on import (make_server/main), static files
served from the app folder, allow_reuse_address set before bind.
- fetch_data.py: pit-window rule extracted into pit…