Files
sam ce70d4f3ee feat(runs): workflow documents take today's step shape, references and when (#2039)
A step is id/type/settings with when and on_failure; the five kinds become
the types agent.run (inline mission), connector.action, approval.wait,
run.notify and workflow.sleep. Documents declare inputs, repository,
instructions, identity and profile; references are {{ task|inputs|steps }}
checked at save. Any number of approval steps, each asking only about what
was held since; actions still held at the end are put to people before the
run finishes. Triggers are refused for a workflow they can't start, and the
workflows API lists, reads and saves documents beside a step-type catalog.

Copied from internal/domain/workflow: definition.go, step_refs.go,
step_flow.go's checks, control_steps.go's when parser, vocabulary.go and
task/interface.go. stableid moves to internal/platform.
2026-11-17 18:43:45 +11:00

90 lines
3.3 KiB
YAML

identity: 6f129e29-0e26-5246-99bd-74cb4496203b
steps:
- type: repo.prepare
- id: assess
type: agent.run
settings:
read_only: true
mission: |
Assess whether this feature request fits the project {{ task.repository }}.
{{ task.prompt }}
Read the repository's AGENTS.md or CLAUDE.md, ROADMAP.md and README (whichever exist) plus enough code to judge scope and architectural fit. Return your result exactly once, then call finish with status "passed" summarising the assessment.
result:
type: object
properties:
fit:
type: boolean
description: "true: fits the project and is worth a PRD. false: close as won't-do."
reasons:
type: string
description: The rationale, written for the person who filed the request.
required: [fit, reasons]
- id: verdict
switch:
on: steps.assess.result.fit
cases:
"false":
- type: forge.close-issue
- type: workflow.finish
settings:
status: declined
detail: "{{ steps.assess.result.reasons }}"
- id: prd
type: agent.run
settings:
read_only: true
mission: |
Write a PRD for this accepted feature request on {{ task.repository }}.
{{ task.prompt }}
<assessment>
{{ steps.assess.result.reasons }}
</assessment>
Explore the affected code surface, then return the PRD exactly once and call finish with status "passed" and a one-line summary. It will be read by whoever decides whether to green-light implementation, and the approved PRD is what the implementation is built from.
result:
type: object
properties:
title:
type: string
description: What is being decided, in a few words.
problem:
type: string
description: The problem, in Markdown, grounded in the code you read.
solution:
type: string
description: The proposed solution, in Markdown. Include proposed signatures as fenced code.
files:
type: array
description: The files the change adds, modifies or deletes.
items:
type: object
properties:
path: {type: string}
change: {type: string, enum: [added, modified, deleted]}
note: {type: string, description: How the change touches the file.}
required: [path, change]
acceptance:
type: array
description: Acceptance criteria, each independently checkable.
items: {type: string}
non_goals:
type: array
description: What this change explicitly does not do.
items: {type: string}
diff_estimate:
type: string
description: The estimated diff size, e.g. "~40 lines across 2 files".
risks:
type: array
description: Risks and open questions the reader must weigh. Empty when there are none.
items: {type: string}
required: [title, problem, solution, files, acceptance, non_goals, diff_estimate]
- type: workflow.approve
settings:
document: "{{ steps.prd.result }}"
then: implement