feat(voice): implement local S2S responsiveness candidate and direct TTS routing

Add local S2S responsiveness candidate pinning ASR options and sentence-at-a-time generation. Route speech synthesis directly to OpenAI API for fluent Persian phonetics with gpt-4o-mini-tts-2025-12-15. Add responsiveness, budget carry, and browser watch unit tests along with acceptance benchmarks and evaluation evidence.
This commit is contained in:
amirhosein mazaheri
2026-10-17 13:02:41 +03:30
parent a94b8cd3ea
commit 628aec8def
40 changed files with 1568 additions and 70 deletions
@@ -0,0 +1,47 @@
# Windows continuation preparation — 2026-10-17
Status: isolated candidate image rebuilt; supervised native retention fixture passed; paid/browser preparation pending; Phase 3 and Phase 4 live acceptance remain pending.
The user confirmed that previous real tests ran on another computer and authorized continuation on this Windows host. Previous private ledgers and native candidate images are not present here. Existing test PostgreSQL/original/extraction volumes remain available and have not been reset. Docker Desktop was started; existing unrelated restart-policy containers started automatically and were left unchanged.
## Recovered inputs
- Clean upstream pin `619e3fe4f71d1c6f35c15870d588a3638de34722`, acquired in `tmp/local-s2s-upstream-619e3fe4`; all 17 recorded SHA-256 fingerprints match after disabling Git archive CRLF conversion.
- Reviewed 134-package Linux CPU lock copied unchanged into `.local-s2s-build/requirements.lock`; original pinned Python base retained.
- All 14 NLTK/Silero asset fingerprints match the existing Linux asset manifest, under `.local-s2s-build/assets-linux`. The Silero directory in this reconstruction is `vad`, not `silero-vad`; mounts must use the actual path.
- Existing Angular checkout `D:/raymand/projects/faq_chatbot_frontend` contains provider selection at commit `a26c597`. Its existing package.json modification was preserved.
- Build succeeded: `rag-local-s2s-candidate:windows-rebuild-20261017`, image ID `sha256:66aceba8e58ad53e6a912352b4471f7bed5db8cd270f41901d1db6affd1240a1`. Original base/lock were retained; native validation remains unrun. A Dockerfile warning about the unset default base ARG remains; the build supplied the explicit pinned base.
## Budget
Carry the full conservative exposure **$0.704504399** from `phase-04-interruption-incident.md`; no release based on missing invoices. Remaining headroom before new reservations is **$0.295495601**, within the original **$1** authorization. This is a documentary carry, not recovered per-request billing evidence or a functioning inference admission ledger.
Public endpoint metadata for all three component models was refreshed without inference. Existing `native-budget-transport.py` price validation passed. Private preparation evidence is `.local-s2s-build/windows-continuation-20261017/`. Do not fabricate old attempt rows to satisfy an old ledger constructor, reset old ledgers, or enable unguarded OpenAI. A fresh exclusive admission ledger must explicitly support this documentary carry before paid startup.
## Checks and remaining gates
- `.venv/Scripts/python -m pytest -q -p no:cacheprovider tests/unit/test_local_s2s_history.py tests/unit/test_local_s2s_evaluation.py tests/unit/test_phase2_provider_selection.py`: **54 passed in 9.63s**.
- `git diff --check`: passed before this report.
- No new paid provider request, engine startup, audio tuning or operational provider switch.
- Windows available physical RAM fell below 1GiB during dependency download; Linux VM MemAvailable alone is insufficient evidence of Windows host headroom. Do not start the native engine until host and VM memory admission is satisfied. Original Linux runners use `/proc/meminfo` and require a Windows-compatible supervisor before reuse here.
- Native fixture validation, bounded cost admission, Windows-specific Compose mounts/images, browser authentication/handoff, approved RAG corpus and bounded embeddings, paired provider measurements and actual restoration remain pending. Existing Linux overrides reference unavailable image digests and `/dev/null`; do not launch them unchanged on this host.
## Completed image check
`docker run --rm --pull never --network none --read-only --memory 128m --memory-swap 128m --pids-limit 64 --cap-drop ALL --security-opt no-new-privileges --entrypoint python rag-local-s2s-candidate:windows-rebuild-20261017 -m pip check`: exit 0, `No broken requirements found.` No key mounted and no engine initialized.
Final Windows physical memory available: **393MiB**; native/paid/browser startup was not attempted. User was asked to free nonessential applications. Build and asset downloads are complete and retained. No unrelated process or container was stopped.
## Supervised native retention run with 4.8GB reported RAM
The user authorized testing after freeing memory. Actual preflight: Windows 5,038,092,288 bytes available, Docker VM 6,191,755,264 bytes. One controlled Windows trial admitted at >=4500MiB Windows / >5GiB VM, with the original 3GiB/no-swap container limit, 2 CPUs, network disabled and no provider key. The supervisor sampled both memory domains and stopped only its owned container if either fell below2500MiB or180s elapsed. This trial does not change existing launch defaults or establish a universal minimum.
**Passed in35.555s, exit0**, no memory abort. Minimum available: Windows4,111,507,456 bytes; VM4,471,754,752 bytes. Active cancellation, two retained-history receipts, next generation, stale-output exclusion, intent correlation, normal completion and unit release passed. Client error null; all cleanup errors/pending requests zero; paid calls zero. See [sanitized result](windows-native-retention-20261017.json). No actual browser, Persian quality or original transient error acceptance follows from fixture I/O.
The Windows checkout's mounted asset manifest has CRLF bytes; its LF-normalized digest matches the historical869eb6be1f444ecded8908b9339078cc5845df367207a63ed28173c4974dca26. A normalized private copy was prepared as `windows-continuation-20261017/assets-lf.json` for later pinned live startup; tracked manifest unchanged. All14 asset payload hashes matched before execution.
Next: a fresh exclusive inference budget guard supporting documentary carry (without fabricated old attempts), Windows Compose/profiles and browser handoff. No paid inference is enabled by this native success; OpenAI admission and real RAG preparation remain pending.
## Later browser preparation
Superseded for readiness by [actual browser handoff](windows-browser-handoff-20261017.md): startup and authenticated proxied connection passed, current reserve$0.763504399. Human microphone/interruption and Phase3/4 acceptance remain pending. Earlier missing-key and preparation-only statements describe their historical checkpoint.