Repository navigation
Description
Summary
Three CI jobs write the pinned Playwright version into GITHUB_OUTPUT, and that value is the one
Chromium cache key all three share since #459. They read it two ways, at two levels of care: the
gate job validates it as exact semver before writing it, because a step output is repository
text and a newline inside one forges further outputs on a fork's pull request; the browser lane and
the warm job write an unvalidated command substitution. So the hardening the gate's own ⚠
documents is absent from the two jobs beside it, and one key is decided by two sources.
Approach
Line numbers as of #461, which this follows.
Three readers today:
.github/workflows/ci.yml:92–102— the gate's. ReadsdevDependencies.playwrightout of
package.json, checks/^[0-9]+\.[0-9]+\.[0-9]+$/, then appendsversion=…..github/workflows/ci.yml:198–200— the browser lane's.echo "version=$(node -p "require('@playwright/test/package.json').version")", no check..github/workflows/browser-cache.yml:42–44— the warm job's, identical to the lane's.
Replace all three with one reader they call. Two shapes, pick one:
- A script,
scripts/playwright-version.mjs, printingversion=<pinned>to stdout and
throwing on anything that is not exact semver, with each step as
run: node scripts/playwright-version.mjs >> "$GITHUB_OUTPUT". It is testable in the unit lane,
andscripts/AGENTS.mdplusdocs/testing.md§ "A spec that inventoriessrc/" hold the
conventions a newscripts/**/*.mjstakes (⚠ thenew URL(…, import.meta.url)ban, and a
co-located spec). - A composite action,
.github/actions/playwright-chromium/action.yml, owning the version
read, the cache key, the path and the install, with asaveinput the warm job alone passes.
This also removes the four-step read → restore → install block's third copy, and makes a key
that disagrees with its payload structurally impossible rather than pinned after the fact. The
repo already consumes a composite action (ci.yml:40). ⚠docs/rules/deployment.mdrequires
every third-party action pinned by SHA andscripts/ci-workflows.test.tsfails on a tag; a
local action is neither, so that spec needs a rule for it.
Either way, scripts/ci-workflows.test.ts:422–426 (keys on a version both Playwright pins agree on) and the versionRead helper at :373 exist only because there are two readers: delete both
once there is one, and pin instead that every job reads the version through it.
⚠ Keep the gate's validation and its reason — it is the only thing standing between a fork's
package.json and a forged step output. Whichever shape wins carries that ⚠ comment.
Acceptance criteria
- One reader produces the Playwright version every job's cache key is built from. No job reads
it a second way. - That reader refuses a version that is not exact semver, and the refusal is tested.
- The three jobs' cache keys still resolve to the same string, so one warmed entry serves both
consumers. -
scripts/ci-workflows.test.tspins the single reader and drops the two-pin equality
assertion, which has nothing left to decide.
Verification checklist
-
pnpm test:run scripts/ci-workflows.test.ts -
.claude/skills/pr-prep/check.sh - Read the pull request's own
Lint, Typecheck & BuildandBrowser lanelogs: both
Chromium steps must report a cache hit, which proves the keys still agree. - With the reader called directly, a
package.jsonwhoseplaywrightpin is^1.65.1must
make it exit non-zero rather than print a key fragment.
Notes
- Found while implementing ci(gate): the gate job's Chromium cache is written where nothing can read it #459, which made one cache key depend on two of these readers. The
equality pin there closes the key's half; this closes the hardening asymmetry and removes the
pin. - The composite-action shape also answers a second finding from that run: read → restore →
install → deps now exists three times across two files, with three comment blocks explaining one
mechanism.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Hold Until
Projects
- StatusShow more project fieldsDone
Activity
Ardnived commentedon Nov 22, 2026
@sydevs-bot implement
sydevs-bot commentedon Nov 22, 2026
🤖 no session running
approved by Ardnived
recent dispatches
Written by the sydevs dispatcher. Sessions never edit this comment.
sydevs-bot commentedon Nov 22, 2026
Handing this back. It cannot be built on
mainyet, because its anchors are #461's and #461 is open.Three criteria are unsatisfiable against
b6d27ed:mainkeys the gate onplaywright-<os>-<v>and the lane onplaywright-chromium-<os>-<v>. Those are two entries. ci(gate): the gate job's Chromium cache is written where nothing can read it #461 is the change that merges them.mainhas nothing to drop —ci-workflows.test.ts:373is the unit-lane step and:422the SHA pin.versionReaddoes not exist here either.devDependencies.playwright. The lane and the warm job read the installed@playwright/testversion. Collapsing those is sound only because ci(gate): the gate job's Chromium cache is written where nothing can read it #461 pins the two equal.Building it anyway would rewrite the same lines of
ci.yml,browser-cache.ymlandci-workflows.test.tsthat #461 rewrites. That duplicates an open PR and conflicts with it.Re-run
@sydevs-bot implementonce #461 merges. No edit to this ticket is needed.🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
Ardnived commentedon Nov 22, 2026
@sydevs-bot implement