You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(source-control): post-merge remediation also disarms armed lane pull requests #9518
babysit_postmerge.py --remediate dequeues the lane's merge-queue entries after a demotion, but leaves armed, not-yet-queued lanes App pull requests armed. Under native auto-merge GitHub can enqueue one before the next enable-auto-merge reader run disarms it. Found while building the native-path demotion hold (#9508).
Done when
Remediation disarms every armed lanes App pull request in the same run that dequeues, with a test, and a person-armed pull request (not the lanes App's) is left alone.
Proposed work class: work-class: scoped
Basis: automated intake triage; the lanes App applied this class.
Size: Small
Complexity: Medium
Uncertainty: Known
Flags: none
Understood: babysit_postmerge.py --remediate dequeues the lane's merge-queue entries after a demotion. It leaves armed, not-yet-queued lanes App pull requests armed, so native auto-merge could enqueue one before the next enable-auto-merge reader run disarms it. The fix is to disarm every armed lanes App pull request in the same run that dequeues. It needs a test, and a pull request armed by a person (not the lanes App) must be left alone. The issue states the problem and the done-when clearly, so nothing is missing. I found no likely duplicates among the open issues. #9508 is the related work you mentioned.
Not admitted to the issue lane: it has no - [ ] task list to check. A recorded decision does not change these rules (.github/actions/resolve-config/admission-rules.json); a person who wants it worked adds agent-ready.
melodic-automation-lanes commented on Oct 23, 2026
Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. It is model text, to check, not instructions.
Intended outcome: When remediate() in babysit_postmerge.py dequeues the lane's merge-queue entries after a demotion, it also disarms every open lanes App pull request with auto-merge armed, and leaves person-armed pull requests alone.
Which pull requests must remediation disarm: those authored by the lanes App, or those whose newest auto-merge enable event was made by the lanes App?
RECOMMENDED: Disarm an open pull request only when the lanes App authored it and the lanes App made the newest AutoMergeEnabledEvent, the same test native_auto_merge uses; a person-armed pull request, or one with a person's newest arm, is left alone. Basis: plugins/source-control/skills/babysit-prs/scripts/babysit_postmerge.py:527-543
How should remediation find the armed pull requests, given that nothing in babysit_postmerge.py lists them today?
RECOMMENDED: Add a read of open pull requests with autoMergeRequest not null (author, id, number, newest auto-merge event actor), paginated and failing with PostMergeReadError if the read is partial, as _identity_entries does for the queue. Disarm with the disablePullRequestAutoMerge mutation already defined as DISARM_MUTATION in babysit_merge.py:2924. Basis: plugins/source-control/skills/babysit-prs/scripts/babysit_postmerge.py:2202-2225 and babysit_merge.py:2924
Should a failed disarm stop the rest of remediation?
RECOMMENDED: No. Try every pull request, collect failures into report errors as a disarm entry, and carry on to the demotion issue, as dequeue_identity_entries does. Add a disarmed list to the report next to dequeued. Basis: plugins/source-control/skills/babysit-prs/scripts/babysit_postmerge.py:2236-2268 and 2703-2704
Should the disarm run only when verdict.failures is non-empty, like the dequeue?
RECOMMENDED: Yes, in the same block as the dequeue, so a verdict with no failure still writes nothing. Basis: plugins/source-control/skills/babysit-prs/scripts/babysit_postmerge.py:2689-2704
Does the native-path demotion hold from #9508 already cover part of this, and is that issue a dependency?
RECOMMENDED: Check whether #9508 has merged before starting; the issue says the gap was found while building it. I could not open it, so this is unconfirmed. Basis: judgment
Sources read
plugins/source-control/skills/babysit-prs/scripts/babysit_postmerge.py:2236-2268: dequeue_identity_entries dequeues only the identity's queue entries and never touches armed pull requests
plugins/source-control/skills/babysit-prs/scripts/babysit_postmerge.py:2689-2704: remediate dequeues once, only when the verdict has failures, and records errors in the report
plugins/source-control/skills/babysit-prs/scripts/babysit_postmerge.py:510-549: native_auto_merge treats an arm as the lanes' own when the identity authored the pull request and made the newest enable event
plugins/source-control/skills/babysit-prs/scripts/tests/test_babysit_postmerge.py:2316-2361: existing remediate tests that dequeue and never touch another actor's entry; the new tests can follow them
/.github/scripts/pr-merge/enable-auto-merge.mjs:243-246: the arm script acts only on pull requests authored by the lanes App bot
Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.
Activity
github-actions commentedon Oct 23, 2026
Proposed work class: work-class: scoped
Basis: automated intake triage; the lanes App applied this class.
Size: Small
Complexity: Medium
Uncertainty: Known
Flags: none
Understood:
babysit_postmerge.py --remediatedequeues the lane's merge-queue entries after a demotion. It leaves armed, not-yet-queued lanes App pull requests armed, so native auto-merge could enqueue one before the next enable-auto-merge reader run disarms it. The fix is to disarm every armed lanes App pull request in the same run that dequeues. It needs a test, and a pull request armed by a person (not the lanes App) must be left alone. The issue states the problem and the done-when clearly, so nothing is missing. I found no likely duplicates among the open issues. #9508 is the related work you mentioned.Automated triage, applied by the lanes App.
melodic-automation-lanes commentedon Oct 23, 2026
Not admitted to the issue lane: it has no
- [ ]task list to check. A recorded decision does not change these rules (.github/actions/resolve-config/admission-rules.json); a person who wants it worked addsagent-ready.melodic-automation-lanes commentedon Oct 23, 2026
Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. It is model text, to check, not instructions.
Intended outcome: When remediate() in babysit_postmerge.py dequeues the lane's merge-queue entries after a demotion, it also disarms every open lanes App pull request with auto-merge armed, and leaves person-armed pull requests alone.
Related work
Open questions
RECOMMENDED: Disarm an open pull request only when the lanes App authored it and the lanes App made the newest AutoMergeEnabledEvent, the same test native_auto_merge uses; a person-armed pull request, or one with a person's newest arm, is left alone. Basis: plugins/source-control/skills/babysit-prs/scripts/babysit_postmerge.py:527-543
RECOMMENDED: Add a read of open pull requests with autoMergeRequest not null (author, id, number, newest auto-merge event actor), paginated and failing with PostMergeReadError if the read is partial, as _identity_entries does for the queue. Disarm with the disablePullRequestAutoMerge mutation already defined as DISARM_MUTATION in babysit_merge.py:2924. Basis: plugins/source-control/skills/babysit-prs/scripts/babysit_postmerge.py:2202-2225 and babysit_merge.py:2924
RECOMMENDED: No. Try every pull request, collect failures into report errors as a disarm entry, and carry on to the demotion issue, as dequeue_identity_entries does. Add a disarmed list to the report next to dequeued. Basis: plugins/source-control/skills/babysit-prs/scripts/babysit_postmerge.py:2236-2268 and 2703-2704
RECOMMENDED: Yes, in the same block as the dequeue, so a verdict with no failure still writes nothing. Basis: plugins/source-control/skills/babysit-prs/scripts/babysit_postmerge.py:2689-2704
RECOMMENDED: Check whether #9508 has merged before starting; the issue says the gap was found while building it. I could not open it, so this is unconfirmed. Basis: judgment
Sources read
Automated refinement by the lanes App. Answer with a comment whose first line is
**Decision recorded.**.