refactor(workflow): stop assuming a human decides

An approval, ask or park can be resolved by an operator, a rule, a
classifier or automatically, so the vocabulary stops naming a person:

- step type human.approve -> workflow.approve
- park class needs_human -> needs_decision (ParkNeedsDecision)
- event kinds human_* -> operator_*
- alert kind task.needs_human -> task.needs_decision
- status grouping "needs you" -> "needs attention"

0061 rewrites the stored values, including the approval step type in the
workflow-definitions resource and each task's pinned definition, with the
digest recomputed so resumed tasks still match.
This commit is contained in:
sam committed 2026-10-25 17:31:16 +11:00
1 parent fc609171ca
commit f2b8681611
76 files changed
+373 -329

No files matched your search

+11 -11
View File
@@ -108,7 +108,7 @@ func CheckApprove(status string) error {
// Approval kinds: what a task in WaitingApproval asks the operator to decide.
const (
// ApprovalPlan is a plan from a human.approve step, read as task.plan.
// ApprovalPlan is a plan from a workflow.approve step, read as task.plan.
ApprovalPlan = "plan"
// ApprovalReview is a review gate's findings.
ApprovalReview = "review"
@@ -203,10 +203,10 @@ func CheckDecline(status string) error {
// source for the dashboard's label, pill severity and "needs you" grouping, so
// the frontend never has to keep a hand-synced copy of the vocabulary.
type StatusMeta struct {
ID string `json:"id"`
Label string `json:"label"`
Kind string `json:"kind"` // pill severity: idle, info, ok, warn, danger
NeedsYou bool `json:"needs_you"` // counts toward the "Needs you" filter
ID string `json:"id"`
Label string `json:"label"`
Kind string `json:"kind"` // pill severity: idle, info, ok, warn, danger
NeedsAttention bool `json:"needs_attention"` // counts toward the "Needs attention" filter
}
// ActionMeta describes how to present an operator control. Confirmation text
@@ -224,11 +224,11 @@ func Statuses() []StatusMeta {
return []StatusMeta{
{ID: Queued, Label: "Queued", Kind: "idle"},
{ID: Running, Label: "Running", Kind: "info"},
{ID: WaitingApproval, Label: "Waiting for approval", Kind: "warn", NeedsYou: true},
{ID: WaitingApproval, Label: "Waiting for approval", Kind: "warn", NeedsAttention: true},
{ID: PROpen, Label: "In review", Kind: "ok"},
{ID: Merged, Label: "Merged", Kind: "ok"},
{ID: Completed, Label: "Done", Kind: "ok"},
{ID: Parked, Label: "Parked", Kind: "warn", NeedsYou: true},
{ID: Parked, Label: "Parked", Kind: "warn", NeedsAttention: true},
{ID: Dead, Label: "Stopped: retry cap", Kind: "danger"},
{ID: Rejected, Label: "Rejected", Kind: "danger"},
{ID: Declined, Label: "Won't do", Kind: "idle"},
@@ -258,10 +258,10 @@ func ActionCatalog() []ActionMeta {
// known, and is never inferred later from reason text. It is part of the
// on-disk format.
const (
// ParkNeedsHuman parks need an operator decision: gate failures,
// ParkNeedsDecision parks need an operator decision: gate failures,
// review verdicts, diff caps, remediation round caps. It is the
// default, so an unclassified park always reads as operator-actionable.
ParkNeedsHuman ParkClass = "needs_human"
ParkNeedsDecision ParkClass = "needs_decision"
// ParkTransient parks are environmental: storage, container pool,
// grants, transport. Nothing about the work is wrong; a requeue can
// succeed. Nothing retries them automatically yet -- the class is
@@ -297,13 +297,13 @@ type Blocker = string
type ParkClass = string
// NormalizeParkClass maps a park class written by a producer to the value
// the store persists. Empty and unknown fall back to NeedsHuman: the safe
// the store persists. Empty and unknown fall back to NeedsDecision: the safe
// misread is "an operator should look at this", never "nothing to do".
func NormalizeParkClass(class string) ParkClass {
switch class {
case ParkTransient, ParkTerminal:
return class
default:
return ParkNeedsHuman
return ParkNeedsDecision
}
}