# Desktop composer focus proof

The app is the real Electron build from each supplied checkout. Nothing in its
focus, window-open handler, tab classification, tab selection or RPC results is
replaced. Both sides use new server databases and the same seed and driver.

Run from this extracted directory:

```sh
python3 reproduce.py --base "$BASE_CHECKOUT" --head "$HEAD_CHECKOUT" --output "$OUTPUT"
```

Base: [9efd960925](https://github.com/pingdotgg/t3code/commit/9efd960925f0899c0a6d045d128557c5d82818e8).
Head: [63957d2d90](https://github.com/pingdotgg/t3code/commit/63957d2d904e33d5ac0ba3e93f1328d9dacee440).

The command installs dependencies and builds each checkout in sequence. Use
`--skip-build` only if both have already been installed and built. It starts and
stops its own Vite, Electron and fixture processes. Run on Linux with
`headless-desktop`, Xvfb, xdotool, ffmpeg, ImageMagick and Python 3. The web viewer
uses Playwright's installed Chromium headless shell. Set `PROOF_CHROMIUM` to
its executable if it is at another location.

The fixed ports must be free: 6895, 7775, 14935, 15815, 18923, 19223, 19224,
19323 and 19324. Output is written into a new timestamped directory.

`pi-scope-fixture.py` is a deterministic implementation of Pi's RPC envelope
that holds a live agent caller and writes the scoped MCP URL and token to a
private file. It does not implement preview tools. Agent operations use the
real server MCP preview_open, preview_act and preview_evaluate, the production
CDP relay, and actual Electron guests. No paid model or account is used.
The identical model label on both sides is fixture metadata.

Rows:

- A1: Browser visible in A; focus A's composer; agent clicks the target=_blank
  link through preview_act; X11 types `12345` without refocusing.
- A2: Agent remains in A; display B with Files open; focus B's composer; run
  the same agent click and X11 typing without refocusing.
- H1: A native X11 left click opens the person's target=_blank link after a
  quiet period exceeding the agent attribution window.
- R1: A second web client streams the desktop-hosted source. The agent reads
  document.title, the person takes control and clicks the person's link in
  the streamed canvas within five seconds.
- RK: The agent focuses the person's link and reads document.title. The person
  takes control in the second web client and presses Enter in its Browser page
  keyboard receiver within five seconds. The native log records the actual
  rawKeyDown/Enter input delivered to the guest from that viewer.

The seed creates one synthetic project with fixture.txt and two threads.
Starting panel state and drafts reset per row. A real X11 composer click and a
focus check happen before recording. Files and Browser are the production
surfaces. Native logging wrappers only observe CDP commands and window opens.
The desktop viewport is 1440x1000, DPR 1, zoom 1, dark. Recordings include an
additional focus/timing sidebar. The second web client is also 1440x1000, DPR 1.
Only the renderer's Date and CSS motion are frozen for stable captures; the
main process's monotonic attribution clock remains live.

Each final still is accepted only when two full window captures 500 ms apart
are pixel-identical. Separate inspection clips select background destinations
after the focus outcome, so inspection cannot hide focus loss. Viewer videos
start in a separate authenticated context; pairing credentials are excluded.
Credential files, browser storage and server homes must never be uploaded.

Published evidence uses the full-run A1/A2/H1 captures and a fresh stream-only R1/RK rerun with native input logging enabled. Auxiliary viewer videos are cropped to the rightmost 540×1000 Browser panel to exclude unrelated loading/sidebar state; the paired desktop recordings remain full size. The viewer can retain its source tab selection; foreground classification is shown by the desktop host selecting person-target.

Viewer excerpts additionally discard the initial setup frames after the raw package trim: before-R1 1.10s, after-R1 1.00s, before-RK 1.00s, after-RK 1.05s. Each excerpt begins with Focus source visible before the new person-target tab appears.
