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:
@@ -1,6 +1,9 @@
|
||||
# Local speech-to-speech adapter: phased implementation plan
|
||||
|
||||
Date: 2026-10-15. Status: **Phase 1 offline implementation delivered; Phase 2 candidate prepared; build/live acceptance pending**.
|
||||
Date: 2026-10-16. Status: **Phase 1 accepted for provider-boundary/OpenAI preservation;
|
||||
Phase 2 accepted; Phase 3 retained-answer implementation/live pending; Phase 4 preparation including frontend selection in progress**.
|
||||
|
||||
[Final Phase 2 acceptance](../evaluation/local-s2s/phase-02-accepted-20261016.md) records actual browser/provider evidence, green scoped tests and retained billing uncertainty. No operational promotion or interruption acceptance.
|
||||
|
||||
## 1. Outcome and scope
|
||||
|
||||
@@ -14,7 +17,10 @@ This is a plan, not authorization to switch the running application, download
|
||||
weights or perform unbounded paid evaluation. The original eight stages are consolidated into four phases without removing scope.
|
||||
Each phase has a tangible demo,
|
||||
acceptance criteria, evidence and a copy-ready English prompt. Phase 1 offline
|
||||
evidence is in [its report](../evaluation/local-s2s/phase-01.md); no phase is accepted.
|
||||
evidence is in [its report](../evaluation/local-s2s/phase-01.md); subsequent real
|
||||
OpenAI listening/native cleanup acceptance is recorded in the
|
||||
[Linux report](../evaluation/local-s2s/phase-01-linux-preparation.md). Phases 2-4
|
||||
remain unaccepted.
|
||||
|
||||
## 2. Target architecture
|
||||
|
||||
@@ -202,6 +208,8 @@ phases. The preserved OpenAI path remains the fallback chosen by the operator.
|
||||
|
||||
## Phase 3 - Complete interruption, shared RAG and used sources
|
||||
|
||||
**User amendment (2026-10-16):** The user revoked whole-response deletion and requested retaining interrupted answers for repeated questions. Keep the original text in a bounded same-session archive and mark its model-context representation explicitly as not fully heard. Do not infer a heard prefix or claim full delivery. Document facts still require backend evidence revalidation. This supersedes the earlier unheard-text-removal criterion; live/RAG acceptance remains mandatory.
|
||||
|
||||
**Visible outcome:** The user interrupts and continues safely, receives correct document answers and sees only valid used sources; repeated interrupted searches are not duplicated.
|
||||
|
||||
**Entry:** Phase 2 accepted. Local engine history ownership and compatibility gaps are understood; shared SearchService remains authoritative.
|
||||
@@ -210,9 +218,9 @@ phases. The preserved OpenAI path remains the fallback chosen by the operator.
|
||||
|
||||
- First implement/prove local interruption and history synchronization. Patch/version the pinned engine narrowly if it cannot apply the required real mutation.
|
||||
- Cover active generation AND already-completed generation with queued unplayed audio. Track operation/response/item/segment/session identities and actual played coordinates.
|
||||
- Inspect the next real controlled LLM request: unheard assistant sentinel text must be absent while valid previous user/tool/assistant context remains. Do not infer text alignment from duration/character ratios.
|
||||
- Inspect the next real controlled LLM request: the interrupted sentinel must remain only in explicitly marked unheard draft context, while valid previous user/tool/assistant context remains. Do not infer text alignment from duration/character ratios.
|
||||
- Accept only receipts emitted after the actual mutation with applied history revision/provenance. Missing, wrong, stale or conflicting receipts fail within bounded deadlines; runtime retains release authority.
|
||||
- If exact heard-prefix repair is unproven, keep the gate open. Whole-turn rollback or fully-played-segment retention is a weaker policy requiring explicit acceptance and contract documentation.
|
||||
- Use the user-selected retain_unheard_draft_v1 policy: keep raw interrupted text, annotate rather than erase its context, and attest the applied mutation. Do not advertise word-level alignment, exact heard-prefix repair or delivery of the entire draft.
|
||||
- Suppress obsolete STT/LLM/TTS outputs even if remote inference keeps computing. Keep backend retained retrieval separate from speech cancellation and preserve original deadlines.
|
||||
- Then expose search_knowledge, reuse_last_evidence and report_used_sources through the existing backend dispatcher/ToolContext/DurableTools/SearchService; never add engine DB authority or a parallel RAG implementation.
|
||||
- Preserve successful-terminal tool validation, call/item/response dedup, backend scope, calibrated eligible retrieval, source identities and handoff/delivery revalidation.
|
||||
@@ -236,6 +244,14 @@ phases. The preserved OpenAI path remains the fallback chosen by the operator.
|
||||
|
||||
## Phase 4 - Validate quality/cost and prove controlled switch/rollback
|
||||
|
||||
**User-authorized preparation amendment (2026-10-16):** Implement independent
|
||||
Phase 4 preparation while real Phase 3 checks remain pending; run the remaining
|
||||
real tests together later. Add frontend OpenAI/local_s2s selection with server-owned
|
||||
allowlisting, frozen per-session provider identity and close/fresh-session switching.
|
||||
This does not waive Phase 3 acceptance, measured quality/cost, or actual operational
|
||||
switch/rollback authorization. [Prepared implementation](../evaluation/local-s2s/phase-04.md).
|
||||
|
||||
|
||||
**Visible outcome:** A paired OpenAI/local scorecard supports the deployment decision, and the preserved OpenAI container is demonstrably restorable without rebuild.
|
||||
|
||||
**Entry:** Phase 3 accepted. Frozen corpus/model profiles, bounded live evaluation authorization and reviewable deployment/rollback configuration are available.
|
||||
|
||||
Reference in New Issue
Block a user