Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

test(voice): cover provider work admission feedback

vastsa6b9ee4432581
diff --git a/apps/desktop/test/live-work-provider-integration.test.mjs b/apps/desktop/test/live-work-provider-integration.test.mjs
new file mode 100644
index 000000000..0782f424c
--- /dev/null
+++ b/apps/desktop/test/live-work-provider-integration.test.mjs
@@ -0,0 +1,300 @@
+import assert from "node:assert/strict";
+import test from "node:test";
+import { AgentHost, MemoryQueueStore } from "@pi-desktop/agent-host";
+import { LiveWorkCoordinator } from "@pi-desktop/host-runtime";
+import {
+ LIVE_WORK_TOOL_NAME,
+ codexDelegationFeedback,
+ codexWorkFeedbackMessage,
+ geminiToolResponseMessage,
+ geminiWorkFeedbackMessage,
+ parseCodexMessage,
+ parseGeminiMessage,
+ parseRealtimeMessage,
+ realtimeToolReceiptMessage,
+ realtimeWorkFeedbackMessages,
+} from "@pi-desktop/voice-runtime/live";
+
+const SESSION_ID = "live-work-fixture-session";
+const CALL_ID = "live-work-fixture-call";
+const BINDING_REVISION = 3;
+const INSTRUCTION = "Inspect the login flow and report the verified result.";
+const PRINCIPAL = { subject: "desktop", roles: ["owner"], pairedDevice: true };
+
+const profiles = [
+ {
+ id: "codex-live",
+ parse(providerRequestId) {
+ const [event] = parseCodexMessage({
+ type: "delegation.created",
+ item: {
+ type: "delegation",
+ target: "client",
+ id: providerRequestId,
+ content: [{ type: "input_text", text: INSTRUCTION }],
+ },
+ });
+ assert.equal(event.kind, "delegation");
+ return {
+ providerRequestId: event.delegationId,
+ toolName: LIVE_WORK_TOOL_NAME,
+ arguments: { instruction: event.instruction },
+ };
+ },
+ receipt(providerRequestId, receipt) {
+ assert.equal(receipt.status, "received");
+ return codexDelegationFeedback(providerRequestId, {
+ operationId: receipt.operationId,
+ status: "received",
+ });
+ },
+ result(providerRequestId, feedback) {
+ return codexWorkFeedbackMessage(providerRequestId, feedback);
+ },
+ assertReceipt(wire, providerRequestId, operationId) {
+ const message = JSON.parse(wire);
+ assert.equal(message.type, "delegation.context.append");
+ assert.equal(message.delegation_item_id, providerRequestId);
+ assert.match(message.content[0].text, new RegExp(operationId));
+ },
+ assertResult(wire, providerRequestId, turnId) {
+ const message = JSON.parse(wire);
+ assert.equal(message.delegation_item_id, providerRequestId);
+ assert.match(message.content[0].text, new RegExp(turnId));
+ },
+ },
+ {
+ id: "gemini-live",
+ parse(providerRequestId) {
+ const [event] = parseGeminiMessage({
+ toolCall: {
+ functionCalls: [{
+ id: providerRequestId,
+ name: LIVE_WORK_TOOL_NAME,
+ args: { instruction: INSTRUCTION },
+ }],
+ },
+ });
+ assert.equal(event.kind, "tool-candidate");
+ return event;
+ },
+ receipt(providerRequestId, receipt) {
+ return geminiToolResponseMessage({
+ providerRequestId,
+ toolName: LIVE_WORK_TOOL_NAME,
+ receipt,
+ });
+ },
+ result(_providerRequestId, feedback) {
+ return geminiWorkFeedbackMessage(feedback);
+ },
+ assertReceipt(wire, providerRequestId, operationId) {
+ const call = wire.toolResponse.functionResponses[0];
+ assert.equal(call.id, providerRequestId);
+ assert.equal(call.name, LIVE_WORK_TOOL_NAME);
+ assert.deepEqual(call.response, {
+ status: "received",
+ operationId,
+ providerRequestId,
+ execution: "not_started",
+ });
+ },
+ assertResult(wire, _providerRequestId, turnId) {
+ assert.match(wire.clientContent.turns[0].parts[0].text, new RegExp(turnId));
+ },
+ },
+ ...["realtime-ga", "realtime-compat-v1"].map((id) => ({
+ id,
+ parse(providerRequestId) {
+ const [event] = parseRealtimeMessage({
+ type: "response.function_call_arguments.done",
+ call_id: providerRequestId,
+ name: LIVE_WORK_TOOL_NAME,
+ arguments: JSON.stringify({ instruction: INSTRUCTION }),
+ }, id);
+ assert.equal(event.kind, "tool-candidate");
+ return event;
+ },
+ receipt(providerRequestId, receipt) {
+ return realtimeToolReceiptMessage({ providerRequestId, receipt });
+ },
+ result(_providerRequestId, feedback) {
+ return realtimeWorkFeedbackMessages(feedback);
+ },
+ assertReceipt(wire, providerRequestId, operationId) {
+ assert.equal(wire.item.type, "function_call_output");
+ assert.equal(wire.item.call_id, providerRequestId);
+ assert.deepEqual(JSON.parse(wire.item.output), {
+ status: "received",
+ operationId,
+ providerRequestId,
+ execution: "not_started",
+ });
+ },
+ assertResult(wire, _providerRequestId, turnId) {
+ assert.match(wire[0].item.content[0].text, new RegExp(turnId));
+ assert.deepEqual(wire[1], { type: "response.create" });
+ },
+ })),
+];
+
+for (const profile of profiles) {
+ test(`${profile.id} request reaches AgentHost admission and terminal feedback wire`, async (t) => {
+ const prompts = [];
+ let id = 0;
+ const host = new AgentHost({
+ runtime: {
+ async prompt(request) {
+ prompts.push(request);
+ id += 1;
+ return { turnId: `runtime-turn-${id}` };
+ },
+ async steer() { return { accepted: true }; },
+ async stop() { return { requested: true }; },
+ async abort() {},
+ async respondInput() {},
+ },
+ sessions: {
+ async get(sessionId) {
+ return {
+ id: sessionId,
+ title: "Live work fixture",
+ projectId: "fixture-project",
+ mode: "agent",
+ permissionMode: "ask",
+ createdAt: "2026-09-29T00:00:00.000Z",
+ updatedAt: "2026-09-29T00:00:00.000Z",
+ };
+ },
+ async history() { return { items: [], hasMore: false }; },
+ },
+ approvals: {
+ async resolveTool() {},
+ async resolveContract() {},
+ async listPendingTools() { return []; },
+ },
+ clock: { now: () => Date.parse("2026-09-29T00:00:00.000Z") },
+ ids: { next: (prefix) => `${prefix}-${++id}` },
+ queueStore: new MemoryQueueStore(),
+ });
+
+ const updates = [];
+ const coordinator = new LiveWorkCoordinator({
+ resolveIntent: async () => ({
+ kind: "new-task",
+ relationToActive: "unspecified",
+ explicitRepeat: false,
+ }),
+ workPort: {
+ async snapshot(sessionId) {
+ const state = await host.workSnapshot(sessionId);
+ return {
+ sessionId,
+ mode: state.mode,
+ state: state.state,
+ ...(state.activeTurnId ? { activeTurnId: state.activeTurnId } : {}),
+ queue: state.queue.map(({ queueEntryId, position }) => ({ queueEntryId, position, summary: "" })),
+ observedAt: Date.parse("2026-09-29T00:00:00.000Z"),
+ };
+ },
+ async submit(request) {
+ const result = await host.startTurn(PRINCIPAL, {
+ sessionId: request.sessionId,
+ admission: "queue",
+ idempotencyKey: request.idempotencyKey,
+ input: {
+ text: request.text,
+ userMessageId: request.userMessageId,
+ voiceOrigin: request.voiceOrigin,
+ },
+ context: { requestId: request.idempotencyKey },
+ });
+ return result.turn.status === "queued"
+ ? { status: "queued", queueEntryId: result.turn.id }
+ : { status: "started", turnId: result.turn.id };
+ },
+ async steer() { return { accepted: true }; },
+ async enqueue() { return { queueEntryId: "unused-queue-entry" }; },
+ async stop() { return { status: "requested" }; },
+ async cancelQueued() { return { status: "canceled" }; },
+ async listProjects() { return []; },
+ async listSessions() { return []; },
+ async openSelection() { return { status: "opened" }; },
+ },
+ onOperation: (update) => updates.push(update),
+ now: () => Date.parse("2026-09-29T00:00:00.000Z"),
+ });
+ t.after(() => coordinator.closeCall(CALL_ID));
+
+ coordinator.openCall({
+ callId: CALL_ID,
+ workSessionId: SESSION_ID,
+ workBindingRevision: BINDING_REVISION,
+ });
+
+ const terminalEvents = [];
+ const subscription = host.subscribe(PRINCIPAL, { scope: "session", sessionId: SESSION_ID }, {
+ deliver(event) {
+ if (event.kind === "turn.completed" && event.turnId) terminalEvents.push(event);
+ },
+ close() {},
+ });
+ t.after(() => host.unsubscribe(subscription.subscriptionId, SESSION_ID));
+
+ const providerRequestId = `${profile.id}-request-1`;
+ const candidate = profile.parse(providerRequestId);
+ const receiptWire = [];
+ await coordinator.receiveCandidate({
+ callId: CALL_ID,
+ workBindingRevision: BINDING_REVISION,
+ workSessionId: SESSION_ID,
+ providerRequestId: candidate.providerRequestId,
+ instruction: candidate.arguments.instruction,
+ }, async (receipt) => {
+ receiptWire.push(profile.receipt(providerRequestId, receipt));
+ return { status: "sent", deliveryId: `${profile.id}-receipt` };
+ });
+
+ assert.equal(prompts.length, 1, "one provider request invokes the existing AgentHost runtime once");
+ assert.equal(prompts[0].content, INSTRUCTION);
+ assert.equal(prompts[0].voiceOrigin.callId, CALL_ID);
+ assert.equal(prompts[0].voiceOrigin.operationId, updates.at(-1).operation.operationId);
+ assert.equal(receiptWire.length, 1);
+ profile.assertReceipt(receiptWire[0], providerRequestId, updates.at(-1).operation.operationId);
+
+ const operation = coordinator.listOperations(CALL_ID)[0];
+ assert.equal(operation.execution, "running");
+ host.ingest({
+ sessionId: SESSION_ID,
+ turnId: operation.turnId,
+ ts: Date.parse("2026-09-29T00:00:01.000Z"),
+ event: { type: "agent_end", messageIds: [] },
+ });
+
+ assert.equal(terminalEvents.length, 1, "the authoritative AgentHost terminal event closes the operation");
+ coordinator.reportTurnTerminal({
+ sessionId: SESSION_ID,
+ runtimeTurnId: terminalEvents[0].turnId,
+ turnId: terminalEvents[0].turnId,
+ status: "completed",
+ });
+ coordinator.reportTurnResult({
+ callId: CALL_ID,
+ operationId: operation.operationId,
+ summary: "Task completed on the recorded turn.",
+ });
+ const terminalOperation = coordinator.listOperations(CALL_ID)[0];
+ assert.equal(terminalOperation.execution, "completed");
+
+ const feedback = {
+ feedbackId: `${profile.id}-feedback`,
+ callId: CALL_ID,
+ workBindingRevision: BINDING_REVISION,
+ operationId: operation.operationId,
+ kind: "result",
+ delivery: "speak-when-idle",
+ content: `Task completed on turn ${terminalOperation.turnId}.`,
+ };
+ profile.assertResult(profile.result(providerRequestId, feedback), providerRequestId, terminalOperation.turnId);
+ });
+}
diff --git a/docs/implementation/live-work-evidence.md b/docs/implementation/live-work-evidence.md
index 5f2f228c6..e8ae9085b 100644
--- a/docs/implementation/live-work-evidence.md
+++ b/docs/implementation/live-work-evidence.md
@@ -10,12 +10,13 @@ specification remains the behavioral source.
- Request branch: `codex/live-voice-v1`; dedicated worktree:
`/Users/lan/.codex/worktrees/live-voice-v1/PI-Desktop`.
- Phase-2 implementation base: `1ec74701f` (the v1 implementation commit).
-- Latest fetched `origin/main`: `6c9e9d4e38a62a72b59e4d3c40c7799c34b27a2d`;
+- Latest fetched `origin/main`: `8fcca3d25c98d66c46d0f9cddab76167b6ddb294`;
it is included in the request candidate through merge commit
- `7e601bd3c9cc4a2deb9416ca4c810885a8ea4c49`.
-- The phase-2 changes originated from `1ec74701f1c23219bc6c68fc723e77cc432419df`
- and were integrated with the latest main before candidate validation. The
- test-harness follow-up and this evidence refresh are based on that candidate.
+ `4afe31c4a3178c06024d3ebcac25a678ef98f9fd` and `pnpm check:pr-base` passes.
+- The phase-2 changes originated from `1ec74701f1c23219bc6c68fc723e77cc432419df`.
+ The provider integration fixture and W2 case-level audit are part of the
+ current candidate; the fixture does not instantiate the production Main
+ work-bridge or concrete provider transport adapters.
- Existing pull request: [#1161](https://github.com/vastsa/PI-Desktop/pull/1161),
open on `codex/live-voice-v1`. This task updates that PR and does not merge it.
- The worktree has an untracked `PI-Desktop-Live-Voice-v1-Spec.md`; it is not a
@@ -113,22 +114,16 @@ specification remains the behavioral source.
| Check | Result |
|---|---|
-| `pnpm --filter @pi-desktop/shared build` | Passed after the additive playback-activity DTO. |
-| `pnpm --filter @pi-desktop/voice-runtime build` | Passed with the playback signal helper. |
-| `pnpm --filter @pi-desktop/host-runtime test` | 75 tests passed. |
-| `pnpm --filter @pi-desktop/voice-runtime test` | 51 tests passed. |
-| `pnpm --filter @pi-desktop/i18n test` | 27 tests passed. |
-| `pnpm --filter @pi-desktop/desktop typecheck` | Passed after rebuilding shared and voice-runtime. |
-| `pnpm -r --if-present test` | Passed all workspace suites: desktop 3,160; agent-runtime 1,091; shared 1,124; host-runtime 75; voice-runtime 51; agent-host 49; plugin-devkit 49; plugin-sdk 356; i18n 27; RACP 21; pi-host 6; docs 11. |
-| Targeted Live Voice `node --test` | 15 tests passed, covering Main service, selection scope/UI, controller path, and playback-activity IPC. |
-| `pnpm build:js` | Passed; docs, workspace packages, Electron main, preload, and renderer built. Existing chunk-size and VitePress highlighting warnings remain. |
+| `node --test test/live-work-provider-integration.test.mjs` (from `apps/desktop`) | 4 passed: Codex Live, Gemini Live, Realtime GA, and Realtime compat-v1. These use real protocol parsers/encoders, the coordinator, and AgentHost admission/terminal APIs; the work port, Runtime prompt, and provider transport are fixtures. |
+| `pnpm -r --if-present test` | Passed all workspace suites on the current candidate; desktop: 3,173 passed, 0 failed; docs: 11 passed, 0 failed. |
+| `pnpm --filter @pi-desktop/desktop typecheck` | Passed on the current candidate. |
+| `pnpm build:js` | Passed on the current candidate; docs, workspace packages, Electron main, preload, and renderer built. Existing VitePress highlighting and large-chunk warnings remain. |
| `pnpm lint` | Passed, including style-token validation. |
-| `cargo fmt --check` | Passed on the latest-main integration candidate. |
-| `cargo test -p host-core --locked` | 666 tests passed on the latest-main integration candidate. |
-| `cargo clippy -p host-core --all-targets --locked` | Passed on the latest-main integration candidate. |
-| `pnpm docs:check` | Passed; 83 English/Chinese specification pairs and 527 documentation pages verified. Existing ADR format notes remain. |
-| `pnpm check:agent-policy`, `pnpm check:pr-base`, `node scripts/check-architecture.mjs`, and `git diff --check` | Passed on the latest-main integration candidate; `origin/main` at `6c9e9d4e38a6`. |
-| Composer plugin-slot integration tests | 11 tests passed after updating the SSR preload boundary and toolbar control expectation for Live Voice. |
+| `cargo fmt --check` | Passed on the current candidate. |
+| `cargo test -p host-core --locked` | 670 tests passed; the later `origin/main` merge changed Runtime/shared TypeScript and docs only. |
+| `cargo clippy -p host-core --all-targets --locked` | Passed; the later `origin/main` merge changed no Rust files. |
+| `pnpm docs:check` | Passed; 83 English/Chinese specification pairs and 530 documentation pages verified. Existing ADR format notes remain. |
+| `pnpm check:agent-policy`, `pnpm check:pr-base`, and `node scripts/check-architecture.mjs` | Passed. PR base check confirms `origin/main` at `8fcca3d25c98` is an ancestor of the candidate. |
The directly exercised W2 behaviors are mapped below. A mapped test proves
only the named seam and assertions, not a complete provider-to-device journey.
@@ -164,22 +159,26 @@ only the named seam and assertions, not a complete provider-to-device journey.
- Codex local output signal threshold and strict playback-activity IPC:
`packages/voice-runtime/src/live/playback-monitor.test.ts` and
`apps/desktop/test/live-voice-ipc-media.test.mjs`.
-
-Direct or partial test mappings include W2-001, W2-005, W2-007, W2-009—016,
-W2-027, W2-041/042, W2-045, W2-049/050, W2-060/061, W2-063/064, W2-073—076,
-W2-081, W2-086—089, and W2-093. The mapping is **not complete**: the remaining
-W2-001—W2-096 cases still need an explicit case-level audit, and the current
-tests do not provide one normalized request → registered handler → terminal →
-provider-wire integration fixture per adapter profile.
+- Four-profile parser/encoder → `LiveWorkCoordinator` → actual
+ `AgentHost.startTurn` / terminal event → feedback encoder fixture:
+ `apps/desktop/test/live-work-provider-integration.test.mjs`. Its local
+ `LiveWorkPort` mirrors the production admission shape but is not the
+ production `createLiveWorkBridge` mapping.
+
+The full W2-001—W2-096 case-level mapping, with Direct / Partial / Gap status
+and evidence boundaries, is in
+`docs/implementation/live-work-w2-coverage.md`. The fixture is deterministic
+and crosses into AgentHost, but does not exercise the registered Main
+`createLiveWorkBridge` handler mapping or concrete socket/WebRTC adapters; it
+therefore remains partial evidence for W2-025 and W2-096.
## Remaining acceptance work
-- Cross-boundary integration currently uses deterministic seams and protocol
- encoders; it does not exercise a full normalized request → registered Agent
- handler → authoritative terminal event → provider wire path for each of
- Codex, Gemini, Realtime GA, and Realtime compat.
-- W2-001—W2-096 still need a complete case-level mapping and uncovered-case
- audit. This implementation does not claim all 96 behaviors pass.
+- Cross-boundary integration now covers four protocol profiles through the
+ shared coordinator and actual AgentHost admission/terminal events. The Main
+ bridge mapping and concrete socket/WebRTC adapter transport remain untested.
+- The W2 matrix has a row for every acceptance ID, but Partial and Gap rows
+ remain; this implementation does not claim all 96 behaviors pass.
- M01—M16 and each Codex OAuth, Gemini Live, Realtime GA, and Realtime compat
real-account/media journey are `NOT RUN`. No credentials, paid endpoints, or
audio-device journey were used. Repository policy also reserves
diff --git a/docs/implementation/live-work-w2-coverage.md b/docs/implementation/live-work-w2-coverage.md
new file mode 100644
index 000000000..d4438b07c
--- /dev/null
+++ b/docs/implementation/live-work-w2-coverage.md
@@ -0,0 +1,125 @@
+# Live Work W2 Acceptance Coverage Audit
+
+Audit baseline: latest request candidate after merging `origin/main` at
+`8fcca3d25c98`. The attached v2 work-integration specification defines the
+behavior for W2-001—W2-096.
+
+Status means:
+
+- **Direct** — a test asserts the named behavior at the listed local boundary.
+- **Partial** — a related seam or invariant is tested, but the complete scenario
+ in the acceptance row is not.
+- **Gap** — this audit found no direct automated test for the named scenario.
+
+These labels describe test mapping, not implementation completion or a claim
+that a real provider/device journey passed. A mocked external boundary is
+called out where relevant.
+
+| ID | Status | Test mapping or uncovered assertion |
+|---|---|---|
+| W2-001 | Direct | `apps/desktop/test/live-voice-service.test.mjs` — “Live call follows prepare, connect, mute, in-memory transcript, reject-only delegation, and end” |
+| W2-002 | Partial | `apps/desktop/test/live-voice-service.test.mjs` — “an explicitly bound work call forwards only the declared tool candidate to its fixed work scope”; host-side session resolution is covered separately, not through the real window selection path |
+| W2-003 | Partial | `apps/desktop/test/live-voice-permission.test.mjs` — “Live Voice media permission requires the trusted main frame and an active microphone lease”; work-binding and delegation owner spoof cases are not combined in this test |
+| W2-004 | Gap | No test currently switches the visible session from A to B and asserts that work remains bound to A |
+| W2-005 | Direct | `apps/desktop/test/live-work-scope.test.mjs` — “a work session removed while Host metadata is being read cannot pass revalidation” |
+| W2-006 | Gap | No test changes project membership or tightens the bound session mode during classification |
+| W2-007 | Direct | `apps/desktop/test/live-work-scope.test.mjs` — “work scope requires the still-active call binding and a supported local session” |
+| W2-008 | Gap | No test proves Live credentials remain separate from the bound session’s configured coding provider |
+| W2-009 | Partial | `apps/desktop/test/live-voice-controller.test.mjs` — “renderer and Main complete a Codex Live user path without invoking an Agent”; work-enabled Codex delegation is covered by the new wire/coordinator/AgentHost fixture, but not through WebRTC DataChannel transport |
+| W2-010 | Partial | `packages/voice-runtime/src/live/protocol.test.ts` — “parses only the declared work tool arguments and builds provider-native single receipts”; actual WebSocket adapter lifecycle is not exercised |
+| W2-011 | Partial | `packages/voice-runtime/src/live/protocol.test.ts` covers the 16-call parser limit; repeated multi-call adapter handling and replay are not asserted together |
+| W2-012 | Partial | `packages/voice-runtime/src/live/protocol.test.ts` parses `response.function_call_arguments.done`; duplicate `output_item.done` delivery through the concrete adapter is not tested |
+| W2-013 | Partial | `packages/voice-runtime/src/live/protocol.test.ts` — “keeps GA and compat-v1 session fields and audio events distinct”; concrete adapter setup and authentication paths are not exercised together |
+| W2-014 | Partial | `packages/voice-runtime/src/live/protocol.test.ts` rejects extra `sessionId` and blank instructions; unknown-tool and malformed-wire zero-side-effect behavior through each adapter is not one fixture |
+| W2-015 | Partial | `packages/host-runtime/src/live-work/coordinator.test.ts` — “delivers a received receipt before classifying and submits the original text once”; it checks ordering, not the specified receipt latency budget under a deliberately slow classifier/Agent |
+| W2-016 | Partial | `packages/host-runtime/src/live-work/coordinator.test.ts` — “does not dispatch if the local provider receipt was not sent”; adapter socket send failures are not exercised |
+| W2-017 | Partial | `packages/host-runtime/src/live-work/coordinator.test.ts` preserves the original request text, but does not assert classification preserves the example’s conditional constraint |
+| W2-018 | Gap | No negative test proves a code-related conversational remark creates no work side effect |
+| W2-019 | Direct | `packages/host-runtime/src/live-work/coordinator.test.ts` — “answers a result query from the recorded operation without starting another turn” |
+| W2-020 | Gap | No test covers a negated or undecided request remaining non-executable |
+| W2-021 | Gap | No test proves “stop speaking” changes announcement policy without stopping work |
+| W2-022 | Gap | No test covers ambiguous “stop” while speech and work are both active |
+| W2-023 | Partial | `packages/host-runtime/src/live-work/coordinator.test.ts` — “fails closed on malformed classifier output and validates exact intent fields”; timeout and missing-model cases are not covered by this test |
+| W2-024 | Partial | `packages/host-runtime/src/live-work/coordinator.test.ts` — “asks for clarification when a busy new task has no explicit relationship”; untrusted history injection is not asserted here |
+| W2-025 | Partial | `apps/desktop/test/live-work-provider-integration.test.mjs` submits each parsed profile request through `AgentHost.startTurn` and observes the Runtime prompt; its LiveWorkPort is a fixture, so the production Main work-bridge mapping is not exercised |
+| W2-026 | Gap | No positive end-to-end test proves a valid steer stays on the captured active turn |
+| W2-027 | Direct | `packages/host-runtime/src/live-work/coordinator.test.ts` — “rejects a stale steer without falling back to prompt or queue” |
+| W2-028 | Direct | `packages/agent-runtime/src/turn-target.test.ts` — “rejects missing or replaced active turns when an exact target was supplied” |
+| W2-029 | Gap | No Voice work test covers a Runtime `accepted: false` steer result or finalizing turn |
+| W2-030 | Partial | `apps/desktop/test/live-work-provider-integration.test.mjs` asserts the user message and `voiceOrigin` reach the AgentHost Runtime prompt; `packages/agent-host/src/agent-host.test.ts` covers a queued voice-provenance turn, but persistence through the production registered handler is not asserted in the same flow |
+| W2-031 | Direct | `crates/host-core/src/turn_queue.rs` — `voice_origin_and_user_message_identity_roundtrip_through_queue`; old-row compatibility is covered by `v19_queue_upgrade_preserves_existing_entries` |
+| W2-032 | Partial | The pure-call regression test covers reject-only delegation; no assertion explicitly pairs final transcript/self-commitment input with zero turn creation |
+| W2-033 | Partial | `packages/host-runtime/src/live-work/coordinator.test.ts` — “uses the Host queue for an explicitly independent task while busy”; this verifies routing through the port, not the production durable Host queue mapping |
+| W2-034 | Partial | Same coordinator queue-routing case plus `packages/agent-host/src/agent-host.test.ts` — “queues behind an active turn, drains in order, and aliases runtime ids”; the voice-to-durable-queue mapping is not exercised in one integration test |
+| W2-035 | Partial | `packages/agent-host/src/turn-queue.test.ts` — “keeps arrival order, positions, and the per-session bound”; Voice error recovery at queue capacity is not covered |
+| W2-036 | Partial | `packages/agent-host/src/agent-host.test.ts` — “cancels a queued collaboration message without dispatching it”; Voice operation-reference cancellation is not covered |
+| W2-037 | Gap | No Voice test races queue removal against delivery-pending or already-consumed state |
+| W2-038 | Gap | No test verifies graceful stop reports “requested” before authoritative terminal state |
+| W2-039 | Partial | `packages/agent-runtime/src/turn-target.test.ts` proves exact-target rejection; an immediate-abort race through the active-run owner is not covered end to end |
+| W2-040 | Gap | No test races a slow new-work classifier against a later accepted stop request |
+| W2-041 | Direct | `packages/host-runtime/src/live-work/coordinator.test.ts` — “deduplicates the same provider request and rejects parameter conflicts” |
+| W2-042 | Direct | Same coordinator case asserts changed parameters under one provider ID are rejected |
+| W2-043 | Gap | No test distinguishes a user-confirmed repeat from an accidental duplicate request |
+| W2-044 | Gap | No test resolves concurrent classifiers in reverse order and asserts admission ordering |
+| W2-045 | Direct | `packages/host-runtime/src/live-work/coordinator.test.ts` — “keeps a terminal event that arrives before submit returns” |
+| W2-046 | Partial | `packages/agent-host/src/agent-host.test.ts` — “queues behind an active turn, drains in order, and aliases runtime ids”; Voice operation updates and single feedback are not part of that assertion |
+| W2-047 | Gap | No test covers unknown dispatch admission with bounded reconciliation and no retry |
+| W2-048 | Partial | `packages/host-runtime/src/live-work/operation-ledger.test.ts` — “preserves all accepted identities up to the call limit”; process restart/replay behavior is not tested in the same case |
+| W2-049 | Direct | `packages/host-runtime/src/live-work/context.test.ts` — “never includes transcript or prior voice input while sharing is disabled” |
+| W2-050 | Direct | `packages/host-runtime/src/live-work/context.test.ts` — “shares only bounded plain user and assistant text when explicitly enabled” |
+| W2-051 | Partial | `packages/host-runtime/src/live-work/context.test.ts` bounds context and preserves the instruction; a long-Unicode UTF-8 boundary case is not explicit |
+| W2-052 | Gap | No test puts a critical negation beyond the instruction-size limit and asserts rejection |
+| W2-053 | Partial | `packages/agent-host/src/agent-host.test.ts` — “reconciles only a matching optimistic user item and ignores duplicate, unknown and wrong-turn acknowledgements”; typed-input context projection is not covered |
+| W2-054 | Partial | `packages/agent-host/src/agent-host.test.ts` covers voice provenance and duplicate acknowledgements; a Voice-origin echo producing zero new candidate is not tested |
+| W2-055 | Gap | No test covers session identity or transcript lookup failure during classifier-context construction |
+| W2-056 | Gap | No credential/header/SDP sentinel test verifies filtering across DTO, diagnostics, and Host feedback |
+| W2-057 | Partial | `packages/agent-host/src/agent-host.test.ts` — “provides live work state without reading transcript history”; disagreement with a false Renderer running flag is not simulated |
+| W2-058 | Partial | `packages/agent-host/src/agent-host.test.ts` maps message/tool events and turn terminals separately; no Voice feedback test asserts tool/message/subagent completion alone cannot settle a work operation |
+| W2-059 | Partial | AgentHost tests cover completed, interrupted, and failed turn events separately; a single Live work projection matrix for failed/interrupted/canceled is absent |
+| W2-060 | Direct | `packages/host-runtime/src/live-work/result-summary.test.ts` — “uses an honest status fallback when no final assistant message exists” |
+| W2-061 | Partial | `packages/host-runtime/src/live-work/result-summary.test.ts` — “uses only the latest assistant message from the exact terminal turn”; bounded re-read after terminal persistence lag is not exercised |
+| W2-062 | Direct | `apps/desktop/test/live-voice-service.test.mjs` — “a shared terminal turn produces one feedback item and updates every linked operation” |
+| W2-063 | Direct | `apps/desktop/test/live-voice-service.test.mjs` — “work feedback waits for a quiet window and reports local delivery separately from task execution” |
+| W2-064 | Direct | `packages/host-runtime/src/live-work/feedback-scheduler.test.ts` covers playback/user idle, silent mode, explicit queries, speech gap, and coalescing |
+| W2-065 | Partial | `packages/agent-host/src/approvals.test.ts` exercises the existing approval broker; a voice-origin task waiting on the original approval UI is not integrated |
+| W2-066 | Gap | No Live work test covers immediate task requests in Plan/Goal sessions |
+| W2-067 | Gap | No test proves spoken approval text cannot resolve a Plan/Goal or tool permission request |
+| W2-068 | Partial | `packages/agent-host/src/agent-host.test.ts` — “relays asktool answers with skip semantics”; it does not test Live feedback/UI behavior for a waiting-input event |
+| W2-069 | Gap | No test exercises an authorized MCP/plugin tool from a voice-origin AgentHost turn through the existing permission gateway |
+| W2-070 | Gap | No test explicitly disables the MCP HTTP server while exercising the internal work port |
+| W2-071 | Partial | `packages/voice-runtime/src/live/protocol.test.ts` rejects extra `sessionId` arguments; a generic desktop-action whitelist attack is not covered |
+| W2-072 | Gap | No test independently invalidates Live and coding credentials while an accepted task is running |
+| W2-073 | Partial | `packages/host-runtime/src/live-work/coordinator.test.ts` — “lists session choices and opens only a call-scoped selection reference”; page-size and secret/path exclusion are not all asserted there |
+| W2-074 | Partial | `apps/desktop/test/live-work-operations.test.mjs` covers opaque-reference panel actions; duplicate-label resolution is not explicitly asserted |
+| W2-075 | Direct | `apps/desktop/test/live-work-scope.test.mjs` — “selection references are opaque, call-scoped, short-lived, and removed with the call” |
+| W2-076 | Direct | `packages/host-runtime/src/live-work/coordinator.test.ts` — “lists session choices and opens only a call-scoped selection reference”; active work binding is kept by the work-scope implementation |
+| W2-077 | Partial | `packages/host-runtime/src/live-work/coordinator.test.ts` — “creates only a project choice and keeps the active call's bound session unchanged”; default model/permission preservation is not asserted |
+| W2-078 | Partial | `packages/host-runtime/src/live-work/context.test.ts` verifies opaque references without project paths; arbitrary project-path submission rejection is not tested at the Host boundary |
+| W2-079 | Partial | The coordinator create-selection test keeps the active call binding unchanged; no test covers the complete create-then-explicit-new-call user flow |
+| W2-080 | Gap | No test covers explicit target reconnection, old pending-candidate withdrawal, and old accepted-task retention together |
+| W2-081 | Partial | `packages/host-runtime/src/live-work/coordinator.test.ts` — “does not dispatch a classifier result after the work call closes”; microphone release is tested separately in the service suite |
+| W2-082 | Gap | No test ends Live after accepted work and proves the real AgentHost operation/queue continues |
+| W2-083 | Partial | `packages/voice-runtime/src/live/protocol.test.ts` parses Gemini tool-call cancellation; adapter behavior before versus after work admission is not tested |
+| W2-084 | Gap | No automated test covers lock/hide lifecycle cleanup while accepted work remains active |
+| W2-085 | Gap | No test delivers an old feedback or receipt callback after a new call replaces the old one |
+| W2-086 | Partial | Operation ledger and feedback scheduler tests bound identities/queues; repeated adapter start/end and detached observer cleanup are not covered together |
+| W2-087 | Partial | `packages/voice-runtime/src/live/response-tracker.test.ts` — “cancels active output and drops late audio and completion from an interrupted response”; PCM helpers have separate resampling coverage, but provider interruption paths are not combined in one regression case |
+| W2-088 | Partial | `apps/desktop/test/live-voice-service.test.mjs` covers mute/media state and feedback gating; active AgentHost work is not paired with mute in one assertion |
+| W2-089 | Partial | `apps/desktop/test/live-voice-controller.test.mjs` covers the existing renderer/Main path; React subscriber unmount ownership is not asserted |
+| W2-090 | Partial | `apps/desktop/test/live-work-operations.test.mjs` renders exact terminal summaries; the complete started/queued/waiting/unknown transition sequence is not tested |
+| W2-091 | Gap | No test switches the visible session before invoking stop/view and asserts the displayed A/T target is retained |
+| W2-092 | Partial | Coordinator tests cover malformed classification, stale steer, and expired selection seams; non-fatal media continuity for each business error is not combined |
+| W2-093 | Gap | No test queues Gemini context-only updates until both model generation and PCM playback drain |
+| W2-094 | Partial | `packages/voice-runtime/src/live/protocol.test.ts` verifies work-profile declarations and GA/compat separation; adapter capability refusal and UI availability are not integrated |
+| W2-095 | Partial | Existing controller, shortcuts, microphone lease, and work-voice tests cover several legacy paths; text prompt/steer/queue and Dictation/Host Speech are not one regression matrix |
+| W2-096 | Partial | `apps/desktop/test/live-work-provider-integration.test.mjs` exercises Codex, Gemini, Realtime GA, and Realtime compat parsers/encoders → `LiveWorkCoordinator` → actual `AgentHost.startTurn` → authoritative `agent_end` → provider feedback encoders. Runtime prompt and provider transport are fixtures; concrete socket/WebRTC adapter instances and real accounts/devices remain untested |
+
+## Audit summary
+
+The matrix now has an explicit row for every W2 acceptance ID. **Direct** and
+**Partial** are test mappings only; **Gap** items remain uncovered and should
+not be described as passing. The audit currently maps 18 Direct, 49 Partial,
+and 29 Gap cases. The new W2-096 fixture reaches the shared Host admission and
+terminal boundaries for all four wire profiles, while provider transport,
+voice models, credentials, and physical audio remain outside this deterministic
+integration test.