# Final proof audit

No blocking scoped proof gap found. The visual matrix remains empty, and the focused foreground-tool regression is sufficient for the final follow-up. This is a proof audit, not a fresh full implementation endorsement.

Reviewed [#23218](https://github.com/pingdotgg/t3code/pull/23218), mirrored as [#23217](https://git.cafe/pingdotgg/t3code/pulls/23217), for [#21219](https://github.com/pingdotgg/t3code/issues/21219). Exact head [3ae498cbdd](https://github.com/pingdotgg/t3code/commit/3ae498cbdd04ab047889afa792dcba0748f810e6), base [ed9b7ca9c5](https://github.com/pingdotgg/t3code/commit/ed9b7ca9c53843ea1e6b466bf7d52928d10e7db0). Read worktree AGENTS and the full pr-audit skill. Read all four changed files and relevant client dispatch, replay helper, finalizer, eligibility filter, failure mappers, and control tests. Checkout HEAD matched the requested head and git status was clean. Used explicit SHA diffs; made no repository edits, checkout changes, forge comments, uploads, test runs, server/browser starts, or PR polling.

## Findings and final-head reconciliation

The original runtime evidence still proves the intended accepted-prompt idle-error problem at its recorded revisions, not a newly executed final-head runtime. Comparing runtime implementation [597823c8ad](https://github.com/pingdotgg/t3code/commit/597823c8ad18a4870c39d834e907b5ef56476e4e) to final head shows that the three production files differ only in foreground-tool settlement: completed/failed now share the same eligibility helper and pass their respective status to emitTool. Error propagation and classification tested at runtime are unchanged. Comparing prior reviewed [9054687df3](https://github.com/pingdotgg/t3code/commit/9054687df3666294018f30298c32cfe77aaa6fb3) to final head shows only that cleanup and its 37-line regression.

Concrete covered sequence: accepted v2 prompt -> running Read tool -> idle stopReason:error -> latest matching tool update is failed before turn.terminal. Test location: apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.test.ts:1782. It uses the real replay subprocess/protocol pipeline with agentId acplause and continuations disabled, consumes the event queue to terminal, and checks the latest tool event. Reverting the follow-up makes this exact assertion observe running rather than failed by inspection. The supplied brief reports that red execution; I did not independently execute it or locate its raw output. This test measures the observable defect, rather than callback wiring or implementation shape.

Cleanup locations: packages/provider-acp/src/server/adapter.ts:6925 and :6976. The unchanged helper at :1248 admits only pending/running tools and rejects background-task and subagent tools. Existing GrokAdapterV2.test.ts:162 exercises that classification; existing registry error/end_turn child-handoff tests exercise child survival across root settlement. The new test plus unchanged predicate/control coverage is sufficient; no new background failure fixture or runtime capture is necessary for this small follow-up. The wider shared finalizer also closes foreground tools after rejected prompts; the same tested cleanup branch handles those failures. This is code-path coverage, not a claim of a new rejected-prompt execution.

Original error path remains covered at registry test :1738: error-bearing and omitted-error idle each fail, preserve a useful message, then permit a distinct successful following prompt. Terminal uniqueness is established through that following completion boundary, not arbitrary future input. finalizeTurn at adapter.ts:6951 guards and sets finalized before yielding. The success/cancel/interrupted branches are unchanged; finalizer still gives interruption precedence. Existing cancellation drain, Stop, rollback/quarantined callback, and child controls remain relevant; no new reconnect or serialized client contract was introduced.

The error.data dismissal is independently supported: effect-acp/src/errors.ts:280 already copies protocol data into AcpRequestError; the extracted following-work conversion previously did the same. Registry promptFailure (provider-acp-registry/src/server/adapter.ts:116) and Grok promptFailure (provider-grok/src/server/adapter.ts:302) produce makeProviderFailure results, not serialized causes/data. provider-core/src/server/failure.ts:211 bounds message to 4096 and code to 128 and returns curated failure fields. No new arbitrary data publication is established. This does not promise that provider message strings can never contain sensitive information; the existing bounded/sanitized message policy is unchanged.

No changed auth, credential storage, permission, approval, modes, sandbox, trust, or MCP decision path. An authentication error is the test input, not an authentication behavior change. No new regex/parser machinery or dependencies. The small adapter-boundary fix is worth having and needs no new documentation.

## Evidence provenance and claim audit

Read all three supplied URLs and the red/green/matrix/summary artifacts they referenced. The web reader failed; direct Python retrieval got HTTP 403; curl with a browser user-agent returned the files successfully.

- [Before runtime](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/4115034ebe84ea8f/before-runtime.txt): narrative transcript at older main, real acplause v0.202610.0, deliberately invalid key, accepted prompt then idle/error, persisted completed; reports fresh-thread and Codex handoff. Not a raw full wire/event trace.
- [After runtime](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/12a15043042aa3f3/fixed-runtime.txt): explicitly names runtime implementation 597823c8ad. Records both routes failed, useful Missing Authentication header, one failure item, and running->failed durable transitions. The fresh route is resumed, not a newly allocated post-fix session. Browser outcomes are supplied by the primary; persistence observations are attributed to the prior verifier. Retained provider wire logs contain baseline traffic only. I did not inspect the database or independently reproduce these observations.
- [Prior proof audit](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/13f7bda6c2738045/proof-audit-pass2.md): accurately discloses those boundaries and bounded uniqueness. Its production-identical statement applies to its test-only head versus its runtime commit, not to this final head; the final head adds cleanup, now covered separately.
- [Original red](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/cbf98dce2e9d2ef0/red-test.txt): delegated report of completed-versus-failed, not raw runner output. Supports the two original regressions; does not prove the new foreground red run.
- Prior raw green artifacts show registry 16, adapter 59, combined client+registry 42, and aggregate 101. These are historical totals, not final-head totals. Repeated registry tests must not be added as distinct tests. The client test at effect-acp/src/client.test.ts:246 verifies structured idle notification preservation; end-to-end registry regression establishes prompt-response propagation.
- Local /tmp/issue21219-final-registry-tests.txt records 17/17 passed, one file, start 07:04:22, after final commit timestamp 07:03:05. It has no embedded SHA or full command, so association with final head is supplied context plus timing, not independently bound by the log. I read the file; I did not run it.
- Final 92/92 adapter tests, foreground red running-versus-failed, clean lint/format, and provider-acp/server typecheck exit 0 are supplied parent claims. No raw final artifacts for those claims were provided or located in this audit. Historical server typecheck hanging is superseded only by that supplied claim. Do not describe these as independently rerun or audited raw outputs. git diff --check against requested base passed here.
- No successful real-provider request is claimed with the invalid key; success, cancel, Stop and following-work behavior use fixtures. No independent endorsement of prior reviewers or current CI is claimed. Cached PR metadata names an older head and is not current-head evidence; no PR refresh/poll performed under the narrower proof brief.

These provenance limitations do not invalidate the targeted test-plus-runtime proof. The exact source diff explains what the historical runtime still covers and the focused added regression covers the only production delta.

## Minimal revised matrix

Visual matrix: EMPTY. No renderer, styles, layout, interaction, or client-wire contract changed. Existing clients display standard failure/tool states. No screenshots, video, browser, server, desktop/mobile session, or fabricated visual fixture is required.

Runtime/protocol proof rows:

| Row | Required evidence | Result |
| --- | --- | --- |
| Accepted idle/error, real provider and handoff | Historical before/after plus production diff reconciliation | Sufficient with historical-runtime provenance above |
| Missing details, next success, bounded single terminal | Existing two replay regressions | Present unchanged at final head; historical raw green and final registry log |
| Running foreground tool on failure | New deterministic failing/green replay | Meaningful exact regression present; red supplied as report, final registry 17/17 local log |
| Background child preservation, cancellation/Stop | Unchanged eligibility filter and relevant existing controls | Sufficient; no new mechanism or render proof needed |

## Scope gaps

No blocking proof gap within the requested scope. Raw final-head red, aggregate 92-test, lint and typecheck logs would improve independent provenance, but repeating tests or rebuilding runtime evidence is unnecessary for this audit. No claim of current CI, final-head integrated runtime, arbitrary-future exactly-once behavior, or real-provider success/cancellation should be made from these materials.

FRICTION: evidence retrieval | web reader failed and default Python requests returned 403 | curl with browser user-agent retrieved the supplied text without browser automation.
FRICTION: revision provenance | runtime and most raw green artifacts predate final cleanup | compared exact production SHAs and isolated new behavior to the focused regression.
FRICTION: check provenance | final aggregate/typecheck/red claims lack supplied raw SHA-bound logs | distinguished parent reports, local runner output, historical artifacts and direct source inspection; no redundant execution.

VERDICT: SUFFICIENT
