Skip to content

Release retained goal waits across concurrent goal edits - #2697

Merged
3 commits merged into
mainfrom
next/retained-wait-release
Oct 23, 2026
Merged

3 commits merged into
mainfrom
next/retained-wait-release

Conversation

@trissim

@trissim trissim commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

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.

@trissim
trissim marked this pull request as ready for review October 23, 2026 08:50
Copilot AI balanced review requested due to automatic review settings October 23, 2026 08:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants