Repository navigation
Release retained goal waits across concurrent goal edits - #2697
Merged
3 commits merged intoOct 23, 2026
Merged
3 commits merged into
3 commits merged into
Conversation
trissim
marked this pull request as ready for review
October 23, 2026 08:50
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
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.
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.
A progress/text edit between the reply read and publication could strand a retained wait: GoalWaitReview compared whole goals despite RecordedGoalWait.current_for explicitly accepting later revisions. GoalWaitReview now uses that existing active-goal/wait rule (goal_waits.py:283); GoalInputReview keeps exact prepared-goal equality (goal_waits.py:354).
The existing publishing_unanswered loop also recaptures the same incarnation and exact wait after an owner/turn fence changes, then rereads replies outside EX (goal_waits.py:317). A replacement wait or inactive/replaced goal ends the operation. The terminal caller rechecks its original completion fence and current dependency activity under EX. No generic retry layer, store or revision veto is added. Release publication already builds progress and the next revision from the actual current goal (goal_management.py:344); completed-reply consumption now also resolves its continuation goal at commit (goal_management.py:408).
Twelve new real race cases in tests/test_goal_reply_lock_scope.py:374, :399, :408 and :420 cover terminal release and closed recovery after retained goal edits, owner title edits or an unrelated status change; exact-wait preservation during the intervening edit; latest progress/revision preservation; completed reply consumption across goal edits; superseding dependency turns; and fresh observation after an intervening waiter turn. The release controls call the entrypoint once. Existing stale-input-review, replacement-wait, incarnation and reply-after-snapshot controls stay in place. The integrator executes the touched test file once with the batch.
Changes: goal_waits.py, goal_management.py, tests/test_goal_reply_lock_scope.py. Fresh branch from a6a44e7 because #2638 already merged. 132 added, 10 deleted. Source relationships traced from existing NRA owner/consumer evidence and current callers; no new census. Lexical evidence does not resolve arbitrary dynamic binding.
Assumed: retained waits keep their existing goal-ID/minimum-revision contract; a new wait identity or superseding dependency turn invalidates the old observation.
At e4ddafa, RegistryOwner._require_current also converts a vanished captured turn record into StaleFence, preserving the cause. The local file run on the previous head returned35 passed/1 failed; the failure was that missing-record error before this fix. No test run followed the fix. The remaining batch run belongs to the integrator. MI #2646 renames a keyword in this same method; preserve its claim_generation spelling alongside this exception change.