Repository navigation
fix(source-control): keep a person's needs-human removal off at an unchanged escalation - #9512
Conversation
…changed escalation pr-merge's escalate() treated a missing human-gated label as a failed label write and added it back on every run while the escalation comment was unchanged, so a person removing the label to approve a pull request was undone on the next gate run. It now reads the timeline only in that case (label absent, comment unchanged) and keeps the label off when a person with write access removed it after the comment last changed. A bot's removal, the lanes App included, lifts nothing; a new head or new reasons rewrite the comment and escalate again; a failed read adds the label as before. Covers the risk, verifier, held-major and shared-copy escalations. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…a lift Review follow-up. A lift now needs the label's newest removal (not any removal) to come from a User of kind human on the trusted-actor list read at the base branch, who also passes is_human (write access, not the agent identity or a self-login): a model-driven User account with write access no longer lifts an escalation. escalate() reads the comments once and hands them to both the upsert and the lift check. Tests cover an untrusted write User, triage access, the newest removal deciding, an unparsable comment time and no agent identity. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review follow-up. The trusted-actor list that decides a lift is read at the repository's default branch, never the pull request's base, so a retarget to a branch that adds the actor cannot widen who lifts; an unreadable default branch is no lift. Tests cover a same-second tie (the later removal decides), an unread default branch, a trusted id on a Bot account, and reading the list at a default branch other than the base. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…unread lifts A needs-human removal made through a GitHub App (performed_via_github_app) no longer counts as the person's lift, matching the package's rule for label provenance. A lift check that could not read the timeline or the default branch now reports why as liftUnread beside the added label. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis 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-review reviewed No blocking or advisory findings on head d65523d. I read the full diff and the PR context, then checked the new code against its helpers in What I checked:
No |
|
claude-security-review reviewed No security findings. critical-findings: 0 What I reviewed. All 5 changed files: the Why the lift looks sound:
Accepted residual risks (not findings):
No manifest, |
No related issue: found while tracing why needs-human came back on #9487 after a person removed it; no open issue tracks it.
Summary
The pr-merge lane put
needs-humanback on a pull request after a person removed it, at the same head and for the same reasons. On #9487 the lanes App escalated at 21:35:48Z withrisk:MED(evidence-unbound:claude-security-review: skip-not-no-change) at head1628ab628e94c61aef97aed6a9a9d0b8abfd35f1. kyle-sexton removed the label at 21:46:31Z and queued the PR at 21:51:39Z. At 21:54:32Z the pr-merge gate (run 40029253237, jobmerge, step "Run the merge gate on each candidate") added the label again and loggedriskEscalation: {"label": "added", "comment": "unchanged"}.ci-statusin merge-group run 40029788252 then failed on the label ("Removing the label approves this pull request; re-queue it to merge."), and the queue removed the PR.Cause:
escalate()inbabysit_merge.pytreated a missing label beside an unchanged escalation comment as a failed label write and retried it on every run. It could not tell a failed write from a person's removal. The pr-unblock-dispatch run that was active at the same time (40029993196) only loggedskip #9487: mergeable still UNKNOWN after 5 re-queriesand wrote nothing.Fix
escalate()now reads the PR timeline in one case only: the label is absent and the marker comment is unchanged. If the label's newest removal came after that comment last changed and was a person's, the label stays off and the run reportslabel: lifted. A person here is a User of kindhumanon the trusted-actor list read at the repository's default branch (never the head or a retargeted base; an unreadable default branch is no lift) who also passesmerge_policy.is_human: write or admin access, not the agent identity, not a self-login. A removal by the lanes App,github-actions[bot], an account off the list (a model-driven User with write access included) or anyone without write access lifts nothing.source-controlandpr-pipeline.Verification
python3 -m unittest discover -s tests -t .inplugins/source-control/skills/babysit-prs/scripts: 2706 tests, OK.test_babysit_merge_unattended.py:github-actions[bot], the agent identity or a read-only user, when it came before the comment's last change, when it removed another label, when the timeline read failed, after a failed label write (no removal), and for a new escalation.scripts/run-ruff.sh checkon both Python files: all checks passed.scripts/check-affected.sh: 12 passed, 1 skipped.check-affected.shlists, which run in CI.Related
report-escalation.sh(pr-unblock) is unchanged. By its documented contract, when a person removes the label to resume and the lane escalates again, the label comes back. Each such label follows a new lane run's decision; no sweep re-asserts an old escalation.clear-escalations.mjsonly removes labels, as the lanes App. That removal is a bot's, so it never counts as a lift.🤖 Generated with Claude Code