Repository navigation
Take back a merge recorded through a prerequisite pull request - #3626
Merged
Merged
Conversation
A merged order whose only merge came through a linked prerequisite PR (P935: #3596, 33bd05c) could not change owner: MergedProblemOrder refuses transfer, and the check and run corrections keep the wrong merged state. CorrectMergedLinkTodo joins the CorrectOrderTodo family: the commander names the exact link and recorded merge commit, and the order is pending again under its own id, check, run, edits and times, with only that link removed. The correction contract now returns an OpenProblemOrder, so a correction may change the order's state instead of casting it to its own type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dR85kyFKcc2tQAJLhK
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
trissim
enabled auto-merge
October 30, 2026 00:41
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 30, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Before: P935 sits at
MergedProblemOrder(#3596, 33bd05c64)although its own edit 8 says #3596 was only the worker/parser prerequisite.AssignTodoto claude-nra is refused ("Only an undelivered order can change owner":Todo.assigned->ProblemOrder.require_reassignment->CheckedProblemOrder.require_transfer).CorrectCheckTodo/CorrectRunTodokeep the wrong merged state, andCorrectOrderTodo.corrected[Order](order: Order) -> Ordercould not express a state change at all.After:
CorrectMergedLinkTodojoins the existingCorrectOrderTodofamily (src/agent_comms/todos.py).previousis aMergedLink(link, sha): the exact linked PR plus the merge commit the order recorded.partreads it from the order (OpenProblemOrder.merged_linkrefuses an unmerged order;MergedProblemOrder.merged_linkrefuses an unlinked PR), so an absent link, a different link, a different merge or a stale Todo revision is refused before any write.replacedisMergedProblemOrder.unmerged(link):copy_as(PendingProblemOrder)with the same id, check, run, edits, scope and times, and only that link removed. Any other linked PR stays on the order, so the watcher reads its merge from the forge again (MergedProgress.foundneeds every linked PR merged); a real implementation merge is never dropped.OpenProblemOrder(CorrectOrderTodo.corrected/replaced,OpenProblemOrder.corrected), so the state change is typed, with no cast of the old type to itself.require_commander,require_open,OrderCorrectionReason). The removed merge is recorded in the order's existingcorrectionshistory.StoredOrderStory.archiveruns in the write but keys on order id, and the id is unchanged, so it adds no row. No new ledger, no new tool (it decodes throughcomms_todoaskind: correct_merged_link_todo), no reassignment permission for merged orders.Control (unrun, per order):
tests/test_holder_standing_rules.py::test_merge_through_a_prerequisite_link_is_taken_back_and_the_order_changes_owner. Real TodoStore: wrong merge with a prerequisite link and a real link; stale revision, different link, different merge and an unmerged order are all refused without writes; the correction keeps the real link and every other order field; thenTodoStore.assigngives P1 to the outsider under its actual goal, and both Goals are unchanged.Not in this PR: grouped P935+P872 assignment. The transaction group belongs to a different owner (
AssignTodo.group/TodoStore.apply_together), and no public entry exposes it for commands with different orders. Reported separately.🤖 Generated with Claude Code
https://claude.ai/code/session_01RnH6dR85kyFKcc2tQAJLhK