Skip to content

fix(pr-pipeline): route workflow-staged to a failing status, not needs-human - #10790

Merged
kyle-sexton merged 3 commits into
mainfrom
fix/workflow-staged-route-fail
Oct 29, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
fix/workflow-staged-route-fail

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: lane routing defect seen on #10767

Summary

pr-unblock put needs-human on #10767 with reason workflow-staged. The lane refuses to push a base merge whose .github/workflows/ tree is not exactly the base's (apply-patch.mjs workflowsAreBaseOwn). On #10767 the PR's own diff changes intake-triage.yml and work-resolve-issue.yml, and main brought post-merge-test-mutation.yml, so the refusal itself was correct. The route was not: a merge the lane token cannot push is a capability limit, and nothing in it needs a person's decision. A session merges main by hand.

A merge that brings only the base's workflows already pushes. That path and its test (apply-patch.test.mjs, "a base-side workflow change is admitted only when the merged workflows are exactly the base's") are unchanged.

Fix

  • escalation-routes.json: workflow-staged routes fail. The stop now ends in a failing pr-unblock/conflict status and the lane-stopped comment, with no label. The stopping check skips lane-stopped (stopSkip). The new why says the merge stages the PR's own workflow changes together with the base's, which the lane token cannot push, so a session merges main by hand.
  • clear-escalations.mjs: keeps the workflow-staged lift for a label an older lane run set, on the same evidence as before. The test file uses this reason as its main fixture, and no open PR carries the label today.
  • protected-path-conflict stays hold. Resolving a conflict in a workflow, settings or .gitmodules file means choosing the content of a security control, and that choice is the owner's.
  • Docs: pr-pipeline/README.md (route description, clear table) and pr-run-activity.md (the push row now skips lane-stopped). Changelog fragment for pr-pipeline.

Verification

  • report-escalation.test.sh failed against the route change before the test update (not ok - the routing table holds these for a person, and workflow-staged: writes the label then a comment). After the update, workflow-staged runs the fail-route assertions: one comment, no label, failing status. 797 ok, exit 0.
  • node --test over .github/actions/resolve-config/, .github/scripts/pr-unblock/, .github/scripts/pr-merge/ and .github/scripts/apply-patch/: 2453 pass, 0 fail.
  • shfmt, markdownlint-cli2 and jq empty are clean on the changed files.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 3 commits October 28, 2026 19:05
…s-human

A resolve-conflicts stop on workflow-staged now ends in a failing
pr-unblock/conflict status and the lane-stopped comment instead of
needs-human. The merge carries the pull request's own .github/workflows/
changes together with the base's, which the lane token cannot push, and
nothing in it is a person's decision, so a session merges main by hand.

escalation-routes.json routes it fail, and the stopping check skips
lane-stopped. clear-escalations.mjs still lifts a workflow-staged label
an older lane run set, on the same evidence as before.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…licts push stops

The push-job rows for unresolved-conflict and unexpected-path-staged
named the awaiting-human skip, but both reasons route fail, so the
stopping check skips lane-stopped.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 28, 2026 23:18
@chatgpt-codex-connector

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 🔄 Running since 2026-10-28T23:18:43.731886Z dd986c0 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

Copy link
Copy Markdown
Contributor

claude-review reviewed dd986c088a91f9ad6396a908a26cc247f5eb036e: 0 finding(s), 0 as inline comments.

No findings. I read the diff and PR context and checked the other places that mention workflow-staged. I did not run any tests; the test counts in the PR description are author-claimed and unverified.

  • Route change: escalation-routes.json sets workflow-staged to fail. The reason is still accepted wherever it is validated: the allow-lists in .github/workflows/pr-run-activity-write.yml (lines 645 and 2032), patch-rules.json and the apply-patch.mjs escalation reason.
  • Old labels: clear-escalations.mjs keeps its workflow-staged lift, so a needs-human label set by an older lane run still clears on the same evidence. Its test change excludes workflow-staged from the generic "fail-routed" loop, which matches its own repository-state check. unresolved-conflict is excluded the same way.
  • Tests and docs: report-escalation.test.sh moves the reason from HOLD_REASONS to FAIL_REASONS. Its label-config cases switch to protected-path-conflict, which is still a hold. The doc rows now say lane-stopped for the stops that route fail. That includes the unresolved-conflict and unexpected-path-staged rows, which were already fail routes.
  • Merge gate and retries: with no label, the failing pr-unblock/conflict status is the only record of the stop. That is the same mechanism unexpected-path-staged already uses, so I treat it as an accepted tradeoff, not a defect.
  • Cost: the change adds no billed resource. The fail route may let the dispatcher retry on the same head under the existing limit-stops-per-head cap. That spends prepaid or subscription usage only and is not a hold.
  • Stale reference, not blocking: docs/adr/0070-escalate-through-a-scripted-report-escalation-leaf-and-a-runner-computed-reason.md:28 lists workflow-staged among the reasons that set the label. It is an ADR, so the original wording is arguably intentional.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed dd986c088a91f9ad6396a908a26cc247f5eb036e: 0 finding(s), 0 as inline comments.

No security findings in this PR.

critical-findings: 0

What changed. escalation-routes.json moves workflow-staged (a resolve-conflicts stop) from route hold to route fail. The other changes are comments, docs, the changelog fragment and test updates, and none of them changes behaviour.

Merge hold. The change touches a merge-hold path, so I read what it gates. The stop used to label the PR needs-human. It now ends in a failing pr-unblock/conflict commit status plus the lane-stopped comment.

  • .github/workflows/pr-require-checks.yml around lines 5061-5117 shows that the ci-status step fails while the newest pr-unblock/* status from github-actions[bot] on the head is failure or error. ci-status is the required check, so the head stays unmergeable.
  • Only a later success status from report-escalation.sh clear, or a new head, lifts that failure. clear posts success only when the lane runs again on that head and does not stop.
  • A new head carries no status, so the next lane run starts clean. That matches how the other fail-routed stops already behave, so this is not a new bypass.
  • The stop is about a push the lane cannot make. No lane push or token scope is added, and the lane still refuses to push a merge whose .github/workflows/ tree is not the base's (workflowsAreBaseOwn, unchanged).
  • protected-path-conflict, conflict-patch-protected-path and feedback-protected-path stay on hold.

Legacy labels. clear-escalations.mjs keeps its workflow-staged lift for labels an older lane run set, on the same evidence as before. Only a comment block changed there. The test filter excludes workflow-staged from the generic fail-reason cases, because that reason keeps its own repository-state check.

Trust controls. I found no widening of who is trusted, of token scope, of the kill switch, or of untrusted text reaching a lane. The report-escalation.sh comment text is built from the reason and why fields of the routing table in the trusted base checkout, not from PR content.

Instruction surfaces and manifests. No standing instruction was deleted or softened, and no plugin manifest was touched, so there are no manifest <field> lines.

Spend. No change to paid plans, billing or lane-run frequency.

PR context. The description contains no embedded instructions aimed at the review lane.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 489fb55 Oct 29, 2026
76 checks passed
@kyle-sexton
kyle-sexton deleted the fix/workflow-staged-route-fail branch October 29, 2026 01:06
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 7, survived 0, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 100%; mutation score 100%.

File Killed Survived Timeout No coverage Invalid Not run
.github/scripts/pr-unblock/review-dependency.mjs 7 0 0 0 0 0

The run's summary has the full report.

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