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
+117
View File
@@ -1,5 +1,122 @@
# Phase 1 agent reference map
Current preparation (2026-10-16): [Phase 4 frontend/provider selection and paired evaluation tooling](evaluation/local-s2s/phase-04.md).
Phase 3 retains interrupted answers as explicitly unheard drafts per the user's
revised policy; real barge-in/RAG/factual acceptance remains pending. Phase 4 is
prepared for isolated testing, not deployed or accepted. No new paid request,
audio tuning or operational switch. Earlier checkpoints below are historical.
Current verdict (2026-10-16): **Phase 2 accepted for isolated development-only
normal Persian browser voice**. [Final evidence](evaluation/local-s2s/phase-02-accepted-20261016.md)
and [machine-readable results](evaluation/local-s2s/phase-02-accepted-20261016.json):
125 local + 258 preservation + 63 PostgreSQL tests passed; actual browser response
fully played and closed normally. Conservative cost exposure $0.420504399, below
the same $1 cap; final invoice details remain unresolved with full reserves held.
Paid engine stopped normally. No buffer/speed change or operational promotion.
Phase 3/4 remain not_started. Earlier checkpoints below are historical and are
superseded where they describe open Phase 2 gates.
Current incident follow-up: [first browser-turn initialization stall repaired](evaluation/local-s2s/phase-02-browser-first-turn-repair-20261016.md).
User session failed after transcription. Native snapshots identified first-reply
Lingua model preload; same cache now warms before listener readiness. Three full
proxy/API/native continuous-input fixture sessions and98 focused tests pass.
Fixed image a51167d1952a; no buffer/speed/timeout change. Repair handoff carries all
prior attempts; cumulative reservation ceiling $0.995118333 of the same$1. Human
browser acceptance remains open; earlier ready checkpoints below are historical.
Current browser handoff (2026-10-16): [isolated browser is ready](evaluation/local-s2s/phase-02-browser-ready-20261016.md).
Angular/API/login and actual proxied WebSocket session_ready/normal close passed;
no inference in connection check. Three real startup probes passed. Human microphone/
reply/transcript acceptance remains open. Same $1 authorization; reconciled prior
exposure $0.689118333, cumulative ceiling $0.901118333, startup reserve $0.748118333.
Private login file and 30-minute engine watchdog documented. No tuning/operational change.
Latest actual run (2026-10-16): [real native Persian round trip passed](evaluation/local-s2s/phase-02-real-native-20261016.md).
Six actual requests succeeded, 2.528s reply audio, successful terminal/normal
release and clean shutdown. Cumulative reservation is $0.998 of the same $1;
final billing remains unresolved, so no further paid request. User accepted native output; browser/microphone remains open; earlier memory blocker below is historical.
No operational switch or audio tuning change.
Latest preparation (2026-10-16): [bounded real native session](evaluation/local-s2s/phase-02-native-paid-preparation-20261016.md).
Single-sample pronunciation accepted by the user. Cumulative reservation ceiling
is $0.998 including the retained $0.56; no new paid request. Real launch awaits
>5GiB host headroom. Budget/runner checks and actual native fixture pass; browser
and real session acceptance remain open. Audio tuning and operations unchanged.
Local S2S real components (2026-10-16): [actual speech/STT/LLM and $1 budget evidence](evaluation/local-s2s/phase-02-real-components-20261016.md).
Four attempts including initial WAV HTTP400; PCM TTS/Kore, Whisper and GPT-4.1 mini
then succeeded. $0.56 reservation retained; STT+LLM report $0.000338333333333, TTS
and final cost not verified. Single-sample pronunciation accepted by the user; real engine/browser remain open.
No heavy container, operational switch or audio tuning. Preserve the paid ledger;
do not restart paid tests or treat the shared key's $5 limit as a $1 test cap.
Local S2S native session/incident follow-up (2026-10-16): [actual tests and safe continuation](evaluation/local-s2s/phase-02-native-session-20261016.md).
110 tests plus real native normal-audio/close, SIGINT, SIGTERM and fixture-provider
failure cases passed in image 89c7295e5219. Final normal run verifies actual setup
mismatch rejection and intent/item correlation. Cleanup ordering repaired without
changing budgets/tuning. systemd-oomd killed VS Code during prior concurrent tests;
continuation runs one 3GiB/no-swap container with host headroom guard. Cold/one-core
failures disclosed. Real components/browser/quality and target cold start remain open.
Local S2S Queue repair (2026-10-16): [corrected image and real constructor regression](evaluation/local-s2s/phase-02-queue-repair-20261016.md).
Type-compatible queue subclass preserves existing capacity/overflow stop. 109
targeted tests plus actual asset-backed engine construction, three HTTP-fixture
warmups and cleanup passed in separate corrected image 6ad4a6a418ef. Older Queue
blocker below is resolved; native sessions/audio/POSIX and real-provider acceptance
remain open. No tuning, dependency, operational or paid-provider changes.
Local S2S authorized asset download (2026-10-16): [actual resources and construction defect](evaluation/local-s2s/phase-02-linux-assets-20261016.md).
Missing NLTK/Silero prerequisite resolved; all retained asset hashes match the old
manifest, actual image tokenizer/POS/JIT load and silence inference pass. Complete
construction fails on Queue[Any] because the local launcher replaces Queue with a
lambda. No runtime fix applied; repair type compatibility without changing queue
capacity/tuning, then continue engine conformance. No paid calls or operational changes.
Local S2S offline follow-up (2026-10-16): [resource inventory and POSIX subset](evaluation/local-s2s/phase-02-offline-preflight-20261016.md).
Four real Linux signal cases passed with actual lifecycle/gateway and fixture
runtime/provider I/O. Cached punkt files matched prior hashes and loaded; required
POS tagger and Silero source/JIT bundle remain missing. Full asset-backed engine
and native shutdown acceptance remain open. No runtime/tuning changes or downloads.
Local S2S successful image retry (2026-10-16): [actual build/native/SDK evidence](evaluation/local-s2s/phase-02-image-build-20261016.md).
Candidate image `5c80c77c54da` built from the reviewed source/base/lock. Package
check, 15 native imports, six actual pinned-handler/OpenAI SDK fixture scenarios,
two fail-closed startup guards and **423 provider-free tests passed**. Earlier
disk-blocked/unbuilt records below are historical. No voice tuning or provider
call; full asset-backed engine, POSIX, components/browser acceptance still open.
Torch/audio are CPU; full upstream also includes an unused CUDA-tagged TTS wheel.
Local S2S image-build attempt (2026-10-15): [disk-capacity evidence](evaluation/local-s2s/phase-02-image-build.md).
Reviewed build reached dependency installation, then its 384 MiB disk guard
cancelled it. No candidate image exists. Task resolver cache retained on tmpfs;
about 1.8 GiB root space available after cancellation. More Docker storage space
needed before retry; no unrelated cleanup, voice changes or provider startup.
Local S2S Linux dependency lock (2026-10-15): [review and evidence](evaluation/local-s2s/phase-02-dependency-lock.md)
record 134 hashed packages, matching CPU torch/audio 2.11.0, exact wheel URLs,
verified Python 3.11 slim-trixie amd64 manifest and a successful wheel-only
hash-required dry run. Source/lock/base-manifest gaps in older checkpoints below
are superseded. No dependency installation, model download, image build, voice
tuning or provider call occurred; Phase 2 runtime/asset/live gates remain open.
Local S2S pinned source acquisition (2026-10-15): clean detached checkout at
`tmp/local-s2s-upstream-619e3fe4`, exact upstream SHA `619e3fe4f71d1c6f35c15870d588a3638de34722`.
All 17 audited SHA-256/blob fingerprints and Git fsck passed; see
[source evidence](evaluation/local-s2s/phase-02-source-checkout.json).
Earlier missing-source statements below are historical. Dependency lock, engine
build/assets/conformance and Phase 2 live acceptance remain open. No source
execution, model/dependency installation or voice/service change in this step.
Local S2S Phase 1 final Linux acceptance (2026-10-15): user-reported Persian
speech/two interruptions/no errors match actual cancelled/completed terminals,
native truncate acknowledgements and persisted user-requested normal close.
Frozen 2048-token / speed 1.30 / PCM24k / 5,760,000-byte output profile verified.
See [final evidence](evaluation/local-s2s/phase-01-linux-preparation.md).
Provider-boundary/OpenAI preservation accepted; earlier live-pending checkpoints
below are historical. Phase 2 engine build/SDK/POSIX/components/local browser,
reviewed lock and actual rollback restoration remain unverified. No operational
switch or extra provider call was made while recording acceptance.
Local S2S acceptance preparation (2026-10-15): [exact commands and gates](evaluation/local-s2s/phase-02-acceptance-checklist.md);
201 cached asset files fingerprinted, existing NLTK load verified, fresh disposable
PostgreSQL 2 local passed / expanded 57 passed and 6 documented baseline failures.