feat(workflow): resume a parked run from a chosen step

Each finished stage records the run's step results; a retry may name a resume
point, and the next attempt skips the steps before it with their results
loaded. A run with a repository resumes only on its pushed branch. The canvas
offers Resume/Re-run from here on parked runs.
This commit is contained in:
sam committed 2026-10-05 13:06:30 +11:00
1 parent 317d3782fa
commit 2d2cf28b2d
37 files changed
+606 -88

No files matched your search

@@ -35,6 +35,7 @@ type actionRequest struct {
Instructions string `json:"instructions,omitempty"`
Findings []string `json:"findings,omitempty"`
RetryMode taskstate.RetryMode `json:"retry_mode,omitempty"`
ResumeFrom string `json:"resume_from,omitempty"`
}
type actorPayload struct {
@@ -120,6 +121,7 @@ func Register(nc *nats.Conn, service taskactions.Service, log *slog.Logger) (fun
Instructions: req.Instructions,
Findings: req.Findings,
RetryMode: req.RetryMode,
ResumeFrom: req.ResumeFrom,
})
natsrpc.Respond(msg, log, "taskactions", actionResponse{
Envelope: natsrpc.NewEnvelope(err),
@@ -153,6 +155,7 @@ func (c Client) ApplyChatTaskAction(ctx context.Context, scope *string, actor ta
Instructions: res.Instructions,
Findings: res.Findings,
RetryMode: res.RetryMode,
ResumeFrom: res.ResumeFrom,
Actor: &actorPayload{
ID: string(actor.Identity),
Kind: string(actor.Kind),
+4 -1
View File
@@ -8,6 +8,7 @@ import (
"github.com/samcharles93/archie-core/internal/config"
"github.com/samcharles93/archie-core/internal/domain/storecontract"
"github.com/samcharles93/archie-core/internal/domain/taskactions"
"github.com/samcharles93/archie-core/internal/domain/workflow"
)
type Store struct{ storecontract.TaskStore }
@@ -17,7 +18,9 @@ func (s Store) TaskByID(ctx context.Context, id int64) (*taskactions.Task, error
if err != nil || t == nil {
return nil, err
}
return &taskactions.Task{ID: t.ID, Owner: t.Owner, Repo: t.Repo, Identity: t.Identity, Status: t.Status, ParkReason: t.ParkReason, IssueNumber: t.IssueNumber, RetryCount: t.RetryCount, Attempt: t.Attempt, Branch: t.Branch, RetryMode: t.RetryMode, ForgeBacked: t.IsForgeBacked(), ReviewGate: t.ReviewGate, RereviewRounds: t.RereviewRounds}, nil
// A pinned definition that no longer parses offers no resume points.
stages, _ := workflow.StageNames(t.WorkflowDefinitionYAML)
return &taskactions.Task{ID: t.ID, Owner: t.Owner, Repo: t.Repo, Identity: t.Identity, Status: t.Status, ParkReason: t.ParkReason, IssueNumber: t.IssueNumber, RetryCount: t.RetryCount, Attempt: t.Attempt, Branch: t.Branch, RetryMode: t.RetryMode, ForgeBacked: t.IsForgeBacked(), ReviewGate: t.ReviewGate, RereviewRounds: t.RereviewRounds, Stages: stages}, nil
}
// CancelExecution delegates to the store.