fix(worker): fence work after queue claim loss - #301
Merged
Joncallim merged 28 commits intoJul 29, 2026
Merged
Conversation
…rovider-snapshot fix(worker): persist Architect provider snapshots
…ested-fence fix(worker): fence nested handoff mutations after claim loss
Joncallim
marked this pull request as ready for review
July 29, 2026 17:22
Joncallim
merged commit Jul 29, 2026
b20c23b
into
codex/pr198-producer-5a2-r3b-claim-renewal
4 checks passed
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.
Source Issue
Issue: #179
Summary
This stacked child makes definitive queue-claim loss an explicit cancellation and ownership fence. Once Redis reports
stale_not_owner, the old worker aborts in-flight Architect generation and cannot persist task, attempt, artifact, question, work-package, checkpoint, event, or terminal queue mutations.Key points:
ClaimLeaseFencewith a typed, non-disclosing loss error and AbortSignal;startTaskAttempt, from misreporting lease loss as persistence/business failure;Evidence
QUEUE_OCCURRENCE_REDIS_MULTIPLICITY_OK,QUEUE_OCCURRENCE_REDIS_RECOVERY_OK, andQUEUE_OCCURRENCE_REDIS_SHUTDOWN_OK--noEmit: passedgit diff --check: passedstale_not_owneras renewed failed two fence tests; removing the post-business ownership assertion failed the source contract testThe local Next build compiled successfully through webpack, then stopped on the parent branch's existing invalid Page export
unresolvedRequiredFilesystemGrantsinapp/dashboard/tasks/[id]/page.tsx. That file is unchanged in this child. A standard Turbopack build could not run from the isolated worktree because its untracked dependency symlink points outside the Turbopack filesystem root.Scope note
web/worker/workforce-materializer.tsis included because materialization performs awaited reads inside a transaction before writing packages and approval gates. The optional synchronous ownership callback makes those boundaries rollback safely without changing non-queue callers.Remaining work
The bounded transient-renewal outage policy remains a separate R3C slice. This draft does not merge or resolve the parent review finding.