Files
11linear11 9cc9f0bc01 docs(plan): update live repair progress report, traces guide, and next session checklist
- Record measured acceptance evidence across real Q01, continuation, and topic change runs
- Add next-session checklist for remaining 60-second continuous speech and quality benchmark
- Add guide for numeric latency and playback diagnostics
2026-10-12 17:57:51 -04:00

11 KiB

Development notes

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-v1 in 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_tokens limitation; 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.

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.