Files
rag-technical-docs-assistant/docs/plans/realtime-agent-mvp-plan.md
T
11linear11 996435d2ae feat(voice): add authenticated Phase 2 live lifecycle
Add cookie authentication, owned conversations, durable Live reservations,
tool completion/replay fencing, revocation, and startup reconciliation.
Introduce forward lifecycle/owner-chain migrations and the temporary Gemini
adapter while preserving the existing OpenAI Realtime adapter.

Include the executable audio client, regression coverage, configuration,
API/database documentation, and recorded acceptance evidence.

Validation: focused review suite 82 passed; Python/TOML parsing, JavaScript
syntax, and whitespace checks passed. Full PostgreSQL/provider-free results
are recorded in the repair report; real-provider/browser acceptance is unrun.

Follow-up work remains for configurable OpenAI/Gemini selection, transport
admission, authority diagnostics, playback message bounds, and client replay
identity after ambiguous creation responses.
2026-10-09 07:59:02 -04:00

31 KiB
Raw Blame History

OpenAI Realtime Agent — Fast MVP Implementation Plan

Current voice decision (2026-10-09): Gemini Live is temporarily the sole voice provider because an OpenAI Realtime voice key is unavailable. The validated backend Gemini model/voice configuration is shared by reservation, stream and operator smoke. No OpenAI voice key is required. Extraction/embedding providers, frozen profiles, measured calibration and canonical search are unchanged. The provider-independent browser audio/events, direct document/chunk identities and durable owner/replay/revocation rules remain authoritative. Historical OpenAI checkpoints below remain historical. Gemini interruption closes safely where native sample-level context truncation cannot be verified; seamless barge-in is not certified. See Phase 2 repair report.

1. Goal and implementation decisions

Deliver a working backend for this browser workflow:

Login → upload → review if required → ready → select documents → start voice session → ask in Persian → receive a grounded spoken answer and retrieved sources.

The frontend belongs to another developer. Our deliverables are the agent runtime, backend APIs, WebSocket contract, integration examples, tests, and operational instructions.

Priorities:

  1. Get the agent calling real search as early as possible.
  2. Make failures observable so we can debug actual results.
  3. Complete the backend required by the frontend.
  4. Improve behavior from measured failures.

Existing work to reuse

  • Immutable document intake and the separate ingestion worker.
  • Extraction, review/resume, embeddings, and atomic publication.
  • Scoped PostgreSQL/pgvector search and knowledge selection.
  • The existing strict LangChain search_knowledge tool and bounded runner.

The early-proof script demonstrates the voice interaction, but its search response is currently hardcoded. Search calibration and real retrieval quality acceptance are also still pending.

Chosen architecture

Frontend owned by another developer
        │
        ├── HTTP: authentication, documents, selection, session lifecycle
        │
        └── Application WebSocket: audio and normalized events
                    │
              FastAPI backend
                    │
              Voice runtime
              ├── OpenAI Realtime adapter
              └── Trusted tool dispatcher
                          │
                 Existing LangChain tool
                          │
                 Existing SearchService
                          │
                 PostgreSQL / pgvector

Separate ingestion worker → existing document pipeline

Use OpenAI Realtime, following the successful proof. Keep the existing configured Realtime model initially and verify access; do not silently replace it. Keep extraction and embedding providers unchanged.

Native voice goes directly through Realtime. LangChain exposes the knowledge tool; the old text agent is not part of the voice execution path.

Delivery boundaries

  • First real agent result: end of Phase 1.
  • Authenticated voice integration available to the frontend: end of Phase 2.
  • Complete browser-workflow backend available: end of Phase 3.
  • MVP acceptance and debugging checkpoint: Phase 4.

Planning estimate: 3–5 focused backend engineering days, conditional on provider access, database availability, calibration, human review, and frontend availability. This is not a delivery guarantee.

Deferred: frontend implementation, durable transcript history, public text chat, voice/model selectors, seamless reconnect, additional tools, Redis, a new agent framework, and retrieval enhancements without measured need.


2. Implementation phases and prompts

Purpose: Resolve the provider mismatch and prepare the smallest valid route to real tool results.

Implementation:

  • Inspect the current working tree and preserve unrelated changes, including the proof script.
  • Record the authorized change from Gemini Live to OpenAI Realtime in the affected current specifications.
  • Keep the application HTTP contracts and canonical search result unchanged.
  • Change the proposed browser audio contract to mono PCM16 little-endian, 24 kHz input and output, matching the proof and documented Realtime PCM configuration. Official OpenAI documentation
  • Specify application events independently from provider events. Add:
    • user_speech_started with turn_ref.
    • audio_started with turn_ref and backend-generated audio_ref.
    • Client playback_progress with audio_ref and cumulative played_ms.
  • Retain the existing session_ready, transcript, sources, turn_interrupted, and error event contracts.
  • Freeze audio_ref lifecycle/coordinates, final progress after interruption, acknowledged truncation before continuation, and transport admission/overflow policy in API Section 7.1. Add audio_ended as a generation delimiter, not playback acknowledgement; one ref per provider output item/audio content part, no splitting. See its sixteen contract walkthroughs, including bounded burst delivery, cancellation races, delayed user ASR, overlapping-turn release and stall/cleanup timer ownership.
  • Keep these future runtime requirements as documentation in Phase 0; implement none of Phases 1-4 here.
  • Verify the persisted embedding profile and approved document bindings. Use the existing calibration command and report loader; never invent a cutoff.
  • Establish separate explicit opt-ins for ingestion, calibration, and voice smoke calls.

Exit criteria: The frontend contract is documented, configuration requirements are explicit, and either a valid measured cutoff is available or its exact missing prerequisites are recorded. Missing provider prerequisites must not stop independent implementation.

Implementation prompt:

Use $implement-feature.

Implement Phase 0 of the OpenAI Realtime Agent MVP plan.

First read AGENTS.md, docs/agent-reference-map.md, and the applicable
current specifications. Inspect Git status and the existing proof,
canonical search service, calibration workflow, and LangChain adapter.
Preserve unrelated changes and all applied migrations.

The user has selected OpenAI Realtime instead of Gemini Live.
Update only the affected current contracts and progress records.
Do not perform a broad documentation rewrite or change extraction
and embedding providers.

Freeze the application WebSocket contract using mono PCM16LE at
24 kHz in both directions. Preserve the existing application events.
Specify user_speech_started, audio_started, and playback_progress
as defined in this plan. Provider objects must remain private.

Document backend-only configuration for the Realtime key/model,
fixed voice, proxy, trusted Origin, deadlines, and measured
calibration-report location. Keep the proof's configured model and
voice initially; validate them against official OpenAI documentation.

Inspect calibration prerequisites and reuse the existing runner.
Run real calls only with explicit opt-in and approved bindings.
A missing cutoff must remain CALIBRATION_REQUIRED.

Deliver contract changes, configuration prerequisites, exact next
commands, and truthful executed/not-run results. Implement no UI,
new retrieval pipeline, or text-chat capability.

Phase 1 — Connect the real agent to the existing tool

Purpose: Obtain a real grounded response before completing browser infrastructure.

Implementation:

  • Add a small OpenAI Realtime adapter and voice runtime.
  • Reuse the proven setup, Persian transcription, audio relay, and proxy behavior where applicable.
  • Wait for provider-confirmed configuration before reporting readiness.
  • Register only search_knowledge, deriving its parameters from the existing strict schema.
  • Dispatch completed tool arguments through the existing async LangChain tool.
  • Create trusted execution context outside model arguments. Share source-reference state across searches belonging to the same voice turn.
  • Keep tool execution separate from the provider receive loop.
  • Return the canonical ok, no_evidence, or error result unchanged.
  • Correlate provider input items, responses, tool calls, transcripts, and application turns. Delayed events must retain their original turn.
  • Provide an opt-in operator smoke command that uses the actual runtime and an enabled persisted actor. It is not a public endpoint.

The adapter sends function results using the matching provider call_id and schedules the authorized continuation. Official function-calling flow

Agent behavior:

  • Speak concise Persian.
  • Search before making document claims; retrieve again for follow-ups.
  • Preserve material numbers, dates, conditions, exclusions, and negation.
  • Treat retrieved instructions as untrusted document content.
  • Disclose insufficient or conflicting evidence.
  • Explain technical failures separately from missing evidence.
  • Greetings and clarification questions may omit search.

Exit criteria: An authorized smoke run produces an actual tool call, real document/chunk identities, and a corresponding answer. Unsupported questions and technical failures produce distinct outcomes.

Implementation prompt:

Use $implement-feature.

Implement Phase 1 only: a small OpenAI Realtime adapter, voice runtime,
and operator smoke harness that call the existing knowledge tool.

Read repository guidance and the Phase 0 contract. Inspect the proof
script and current LangChain/search implementation before coding.
Preserve the original proof script and unrelated changes.

Use the existing StructuredTool async entrypoint and one shared
SearchToolRunner. Supply backend-owned SearchExecution, deadlines,
and cancellation. Maintain shared source-reference state within
each application voice turn. Expose only query and optional context.

Implement provider setup acknowledgement, strict function dispatch,
canonical tool output serialization, response continuation, and
provider/input-item/response/call-to-turn correlation. Keep retrieval
off the audio receive loop. Coalesce duplicate events within the
active runtime and prevent duplicate response continuation.

Follow authoritative API 7.1.2/7.1.5/7.1.6: acknowledge VAD
create_response=false and interrupt_response=false; the backend alone
cancels the specific old response. Correlate a narrowly identified
no-active-response race with terminal state and complete context cleanup.
Keep provider-generated audio in the bounded reservoir and pace browser
delivery with progress credits; keep provider control reception responsive.
Only eligible open/sealed refs have playback-stall deadlines; atomically
invalidate ref/timer identities on finalization, recheck queued callbacks,
and start each new eligible interval independently. Retire credit once while
retaining heard/sent/generated evidence; cleanup and release gates stay separate.
Preserve delayed authorized user transcripts under their original turn;
suppress late assistant output only for actually interrupted/superseded work.
Gate each response/create and tool continuation on committed current input,
valid authority/epoch and every cleanup barrier. Consume one intent, and
make cleanup callbacks reevaluate the latest turn token, never release a
superseded response. Diagnostic text uses confirmed input-item creation.

Use an English policy prompt that requires concise Persian speech,
fresh retrieval for document claims and follow-ups, faithful material
conditions, clarification for ambiguity, and safe handling of
untrusted source instructions. Do not invent evidence or fallback
answers when retrieval fails.

Add an operator-only smoke command with an explicit persisted actor,
provider-call opt-in, and bounded execution. Diagnostic text input is
allowed in this harness; do not add a public text-chat route.

Test with a fake provider transport and the actual LangChain adapter.
Cover valid calls, malformed/forged arguments, duplicate events,
delayed transcripts, no_evidence, technical errors, and cancellation.
Run real smoke calls only when prerequisites and authorization exist.

Report actual tool/result correlation and remaining runtime limits.
Do not add a new agent framework or rebuild ingestion/search.

Phase 2 — Add trusted identity and durable Live lifecycle

Remaining-defect implementation and executed acceptance are recorded in the updated repair report. Real selected-model multi-turn behavior and frontend readiness remain unverified.

Purpose: Make the working runtime safely callable by the frontend.

Implementation:

  • Add forward migrations for auth_sessions, owned voice conversations, live_sessions, and voice-only tool_calls, following the existing database contract.
  • Implement A01–A03, C01, V01–V04, and the authenticated stream route.
  • Resolve identity from opaque cookie sessions; enforce Origin, CSRF, role, ownership, expiry, and current access epoch.
  • Persist the session reservation before opening the provider connection.
  • Deduplicate creation and tool calls durably. Running duplicates share completion; completed duplicates require fresh eligibility checks; changed arguments conflict.
  • Allow one media connection per session.
  • On interruption, cancel pending calls, flush playback, suppress late output, and truncate unplayed provider audio using validated playback progress. WebSocket playback requires application-managed truncation. Official interruption guidance
  • Close sessions on logout, expiry, user disablement, or access-epoch revocation. Extend existing selection invalidation transactionally and notify the local runtime after commit.
  • On API restart, fail abandoned sessions and running calls. Reconnection creates a fresh session after reconciliation.
  • Wire the modular API without importing the prototype retrieval singleton or exposing the prototype chat route.

Exit criteria: Authenticated clients can create, stream, poll, reconcile, and close a session. Replay, interruption, revocation, and restart behavior pass targeted real PostgreSQL checks.

Implementation prompt:

Use $implement-feature.

Implement Phase 2: authenticated HTTP/WebSocket access and durable
voice-session/tool-call lifecycle around the Phase 1 runtime.

Follow the API and database specifications for A01-A03, C01,
V01-V04, ownership, replay, state transitions, errors, and voice-only
tool persistence. Inspect Alembic head and add forward migrations.
Never modify applied revisions or create deferred text-history tables.

Implement opaque cookie sessions, stored token hashes, CSRF,
trusted Origin checks, expiry, enabled-user checks, and owner-chain
authorization. Provision demo accounts through trusted maintenance
commands; add no signup or account-management UI.

Reserve Live sessions before remote setup. Keep provider calls outside
transactions. Enforce creation replay and one active media connection.
Persist tool arguments/hash/results and coalesce running duplicates.
Revalidate parent authorization and source eligibility before replay
and before releasing results. Do not repeat provider work on replay.

Implement interruption, playback-progress validation, provider audio
truncation, late-event suppression, bounded queues, and cleanup.
Accept only documented application controls; never forward arbitrary
browser JSON as provider events.

Apply API 7.1.2/7.1.5/7.1.6 exactly: separate bounded generated backlog,
transport reservations and browser playback; use a paced progress-credit
window, not a two-second cap on a generation burst. Restrict playback-stall
timers to eligible open/sealed refs; finalization atomically invalidates them,
queued callbacks recheck state/identity, and new eligible output gets fresh
timing. Acknowledged retirement releases remaining credit once without
changing playback evidence or bypassing response-release barriers. Both VAD flags are
false, with backend-owned response-specific cancellation and the narrow
no-active cancellation race exception after terminal-state confirmation.
Preserve delayed user ASR, distinguish normal completion from interruption,
and suppress only ineligible assistant output. Response release requires
current correlated input commitment, authorization/epoch and all cleanup
barriers; a new genuine speech-start supersedes pending work without
restarting old cleanup or letting its callbacks release the old turn.

Integrate logical epoch invalidation with the existing selection
service and close affected runtimes after commit. Handle logout,
expiry, disablement, provider loss, and startup recovery.

Use deterministic provider simulations plus isolated PostgreSQL
tests for uniqueness, concurrent replay, ownership, cancellation,
revocation races, and restart. Missing database configuration must
fail acceptance rather than count as a pass.

Deliver the callable API and an integration example for the frontend
developer. Implement no production UI or public text chat.

Phase 3 — Expose document workflows and hand off to the frontend

Purpose: Complete the backend needed for the full browser MVP.

Implementation:

  • Expose D01–D04, D06–D07 and the authenticated review preview, K01–K02, and read-only F01.
  • Wrap existing intake, review, retry, and selection services.
  • Bound multipart parsing and file spooling before passing data to intake.
  • Keep independent uploads and immutable originals. Retry the same eligible failed document/job.
  • Preserve explicit extraction/factual review. Approval does not automatically retry, publish, or activate a document.
  • Publish runtime-derived capabilities and truthful processing states.
  • Provide a frontend handoff containing HTTP examples, WebSocket schemas, error/recovery behavior, and a small client integration example.
  • Use a same-origin development proxy for the other developer's frontend; do not default to wildcard credentialed CORS.

Exit criteria: A frontend developer can implement the complete browser journey using the handoff without inventing backend behavior.

Implementation prompt:

Use $implement-feature.

Implement Phase 3 only: the document/selection/configuration HTTP
transport and frontend integration handoff.

Reuse the existing application services for D01-D04, D06-D07,
the authenticated review preview, K01-K02, and F01. Follow their
documented permissions, DTOs, idempotency, revision checks, pagination,
and safe errors. Add no public search endpoint.

Bound multipart parsing, aggregate request size, file size, and
temporary spooling. Preserve byte/title replay semantics, independent
document identities, immutable originals, same-job retry, and
ready-but-inactive publication.

Expose retained evidence and evidence-bound review decisions.
Require explicit human decisions where the existing workflow does.
Approval alone must not enqueue, publish, or activate anything.
Protect preview access without accepting storage paths from callers.

Publish actual configured capabilities and processing states.
Use the existing API error envelope and request correlation.

Prepare a concise frontend handoff with endpoint examples,
cookie/CSRF requirements, UUID/idempotency handling, audio setup,
event schemas, playback-progress reporting, interruption, source
labels, polling, and fresh-session recovery. Include a minimal client
integration example, not a production frontend.

Test authorization, oversized/malformed uploads, upload replay,
review approval/rejection/staleness, same-job retry, atomic selection,
and revoked-source redaction. Reuse existing fixtures and run affected
PostgreSQL acceptance where persistence behavior is changed.

Deliver a complete documented backend integration surface.
Do not rebuild the worker, add settings editing, or implement UI.

Phase 4 — Run real acceptance, debug failures, and prepare deployment

Purpose: Evaluate the actual MVP and fix the highest-impact defects.

Implementation:

  • Test locally with the frontend developer's UI first.
  • Complete the existing independently annotated retrieval evaluation, including unseen files and required human review.
  • Preserve the documented gate: at least 18/20 answerable cases, every critical case, and all six unsupported cases.
  • Run a bounded voice scenario set covering factual questions, follow-ups, topic changes, ambiguity, missing support, interruption, provider loss, and revocation.
  • Record correlated timings for user-turn completion, tool start/end, first output audio, and terminal outcome. Keep document bodies, audio, cookies, and secrets out of diagnostic logs.
  • Classify failures as transcription, retrieval, tool dispatch, grounding, playback, or lifecycle failures.
  • Fix observed release blockers and rerun affected checks.
  • Update the existing container setup for one API process, one separate worker, PostgreSQL/pgvector, shared durable files, and eventual HTTPS/WSS.
  • Provide /health/live and /health/ready; health checks must not call AI providers.
  • Record local acceptance separately from HTTPS deployment acceptance.

Exit criteria: The local browser workflow passes, real quality results are recorded, release-blocking failures are fixed, and startup/recovery instructions are reproducible.

Implementation prompt:

Use $implement-feature.

Complete Phase 4: real MVP acceptance, measured debugging, and
operational handoff. Start from the implemented backend and the
frontend developer's UI.

Run provider-free regressions and mandatory isolated PostgreSQL
acceptance. Run real ingestion/calibration/evaluation/voice calls only
with the corresponding explicit opt-ins and approved inputs.

Complete the existing held-out evaluation without weakening labels,
sharing calibration questions, inventing unseen annotations, or
changing the frozen embedding profile. Apply the documented
18/20, all-critical, and 6/6-unsupported gate.

Exercise real Persian voice questions, follow-ups, topic changes,
ambiguous references, insufficient/conflicting evidence, prompt-like
source content, interruption during search/playback, provider loss,
logout, epoch revocation, and API restart.

Record safe correlated timing/status evidence. Classify each failure
by layer and fix only measured MVP blockers. Add a regression for
each material defect, then rerun affected checks. Do not introduce
reranking, ANN, new tools, or unrelated refactoring without evidence.

Update the existing deployment setup and readiness/liveness endpoints.
Keep one API process and a separate worker with persistent storage.
Provide local startup, migration, account provisioning, review/retry,
frontend integration, and recovery instructions. Document the
remaining HTTPS/WSS deployment gate.

Report implemented behavior, actual test results, real-provider
results, latency observations, known limits, and unresolved external
prerequisites. Never claim quality or deployment acceptance from mocks.

3. Validation and debugging rules

Run targeted checks after each phase. Run the full suites at the final checkpoint:

.venv/Scripts/python -m pytest -m "not postgres"
.venv/Scripts/python -m tests.postgres_prerequisites
.venv/Scripts/python -m pytest -m postgres --require-postgres
.venv/Scripts/python -m pip check
git diff --check

TEST_DATABASE_URL must identify an isolated test database. Inspect new files separately because tracked diff checks do not cover untracked files.

Keep three independent result categories: technical checks, real retrieval quality, and real browser voice behavior.

For each material failure, record the scenario, expected behavior, correlated IDs, failing layer, fix, and rerun result. Do not add an observability service for this MVP.


4. Defaults, prerequisites, and handoff

  • Responsibility: backend implementation and integration support; frontend implementation remains with its developer.
  • Development: local browser first, using a same-origin proxy; HTTPS/WSS remains a separate deployment checkpoint.
  • Voice profile: preserve gpt-realtime-mini and fixed shimmer; proof input transcription is whisper-1 with language fa (output speed 0.98). Official retirement dates checked 2026-10-08: gpt-realtime-mini 2027-01-20; whisper-1 2027-02-26. No shimmer-specific retirement date found. See official deprecations and Phase 0 configuration lifecycle. Replacement needs a separate explicit decision/account/budget/validation before retirement; never silently migrate.
  • Search: reuse the current compatible embedding profile, measured cutoff, evidence limits, and four-running/eight-waiting runner with its existing 75-second maximum.
  • Proposed local defaults: eight-hour auth sessions, ten-minute voice sessions, 15-second provider connection timeout, 30-second setup deadline, and at most two seconds of queued audio per direction. Make these configurable engineering defaults.
  • Transport/lifecycle defaults: API Section 7.1 is canonical: 9600-byte aligned PCM messages; 4096-byte client controls / 65536-byte server events; 96000-byte and 100-message audio queues; 1000 ms final progress window; 5-second cleanup acknowledgement and send deadlines. A separate 1440000-byte (30 s) generated-plus-undrained backlog and 72000-byte (1500 ms) progress-credit delivery window prevent healthy generation bursts overflowing playback; 5 s stalled progress fails explicitly only for eligible open/sealed refs. Finalization invalidates their stall timer atomically; final-progress/cancellation/cleanup deadlines remain independent, callbacks recheck state/identity, and newly eligible output gets fresh timing. Retirement releases credit once while retaining evidence counters. Other reference/input/provider/control/memory caps and current-turn release gates are specified there. These are initial engineering defaults, not product capacity/latency approval.
  • Real-call limits: retain the existing ten-call calibration and 26-query evaluation bounds. Use a separately opted-in voice smoke run capped at ten minutes total. Ingestion has its own explicit budget.
  • External prerequisites: approved originals/document bindings, required human review, compatible database/provider access, and frontend availability. Missing prerequisites block their dependent acceptance only.
  • Markdown artifact: this plan is stored as docs/plans/realtime-agent-mvp-plan.md. Add links to phase completion reports as implementation progresses. This document records the proposed work; it does not claim implementation or runtime acceptance.

Phase 0 checkpoint (2026-10-08)

Contract/configuration preparation repaired for ordering, coordinates, transport bounds, provider retirement, preflight, paced output, cancellation races, delayed user transcripts and overlapping-turn release; see prerequisites, next commands and actual results. Measured calibration remains blocked by explicit opt-in, approved bindings and verified database/profile access. Later phases are not implemented by this checkpoint.

Phase 1 repair checkpoint (2026-10-08)

Implemented the scoped existing-runtime repairs; see operator configuration, behavior, exact checks and remaining acceptance. The original proof/mock scripts, shared canonical search/StructuredTool/runner, migrations and frozen inputs remain unchanged.

Targeted fake-provider/shared-runner/shutdown acceptance: 181 passed. Final provider-free acceptance: 1426 passed, three existing Windows symlink skips and 311 PostgreSQL tests deselected. Dependency, AST, manifest, whitespace, guide-link and baseline preservation checks passed. Real provider/Persian speech/browser playback and isolated PostgreSQL acceptance remain unrun; missing opt-in/calibrated corpus bindings and TEST_DATABASE_URL are not filled with invented evidence. The cancellation classifier remains fail-closed. This checkpoint does not claim the real grounded-provider Phase 1 exit criterion.

Five remaining Phase 1 defects checkpoint (2026-10-08)

Repaired independent failure cleanup, one-to-one function identity, exact adapter wire accounting, common call-ID validation and successful empty-audio lifecycle. See behavior, regression evidence and exact executed checks. This later checkpoint passed 229 targeted tests and 1474 provider-free tests (three existing Windows symlink skips; 311 PostgreSQL tests deselected). Protected inputs and unrelated changes remain preserved; shared retrieval and the existing 50 ms runner test are unchanged. Real provider, speech, browser playback and isolated PostgreSQL acceptance remain unrun with the prerequisites and fail-closed limits recorded in the operator guide. Scope remains Phase 1.

Readiness and Unicode Phase 1 checkpoint (2026-10-08)

Repaired application admission to require successful session_ready delivery, separate from provider-confirmed setup. Malformed Unicode model arguments now receive canonical INVALID_TOOL_ARGUMENTS with safe bounded replay fingerprints, while provider framing/correlation remains strict. See operator behavior, evidence and exact checks.

This later checkpoint adds 52 regressions: 281 targeted tests passed; the full provider-free suite passed 1526 tests with three existing Windows symlink skips and 311 PostgreSQL tests deselected. Protected files and unrelated changes were preserved. Real provider/speech/browser and isolated PostgreSQL acceptance remain unrun; missing calibration and unproved cancellation classification remain fail-closed. Historical results above are unchanged. Scope remains Phase 1.

Provider replay and user ASR Phase 1 checkpoint (2026-10-08)

Repaired replay hashing to retain the provider's actual UTF-8 wire admission without applying that cap to ASCII expansion or canonical numeric spelling. Completed user-ASR is coalesced by mapped input/content identity, with conflicts failing observably and legitimate repeated partial text preserved. See operator evidence, failures/reruns and exact checks.

This checkpoint adds 37 cases: 318 targeted tests passed; 1563 provider-free tests passed with three existing Windows symlink skips and 311 PostgreSQL tests deselected. Protected files, unrelated changes, shared search/runner and the existing 50 ms test remain preserved. Historical results above remain distinct. Real provider/speech/browser and isolated PostgreSQL acceptance remain unrun, subject to authorization/calibrated actor/corpus prerequisites and fail-closed calibration/cancellation classification. Scope remains Phase 1.