Repository navigation
feat(runtime): generation-fence Case status and terminal commits - #28
Merged
Merged
Conversation
Closed
19 tasks done
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.
Stale workers can currently change Case state after a newer generation returns the Case to the same status, and successful terminal commits leave a window before Job settlement in which an expired Job can be claimed into a new generation.
This change extends the T3 artifact fence to ordinary Case transitions, retry reset, successful terminal commits, and final failure. Successful terminal commits atomically persist Case, Resolution (when resolved), completion Event, and Job settlement, so settlement delay cannot advance a terminal Case's generation.
Fixes #22. Builds on #27; part of #17.
Changes
UpdateStatus,UpdateStatusIfCurrent, andUpdatePausedto persisted generation 0, with rejected/missing writes reported accurately. Legacy completion/status/failure Events also lock and check the persisted Case inside their insertion transaction, so a generation-0 input cannot bypass the positive-generation boundary.MEMORY_INDEXEDandINSUFFICIENT_EVIDENCEretain RunManager's successful Job classification.ErrCommitOutcomeUnknownwithout replay, failure compensation, or success publication.Validation
go test -race -p 1 -count=1 -json ./...with an isolated real MySQL 8.4 schema: all 52 packages with tests passed. Four real CodeRunner sandbox tests were skipped; MySQL tests ran.0a3d6a0). The fake now stores detached Run copies; a channel barrier makes the active-run assertion deterministic and waits for worker completion. Reintroducing pointer aliasing deterministically fails the test. The dataset package passed 100 repetitions with-race.db533deagainst real MySQL: all three legacy status writers, generation-0 completion/status/failure Events on generation 2, missing-row success reporting, and both historical success classifications. The fixes preserve the full rejected write set and include successful owned terminal and generation-0 compatibility controls. Existing ABA fixtures now use owned transitions/resets, controls use the atomic capability, and historical split-settlement fixtures are explicitly constructed through SQL.38007017814on review-fix HEAD01a1117passed all five gates, including real MySQL migration/runtime invariants and the full backend race suite.go vet ./..., Go formatting, andgit diff --checkpassed.No T5 retention/GC or T6 deployment gate changes are included.