Drafts: trigger, workflow and policy, with a dry run #2008
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#2008
Reference in new issue
Block a user
A draft bundles a trigger, a workflow and any policy it needs, with a plain-language summary and a dry run. A dry run replays stored events through the draft: read-only steps run for real, and every other action is judged without executing.
Done when: the first alert's proposal shows a summary and a dry run against that alert.
Spec: R12.
From the 2026-11-16 module review: a workflow is currently a Go closure registered at start (
runs.Workflow,runs.Investigate). A draft, a dry run and a proposal (#1995) need a workflow that can be stored, diffed, validated and run with effects off, which a closure can't be.Decide the representation before this issue starts: a small step vocabulary as data (agent, action, wait for approval, notify, sleep) executed by
modules/runs, withinvestigateshipped as a workflow document. A dry run is then a mode of the same execution (judge, don't execute) rather than a second implementation. The old YAML vocabulary in WORKFLOWS.md is the starting point to cut down, not to port whole.Landed (
703d5376band before, migration 00031) and shown on staging: a test disk alert with no trigger formed a group, POST /api/groups/{id}/draft made a draft with its summary, and the dry run against that alert ran the investigate document: gemma4 queried Prometheus for real (read-only), found /tmp at 6% and proposed nothing; the notice was recorded, not sent. Workflows are now stored YAML documents (agent, action, wait_for_approval, notify, sleep), investigate ships as one, the closure path is gone, and dry mode is enforced in judgement (ErrDryRun) and the interpreter. Not shown on staging: a dry run with a changing action (covered by TestDryRunNeverExecutesAChangingAction). Left: list/diff of workflow versions, a diff view, publish doesn't check an existing trigger name, WORKFLOWS.md still describes the old vocabulary.