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.
28 KiB
Development notes
2026-10-16 — User-authorized Phase 4 preparation and frontend provider choice
- Prepare Phase 4 while Phase 3 live/factual gates remain pending. The frontend selects an allowed provider per new session; server-owned credentials, models, tuning and canonical retrieval remain unchanged. No automatic fallback.
- Add optional V01/F01 provider, authenticated configuration-only provider metadata, explicit-provider replay/race conflict and row-pinned stream settings. Preserve old default-only clients and profiles; no schema migration.
- Close and verify terminal state before changing UI selection. Unknown closure keeps the previous provider and ids. Start a fresh session on the next click.
- Add an offline paired latency/cost scorecard, unmeasured template, fault matrix, isolated image/override and operational restoration runbook. No new paid call, provider switch, dependency or audio buffer/speed change.
- See Phase 4 evidence for tests and remaining real gates. No quality/savings/rollback acceptance is inferred from fixtures.
2026-10-16 — Phase 2 isolated normal browser voice accepted
- Required real component/native/Persian browser/normal-close evidence is complete. Finish provider-free acceptance: 125 local, 258 OpenAI preservation and 63 real isolated PostgreSQL tests pass. See final evidence.
- Correct two stale test assumptions to the existing contract: source citations require report_used_sources, and adjacent unsent transcript deltas may coalesce. Preserve database/text/replay assertions; do not alter runtime or deadlines.
- Add phase-02-final-postgres.py: new test-owned resource-limited tmpfs PostgreSQL container, default durability settings, no persistent mounts/provider keys, explicit --require-postgres and automatic owned-container cleanup. This replaces slow disk-backed execution without touching candidate or operational data.
- Read-only generation billing confirms $0.003504399; retain $0.417 for every unresolved attempt, giving conservative exposure $0.420504399. Keep original exclusive ledgers unchanged and do not restart paid inference. Delayed invoice details remain a disclosed accounting follow-up; bounded-cost compliance is met.
- Stop the owned paid-engine watchdog normally; preserve candidate DB, images, frontend, operational OpenAI and tuned buffer/speed configuration. Phase 3/4 remain not_started; no interruption/RAG acceptance or provider promotion.
2026-10-16 — First browser reply: native lazy language preload
- Actual human greeting reached transcript but provider-send stalled. Reproduce through the real proxy/API using fixture HTTP, preserving paid ledgers.
- Native thread dumps locate lazy all-language Lingua preload at the first spoken reply. Prime the same cache during engine construction, before listener startup; preserve all detection behavior, buffers, speed, PCM and existing deadlines.
- Three full-path continuous-input fixture sessions and98 focused tests pass. Native backend-selection experiment did not fix the issue and was discarded.
- Build separate COPY-only image a51167d1952a. Repair ledger retains previous $0.807118333 and enforces cumulative$0.995118333; no retries/old-ledger reset. Human browser acceptance remains open. See evidence.
2026-10-16 — Browser candidate running with bounded handoff
- Start existing isolated DB/migrations/API with corrected immutable image and Angular with the separate proxy. New disposable user; private local credentials.
- Add evaluation-only browser transport, Compose override and engine watchdog. Reconcile only three billed older calls; retain failed and unbilled reservations. Cumulative ceiling $0.901118333 under the original $1; no key-cap change.
- Apply documented Google maxOutputTokens2048 in both endpoint options only to this evaluation, not operational speech speed/buffers. LLM remains128 test tokens.
- Three real probes passed; actual cookie/Origin/CSRF API and proxied native session_ready/closed user_requested passed with no inference. Human mic test remains pending. Watchdog limits engine memory and stops it after30minutes.
- Budget regression/Compose/parse/diff checks pass. No frontend source or public API contract change. See handoff.
2026-10-16 — Native output listening accepted; earlier billing reconciled
- Record user acceptance of the 2.528s native reply. Browser/API/microphone acceptance and applicable failed DB checks remain open; no Phase2 acceptance.
- Read-only billing now confirms the earlier three successful standalone calls: $0.00078 TTS + $0.000308333 STT + $0.00003 LLM = $0.001118333. Exclude the first failed WAV attempt and distinguish these from the newer native turn.
- New native generation records still return404. No inference or operational changes; reservation accounting is not actual cost. See updated real-native and real-components evidence.
2026-10-16 — Real native round trip passes within original $1 authorization
- Host memory recovered without lowering any guard; one owned container completed actual STT/LLM/TTS probes and a native audio turn, successful terminal, correlation, slot release and clean shutdown. Six real HTTP200 requests, 130.096s total.
- Save the 2.528s Persian reply for human listening. Recognized input retains the earlier کتاه/کوتاه mismatch; browser/microphone and broad quality are not proved.
- Preserve both paid ledgers: cumulative reserve $0.998, not actual cost. Immediate billing lookups remain404; no further paid request or automatic startup.
- No operational configuration, audio tuning, frontend or database changed. See actual evidence.
2026-10-16 — Bounded real native session preparation
- Record user acceptance of pronunciation for the single generated Persian sample.
- Extend the existing native harness with a real-provider mode and an evaluation-only persistent admission guard. Retain the prior $0.56; two attempts per component reserve at most $0.438 more, for a $0.998 cumulative ceiling under the same $1.
- Keep private credential mode0600; run its test container as its owner. Harden the existing runner to report pre-start refusal, propagate failure and stop its owned container on interruption. No dependency, operational or tuning change.
- Budget and runner regressions pass; actual native fixture passes in27.011s. Real execution remains unaccepted: initial credential preflight failed before admission, then host memory was below the unchanged5GiB startup requirement. See evidence.
2026-10-16 — Authorized real Persian component evaluation, $1 total limit
- Add a standalone exclusive-ledger runner for fixed real TTS/STT/LLM requests, conservative pre-admission reservations, no automatic retries and bounded data. Keep the supplied credential ignored and private; existing key cap/settings stay.
- One WAV HTTP400 stopped the first sequence; explicitly announced PCM correction then produced 5.16s of real Persian audio, a Whisper transcript and GPT-4.1 mini reply. Four attempts retain $0.56 of the authorized $1 budget. Reported STT+LLM cost is $0.000338333333333; TTS/final billing remains unverified, not free.
- Record کتاه/کوتاه transcript difference and pending human listening. No broad quality/RAG/browser acceptance, heavy engine startup, audio tuning or operational change. Files: evaluation runner/evidence and current index/ledger/README. See actual results.
2026-10-16 — Native local S2S session conformance and memory-safe continuation
- Add an actual native WebSocket/session/audio runner using real assets/handlers/ SDK and fixture-only upstream HTTP. Normal audio/close, setup mismatch and intent correlation, SIGINT/SIGTERM during provider work and failed-provider terminal checks passed. No real provider quality/listening claim. 110 focused tests pass.
- Repair shutdown order: cancel gateway/provider I/O before joining workers; cancel accepted writers/tasks before Server.wait_closed (also fixes Python 3.13 client-wait semantics). Existing deadlines, queue capacity and voice tuning stay.
- Prior concurrent native runs coincided with systemd-oomd killing VS Code due to memory pressure. Continue sequentially with a 3GiB/no-swap limit, two CPU cap, host headroom checks and automatic owned-container stop. Record cold-start and one-core timeout failures; do not change product timeouts to excuse them.
- Files: local lifecycle/components, one regression, native evaluation/guarded runner and evidence/index/progress docs. Separate image 89c7295e5219 preserves older candidates and operational selection. No downloads or paid calls. See actual evidence.
2026-10-16 — Preserve Queue type compatibility during engine construction
- Replace only the launcher's Queue lambda with a subclass of the existing FailClosedQueue bound to its owner stop event. This retains generic annotations while preserving 256 slots, FIFO and fail-closed overflow. No audio or contract changes; existing v3 behavior/profile identity remains compatible.
- Enhance the real-image construction regression to verify typed queue creation, capacity, overflow/stop and draining. 109 focused tests pass. The corrected image constructs all real handlers with local assets and exactly three fixture warmups, then cleans up successfully. Native server/sessions remain untested.
- Files:
services/local_s2s/engine.py, construction evaluation script, repair evidence and current index/ledger/README. A separate offline image layer keeps the original image intact. No downloads, paid calls or operational changes. See actual evidence.
2026-10-16 — Authorized NLTK/Silero resource acquisition
- Download the previously missing tagger and minimal Silero JIT hub bundle from fixed official revisions, under explicit user authorization. All 14 retained resource hashes match prior evidence. Preserve resources in ignored build storage and record the Linux subset manifest and acquisition provenance.
- Actual immutable-image NLTK sentence/POS loading and Silero JIT inference on 8/16 kHz silence pass with no networking. Complete engine construction then exposes Queue[Any] versus launcher-lambda incompatibility. Report the defect; no runtime fix, capacity/speed change, paid call or operational action here.
- Files: asset manifest, evaluation scripts/report/JSON, local README, reference map and progress ledger. Next repair must preserve queue capacity and stop behavior while retaining type compatibility. See evidence.
2026-10-16 — Local S2S resource inventory and Linux signal subset
- Retain the built image and application runtime unchanged. Reuse four existing local punkt files whose hashes match the earlier asset manifest; stage copies only under ignored build inputs. Image NLTK sentence loading passed, while full preflight correctly rejects the absent POS tagger. Required Silero source/JIT files were not found; the cached ONNX model is not substituted.
- Add a standalone evaluation script using existing lifecycle/gateway code, fixture runtime/provider I/O, real local HTTP and OS SIGINT/SIGTERM. All four cases passed, including runtime-stop failure. This demonstrates the isolated lifecycle subset, not complete engine/native-worker shutdown or Persian audio.
- Files: evaluation script/report/JSON, progress ledger, reference map and local service README. No new dependency, image rebuild, runtime edit, voice tuning, database access, paid call or download. Next requires transfer or authorized acquisition of missing real resources. See actual evidence.
2026-10-12 — Live repair diagnostics and bounded Gemini cleanup
- Extend the existing numeric diagnostics with opt-in audio/cancellation timing; keep PCM/text/provider payloads out of traces. This enables attribution before changing buffer sizes or cancellation deadlines.
- Bound Gemini pump termination and transport close independently with
asyncio.wait. Attempt abort after expiry and preserve incomplete-cleanup failure. A cancelled caller still shares the same cleanup task. - Record actual worklet consumed and discarded output samples, with attribution per reference; diagnostics never change backend playback credit.
- Keep the 80 ms prebuffer, five-second cancellation deadline, generation budget and output reservoir unchanged pending measured live acceptance.
- Files: backend voice runtime/settings/diagnostics and Gemini adapter; frontend voice service/engine/worklet; affected regression tests and fixed trace runner. See trace guide and progress record.
2026-10-12 — Same-topic evidence reuse
- Add the empty-argument internal continuation tool and a narrowly scoped exception to fresh retrieval for every follow-up, as authorized by repair issue 10. New topics and insufficient evidence still require canonical search.
- Reuse the original successful retrieval row; add no fake tool execution, durable history, cross-session cache, public endpoint or migration.
- Revalidate owner/auth session, active Live session, both access epoch and knowledge revision, and document/chunk eligibility before reuse and delivery. Selection additions invalidate reuse even when the access epoch is unchanged.
- Assign source labels through the new turn's existing execution so they cannot collide with other evidence in that turn. Keep the original retrieval's public reference for attribution. Clear the bundle on interruption/fresh search/failure/end.
- Pin
same-session-evidence-v1in new reservations and Persian style revision v3 in OpenAI instruction profiles. Existing reservations are not rewritten. - Files: voice runtime/lifecycle/durable-tools/configuration/style, both provider tool declarations, API/implementation/database documentation and focused tests.
- Prepare a synthetic 20-question quality fixture after the user's localhost/test data direction. No real answer-budget or output-capacity candidate is accepted.
2026-10-12 — First real OpenAI playback reproduction
- The user heard the correct fee but reported severe gaps, late audio start and
a response cut short. Both captured answer terminals matched OpenAI's
max_output_tokenslimitation; recorded generated/sent/played PCM totals match. Sample conservation does not prove every displayed word was spoken or heard. - Available PCM was delayed behind queued assistant captions. Give PCM a turn between captions and merge adjacent queued partial deltas for the same response. Keep source/lifecycle controls ordered, start before bytes, seal before the next reference starts, per-send authorization, and finite credit/queue bounds.
- Add numeric authority-check and emit durations and queued-control counts to the existing opt-in trace so a second real run can distinguish remaining causes.
- Evaluate a temporary 512-token profile in the isolated localhost runtime. Leave the repository's 256-token default and 30-second reservoir unchanged; this first question does not select a final answer budget.
- Validation: 335 focused backend voice tests passed, including caption fairness, delta conservation, final snapshots and revocation. Actual replay is pending.
2026-10-12 — Replay: limited sentences and slow speech
- User reports no choppiness in two later calls, but some incomplete sentences and slow speaking pace. Five replay sessions were recorded; three contain an actual validated max-output-token terminal at the temporary 512-token cap. The most recent main reference conserved 936000 bytes / 19500 ms through reported playback. This does not establish word-level transcript agreement.
- Per-frame authority checks sometimes took 1060 ms while emission took at most 1 ms. Check session and turn captures together against one current locked authority snapshot per frame, preserving all gates and avoiding an authority cache. This reduces duplicate transactions; remaining latency needs replay.
- Add validated server-only OpenAI output speed, freeze it in the execution profile, and require provider acknowledgment. Keep default 1.0; local candidate 1.15 responds to the user's clarification that speech itself is slow.
- Style revision v4 asks for silent evidence-tool calls, direct short factual answers and brisk natural speech, while preserving all essential conditions, exceptions, numbers, negation and grounding. No automatic response chaining.
- Next isolated-runtime candidate: 1024 tokens, speed 1.15, style v4. This combined repair replay cannot attribute changes to a single variable or select the final production budget. Retain the 30-second output reservoir and existing prebuffer.
- Files: voice lifecycle/configuration/style, live route, OpenAI adapter, configuration example, contract documents and regression tests.
2026-10-12 — Same-connection continuation hits the 1024-token limit
- User supplied the actual answer ending mid-word at «تضمین باز» with the limited notice. Session 622f388e-2961-472a-be63-7519342753b1 has a validated limited second-turn terminal at 1024 tokens. Its 1655560 generated PCM bytes were all sent and sealed; reported playback is 34490 ms, leaving only sub-ms rounding. The durable tool table contains one successful retrieval for the whole session; no additional retrieval was recorded for continuation.
- Peak backlog 1269592 bytes is 88.17% of the 30-second reservoir, already above the plan's 80% acceptance threshold. Implement plan issue 11's explicit finite OpenAI 5760000-byte / 120-second reservoir before testing 2048 tokens.
- Preserve Gemini's 30-second baseline and all frame, queue, credit and timeout limits. Freeze new OpenAI capacity fields in reservations. Reject both aggregate bytes and logical slab exhaustion before decoding/allocation; the larger profile supports 664 logical slabs across its bounded references. No receive throttling.
- Add synthetic burst, multiple-reference drain, bound-exhaustion, independent stall/cancellation, configuration and memory measurements. Actual token-budget quality/capacity benchmark remains separate and open.
- Files: voice settings/runtime/configuration, live route/provider factory/smoke, API/database/configuration documentation and test_voice_output_capacity.py.
- Completed checks: 402 focused voice cases, 12 PostgreSQL cases, 18 transport cases. Synthetic full-reservoir allocation peak 6668463 bytes, measured separately from real-provider/process memory. API ready with temporary 2048-token candidate; actual OpenAI setup acknowledged it without generating an answer.
2026-10-12 — Local embedding latency blocks the next microphone replay
- Actual search embedding took 47933.47 ms; the call closed before its valid two-source result arrived. No spoken-answer generation was observed, so this attempt says nothing about the new answer-budget completeness.
- Subsequent native probes took 518/506 ms and the actual compatibility route 516 ms. The original request lacks load-duration data; model cold loading is an unproven cause. Use bounded model residency as a test-environment mitigation.
- Verified zero-embedding empty-input preload. A task-owned /tmp helper refreshes residency every minute for 30 minutes and stops; no application provider adapter, frozen embedding identity, calibration, factual cache or global service change.
- Record provider-close timeout/abort separately; cleanup live acceptance stays open.
2026-10-12 — Continuation browser log confirms genuine playback failure
- User heard choppiness and mid-answer error closure. Backend identifies a five-second playback-progress stall, with only 11.69% aggregate reservoir occupancy. Last reported consumption leaves 72000 sent/outstanding and 34400 unsent bytes. No spoken-answer terminal/seal arrived before failure.
- The supplied browser console lacks Debug-level receive/enqueue/consume traces. Promote numeric traces to development-only Info, add context state and sanitized worklet error logs plus a one-second capture clock. Preserve pre-transfer chunk length for accurate enqueue diagnostics. Do not change timeout or fabricate progress before the actual stopped browser stage is identified.
- Files: frontend voice-stream.service.ts and voice-audio-engine.service.ts; progress/trace documentation. No backend behavior change in this checkpoint.
- Validation: frontend build and 90 voice tests passed. Force installed Node 22.23.1 for escalated test commands: their default PATH picks system Node 20, whose jsdom/undici initialization fails before any tests run. No dependency edit.
2026-10-12 — General ASR burst repair and requested pause
- A real longer-question failure reached CLIENT_CONTROL_CAPACITY at 63 controls and 6454 bytes, with zero PCM backlog. Extend bounded adjacent partial-caption coalescing to user transcripts, preserving role/turn/response boundaries, text, final snapshots, intervening controls and existing bounds. No fixture-specific prompt or routing change remains; delivery revision stays v4.
- Regression blocks a send and supplies 200 Persian deltas plus a completed snapshot and intervening control. Four focused files pass 220 cases in 27.96 s with local socket access; replay assertion checks incremental text conservation. Full-suite/PostgreSQL acceptance was not rerun for this queue-only change.
- User reports longer-input replay, close/reconnect and silence acceptable. A separately recorded fee query became «پذیره» and yielded no_evidence; source query quality is unresolved and distinct from transport feedback.
- At the user's request, defer the 60-second input scenario and future acceptance until 2026-10-13. Resume from docs/plans/live-conversation-repair-next-session.md. Keep intermittent stall, cleanup, combined sequences and budget matrix open.
- Frontend remains feat/backend-changes with four uncommitted diagnostics/sample accounting files; backend remains feat/ingestion-foundation with uncommitted repairs/tests/contracts/docs. Both need separate commits; none created/pushed. Unrelated .aws must not be staged. This checkpoint changes documentation only.
Local S2S image retry and native checks — 2026-10-16
After the user freed disk, retried the exact reviewed source/base/lock with no
runtime or recipe changes. Image rag-local-s2s-candidate:phase2, ID
sha256:5c80c77c54da4641318e69cdb8fff092391cd746e491fa8029280c2999ce27d1,
built successfully (775.34s; size 2,349,831,100 bytes). Native package check, 15
imports, six real-handler/SDK controlled-I/O cases and two startup refusal guards
passed under network-disabled read-only containers. Existing focused regressions:
423 passed in 69.65s, zero skips. No paid calls, voice tuning, service restart or
DB acceptance. Real local assets/full engine/POSIX/provider-browser gates remain.
Full upstream includes unused CUDA-tagged qwentts wheel; CPU torch/audio alone
do not certify that all installed binaries are CPU-only. Evidence and smoke source
in docs/evaluation/local-s2s/phase-02-image-build-20261016.* / image-sdk-smoke.py.
Historical Local S2S preparation notes — 2026-10-15
Phase 2 actual image-build attempt: user authorized the reviewed build. Added
binary-only dependency installation and excluded resolver cache/scratch artifacts
from Docker context (actual 6.64 MB). Moved only task-owned resolver cache to tmpfs
to preserve it and free about 780 MiB. A 384 MiB root-disk guard cancelled the
build during package installation; exit 130, no final image. Root returned to
about 1.8 GiB free; existing services remained running. No unrelated deletion,
pruning, model download, provider call or voice tuning. Evidence and retry-space
prerequisite in docs/evaluation/local-s2s/phase-02-image-build.*.
Phase 2 dependency follow-up: generated full Python 3.11/Linux manylinux_2_40
134-package hash lock and matching CPU torch/torchaudio 2.11.0 exact wheel
constraints, preserving upstream dependencies. Verified trixie amd64 base manifest;
wheel-only installation dry run passed. Kept PyPI as sole general index to avoid
CPU-index shadowing. Tracked lock/inputs, license/size metadata and exact commands
in services/local_s2s/ and docs/evaluation/local-s2s/phase-02-dependency-lock.*.
Resolver cached metadata/wheel artifacts (including CPU torch); no library
installation, source build, model download, provider call or voice/service changes.
Native engine/image/asset acceptance remains pending.
Phase 2 source-only follow-up: fetched the user-authorized full pinned upstream
commit into ignored tmp/local-s2s-upstream-619e3fe4; clean detached checkout,
all 17 audited SHA-256/blob fingerprints match, Git fsck passed. Evidence:
docs/evaluation/local-s2s/phase-02-source-checkout.json. Existing checkouts and
services preserved. No execution/install/build/model download or provider call.
Reviewed Linux dependency lock is the next gate; Phase 2 remains in progress.
Final acceptance: user reports successful Persian speech, two interruptions and no error. Correlated native diagnostics cover active and completed-unplayed generation repair; both matching acknowledgements precede the next turn's audio. Isolated persisted session is closed/user_requested with no error. Stored speed 1.30, 2048-token cap, PCM24k and 5,760,000-byte backlog verified. Phase 1 accepted for provider-boundary/OpenAI preservation; plan/ledger/report/reference map updated. No new call or runtime tuning. Phase 2 build/live checks and rollback stay open.
Removed the artificial candidate LIVE_MAX_INTENTS=3 override after tracing a
user-run close to RESPONSE_INTENT_CAPACITY. Baseline capacity 256 restored;
actual 2048-token cap, speed 1.30 and inspected buffer values unchanged. Candidate
had no active sessions before recreation; readiness 200 afterward. No new paid
call; restoring runtime capacity does not authorize extra paid requests.
User feedback after real speech: preserve established voice tuning. Restored candidate response cap from 256 to configured 2048 only. Verified speed 1.30, OpenAI-repair backlog 5,760,000 bytes, credit 72,000 bytes and queue 96,000 bytes / 2 seconds unchanged; readiness 200. No extra paid call. Historical 256-token preparation evidence below is superseded for current generation cap.
Follow-up: initial readiness/auth checks missed capabilities.voice=false.
The first UI attempt stopped before reservation because the validation-only
embedding factory requires explicit request limits. Added conservative UTF-8
byte limits solely to the disabled candidate embedding endpoint configuration.
Recreated only candidate API; authenticated configuration now advertises
voice/captions=true with transport testing and uncalibrated status. No provider
calls or runtime/schema changes; real speech acceptance remains pending.
Prepared a candidate-only Linux Compose override and started isolated DB/API
plus Angular on 127.0.0.2:4201 using cached images and read-only current source.
Historical Windows image IDs are unavailable here; selected Linux identities and
actual checks are in docs/evaluation/local-s2s/phase-01-linux-preparation.md.
Session/intent/token limits are 60s/3/256. Migration, DB identity, bootstrap,
readiness and proxied auth/Origin/CSRF checks passed. No provider session was
opened; listening/native repair acceptance remains pending. No runtime code,
frontend source, applied migration or operational service was changed.
Frontend commit checkpoint — 2026-10-12
Supersedes the earlier uncommitted-frontend status: at the user's explicit
request, all four reviewed frontend files were committed on feat/backend-changes
as 52202c2 (Add live voice playback diagnostics and sample accounting).
The frontend working tree is clean. No push was performed. Backend changes
remain uncommitted, and live acceptance remains paused until tomorrow.