Repository navigation
Conversation
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.
Problem
A scheduled SOP scan only persisted its dispatched Run links when the entire scan finished. If a later dispatch blocked and the process restarted, already-started downstream runs could lose their link to the scheduled execution.
Change
Checkpoint the existing execution's Run links and pulled/dispatched counts after every successful dispatch, before starting the next item. If that checkpoint fails, stop further dispatches and try to save a failed terminal record with the already-started run's evidence. User-facing errors stay generic; storage details remain in scheduler logs.
Related to #460. This is one bounded backend slice; it does not close the broader outcome-attribution issue or duplicate #1123's token-usage work. A dispatch is not counted as a delivered business outcome.
Validation
internal/scheduletests passed in Linux/amd64 Docker using a cross-compiled Go 1.26.11 test binary, including the three new regressions. The original two regressions failed on the unmodified implementation before the fix.GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go vet ./internal/schedulepassed.python scripts/check-public.pyandgit diff --checkpassed.Compatibility and remaining scope
No schema, API, permission, or runner-protocol changes. The downstream dispatch and its checkpoint are not one atomic transaction: a crash between dispatch success and checkpoint commit can still lose that last link. Recovery reconciliation, durable long-term retention, and structured business-outcome reporting remain follow-up work under #460. A failed checkpoint does not cancel or change the status of a downstream SOP that already started.