Commit Graph

62 Commits

Author SHA1 Message Date
leubeem
c9f51f757f 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
dc45de6c94 copilot 2026-05-19 12:46:31 +02:00
leubeem
e807e483ce 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
b6ca2091a0 komplette 320 sops 2026-05-06 15:51:58 +02:00
itsrubberduck
7a863f0678 redeisng to match osq 2026-04-25 20:52:25 +02:00
itsrubberduck
d3e6787836 first version looks ok 2026-04-25 20:29:09 +02:00
itsrubberduck
837c1ef623 feat: update classroom feedback round 2 content 2026-02-27 13:03:04 +01:00
itsrubberduck
5dae46cea5 feat(learn-pfd): add pitch-based speed hold step and target speed zones 2026-02-21 00:08:16 +01:00
itsrubberduck
6cf5a8f39e 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
7862f1ffd4 Bridge dome light mode mapping and flightlab seat belt flow 2026-02-18 22:43:56 +01:00
itsrubberduck
bf4ce3abdf typescript 2026-02-17 18:19:55 +01:00
itsrubberduck
4a01593612 fix typescript errors and update dependencies 2026-02-17 18:13:04 +01:00
itsrubberduck
562ad236a2 use 6 digit codes for bridge 2026-02-16 15:47:12 +01:00
itsrubberduck
46f95baf9e 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
56bd770a13 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
d4190c9d95 dont log users id on transmission 2026-02-13 18:44:34 +01:00
itsrubberduck
c6e7eb396f 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
cabdc8db6d fix pm 2026-02-13 08:50:02 +01:00
Remi
317151dfa7 Brighten high-readability profiles and default to level 5 2025-10-18 21:39:23 +02:00
Remi
2884c4af4c Loosen readability 4-5 filters for clarity 2025-10-18 21:33:52 +02:00
Remi
291c18ed03 Normalize taxi routes for clearer speech 2025-10-18 21:29:56 +02:00
itsrubberduck
56fff99437 fix radiocall sign missing in mayday and panpan 2025-10-18 11:09:52 +02:00
Remi
d0f3d07200 feat: surface pilot intent from llm decisions 2025-10-16 21:07:21 +02:00
Remi
d9ca19404a Add simple auto flow evaluation for communication engine 2025-10-14 12:02:49 +02:00
itsrubberduck
651a41106f merge 2025-10-12 15:42:18 +02:00
Remi
911c44b50b Add feedback page and gate classroom behind orientation 2025-10-05 14:37:06 +02:00
Remi
79a30c905e feat: add classroom search and advanced drills 2025-10-05 09:31:00 +02:00
Remi
7f2585c211 Improve flow activation handling and expose active nodes 2025-09-23 23:12:02 +02:00
Remi
a2eaf47dc8 Refine readback field placeholders 2025-09-22 08:31:55 +02:00
Remi
72ba74dc11 Adjust frequency change lesson call sign 2025-09-22 08:29:26 +02:00
Remi
dbfa7a3044 Revise fundamentals lessons and add frequency handoff 2025-09-22 08:05:04 +02:00
Remi
3c12f6d836 feat: allow manual unlocks in learn missions 2025-09-22 07:40:15 +02:00
Remi
fbec5c4830 Add session timeline logging and admin sessions view 2025-09-21 23:08:10 +02:00
itsrubberduck
428dac07f0 shorten title name 2025-09-21 22:41:43 +02:00
Remi
6c9f467b94 Enable flow-aware decision routing 2025-09-21 21:16:33 +02:00
itsrubberduck
af5a480f2d fix syntax error 2025-09-21 17:44:14 +02:00
itsrubberduck
d2a7918e38 merge 2025-09-21 17:43:45 +02:00
Remi
e50eb66b2a Add mission planning flow to learn page 2025-09-21 17:02:47 +02:00
itsrubberduck
42f701dc08 change mission modules 2025-09-21 16:09:05 +02:00
Remi
a01d83de50 Rebuild learn modules with updated chapters 2025-09-21 14:49:32 +02:00
itsrubberduck
cd94f7c83c change learn image 2025-09-20 23:42:02 +02:00
Remi
526f74c3b1 Build decision flow editor and runtime integration 2025-09-20 18:33:32 +02:00
Remi
45f405485c Fix learn TTS speed control 2025-09-20 12:13:49 +02:00
Remi
341a39e7d8 refactor: share llm decision types 2025-09-20 09:27:45 +02:00
Remi
103fdd6bbc feat: improve learn experience 2025-09-19 23:01:39 +02:00
itsrubberduck
4a9fec3ef9 use new images 2025-09-19 16:49:15 +02:00
Remi
af804d48b6 refactor: externalize learn modules and reduce reactivity 2025-09-19 16:46:18 +02:00
Remi
7db4d0357e Refactor radio audio effects and use in learn page 2025-09-19 13:20:00 +02:00
Remi
d034116ea5 Adjust learn page settings and defaults 2025-09-19 11:29:57 +02:00
itsrubberduck
0abd7c049e replace fower to four becaus tts doesnt work 2025-09-19 09:43:01 +02:00