Skip to content

fix(lanes): give every job that runs PR code a read-only Actions cache - #11824

Merged
kyle-sexton merged 4 commits into
mainfrom
fix/read-only-cache-pr-code-jobs
Nov 1, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
fix/read-only-cache-pr-code-jobs

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs: #8294

Summary

Lane jobs that check out PR, issue or lane-branch code, or feed that content to a model, run on main-scoped events (workflow_dispatch on main, workflow_run, issues, schedule). On those events GitHub grants a write-capable Actions cache token by default, so that content could plant a cache entry that a later main run restores. Every such job now declares cache-mode: read: it restores caches and never saves them (workflow syntax, cache-mode changelog, 2026-09-10). This covers #8294's first acceptance criterion. The second (id-token: write) stays open: every listed caller job either already hands the token request to the read runner's broker-check job or runs only main, except the write runner's run job, which the owner is deciding.

Fix

  • cache-mode: read on 19 jobs:
    • read runner run, scan, summary
    • write runner run
    • work-resolve-issue run-checks
    • pr-unblock resolve-conflicts-select, adjudicate-feedback
    • eval-browser-dispatch eval
    • intake-triage refine-issue, refine-issue-subscription
    • pr-review-main review, review-subscription, review-fallback
    • pr-verify check-intent, check-intent-subscription, check-intent-fallback
    • maintenance-audit-lane-runs judge, judge-subscription, judge-fallback
  • callers.test.mjs: a contract test pins each listed job at read or none. A second test fails any caller of a lane runner that sets none or write-only, since a cap below the callee's read stops the run before it starts (Reuse workflows).
  • Left unchanged:
    • Hosted review and intake caller jobs: their ci-workflows callees already set cache-mode: none (pr-review-cli.yml:329, intake-triage.yml:362).
    • pr-require-checks: it saves caches only on refs/heads/main, and its PR code arrives only on pull_request/merge_group, whose cache scope is not main.

Verification

  • callers.test.mjs passes 213 of 213. The new test fails with the key removed from one listed job.
  • No edited job saves a cache: every actions/setup-node step there sets package-manager-cache: false, and no edited job runs an actions/cache save step.
  • One independent security review: no blocker. Its findings (a sync-managed actionlint.yaml edit reverted, five model jobs added, the caller-side guard) are fixed here. Its suggestion of a structural detection rule in place of the job list was not taken: the list is simpler, and a detector that reads checkout refs from YAML misses content fetched in run: steps.
  • Left out: a live lane run after merge (fix(lanes): read-only cache and no id-token in jobs that run PR code #8294's third criterion), which the next issue-lane and fix-docs runs cover.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 4 commits October 31, 2026 23:46
Jobs on main-scoped events (workflow_dispatch, workflow_run, issues)
that check out, run, or feed a model PR head, issue or lane-branch
content now set `cache-mode: read`, so that content can restore from
main's Actions cache but never save an entry a later main run restores.

Covered: pr-run-activity-read run and scan, pr-run-activity-write run,
work-resolve-issue run-checks, pr-unblock resolve-conflicts-select,
eval-browser-dispatch eval, intake-triage refine-issue and
refine-issue-subscription, pr-review-main review legs, and pr-verify
check-intent legs. callers.test.mjs pins the list, and the actionlint
config comment now points at it.

Refs: #8294

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adds cache-mode: read to the read runner's summary job, pr-unblock's
adjudicate-feedback and the three lane-run audit judges, which feed lane
diffs, review comments or run data to a model. The contract test accepts
read or none and checks that no caller of a lane runner caps it below read.
The actionlint.yaml comment is sync-managed and goes back to main's text.

Refs: #8294

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 1, 2026 04:10
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T04:11:48.454705Z 94315ad Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 94315ad87d646bdd2c09a12f16018abd6bab51e9: read 10 of 10 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #11824, read-only Actions cache for jobs that run or read PR code

No security issues found.

The change only narrows access. It adds cache-mode: read to 19 jobs across 9 workflows. These jobs run on main-scoped events and check out, run, or pass PR, issue or lane-branch content to a model. A new test in .github/actions/resolve-config/callers.test.mjs makes sure those jobs stay at read or none, and that no caller of a lane runner sets the cache below read. No permission, trigger, token request, trusted-actor check, kill switch or merge hold changed.

What I checked

  • All 10 files read in full. Every hunk in .claude-lane/pr.diff: the test file, plus eval-browser-dispatch, intake-triage, maintenance-audit-lane-runs, pr-review-main, pr-run-activity-read, pr-run-activity-write, pr-unblock, pr-verify and work-resolve-issue. The test file is under .github/actions/resolve-config/, but it is a test, which this skill says is not part of the broker-signer control.
  • Trust controls: nothing is widened. The new key can only remove the ability to write to the cache. Each edited job keeps its existing permissions: and if: lines.
  • Can a read-only cache break a gate? Some controls might depend on saving to the Actions cache, and read-only mode would silently block those saves. I searched .github/ for actions/cache/save. Saves happen only in pr-require-checks.yml, pr-feedback-dispatch.yml, pr-unblock-dispatch.yml and the check-wip-cap action. None of those workflows is edited. check-wip-cap is used at work-resolve-issue.yml:199, which is in a different job from the edited run-checks job (about line 636). Its save step also sets continue-on-error: true (action.yml#L95-L101). So no edited job loses a save that a cap or hold relies on. The merge-gate carry files (carry-run-cache.mjs, head-ref-map.mjs, lane-records.mjs, verify-answers.mjs) already avoid actions/cache.
  • Instruction-surface lens: not triggered. No standing instruction is deleted or softened.
  • Plugin manifests: none changed.
  • PR context: it contains no text addressed to the review lane.

Left open (outside this diff)

Spend

  • None. The diff changes no turn limits, models, schedules or runners.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed 94315ad87d646bdd2c09a12f16018abd6bab51e9: read 10 of 10 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

I read every hunk in all 10 changed files. Each one is a trusted-path file (workflows under .github/workflows/ and .github/actions/resolve-config/**), so each got a closer look.

What changes: 19 jobs in 9 workflows get cache-mode: read, so the Actions cache tokens of jobs that check out or read PR, issue or lane-branch content can restore caches but not save them. callers.test.mjs gets two contract tests:

  • one pins each listed job at read or none
  • one fails any caller of pr-run-activity-read.yml or pr-run-activity-write.yml that sets none or write-only

What I checked with Read and Grep:

  • Job names: every name in the new test matches a job key in the head files. For example, run, scan and summary are at pr-run-activity-read.yml lines 547, 2400 and 3102, and run is at pr-run-activity-write.yml line 521. Every cache-mode: read line sits at job level, beside runs-on and timeout-minutes.
  • Caller test regex: all 33 callers of the runners use ./.github/workflows/pr-run-activity-(read|write).yml. The test's $-anchored regex matches all of them, because the YAML parser drops the trailing # zizmor comment. No caller sets cache-mode today, so the new guard passes now and would fail on a later cap below read.
  • Jobs left unchanged in the write runner: report checks out only github.event.repository.default_branch and sets package-manager-cache: false (L2348). Leaving it without read is consistent with the stated scope.
  • actionlint: .github/actionlint.yaml already mentions cache-mode, so this change needs no linter config edit.

Not verified: the PR's claim that callers.test.mjs passes 213 of 213 comes from the author. I had no shell, so I did not run it.

Closing issue: the PR says "Refs: #8294" and closes no issue, and the PR context file has no closing-issue section, so there are no acceptance criteria to check. The PR says #8294 stays open for its id-token: write criterion and for the live-run check after merge.

Embedded text: none of the PR context told the lane to do anything.

Spend: none. The change adds no runs, turns or billed resources.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit cdb86f3 Nov 1, 2026
66 of 78 checks passed
@kyle-sexton
kyle-sexton deleted the fix/read-only-cache-pr-code-jobs branch November 1, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant