# Composer trigger latency evidence

Run from each commit's own checkout after installing dependencies and building the real desktop app:

```sh
vp i
vp run build:desktop
node apps/desktop/node_modules/electron/install.js
RECORD=1 headless-desktop node <downloaded-driver>/desktop-measure.mjs <new-output-directory> 4 15
```

Use a new output directory on each invocation. Run the two commits sequentially on the same machine. The driver launches the actual Electron app with its production web bundle and bundled server, an isolated T3 home, an isolated synthetic user home, a synthetic project, 26 demonstration skills, and a synthetic API-key-shaped credential. It sends no model requests. Six additional bundled Codex skills are discovered in this environment, making 32 skill options. The slash-at-start menu has 36 options, mid-prompt slash 33, and file mention one.

Each invocation has three consecutive batches of 15 trials for each trigger (`/` at the start, `@`, `$`, `/` after `hi `), plus 30 letter trials per batch (`a`, `k`). Every trial clears the editor, closes the menu, enters the prefix if applicable, and arms a capture-phase keydown listener only for the measured key. A MutationObserver records when the character reaches the editor DOM. `requestAnimationFrame` followed by `setTimeout(0)` records the next frame opportunity. This is a paint proxy, not physical display scanout timing. CPU throttling is set through CDP on the Electron renderer. The comparison was repeated at rate 1 (unthrottled) by replacing the `4` argument with `1`, again on fresh state for each side.

The driver saves raw timings, final text, menu option text for every trial, and independent Escape-close checks. It records the first batch at 30 fps and saves one still for each trigger only after comparing two screenshots 500 ms apart. Captures are cropped to the composer region to exclude the host identity sidebar. Both sides use the same 1400x900 Electron window, light appearance, Xvfb/X11 display, and 840x650 capture region.

`results.json` and `functional.json` are the measurement and behavior outputs. To compare two completed invocations:

```sh
node <downloaded-driver>/summarize.mjs <base-output>/results.json <head-output>/results.json <comparison-output-directory>
```

This emits per-key pooled medians and the three batch medians, their max-minus-min spread, exact option-list equivalence, a Markdown measurement table, and a chart. No tests are used as the evidence.

The original report's Wayland/fcitx5 input stack and physical 2019 laptop are not available in this Xvfb session. The comparison measures the shared composer path inside the actual Linux Electron app. It does not claim verification of IME-specific behavior or physical screen latency.
