feat(work): schedule task evaluation through work graph
CI / test (push) Failing after 47s
CI / test (pull_request) Failing after 39s

This commit is contained in:
m
2026-08-23 12:07:06 +03:00
parent a82592a130
commit a99f48e615
6 changed files with 208 additions and 11 deletions
+18
View File
@@ -18,6 +18,12 @@ type GraphScheduleRequest struct {
Now int64 `json:"now_unix_millis"`
}
type TaskEvaluationScheduleRequest struct {
Plan work.TaskEvaluationGraphRequest `json:"plan"`
Intents []work.AgentDispatchIntent `json:"intents"`
Now int64 `json:"now_unix_millis"`
}
type GraphCompleteRequest struct {
GraphID string `json:"graph_id"`
Revision int64 `json:"revision"`
@@ -105,6 +111,18 @@ func AdmitAndSchedule(ctx context.Context, store ports.GraphStore, request Graph
return next, ready, nil
}
// AdmitAndScheduleTaskEvaluation creates the durable general-first or
// bounded-expansion fan-out before handing it to the existing graph scheduler.
// The request path only persists/enqueues work; specialist execution happens
// independently through the dispatch workers.
func AdmitAndScheduleTaskEvaluation(ctx context.Context, store ports.GraphStore, request TaskEvaluationScheduleRequest) (work.WorkGraph, []work.GraphNodeID, error) {
graph, err := domain.BuildTaskEvaluationGraph(request.Plan)
if err != nil {
return work.WorkGraph{}, nil, err
}
return AdmitAndSchedule(ctx, store, GraphScheduleRequest{Graph: graph, Intents: request.Intents, Now: request.Now})
}
func CompleteGraphNode(ctx context.Context, store ports.GraphStore, graphID string, revision int64, nodeID work.GraphNodeID, success bool) (work.WorkGraph, error) {
graph, err := store.LoadWorkGraph(ctx, graphID, revision)
if err != nil {