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
@@ -892,3 +892,33 @@ a session echo alone is insufficient. Interruption requiring history repair fail
closed pending Phase 3. Preserve owner, Origin, cookie, CSRF, replay, profile and
epoch checks. Candidate startup requires dedicated test DB/storage. Build and
real Persian/browser acceptance remain open; see [Phase 2 evidence](../evaluation/local-s2s/phase-02.md).
## User-authorized provider selection amendment — 2026-10-16
The Phase 4 development UI may select an existing server-configured provider;
it cannot choose model/voice, change audio policy, supply credentials or override
identity/scope. This supersedes the earlier no-provider-selector UI restriction
for this explicitly requested capability. It does not authorize promotion.
- Authenticated `GET /api/v1/voice/sessions/providers` returns `default_provider`,
`connection_checked=false` and `providers` rows `{id,label,can_start,reason}`.
IDs are openai/local_s2s/gemini. Reasons are disabled, not_configured,
isolated_environment_required or calibration_required. Eligibility is server
configuration/capability evidence, not a remote health or quality check.
- `GET /api/v1/configuration` accepts an optional provider enum and evaluates that
allowed provider's existing capability gates; omission retains prior behavior.
- V01 accepts optional `provider` from the same enum. Only the default plus
`VOICE_SELECTABLE_PROVIDERS` may be newly admitted; missing credentials never
fall back. Other provider/model/audio fields remain forbidden.
- V01/V03 responses add the frozen `provider` field. An explicit different provider
on the same client_request_id is IDEMPOTENCY_CONFLICT (409), including concurrent
creation. Replay without an explicit choice recovers the original frozen row
before current configuration checks. No old profile is rewritten.
- Stream admission selects server settings for the row's pinned, currently allowed
provider, then applies the existing model/profile/search/owner/Origin/cookie/epoch
checks. Local requests still require disposable database/storage isolation.
- Changing provider ends the old call and requires a fresh session/request identity.
No seamless media switch or automatic cross-provider fallback is introduced.
Provider secrets and tuned OpenAI speech settings stay server-side. Selection adds
no tables/migrations or document-content versioning.