GO-LIVE - third steps #102

Closed
opened 2026-05-11 21:15:57 +02:00 by thomasknaus · 0 comments
thomasknaus commented 2026-05-11 21:15:57 +02:00 (Migrated from github.com)

System: Du bist ein erfahrener Rust Backend/Desktop Engineer. Erzeuge für jede der folgenden P0‑Aufgaben einen vollständigen, reviewbaren PR. Jeder PR enthält: Branchname, Commit‑Message, PR‑Titel, PR‑Body (Problem, Risiko, Änderung, Tests), minimalen Diff (Rust), und mindestens einen Unit/Integrationstest. Führe nur Änderungen in den angegebenen Dateien durch. Stoppe nach Erzeugung eines PR und warte auf Bestätigung.

Kontext: Repo enthält Desktop App und Backend. Relevante Dateien: engine_bridge.rs, race_orchestrator.rs, qwen_manager.rs, command_matcher.rs, PATTERNS_AND_COMMANDS.md, config.rs, udp_listener.rs.

P0 Tasks (in Reihenfolge)

  1. Fix lap assignment
  • Branch: fix/p0-lap-assignment
  • Files: desktop-app/src/services/engine_bridge.rs
  • Change: Replace current_status.lap = state.position; with current_status.lap = state.car_status.current_lap;
  • Add Unit Test: tests/unit/test_lap_assignment.rs that constructs a state with car_status.current_lap and asserts mapping.
  • PR Body: Problem, Risiko, Änderung, Tests, Checklist.
  1. Unify commands loading
  • Branch: fix/p0-centralize-commands
  • Files: desktop-app/src/services/engine_bridge.rs, desktop-app/src/services/command_matcher.rs, desktop-app/src/state.rs or AppState
  • Change: Load commands.json once into AppState.commands (Arc<RwLock<Vec>>). Inject reference into RaceOrchestrator and CommandMatcher. Remove duplicate file loads.
  • Add Integration Test: tests/integration/test_commands_consistency.rs that modifies commands.json and asserts both components see same set after reload.
  1. Qwen Hot-Reload propagation
  • Branch: fix/p0-qwen-hot-reload
  • Files: desktop-app/src/services/qwen_manager.rs, desktop-app/src/services/engine_bridge.rs, desktop-app/src/race_orchestrator.rs
  • Change: QwenManager exposes a watch::Sender<Option<Arc>>; Orchestrator holds watch::Receiver and updates internal client on change. Ensure thread-safety and no blocking.
  • Add Integration Test: tests/integration/test_qwen_hot_reload.rs that simulates license upgrade and asserts Orchestrator uses Qwen for next NLG call.
  1. Session type mapping
  • Branch: fix/p0-session-type-mapping
  • Files: desktop-app/src/race_orchestrator.rs, desktop-app/src/config.rs
  • Change: Add missing session types SPRINT and WARMUP to session_type_to_str and update allowed_sessions validation if needed.
  • Add Unit Test: tests/unit/test_session_type_mapping.rs.

Execution constraints

  • Keep diffs minimal and focused.
  • No global mutable statics without safe wrappers.
  • Replace unwrap/expect in changed code paths.
  • Run cargo fmt and ensure cargo build and cargo test pass locally (conceptually).

Output required for each PR

  • Branch name
  • Commit message
  • PR title
  • PR body (Problem, Risk, Change list, Tests)
  • Minimal unified diff (only changed lines)
  • Test file path and test snippet
  • Local verification steps (1–3 commands)

Begin with Task 1 (lap assignment). Produce the full PR output and stop.

System: Du bist ein erfahrener Rust Backend/Desktop Engineer. Erzeuge für jede der folgenden P0‑Aufgaben einen vollständigen, reviewbaren PR. Jeder PR enthält: Branchname, Commit‑Message, PR‑Titel, PR‑Body (Problem, Risiko, Änderung, Tests), minimalen Diff (Rust), und mindestens einen Unit/Integrationstest. Führe nur Änderungen in den angegebenen Dateien durch. Stoppe nach Erzeugung eines PR und warte auf Bestätigung. Kontext: Repo enthält Desktop App und Backend. Relevante Dateien: engine_bridge.rs, race_orchestrator.rs, qwen_manager.rs, command_matcher.rs, PATTERNS_AND_COMMANDS.md, config.rs, udp_listener.rs. P0 Tasks (in Reihenfolge) 1) Fix lap assignment - Branch: fix/p0-lap-assignment - Files: desktop-app/src/services/engine_bridge.rs - Change: Replace `current_status.lap = state.position;` with `current_status.lap = state.car_status.current_lap;` - Add Unit Test: tests/unit/test_lap_assignment.rs that constructs a state with car_status.current_lap and asserts mapping. - PR Body: Problem, Risiko, Änderung, Tests, Checklist. 2) Unify commands loading - Branch: fix/p0-centralize-commands - Files: desktop-app/src/services/engine_bridge.rs, desktop-app/src/services/command_matcher.rs, desktop-app/src/state.rs or AppState - Change: Load commands.json once into AppState.commands (Arc<RwLock<Vec<Command>>>). Inject reference into RaceOrchestrator and CommandMatcher. Remove duplicate file loads. - Add Integration Test: tests/integration/test_commands_consistency.rs that modifies commands.json and asserts both components see same set after reload. 3) Qwen Hot-Reload propagation - Branch: fix/p0-qwen-hot-reload - Files: desktop-app/src/services/qwen_manager.rs, desktop-app/src/services/engine_bridge.rs, desktop-app/src/race_orchestrator.rs - Change: QwenManager exposes a watch::Sender<Option<Arc<QwenClient>>>; Orchestrator holds watch::Receiver and updates internal client on change. Ensure thread-safety and no blocking. - Add Integration Test: tests/integration/test_qwen_hot_reload.rs that simulates license upgrade and asserts Orchestrator uses Qwen for next NLG call. 4) Session type mapping - Branch: fix/p0-session-type-mapping - Files: desktop-app/src/race_orchestrator.rs, desktop-app/src/config.rs - Change: Add missing session types SPRINT and WARMUP to session_type_to_str and update allowed_sessions validation if needed. - Add Unit Test: tests/unit/test_session_type_mapping.rs. Execution constraints - Keep diffs minimal and focused. - No global mutable statics without safe wrappers. - Replace unwrap/expect in changed code paths. - Run `cargo fmt` and ensure `cargo build` and `cargo test` pass locally (conceptually). Output required for each PR - Branch name - Commit message - PR title - PR body (Problem, Risk, Change list, Tests) - Minimal unified diff (only changed lines) - Test file path and test snippet - Local verification steps (1–3 commands) Begin with Task 1 (lap assignment). Produce the full PR output and stop.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thomas_knaus/RaceEngineer#102
No description provided.