Skip to content

feat: modernize CLI, fix telemetry gaps, add Tyre Strategy insight, and setup CI/infra#287

Open
JuanjoRestrepo wants to merge 4 commits into
IAmTomShaw:mainfrom
JuanjoRestrepo:feature/modernize-cli-telemetry
Open

feat: modernize CLI, fix telemetry gaps, add Tyre Strategy insight, and setup CI/infra#287
JuanjoRestrepo wants to merge 4 commits into
IAmTomShaw:mainfrom
JuanjoRestrepo:feature/modernize-cli-telemetry

Conversation

@JuanjoRestrepo

@JuanjoRestrepo JuanjoRestrepo commented May 6, 2026

Copy link
Copy Markdown

Pull Request: CLI Modernization, Telemetry Correctness, and Tyre Strategy Insight

Visuals

New Tyre Strategy Live Data Window

image

PR Context: Complementary Tyre Insights & Core Stability

I am aware of the recent "Stint Tracker" work by @loisekk. This PR is intended to be complementary to that effort. While the stint tracker provides a visual history of compound changes, this PR focuses on a Live Data Table approach for the Tyre Strategy window—prioritizing high-precision, real-time metrics (Exact Tyre Life, Speed, and computed Gaps/Intervals).

Additionally, this PR provides a major infrastructure overhaul (CLI modernization, Telemetry distance fixes, and CI/CD setup) that ensures the underlying data stream is accurate for all future insights.

Key Changes

1. Entrypoint & CLI Correctness

  • Typed Argument Parsing: Replaced ad-hoc sys.argv logic with argparse in main.py.
  • Lazy Imports: GUI-heavy modules are now loaded only when needed for CLI-only environments.
  • Practice Support: Added support for Practice sessions via --practice {1,2,3} or aliases --fp1/--fp2/--fp3.

2. Telemetry & Data Correctness

  • Cumulative Distance Fix: Resolved a bug where race distance was not advancing correctly per lap, which is essential for stable leaderboard ordering.
  • Computed Gap Fields: Added gap_to_leader_s and interval_ahead_s to telemetry frame payloads.
  • Cache Safety: Implemented session-aware cache suffix mapping to prevent session collisions.

3. Leaderboard Stability

  • Distance-Based Progress: Introduced _driver_progress_m to prefer stable distance-based ordering, resolving the "jitter" duringoverlaps and pit stops.

4. Infrastructure & Tooling

  • Packaging: Added pyproject.toml using uv standards for modern dependency management.
  • CI/CD: Added a GitHub Actions workflow for automated sanity checks and tests.

Verification Run

  • Tests: uv run python -m pytest tests/test_main_cli.py -q -> 7 passed.
  • Linting: Verified with Ruff on all modified files.
  • Manual: Verified --help, --list-rounds, and isolation testing for the Tyre Strategy window.

…nd setup CI/infra

Major chunk of work including:
- argparse implementation in main.py
- lazy loading of GUI modules
- fix cumulative race distance and add gap/interval fields
- session-aware cache suffixing
- distance-based leaderboard ordering
- production-ready Tyre Strategy insight window
- pyproject.toml and GitHub Actions CI setup
- synced documentation and added CLI regression tests
@loisekk

loisekk commented May 6, 2026

Copy link
Copy Markdown
Contributor

I went through your code properly, not just the PR description.

The distance fix in process_single_driver makes sense — total_dist_so_far carrying across laps is the right approach, the reset was silently messing up leaderboard ordering the whole time. Gap fields and in_pit flag are cleanly added into the payloads. Cache suffix map is a good catch for sprint weekend collisions.

CLI looks much cleaner now with argparse and lazy imports. Tyre Strategy window is actually hooked into the live stream which is good to see. Tests are covering real cases too. And the Safety Car simulation with the deploy, on-track and return phases — that wasn't even mentioned in the description, nice addition.

Went through all of it — the bug fixes, the replaced parts, the new features. Everything looks properly done. Good stuff, happy to see this :)

@JuanjoRestrepo

JuanjoRestrepo commented May 7, 2026

Copy link
Copy Markdown
Author

Thank you so much for the detailed review @loisekk

I'm glad the distance-tracking fix and the Safety Car simulation resonated those were definitely the "hidden" stability improvements I wanted to ensure were solid.

Regarding the conflicts: I've just pushed a resolve. Since your "Stint Tracker" and my "Live Tyre Info" table provide different but equally valuable perspectives, I've integrated both into the project.

  • Tyre Strategy: Your visual stint history window remains as the default.
  • Live Tyre Info: My table-based view (with real-time gaps and speed) is now available as a second option in the Insights Menu.

This way, users can choose between a visual timeline or a precise data table depending on their needs.

@loisekk

loisekk commented May 8, 2026

Copy link
Copy Markdown
Contributor

Thank you for integrating both approaches . Your solution here is thoughtful—keeping the visual timeline as default while adding the data table as an option respects both perspectives. That's exactly the kind of collaborative design I was hoping for.

The Live Tyre Info table with real-time gaps and speed fills a gap (good) Combined with the Stint Tracker, users now get flexibility to analyze in whatever way makes sense for their workflow. Really appreciate you taking the time to merge these thoughtfully instead of choosing one over the other.

Looking forward to testing this out :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants