Files
archie/internal/domain/workflow/shipped/triage.yaml
T

53 lines
2.6 KiB
YAML

id: triage
identity: 6f129e29-0e26-5246-99bd-74cb4496203b
steps:
- type: repo.prepare
- id: classify
type: agent.run
settings:
read_only: true
mission: |
Triage this {{ task.kind }} on the repository {{ task.repository }}: 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. 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. Check whether the repository 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 a human 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 human 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 }}"