feat: add durable safe retries with uncertainty tracking and SDK examples

This commit is contained in:
2026-09-17 15:43:44 +08:00
parent 9e3d4be5cc
commit d65cf96ea7
44 changed files with 1300 additions and 77 deletions

View File

@@ -22,9 +22,9 @@ func (s TaskState) Terminal() bool {
func (s TaskState) CanTransitionTo(next TaskState) bool {
switch s {
case TaskWaiting:
return next == TaskLeased || next == TaskCancelled || next == TaskFailed
return next == TaskLeased || next == TaskCancelled || next == TaskFailed || next == TaskNeedsReview
case TaskLeased:
return next == TaskRunning || next == TaskWaiting || next == TaskCancelled || next == TaskFailed
return next == TaskRunning || next == TaskWaiting || next == TaskCancelled || next == TaskFailed || next == TaskNeedsReview
case TaskRunning:
return next == TaskSucceeded || next == TaskWaiting || next == TaskFailed || next == TaskNeedsReview || next == TaskCancelled
case TaskNeedsReview: