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

+1 -1
View File
@@ -1,4 +1,4 @@
/** Operator alerts as the dashboard reads them: what needs a human, by severity. */
/** Operator alerts as the dashboard reads them: what needs attention, by severity. */
export type AlertSeverity = "action" | "warning" | "info";
@@ -117,7 +117,7 @@ onUnmounted(() => document.removeEventListener("keydown", onGlobalKeydown));
</CommandGroup>
<CommandGroup heading="Views">
<CommandItem value="Tasks in progress" @select="go('/tasks?status=running')">Tasks in progress</CommandItem>
<CommandItem value="Tasks needing attention" @select="go('/tasks?status=needs_you')">Tasks needing attention</CommandItem>
<CommandItem value="Tasks needing attention" @select="go('/tasks?status=needs_attention')">Tasks needing attention</CommandItem>
</CommandGroup>
<CommandGroup heading="Pages">
<CommandItem
+1 -1
View File
@@ -18,7 +18,7 @@ export const buttonVariants = cva(
destructive:
"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",
link: "text-primary underline-offset-4 hover:underline",
// An action that exists because something needs a human has to look
// An action that exists because something needs attention has to look
// unlike one that is always present. `destructive` would overstate it:
// nothing is broken, it is waiting.
attention:
+2 -2
View File
@@ -5,7 +5,7 @@ import { computed } from "vue";
import { useTasksStore } from "@/stores/tasks";
import LiveActivityCard from "./LiveActivityCard.vue";
import NeedsYouCard from "./NeedsYouCard.vue";
import NeedsAttentionCard from "./NeedsAttentionCard.vue";
import QuickTask from "./QuickTask.vue";
import SetupPanel from "./SetupPanel.vue";
import { setupPanelState } from "./setup-preference";
@@ -25,7 +25,7 @@ const setupIncomplete = computed(() => setupPanelState(setup.value).kind === "in
<div :class="setupIncomplete ? 'grid items-start gap-4 lg:grid-cols-[minmax(0,1fr)_320px]' : 'mx-auto max-w-5xl'">
<div class="grid min-w-0 gap-4">
<QuickTask />
<NeedsYouCard />
<NeedsAttentionCard />
<LiveActivityCard v-if="summary" />
</div>
<SetupPanel v-if="setupIncomplete" class="max-lg:-order-1" />
@@ -13,7 +13,7 @@ import { useTasksStore } from "@/stores/tasks";
const { tasks } = storeToRefs(useTasksStore());
const loadDashboard = useTasksStore().load;
/** Tasks waiting on a human, each with the reason and the next action. */
/** Tasks needing attention, each with the reason and the next action. */
type AttentionTask = Task & { park_reason?: string; plan?: string };
const waiting = computed(() => {
@@ -30,7 +30,7 @@ function meta(task: AttentionTask): string {
<template>
<Section v-if="waiting.length" title="Needs attention" class="mb-0">
<template #action>
<Button variant="ghost" size="sm" as-child><RouterLink to="/tasks?status=needs_you">All tasks</RouterLink></Button>
<Button variant="ghost" size="sm" as-child><RouterLink to="/tasks?status=needs_attention">All tasks</RouterLink></Button>
</template>
<ul class="divide-y divide-border">
<li v-for="task in waiting" :key="task.id" class="flex flex-wrap items-center gap-3 py-2">
+3 -3
View File
@@ -7,7 +7,7 @@ export interface StatusMeta {
id: string;
label: string;
kind: string;
needs_you?: boolean;
needs_attention?: boolean;
}
/** An operator control as the server describes it. */
@@ -40,12 +40,12 @@ export const DEFAULT_STATUSES: StatusMeta[] = [
id: "waiting_approval",
label: "Waiting for approval",
kind: "warn",
needs_you: true,
needs_attention: true,
},
{ id: "pr_open", label: "In review", kind: "ok" },
{ id: "merged", label: "Merged", kind: "ok" },
{ id: "completed", label: "Done", kind: "ok" },
{ id: "parked", label: "Parked", kind: "warn", needs_you: true },
{ id: "parked", label: "Parked", kind: "warn", needs_attention: true },
{ id: "dead", label: "Stopped: retry cap", kind: "danger" },
{ id: "rejected", label: "Rejected", kind: "danger" },
{ id: "closed_wont_do", label: "Won't do", kind: "idle" },
+2 -2
View File
@@ -100,10 +100,10 @@ export function statusIds(): string[] {
/**
* attentionStatusIds is the set of statuses that count toward the "Needs you"
* filter (work that is waiting on a human).
* filter (work that needs attention).
*/
export function attentionStatusIds(): Set<string> {
return new Set(statuses.value.filter((s) => s.needs_you).map((s) => s.id));
return new Set(statuses.value.filter((s) => s.needs_attention).map((s) => s.id));
}
/**
+1 -1
View File
@@ -43,7 +43,7 @@
// can invoke its own tools with `executeTool`, so an agent's call and a page
// script's call reach the server identically. A durable record can honestly
// say only that the actor was the signed-in identity and the source was
// webmcp -- a hint, not proof -- and must never claim a human approved. Real
// webmcp -- a hint, not proof -- and must never claim someone approved. Real
// agent attribution needs the agent to authenticate with its own credential,
// which is the A2A work where an agent is an Identity.
//
+3 -3
View File
@@ -27,9 +27,9 @@ const taskKinds = new Set([
"step_retried",
"review_approved",
"remediation_round",
"human_approved",
"human_rejected",
"human_rereviewed",
"operator_approved",
"operator_rejected",
"operator_rereviewed",
"agent_approved",
"agent_rejected",
"agent_rereviewed",
+1 -1
View File
@@ -59,7 +59,7 @@ function selectStatus(value: unknown) {
<SelectContent>
<SelectGroup>
<SelectItem :value="ALL_STATUSES">All statuses</SelectItem>
<SelectItem value="needs_you">Needs attention</SelectItem>
<SelectItem value="needs_attention">Needs attention</SelectItem>
<SelectItem
v-for="entry in statusList()"
:key="entry.id"
+1 -1
View File
@@ -33,7 +33,7 @@ const columns = computed<DataTableColumn<Task>[]>(() => [
]);
const parkClassLabels: Record<string, string> = {
needs_human: "needs attention",
needs_decision: "needs attention",
transient: "transient",
terminal: "terminal",
};
+3 -3
View File
@@ -16,11 +16,11 @@ import type { StatusMeta } from "@/lib/task-meta";
// The vocabulary is the server catalog, not a hand-synced copy: the set of
// known statuses comes straight from what the server serves, so a status added
// on the backend shows up here without a frontend change. "needs_you" is a UI
// pseudo-status (work waiting on a human), so it is prepended rather than
// on the backend shows up here without a frontend change. "needs_attention" is a UI
// pseudo-status (work needing attention), so it is prepended rather than
// stored in the catalog.
export function taskStatuses(catalog: StatusMeta[]): Set<string> {
return new Set(["needs_you", ...catalog.map((status) => status.id)]);
return new Set(["needs_attention", ...catalog.map((status) => status.id)]);
}
/**
+1 -1
View File
@@ -55,7 +55,7 @@ const LEAD = ["mission", "workflow", "message", "body", "plan", "then", "status"
const longText = /mission|body|detail|plan|rules/;
function kindOf(key: string, schema: SettingsSchema): Kind {
if ((["workflow.call", "workflow.handoff"].includes(type.value) && key === "workflow") || (type.value === "human.approve" && key === "then")) return "workflow";
if ((["workflow.call", "workflow.handoff"].includes(type.value) && key === "workflow") || (type.value === "workflow.approve" && key === "then")) return "workflow";
if (type.value === "agent.run" && key === "model") return "select";
if (schema.type === "string") return schema.enum ? "select" : longText.test(key) ? "text" : "line";
if (schema.type === "boolean") return "boolean";
+1 -3
View File
@@ -1,4 +1,4 @@
import { Bot, FileSearch, GitBranch, MessageSquare, ShieldCheck, Split, Terminal, UserCheck, Workflow } from "@lucide/vue";
import { Bot, FileSearch, GitBranch, MessageSquare, ShieldCheck, Split, Terminal, Workflow } from "@lucide/vue";
import type { Component } from "vue";
const GROUP_ICONS: Record<string, Component> = {
@@ -7,7 +7,6 @@ const GROUP_ICONS: Record<string, Component> = {
repo: GitBranch,
gate: ShieldCheck,
forge: MessageSquare,
human: UserCheck,
review: FileSearch,
workflow: Workflow,
};
@@ -18,7 +17,6 @@ const GROUP_TITLES: Record<string, string> = {
repo: "Repository",
gate: "Checks",
forge: "Issues and PRs",
human: "People",
review: "Review",
workflow: "Flow",
};
+2 -2
View File
@@ -158,7 +158,7 @@ const TYPE_TITLES: Record<string, string> = {
"gate.diff-rules": "Diff rules",
"forge.comment": "Comment",
"forge.close-issue": "Close issue",
"human.approve": "Human approval",
"workflow.approve": "Approval",
"workflow.call": "Call workflow",
"workflow.handoff": "Hand off",
"workflow.finish": "Finish",
@@ -196,7 +196,7 @@ function stepDetail(type: string, settings: Mapping): string {
return pick("workflow");
case "workflow.finish":
return pick("status") || "completed";
case "human.approve":
case "workflow.approve":
return pick("then") ? `then ${pick("then")}` : "";
case "gate.repository":
return pick("expect") === "test-failure" ? "tests must fail" : settings.repair ? "repair if red" : "";
+1 -1
View File
@@ -86,7 +86,7 @@ function startsVia(value: unknown, target: string): string {
case "workflow.handoff":
if (settings.workflow === target || resultChoices(all, settings.workflow).includes(target)) return "hands off to it";
break;
case "human.approve":
case "workflow.approve":
if (settings.then === target) return "runs it once approved";
break;
}