# Proof audit, pass 1 — current desktop navigation fixture matrix

PR [#28817](https://git.cafe/pingdotgg/t3code/pull/28817), issue [#28788](https://git.cafe/pingdotgg/t3code/issues/28788). Branch `fix/issue-28788`, target `main`.

**After:** [658384cf58](https://git.cafe/pingdotgg/t3code/commit/658384cf5895ad199226491097b351af28ffdd28). **Before:** actual merge-base [f6503f0e71](https://git.cafe/pingdotgg/t3code/commit/f6503f0e717f5d577a897149b4ceeb3d1bf00b3a). The checkout HEAD and live GitCafe PR head matched at inspection. The complete PR diff contains only `apps/desktop/src/preview/Manager.ts` and `Manager.test.ts`.

Read-only source audit: no edits to the worktree, no forge comments, no builds/tests/captures, no app/browser/server launch. Prior evidence and driver source were downloaded and read; old media was not re-audited. This document defines what to capture, not a claim of runtime verification or merge readiness. Work finished within the 45-minute budget.

## Findings first

1. **Every current row is pending.** The linked PR body and earlier evidence cover old base [3fd2b855c5](https://git.cafe/pingdotgg/t3code/commit/3fd2b855c5c6b9169cdfe3733b34011c1c5ed4b7) and old head [8a80aaf602](https://git.cafe/pingdotgg/t3code/commit/8a80aaf6028e96ff8f7c2227e93d1623d6d06e91). They establish useful reproduction history, but are not proof for this head/base pair. Recapture all required rows, including controls. A recording must start before input/card click and retain the full app through settlement and the toast observation window; settled stills or a single zero-toast sample cannot exclude a transient error.
2. **The changed branch accepts every non-null object whose numeric `errno` is -3.** It does not inspect `code`, URL, a redirect event, or final document success. A missing/destroyed guest and same-current-URL reload return before it. Prove a live registered native guest, a different entered URL, and the actual native promise rejection for each affected run. Do not classify a fixture solely from its HTTP status/name.
3. **History is a second visible effect, with two distinct stores.** On the native success path the entered source URL goes through `rememberPreviewUrl` and then `recordVisitForThread`. The new recent card comes from the **project-scoped persisted history bucket**. The in-memory thread `recentlySeenUrls` also receives URLs from guest/server snapshots on both revisions; do not assert that the source exists there only on head. The initially supplied old matrix made that over-strong assertion; the later old evidence already corrects it. Read both stores, keeping source and target identity explicit.
4. **Add R10: aborted source followed by a genuine final-target failure.** R1/R6 cover successful final targets and R4 covers a direct error, but neither alone shows the combined state. Pending A superseded by unreachable B traverses both relevant error classes: suppress A's false -3 notification while retaining B's real notification and LoadFailed surface. This is an existing combination omitted from the old matrix, not a new path introduced by main.
5. **Prior drivers fit the current UI/RPC, after preparation and a small extension.** The four scripts cannot safely be run verbatim because they hardcode the previous round's scratch directory, synthetic project and base checkout. Their interaction and fixture logic remains compatible by source inspection. Use the separately linked `inspect-stores.js`; it is available in the old evidence index. Add R10, registration/result assertions, and revision/build provenance as described below. No driver was executed in this pass.

## Changed code and every reachable caller

The PR changes no React component, prop interface, CSS, navigation contract or provider adapter. [Manager's predicate](https://git.cafe/pingdotgg/t3code/blob/658384cf5895ad199226491097b351af28ffdd28/apps/desktop/src/preview/Manager.ts#L422) and [navigate](https://git.cafe/pingdotgg/t3code/blob/658384cf5895ad199226491097b351af28ffdd28/apps/desktop/src/preview/Manager.ts#L1916) are the production change. The new tests inject a -3 rejection and a -102 rejection and assert operation success/failure; they do not prove guest settlement, UI notifications or history.

Production native call chain:

- [RightPanelSurfaceContent](https://git.cafe/pingdotgg/t3code/blob/658384cf5895ad199226491097b351af28ffdd28/apps/web/src/components/chat/RightPanelSurfaceContent.tsx#L86) mounts `PreviewPanel` in embedded mode with thread/environment, explicit surface tab id, configured URLs, visibility and annotation callback. `PreviewPanel` checks preview availability and operate permission, then mounts the only production `PreviewView`. Other shell modes (`inline`, `sheet`, `sidebar`) are supported by the shell type but are not additional production mounts of this address/card view.
- [PreviewView.navigateToResolvedUrl](https://git.cafe/pingdotgg/t3code/blob/658384cf5895ad199226491097b351af28ffdd28/apps/web/src/components/preview/PreviewView.tsx#L231) has exactly two UI callers: `handleSubmitUrl` from the address form/Enter, and `handleOpenServerUrl` from recent/configured/discovered server cards. Native branch: `previewBridge.navigate` → [preload](https://git.cafe/pingdotgg/t3code/blob/658384cf5895ad199226491097b351af28ffdd28/apps/desktop/src/preload.ts#L336) → [desktop IPC handler](https://git.cafe/pingdotgg/t3code/blob/658384cf5895ad199226491097b351af28ffdd28/apps/desktop/src/ipc/methods/preview.ts#L106) → `manager.navigate`. No other production invocation of this Manager method was found.
- Address handler resolves URL/search input; card handler resolves local environment URLs. Both await native navigation, then write visit history, or catch and add “Could not open this address”. Address history uses the resolved input; card history preserves the selected original URL. Settings/command palette/keybindings can select defaults, open Browser, focus the address field or refresh; they do not implement another await/catch. R1 covers the common focused input; R9 covers the second catch/card route.
- A non-native server tab with a mounted stream uses `ServerBrowserSurface.navigate`, or returns false when control is disabled. Without a usable native tab/bridge the fallback opens a session. These do not use the changed native promise. A primary-environment `runtime: server`, `headless: false` tab in Electron **does render natively**, through [rendersServerTabNatively](https://git.cafe/pingdotgg/t3code/blob/658384cf5895ad199226491097b351af28ffdd28/apps/web/src/browser/previewRuntime.ts#L52). Do not exclude it by runtime label alone.
- Hosted guests are created independently of the visible content slot by `ElectronBrowserHost`/`HostedBrowserWebview`; an attached Idle `about:blank` guest can therefore reach native navigate without a warmup visit (R5b/R9). Guest registration is asynchronous: an empty-state screenshot does not establish registration.
- Terminal/markdown links, discovered-port actions outside this empty state, agent/MCP open and initial URL attachment use open/session/guest loading paths. Back/forward, refresh/re-entering current URL, popup and pending-URL registration use separate operations. In-page navigation does not invoke this awaited `navigate` call. The floating mini-player shares the hosted guest but does not add an address/card caller. No provider-specific path is changed.

## Branches, data shapes and layout collapse

Manager normalizes input, publishes Loading, then: no attached webContents → pending return; missing/destroyed contents → detach/recovery return; exact current URL → reload return; different URL/live contents → await `loadURL`. Promise resolution succeeds on both. Numeric -3 object rejection fails before and succeeds after. All other error values/shapes still fail (including null/primitive, code-only `ERR_ABORTED`, string `"-3"`, or another numeric errno). Interrupts are not converted into successful results by this catch.

[did-fail-load](https://git.cafe/pingdotgg/t3code/blob/658384cf5895ad199226491097b351af28ffdd28/apps/desktop/src/preview/Manager.ts#L1365) ignores numeric -3 and all non-main-frame failures on both revisions; the literal-to-constant replacement preserves its behavior. Other main-frame failures set LoadFailed. Navigation, stop-loading and title events determine the actual URL/loading state; the catch itself sets neither Success nor a final target. Stop-loading preserves a prior LoadFailed status.

The render branches downstream are:

- No snapshot/Idle → `PreviewEmptyState`. No parseable recents and no local servers → “No preview yet”; recents → “Recently used”; servers → “Local servers”; both sections when both are present. R5b covers zero-to-one section appearance, R5a one-to-two insertion, R9 updating an existing entry without duplication. Parseable entries are filtered and only the first 8 shown; history stores at most 50 per project. New visits can reorder/evict entries, but there is no new threshold-specific code from this catch. Larger counts collapse to the same insertion behavior.
- Loading/success → native content slot, URL and loading progress, navigation controls. Streaming pending/control states are separate and unaffected. Final URL can differ from entered source. R1–R3/R6 cover this state transition.
- Main-frame LoadFailed → `PreviewUnreachable`, hides native content and disables pick/capture/floating actions. LoadFailed with server `download` metadata → `PreviewFileNotShown`; native failed handler does not add such metadata. R4/R10 cover ordinary error rendering. Downloads/204 must preserve observed document/address/loading behavior rather than assume a new document.
- Recent cards use title or host/path/query/hash; text truncates; valid timestamps render relative time; favicon/fallback and removal button are existing variants. Server card live/source/status variants use the same open callback. Theme, viewport width, profile badge, device viewport/zoom, visibility, recording, cursor/pick state, menus/tooltips, focus/hover and annotation availability change existing chrome but not the errno decision. No new style or breakpoint is introduced. Capture a normal embedded panel at one width/theme; do not multiply every cosmetic variant for this main-process condition.
- Empty address input does nothing; Escape blurs/reset; valid URL or search input normalizes; invalid/unsupported URL errors before native load. These are existing entry behavior, not newly affected layout states. The “Stop” loading label invokes the existing refresh handler; there is no separate stopLoading bridge operation to seed a new manual-stop row. Do not claim a Stop-button cancellation test from its label.

## What main changed since the older evidence

I compared old main to current merge-base in both preview directories and the rendering/IPC/store dependencies. Fourteen files changed under `apps/desktop/src/preview` and `apps/web/src/components/preview`:

| Main change | Effect on this matrix |
|---|---|
| `Manager.ts` Crypto → SecureRandom for screenshot IDs | No navigation/error/render path added or removed. |
| `BrowserSession.ts` Digest migration; allow pointerLock permission | No navigation fixture requests pointer lock; no added row. |
| Browser cookie-import managed-policy gate | Cookie-import settings path, not navigate; use a fresh synthetic profile without importing cookies. No added row. |
| `CdpRelay.ts` scoped Page download behavior; opt-in download events; `DesktopBrowserHost.ts` reads Page.downloadWillBegin | Download behavior may differ from the old run. **Retain and recapture real R7**, including download events, disposition/path/dialog/retained document. Do not reuse the old “no completed download” claim. No new native navigation or error-view branch. |
| `GuestInput.ts` preserves focus across overlapping CDP presses | Existing input behavior changed; normal sequential Playwright renderer clicks/Enter still fit. No added navigation row. |
| `agentOpenedPreviews.ts` reveal without user-focus revision | Agent reveal path, not address/card handling. No added row. |
| `previewMiniPlayerLayout.ts` preserves constrained size and resize minimum | Existing floating path sizing changed, but no new caller of navigate. Minimum fixtures remain embedded; no added row. |

`PreviewView`, `PreviewEmptyState`, `PreviewChromeRow`, recent/local-server cards, native/server runtime selection, hosted-webview implementation, project history store, thread preview state and navigate IPC handler did not change across those main revisions. Preload added unrelated `readMedia`; `preview.navigate` did not change. Main adds/removes **no relevant render path or required row** for this diff. R10 is an audit completeness correction to an existing combination.

## Minimum capture contract

**Each required row: Linux Electron desktop × full app window 1100×780 × dark × DPR 1 × default zoom/font scale × native embedded Browser × before and after.** Record actual renderer/guest bounds (do not assume the old guest width), Electron/Chromium versions, OS, commit, build input/output provenance, theme and source/target/runtime/guest id. No device emulation. UI Date may be fixed while timers and native/fixture clocks stay live. Use the same fixture response behavior and preparation on both revisions, fresh isolated T3 home, Electron config and synthetic project per scenario; never live userdata.

Start full-window **recording** before Enter/card click and keep it continuous through all native results, final page/error, and several seconds of toast observation (at least 3.8 s after settlement on each side; the prior driver records 11–15 s). Log toast additions/removals throughout; record entire address/chrome/guest/toast area. Keep source/error identity in diagnostics because toast text can be generic and stacked. Show exact project history URLs, order and count after relevant rows. Stills supplement recordings; R5a can be the history phase of R1. Minimum is **11 row identities, 20 recordings** across both revisions (R5a shares R1), plus extracted stills/diagnostics. R10 may need a longer shared observation window. Other OS/theme/width/streamed/mobile/relay cases are not claimed runtime-tested.

## Required fixture matrix

All outcomes below are source-derived acceptance criteria or explicitly conditional on measured Electron results. No capture at the current revisions has been reviewed.

| Row | Named fixture / input data | Diff effect; before → after | Real app seeding and interaction | Minimum / status |
|---|---|---|---|---|
| R1 | Slow-resource client redirect; warm native registered guest; new source `/slow-redirect`; source holds `/slow-resource` and sets location to distinct static `/target` | **Affected if measured errno -3.** Target on both; false navigation toast before → none after; loading must settle. | UI visit `/warmup`; prove registration; address Enter `/slow-redirect`. Native promise/event log must identify -3, final document and URL. | **recording**, 1100×780 × dark × base/head. **PENDING: recapture**. |
| R2 | HTTP 302 `/302` → `/target`, same warm guest | **Control.** Resolved load, no error toast and same target on both; entered source history on both. | Fresh matched warmup state; Enter `/302`; observe promise, redirects and history. | **recording**, same tuple. **PENDING: recapture**. |
| R3 | Client redirect only after initial load completes; `/fast`, no held resource | **Control if initial load resolves.** No toast on either; target on both. | Enter `/fast`; retain initial native resolution before page redirect. If -3 occurs, classify as R1 and repair the control. | **recording**, same tuple. **PENDING: recapture**. |
| R4 | Direct main-frame connection refusal; unused local port, different URL from warmup | **Control.** Genuine failure toast and “This site can’t be reached” on both; failed entered URL absent from new project visit history. | Confirm no listener on selected refusal port (old driver 38918); Enter its URL from warm guest; capture native -102, error view, settled loading and project history. | **recording**, same tuple. **PENDING: recapture**. |
| R5a | R1 history with exactly one initial warmup entry; source and target distinguishable; no unrelated entries | **Affected.** New Idle tab recent list: warmup only before → source plus warmup after. Project bucket gets entered source, not an inferred target visit. Thread recentlySeenUrls is diagnostic only, not a head-only assertion. | Continue R1 by opening a blank Browser surface in same project; expose real recent cards and read project history and thread state. Do not inject desired post-state. | **recording**, same tuple; shares R1. Before/After list stills. **PENDING: recapture**. |
| R5b | First aborted entered visit: zero initial project recents, zero local-server cards; live attached Idle about:blank guest | **Affected.** After redirect/new blank tab: “No preview yet” before → first source recent card after. | Fresh synthetic project; no warmup visit; wait for native guest registration before Enter slow redirect. Then open blank Browser tab. Verify zero servers and zero initial bucket entries; discovery must not add fixture cards. | **recording**, same tuple. **PENDING: recapture**. |
| R6 | User navigation supersedes pending A: `/hold` then successful B `/target`; one warmup history entry | **Affected if A rejects -3.** False A toast before → none after; B stays final; project history gains A after, while B is visited on both. Record actual recent order. | Submit A, await server request milestone, then Enter B in same guest. Observe A rejection, B resolution and final B; new blank tab shows history. | **recording**, same tuple. **PENDING: recapture**. |
| R7 | Real attachment `/download` in warm native tab; application/octet-stream and Content-Disposition attachment | **Conditional control.** Old Electron returned -2, so retain failure behavior if still -2. If current run returns -3, only source notification/history success-path changes; do not invent a loaded download document. | Enter real endpoint; log actual errno, download begin/progress, saved/cancelled/dialog disposition and retained page/address/loading, then project history. Main changed download plumbing, so old outcome is not accepted. | **recording**, same tuple. **PENDING: recapture; current errno/disposition unverified**. |
| R8 | Real HTTP 204 `/no-content` from attached warmup tab | **Conditional control.** Old Electron returned -2; unchanged failure if still -2. If -3, false toast removed and source visit recorded; no new document is promised. | Enter real 204 endpoint; log native result and retained document/address through toast and settled phases; open blank tab to show history. | **recording**, same tuple. **PENDING: recapture; current errno unverified**. |
| R9 | Recent-card slow redirect from registered Idle guest; existing `/card` recent seeded with redirects off | **Affected.** Second UI catch: source false toast before → none after; target on both; existing project history entry remains one rather than duplicating. | UI visit `/card` with redirect disabled; open new blank tab, await guest registration; enable redirect, click real `/card` recent button. Read exact URL/count afterward. A local-server-card click converges on same handler and can substitute if its preconditions/result are documented. | **recording**, same tuple. **PENDING: recapture**. |
| R10 | Pending A superseded by genuinely failing B; `/hold` then unused-port URL from R4; warmup entry present | **Affected combination.** A must reject -3; B must fail with non--3. Extra false A toast before → only genuine B failure notification after; B LoadFailed view retained on both. Head may record aborted A; neither records failed B as a new successful visit. | Extend R6 sequence to submit R4 URL for B; confirm A request before B and record both promise/error identities, toast sequence, final failure page and history. Real UI/fixtures suffice; no injected result needed. If this Electron sequence cannot produce the specified pair, report it and use a clearly labelled Manager/IPC harness for the combination, not a claimed real response. | **recording**, same tuple. **PENDING: new combination, not in prior driver**. |

## Collapsed or supplemental rows

| Row | Path / shape | Why it is outside the minimum; seeding / status |
|---|---|---|
| C1 | Missing tab/guest, destroyed guest, pending initial URL and registration | Returns before changed catch or uses `registerWebview.loadPendingUrl`; open/close/reopen can reach it. **SOURCE-TRACED**, not current runtime proof. R1/R5b/R9 must positively avoid it. |
| C2 | Same URL/reload, back/forward, refresh, in-page navigation, popup/open, initial session URLs, terminal/markdown/MCP opens | Different native/RPC/guest operation. Existing UI reaches these. **SOURCE-TRACED**, no extra recording required for this condition. |
| C3 | Invalid/empty/search address input; primitive/null/code-only/string-errno rejections | Input handling unchanged; only numeric -3 is caught. Pure predicate/error-shape cases have no additional visual outcome beyond R4. Inject only in a labelled Manager/IPC harness if desired. **SOURCE-TRACED**, no new runtime claim. |
| C4 | Main-frame abort, subframe resource error, main-frame non--3 failure | Listener's constant replacement preserves behavior. R1/R6 demonstrate main abort, R4/R10 main error; subframe failures are ignored. **SOURCE-TRACED**, collapsed. |
| C5 | Streamed server browser with/without control; web/mobile; preview unavailable/permission denied; remote/relay/tunnel | Separate render/control/open path. Native desktop primary-server or desktop-runtime tabs are in native scope. A remote desktop-runtime tab reaches the same IPC; URL resolution differs, error classification does not. **SOURCE-TRACED**, no cross-client/connection verification claim. |
| C6 | Light theme, other widths/device viewports/zoom, long URL/title, favicon, time labels, >8 recents/list cap, mixed local servers, profile/menu/pick/recording/floating/hidden states | Existing cosmetic/data variants unchanged; R5a/b/R9 represent new/repeated/empty history transitions. Collapse to named dark embedded tuple. **NOT RUNTIME-VERIFIED**; no new layout branch from this diff. |
| C7 | Windows 11 and macOS Electron | Shared code but native event timing can differ. **NOT RUN / unavailable in this Linux pass.** Required to claim native platform verification, not silently substituted with Linux images. |
| R7h | Synthetic -3 substituted for real attachment rejection | Existing old harness can still run after path fixes. **OPTIONAL HARNESS**, not proof that real downloads return -3. Real R7 remains mandatory. Numeric catch is already exercised naturally by R1/R6. |
| R8h | Synthetic -3 substituted for real 204 rejection | Same as R7h; distinct retained-document observation is supplemental. **OPTIONAL HARNESS**, not proof of real 204 errno. Real R8 remains mandatory. |

## Driver compatibility and handoff

Read versions: [run-capture.sh](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/05deccbbe3494c4d/run-capture.sh), [seed.mjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/433a50e50d86efb0/seed.mjs), [capture.mjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/c9d38b7c73cf7bf0/capture.mjs), [fixtures.mjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/4719dfd044af1370/fixtures.mjs), [inspect-stores.js](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/67746c8e7b51b544/inspect-stores.js). These exact downloaded sources are retained alongside this matrix, unchanged.

| Driver | Fits current source? | Required preparation / limits |
|---|---|---|
| run-capture.sh | **Yes, lifecycle pattern.** It retains spawned fixture PID and stops it in trap. | Relocate hardcoded scratch to the capturer's subdirectory; make launcher log/PID output timestamped there. It accepts only side and does not forward a row filter. Do not also launch a competing fixture on port 38917. |
| seed.mjs | **Yes, source-compatible UI/RPC.** Existing selectors and `thread.create` schema fit; creates stopped thread through RPC, no provider turn. | Relocate synthetic project path and initialize that project; onboarding dismissal assumes the fresh profile's Close control. Check command reply Success and project/thread visibility. It waits for “No preview yet”, **not native registration**; add an explicit registered-guest precondition. |
| capture.mjs | **Yes for R1–R9 after environment preparation; extend for R10.** Real form Enter/card click, loadURL observer, MutationObserver toast trace, full-window lossless recording and fresh per-row home remain applicable. | Relocate scratch/root paths. Base checkout must actually be current merge-base and both desktop/server/web bundles rebuilt at their pinned inputs; the script launches dist-electron/main.cjs, not source. Its manifest currently records root but not git/build SHA: add provenance. Require expected native results per row, not just successful script completion. Add R10 as R6 with failing B from R4. Assertions should confirm final failure preserved. For R7 keep actual changed download behavior; isolate any save location under capture scratch. |
| fixtures.mjs | **Yes.** Slow redirect, 302, after-load redirect, held response, attachment, 204 and static documents remain appropriate. | Relocate log directory; confirm bind succeeds and refusal port is free. It listens at fixed 38917 and its request list spans rows: filter by run/recording start. R10 uses existing /hold plus refused port, so no new response route is necessary. |
| inspect-stores.js | **Source-compatible diagnostic helper**, linked in old evidence; reads hook snapshots and history-shaped objects. | It inspects private React fiber shapes and is best-effort, not a proof assertion. Confirm actual current thread/runtime/hasWebContents values are present. Persisted project bucket in localStorage is the direct history identity check; do not treat an empty fiber scan as empty history. |

The old driver's R5a is R1's history phase, not an independent row. Keep that explicit mapping in output. Do not claim R5b is combined with R9: R9 pre-seeds a recent entry, so it cannot prove zero-to-one history. R7h/R8h must stay marked synthetic if reused. A direct bridge.navigate call bypasses the two UI catches/history writes and is only a labelled IPC harness, never a substitute for native UI toast/history proof.

Review coverage: complete two-file PR diff; native navigation and did-fail-load branches; sole production IPC caller; both UI handlers; production mount and permissions; native/streamed runtime selection; hosted Idle registration; project history versus thread recent state; empty/loading/error/card/chrome branches; all fourteen changed preview files from main plus relevant unchanged dependencies; prior matrix/evidence text and all four requested drivers plus inspector. Existing tests were read, not rerun. No current visual result is asserted. No server, emulator or lease was started. The lead-owned worktree and scratch parent were preserved; matrix source remains in this step subdirectory as requested.

FRICTION: tool | Python urllib received HTTP 403 fetching the public evidence artifact; curl fetched it successfully. | Use curl for these artifact downloads.
VERDICT: INSUFFICIENT <all affected rows: not yet captured>
