feat(voice): implement local S2S retained history and provider selection

Add pinned CPU engine dependencies, retained interrupted-response history, provider admission, offline evaluation and isolated browser tooling.

Record Phase 2 acceptance and Phase 3/4 preparation, bounded paid-test accounting and interruption incident findings. Human interruption acceptance, paired OpenAI evaluation and rollback remain pending.
This commit is contained in:
11linear11
2026-10-16 17:09:27 -04:00
parent 8d348f0ba1
commit a94b8cd3ea
111 changed files with 14764 additions and 58 deletions
+24
View File
@@ -0,0 +1,24 @@
"""Shared runtime with local adapter and explicitly simulated native setup I/O."""
from uuid import uuid4
from app.infrastructure.local_s2s import LocalS2SAdapter
from app.modules.voice.runtime import VoiceRuntime
from app.modules.voice.settings import RuntimeSettings
from tests.unit.test_local_s2s_phase2 import local_config, confirmed
from tests.unit.test_realtime_phase1 import Transport, commands, until
async def make_local(service, runner, persisted):
wire, output = Transport(), []
adapter = LocalS2SAdapter(wire, config=local_config(local_s2s_retain_interrupted_answers=True),
settings=RuntimeSettings(_env_file=None))
async def emit(event):output.append(event)
async def authority(execution):
return persisted['enabled'] and execution.capture(
dict(id=execution.user_id,organization_id='fixture',role='user'),persisted['epoch'])
runtime = VoiceRuntime(adapter,service,runner,uuid4(),emit,authority_check=authority)
await runtime.start()
await until(lambda:commands(wire,'session.update'))
session=confirmed(adapter);session['id']='fixture-native-session'
await runtime.handle(dict(type='session.updated',session=session))
await until(lambda:runtime.ready)
return runtime,wire,output