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
+7 -4
View File
@@ -4,6 +4,7 @@ from copy import deepcopy
from types import SimpleNamespace
from uuid import uuid4
import pytest
from tests.support.local_s2s_runtime import make_local
from app.infrastructure.realtime import canonical_json
from app.modules.voice.durable_tools import DurableTools, DurableFailure
from tests.unit.test_realtime_phase1 import runner, persisted, make, input_turn, response, call, done, until
@@ -20,10 +21,11 @@ def source_events(out):
@pytest.mark.parametrize('refs', [['S2'], ['S1', 'S3'], []])
def test_only_reported_sources_reach_ui_and_duplicate_report_is_idempotent(runner, persisted, refs):
@pytest.mark.parametrize('provider',['openai','local_s2s'])
def test_only_reported_sources_reach_ui_and_duplicate_report_is_idempotent(runner, persisted, refs, provider):
result = evidence()
async def scenario():
runtime, wire, out = await make(SimpleNamespace(engine=None,
runtime, wire, out = await (make_local if provider=='local_s2s' else make)(SimpleNamespace(engine=None,
search=lambda *_: deepcopy(result)), runner, persisted)
try:
await input_turn(runtime)
@@ -61,9 +63,10 @@ def test_only_reported_sources_reach_ui_and_duplicate_report_is_idempotent(runne
@pytest.mark.parametrize('args', [dict(source_refs=['S99']), dict(source_refs=['S1','S1']),
dict(source_refs=['S1'], document_id='forged'), dict(source_refs='S1'), {},
dict(source_refs=[None])])
def test_invalid_reports_never_publish_sources(runner, persisted, args):
@pytest.mark.parametrize('provider',['openai','local_s2s'])
def test_invalid_reports_never_publish_sources(runner, persisted, args, provider):
async def scenario():
runtime, wire, out = await make(SimpleNamespace(engine=None,
runtime, wire, out = await (make_local if provider=='local_s2s' else make)(SimpleNamespace(engine=None,
search=lambda *_: evidence()), runner, persisted)
try:
await input_turn(runtime)