# Pairing compatibility runtime proof

Environment: Linux x64 fs-29, Node 26.12.1. Both servers are real app servers, loopback only, isolated homes. No live T3 data was opened for writing. Credentials omitted.

Before: main 044f07257c9684ae4543bd1e1ebf9c394e9e3830.
After: c502579298f719c4346f48ff75f3b7d896ba17c4.

## Reporter direction: published stable CLI against V2

Command: `npx --yes t3@0.0.45 pair --base-dir /home/ubuntu/wt/issue-15492/.t3`
Server: `vp run dev` at main, server port14833/web6793; descriptor serverVersion0.1.1, orchestrationProtocolVersion2.
Output: Pairing with fs-29 (http://127.0.0.1:14833); token and URL printed; exit0.
POST `/api/auth/browser-session` with that fresh credential: HTTP401, `auth_invalid`, `invalid_credential`.
Read-only metadata: `.t3/userdata/state.sqlite` was created and has one auth_pairing_links row. Running V2 server uses statev2.sqlite.
Control: `node apps/server/src/bin.ts pair --base-dir /home/ubuntu/wt/issue-15492/.t3`; fresh credential exchanged with HTTP200.

## Reverse direction before fix: current CLI against real stable V1

Server command: `npx --yes t3@0.0.45 serve --port 14834 --host 127.0.0.1 --base-dir /tmp/issue-15492-v1 --no-browser`
Descriptor: serverVersion0.0.45, orchestrationProtocolVersion1.
CLI command at main: `node apps/server/src/bin.ts pair --base-dir /tmp/issue-15492-v1`
Output: token printed, exit0. Fresh credential exchange: HTTP401, `auth_invalid`, `invalid_credential`.
The current CLI created statev2.sqlite alongside stable's state.sqlite.

## Reverse direction after fix

Same stable server and same CLI command at c502579298.
Exit1:
```
IncompatibleServerProtocolError: The running T3 Code server (0.0.45) speaks orchestration protocol 1, but this CLI speaks protocol 2.
Pair with the matching CLI instead: `npx t3@0.0.45 pair`.
```
SHA256 of statev2.sqlite before and after the rejected command: unchanged.

## Matching V2 after fix

`node apps/server/src/bin.ts pair --base-dir /home/ubuntu/wt/issue-15492/.t3` at c502579298: exit0. Fresh credential exchange: HTTP200.

## Automated regression

`vp test run src/cli/pair.test.ts -t "another protocol"` in apps/server at d90dd6ee07 (test-only commit): FAIL. Expected only server-runtime.json; actual additionally environment-id, secrets, statev2.sqlite.
`vp test run src/cli/pair.test.ts` after fix: 14/14 PASS.

No UI/render changes; capture matrix empty. macOS desktop/Tailscale wrapping was not run; the same server/CLI protocol sequence was run on Linux. Already published t3@0.0.45 is immutable and remains affected; this fix protects future CLI releases. No unrelated visible changes.
