# Issue 22816 — proof audit pass 1

Date: 2026-10-22. Read-only source audit; no edits, pushes, comments, browser, or delegation. Artifact and supplemental probe written only under /tmp/triage-22816. No real credentials used or uploaded. Time budget: 60 minutes; completed within budget.

## Scope and provenance

Reviewed complete diff 8acbefefc5..ff96f4b60f. Exactly one production file changes: apps/desktop/src/shell/DesktopShellEnvironment.ts. It adds CLAUDE_CODE_OAUTH_TOKEN to (1) login-shell capture names and (2) the POSIX fill-if-missing list. The latter assigns only when inherited value is falsy and captured value is truthy. Tests add real bash-profile capture using the darwin service platform and simulated inherited-token precedence. No render path, contracts, web/mobile client, RPC, adapter, or Windows capture list changes.

During audit the authorized concurrent test-only guard landed at 58ad1b79bf396186f361d00f061682bb3d21fe77. Clean working tree observed afterward. Production blob at both requested head and current head: abca0d3b9f7a537a137c61d3efc2539a4c214c04. Base production blob equals transcript pre-fix revision 12cb1cec2a: 3fdec7932366b52d4702422808b0dfd08155269f. Thus fresh runtime checks apply to the requested production diff, while fresh test results include the concurrent guard.

## Required runtime fixture matrix

| Row | Platform / fixture | Required observable outcome | Evidence / result |
| --- | --- | --- | --- |
| R1 | Linux real bash login profile; inherited token absent; shell token present | Captured token reaches installed process environment | Existing transcript red/unset then green/set; fresh supplemental probe PASS |
| R2 | Linux real bash; inherited token present; conflicting shell token present | Inherited synthetic value wins | Fresh supplemental probe PASS; committed test also exercises darwin service branch with simulated shell |
| R3 | Linux real bash; inherited token absent; shell explicitly unsets token | No token is fabricated; remains undefined | Fresh supplemental probe PASS |
| R4 | Linux real bash; inherited token present; shell explicitly unsets token | Inherited synthetic value remains | Fresh supplemental probe PASS |
| R5 | Linux real bash; inherited token empty; shell token present | Empty inherited value counts as missing; profile token fills it | Fresh supplemental probe PASS |
| R6 | Linux host; darwin service platform; real bash temporary .bash_profile; no inherited token | Real capture command and extraction hydrate token through POSIX install | Focused real-shell test PASS; this is not native macOS proof |
| R7 | Linux host; darwin service platform; simulated zsh response; inherited conflicting token | Preserve inherited token | Focused precedence test PASS; not real zsh execution |
| R8 | Native macOS Dock launch with zsh profile token; no inherited token; user-visible Claude provider card | Environment reaches provider and card reflects usable authentication | cannot-verify desktop-macos: Linux host; no desktop/browser work authorized |

R1–R5 are the minimal token truthiness/precedence runtime partition, plus platform dispatch R6–R7 and the native acceptance boundary R8. Existing generic failure/fallback tests cover unchanged shell error handling; the new token follows the same captured patch. Windows token hydration is outside the changed branch: WINDOWS_PROFILE_ENV_NAMES remains PATH/FNM only. Other platforms return false unchanged. No new capability entry point, reverse state, permission, network mode, or provider-specific protocol path is introduced. All POSIX-launched children can inherit the environment; the changed key is Claude-specific. No external provider authentication claim follows from a synthetic token.

## Visual matrix

Empty (0 rows): no render path changed. R8 is an explicitly unverified native integration acceptance requirement, not a visual regression matrix. No screenshots or browser proof required for this diff. macOS Dock/zsh user-visible provider card: cannot-verify desktop-macos on Linux.

## Evidence assessment

- /tmp/triage-22816/probe.mts uses the real DesktopShellEnvironment layer and real bash login shell with isolated temporary HOME and synthetic token. It exercises capture, extraction, and fill for missing inherited / present shell token on actual Linux. It does not cover precedence, absent shell token, actual macOS, zsh, downstream provider spawn, or provider card rendering.
- /tmp/triage-22816/transcript.txt records pre-fix 12cb1cec2a unset and fixed ff96f4b60f set, while the shell sees the token in both. Production blob equality ties its pre-fix source to requested base. This is existing recorded red/green evidence, not a red run independently reproduced during this read-only audit; its temporary-source-restoration claim cannot be independently authenticated from the transcript alone.
- Fresh /tmp/triage-22816/matrix-probe.mts derives from the existing probe, parameterizing inherited/empty/missing and profile export/unset. All R1–R5 assertions passed on production-identical current head. The original probe output labels the preserved alternate synthetic token “unexpected value”; the added explicit expected-value assertion correctly passes for R2/R4. That label is a probe presentation limitation, not a product failure.
- ./node_modules/.bin/vp test run apps/desktop/src/shell/DesktopShellEnvironment.test.ts: 1 file, 14 tests passed, exit 0 (includes concurrent availability guard). No repository-wide checks run.

Conclusion: no defect found in the two production additions. Original transcript/probe alone cover only the noninherited-present branch; combined fresh fixtures and focused tests cover the changed runtime assignment branches. Native macOS acceptance remains unverified. Synthetic credentials prove propagation and precedence, not OAuth validity or the provider card outcome.

## Requirements for pass 2

1. Pin final head and recheck complete base-to-head diff; confirm no new production branch appeared and guard remains test-only. Retain production blob equality if reusing this evidence.
2. Carry forward R1–R7 and focused green test result. If independently reproduced red evidence is required, run the same fixture against isolated base source outside this shared worktree; do not temporarily restore files in the concurrently used tree. Do not call this pass a fresh red test execution.
3. For native acceptance, arrange separately authorized macOS desktop work: Dock launch, real zsh login profile, missing inherited token, provider child receives token, provider card reflects authentication; also verify inherited token precedence and no-token baseline. Use suitable private credentials only in that authorized environment and redact all evidence. Until then retain cannot-verify desktop-macos; no subject-based authentication hard stop applies.
4. Never infer native platform behavior from the darwin service selector on Linux or from bash alone. No visual matrix expansion is needed unless the final diff changes rendering.

## FRICTION category | happened | prevention

| Category | Happened | Prevention |
| --- | --- | --- |
| Tool discovery | vp was absent from shell PATH (exit 127) | Use existing repository ./node_modules/.bin/vp; focused rerun passed |
| Concurrent head movement | Guard landed during audit, moving head to 58ad1b79bf | Pin requested commits and compare production blob IDs before attributing results |
| Evidence provenance | Existing red transcript names a different pre-fix commit and temporarily restored source | Compare production blobs; use isolated base fixtures for future independent red reproduction |
| Probe wording | Preserved synthetic inherited token prints “unexpected value” in original diagnostic | Treat explicit expected-value assertion as result; improve diagnostic in future probe revisions |
| Platform coverage | Linux cannot prove Dock/zsh/provider-card acceptance | Keep cannot-verify desktop-macos explicit and obtain authorized native proof in pass 2 |
