33 Commits

Author SHA1 Message Date
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
8f45c3397d fix typescript errors and update dependencies 2026-02-17 18:13:04 +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
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
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
itsrubberduck
fb4cf53a89 insight into research 2025-10-04 16:49:44 +02:00
Remi
ba93c494c9 Add session timeline logging and admin sessions view 2025-09-21 23:08:10 +02:00
Remi
10cae457f9 Enable flow-aware decision routing 2025-09-21 21:16:33 +02:00
Remi
cf6748b9bc Build decision flow editor and runtime integration 2025-09-20 18:33:32 +02:00
Remi
880605b262 Fix learn TTS speed control 2025-09-20 12:13:49 +02:00
Remi
1711ed1e5e refactor: share llm decision types 2025-09-20 09:27:45 +02:00
Remi
29ee3143e4 feat: improve learn experience 2025-09-19 23:01:39 +02:00
Remi
9e25c91446 Refactor radio audio effects and use in learn page 2025-09-19 13:20:00 +02:00
itsrubberduck
6e6576dd68 replace fower to four becaus tts doesnt work 2025-09-19 09:43:01 +02:00
Remi
b22b460513 refactor: centralize radio speech normalization 2025-09-19 09:20:04 +02:00
itsrubberduck
576fd83dc8 merge 2025-09-19 08:55:49 +02:00
Remi
c18568f12b Translate pilot monitoring and learn pages 2025-09-19 08:54:57 +02:00
Remi
641042ac75 Translate news posts and remove banners 2025-09-18 23:49:41 +02:00
Remi
422035dff7 Add ATIS quick actions and airport frequency data 2025-09-18 18:16:40 +02:00
Remi
a4b8a0ca2f Align public messaging and add news banners 2025-09-17 19:22:56 +02:00
itsrubberduck
57403d27aa merge 2025-09-17 16:01:32 +02:00
Remi
7644b895c4 Add automated flight simulation trace for pilot monitoring 2025-09-17 15:56:09 +02:00
Remi
e6755d2042 Revise landing messaging and add news feed 2025-09-17 15:44:41 +02:00
Remi
fe66a4c04c Implement authentication, waitlist, and logging upgrades 2025-09-16 17:28:34 +02:00
itsrubberduck
e155434b57 refactor: update OpenAI TTS integration and cleanup imports
- index.vue: comment out cockpit simulator image
- learn.vue: remove unused imports (useRadioTTS, learnModules)
- atc/say.post.ts & utils/normalize.ts: rename openaiOld → normalize, adjust TTS calls, skip ensureDir/writeFile
- communicationsEngine.ts: fix atcDecisionTree import path
2025-09-16 16:14:12 +02:00
Remi
d69c01e97a Refine pilot monitoring communication flow 2025-09-16 15:48:00 +02:00
itsrubberduck
059dc656b3 The system now intelligently handles edge cases while maintaining the core decision tree structure. The LLM will follow the schema when possible but can respond naturally when the pilot says something unexpected, making it much more realistic and flexible for training scenarios 2025-09-16 12:38:15 +02:00
itsrubberduck
4b8da310b4 new version of pm using decision tree 2025-09-16 12:23:32 +02:00