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:
@@ -0,0 +1,103 @@
|
||||
# Phase 2 real components under a $1 authorization — 2026-10-16
|
||||
|
||||
Later billing follow-up: the three successful calls below now have provider
|
||||
records: TTS $0.00078 + STT $0.000308333 + LLM $0.00003 = **$0.001118333**.
|
||||
The failed WAV attempt is excluded. Earlier pending-billing observations below
|
||||
are historical; the newer native-turn bill remains unresolved.
|
||||
|
||||
Three actual component calls succeeded: Gemini 3.8 Flash-Lite TTS/Kore produced
|
||||
Persian PCM, Whisper large-v3 transcribed it, and GPT-4.1 mini replied in Persian.
|
||||
There was also one earlier failed WAV-format speech attempt, HTTP400. No automatic
|
||||
retry or model substitution occurred. Phase 2 is **in_progress**: the user accepted pronunciation of the single saved sample. Real native-engine/
|
||||
browser integration and final billing remain unaccepted.
|
||||
|
||||
[Machine-readable evidence](phase-02-real-components-20261016.json) records the
|
||||
actual request headers/IDs, usage, stage timing and qualifications. Audio is in
|
||||
ignored `.local-s2s-build/persian-real-tts-one-dollar.wav`, SHA-256
|
||||
`1edd8a6ef0182664f58dc6a37464bcfee3ab434e225c161aab3890930fda0998`.
|
||||
|
||||
## Authorization, cost and containment
|
||||
|
||||
The user authorized starting real testing with a **$1 total limit** and supplied
|
||||
an OpenRouter key. Read-only metadata showed that key's existing provider cap was
|
||||
$5, not $1; it was not a management key. No key cap or operational credential was
|
||||
changed. The supplied secret was stored only in ignored local storage with 0600
|
||||
permissions and is absent from these reports and scripts.
|
||||
|
||||
[The bounded runner](live-components-one-dollar.py) reserves cost before sending
|
||||
each request, persists failed/in-flight admissions, uses no client retries, and
|
||||
refuses accidental re-execution of an existing ledger. The initial sequence
|
||||
reserved $0.25 TTS + $0.05 STT + $0.01 LLM. After the sole WAV HTTP400 it stopped.
|
||||
An explicitly announced PCM-format correction matching the native engine retained
|
||||
that first reservation and added $0.31, for **$0.56 total reserved** across four
|
||||
attempts. This is below the authorization; it is not a provider-enforced $1 key cap.
|
||||
|
||||
The reservation is based on captured [official model metadata](https://openrouter.ai/api/v1/models?output_modalities=all)
|
||||
and [TTS endpoints](https://openrouter.ai/api/v1/models/google/gemini-3.8-flash-lite-tts/endpoints):
|
||||
both TTS endpoints list 8192 maximum prompt tokens and 16384 completion tokens at
|
||||
$0.0000005/$0.000006 per token. Even both full endpoint maxima total $0.2048,
|
||||
below the $0.25 reservation for one TTS attempt. STT is limited to ten seconds;
|
||||
its $0.05 reservation exceeds a full minute at every listed route. LLM input is
|
||||
bounded and output capped at 128 tokens, with provider price limits and fallback
|
||||
disabled. These caps apply to this evaluation only; operational voice limits stay.
|
||||
|
||||
Actual reported STT cost is **$0.000308333333333**, with ten billed seconds for
|
||||
5.16 seconds of audio. LLM reported **$0.00003**, 39 prompt and nine completion
|
||||
tokens. Their combined reported cost is **$0.000338333333333**.
|
||||
**TTS cost and the final total are not yet verified.** Read-only generation lookups
|
||||
for the three returned IDs yielded404, and the key usage total had not changed
|
||||
at the final lookup. That zero delta is not proof the calls were free. Keep the
|
||||
entire $0.56 reservation; no further paid requests were made and no final cost
|
||||
acceptance is claimed.
|
||||
|
||||
No ML engine/container, startup probes, database, browser, user microphone or
|
||||
operational service was launched. The small HTTP runner ran stages sequentially,
|
||||
avoiding the earlier native-test memory pressure. No models were downloaded and
|
||||
no audio buffers, speed or provider selection were modified.
|
||||
|
||||
## Actual observations
|
||||
|
||||
| Stage | Outcome |
|
||||
| --- | --- |
|
||||
| Initial TTS/WAV | HTTP400; original error body was not retained, so its precise cause is not established |
|
||||
| Explicit TTS/PCM correction | HTTP200 in 2.730 s; 247680 raw bytes; provider Content-Type declares `audio/pcm;rate=24000;channels=1` |
|
||||
| STT/multipart, language fa | HTTP200 in 1.946 s; Persian text returned |
|
||||
| LLM | HTTP200 in 0.784 s; Persian greeting; successful stop terminal |
|
||||
|
||||
The saved WAV contains **123840 PCM16 mono samples**, 5.16 seconds using the
|
||||
provider-declared 24 kHz rate. Its WAV header was constructed locally; it is not
|
||||
independent measurement of the physical sample rate. The real PCM endpoint now
|
||||
has compatibility evidence; the rejected WAV request is not hidden or classified
|
||||
as a proven format-specific provider defect without its missing error body.
|
||||
|
||||
TTS source text:
|
||||
|
||||
> سلام، این یک آزمایش کوتاه برای بررسی صدای فارسی است.
|
||||
|
||||
Actual STT:
|
||||
|
||||
> سلام، این یک آزمایش کتاه برای بررسی صدای فارسی است.
|
||||
|
||||
The transcript differs at «کوتاه/کتاه». The user listened and reported
|
||||
«تلفظ خوب و قابل قبول بود» on 2026-10-16. This accepts pronunciation of the
|
||||
single saved sample; the written recognition mismatch is retained. This one synthetic example is
|
||||
not a Persian accuracy benchmark, naturalness score, accent/noise test or RAG
|
||||
answer-quality evaluation. Actual LLM reply was «سلام! حالت چطوره؟ 😊» under a
|
||||
small greeting-only test instruction; production policy adherence was not tested.
|
||||
The single generated sample has passed user listening; the LLM reply has not yet been synthesized here.
|
||||
|
||||
The run order was **TTS → STT → LLM** to avoid sending an unconsented existing
|
||||
voice clip to a provider. Only the fixed test text and its generated audio were
|
||||
sent. A full browser conversation and synthesis of the LLM reply were not run.
|
||||
|
||||
## Validation and next gate
|
||||
|
||||
Offline budget check and a negative authorization-overflow check passed before
|
||||
execution; `git diff --check` passed. No broad application tests were rerun for
|
||||
this standalone evaluation. Existing 110-test/native evidence remains separate.
|
||||
The ledger is exclusive and intentionally prevents repeating paid requests by
|
||||
running the command again. Do not delete it to bypass the cumulative budget.
|
||||
|
||||
Next: reconcile billing and prepare bounded real-engine/browser acceptance
|
||||
within the remaining authorization. Single-sample listening is accepted.
|
||||
No spending beyond the retained reservation or Phase 2 acceptance is implied.
|
||||
Reference in New Issue
Block a user