fix(ci): use one browser for gallery head and base renders
Gallery health resolved its browser inside the head render step. The helper writes CMUX_CHROME_HEADLESS_SHELL to GITHUB_ENV, which Actions imports only for later steps: the head ran full Chrome while the base replay ran headless-shell. This produced different text widths and layout-shift scores for unchanged source during the limits audit. Shell selection arrived in c2933eb2bdf405ec0a91688965c81d4823319755.
Resolve the browser in its own preceding step, under the same render condition, so both sides receive the same executable. The existing dependency installation moves with setup.
Leo's audit request: “why are there prompt limits anyways?” and “well we ought to audit the limits and make sure 1. don't have nonsense 2. do some super sweet ergo perf stuff”. This corrects the validation used by that audit.
Validation: python3 -m unittest tests.test_playwright_system_chrome tests.test_ci_gallery_health_merge_ref — 17 passed. The regression executes the workflow commands with fake build/browser commands and imports GITHUB_ENV between steps: it fails on ca064c23b60d with head=chrome, base=resolved shell, and passes after the fix. python3 tests/test_ci_workflow_guards_are_wired.py passes; the regression lives in the already-wired gallery guard suite. Static pre-push checks and pr-overlap pass. No browser is launched by the portable regression.
Paired gallery replays 41637515269 and 41647896883 rendered the original and current clipboard change against their respective bases under the same full Chrome engine. The current replay rendered merge 907a576a40b114bfbb6bf94629ae6ab84eac5b58 and base 8d08eaaf21413c0a39d72231bb54099fe75c31c3, including both themes: each reports identical repo-worktrees-search layout shift 0.00699 (baseline 0.00447) and moves, with no fresh render or geometry failure. This confirms the previously different scores disappear when the executable matches.
🤖 Generated with Codex
Agent session: agent session