-
Notifications
You must be signed in to change notification settings - Fork 0
fix(scheduler): revalidate live merge lifecycle #2006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
seonghobae
wants to merge
10
commits into
fix/scheduler-skip-central-target-inventory
Choose a base branch
from
fix/scheduler-draft-merge-mutation-guard
base: fix/scheduler-skip-central-target-inventory
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2d140a8
test(scheduler): reproduce draft merge mutation reachability
seonghobae 5abc0a0
fix(scheduler): reject draft merge mutations
seonghobae 597437c
Merge updated scheduler stack parent into #2006
seonghobae 8e7d76f
test(scheduler): inherit proven credential fixtures
seonghobae fb552da
Merge updated #2005 scheduler test contract into #2006
seonghobae 1fbcc50
Merge #2005 inventory-boundary repair into #2006 lifecycle guard
seonghobae 897c7e6
test(scheduler): reproduce live draft merge race
seonghobae c60a8e0
fix(scheduler): revalidate live merge lifecycle
seonghobae d739e0d
docs(scheduler): bind lifecycle evidence to remote RED
seonghobae 7692865
merge(scheduler): restack lifecycle guard on current inventory boundary
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Draft merge mutation boundary | ||
|
|
||
| Decision date: **2026-09-07** | ||
|
|
||
| ## Problem | ||
|
|
||
| The scheduler normally excludes Draft pull requests during inspection. A PR can | ||
| change lifecycle state after that decision, or another caller can invoke the | ||
| mutation helper directly. Without a second guard, direct merge or auto-merge | ||
| could proceed from stale Ready-state authority. | ||
|
|
||
| ## Decision | ||
|
|
||
| `enable_auto_merge` and `merge_pr` retain their cheap caller-snapshot Draft | ||
| guard. After dry-run handling and mutation-actor validation, both now call one | ||
| shared boundary that reuses the existing direct REST authority read. That read | ||
| must prove the same repository and PR number remain open, expose an explicit | ||
| Draft value of `false`, and retain the expected exact head. Missing, malformed, | ||
| closed, Draft, or moved-head evidence fails closed before `gh pr merge`. | ||
|
|
||
| This boundary is intentionally inside both mutation entrypoints. The earlier | ||
| `inspect_pr` approval revalidation remains useful, but cannot protect a direct | ||
| caller or a lifecycle transition occurring after that decision-level check. | ||
| `--match-head-commit` remains the final GitHub head guard; it does not replace | ||
| the live Draft-state check. | ||
|
|
||
| ## Failure scenes | ||
|
|
||
| - A Ready snapshot becomes Draft on the same head: mutation is refused. | ||
| - The PR closes, becomes unavailable, or returns malformed authority: mutation | ||
| is refused. | ||
| - The head changes after inspection: mutation is refused before GitHub CLI. | ||
| - A direct helper call supplies a Draft PR: no GitHub command is executed. | ||
| - A freshly open, non-Draft PR on the expected head follows the existing | ||
| guarded merge flow unchanged. | ||
|
|
||
| ## Evidence and follow-up | ||
|
|
||
| The original RED `2d140a84203a0df0cb86cd6b6ab31fc37bbdbda2` | ||
| covered only an already-Draft caller snapshot. Corrective RED | ||
| `897c7e6505a4c5dc203471109e425996f91fb9c9` covers | ||
| both mutation entrypoints across same-head Ready→Draft, moved-head, missing-PR, | ||
| and exact-ready cases. The focused scheduler suite passes locally under | ||
| `GITHUB_ACTIONS=true` and `-W error`; fresh exact-head hosted checks and | ||
| independent review remain required. | ||
|
|
||
| ## Reference | ||
|
|
||
| GitHub. (2026). *Pull requests and draft pull requests*. | ||
| https://docs.github.com/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.