test(e2e): live-server voice-recognition gate test#10324
Merged
Conversation
Add mock-backend VoiceEmbed/VoiceVerify (deterministic DC-offset speaker discrimination) and a verify-mode gated realtime pipeline, then drive the real HTTP/WS stack: an authorized speaker reaches response.done while an unauthorized one is dropped before the LLM with a speaker_not_authorized event. Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude:opus-4.8 [Claude Code]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-up to the realtime voice-recognition gate (already merged): a live-server e2e that exercises the gate end to end through the real HTTP/WebSocket stack.
It drives
httpapi.API→/v1/realtime(WebSocket) →runRealtimeSession→newVoiceGate(real gRPC to a speaker backend) →commitUtterance→Authorize(real gRPC) → the hard barrier before the LLM.How
No GPU or real models needed. The existing
tests/e2emock-backend gains two RPCs:VoiceEmbed/VoiceVerifywith a deterministic, resampling-robust speaker discriminator: the signed DC offset of the audio maps to one of two orthogonal unit embeddings. A positive bias is the enrolled (authorized) speaker; a negative bias is a different (unauthorized) one.A
mock-speakermodel and a verify-moderealtime-pipeline-gatedmodel are added to the suite (verify mode enrolls a reference WAV at model load, so it needs no registry/store backend and runs fully in-process).Specs (
tests/e2e/realtime_voicegate_test.go)response.done, no reject event.speaker_not_authorizedevent and noresponse.done(dropped before the LLM).Verified on latest
master:2 Passed | 0 Failed, and the fullRealtimelabel still green (no regressions). Logs confirm each real step (reference enrolled at load, per-utterance embed over gRPC, gate allow/reject).Assisted-by: Claude:opus-4.8 [Claude Code]