# Proof audit pass 1 — fixture matrix

Scope: [#22761](https://git.cafe/pingdotgg/t3code/pull/22761), mirrored [#22761](https://github.com/pingdotgg/t3code/pull/22761). Read-only review in `/home/ubuntu/wt/issue-8388`.
Pinned before: [7ffc3bb7e8](https://github.com/pingdotgg/t3code/commit/7ffc3bb7e80d88327a06d667e4be1bdef85329d3). Pinned after: [e85525de29](https://github.com/pingdotgg/t3code/commit/e85525de299e3a480e4f0be5769da84c737d7a24). Clean checkout, matching requested head. Live PR metadata agrees on head and branch `fix/issue-8388` → `main`; live main has moved, so this matrix uses the requested pinned base.

## Scope and render-path inventory

The complete pinned diff changes only `packages/provider-opencode/src/server/adapter.ts` and `adapter.test.ts`: no renderer, client contract, CSS, or layout changed. Changed components have zero render paths. The server adapter is shared by local/remote clients and is not an Electron-specific implementation. No provider other than OpenCode 1.x is changed; OpenCode 2.x has a separate adapter.

Adapter path: owned `message.part.updated` step-finish → `accumulateOpenCodeStepUsage` → lastStep; unresolved ownership queues steps until `message.updated` establishes ownership. Other-prompt steps are excluded; duplicate IDs are excluded by existing bookkeeping. SDK `provider.list` runs in background with a five-second timeout; ceiling lookup uses selected `provider/model` string, trimming whitespace and preserving model IDs containing slashes. `emitProviderTurn` is called during admission/running and from `finalizeTurn` for all terminal statuses. It adds context tokenUsage only at terminal time when a step exists. Existing cumulative turnTokenUsage remains separate. Unknown/pending/failed catalog means nullable ceiling and must not block completion; no later catalog-driven update is implemented. No owned steps means no new context snapshot. Failed/interrupted terminal turns with an owned step also take this emission branch.

Indirect unchanged web consumer path: ChatView → latestProviderTurnTokenUsage (newest timestamp across turns, with fork-transfer fallback) → deriveLatestContextWindowSnapshot (live usage, then provider-thread contextUsage, then compaction item fallback) → ChatComposer → ComposerFooterPrimaryActions in ComposerFooterControls → ContextWindowMeter or placeholder or nothing. Desktop wraps this same web UI. Search found no equivalent ContextWindowMeter/contextWindow consumer in native mobile; mobile still receives the shared provider-turn data. No separate Settings/command-palette/keybinding renderer exists: Settings toggles the legacy meter; compaction is an existing action, outside this adapter change.

Props/conditionals: ChatComposer gates activeContextWindow on `contextWindowMeterEnabled`; placeholder requires enabled + detail loading + started thread + provider capability not explicitly false. Meter receives usage, modelDisplayName, onCompact, compactDisabled, compactDisabledReason. Compact/resting footer changes primary-action layout, not the meter implementation. Usage percentage determines normal versus >90% error color; known maximum shows percentage, denominator, progressbar; unknown maximum shows used count only. Positive totalProcessed and non-null cost add rows, but new adapter snapshots derive both as null. Automatic compaction copy uses model name/threshold; these snapshots have automatic compaction true and threshold null. Compact action is optional and, when disabled, may show a reason (permission, missing project/provider support, or unavailable current thread state). Interactions: hover/focus/click meter popover, dismiss it; existing Compact context callback. No new interaction is introduced.

## Collapsed fixture matrix

“Required” below means proof for this server-only change. Visual rows are optional corroboration for the later capture package, not an unrelated frontend acceptance suite. No screenshots were taken by this reviewer.

| Row / named fixture | Affected / minimum proof | Seed and observable expectation | Minimum capture viewport/theme |
|---|---|---|---|
| S1 Real OpenCode known ceiling | Yes; required before/after running-dev-server transcript with SHAs | Real OpenCode 1.18.18, model openrouter/z-ai/glm-5.3-flash, deterministic local OpenRouter-shaped SSE endpoint; prompt12000/cache1000/output32. Before context absent; after input12000/cache1000/output32/used12032/max128000; cumulative usage unchanged. This is local integration with a stub upstream, not a real OpenRouter account. | N/A: JSON transcript |
| S2 Last step, catalog ready | Yes; required scoped test | Committed adapter harness sends owned steps input9000/cache500/output40 then input11000/cache1000/output32; terminal context is last step, used12032/max202752, not sum. | N/A: test |
| S3 Last step, catalog pending | Yes; required scoped test | Same committed harness holds catalog promise unresolved through terminal event; completion occurs and context max=null, used12032. No waiting for catalog. | N/A: test |
| S4 Ownership / unavailable / terminal behavior | Affected supporting paths; scoped suite regression coverage | Existing harness covers unresolved ownership, duplicate and other-prompt steps, completed/failed/no-step paths for cumulative usage. New context assertions cover S2/S3; do not claim dedicated assertions for failed/interrupted context snapshots or catalog rejection/timeout. | N/A: test; no additional visual row |
| V1 Before no meter / Codex positive control | Indirect existing renderer; optional visual corroboration | Enable General → Legacy features → Context window indicator. Same thread's completed OpenCode turns have no tokenUsage before; switch same thread to Codex and complete turn to establish meter positive control. Preserve labels so the control is not mistaken for the fix. | If captured: one 1280×800 web viewport, same theme (dark is sufficient) before/after/control |
| V2 Known-ceiling meter, closed/open | Indirect output visibly changes; optional, useful later capture pair | Reuse S1 real app thread and enabled legacy setting. After: normal ring, popover 9.4% and 12k/128k, no cost/total processed rows from this snapshot. Open via meter interaction and capture denominator. No fabricated usage injected into app state. | Same 1280×800/theme as V1; one closed and one open state if requested |
| V3 Unknown-ceiling count-only | Indirect, visually distinct; optional labelled harness only | S3 yields max=null; unchanged UI renders count-only popover, no percentage/progressbar. A UI harness must explicitly label synthetic projection; pending SDK fixture is not a real-account runtime. | If requested: same viewport/theme; no required screenshot |
| V4 Hidden / loading placeholder | Existing branches, not renderer changes; no capture required | Disabled setting hides meter; enabled/loading/started/capable reserves size-7 placeholder; no-step and no fallback means no meter. Keep note that historical Codex usage or compaction fallback can show an existing meter even before OpenCode fix. | N/A |
| V5 Overloaded / compaction action variants | Unchanged meter branches; no capture required | >90% color, zero percentage, enabled/disabled/absent compaction control and reason, model name copy. These are not changed by a renderer diff; no requirement to manufacture high usage or invoke compaction. | N/A |
| V6 Other surfaces/layout/theme | No separate renderer changed; no extra capture required | Desktop shares web. Native mobile has no corresponding meter consumer found. Narrow/resting composer, light theme, relay/tunnel do not introduce adapter-specific rendering paths. No Android/Windows/real OpenRouter network verification claimed. | N/A; do not impose full client × viewport × theme matrix |
| R1 Reproducible runtime fixture | Required for later formal capture package; MISSING | Commit a credential-free deterministic SSE stub, OpenCode config template, isolated-state/project/provider seed instructions or script, exact runtime/version/ports, and extraction command producing S1 transcripts with full SHAs. Existing committed unit fixture is reproducible, but does not reproduce running-dev-server S1. `/tmp/issue-8388/stub.py`, project config, wrapper and prose notes are temporary and not a committed integration fixture. Lead owns implementation/capture; reviewer makes no edits. | N/A |

## Evidence inspected

- [Before running-dev-server transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/7186c171d257c2b4/before-runtime.json): base SHA recorded as short 7ffc3bb7e8; two completed OpenCode turns have tokenUsage null and cumulative input12000/cache1000/output32. Same-thread Codex control carries context snapshot.
- [After running-dev-server transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/f8b7e85239b0cc76/after-runtime.json): full requested head SHA; completed OpenCode turn used12032/max128000 with matching usage. These are supplied prior captures corroborated by local copies/notes, not new runtime execution by this reviewer. Transcript JSON does not itself include server startup command, port, raw request/event log, or full reproducible extraction procedure; add these to R1 rather than calling this an independently repeated runtime test.
- Independently ran `./node_modules/.bin/vp test run packages/provider-opencode/src/server/adapter.test.ts` at the pinned head: 1 file, 32 tests passed (8.80s). No repo-wide checks, servers, or browsers launched.

## Friction and handoff

FRICTION: Runtime proof depends on temporary files under `/tmp`; commit R1 before formal capture so another maintainer can reproduce it without this machine's private state.
FRICTION: Meter is legacy and defaults off; capture must explicitly enable it. Older same-thread Codex snapshots can make a naive OpenCode-before screenshot misleading; use fresh labelled OpenCode seed or identify the control clearly.
FRICTION: Test catalog ceiling202752 differs from deterministic runtime config128000; both are intentional source data, not conflicting output. Capture must identify its model config.
FRICTION: PR registration rejected GitCafe URL as unrecognised; registration succeeded using the mirrored GitHub PR URL. Forge reads used cafe only.
FRICTION: No new server/browser runtime was run, as requested; provided transcripts establish prior runtime behavior, not fresh reviewer execution. No full UI matrix is justified by this server-only diff.

Pass 1 matrix is complete; formal proof sufficiency remains blocked only on the requested committed runtime reproducer. This is an evidence verdict, not a merge-readiness code-review verdict.

VERDICT: INSUFFICIENT R1
