Skip to content

feat: analysis hall + on-track HUD + no-fake-fallback sweep + docs - #37

Merged
mlnomadpy merged 1 commit into
masterfrom
mlnomadpy/montreal-v3
May 26, 2026
Merged

feat: analysis hall + on-track HUD + no-fake-fallback sweep + docs#37
mlnomadpy merged 1 commit into
masterfrom
mlnomadpy/montreal-v3

Conversation

@mlnomadpy

Copy link
Copy Markdown
Owner

Summary

Big sprint bundle. Three top-level themes:

  1. Analysis Hall + On-Track HUD — two flagship surfaces rebuilt from scratch around real data.
  2. No-fake-fallback sweep — deep audit + removal of hardcoded/templated data across pages and stores. Real bridge endpoints or honest "DATA UNAVAILABLE" — nothing in between.
  3. Bridge endpoints + Termux fixes — 5 new routes, parquet exports work on SQLite (Termux), pyarrow shim, full docs refresh.

PWA — Analysis Hall (new tabbed UI)

  • pages/analysis-hub/AnalysisHub.vue rewritten as 6-tab UI (Overview/Telemetry/Systems/IMU/Signals/Modules) under pages/analysis-hub/tabs/
  • DuckDB-wasm + Leaflet + Chart.js (lazy-loaded, worker bundled same-origin — fixes the jsdelivr CORS error)
  • analysisStore (Pinia) with sessionId/laps/selectedLapIndex/filterOutliers/activeTab + lapFilterSql getter
  • shared/lib/telemetry/outliers.ts (SANITY_RANGES + clipOutliers) and shared/lib/telemetry/queries.ts (decimation + signal helpers)
  • New shared/ui/charts/CyberLineChart.vue wrapper
  • Sonoma centerline + raw GPS + virtual path mapped from distance_m (mirrors the standalone HTML viewer)

PWA — On-Track HUD (cockpit-minimal redesign)

  • Critical bug fix: reactive sid via computed (explicit > replay source > /health active_session_id) + watcher. Previously const sid = activeSessionId ?? '' was captured statically and the SSE was opened with empty sid → REPLAY ACTIVE pill showed but no frames flowed.
  • useLapDerivation composable derives lap_number from cumulative distance / track_length_m (bridge doesn't emit lap_number)
  • New AgentTraceDrawer (T key, polls /coach/traces only while open — battery-aware on Pixel 10)
  • New CoachVoiceButton FAB (M key) + Shift+D debug overlay
  • New HudCornerTile widget; Pixel 10 landscape (2424×1080)
  • WAITING-FOR-DATA overlay with one-click START REPLAY
  • Empty-state policy: tiles hidden until firstFrameAt is set (no scrambled grid)

PWA — 8 pages newly tabbed

Settings, CarSetup, Calibration, HardwareDetail, PitStall, QuestLog, EndOfDay, PreBrief, LivePitWall (via CyberTabs)

Bridge — new endpoints

  • GET /session/<sid>/laps — GPS+distance+stint lap detection
  • GET /coach/traces?session_id=&limit=&since_ts=agent_traces table polling
  • GET /leaderboard?track=&limit= — best-lap aggregation
  • GET /carsdata/cars/*.yaml scan + currently-loaded flag
  • GET /session/<sid>/export.parquet: SQLite path via streaming pyarrow batches; telemetry_signals + signal_registry now include session_id column (fixes DuckDB-wasm binder errors in Analysis Hall queries)

No-fake-fallback sweep

Stores: medalStore honest empty state; telemetryStore.startSimulation() Math.sin/cos fakes removed; litert_coach._templated_pre_brief dropped; /coach/brief response exposes error from llm_friction row.

Pages wired to real endpoints: CarSetup→/cars, TrackAtlas→/track/{markers,danger_zones,elevation,weather}, LapTimesHall type-drift fix, StageClear→/session/<sid>/scorecard + /coach/debrief, DriverEvolution drops fake median, TrainerCard→/driver/<id>/profile, PreBrief preflight bound to /health, LiveCarState coaches from /coach/agents + /capabilities, GarageHub counts from real stores.

Removed: SponsorContractsBody hardcoded sponsors, OnboardingFlow default car, CoachCodexMode fake emotion, ModulesTab literal tile counts, HardwareDetail hardcoded modal fields, OnTrackHud session.totalLaps reference.

Docs (refreshed/rewritten)

README.md, docs/api.md, docs/architecture.md, docs/stack.md, docs/hardware.md, data/README.md, docs/pitwall-web-design.md, docs/ux.md, docs/coaching-engine.md, docs/adk-agent-architecture.md, docs/litert_termux_validation.md, deploy/phone/README.md. NEW: docs/analysis-hall.md, docs/on-track-hud.md.

Tests

  • tests/features/coaching/test_coach_traces.py (5/5)
  • tests/features/test_api_cars.py (2/2)
  • tests/features/test_api_leaderboard.py (3/3)
  • src/pwa/tests/{analysisStore,outliers}.test.ts (11/11)
  • cd src/pwa && npm run build → 125 entries, 3700 KiB, 0 errors

Test plan

  • Open /garage/analysis — session picker populated, no DuckDB worker errors in console
  • Pick a session — Overview tab shows real Sonoma map (centerline + raw GPS + virtual path), summary stats from real DB
  • Cycle laps via ←/→, toggle outliers with O, switch tabs 16
  • Open /hud — WAITING overlay appears (3s grace), click START REPLAY, picker starts replay, REPLAY ACTIVE pill, telemetry flows, lap number derives from distance, GPS dot traces minimap
  • Press T — AgentTraceDrawer opens (will show "AGENT TRACE UNAVAILABLE — google-adk not installed" until ADK is installed on phone)
  • Press M — voice FAB activates (Web Speech API; /coach/ask returns 503 until ADK is installed)
  • Press Shift+D — debug overlay shows live sid/frames/age/lap

PWA — Analysis Hall (new):
- AnalysisHub.vue rewritten as 6-tab UI (Overview/Telemetry/Systems/IMU/
  Signals/Modules), under pages/analysis-hub/tabs/
- DuckDB-wasm + Leaflet + Chart.js (lazy-loaded, worker bundled
  same-origin to avoid jsdelivr CORS)
- analysisStore (Pinia) with sessionId/laps/selectedLapIndex/
  filterOutliers/activeTab + lapFilterSql getter
- New shared lib: telemetry/outliers.ts (SANITY_RANGES + clipOutliers)
  and telemetry/queries.ts (decimation + signal helpers)
- New shared/ui/charts/CyberLineChart.vue Chart.js wrapper
- Track JSON fetched from src/pwa/public/data/

PWA — On-Track HUD (redesigned):
- Reactive sid via computed: explicit > replay source > /health
  active_session_id (fixes "REPLAY ACTIVE but no data" bug — SSE was
  opened with empty sid and never resubscribed)
- useLapDerivation composable derives lap_number from cumulative
  distance / track_length_m (bridge doesn't emit lap_number)
- New AgentTraceDrawer (T key, polls /coach/traces only while open)
- New CoachVoiceButton FAB (M key) + Shift+D debug overlay
- New HudCornerTile widget; cockpit-minimal layout, Pixel 10 landscape

PWA — 8 pages newly tabbed: Settings, CarSetup, Calibration,
HardwareDetail, PitStall, QuestLog, EndOfDay, PreBrief, LivePitWall
(via CyberTabs)

Bridge — new endpoints:
- /session/<sid>/laps (GPS+distance+stint lap detection)
- /coach/traces (agent_traces table polling)
- /leaderboard (best-lap aggregation)
- /cars (data/cars/*.yaml scan + currently-loaded flag)
- /session/<sid>/export.parquet: SQLite path via streaming pyarrow
  batches; telemetry_signals + signal_registry now include session_id
  column

No-fake-fallback sweep:
- entities/quest/medalStore: honest empty state
- entities/session/telemetryStore: removed startSimulation() fakes
- coaching/litert_coach: dropped _templated_pre_brief
- coaching/bp_coaching: /coach/brief response exposes error from
  llm_friction row
- Pages wired to real endpoints: CarSetup -> /cars, TrackAtlas ->
  /track/{markers,danger_zones,elevation,weather}, LapTimesHall type-
  drift fix, StageClear -> /session/<sid>/scorecard + /coach/debrief,
  DriverEvolution drops fake median, TrainerCard -> /driver/<id>/
  profile, PreBrief preflight bound to /health, LiveCarState coaches
  from /coach/agents + /capabilities, GarageHub counts from real
  stores
- Removed: SponsorContractsBody hardcoded sponsors, OnboardingFlow
  default car, CoachCodexMode fake emotion, ModulesTab literal tile
  counts, HardwareDetail hardcoded modal fields, OnTrackHud
  session.totalLaps reference

Docs (refreshed/rewritten):
- README.md, docs/api.md, docs/architecture.md, docs/stack.md,
  docs/hardware.md, data/README.md
- docs/pitwall-web-design.md, docs/ux.md
- docs/coaching-engine.md, docs/adk-agent-architecture.md,
  docs/litert_termux_validation.md, deploy/phone/README.md
- NEW: docs/analysis-hall.md, docs/on-track-hud.md

Tests:
- tests/features/coaching/test_coach_traces.py (5/5)
- tests/features/test_api_cars.py (2/2)
- tests/features/test_api_leaderboard.py (3/3)
- src/pwa/tests/{analysisStore,outliers}.test.ts (11/11)
@mlnomadpy
mlnomadpy merged commit a6aa7da into master May 26, 2026
0 of 4 checks passed
@mlnomadpy
mlnomadpy deleted the mlnomadpy/montreal-v3 branch May 26, 2026 19:18
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.

1 participant