@gumpwang/agent-workflow 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -13
- package/dist/agent-workflow.js +217 -152
- package/docs/contract.md +102 -71
- package/package.json +2 -1
- package/templates/agents.yaml +17 -0
- package/templates/config.yaml +11 -99
- package/templates/handlers/agent-merge.sh +1 -1
- package/templates/handlers/workspace-cleanup.sh +6 -0
- package/templates/handlers/workspace-provision.sh +14 -0
- package/templates/projects/your-repo/project.yaml +63 -0
- package/templates/workflows/review-loop.yaml +2 -2
- package/templates/workflows/teardown.yaml +1 -1
package/docs/contract.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# agent-workflow 契约参考
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
改配置(`config.yaml`、`agents.yaml`、`project.yaml`)、写或改 workflow、写 `run` step 的脚本、或排查 ledger 时读本文。本文随包分发:`agent-workflow contract` 打印全文,`agent-workflow contract --path` 打印文件位置。术语见仓库根目录 `CONTEXT.md`。
|
|
4
4
|
|
|
5
5
|
本文的每个 ```yaml 示例第一行注释写明它在 rule set 里的文件路径;测试把这些示例写进 `init` 出来的 rule set,要求 `agent-workflow validate` 通过。标了 `(rejected: NOT_IMPLEMENTED)` 的示例展示保留字段,`validate` 必须拒绝。
|
|
6
6
|
|
|
@@ -9,23 +9,30 @@
|
|
|
9
9
|
引擎不带任何规则。规则全部在 rule set 里:`$AGENT_WORKFLOW_HOME`(默认 `~/.agent-workflow`)。
|
|
10
10
|
|
|
11
11
|
```text
|
|
12
|
-
config.yaml
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
config.yaml max_concurrent, registered projects
|
|
13
|
+
agents.yaml agent profiles, default_agent
|
|
14
|
+
workflows/<id>.yaml one workflow per file; <id> is the file name
|
|
15
|
+
prompts/ prompt files (template: implement.md, resume.md, review.md, ...)
|
|
16
|
+
handlers/ scripts for run steps and workspace hooks (template: agent-merge.sh, workspace-*.sh)
|
|
17
|
+
state/ global: dispatch.lock, last-run.json, issues.json, logs/deliveries.log
|
|
18
|
+
projects/<name>/project.yaml one project: tracker, root, workspace, state, enabled workflows
|
|
19
|
+
projects/<name>/state/ default state dir: ledger.json, logs/, prompts/, runs/ (written by the engine)
|
|
20
|
+
projects/<name>/workspace/ default workspace dir: one git worktree per ticket
|
|
17
21
|
```
|
|
18
22
|
|
|
23
|
+
workflow、prompt 和 handler 由所有项目共用;ledger 和 workspace 按项目分开。全局只有一把锁:`max_concurrent` 统计所有项目的存活 agent。
|
|
24
|
+
|
|
19
25
|
- `agent-workflow init [--home DIR] [--force]` 把包内 `templates/` 复制进 rule set:只补缺失文件,`--force` 覆盖。之后引擎只读 rule set,模板升级不会改变已有 rule set 的行为。
|
|
20
26
|
- workflow 只从 `$AGENT_WORKFLOW_HOME/workflows/<id>.yaml` 读取,没有内置 workflow,也没有同 id 覆盖的第二层。
|
|
21
27
|
- `${{ rules.dir }}` 是 rule set 根目录。
|
|
22
28
|
- 相对路径按 rule set 根目录解析:
|
|
23
29
|
- `prompt_file`、`resume_prompt_file`:如 `prompts/implement.md`。
|
|
24
|
-
- `run` 的第一个词:是含 `/` 的相对路径、且不以 `.`、`/`、`~`、`$` 或引号开头时(如 `handlers/agent-merge.sh`),引擎把它换成 rule set 里的绝对路径,文件不存在时 `validate` 报 `RUN_NOT_FOUND`。`./x`、`../x` 保持 shell
|
|
30
|
+
- `run` 以及 `workspace.provision` / `cleanup` 的第一个词:是含 `/` 的相对路径、且不以 `.`、`/`、`~`、`$` 或引号开头时(如 `handlers/agent-merge.sh`),引擎把它换成 rule set 里的绝对路径,文件不存在时 `validate` 报 `RUN_NOT_FOUND`。`./x`、`../x` 保持 shell 原义(相对工作目录)。命令的工作目录不变(`run` 为 workspace,workspace 脚本为 `$ROOT`)。
|
|
31
|
+
- `project.yaml` 里的相对 `workspace.path` 和 `state.path` 按项目目录 `projects/<name>/` 解析。
|
|
25
32
|
|
|
26
33
|
## 一轮 reconcile
|
|
27
34
|
|
|
28
|
-
`agent-workflow dispatch [--dry-run]`
|
|
35
|
+
`agent-workflow dispatch [<project>...] [--dry-run]` 跑一轮:不写项目名时处理 `config.yaml` 登记的全部项目,写了只处理这些项目(必须已登记,否则退出 1);`dispatch --ticket <ID>` 只推进这一个工单的活跃 run(重新读一次工单状态,不启动新 run),`deliver` 用它在交付后立即推进。对每个工单,当前状态命中哪个已启用 workflow 的 trigger,那个 workflow 就是期望的 workflow(每个状态至多命中一个,`validate` 保证):
|
|
29
36
|
|
|
30
37
|
| 情况 | 动作 |
|
|
31
38
|
|---|---|
|
|
@@ -57,9 +64,9 @@ state/ ledger.json, logs/, prompts/, runs/ (written by the engine)
|
|
|
57
64
|
|
|
58
65
|
工单能被转到的状态只来自配置,引擎没有兜底状态表:
|
|
59
66
|
|
|
60
|
-
1. 已启用 workflow 的 trigger 状态(`
|
|
67
|
+
1. 已启用 workflow 的 trigger 状态(`project.yaml` 里 `states` 覆盖后的值,按 `workflows` 顺序);
|
|
61
68
|
2. `tracker.other_states`;
|
|
62
|
-
3. `attention_state
|
|
69
|
+
3. 项目的 `attention_state`;
|
|
63
70
|
4. GitHub 另有两个固定状态:`Open`(排第一)与 `Closed`(排最后)。
|
|
64
71
|
|
|
65
72
|
匹配不区分大小写,workflow 拼写和 `state_alias` 里的 tracker 拼写都认,写入时用 tracker 拼写。`tracker:` step 与 `agent-workflow ticket <ID> state` 走同一个进程内 adapter,受同一个状态目录约束。Linear 上目录里的状态在团队里不存在时报错(`ticket` 退出码 4)。
|
|
@@ -98,13 +105,19 @@ agent 和 handler 用它读写工单,Linear 与 GitHub 用法相同。项目
|
|
|
98
105
|
|
|
99
106
|
退出码:`0` 成功;`1` 配置错误或意外错误;`2` 用法错误、输入错误(如空 body)或缺凭证;`3` tracker API 错误;`4` 工单、项目或状态找不到,或状态不在目录里;`5` `--final` 时还有未勾选项。
|
|
100
107
|
|
|
101
|
-
##
|
|
108
|
+
## 配置文件
|
|
109
|
+
|
|
110
|
+
配置分三层:`config.yaml` 登记项目,`agents.yaml` 定义 agent profile,每个项目一个 `projects/<name>/project.yaml`。
|
|
102
111
|
|
|
103
112
|
```yaml
|
|
104
113
|
# config.yaml
|
|
105
114
|
max_concurrent: 3
|
|
115
|
+
projects: [web, api]
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```yaml
|
|
119
|
+
# agents.yaml
|
|
106
120
|
default_agent: claude
|
|
107
|
-
attention_state: Blocked
|
|
108
121
|
agents:
|
|
109
122
|
claude:
|
|
110
123
|
runner: headless
|
|
@@ -114,65 +127,82 @@ agents:
|
|
|
114
127
|
codex:
|
|
115
128
|
session: none
|
|
116
129
|
command: env AGENT_SESSION="$SESSION_ID" codex exec --json -
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
```yaml
|
|
133
|
+
# projects/web/project.yaml
|
|
134
|
+
tracker:
|
|
135
|
+
kind: linear
|
|
136
|
+
slug: web-app-0123456789ab
|
|
137
|
+
api_key: $LINEAR_API_KEY
|
|
138
|
+
assignee: me
|
|
139
|
+
other_states: [Backlog, "In Review"]
|
|
140
|
+
state_alias: { Canceled: Cancelled }
|
|
141
|
+
root: ~/dev/web
|
|
142
|
+
attention_state: Blocked
|
|
117
143
|
workspace:
|
|
118
|
-
path: ~/.agent-workflow/workspaces/${{ project.name }}/${{ ticket.identifier }}
|
|
119
144
|
branch: agent/${{ ticket.identifier }}
|
|
145
|
+
provision: handlers/workspace-provision.sh
|
|
146
|
+
cleanup: handlers/workspace-cleanup.sh
|
|
147
|
+
workflows: [implement, review, hotfix, merge, teardown, abandon]
|
|
148
|
+
inputs:
|
|
149
|
+
review: { max-rounds: 2, strictness: light }
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
```yaml
|
|
153
|
+
# projects/api/project.yaml
|
|
154
|
+
tracker:
|
|
155
|
+
kind: github
|
|
156
|
+
repo: acme/api
|
|
157
|
+
assignee: [me, octocat]
|
|
158
|
+
other_states: [Backlog, "In Review"]
|
|
159
|
+
root: ~/dev/api
|
|
160
|
+
attention_state: In Review
|
|
161
|
+
workspace:
|
|
162
|
+
path: worktrees/${{ ticket.number }}
|
|
163
|
+
branch: wip/${{ ticket.identifier }}
|
|
120
164
|
provision: git -C "$ROOT" worktree add "$WORKSPACE" -b "$WORKSPACE_BRANCH" origin/main
|
|
121
165
|
cleanup: git -C "$ROOT" worktree remove "$WORKSPACE" --force
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
slug: web-app-0123456789ab
|
|
127
|
-
api_key: $LINEAR_API_KEY
|
|
128
|
-
assignee: me
|
|
129
|
-
other_states: [Backlog, "In Review"]
|
|
130
|
-
state_alias: { Canceled: Cancelled }
|
|
131
|
-
root: ~/dev/web
|
|
132
|
-
workflows: [implement, review, hotfix, merge, teardown, abandon]
|
|
133
|
-
roles:
|
|
134
|
-
implementer: { agent: claude }
|
|
135
|
-
reviewer: { agent: codex }
|
|
136
|
-
author: { agent: claude }
|
|
137
|
-
inputs:
|
|
138
|
-
review: { max-rounds: 2, strictness: light }
|
|
139
|
-
api:
|
|
140
|
-
tracker:
|
|
141
|
-
kind: github
|
|
142
|
-
repo: acme/api
|
|
143
|
-
assignee: [me, octocat]
|
|
144
|
-
other_states: [Backlog, "In Review"]
|
|
145
|
-
root: ~/dev/api
|
|
146
|
-
attention_state: In Review
|
|
147
|
-
workspace:
|
|
148
|
-
path: ~/.agent-workflow/workspaces/api/${{ ticket.number }}
|
|
149
|
-
branch: wip/${{ ticket.identifier }}
|
|
150
|
-
workflows: [implement, merge, teardown]
|
|
151
|
-
states: { teardown: [Closed] }
|
|
152
|
-
roles:
|
|
153
|
-
implementer: { agent: claude }
|
|
166
|
+
state:
|
|
167
|
+
path: ~/.cache/agent-workflow/api
|
|
168
|
+
workflows: [implement, merge, teardown]
|
|
169
|
+
states: { teardown: [Closed] }
|
|
154
170
|
```
|
|
155
171
|
|
|
172
|
+
`config.yaml`:
|
|
173
|
+
|
|
156
174
|
| 键 | 必填 | 说明 |
|
|
157
175
|
|---|---|---|
|
|
158
176
|
| `max_concurrent` | 否 | 同时存活的 agent 进程上限(跨项目),默认不限 |
|
|
177
|
+
| `projects` | 是 | 登记的项目名列表,项目名只用 `[A-Za-z0-9_.-]`。每个名字对应 `projects/<name>/project.yaml`;不带参数的 `dispatch` 处理全部登记项目。项目名出现在工单编号(GitHub)、日志和 `$PROJECT_NAME` 里 |
|
|
178
|
+
|
|
179
|
+
`agents.yaml`:
|
|
180
|
+
|
|
181
|
+
| 键 | 必填 | 说明 |
|
|
182
|
+
|---|---|---|
|
|
159
183
|
| `default_agent` | 否 | 没指定 agent 的 role 用哪个 profile;必须在 `agents` 里。只有一个 profile 时可省略 |
|
|
160
|
-
| `attention_state` | 否 | run 需要人处理时把工单转到的状态(如 `In Review`),项目可覆盖。不能是该项目任何 workflow 的 trigger 状态(`CONFIG_INVALID`),自动进入状态目录。不配则只评论 |
|
|
161
184
|
| `agents.<name>.command` | 是 | 新会话的启动命令,bash 执行,prompt 走 stdin,输出追加到 `$LOG_FILE`;命令行上必须带 `$SESSION_ID`(缺少时 `validate` 给 `SESSION_ID_MISSING` 警告) |
|
|
162
185
|
| `agents.<name>.session` | 否 | `claude`(`resume_command` 续跑同一 `$SESSION_ID`)或 `none`(默认,每个 turn 新开会话) |
|
|
163
186
|
| `agents.<name>.resume_command` | `session: claude` 时必填 | 续跑命令 |
|
|
164
187
|
| `agents.<name>.runner` | 否 | 只有 `headless`(默认) |
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
|
171
|
-
|
|
172
|
-
| `
|
|
173
|
-
| `
|
|
174
|
-
| `
|
|
175
|
-
| `
|
|
188
|
+
|
|
189
|
+
role 的 agent 取值顺序:workflow 里的 `roles.<role>.agent` → `default_agent` → 唯一的 agent profile。
|
|
190
|
+
|
|
191
|
+
`projects/<name>/project.yaml`:
|
|
192
|
+
|
|
193
|
+
| 键 | 必填 | 说明 |
|
|
194
|
+
|---|---|---|
|
|
195
|
+
| `tracker` | 是 | 见下表 |
|
|
196
|
+
| `root` | 是 | canonical repo,即 `$ROOT` |
|
|
197
|
+
| `attention_state` | 否 | run 需要人处理时把工单转到的状态(如 `In Review`)。不能是该项目任何 workflow 的 trigger 状态(`CONFIG_INVALID`),自动进入状态目录。不配则只评论 |
|
|
198
|
+
| `workspace` | 否 | 每个工单一个 workspace。不写时 agent 在 `root` 里工作 |
|
|
199
|
+
| `workspace.path` | 否 | `${{ }}` 模板,默认 `projects/<name>/workspace/${{ ticket.identifier }}`;相对路径按项目目录解析 |
|
|
200
|
+
| `workspace.branch` | 否 | `${{ }}` 模板。不写时 `$WORKSPACE_BRANCH` 为空。`path` 和 `branch` 只认 `project.*` 与 `ticket.{id,identifier,number,state}`(它们会进 shell 和 git) |
|
|
201
|
+
| `workspace.provision` / `cleanup` | 否 | shell 脚本,可以用 rule set 里的公共脚本(如 `handlers/workspace-provision.sh`)。provision 在首个 agent turn 前执行(目录不在时再执行),新建的 workspace 在启动失败时回滚;cleanup 在 `close: cleanup` 时执行,失败只告警 |
|
|
202
|
+
| `state.path` | 否 | 项目 state 目录(ledger、交付、agent 日志与 prompt),默认 `projects/<name>/state`;相对路径按项目目录解析。两个项目不能共用 |
|
|
203
|
+
| `workflows` | 是 | 启用的 workflow id(`workflows/<id>.yaml`)。引擎没有默认列表,缺少时 `validate` 报错。顺序决定 GitHub 状态 label 的优先级 |
|
|
204
|
+
| `states.<workflow>` | 否 | 覆盖该 workflow 的 `on.states` |
|
|
205
|
+
| `inputs.<workflow>.<input>` | 否 | workflow 的 input 值 |
|
|
176
206
|
|
|
177
207
|
`tracker`:
|
|
178
208
|
|
|
@@ -304,7 +334,7 @@ steps:
|
|
|
304
334
|
| `on.tracked` | 否 | `true`:只处理已有 ticket context 的工单(收尾类 workflow),默认 `false` |
|
|
305
335
|
| `on_interrupt` | 否 | `cancel`(默认)或 `finish-step` |
|
|
306
336
|
| `inputs.<name>` | 否 | `type`:`string` / `number` / `boolean` / `choice`(`options` 必填);`default`、`required`、`min` / `max`(仅 number)、`description` |
|
|
307
|
-
| `roles.<role>` | 否 | `agent
|
|
337
|
+
| `roles.<role>` | 否 | `agent`:`agents.yaml` 里的 profile 名,不写时用 `default_agent`,再不行用唯一的 profile;`max_attempts`:同一 launch step 的最大 turn 数(首个 turn + 续跑),默认 3 |
|
|
308
338
|
| `state.<name>` | 否 | run 的初始值(标量),只有 `set` 能改 |
|
|
309
339
|
| `steps` | 是 | 至少一个 step |
|
|
310
340
|
|
|
@@ -344,8 +374,8 @@ steps:
|
|
|
344
374
|
- turn 结束但没有交付:工单仍在该 workflow 的 trigger 状态时,续跑同一 session,prompt 带上"上一轮没有交付"的提醒和 Completion 段,次数用尽进入 attention;工单已在不触发 workflow 的状态时不再续跑,step 记 `no-delivery` 后继续。
|
|
345
375
|
- 交付被接受时,该 role 的 turn 计数清零:`max_attempts` 只限制没有交付的 turn。
|
|
346
376
|
- 一个 run 接受过交付之后,后续 step 失败进入 attention,而不是重新开始 workflow(那会把 agent 叫回来重做已交出的工作)。
|
|
347
|
-
- agent 交付后,`deliver` 在后台对这个工单跑一次 `dispatch --ticket <ID
|
|
348
|
-
-
|
|
377
|
+
- agent 交付后,`deliver` 在后台对这个工单跑一次 `dispatch --ticket <ID>`,输出追加到全局的 `state/logs/deliveries.log`;另一轮持有锁时它等锁释放(最多 15 分钟)再推进,超时才留给下一轮。
|
|
378
|
+
- 交付文件:项目 state 目录下的 `runs/<run-id>/deliveries/<name>.md`(正文)与 `<name>.json`(token、verdict、是否不完整、问题列表、时间、step 位置)。
|
|
349
379
|
|
|
350
380
|
`agent-workflow deliver [--verdict <v>] [--force] [- | --file <f>]` 只能在 agent turn 里用,失败时退出 1,stderr 为 `deliver: <代码>: <说明>`:
|
|
351
381
|
|
|
@@ -354,7 +384,7 @@ steps:
|
|
|
354
384
|
| `TOKEN_REQUIRED` | 不在 agent turn 里(缺 `AGENT_WORKFLOW_RUN` / `AGENT_WORKFLOW_ROLE` / `AGENT_WORKFLOW_TOKEN`) |
|
|
355
385
|
| `RUN_NOT_FOUND` | run 已不活跃 |
|
|
356
386
|
| `TOKEN_INVALID` | token 不属于这个 role 的当前 turn |
|
|
357
|
-
| `CONFIG_INVALID` |
|
|
387
|
+
| `CONFIG_INVALID` | 配置校验不过 |
|
|
358
388
|
| `STEP_NOT_EXPECTING` | 当前 step 不在等这个 role 的交付 |
|
|
359
389
|
| `DELIVERY_EMPTY` | 正文为空 |
|
|
360
390
|
| `DELIVERY_INCOMPLETE` | `strict` 时缺标题、结论或 JSON 不合法;`--force` 仍按不完整记下 |
|
|
@@ -410,21 +440,20 @@ steps:
|
|
|
410
440
|
|
|
411
441
|
## validate
|
|
412
442
|
|
|
413
|
-
`agent-workflow validate [--json]` 检查 `config.yaml`
|
|
443
|
+
`agent-workflow validate [--json]` 检查 `config.yaml`、`agents.yaml`、每个登记项目的 `project.yaml` 和它启用的 workflow;`validate <file>` 只检查一个 workflow 文件(文件路径相对当前目录;文件里的相对 prompt 与 `run` 路径仍按 rule set 根目录解析)。有 error 时退出 1。每条诊断:级别、文件、位置(如 `steps[2].tracker.state`)、代码、说明。
|
|
414
444
|
|
|
415
445
|
| 代码 | 含义 |
|
|
416
446
|
|---|---|
|
|
417
|
-
| `CONFIG_NOT_FOUND` / `CONFIG_INVALID` |
|
|
447
|
+
| `CONFIG_NOT_FOUND` / `CONFIG_INVALID` | 缺 `config.yaml`、`agents.yaml` 或登记项目的 `project.yaml` / 键或值不合法(含缺少 `workflows`、未知键、旧的单文件布局、`default_agent` 不在 `agents` 里、`attention_state` 是 trigger 状态、两个项目共用一个 state 目录) |
|
|
418
448
|
| `SESSION_ID_MISSING` | 警告:agent 命令行上没有 `$SESSION_ID` |
|
|
419
449
|
| `WORKFLOW_NOT_FOUND` | rule set 里没有 `workflows/<id>.yaml` |
|
|
420
450
|
| `WORKFLOW_INVALID` | workflow 结构错误(未知键、缺字段、类型错) |
|
|
421
451
|
| `TRIGGER_CONFLICT` | 同一个状态触发了两个 workflow |
|
|
422
452
|
| `PROFILE_REQUIRED` / `PROFILE_NOT_FOUND` | role 绑定不到 agent profile / 绑定的 profile 不存在 |
|
|
423
|
-
| `ROLE_UNUSED` | 警告:项目覆盖了没有 workflow 声明的 role |
|
|
424
453
|
| `INPUT_REQUIRED` | 缺必填 input |
|
|
425
454
|
| `LAUNCH_IN_LOOP` / `ROLE_RELAUNCHED` / `ROLE_NOT_LAUNCHED` | launch 在 `while` 里 / 同一 role launch 两次 / message 前没有 launch |
|
|
426
455
|
| `RESUME_PROMPT_REQUIRED` | `max_attempts` > 1 的 launch 没有续跑 prompt |
|
|
427
|
-
| `PROMPT_NOT_FOUND` / `RUN_NOT_FOUND` | rule set 里缺 prompt 文件 / `run`
|
|
456
|
+
| `PROMPT_NOT_FOUND` / `RUN_NOT_FOUND` | rule set 里缺 prompt 文件 / `run` 或 workspace 脚本引用的文件 |
|
|
428
457
|
| `EXPR_INVALID` / `UNKNOWN_NAME` / `UNSAFE_INTERPOLATION` | 表达式语法错 / 名字不存在 / `run` 里插值了不可信文本 |
|
|
429
458
|
| `HANDWRITTEN_DELIVER` | 警告:prompt 里手写了 `agent-workflow deliver`,引擎会自己追加 |
|
|
430
459
|
| `NOT_IMPLEMENTED` | 用了保留字段 |
|
|
@@ -439,7 +468,7 @@ steps:
|
|
|
439
468
|
| `PROJECT_NAME` / `PROJECT_SLUG` | 项目名与 Linear slug 或 GitHub repo |
|
|
440
469
|
| `LINEAR_API_KEY` | 仅 Linear |
|
|
441
470
|
| `GH_REPO` / `ISSUE_NUMBER` | 仅 GitHub:`owner/name`(`gh` 也认它)、issue 号 |
|
|
442
|
-
| `ROOT` | `
|
|
471
|
+
| `ROOT` | `project.yaml` 的 `root` |
|
|
443
472
|
| `WORKSPACE` / `WORKSPACE_ROOT` / `WORKSPACE_BRANCH` | 工单的 workspace 与分支 |
|
|
444
473
|
| `AGENT_WORKFLOW_HOME` / `AGENT_WORKFLOW_WORKFLOW` / `AGENT_WORKFLOW_RUN` | rule set 根目录(`${{ rules.dir }}` 同值)/ 当前 workflow 文件 / run id |
|
|
445
474
|
| `AGENT_WORKFLOW_DIR` | 引擎包根目录 |
|
|
@@ -458,7 +487,7 @@ agent 存活判定:pid 存在,且该 pid 所在进程组里有进程的 argv
|
|
|
458
487
|
| `implement` | `Todo`, `In Progress` | `launch: implementer`(`prompts/implement.md`,续跑 `prompts/resume.md`,`max_attempts: 3`),交付 `handoff`(`## PR`、`## Verification`、`## Adjacent issues`,结论 `done` / `blocked`)。`done` → `tracker` 转 In Review;`blocked` → attention。agent 自己用 `agent-workflow ticket` 开工转状态、写 workpad、关联 PR |
|
|
459
488
|
| `merge` | `Merging`(tracked) | `run: handlers/agent-merge.sh`;`returned` → `note`(冲突说明,交给下次 implement);`done` → `close: cleanup` |
|
|
460
489
|
| `teardown` | `Done`, `Canceled`, `Cancelled`, `Duplicate`, `Closed`(tracked) | `close: cleanup` |
|
|
461
|
-
| `review-loop`(默认不启用) | `Todo`, `In Progress` | implementer 交付 `handoff` 后,reviewer 只读评审(`prompts/review.md`,续跑 `prompts/review-resume.md`),交付 `review`(`## Findings`,`clean` / `issues`);`issues` 时最多 `inputs.max-rounds`(默认 3)轮 `message` 修复(`prompts/fix.md`)+ 复审(`prompts/rereview.md`);`clean` → 评论并转 In Review,仍有问题或 implementer `blocked` → attention。在项目里用 `workflows: [review-loop, merge, teardown]` 替换 implement
|
|
490
|
+
| `review-loop`(默认不启用) | `Todo`, `In Progress` | implementer 交付 `handoff` 后,reviewer 只读评审(`prompts/review.md`,续跑 `prompts/review-resume.md`),交付 `review`(`## Findings`,`clean` / `issues`);`issues` 时最多 `inputs.max-rounds`(默认 3)轮 `message` 修复(`prompts/fix.md`)+ 复审(`prompts/rereview.md`);`clean` → 评论并转 In Review,仍有问题或 implementer `blocked` → attention。在项目里用 `workflows: [review-loop, merge, teardown]` 替换 implement;要让评审用另一个 agent,在 `workflows/review-loop.yaml` 里写 `roles.reviewer.agent` |
|
|
462
491
|
|
|
463
492
|
`handlers/agent-merge.sh` 以 `gh pr view` 读到的 PR 状态为准做决定,不只看 `gh pr merge` 的退出码。PR 分支取 `$WORKSPACE_BRANCH`(即 `workspace.branch`);完成状态与返工状态由 `merge.yaml` 通过 `env:` 传入 `$MERGE_DONE_STATE`、`$MERGE_REWORK_STATE`(模板:Linear `Done`、GitHub `Closed`;返工 `In Progress`)。handler 没有内置默认值,缺任一输入即非 0 退出并说明缺哪个。评论和转状态用 `agent-workflow ticket "$ISSUE_IDENTIFIER" …`:
|
|
464
493
|
|
|
@@ -472,7 +501,9 @@ agent 存活判定:pid 存在,且该 pid 所在进程组里有进程的 argv
|
|
|
472
501
|
|
|
473
502
|
默认不带 `--auto`:引擎每轮都会重跑 pending 的 step,自己就起到了"checks 通过后再合并"的作用。显式加了 `--auto` 而仓库没开启时,handler 报失败并提示开启 auto-merge 或去掉 `--auto`。
|
|
474
503
|
|
|
475
|
-
## Ledger
|
|
504
|
+
## Ledger(项目 state 目录下的 `ledger.json`)
|
|
505
|
+
|
|
506
|
+
每个项目一份,只放该项目的工单;引擎读写时把所有项目的 ledger 合在一起看(工单编号跨项目唯一)。
|
|
476
507
|
|
|
477
508
|
```json
|
|
478
509
|
{
|
|
@@ -481,11 +512,11 @@ agent 存活判定:pid 存在,且该 pid 所在进程组里有进程的 argv
|
|
|
481
512
|
"HAN-81": {
|
|
482
513
|
"project": "codans",
|
|
483
514
|
"ticket": { "identifier": "HAN-81", "state": "In Progress", "title": "…" },
|
|
484
|
-
"workspace": { "path": "/Users/me/.agent-workflow/
|
|
515
|
+
"workspace": { "path": "/Users/me/.agent-workflow/projects/codans/workspace/HAN-81", "branch": "agent/HAN-81", "ready": true },
|
|
485
516
|
"roles": {
|
|
486
517
|
"implementer": {
|
|
487
518
|
"agent": "claude", "session_id": "6f1c…", "pid": 12345, "status": "running", "turns": 1,
|
|
488
|
-
"log": "/Users/me/.agent-workflow/state/logs/HAN-81.implementer.log", "last_launch_at": "…"
|
|
519
|
+
"log": "/Users/me/.agent-workflow/projects/codans/state/logs/HAN-81.implementer.log", "last_launch_at": "…"
|
|
489
520
|
}
|
|
490
521
|
},
|
|
491
522
|
"run": {
|
|
@@ -503,4 +534,4 @@ agent 存活判定:pid 存在,且该 pid 所在进程组里有进程的 argv
|
|
|
503
534
|
- `run.cursor`:当前 step 的路径,`[2, 0]` 表示第 3 个 step(一个 `while`)循环体里的第 1 个;`run.loops` 记每个 `while` 已跑的轮数。`run.turn`:当前 step 正在等的 role。
|
|
504
535
|
- `note`:`note` step 写入,下一个 agent turn 用后清除。`parked_state`:`resolve cancel` 或 `on-timeout: cancel` 写入,工单离开该状态前不启动新 run。
|
|
505
536
|
- `deliveries`:每个交付名最新一份已接受交付的路径、结论、run 与时间。`roles.<r>.token`:当前 turn 的 token。`run.attention_state`:进入 attention 时工单所在(或被转去)的状态,人把工单改到别的 trigger 状态时 workflow 重新开始。`run.attention_kind`:attention 的类别,目前只有 `incomplete_delivery`(交付不完整,可 `resolve accept`)。
|
|
506
|
-
- 引擎只读 `version: 2` 的 ledger
|
|
537
|
+
- 引擎只读 `version: 2` 的 ledger,其他版本报错。旧文件被忽略:旧工单用 `forget` 删除 context,再让工单重新进入 trigger 状态。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gumpwang/agent-workflow",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Dispatch Linear or GitHub issues to coding agent CLIs through declarative workflows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "tsup",
|
|
27
27
|
"prepack": "tsup",
|
|
28
|
+
"release": "scripts/release.sh",
|
|
28
29
|
"dispatch": "./bin/agent-workflow dispatch",
|
|
29
30
|
"dispatch:dry": "./bin/agent-workflow dispatch --dry-run",
|
|
30
31
|
"dispatch:status": "./bin/agent-workflow status",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# agents.yaml — agent profiles, shared by every project.
|
|
2
|
+
#
|
|
3
|
+
# A workflow role names one (roles.<role>.agent in the workflow file); with a
|
|
4
|
+
# single profile every role uses it. The command runs under bash with the
|
|
5
|
+
# prompt on stdin and output appended to $LOG_FILE; it must keep $SESSION_ID on
|
|
6
|
+
# its command line, which is how the engine tells the agent from a recycled pid.
|
|
7
|
+
|
|
8
|
+
# With several profiles, roles that name no agent use this one.
|
|
9
|
+
# default_agent: claude
|
|
10
|
+
agents:
|
|
11
|
+
claude:
|
|
12
|
+
# claude: resume_command continues $SESSION_ID. none: every turn is a new session.
|
|
13
|
+
session: claude
|
|
14
|
+
command: |
|
|
15
|
+
claude -p --dangerously-skip-permissions --session-id "$SESSION_ID" --output-format stream-json --verbose
|
|
16
|
+
resume_command: |
|
|
17
|
+
claude -p --dangerously-skip-permissions --resume "$SESSION_ID" --output-format stream-json --verbose
|
package/templates/config.yaml
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
# ─────────────────────────────────────────────────────────────────────────
|
|
2
2
|
# config.yaml — agent-workflow configuration
|
|
3
3
|
#
|
|
4
|
-
# `agent-workflow init` copies
|
|
5
|
-
# $AGENT_WORKFLOW_HOME (default ~/.agent-workflow)
|
|
6
|
-
#
|
|
7
|
-
# copies freely. Relative prompt_file, resume_prompt_file and run paths in a
|
|
8
|
-
# workflow resolve against this rule set root.
|
|
4
|
+
# `agent-workflow init` copies the templates into the rule set,
|
|
5
|
+
# $AGENT_WORKFLOW_HOME (default ~/.agent-workflow). The engine reads only the
|
|
6
|
+
# rule set: edit these copies freely.
|
|
9
7
|
#
|
|
10
|
-
#
|
|
11
|
-
# coding agents
|
|
12
|
-
#
|
|
8
|
+
# config.yaml this file: the registered projects
|
|
9
|
+
# agents.yaml the coding agents
|
|
10
|
+
# projects/<name>/project.yaml the tracker, repo and workflows of one project
|
|
11
|
+
# workflows/ prompts/ handlers/ shared by every project
|
|
13
12
|
#
|
|
14
13
|
# Check the result with: agent-workflow validate
|
|
15
14
|
# ─────────────────────────────────────────────────────────────────────────
|
|
@@ -17,94 +16,7 @@
|
|
|
17
16
|
# Agents alive at the same time, across all projects. Remove for no limit.
|
|
18
17
|
max_concurrent: 3
|
|
19
18
|
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
|
|
24
|
-
# attention_state: In Review
|
|
25
|
-
|
|
26
|
-
# Agent profiles. A workflow role names one (roles.<role>.agent), a project can
|
|
27
|
-
# override it (projects.<name>.roles), and with a single profile every role
|
|
28
|
-
# uses it. The command runs under bash with the prompt on stdin and output
|
|
29
|
-
# appended to $LOG_FILE; it must keep $SESSION_ID on its command line, which is
|
|
30
|
-
# how the engine tells the agent from a recycled pid.
|
|
31
|
-
# With several profiles, roles that name no agent use this one.
|
|
32
|
-
# default_agent: claude
|
|
33
|
-
agents:
|
|
34
|
-
claude:
|
|
35
|
-
# claude: resume_command continues $SESSION_ID. none: every turn is a new session.
|
|
36
|
-
session: claude
|
|
37
|
-
command: |
|
|
38
|
-
claude -p --dangerously-skip-permissions --session-id "$SESSION_ID" --output-format stream-json --verbose
|
|
39
|
-
resume_command: |
|
|
40
|
-
claude -p --dangerously-skip-permissions --resume "$SESSION_ID" --output-format stream-json --verbose
|
|
41
|
-
|
|
42
|
-
# The per-ticket workspace, a git worktree on branch agent/<identifier>.
|
|
43
|
-
# path and branch are ${{ }} templates over ticket.* and project.*. provision
|
|
44
|
-
# runs before the first agent turn (and again when the directory is missing);
|
|
45
|
-
# cleanup runs when a ticket closes. Both get $ROOT, $WORKSPACE,
|
|
46
|
-
# $WORKSPACE_BRANCH and $ISSUE_* in the environment. A project may set its own.
|
|
47
|
-
# Without a workspace, agents work in the project root (not recommended).
|
|
48
|
-
workspace:
|
|
49
|
-
path: ~/.agent-workflow/workspaces/${{ project.name }}/${{ ticket.identifier }}
|
|
50
|
-
branch: agent/${{ ticket.identifier }}
|
|
51
|
-
provision: |
|
|
52
|
-
set -euo pipefail
|
|
53
|
-
mkdir -p "$(dirname "$WORKSPACE")"
|
|
54
|
-
git -C "$ROOT" fetch origin
|
|
55
|
-
if [ -e "$WORKSPACE/.git" ]; then
|
|
56
|
-
:
|
|
57
|
-
elif git -C "$ROOT" show-ref --verify --quiet "refs/heads/$WORKSPACE_BRANCH"; then
|
|
58
|
-
git -C "$ROOT" worktree add "$WORKSPACE" "$WORKSPACE_BRANCH"
|
|
59
|
-
else
|
|
60
|
-
git -C "$ROOT" worktree add "$WORKSPACE" -b "$WORKSPACE_BRANCH" origin/main
|
|
61
|
-
fi
|
|
62
|
-
cleanup: |
|
|
63
|
-
git -C "$ROOT" worktree remove "$WORKSPACE" --force 2>/dev/null || true
|
|
64
|
-
git -C "$ROOT" branch -D "$WORKSPACE_BRANCH" 2>/dev/null || true
|
|
65
|
-
git -C "$ROOT" worktree prune || true
|
|
66
|
-
|
|
67
|
-
# The key is the project name ([A-Za-z0-9_.-]): it shows up in workspace paths,
|
|
68
|
-
# reports and $PROJECT_NAME.
|
|
69
|
-
projects:
|
|
70
|
-
your-repo:
|
|
71
|
-
tracker:
|
|
72
|
-
kind: linear
|
|
73
|
-
# Linear project URL tail, e.g. https://linear.app/<team>/project/<this>.
|
|
74
|
-
slug: your-project-slug-000000000000
|
|
75
|
-
# $VAR reads the environment, then ~/.config/linear/api-key or ~/.linear-api-key.
|
|
76
|
-
api_key: $LINEAR_API_KEY
|
|
77
|
-
# Only tickets assigned to these users (id, email, name or display name;
|
|
78
|
-
# `me` is the key's owner). Remove to dispatch every ticket.
|
|
79
|
-
assignee: me
|
|
80
|
-
# States no workflow starts on that agents may still move a ticket to.
|
|
81
|
-
# With the trigger states of the enabled workflows they are the only
|
|
82
|
-
# states `agent-workflow ticket <ID> state` accepts.
|
|
83
|
-
other_states: ["In Review"]
|
|
84
|
-
# Workflow state name → this team's spelling, when they differ.
|
|
85
|
-
# state_alias: { Canceled: Cancelled }
|
|
86
|
-
# The canonical repo: $ROOT in hooks and steps.
|
|
87
|
-
root: ~/dev/00/your-repo
|
|
88
|
-
# Enabled workflows, in priority order: ids of files in workflows/.
|
|
89
|
-
workflows: [implement, merge, teardown]
|
|
90
|
-
|
|
91
|
-
# A project whose tickets are GitHub Issues. States are labels (Todo,
|
|
92
|
-
# In Progress, In Review, Merging); a closed issue is Closed; identifiers are
|
|
93
|
-
# <project name>-<issue number>, e.g. your-gh-repo-12.
|
|
94
|
-
# your-gh-repo:
|
|
95
|
-
# tracker:
|
|
96
|
-
# kind: github
|
|
97
|
-
# repo: your-org/your-gh-repo
|
|
98
|
-
# assignee: me
|
|
99
|
-
# # State labels no workflow starts on; changing state swaps them out too.
|
|
100
|
-
# # Open and Closed are always allowed.
|
|
101
|
-
# other_states: [Backlog, "In Review"]
|
|
102
|
-
# root: ~/dev/00/your-gh-repo
|
|
103
|
-
# workflows: [implement, merge, teardown]
|
|
104
|
-
# # GitHub has no Done / Canceled: tear down on a closed issue only.
|
|
105
|
-
# states: { teardown: [Closed] }
|
|
106
|
-
# # Per-workflow input values and role → agent overrides. For example, an
|
|
107
|
-
# # implementer / reviewer loop with the reviewer on another agent:
|
|
108
|
-
# # workflows: [review-loop, merge, teardown]
|
|
109
|
-
# # inputs: { review-loop: { max-rounds: 2 } }
|
|
110
|
-
# # roles: { reviewer: { agent: codex } }
|
|
19
|
+
# The projects `agent-workflow dispatch` runs (all of them unless the command
|
|
20
|
+
# names some). Each name ([A-Za-z0-9_.-]) is a directory projects/<name>/ with
|
|
21
|
+
# a project.yaml; it shows up in ticket identifiers, reports and $PROJECT_NAME.
|
|
22
|
+
projects: [your-repo]
|
|
@@ -33,7 +33,7 @@ set -euo pipefail
|
|
|
33
33
|
|
|
34
34
|
: "${ISSUE_IDENTIFIER:?ISSUE_IDENTIFIER required}"
|
|
35
35
|
: "${ROOT:?ROOT required}"
|
|
36
|
-
: "${WORKSPACE_BRANCH:?WORKSPACE_BRANCH required: set workspace.branch in
|
|
36
|
+
: "${WORKSPACE_BRANCH:?WORKSPACE_BRANCH required: set workspace.branch in project.yaml}"
|
|
37
37
|
: "${MERGE_DONE_STATE:?MERGE_DONE_STATE required: set it in the env of the merge workflow step}"
|
|
38
38
|
: "${MERGE_REWORK_STATE:?MERGE_REWORK_STATE required: set it in the env of the merge workflow step}"
|
|
39
39
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# workspace-cleanup.sh — remove the ticket's worktree and branch when it closes.
|
|
3
|
+
# Runs as workspace.cleanup with $ROOT, $WORKSPACE and $WORKSPACE_BRANCH set.
|
|
4
|
+
git -C "$ROOT" worktree remove "$WORKSPACE" --force 2>/dev/null || true
|
|
5
|
+
git -C "$ROOT" branch -D "$WORKSPACE_BRANCH" 2>/dev/null || true
|
|
6
|
+
git -C "$ROOT" worktree prune || true
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# workspace-provision.sh — create the ticket's git worktree on its branch.
|
|
3
|
+
# Runs as workspace.provision with $ROOT, $WORKSPACE and $WORKSPACE_BRANCH set.
|
|
4
|
+
# Reuses the branch when it exists, else branches off origin/main.
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
mkdir -p "$(dirname "$WORKSPACE")"
|
|
7
|
+
git -C "$ROOT" fetch origin
|
|
8
|
+
if [ -e "$WORKSPACE/.git" ]; then
|
|
9
|
+
:
|
|
10
|
+
elif git -C "$ROOT" show-ref --verify --quiet "refs/heads/$WORKSPACE_BRANCH"; then
|
|
11
|
+
git -C "$ROOT" worktree add "$WORKSPACE" "$WORKSPACE_BRANCH"
|
|
12
|
+
else
|
|
13
|
+
git -C "$ROOT" worktree add "$WORKSPACE" -b "$WORKSPACE_BRANCH" origin/main
|
|
14
|
+
fi
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# project.yaml — one project: which tracker, which repo, which workflows.
|
|
2
|
+
# The directory name (projects/<name>/) is the project name; list it under
|
|
3
|
+
# `projects` in config.yaml.
|
|
4
|
+
|
|
5
|
+
tracker:
|
|
6
|
+
kind: linear
|
|
7
|
+
# Linear project URL tail, e.g. https://linear.app/<team>/project/<this>.
|
|
8
|
+
slug: your-project-slug-000000000000
|
|
9
|
+
# $VAR reads the environment, then ~/.config/linear/api-key or ~/.linear-api-key.
|
|
10
|
+
api_key: $LINEAR_API_KEY
|
|
11
|
+
# Only tickets assigned to these users (id, email, name or display name;
|
|
12
|
+
# `me` is the key's owner). Remove to dispatch every ticket.
|
|
13
|
+
assignee: me
|
|
14
|
+
# States no workflow starts on that agents may still move a ticket to.
|
|
15
|
+
# With the trigger states of the enabled workflows they are the only
|
|
16
|
+
# states `agent-workflow ticket <ID> state` accepts.
|
|
17
|
+
other_states: ["In Review"]
|
|
18
|
+
# Workflow state name → this team's spelling, when they differ.
|
|
19
|
+
# state_alias: { Canceled: Cancelled }
|
|
20
|
+
|
|
21
|
+
# A project whose tickets are GitHub Issues instead. States are labels (Todo,
|
|
22
|
+
# In Progress, In Review, Merging); a closed issue is Closed; identifiers are
|
|
23
|
+
# <project name>-<issue number>, e.g. your-repo-12.
|
|
24
|
+
# tracker:
|
|
25
|
+
# kind: github
|
|
26
|
+
# repo: your-org/your-repo
|
|
27
|
+
# assignee: me
|
|
28
|
+
# # State labels no workflow starts on; changing state swaps them out too.
|
|
29
|
+
# # Open and Closed are always allowed.
|
|
30
|
+
# other_states: [Backlog, "In Review"]
|
|
31
|
+
# GitHub has no Done / Canceled: tear down on a closed issue only.
|
|
32
|
+
# states: { teardown: [Closed] }
|
|
33
|
+
|
|
34
|
+
# The canonical repo: $ROOT in hooks and steps.
|
|
35
|
+
root: ~/dev/00/your-repo
|
|
36
|
+
|
|
37
|
+
# When a run needs a human (the agent is blocked, kept ending without a
|
|
38
|
+
# delivery, …) the ticket gets a comment; with attention_state it also moves
|
|
39
|
+
# to that state. It must be a state no workflow starts on.
|
|
40
|
+
# attention_state: In Review
|
|
41
|
+
|
|
42
|
+
# The per-ticket workspace, a git worktree on branch agent/<identifier>.
|
|
43
|
+
# path (default projects/<name>/workspace/<identifier>) and branch are
|
|
44
|
+
# ${{ }} templates over ticket.* and project.*. provision runs before the
|
|
45
|
+
# first agent turn (and again when the directory is missing); cleanup runs
|
|
46
|
+
# when a ticket closes. Both get $ROOT, $WORKSPACE, $WORKSPACE_BRANCH and
|
|
47
|
+
# $ISSUE_* in the environment; a relative script path like the ones below is a
|
|
48
|
+
# file of the rule set, shared by every project. Without a workspace, agents
|
|
49
|
+
# work in the project root (not recommended).
|
|
50
|
+
workspace:
|
|
51
|
+
branch: agent/${{ ticket.identifier }}
|
|
52
|
+
provision: handlers/workspace-provision.sh
|
|
53
|
+
cleanup: handlers/workspace-cleanup.sh
|
|
54
|
+
|
|
55
|
+
# Ledger, run deliveries and agent logs. Default: projects/<name>/state.
|
|
56
|
+
# state:
|
|
57
|
+
# path: ~/somewhere/else
|
|
58
|
+
|
|
59
|
+
# Enabled workflows, in priority order: ids of files in workflows/.
|
|
60
|
+
workflows: [implement, merge, teardown]
|
|
61
|
+
# Per-workflow input values. For example, an implementer / reviewer loop:
|
|
62
|
+
# workflows: [review-loop, merge, teardown]
|
|
63
|
+
# inputs: { review-loop: { max-rounds: 2 } }
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
# clean, then the ticket goes to human review. Not enabled by default: put it
|
|
3
3
|
# in a project's `workflows` in place of implement, e.g.
|
|
4
4
|
# workflows: [review-loop, merge, teardown]
|
|
5
|
-
# and bind the reviewer to another agent if you like:
|
|
6
|
-
#
|
|
5
|
+
# and bind the reviewer to another agent profile of agents.yaml if you like:
|
|
6
|
+
# reviewer: { agent: codex, max_attempts: 2 }
|
|
7
7
|
#
|
|
8
8
|
# implementer delivers a handoff (done | blocked), like implement
|
|
9
9
|
# reviewer reviews the branch read-only, delivers review (clean | issues)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# teardown — the ticket is finished or dropped: stop its agents, remove the
|
|
2
2
|
# workspace and forget the ticket. GitHub projects usually override the states
|
|
3
|
-
# with `states: { teardown: [Closed] }` in
|
|
3
|
+
# with `states: { teardown: [Closed] }` in its project.yaml.
|
|
4
4
|
name: teardown
|
|
5
5
|
description: Stop agents and clean up when a ticket is finished or dropped
|
|
6
6
|
on:
|