Repository navigation
ci(gate): the gate job's Chromium cache is written where nothing can read it - #461
Conversation
The gate's cache step both restored and saved, in a workflow that runs on `pull_request` and `merge_group` alone. A cache is readable from the ref that wrote it, that ref's pull-request base, or the default branch — so nothing the gate saved was ever read back, a merge-queue entry's ref being new per entry, and the step paid a ~170 MB Chromium download plus a cache upload on the critical path of the one required check, every first run of a pull request and every merge. `browser-cache.yml` already solved this for the browser lane: it writes the entry on `main`, and the lane restores it. Two things stopped the gate from reading that entry — the keys differed, and so did the payloads, since `chromium.launch()` with no `channel` resolves to `chromium_headless_shell` while the warm job saved `--no-shell`. Measured here: with the full Chromium present and the shell absent, `chromium.launch()` fails with "Executable doesn't exist at .../chromium_headless_shell-1255/...", which is what a restore-only gate over a shell-less entry would have hit in CI. So the warm job now installs both builds under one key, and both consumers restore it. The key is renamed to name its payload rather than carrying a revision number: an entry saved under the old key holds no shell, and a stale hit would have given the gate a browser it cannot launch. `pnpm test:a11y` passes locally against a shell installed this way, over 52 stories. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYvuWj4hRz8gbf7Qii
Splitting it into install-on-miss and install-deps-on-hit bought nothing and cost the guarantee. `playwright install --with-deps chromium` skips a browser whose marker file the restore brought back and installs the system libraries either way, so one unconditional step is both cheaper to read and self-healing: a partial or shell-less entry costs a download instead of handing `test:a11y` a browser it cannot launch. The key still names its payload, so the warmed entry gains the headless shell on the next push to `main` rather than at the next Playwright bump. With the hit path gone the gate reads no `cache-hit` output, so the step needs no `id` — which is also what #458 removes from it as dead. The spec gains the pins that shape leaves load-bearing: the install step has no `if:`, and the warm job's install carries no `--no-shell` while its key says `with-shell`. Three duplicated extractions become one each — `jobIn` bounds a job at the next column-2 line, so a renamed job throws instead of widening the slice over its neighbour's steps, and `steps`, `cacheActions` and `expectRestoresWarmedCache` are shared by both consumers' describes. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYvuWj4hRz8gbf7Qii
The browser lane's recipe installed `--no-shell` and the accessibility gate needs the shell, so a developer following the first paid a download at the first `pnpm test:a11y`. One recipe carrying both builds matches what the warmed cache now holds. Records what was rejected with it: giving the accessibility gate `channel: 'chromium'` would converge both lanes on one build, at the cost of re-measuring every figure in that section against a browser it did not render in. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYvuWj4hRz8gbf7Qii
sydevs-bot
left a comment
There was a problem hiding this comment.
1 question for the reviewer, one per thread.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
No larger than #459: two workflows, their spec, and one doc. Four of the five acceptance criteria are met, and the body says the fifth cannot be shown from here — the key rename makes this PR's own gate run miss, so "measured on a real run" waits two merges. That is the cost option B on the open question avoids: B needs no rename, so the gate hits the entry main already holds and the criterion is checkable now. My second opinion there is B, left open for you.
The mechanism holds: all three key: lines are byte-identical, --with-deps still runs on a hit in both jobs, and both Playwright pins are exact 1.65.1, so the gate's package.json read and the warm job's installed read cannot diverge today.
The prose is oversized. One fact — one warmed key, two consumers, the shell is a download of its own — now sits in browser-cache.yml's header, both ci.yml jobs and two docs/testing.md blocks. Two findings cut restatements; the ⚠ warnings stay.
Findings
should-fix—docs/testing.md:419narrates the arrangement the diff removes, and restates its own section's ref-scoping rule.should-fix—scripts/ci-workflows.test.ts:341:onCacheHithas one caller and asserts inside a getter's name.consider—ci.yml:84is a third home for the ref-scoping why.
What was checked
new-pieces.mjs:NONE, so no streamliner ran. The spec's new helpers were walked by hand: all butonCacheHithave several callers.- Read whole on the branch: both workflows, the spec,
scripts/check-a11y.mjs(chromium.launch(), no channel — confirmed),scripts/check-a11y.test.ts(pins no launch). - The gate job holds one
actions/cache*and onekey:/path:pair, so its new assertions cannot vacuum. - No
previewUrlorfixturein.claude/workflow.json, so no preview data check; no contract surface.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The browser-lane paragraph two above already says a run can only restore from its own ref, its base, or the default branch. The gate's note restated it and then narrated the arrangement this branch removes, which reads as current state to anyone opening the file fresh. #459 holds that story. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYUKMV5uhjGsemiH9h
The helper had a single caller and ran an expect inside a name that read like a getter, so a reader following the call saw one assertion where two ran. The gate job has no on-hit step by design, so no second caller is coming. Its docblock's why already sits in the it-block's comment above. Watched failing: with the lane's on-hit condition no longer matching, the inlined length assertion reds with its message intact. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYUKMV5uhjGsemiH9h
browser-cache.yml's header owns why only the default branch can write the entry, and the browser lane's own restore points at it in one line. The gate made a third home for it. The measured cost stays: it is the reason this step restores at all, and sits nowhere else. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYUKMV5uhjGsemiH9h
|
Three critic findings, all adopted. Prose only — no behaviour moved. Base merged in clean (#460's contract re-sync) and pushed with the work.
The A/B/C question on Lean gate ✓ lint, typecheck, 188 files / 2360 tests. Security review skipped — no trigger path in the diff. Docs checked, nothing stale: the four files in the diff are the only ones describing this cache. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
sahajatlas-design | 94c6690 | Nov 22 2026, 09:04 PM |
The accessibility gate launched the headless shell, a download of its own beside the full Chromium the browser lane drives, so one warmed cache entry could serve both only by holding both builds. `channel: 'chromium'` in `scripts/check-a11y.mjs` removes the fork instead: both consumers launch the full browser, the warm job keeps `--no-shell`, and the key keeps its name — so the entry `main` already holds serves the gate, with no rename and nothing to re-save. Measured on the pinned 1.65.1 with the full Chromium installed and no shell present, which is exactly what the warm job writes: 52 stories, clean. The `--no-shell` on the gate's own install keeps what a miss downloads equal to what the key promises. `ci-workflows.test.ts` pins the channel against the warm job's `--no-shell`, since dropping either one hands the gate a build the entry does not hold, on a required check. Each pin was watched failing: the channel removed, the warm job's `--no-shell` removed, the gate's `--no-shell` removed, and the gate's key disagreeing with the warm job's. The gate's flag assertion reads the run line rather than the step, because the step's own comment names both flags and a step-wide match passed with the flag gone. Answers the A/B/C question on `browser-cache.yml` with B, as the reviewer chose. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVbSPfJF5aJ7x4LdKM
`settled` armed its quiet timer before the first mutation, so a run that looked in the gap between `load` and React mounting found the page quiet because nothing had started — and audited an empty body. Found while re-measuring the gate for the converged Chromium build. It fails green, which is why nothing caught it: axe reports no violation on an empty page and the tap probe reports no control. Measured over the 52 stories, the probe reached between 1 and 126 controls across runs on one unchanged tree, in both Chromium builds. With the first mutation required, three runs measured 645, 655 and 655 controls, clean, in about 43s. The quiet period stays the test, as its docblock argues: a themed-on-mount component is on screen long after `#ladle-root` gains a child. The cap still releases a story that mutates nothing, so the wait cannot hang the gate. No spec: `settled` runs in the page, and the unit lane holds the gate's arithmetic only. The measurement above is the evidence. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVbSPfJF5aJ7x4LdKM
|
B built, as you chose — and the re-measure it needs turned up a second defect.
Lean gate ✓ lint, typecheck, 188 files / 2360 tests. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
#458 landed the dead `id: browser-cache` removal from the gate job's Chromium step, which this branch had already dropped while rewriting the same step restore-only. Both sides wanted the id gone, so this branch's step is kept whole: it carries that removal plus `actions/cache/restore` on the key `browser-cache.yml` warms. Nothing else conflicted. #458's smoke-lane work — the quiet `dependabot` skip, its prose and its two spec pins — merges in untouched. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVzQXK8AUgWvU7J9kp
|
Merged Took this branch's step whole. #458 dropped the dead Lean gate green: lint, typecheck, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
main-warmed cache instead of saving one nolater ref can read.
mainalready holds serves both — optionB, as chosen on the open question.
re-measuring it for the converged build.
Change outline
One writer on
main, two readers inci.yml. The gate was neither before: it wrote its own keyon refs nothing can restore from, and downloaded the browser on every run regardless.
Nothing in
browser-cache.yml's payload or key moves, so the entry onmainserves the gate fromthis PR's own run. The second commit is a separate finding in the gate itself:
settledarmed itsquiet timer before the page had changed, so a look taken between
loadand React mounting foundthe page quiet because nothing had started.
Preview
Nothing here reaches a deployed artifact: the diff is two workflows, the accessibility gate, its
spec and
docs/testing.md. What changed is visible in a CI run's own log and in the gate's ownreport — see
## Manual verification.Test results
pnpm test:run(188 files, 2360 tests)pnpm test:run scripts/ci-workflows.test.ts(33)pnpm ladle:build+pnpm test:a11y: ✓ 52 stories, clean, driving the full Chromium with noheadless shell installed at all — the exact payload the warm job saves
Manual verification
Lint, Typecheck & Buildlog. The Chromium step must report a cache hit andno post-job cache upload. A green job that downloaded ~170 MB is the failure this PR is about.
Unlike option A, this is checkable here: no key is renamed, so the warmed entry is the one on
maintoday.Accessibility gatestep's line. It must report hundreds of controls measured, nota handful. That is the second commit's property, and only a real run shows it.
the case the ticket exists for, and no pull-request run can demonstrate it.
Notes for reviewer
--no-shell, the full browseralone. The gate now asks for that build by name, so
ci-workflows.test.tspins the two together:drop either and the gate launches a build the entry does not hold, on a required check. Measured
on the pinned 1.65.1 — the full Chromium present, the shell absent —
chromium.launch()with nochannel fails with
Executable doesn't exist at …/chromium_headless_shell-1255/….rather than a failure:
playwright installskips a browser whose marker the restore broughtback, and
--with-depsinstalls the system libraries no cache holds.--no-shellkeeps what amiss downloads equal to what the key promises.
between 1 and 126 controls across runs on one unchanged tree, in both Chromium builds, and axe
reported no violation either way — green having read an empty body. With the first mutation
required it measures 645 to 655, still clean. If a story is slow enough to need more than the 4s
cap, that cap still releases it, so the wait cannot hang the gate.
id: browser-cacheas dead. This PR drops it too,for the same reason, so the two agree — but whichever lands second needs that hunk resolved.
scripts/ci-workflows.test.tsalso pins that theplaywrightand@playwright/testdevDependency pins are equal: the gate keys on the first and the warm job on the second, so a
bump moving one alone would key the gate on an entry nothing writes.
Detail
What
--no-shellleaves out.playwright install chromiuminstalls the full browser and theheadless shell;
--no-shelland--only-shellselect one. Verified on 1.65.1 withplaywright install --dry-run: plain nameschromium-1255,ffmpeg-1013andchromium_headless_shell-1255;--no-shellnames the first two. So the warmed entry has held the full browser all along, andoption B spends nothing to use it.
Every pin was watched failing. The channel removed from
check-a11y.mjs;--no-shellremovedfrom the warm job;
--no-shellremoved from the gate's install; the gate's key no longer agreeingwith the warm job's; the gate saving as well as restoring; an
if:added to its install; thelane's on-hit
install-depsremoved; the warm job reading the version another way than the lane;the two Playwright pins drifting apart; and the
gate:andbrowser:jobs renamed, which throw atcollection instead of widening a slice over the next job's steps.
⚠ One of those mutations passed first, and the assertion was mine. The gate's flag check read
the whole step, and the step's own comment names
--no-shell, so it stayed green with the flaggone from the command. It now reads the
run:line, like the warm job's.The gate's empty-page runs left no trace. Both of its browser-side checks are silent on an
empty body — axe finds no violation, the probe finds no control — so every run was green and the
controls figure is printed, never asserted. Nothing in the unit lane can see it either:
settledruns in the page. The measurement in
docs/testing.mdis the evidence, and the gate's own reportline is where a reviewer reads it.
Rejected, with reasons.
keeps the gate's rendered output exactly as measured, at a permanent cost: both jobs restore a
build neither launches, the entry grows from ~170 MB to ~260 MB, and the key has to be renamed
once so the warm job re-saves — which is what put the ticket's "measured on a real run" criterion
two merges out.
--only-shellanywhere. With both consumers on the full browser, nothing launches the shell.saveinput for the warm job, would make key-and-payload disagreement structurally impossible rather
than pinned after the fact. Out of scope here; filed.
package.json's pin before writing it toGITHUB_OUTPUT(a fork's step output can forge further outputs); the lane and the warm job readthe installed
@playwright/testwith no guard. One shared reader would remove both the asymmetryand the equality pin this PR adds. Filed rather than built: it changes a required check's steps
for a hardening this ticket did not ask for.
Not measured: the download's wall-clock cost, and whether the full Chromium and the headless
shell differ in what axe reports. The jsdom-against-browser figures in
docs/testing.mdwere takenon the shell, and are marked as such; what they weigh is layout against no layout, which the build
does not move.
Closes #459
🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjVbSPfJF5aJ7x4LdKM