Skip to content

perf(ci): merge Refine's three plan jobs into one - #17552

Open
kyle-sexton wants to merge 5 commits into
mainfrom
perf/refine-merge-plan-jobs
Open

kyle-sexton wants to merge 5 commits into
mainfrom
perf/refine-merge-plan-jobs

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs: #14292

Summary

pr-refine.yml ran check-dispatcher-current, select-passes and fix-docs-head as three serial jobs. All three run only default-tip code with read-only tokens, and each one resolved the tip and checked it out again. They were separate jobs only to pass outputs between them. Each extra job is a serial hop (queue wait, runner start, checkout) on the path Review waits behind (.github/scripts/pr-review/wait-refine.mjs:121-122).

Fix

  • One job, select-passes, with the compare, plan and head-read steps gated on the earlier steps' outputs.
  • Permissions, a deliberate union. The merged job holds the three jobs' read scopes together: contents: read, actions: read, pull-requests: read. The old select-passes held contents and pull-requests, so its steps now also run with actions: read. No write scope, no id-token, no secret. The hub session checked this under the owner's security rule: read-only scope, base code only.
  • A stale dispatcher still starts no plan step and no later job. A dispatch with no dispatcher run and no fix-docs activity now skips the job instead of running a green no-op.
  • New plan-result and head-result outputs give record-passes each part's own result, so a failed plan still logs pass=plan. UNVERIFIED: a red head step is logged as fix-docs-head only if GitHub passes a failed job's outputs to its dependents. The workflow syntax docs say outputs "are available to all downstream jobs that depend on this job" and do not address a failed job. If GitHub does not pass them, a failed job logs pass=plan.
  • The lane-hold output is renamed hold-held, since select-passes already exports held. Fix Docs Head Held keeps its name and now needs select-passes alone.
  • The three job timeouts become one 20-minute limit.

Verification

Before (W5, 7 runs on 2026-11-19): the critical path with no change was 9 serial jobs, 11 when a patch is pushed. Measured queue waits on the two removed hops were 22, 87, 48, 31 and 4 s across 5 full runs, plus about 15-20 s of repeated tip resolve and checkout.

After: 2 fewer serial hops on runs that plan fix-docs, 1 fewer on runs that plan no pass, and up to 2 fewer runner slots and checkouts per run.

  • node --test --test-concurrency=4 over the 32 affected test files: 2673 pass, 0 fail (rerun after merging main).
  • scripts/check-read-caller-keys.test.sh, read-runner-dispatcher-gate.test.sh, check-app-key-references.test.sh: pass.
  • actionlint: clean.

After merge I'll measure the Refine span and Review's wait on the next runs against the W5 table.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01KeBVgdbwavfuWZGmKnMhWX

kyle-sexton and others added 4 commits November 19, 2026 17:26
pr-refine.yml ran check-dispatcher-current, select-passes and
fix-docs-head as three serial jobs. All three run only default-tip code
with read-only tokens and each resolved the tip and checked it out again;
they were separate only to pass outputs between them. They are now one
job, select-passes, with the compare, plan and head-read steps gated on
the earlier steps' outputs.

This removes 2 serial hops from runs that plan fix-docs (1 from runs
that plan no pass) and up to 2 runner slots and checkouts. Measured queue waits on the removed hops were 22, 87, 48, 31
and 4 s across 5 full runs, plus about 15-20 s of repeated tip resolve
and checkout.

Behavior is kept:
- Permissions are the union of the three jobs' read scopes (actions,
  contents, pull-requests: read); no write scope, id-token or secret.
- A stale dispatcher starts no plan step and no later job.
- New plan-result and head-result outputs give record-passes each part's
  own result, so a failed plan still logs pass=plan. A red head step is
  still logged as fix-docs-head, and a red compare still logs nothing,
  when GitHub passes a failed job's outputs to its dependents (not
  documented); otherwise a failed job logs pass=plan.
- The lane-hold output is renamed hold-held, since select-passes already
  exports held for the changed-files hold.
- Fix Docs Head Held keeps its name and now needs select-passes alone.

Tests that pinned the old layout are updated to the merged job.

Refs: #14292

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeBVgdbwavfuWZGmKnMhWX
The pr-pipeline docs now name select-passes where they named
fix-docs-head; the convention itself is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeBVgdbwavfuWZGmKnMhWX
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 19, 2026 22:37
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T22:39:23.944384Z f024f37 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 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #17552, incremental since f024f37

No security issues found.

Scope. This was an incremental review of one listed file, .github/scripts/pr-refine/gate-jobs.test.mjs, and I read its whole change in .claude-lane/incremental.diff. Because this lane already reviewed an earlier head, the review was blocking only.

What changed. The commit deletes one code comment in a test helper: // A job's needs and if:, single-line or folded, as written., which sat above gateOf. No code or behaviour changes.

Why it is not a finding.

  • The file matches none of the trusted-path globs.
  • It is not an instruction surface (not a CLAUDE.md, rules file, skill, agent body or hook list), so the instruction-surface lens does not apply.
  • It touches no trust control, token scope, merge hold or manifest.

Prior finding. The one earlier entry is this lane's whole-review summary of f024f37, which found no issues. It carries no finding to restate.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review (incremental, blocking only): f024f37 → baa0fec

This lane already reviewed an earlier head, so this review reports only blocking findings.

Scope. One file changed since the last review: .github/scripts/pr-refine/gate-jobs.test.mjs. I read its whole change in the incremental diff.

What changed. The push deletes one comment line above gateOf (// A job's needs and if:, single-line or folded, as written.). No code, assertion or test logic changes, so test behaviour is unchanged and nothing is loosened.

No blocking findings.

  • The prior summary comment had no line anchor and listed no findings, so nothing carries over.
  • No closing issue (the PR only uses Refs), so there are no acceptance criteria to check.
  • Loosened-check verdict: fail. The prompt had no loosened_check_verdict: or loosened_check_patterns: lines, so I used the default with no consumer entries. I did not check the decision-record citation requirement because there was no loosened_check_decision_record: line. Removing a comment loosens no check.
  • I ran no tests or tools myself. The PR body's test results are the author's claims and unverified.

Verifier dropped 0 of 0 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head baa0fec8c1d3d98405c69c7d5f6f33a97d3a71ca. What it wrote, as data:

What it wrote (31 lines)
Summary: Issue #14292 is linked by `Refs:`, so this PR only has to deliver part of it. The part it
  delivers is in scope. The last trusted comment on the issue says the wait now comes from about 15
  serial Refine jobs queueing for runners. This PR merges `check-dispatcher-current`,
  `select-passes` and `fix-docs-head` into one `select-passes` job, which removes up to two of those
  serial hops. It adds no pre-check job, and Review still waits for Refine, which matches the
  issue's recorded decision. The rewiring is consistent across the workflow: every caller of
  `fix-docs-head` now reads `needs.select-passes.outputs.*`, `held` is renamed to `hold-held`, and
  new `plan-result` and `head-result` outputs feed `record-passes`. Tests and docs are updated to
  match. The merged job only adds `actions: read`, so it stays read-only, with no secret or
  `id-token`. Test Node and every Test Bash job passed on the judged head
  (https://github.com/melodic-software/claude-code-plugins/actions/runs/44633141377/job/135993177475).
  The verdict is fail because the PR body never says what remains of #14292, which a `Refs:` part
  delivery must do. Also, the stale-dispatcher guard is pinned at the `start` and `files` steps, but
  not at the plan step that actually produces the passes. Two things for a human, not blocking: the
  trusted comment calls cutting serial jobs "a design choice for the owner", and the spec records no
  owner decision on this approach. The three job timeouts (5, 10 and 5 minutes) are replaced by one
  20-minute limit.
- PR body: state what remains of #14292 after this part, for example the rest of the roughly 9
  serial jobs on Refine's critical path and the runner queue wait that Review still sits behind, and
  whether the issue stays open. Today the body only says 'After merge I'll measure…', which is a
  follow-up check, not the remaining work on the issue.
- .github/workflows/pr-refine.yml: the diff gates `start` on `stale != 'true'`, `files` on
  `steps.start.outcome == 'success'` and `head` on the plan's `fix-docs`, but leaves unchanged the
  steps between `files` and the `plan` step (`write-pass-plan.mjs`). Gate the `plan` step, and any
  setup step before it, on `steps.start.outcome == 'success'` so a stale dispatcher, or a dispatcher
  run that is not fix-docs, cannot plan passes. A gate such as `steps.files.outputs.held != 'true'`
  evaluates true when `files` was skipped.
- .github/scripts/pr-refine/gate-jobs.test.mjs: the stale-dispatcher test injects `select-passes`'s
  outputs, so it never checks the step gates. Add a `stepIf(block, "plan")` assertion that the plan
  step does not run when `steps.start.outcome` is `skipped`. That way the PR body's claim that 'a
  stale dispatcher still starts no plan step' is checked by a test that can fail.

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass removes the label, at a new commit or at this same head: once a trusted person edits the body, and only trusted people have edited it since the fail, this head is judged again, so a fail on the body or the issues it links needs only the body fixed, no new commit.

@github-actions github-actions Bot added the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant