f2c5831315
Root cause: warm-before-hide kept the window visible during backend warmup, and on a restart that warmup could take several seconds (the stream backend start waits up to 8s). During that visible window, clicks over the app were skipped by the userIsInApp guard and clicks elsewhere were shot post-click, so a restarted session looked like it stopped after one click. - Recording is now 'armed' only after the window is hidden and the buffer is primed. A new warmingUp flag makes onOsClick ignore clicks during warmup (the window is covering the user's work anyway) instead of mishandling them. Cleared on pause/finish. - armRecording caps the warmup wait (WARMUP_MAX_MS=1500): the window hides and the session arms even if the backend start hangs, so it can never sit visible for seconds dropping clicks. The backend keeps coming up in the background; the first click or two may take the fresh-shot fallback. - A generation token invalidates an in-flight backend start whose session has since finished, so a slow start can't install into a new session or leave the starting-guard stuck and block the restart from starting one. Tests: 4 new behavioral capture tests (warmup ignores clicks; pause/finish clear it; armRecording warms-then-hides-then-arms; a hung start still arms within the cap; a stale start is discarded and frees the guard) plus a new end-to-end self-test scenario (warmup click ignored, first armed click captured). 152 unit tests + all repo checks pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>