Three end-to-end tests exercising the full slice-3 stack in-process: MockRealtimeBrain + brain-process-equivalent shim (riding on the public run_openai_pump library function) + spawn_tap_engine + TapAudioPipe. No subprocess, no real OpenAI credentials, no browser. - audio_round_trip_pushes_pcm_and_receives_canned_response (§7.5 #3): push PcmFrame via TapAudioPipe -> engine -> brain shim -> run_openai_pump -> translator -> input_audio_buffer.append -> MockRealtimeBrain -> canned response.audio.delta -> translator -> audio_out tap frame -> TapAudioPipe.next_pcm_frame. Catches any break in the audio pipeline; completes in ms. - function_call_hangup_dispatches_and_closes_session (§7.4 + §7.5 #3): ToolRegistry.dispatch("hangup") -> HangupTool.call -> AppState::close -> session removed from DashMap, returns Ok({channel_state: Closing}). Drives the registry via the public Arc<Mutex<ToolRegistry>> handle on TapConn (in-process drain_function_calls is private to session_map, its behavior is covered by session_map.rs:451's inline test). - s4_brain_sends_session_update_with_turn_detection_null_end_to_end (§7.5 #7): the brain process equivalent sends session.update with turn_detection: null on pump startup (run_openai_pump's first action). MockRealtimeBrain rejects non-null with a typed OpenAI-shaped error (mock.rs:150). Stack comes up without WS errors + engine reconnect_attempts stays 0 -> S4 honored end-to-end through the actual translator. Note: AGENTS.md says browser-driven e2e is deferred post-slice-1, so the test pushes PCM directly through TapAudioPipe (the slice-2 tap_integration.rs harness pattern), not via a real str0m peer. Files added: crates/rutster/tests/realtime_integration.rs (new test). Files modified: crates/rutster/Cargo.toml adds rutster-brain-realtime (mock feature) as dev-dep so the test can drive run_openai_pump + MockRealtimeBrain in-process; Cargo.lock regenerated. Seam test honored: loop_driver.rs and rtc_session.rs untouched. All 91 workspace tests green. cargo fmt --all --check + cargo clippy --all --all-targets -- -D warnings clean.
48 KiB
48 KiB