Drafts: trigger, workflow and policy, with a dry run #2008

Closed
opened 2026-11-14 16:02:45 +00:00 by sam · 2 comments
Owner

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.

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.
sam added the featurehigh labels 2026-11-14 16:02:45 +00:00
sam added a new dependency 2026-11-14 16:02:46 +00:00
Author
Owner

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, with investigate shipped 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.

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`, with `investigate` shipped 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.
Author
Owner

Landed (703d5376b and 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.

Landed (703d5376b and 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.
sam closed this issue 2026-11-15 23:10:11 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#2008