Commit Graph

92 Commits

Author SHA1 Message Date
leubeem
2069663f01 feat: wire Python backend session to PTT, add pm.vue debug logger
- Pass  as top-level field in PTT requests so Whisper STT
  results are linked to the correct Python backend session
- Add namespaced  helper in pm.vue (info/warn/error/debug/group)
  controlled by localStorage PM_DEBUG flag; logs transmit/response
  cycles, TTS calls, flag/variable syncs, and fallback warnings
- Log backend session creation context (flow, start state, vars, flags)
  in startMonitoring
- Fix typo in text input hint: STT fails not PTT fails

and

fix: sync backend variables to frontend after each transmission

The ATC say template was rendered using the frontend engine's local
variable defaults (squawk '1234', hardcoded SID, etc.) instead of
the authoritative values from the Python backend session. This caused
the spoken clearance and the readback prompt to show different squawk
codes.

- After each backend transmission response, sync all response.variables
  into vars.value (same pattern already used for flags)
- Prefer controller_say_rendered (pre-rendered by backend) over the raw
  template for TTS scheduling, eliminating any remaining dependency on
  local variable state for the ATC speech text
2026-05-20 16:44:01 +02:00
itsrubberduck
f721fd1536 copilot 2026-05-19 12:46:31 +02:00
leubeem
9464d37293 Wire /pm to Python backend for stateful ATC training sessions
Replace the LLM-per-request flow in /pm with a stateful Python backend
(OpenSquawk-LiveATC-api). The backend owns session state, does regex-first
routing with readback evaluation, and returns the next state + ATC speech.
The frontend keeps its local cursor (communicationsEngine) for TTS and
monitoring UI, but no longer calls /api/llm/decide.

Changes:

app/composables/useRadioBackend.ts (new)
  Typed Nuxt composable wrapping the Python REST API:
  createSession, transmit, deleteSession, fetchFlows.
  Base URL read from NUXT_PUBLIC_RADIO_BACKEND_URL (default 127.0.0.1:8000).

nuxt.config.ts
  Expose radioBackendUrl as a public runtime config key so the composable
  and communicationsEngine can both reach the Python backend.

shared/utils/communicationsEngine.ts
  - fetchRuntimeTree now accepts an optional baseUrl so it fetches from the
    Python backend instead of the Nuxt server when a URL is provided.
  - renderTpl handles both {var} (old MongoDB schema) and {{var}} (new YAML
    schema) — double-brace matched first to avoid partial matches.
  - stateSayTpl / stateUtteranceTpl helpers unify say_tpl|say_template and
    utterance_tpl|expected_pilot_template across both schema versions.
  - auto_transitions from the new YAML schema are included when collecting
    eligible transitions in collectAtcStatesUntilPilotTurn.

shared/types/decision.ts
  RuntimeDecisionState extended with say_template and expected_pilot_template
  fields (new YAML schema field names alongside the existing legacy names).

app/pages/pm.vue
  - startMonitoring: loads tree from Python backend, then creates a backend
    session (backendSessionId). Cursor synced to session.current_state.
  - handlePilotTransmission: calls radioBackend.transmit instead of
    /api/llm/decide. Applies auto_advanced_states via moveToSilent, then
    the final state. Speaks controller_say_template via TTS.
  - Both fetchRuntimeTree calls now pass radioBackendUrl so they hit the
    Python backend, not the Nuxt flow-from-MongoDB path.

AGENTS.md (new)
  Project guide updated to document the new two-backend architecture,
  the Python backend session lifecycle, and the dual template schema.

docs/plans/2026-05-06-pm-python-runtime-contract.md (new)
  Implementation plan and API contract written before the work started.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 17:49:28 +02:00
itsrubberduck
ae3dab6f9d komplette 320 sops 2026-05-06 15:51:58 +02:00
itsrubberduck
20358eea6c redeisng to match osq 2026-04-25 20:52:25 +02:00
itsrubberduck
bbcd9dca54 first version looks ok 2026-04-25 20:29:09 +02:00
itsrubberduck
e792b09671 feat: update classroom feedback round 2 content 2026-02-27 13:03:04 +01:00
itsrubberduck
f5509d9fce claude hat das pfd sehr krass ueberarbeitet 2026-02-21 18:04:37 +01:00
itsrubberduck
febe4d907a feat(pfd): realistic styling, flight inertia, and improved training exercises
- Darken all tape backgrounds to match real A320 PFD (#16181f/#1c1e26)
- Speed/altitude readouts green (#19e34a) instead of cyan
- Attitude indicator: sky/ground gradients, W-shaped aircraft symbol
- Speed tape: cyan target zone (not red), VFE/min-speed red bands
- Altitude tape: ticks on left side toward attitude indicator
- Flight physics: 3x slower pitch (smoothed, tau 2s), halved roll rate,
  stronger speed-pitch coupling for realistic 150t inertia
- Pitch/bank exercises use normal flight ranges (±10° bank, ±3-4° pitch)
- Multi-phase speed exercise: explain → coarse hold 5s → fine hold 8s
- ATC messages emphasize small inputs, patience, and anticipation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 15:45:39 +01:00
itsrubberduck
06f277e3ee feat(learn-pfd): add pitch-based speed hold step and target speed zones 2026-02-21 00:08:16 +01:00
itsrubberduck
b83ccf2c7c engine thr mehr respektieren 2026-02-20 23:55:45 +01:00
itsrubberduck
ef8f1a1991 feat(engine): add learn-pfd engine composable with goal evaluation
Composable manages phase navigation, interaction goal monitoring with
hold-time validation, progress tracking, and hint system for the
learn-pfd medienstation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 23:01:16 +01:00
itsrubberduck
636f7f7e12 feat(data): add learn-pfd scenario phases with progressive PFD element introduction
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 18:33:15 +01:00
itsrubberduck
c4c841a2c1 feat(ws): add stick-input WebSocket message handler and client support
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 18:30:26 +01:00
itsrubberduck
4e74b74255 feat(fbw): add Airbus Normal Law FBW physics composable
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 18:30:16 +01:00
itsrubberduck
3f28abae1f feat(types): add LearnPfdPhase, PFD element types, and stick-input WS event
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 18:29:01 +01:00
itsrubberduck
352ad8d68e feat(flightlab): simplify takeoff flow and wait for TTS before auto-advance 2026-02-19 00:04:21 +01:00
itsrubberduck
d40259d03c manuelle anpassungen an der config 2026-02-18 23:19:37 +01:00
itsrubberduck
f384e30b9b feat(flightlab): add seatbelt phases to stepper and escape shortcuts 2026-02-18 22:52:23 +01:00
itsrubberduck
390c38d8bd Bridge dome light mode mapping and flightlab seat belt flow 2026-02-18 22:43:56 +01:00
itsrubberduck
5915479c1a hoehen anpassen damit alles etwas ruhiger wird 2026-02-18 19:35:07 +01:00
itsrubberduck
c605705a38 change default settings 2026-02-18 18:05:12 +01:00
itsrubberduck
f88fced5b1 typescript 2026-02-17 18:19:55 +01:00
itsrubberduck
8f45c3397d fix typescript errors and update dependencies 2026-02-17 18:13:04 +01:00
itsrubberduck
3d5a18df6a use 6 digit codes for bridge 2026-02-16 15:47:12 +01:00
itsrubberduck
36f5a72c66 fix(flightlab): prevent overlapping takeoff voices on rapid phase changes 2026-02-15 18:05:11 +01:00
itsrubberduck
bb73b43a89 refactor(flightlab): rewrite takeoff texts for simulator context and auto-stop sounds on phase change
Rewrote all takeoff scenario texts from passive fear-of-flying coaching
to active simulator operation instructions (thrust levers, sidestick,
rudder pedals, gear lever, instrument readings). Stop looping ambient
sounds automatically when transitioning to phases that don't reference them.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 16:50:04 +01:00
itsrubberduck
7a1f35bc90 refactor(flightlab): remove instructor flow and simplify takeoff controls 2026-02-15 16:32:20 +01:00
itsrubberduck
5a25e212d7 fix(classroom): audio speed slider now actually changes playback speed with pitch correction
- Fix client: playbackRate was set to 1 for non-native-speed providers (Speaches/Piper),
  making the speed slider ineffective in the main Pizzicato audio path
- Fix server: pass speed parameter to Speaches TTS API
- Add pitch-preserving playback via MediaElementSourceNode when rate != 1,
  routing through the same Web Audio effects chain (radio filters, distortion, etc.)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 01:01:02 +01:00
itsrubberduck
ea51e1dcc3 feat(classroom): integrate user feedback — audio speed, METAR TTS, phonetics, UI fixes
- Lower default audio speed to 0.85x, extend slider range to 0.5-1.3x
- Add METAR normalization for intelligible TTS (wind, vis, clouds, temp, QNH)
- Expand SID/STAR suffix regex to handle spaces (SUGOL 2S)
- Add approach suffix phonetic expansion (ILS 08R Y → Yankee)
- Fix "Soll:" → "Expected:" in readback feedback
- Accept numeric values for pushback delay field
- Add news article documenting the changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 14:21:35 +01:00
itsrubberduck
77ecd49334 feat(flightlab): sidebar, progress bars, skip speech, SimBridge telemetry & auth
- Add collapsible sidebar with phase stepper (jump between phases)
- Add SimBridge conditions panel in sidebar (live values, progress bars, targets)
- Add global progress bar (top edge, glowing) + phase-local TTS progress bar
- Add skip button to skip TTS speech while ATC is speaking
- Add skipSpeech() to audio composable (stops current Pizzicato sound)
- Wire up bridge data.post.ts with user auth (JWT) + example payload
- Add server-side telemetry store with pub/sub for Bridge→WS relay
- Extend WS handler with subscribe-telemetry message + userId tracking
- Extend sync composable with subscribeTelemetry() + onTelemetry() callback
- Add require-auth middleware to all flightlab pages
- Fix instructor station ECONNREFUSED via import.meta.client guard
- Add animations: phase transitions, button lists, fade-scale, check-pop, pulse

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 10:14:33 +01:00
itsrubberduck
2efa24f7f5 umalute fixen 2026-02-13 18:49:56 +01:00
itsrubberduck
a915af4398 dont log users id on transmission 2026-02-13 18:44:34 +01:00
itsrubberduck
25378db177 fix(flightlab): resolve TypeScript strict null checks in engine composable
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 18:01:05 +01:00
itsrubberduck
9923cbbd5d feat(flightlab): add WebSocket sync composable for instructor-participant sessions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:45:45 +01:00
itsrubberduck
4696885f8b feat(flightlab): add audio composable with TTS radio effects and ambient cockpit sounds
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:44:33 +01:00
itsrubberduck
ea878662f8 feat(flightlab): add scenario engine composable with phase navigation and progress tracking
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:23:32 +01:00
itsrubberduck
f778f60ac9 feat(flightlab): add complete takeoff EDDF scenario with all phases and comfort branches
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:23:05 +01:00
itsrubberduck
e8b36177ed feat(flightlab): add type definitions for FlightLab scenario engine
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:20:26 +01:00
itsrubberduck
d90b494334 fix pm 2026-02-13 08:50:02 +01:00
Remi
b602a16cef Brighten high-readability profiles and default to level 5 2025-10-18 21:39:23 +02:00
Remi
5b12888212 Loosen readability 4-5 filters for clarity 2025-10-18 21:33:52 +02:00
Remi
86727e7749 Normalize taxi routes for clearer speech 2025-10-18 21:29:56 +02:00
itsrubberduck
cbbe902187 fix radiocall sign missing in mayday and panpan 2025-10-18 11:09:52 +02:00
Remi
faebc91ebb feat: surface pilot intent from llm decisions 2025-10-16 21:07:21 +02:00
Remi
5037da189f Add simple auto flow evaluation for communication engine 2025-10-14 12:02:49 +02:00
itsrubberduck
87b2e3b215 merge 2025-10-12 15:42:18 +02:00
Remi
913a118124 Add feedback page and gate classroom behind orientation 2025-10-05 14:37:06 +02:00
Remi
0ec0ebcad3 feat: add classroom search and advanced drills 2025-10-05 09:31:00 +02:00
itsrubberduck
fb4cf53a89 insight into research 2025-10-04 16:49:44 +02:00