# macOS cold-launch regression proof

Target: [#18422](https://github.com/pingdotgg/t3code/pull/18422). Candidate: `22e2fd935897556e8700bc24186a6dbc1ff1805d`, including the author's latest integration commit. Captured on headless Linux, 2026-10-19.

This is a startup/service behavior change. No visual layout changed. Electron OS events and windows are fixtures; the actual DesktopClerk and DesktopWebLinks services run. Hosted-auth tests bind a real local HTTP callback receiver. These results do not establish packaged macOS or native Electron behavior.

## Before

With the main DesktopClerk implementation substituted temporarily, the focused cold-event regression fails immediately at renderer readiness:

```text
Expected:
  https://example.com/cold
  file:///tmp/report%20%231.html
  t3code://new?prompt=Fix+it
  t3code-dev://threads/env-1/thread-1
Received: []
Tests: 1 failed, 21 skipped
```

The substituted implementation was restored. The test uses a Deferred shell-probe barrier, without timing sleeps.

## After

The candidate delivers that mixed cold sequence once, in order, after renderer readiness; warm delivery, unrelated events, and secondary-instance handling also pass. Additional focused regressions prove scoped waiting before first-window creation, hosted-auth cancellation and callback-port release, serialized auth navigation, and suppression of stale window reveal.

```text
Test Files  8 passed (8)
Tests       156 passed (156)
```

The primary agent reran those eight suites after integrating the author's new main merge. Scoped desktop typecheck and lint pass. One pre-existing Effect style suggestion remains in DesktopWebLinks.test.ts; no type errors.

Expanded case counts in the two edited module suites: 50 before cleanup after current-main integration, 43 after the separate test phase, 45 after adding two distinct auth-lifecycle regressions. PR additions against that main are reduced from 12 to 7. No one-off test files.

Command from the batch worktree:

```sh
export PATH="$HOME/.local/bin:$PATH"
ELECTRON_OVERRIDE_DIST_PATH=/tmp ./node_modules/.bin/vp test run \
  apps/desktop/src/app/DesktopClerk.test.ts \
  apps/desktop/src/app/DesktopWebLinks.test.ts \
  apps/desktop/src/app/DesktopLifecycle.test.ts \
  apps/desktop/src/electron/ElectronWindow.test.ts \
  apps/desktop/src/ssh/DesktopSshPasswordPrompts.test.ts \
  apps/desktop/src/window/DesktopWindow.test.ts \
  apps/desktop/src/updates/DesktopUpdates.test.ts \
  apps/desktop/src/updates/DesktopRemoteUpdates.test.ts
```

ELECTRON_OVERRIDE_DIST_PATH bypasses missing Electron binary lookup; it does not run Electron. Screenshots or a recording from a Linux web preview would not prove macOS launch-event delivery, so no native visual evidence is claimed.

## Remaining verification

A human must verify a packaged macOS app launched cold from Finder using a URL and HTML file, native focus/navigation, and actual provider/Clerk sign-in. Windows, native Linux Electron, iOS, and Android were not run. Desktop-only code changes do not certify those surfaces. Human approval remains required for authentication-related startup handling. Nothing was merged.

Tests: GPT-6-Astra (high). Implementation: GPT-6.1-Sol (high). Harness: Codex through T3 Code.
