Repository navigation
fix(ci): isolate Node cache writes - #127107
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
215c8e8 to
04d0699
Compare
|
@clawsweeper re-review Exact head: |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: found issues before merge. Reviewed August 21, 2026, 5:36 AM ET / 09:36 UTC. ClawSweeper reviewWhat this changesThis PR replaces implicit Node and pnpm cache saves with explicit off, restore, or read-write modes and moves their publishing into selected trusted workflows. Merge readinessKeep open. The prior Node/dist writer finding is addressed, but the new guard still permits bare cache writers in pull-request workflows, so the stated cache-write isolation remains incomplete. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherGitHub Actions workflows use shared Node and pnpm setup actions before builds and tests. The setup actions restore caches, while trusted workflows explicitly publish cache entries for later runs. flowchart LR
A[Workflow trigger] --> B[Shared setup action]
B --> C[Cache mode validation]
C --> D[Restore-only cache]
C --> E[Trusted cache writer]
D --> F[Build and tests]
E --> G[Shared cache]
Decision needed
Why: The current branch deliberately limits its structural check to Node-oriented paths, while remaining bare cache writers execute in pull-request workflows; choosing a narrower permanent boundary is a maintainer security-policy decision. Before merge
Findings
Agent review detailsSecurityNeeds attention: The new cache authority model leaves direct pull-request cache writers outside its protection. PR surfaceTests +114, Config +127, Other -21. Total +220 across 59 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Convert every pull-request-capable direct cache action to restore-only or move its save into a trusted writer, then make the structural guard enumerate all permitted writers rather than filtering by Node path. Do we have a high-confidence way to reproduce the issue? Yes, from source: an apps/linux pull request triggers the Linux workflow, which runs a bare cache action before Cargo builds and tests; the new guard explicitly leaves that non-Node writer outside its check. Is this the best way to solve the issue? No. Explicit modes are a good owner boundary for Node caches, but the new guard proves only a Node-path subset while direct pull-request cache writers remain. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f7cbe9e5daec. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
04d0699 to
5d887b2
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
5d887b2 to
64b3b9b
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
64b3b9b to
d34ddc0
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
What Problem This Solves
Resolves a problem where pull-request-capable workflows could execute repository-controlled setup code in jobs that also had authority to publish shared Node-oriented GitHub Actions caches. That coupling let untrusted changes influence Node toolchain, dependency, pnpm, Vitest, compile, and build cache contents.
Addresses CodeQL alerts #719-723, #785, and #795.
Scope is intentionally limited to the Node-oriented cache families named by those alerts and their direct callers. Android SDK, Cargo, and Swift caches are unchanged and outside this lane.
Why This Change Was Made
The shared Node and pnpm setup actions now expose one explicit
cache-mode: off|restore|read-writecontract that defaults tooff, validate it, and remain restore-only. Every caller declares its authority, PR-capable Node cache paths use restore-only actions, and every remaining save step requires validatedread-writeauthority.This removes the legacy per-cache save switches and the CI matrix's in-run Vitest writer election. The protected warmer publishes shared CI caches; trusted release, Testbox, and proof workflows retain their existing cache saves through the same contract. Publication behavior is unchanged.
User Impact
CI retains cache restoration, but pull requests can no longer publish Node toolchain, dependency, pnpm, Vitest, compile, or build caches. Trusted cache publication is explicit and structurally enforced.
Evidence
d34ddc0687bbb22662133ef6a848a7cdeeee2950restore, 9off, 3 trustedread-write, 1 dispatch-onlyread-write|restore, and 1 conditionalrestore|off.cache-mode == 'read-write'; no save-capable Node cache action remains in pull-request execution.pnpm deadcode:dependenciespassed.node scripts/check-changed.mjs -- <affected paths>passed all selected tooling, scripts, test-root typecheck, formatting, and lint lanes.git diff --check, targetedoxfmt --check, YAML parse, composite-action schema probe, and privacy scrub passed.