Skip to content

ci(gate): the gate job's Chromium cache is written where nothing can read it - #461

Merged
sydevs-bot merged 10 commits into
mainfrom
claude/ci-459-gate-cache
Nov 22, 2026
Merged

sydevs-bot merged 10 commits into
mainfrom
claude/ci-459-gate-cache

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The accessibility gate restores Chromium from the main-warmed cache instead of saving one no
    later ref can read.
  • Both consumers launch the same build, so the entry main already holds serves both — option
    B, as chosen on the open question.
  • The gate audited whatever had rendered when it looked, which was sometimes nothing. Found while
    re-measuring it for the converged build.

Change outline

One writer on main, two readers in ci.yml. The gate was neither before: it wrote its own key
on refs nothing can restore from, and downloaded the browser on every run regardless.

 chromium: Warm the Chromium cache               .github/workflows/browser-cache.yml
   look the key up (lookup-only)
   miss → playwright install --no-shell chromium  # the full browser alone — unchanged
   miss → save it under that key                  # key: playwright-chromium-<os>-<version>

 browser: Browser lane                           .github/workflows/ci.yml
   restore that key, never save                  # unchanged
   miss → install --with-deps --no-shell chromium
   hit  → install-deps chromium

 gate: Lint, Typecheck & Build                   .github/workflows/ci.yml
   read the pinned Playwright version            # out of package.json, validated
-  actions/cache: restore AND save               # its own key, written for nobody
-  install --with-deps chromium                  # ~170 MB downloaded every run
+  actions/cache/restore: that same key
+  install --with-deps --no-shell chromium       # no `if:`: skips a restored browser, heals a partial one
-  pnpm test:a11y                                # chromium.launch(), no channel → the headless shell
+  pnpm test:a11y                                # launch({ channel: 'chromium' }) → the full browser

Nothing in browser-cache.yml's payload or key moves, so the entry on main serves the gate from
this PR's own run. The second commit is a separate finding in the gate itself: settled armed its
quiet timer before the page had changed, so a look taken between load and React mounting found
the 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 own
report — see ## Manual verification.

Test results

  • Lean gate: ✓ lint, typecheck, pnpm test:run (188 files, 2360 tests)
  • Targeted specs: ✓ pnpm test:run scripts/ci-workflows.test.ts (33)
  • pnpm ladle:build + pnpm test:a11y: ✓ 52 stories, clean, driving the full Chromium with no
    headless shell installed at all — the exact payload the warm job saves
  • Three further gate runs: 645, 655 and 655 controls measured, clean, ~43s each
  • Build: N/A — no app code changed

Manual verification

  1. Read this PR's Lint, Typecheck & Build log. The Chromium step must report a cache hit and
    no 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
    main today.
  2. Read the Accessibility gate step's line. It must report hundreds of controls measured, not
    a handful. That is the second commit's property, and only a real run shows it.
  3. Read a merge-queue entry's log for the same thing, once something lands after this. That is
    the case the ticket exists for, and no pull-request run can demonstrate it.

Notes for reviewer

  • The channel is what holds one key honest. The warm job saves --no-shell, the full browser
    alone. The gate now asks for that build by name, so ci-workflows.test.ts pins 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 no
    channel fails with Executable doesn't exist at …/chromium_headless_shell-1255/….
  • The gate's install stays unconditional, which is what makes a stale or partial entry a cost
    rather than a failure: playwright install skips a browser whose marker the restore brought
    back, and --with-deps installs the system libraries no cache holds. --no-shell keeps what a
    miss downloads equal to what the key promises.
  • The second commit changes what the gate measures, not what it demands. The probe reached
    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.
  • PR ci(smoke): let a Dependabot run skip Smoke quietly #458 edits the same step and drops its id: browser-cache as 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.ts also pins that the playwright and @playwright/test
    devDependency 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-shell leaves out. playwright install chromium installs the full browser and the
headless shell; --no-shell and --only-shell select one. Verified on 1.65.1 with playwright install --dry-run: plain names chromium-1255, ffmpeg-1013 and chromium_headless_shell-1255;
--no-shell names the first two. So the warmed entry has held the full browser all along, and
option B spends nothing to use it.

Every pin was watched failing. The channel removed from check-a11y.mjs; --no-shell removed
from the warm job; --no-shell removed from the gate's install; the gate's key no longer agreeing
with the warm job's; the gate saving as well as restoring; an if: added to its install; the
lane's on-hit install-deps removed; the warm job reading the version another way than the lane;
the two Playwright pins drifting apart; and the gate: and browser: jobs renamed, which throw at
collection 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 flag
gone 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: settled
runs in the page. The measurement in docs/testing.md is the evidence, and the gate's own report
line is where a reviewer reads it.

Rejected, with reasons.

  • A — one entry holding both builds (what this PR carried until the question was answered). It
    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-shell anywhere. With both consumers on the full browser, nothing launches the shell.
  • A composite action owning the version read, the key, the path and the install, with a save
    input for the warm job, would make key-and-payload disagreement structurally impossible rather
    than pinned after the fact. Out of scope here; filed.
  • One reader for the version. The gate validates package.json's pin before writing it to
    GITHUB_OUTPUT (a fork's step output can forge further outputs); the lane and the warm job read
    the installed @playwright/test with no guard. One shared reader would remove both the asymmetry
    and 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.md were taken
on 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

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 sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 question for the reviewer, one per thread.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread .github/workflows/browser-cache.yml Resolved
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 22, 2026
@sydevs-bot

sydevs-bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 21:48Z resolve-conflicts · attempt 1 · session · done
  • 21:48Z resolve-conflicts · attempt 1 · session
  • 21:25Z address-review · attempt 1 · session · done
  • 21:25Z address-review · attempt 1 · session
  • 20:56Z address-review · attempt 1 · session · done

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 22, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 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:419 narrates the arrangement the diff removes, and restates its own section's ref-scoping rule.
  • should-fix — scripts/ci-workflows.test.ts:341: onCacheHit has one caller and asserts inside a getter's name.
  • consider — ci.yml:84 is 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 but onCacheHit have 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 one key:/path: pair, so its new assertions cannot vacuum.
  • No previewUrl or fixture in .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

Comment thread docs/testing.md Resolved
Comment thread scripts/ci-workflows.test.ts Resolved
Comment thread .github/workflows/ci.yml Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 22, 2026
sydevs-bot and others added 4 commits November 22, 2026 20:58
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
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

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 browser-cache.yml still waits on you, with the critic's second opinion for B. Nothing else holds this.

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

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 22, 2026
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 22, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review November 22, 2026 21:06
@sydevs-bot
sydevs-bot requested a review from Ardnived November 22, 2026 21:06
@sydevs-bot
sydevs-bot enabled auto-merge November 22, 2026 21:06
@sydevs-bot sydevs-bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 22, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sahajatlas-design 94c6690 Nov 22 2026, 09:04 PM

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 22, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 22, 2026
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
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

B built, as you chose — and the re-measure it needs turned up a second defect.

  • The A/B/C question — B. check-a11y.mjs launches channel: 'chromium', so both consumers drive the full browser and the entry on main serves the gate unchanged. No rename, so this PR's own gate run can show the hit — the ticket criterion A put two merges out. 695d233
  • The gate audited pages before they rendered. settled armed its quiet timer before the page had changed, so a look between load and React mounting found it quiet because nothing had started. The tap probe reached between 1 and 126 controls across runs on one unchanged tree, in both builds, and axe reported nothing either way — green having read an empty body. With the first mutation required: 645, 655 and 655 controls, clean. 14e10fe

Lean gate ✓ lint, typecheck, 188 files / 2360 tests. pnpm test:a11y ✓ 52 stories, clean, with no headless shell installed. Security review skipped — no trigger path. Body refreshed.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 22, 2026
#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
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Merged main in. One hunk conflicted: the gate job's Chromium step in .github/workflows/ci.yml, which #458 and this branch both rewrote.

Took this branch's step whole. #458 dropped the dead id: browser-cache from it, and this branch had already dropped the same line while making the step restore-only — so taking ours loses nothing of #458's intent. Nothing else conflicted; #458's smoke-lane work merged in untouched.

Lean gate green: lint, typecheck, pnpm test:run (188 files, 2361 tests). Plus ci-workflows, wrangler-config and check-a11y specs (67).

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 22, 2026
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 22, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Nov 22, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Pending in SYDevelopers Technical Roadmap Nov 22, 2026
Merged via the queue into main with commit 3b545df Nov 22, 2026
26 checks passed
@sydevs-bot
sydevs-bot deleted the claude/ci-459-gate-cache branch November 22, 2026 22:22
@sydevs-bot sydevs-bot moved this from Pending to Done in SYDevelopers Technical Roadmap Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

ci(gate): the gate job's Chromium cache is written where nothing can read it

3 participants