Repository navigation
fix(work-resolve-issue): stop a run before its push when a listed human opens a PR for the issue - #17080
Conversation
…'s open pull request The issue lane must stop before its push when a listed human's open pull request names the issue. These cases fail until the check exists: a listed human's draft Refs pull request and closing pull request are named, none and a stranger's pull request name nothing, and a failed read fails the check. Refs: #16748 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…an opens a PR for the issue A dispatched run checked for a listed human's open pull request only at admission and at a work-unblock re-fire, so a human's draft opened while the run worked still got a duplicate lane branch and PR. A new check-human-pull job runs after the model job and before apply-issue-patch. It calls admit.mjs humanPullsFor, built on openPullsFor with the listed-human filter work-unblock's humanPull used (which now calls it too), with the trusted-actor list from the default branch tip. When it names a pull request, apply-issue-patch pushes nothing and report-outcome routes the done run as blocked-by-pr, which keeps agent-ready and waits on that pull request. A failed read fails the job, so nothing is pushed, and report-outcome routes it as the patch-apply-failed fault retry. Closes #16748 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed Security review: no security issues foundThis review was blocking only: the lane already reviewed an earlier head ( Changes since the last review
Rechecked from the earlier review
No trust control is widened. No token scope grows, the trusted-actor check is not loosened, no new untrusted text reaches a credentialed lane, and no merge hold or kill switch is weakened. The pull request touches no plugin manifest. I found no embedded instructions in the PR context. Spend (not a finding): each run that writes a patch, and now each reuse run, starts one more short job on a standard critical-findings: 0 |
|
claude-review reviewed Code review: PR #17080, stop a run before its push when a listed human opens a PR for the issueBlocking only: this lane already reviewed an earlier head (
The earlier advisory finding is fixed. It was that a reuse-branch run opened its PR without the check.
Closing issue #16748 acceptance criteria:
The test results in the PR description are the author's claims, not checked by me: this lane has no shell. Loosened-check verdict: fail (no Spend (not a finding): each run that writes a patch or resumes a branch adds one short Verifier dropped 0 of 0 candidates. |
…eck-human-pull job's result read-lane-broker-check.test.sh evaluates apply-issue-patch's and report-outcome's if expressions, and its evaluator throws on any context reference it lacks. Both now read needs.check-human-pull, so the caller context names the job's success with no pull request. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…use run opens its PR A reuse run writes no patch, so check-human-pull skipped and report-outcome opened the lane PR from the resumed branch while a listed human's pull request for the issue was open. The check now also runs when the run reuses a branch; decide's existing blocked-by-pr branch stops that PR, and a failed read still opens none. Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
Held for the owner's sign-off on four choices the issue does not settle: (a) A failed pull-request read fails closed: nothing is pushed, and the run is routed as the existing patch-apply-failed escalation. CI Status is green and both review lanes report 0 findings on 2b65a23. The label comes off when the owner decides. |
|
Owner decision, 2026-11-18, typed in the owning session: "go w/ recommendations" on Q69, option A: merge as built, with the four agent-made choices (fail closed on a failed PR read, the blocked-by-pr wait, a separate check job before the push, the same check on the reuse-branch path). The hold is lifted. |
Closes #16748
Summary
A dispatched
work-resolve-issuerun now stops before it opens a pull request when a listed human's open pull request, draft or ready, names the issue (Closes #NorRefs: #N). That covers both ways the lane opens one: a run that wrote a patch pushes no branch, and a run that reuses an earlier lane branch opens no PR from it. Either way the run takes the existingblocked-by-prroute: the issue keepsagent-ready, the stop comment names the human's pull request, and work-unblock starts the run again once that pull request merges or closes.Fix
.github/scripts/intake-triage/admit.mjs: new exportedhumanPullsFor, built onopenPullsFor, keeps the open pull requests whose author id is in the trusted-actor list's humans. This is the filter work-unblock'shumanPullapplied;humanPullin.github/scripts/work-unblock/label-unblocked.mjsnow calls it, so only one copy of the reader remains..github/scripts/work-resolve-issue/check-human-pull.mjs(new): runshumanPullsForfor the issue with the default branch'strusted-actors.json, the same trusted-actor source admission and check-blockers use, and writespull=<n>orpull=. The listed-human test reads the pull request's author id from the API. It never reads a pull request's title, body or login text..github/workflows/work-resolve-issue.yml: a newcheck-human-pulljob runs after the model job, from the default branch tip withcontents,issuesandpull-requests: readonly. It runs under the same written-patch condition asapply-issue-patch, and also when the run reuses a lane branch (scan-reuse-branchset), since such a run writes no patch andreport-outcomeopens the PR from the resumed branch.apply-issue-patch, the job that pushes the branch, now runs only when that job succeeded and named no pull request.report-outcomepasses the job's output through as the newhuman-pullinput..github/workflows/pr-run-activity-write.yml: the newhuman-pullinput reaches the script only throughenv:(HUMAN_PULL). The first step checks it as a pull request number, in issue mode only..github/scripts/work-resolve-issue/report-outcome.mjs: on a done run withHUMAN_PULLset,decideroutesblocked-by-pr, naming the pull request, before its resumed-branch PR open, so a reuse run is stopped by the same branch. Stops the run itself reported (hold, pushback, host-only and the rest) keep their own route, so a person's hold is never replaced by a wait.scripts/read-lane-broker-check.test.sh: its caller context namescheck-human-pull's result, whichapply-issue-patch's andreport-outcome's conditions now read.When the pull-request read fails: the script throws and
check-human-pullfails.apply-issue-patchthen does not run, so nothing is pushed and no pull request opens. This follows the same rule as the existing checks: admission awaitsopenPullsForwithout a catch, so a failed read admits nothing (admit.mjs:2551), and report-outcome's own closer re-read before a PR open says "A failed read throws, like this script's other reads, and opens no PR" (report-outcome.mjs:2787-2788).report-outcomethen receivesescalation-reason: patch-apply-failed, the existing fault retry for a job that failed before it committed. On a reuse run the same escalation keeps the resumed branch's PR closed. The issue keepsagent-ready, work-unblock starts it again, and the failed job is named in the run's log.The route follows the owner-approved acceptance on the issue (decision): the existing
blocked-by-prwait. Admission parks the same case at Work statusdeferredwith a wait comment (admit.mjs:1586-1588, admit.mjs:2736). Inside a run,blocked-by-pris the stop with the same effect: it waits on that pull request and restarts once it closes.Verification
Run locally in the worktree with
node --test --test-concurrency=4:check-human-pull.test.mjs(new, 5 tests): a listed human's draftRefs:pull request is named; a listed human's closing pull request is named; with none, nothing is named; with only a non-listed author's pull request, nothing is named; a failed read rejects and writes no output. All five failed first, with the module missing (commit ba1a925), then passed.report-outcome.test.mjs: a done run withhumanPullrouteswait/blocked-by-prwithpr=31and opens no PR, the same run without it opens the PR, and a run's ownintent-changestop keeps its hand-back. A reuse run with checks passed opens the PR from the resumed branch, waits on the human's pull request instead whenhumanPullis set (naming the branch), and opens none when the check failed (patch-apply-failed).callers.test.mjs:apply-issue-patchneedscheck-human-pulland skips on a named pull request or a failed check; the check job's needs, permissions, script, trusted-actor path and output; the check runs for a written patch and for a reuse run, and not for an empty patch or no run (the reuse case failed before the workflow change, then passed);report-outcomepasseshuman-pulland maps a failed check topatch-apply-failed;check-human-pulltakes each resolve-issue value from the call that ran.scripts/read-lane-broker-check.test.sh: 37/37. It failed in CI on the first ready run (Test Bash (3)), since its evaluator throws on the newneeds.check-human-pullreference; fixed in 7039947.scripts/write-runner-never-rules.test.sh75/75,write-runner-hold-labels.test.sh12/12,write-runner-revoke-step.test.sh7/7,check-read-caller-keys.test.sh73/73,check-app-key-references.test.sh9/9.check-read-caller-keys.sh --check,runner-policy.mjs, actionlint andzizmor --offlineon both workflows, andcheck-line-citations.py: clean.scripts/check-affected.shafter merging main: 14 passed, 5 skipped.check-changelog-fragments.sh --check-required origin/main: no plugin changed, so no fragment is needed.Not verified: a live lane run on a real issue. The workflow wiring is covered only by the callers tests and the linters above.
Related
.github/scripts/work-resolve-issueandwork-resolve-issue.ymlintomelodic-software/pr-pipeline-sandboxfollows this merge (they are synced by hand).pr-run-activity-write.ymlgains an input too, so it needs the same resync if the sandbox carries that file.🤖 Generated with Claude Code