fix(work-graph): preserve scheduled task evaluation revision
CI / test (push) Successful in 50s
CI / test (pull_request) Successful in 49s

This commit is contained in:
m
2026-08-23 20:58:50 +03:00
parent 1f5569db15
commit aeafc6e0ac
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -218,7 +218,11 @@ func AdmitAndScheduleTaskEvaluation(ctx context.Context, store ports.GraphStore,
intents[i].TaskEvaluationProfile = &profile
}
intents[i].TaskEvaluationCases = append([]capability.TaskEvaluationCase(nil), node.TaskCases...)
intents[i].TaskEvaluationExecution = &work.TaskEvaluationDispatchContext{GraphID: graph.ID, GraphRevision: graph.Revision, NodeID: node.ID, BindingRevision: request.Plan.BindingRevision, ActorID: identity.ActorID(request.Plan.ActorID), PrincipalID: identity.PrincipalID(request.Plan.PrincipalID), ScopeID: authority.ScopeID(request.Plan.ScopeID)}
// AdmitAndSchedule increments the draft revision before persisting
// the leased node. The callback must target that scheduled revision;
// using the draft revision would save a completed copy that loses to
// the already-persisted immutable scheduled revision.
intents[i].TaskEvaluationExecution = &work.TaskEvaluationDispatchContext{GraphID: graph.ID, GraphRevision: graph.Revision + 1, NodeID: node.ID, BindingRevision: request.Plan.BindingRevision, ActorID: identity.ActorID(request.Plan.ActorID), PrincipalID: identity.PrincipalID(request.Plan.PrincipalID), ScopeID: authority.ScopeID(request.Plan.ScopeID)}
break
}
}