fix(gatedrive): scope-transferred refusal ends false BLOCKED after parent claims a WAITING drive (change 0459) - #337
Merged
danielhanold merged 9 commits intoSep 26, 2026
Conversation
Docket-Plan-Path: docs/superpowers/plans/2026-09-26-worker-s-gate-drive-acknowledge-is-refused-scope-closed-afte.md
…sferred (change 0459)
…ansferred (change 0459)
…om its message (change 0459)
…is never acknowledged or reused (change 0459)
…ility-first scoped start (change 0459) Review fixes: - Finding 1: closeScopeFinal's already-closed branch returned ErrScopeClosed even when the worker's own acknowledge lost the race to a claim/takeover between retirePredecessor and closeScopeFinal (Closed && !FinalAcked), so the refusal falsely said the scope was finished by its terminal acknowledgement. It now returns ErrScopeTransferred for !FinalAcked and keeps ErrScopeClosed for FinalAcked; ownership.go/acknowledge.go doc comments updated accordingly. - Finding 3: precheckScopedStart checked scope.Closed before the child capability, unlike Acknowledge and scopeReserveRefusal, so a wrong-capability caller learned transferred-vs-finished. The capability check now runs first. TestTransferredScopeRefusalOrdering gains a wrong-capability scoped-start case and a closeScopeFinal-on-claim-closed-scope case.
…akeover (change 0459)
danielhanold
force-pushed
the
fix/worker-s-gate-drive-acknowledge-is-refused-scope-closed-afte
branch
from
September 26, 2026 15:13
91742d9 to
a15203f
Compare
danielhanold
deleted the
fix/worker-s-gate-drive-acknowledge-is-refused-scope-closed-afte
branch
September 26, 2026 15:14
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.
Summary
Fixes a false
BLOCKEDfrom a build worker after its parent claims the worker's handed-off (WAITING) test drive. The claim closes the worker's scope, as it should. The worker's acknowledge was then refusedscope-closed, and that refusal told the worker to returnBLOCKED.scope-transferred. Acknowledge, a scoped start, or a scope reservation with the child capability on a scope closed by a claim or takeover (Closed && !FinalAcked) now returns it. Its message names the real state and never says BLOCKED. AFinalAckedscope still returnsscope-closed. Parent-side takeover and bind-scope-change are unchanged.docket-build-task): a handed-off worker never acknowledges or reuses its original scope. It reports on the continuation's verdict and runs further tests only under a fresh scope.docket-build): the continuation carries the drive id, the verdict, a "scope closed" statement, and a fresh scope bundle when more drives may be needed.Departure from spec: some existing child-side takeover and claim assertions were flipped to
scope-transferred. Under the spec's own rule that is the right result. The parent takeover HALT staysscope-closed.Review (docket-review-standard)
takeoverClosecommand: go run ./cmd/docket development test
result: green
head_sha: a15203f
ran_at: 2026-09-26T15:13:15Z