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,110 @@
|
||||
# Phase 2 image build and checks — 2026-10-16
|
||||
|
||||
Status: **image built; basic native/SDK and focused regression checks passed**.
|
||||
Phase 2 remains **in_progress / not accepted**: full engine initialization,
|
||||
asset validation, actual signal handling and real Persian components/browser
|
||||
have not been proved by these checks. This supersedes the 2026-10-15 disk-blocked
|
||||
build checkpoint. [Machine-readable evidence](phase-02-image-build-20261016.json).
|
||||
|
||||
## Built artifact
|
||||
|
||||
- Local tag: `rag-local-s2s-candidate:phase2`.
|
||||
- Image ID: `sha256:5c80c77c54da4641318e69cdb8fff092391cd746e491fa8029280c2999ce27d1`.
|
||||
- Size: **2,349,831,100 bytes**; Linux/amd64. No registry push or RepoDigest.
|
||||
- Exact upstream: `619e3fe4f71d1c6f35c15870d588a3638de34722`, existing extension v3.
|
||||
- Reviewed lock SHA-256: `fdcd9ad5d520012d9a31fa6b89492f69c39454339c6766172bde2df0bf0bd19a`.
|
||||
- Exact base: `python:3.11-slim@sha256:e529028263dbe6910a2d96f7d2b8f5266385e917fd45d286ef166977c094a51e`.
|
||||
- Build exit **0**, elapsed **775.34 seconds**, disk guard did not fire;
|
||||
minimum sampled free disk **22,656,344,064 bytes**. About 22 GB free afterward.
|
||||
|
||||
The user freed disk before this attempt. Verified the clean upstream checkout,
|
||||
prepared v3 source patch, source manifest and lock identities before retrying.
|
||||
No new runtime source or Docker recipe changes were needed today. The embedded
|
||||
`engine-build-manifest.json` is the preserved pre-build input manifest and retains
|
||||
`built=false`; this external record supplies the actual completed image identity.
|
||||
|
||||
```sh
|
||||
docker build --pull=false --progress=plain -f services/local_s2s/Dockerfile \
|
||||
--build-arg ENGINE_BASE_IMAGE=python:3.11-slim@sha256:e529028263dbe6910a2d96f7d2b8f5266385e917fd45d286ef166977c094a51e \
|
||||
-t rag-local-s2s-candidate:phase2 .
|
||||
```
|
||||
|
||||
Actual command/result and full log are retained in ignored
|
||||
`.local-s2s-build/image-build-20261016-{command,result}.json` and
|
||||
`.local-s2s-build/image-build-20261016.log`. Evidence JSON records fingerprints.
|
||||
|
||||
## Executed checks
|
||||
|
||||
Every image check used the immutable image ID, `--rm --network none --read-only`,
|
||||
capabilities dropped, no-new-privileges, memory/PID limits, and no host credential
|
||||
or document mounts. Checks requiring temporary files received a small tmpfs.
|
||||
No ports published, engine service started or paid request sent.
|
||||
|
||||
| Check | Actual result |
|
||||
| --- | --- |
|
||||
| `python -m pip check` | exit 0, no broken requirements |
|
||||
| Native/runtime imports | **15 passed**, full list in JSON |
|
||||
| Python/glibc | **3.11.17 / 2.41** inside actual image |
|
||||
| Torch/Torchaudio | both **2.11.0+cpu**, CUDA unavailable, tensor operation passed |
|
||||
| Image data boundaries | `/app/.env` and original-document directory absent |
|
||||
| Actual pinned LLM handler + installed OpenAI SDK | **6 scenarios passed** with controlled HTTPX I/O |
|
||||
| Startup without explicit opt-in | refused before initialization, expected exit 2 |
|
||||
| Opt-in with missing assets | fixed asset-validation failure before probes, expected exit 1 |
|
||||
| Existing provider-free local/runtime/OpenAI/Gemini regressions | **423 passed in 69.65s**, zero failures/errors/skips |
|
||||
|
||||
Native imports covered torch, torchaudio, onnxruntime, nltk, openai, upstream
|
||||
configuration/configured-runtime/backend registry, STT/LLM/TTS handlers, VAD,
|
||||
Realtime server and the local launcher. Modules imported successfully; this does
|
||||
not mean that an asset-backed engine instance was constructed or audio processed.
|
||||
|
||||
[Reproducible native SDK smoke](image-sdk-smoke.py) imports the actual installed
|
||||
upstream classes and OpenAI **2.28.0** SDK. Only provider HTTP I/O is replaced by
|
||||
HTTPX fixtures; it is not the earlier AST/RecordingSDK harness. At both 17 and 83
|
||||
synthetic token caps, real handler construction invokes warmup and a normal
|
||||
`_request` sends the configured cap. HTTP 503 and connection failures each make
|
||||
exactly **one** attempt despite upstream warmup requesting six retries. These
|
||||
synthetic settings are confined to the smoke process and do not alter voice tuning.
|
||||
|
||||
```sh
|
||||
docker run --rm -i --network none --read-only \
|
||||
--tmpfs /tmp:rw,noexec,nosuid,size=128m \
|
||||
--cap-drop ALL --security-opt no-new-privileges --memory 2g --pids-limit 128 \
|
||||
-e OMP_NUM_THREADS=1 -e OPENBLAS_NUM_THREADS=1 --entrypoint python \
|
||||
sha256:5c80c77c54da4641318e69cdb8fff092391cd746e491fa8029280c2999ce27d1 - \
|
||||
< docs/evaluation/local-s2s/image-sdk-smoke.py
|
||||
```
|
||||
|
||||
Focused tests used the same 16 existing test files as the earlier 423-case review;
|
||||
exact arguments and JUnit fingerprint are in the evidence JSON. Test-only
|
||||
`TRUSTED_HOSTS` overrides the invalid ambient host configuration, not deployment
|
||||
configuration. JUnit is `.local-s2s-build/focused-20261016.xml`. The earlier
|
||||
capacity test also passed in this combined run; no assertion was relaxed.
|
||||
Broader provider-free and PostgreSQL suites were not run or implied green.
|
||||
|
||||
## Observations and open gates
|
||||
|
||||
- Docker warns that the required base ARG has no default. The exact reviewed
|
||||
digest was supplied; no floating fallback was introduced.
|
||||
- Optional DeepFilterNet is absent and VAD import warns; enhancement remains
|
||||
disabled. ONNX uses an in-memory telemetry ID because the container is read-only.
|
||||
Neither warning caused a failed check or led to another dependency installation.
|
||||
- **CPU scope correction:** the full retained upstream dependency graph includes
|
||||
`qwentts_cpp_python-0.5.0-1cu128` for an unused local TTS branch. The image is not
|
||||
certified free of CUDA-tagged binaries. Selected orchestration uses CPU Torch
|
||||
and HTTP STT/LLM/TTS; no GPU inference or model-weight download occurred. Earlier
|
||||
absence of NVIDIA-named package requirements did not establish binary contents.
|
||||
- Fingerprinted NLTK/Silero assets have not been provisioned at the required Linux
|
||||
paths. Checked standard host resource roots were absent; missing-assets guard
|
||||
correctly closes before component initialization. No synthetic asset fixture
|
||||
was substituted for real resources.
|
||||
- Complete engine/SDK controlled-I/O, actual Linux SIGINT/SIGTERM cleanup,
|
||||
real component format/rate/Persian and isolated local_s2s browser acceptance
|
||||
remain open. Native imports and this SDK subset do not close those gates.
|
||||
- No voice setting, buffer, speed, output cap, profile or reservation was changed.
|
||||
No database/migration acceptance was run. Existing API/DB containers were already
|
||||
stopped at the start of this host session and were not restarted. The unrelated
|
||||
pre-existing `fastapi_db` restart loop was left unchanged. All temporary check
|
||||
containers were removed; no existing images/volumes/cache were pruned.
|
||||
|
||||
Next: provision and verify the real local assets, then initialize the full pinned
|
||||
engine in controlled-I/O/network-isolated tests before authorizing paid stages.
|
||||
Reference in New Issue
Block a user