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.
52 lines
2.6 KiB
YAML
52 lines
2.6 KiB
YAML
repository: optional
|
|
identity: 6f129e29-0e26-5246-99bd-74cb4496203b
|
|
steps:
|
|
- id: classify
|
|
type: agent.run
|
|
settings:
|
|
read_only: true
|
|
mission: |
|
|
Triage this {{ task.kind }}: decide whether it needs a code change at all, and if so which workflow suits it best.
|
|
|
|
{{ task.prompt }}
|
|
|
|
Read only as much as you need to judge this. If the task names no repository, there is no code to read: judge from the request alone. A title or body that is purely conversational, administrative, or already resolved needs no code change.
|
|
|
|
If it does need a change, the workflow is a real decision, not a formality. If there is a repository, check whether it already has a settled design for what is being asked (a design document, an approved plan, an existing implementation to extend). If it does not, and the request is not a defect, choose feasibility: it writes a design document for an operator to approve, which is cheaper than an implementation built on a guess. Choose tdd when there is an observable wrong behaviour a test can reproduce first. Choose implement only when the change is well understood and its shape is already clear.
|
|
|
|
Return your result exactly once, then call finish with status "passed".
|
|
result:
|
|
type: object
|
|
properties:
|
|
needs_code_change:
|
|
type: boolean
|
|
description: "false: nothing to build, close it. true: route to a workflow that builds something."
|
|
workflow:
|
|
type: string
|
|
enum: [implement, tdd, feasibility]
|
|
description: Which workflow fits best. Required when needs_code_change is true; omit it otherwise.
|
|
reasons:
|
|
type: string
|
|
description: The rationale, written for the person who filed the request.
|
|
required: [needs_code_change, reasons]
|
|
if:
|
|
properties:
|
|
needs_code_change: {const: true}
|
|
then:
|
|
required: [workflow]
|
|
- type: forge.comment
|
|
when: "!steps.classify.result.needs_code_change"
|
|
settings:
|
|
body: "Triaged: no code change is needed for this. {{ steps.classify.result.reasons }}"
|
|
- type: forge.close-issue
|
|
when: "!steps.classify.result.needs_code_change"
|
|
- type: workflow.finish
|
|
when: "!steps.classify.result.needs_code_change"
|
|
settings:
|
|
detail: "triaged: no code change needed. {{ steps.classify.result.reasons }}"
|
|
- type: workflow.handoff
|
|
when: "steps.classify.result.needs_code_change"
|
|
settings:
|
|
workflow: "{{ steps.classify.result.workflow }}"
|
|
detail: "triaged to {{ steps.classify.result.workflow }}: {{ steps.classify.result.reasons }}"
|