dsh-gate-agent 0.1.5 → 0.1.7
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 +90 -29
- package/lib/index.js +402 -165
- package/package.json +1 -1
- package/skills/gate-write-agent-notes/SKILL.md +3 -1
- package/skills/gate-write-agent-notes/references/verification.md +3 -1
- package/skills/gate-diagnosing-bugs/SKILL.md +0 -143
- package/skills/gate-diagnosing-bugs/scripts/hitl-loop.template.sh +0 -44
- package/skills/gate-fix-bug/SKILL.md +0 -99
- package/skills/gate-fix-bug/assets/worker-briefs/fix-bug-review.md +0 -23
- package/skills/gate-fix-bug/assets/worker-briefs/gate-fix-bug.md +0 -33
package/README.md
CHANGED
|
@@ -60,15 +60,12 @@ Host 插件:用 phase/node 门禁组织讨论、规划、实施、评审、验
|
|
|
60
60
|
| phase / node | 用途 | 主代理/worker 与技能 |
|
|
61
61
|
|---|---|---|
|
|
62
62
|
| `discuss` | 理解需求、讨论方案、确认授权 | root;不派 worker;文件只读,可提交已有改动 |
|
|
63
|
-
| `orchestrating/plan` |
|
|
63
|
+
| `orchestrating/plan` | 规划,或 review findings 后修订 | planning worker(文件只读、只读 shell、`gate_note_write`);`gate-planning` + `gate-write-agent-notes` |
|
|
64
64
|
| `orchestrating/plan-review` | Plan Review 三轴评审 | review worker;`gate-plan-review` |
|
|
65
|
-
| `orchestrating/
|
|
66
|
-
| `orchestrating/implement` | 按已确认计划实施 | implement worker;`gate-implement` |
|
|
65
|
+
| `orchestrating/implement` | 实施,或 review/verify findings 后修正 | implement worker;`gate-implement` |
|
|
67
66
|
| `orchestrating/code-review` | 实现 review(Standards/Spec) | review worker;`gate-code-review` |
|
|
68
|
-
| `orchestrating/implement-revise` | 按 review findings 修正 | implement worker;`gate-implement` |
|
|
69
67
|
| `orchestrating/verify` | 最终验收与证据绑定 | verify worker;`gate-verify` |
|
|
70
68
|
| `orchestrating/note-lifecycle` | 把 proposed Note 转 implemented、跑 notes 校验 | root;`gate-write-agent-notes` lifecycle 工具 |
|
|
71
|
-
| `orchestrating/fix-bug` | 修复已授权缺陷并复核 | fix worker + review worker;`gate-fix-bug` + `gate-code-review` |
|
|
72
69
|
| `reviewing/code-review-standalone` | 单独只读 code review | review worker;`gate-code-review` |
|
|
73
70
|
| `reviewing/proposal-review` | 单独提案评审 | review worker;`gate-plan-review` |
|
|
74
71
|
| `reviewing/verify-standalone` | 单独只读验收 | verify worker;`gate-user-verify` |
|
|
@@ -78,6 +75,16 @@ Host 插件:用 phase/node 门禁组织讨论、规划、实施、评审、验
|
|
|
78
75
|
|
|
79
76
|
进入阶段不等于执行。主代理按当前 procedure 加载技能、派 worker,再用 `gate_record` 推进节点。
|
|
80
77
|
|
|
78
|
+
review findings 后不进入独立的 revise 节点:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
plan-review findings → plan → plan-review
|
|
82
|
+
code-review findings → implement → code-review
|
|
83
|
+
verify FAIL → implement → code-review
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
`plan` / `implement` 修订记录可省略 `workerSessionIds`;谁执行修订、是否复用或新开子代理由主代理判断,procedure 不规定。review 仍必须由独立 worker 完成。
|
|
87
|
+
|
|
81
88
|
## 权限
|
|
82
89
|
|
|
83
90
|
| 阶段/角色 | 文件写 | Note 写 | shell | 仓库写 |
|
|
@@ -85,7 +92,6 @@ Host 插件:用 phase/node 门禁组织讨论、规划、实施、评审、验
|
|
|
85
92
|
| discuss root | ❌ | ❌ | 只读 | add/commit/push |
|
|
86
93
|
| planning worker | ❌ | ✅ gate_note_write | 只读 | ❌ |
|
|
87
94
|
| plan-review / code-review / code-review-standalone / proposal-review worker | ❌ | ❌ | 只读 | ❌ |
|
|
88
|
-
| implement / implement-revise / fix-bug worker | ✅ | ❌ | 可写 | add/commit/push |
|
|
89
95
|
| verify / verify-standalone worker | ❌ | ❌ | 只读 | ❌ |
|
|
90
96
|
| note-lifecycle root | ✅ | ✅ lifecycle 工具 | 可写 | add/commit/push |
|
|
91
97
|
| docs root | ✅ | ❌ | 可写 | add/commit/push |
|
|
@@ -95,7 +101,7 @@ Host 插件:用 phase/node 门禁组织讨论、规划、实施、评审、验
|
|
|
95
101
|
|
|
96
102
|
- discuss 文件只读;要改文件先进入 plan/implement。提交已有改动用 git add/commit/push,不受文件只读影响。
|
|
97
103
|
- planning worker 的 shell 只读;产品文件和仓库写拒绝。
|
|
98
|
-
- implement
|
|
104
|
+
- implement worker 保留 push。
|
|
99
105
|
- access 会显示在 gate_status、/gate-status、gate_record、gate_start_phase、命令 follow-up 和 worker prompt:
|
|
100
106
|
|
|
101
107
|
```text
|
|
@@ -109,13 +115,12 @@ Host 插件:用 phase/node 门禁组织讨论、规划、实施、评审、验
|
|
|
109
115
|
| 命令 | 参数 | 作用 |
|
|
110
116
|
|---|---|---|
|
|
111
117
|
| `/gate-init` | 无 | 初始化 notes、AGENTS.md、`verify-notes`、CI、git 与基础 `.gitignore`,保持 `discuss` |
|
|
112
|
-
| `/gate-enter-plan [具体工作事项或上下文语义]` | 可选 |
|
|
113
|
-
| `/gate-enter-implement [具体工作事项或上下文语义]` | 可选 |
|
|
118
|
+
| `/gate-enter-plan [具体工作事项或上下文语义]` | 可选 | 进入 plan:planning worker 写/改 Note → plan-review 三轴评审;findings 回 plan 修订,通过后回 discuss |
|
|
119
|
+
| `/gate-enter-implement [具体工作事项或上下文语义]` | 可选 | 进入 implement:implement worker 实施 → code-review → verify;findings 回 implement;通过后 note-lifecycle 或 mechanical 回 discuss |
|
|
114
120
|
| `/gate-prd [主题或上下文语义]` | 可选 | 用户级创建/更新 PRD;仅 discuss |
|
|
115
121
|
| `/gate-docs [文档范围或上下文语义]` | 可选 | 进入文档治理,按项目文档规范处理 |
|
|
116
122
|
| `/gate-implement-review [具体工作事项或上下文语义]` | 可选 | 对当前改动做独立只读 code review,只输出 findings |
|
|
117
123
|
| `/gate-code-verify [具体工作事项或上下文语义]` | 可选 | 对当前改动做独立只读验收(gate-user-verify) |
|
|
118
|
-
| `/gate-fix-bug [具体工作事项或上下文语义]` | 可选 | 基于描述或当前上下文派 fix worker 修复已授权缺陷 |
|
|
119
124
|
| `/gate-propose-review [具体工作事项或上下文语义]` | 可选 | 对提案做独立只读三轴评审 |
|
|
120
125
|
| `/gate-note-verify` | 无 | 只读检查 notes tree/format/lifecycle/archived |
|
|
121
126
|
| `/gate-note-archive <note> [--superseded-by <new>]` | 必需 Note 路径 | 归档 implemented Note,写 Archived、移动、封印、报告入站链接 |
|
|
@@ -126,7 +131,7 @@ Host 插件:用 phase/node 门禁组织讨论、规划、实施、评审、验
|
|
|
126
131
|
| `/gate-return-discuss` | 无 | 放弃当前节点,回到 discuss |
|
|
127
132
|
| `/gate-status` | 无 | 只读显示当前 phase/node、procedure、access 与下一步命令 |
|
|
128
133
|
|
|
129
|
-
直接 implement(`/gate-enter-implement [具体工作事项或上下文语义]` 或 `gate_start_phase({node:'implement',brief})`)会自动标记 `mechanical`,跳过 Note lifecycle;不需要 `mechanical:` 前缀。plan
|
|
134
|
+
直接 implement(`/gate-enter-implement [具体工作事项或上下文语义]` 或 `gate_start_phase({node:'implement',brief})`)会自动标记 `mechanical`,跳过 Note lifecycle;不需要 `mechanical:` 前缀。plan 手动选择 `mechanical` 时也不要求前缀,只需 `notePaths: []`。
|
|
130
135
|
|
|
131
136
|
离开 discuss 的授权可来自对话(包括要求用户再输入 slash command)或 `ask_user_question`;明确授权后,主代理可调用 `gate_start_phase({node:'plan'|'implement', brief})`。
|
|
132
137
|
|
|
@@ -136,11 +141,10 @@ Host 插件:用 phase/node 门禁组织讨论、规划、实施、评审、验
|
|
|
136
141
|
|---|---|---|
|
|
137
142
|
| `gate-planning` | planning worker | 生成/更新规划 Note,组织工作项、验收和设计 |
|
|
138
143
|
| `gate-plan-review` | plan/proposal review worker | Standards/Spec/Architecture 三轴评审 |
|
|
139
|
-
| `gate-implement` | implement
|
|
144
|
+
| `gate-implement` | implement worker | 按计划实施并返回改动/验证结果 |
|
|
140
145
|
| `gate-code-review` | code review worker | 对实现做 Standards/Spec 两轴 review |
|
|
141
146
|
| `gate-verify` | verify worker | 最终验收、证据收集与汇报 |
|
|
142
147
|
| `gate-user-verify` | standalone verify worker | 独立只读验收 |
|
|
143
|
-
| `gate-fix-bug` | fix worker | 已授权缺陷修复流程 |
|
|
144
148
|
| `gate-write-agent-notes` | planning worker / root note lifecycle | Note 检索、格式、finalize/verify |
|
|
145
149
|
|
|
146
150
|
## 典型用法
|
|
@@ -153,6 +157,36 @@ Host 插件:用 phase/node 门禁组织讨论、规划、实施、评审、验
|
|
|
153
157
|
|
|
154
158
|
从 `discuss` 开始,不进入 planning/implement。
|
|
155
159
|
|
|
160
|
+
初始化会生成:
|
|
161
|
+
|
|
162
|
+
- `.agents/gate/verify-notes.mjs`
|
|
163
|
+
- `.agents/gate/ci/*.ts`
|
|
164
|
+
- `.agents/gate/artifact-policy.json`
|
|
165
|
+
- `.agents/gate/init-manifest.json`
|
|
166
|
+
|
|
167
|
+
`init-manifest.json` 记录生成物 hash、artifact-policy hash、AGENTS managed block、verify-notes script 和 notes 目录结构。它被 git 跟踪;同内容重跑 init 时字节稳定。
|
|
168
|
+
|
|
169
|
+
只读核对:
|
|
170
|
+
|
|
171
|
+
```text
|
|
172
|
+
gate_init_verify
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
它会检查:
|
|
176
|
+
|
|
177
|
+
- 5 个 CI 脚本 + launcher 的 SHA-256;
|
|
178
|
+
- `artifact-policy.json` 的 schema;用户修改后有效则显示 `customized`;
|
|
179
|
+
- AGENTS managed block;
|
|
180
|
+
- `scripts.verify-notes`;
|
|
181
|
+
- workflow 是否存在;
|
|
182
|
+
- notes 四目录结构。
|
|
183
|
+
|
|
184
|
+
不检查 Note 内容;Note 内容继续用:
|
|
185
|
+
|
|
186
|
+
```text
|
|
187
|
+
npm run verify-notes
|
|
188
|
+
```
|
|
189
|
+
|
|
156
190
|
### Planning
|
|
157
191
|
|
|
158
192
|
```text
|
|
@@ -170,7 +204,7 @@ gate_record({
|
|
|
170
204
|
})
|
|
171
205
|
```
|
|
172
206
|
|
|
173
|
-
进入 `plan-review`,由 review worker 做三轴评审;findings
|
|
207
|
+
进入 `plan-review`,由 review worker 做三轴评审;findings 记录后回到 `plan`;修订完成后可再次 review,直到通过后回 `discuss`,`planReady=true`。
|
|
174
208
|
|
|
175
209
|
### Implementation
|
|
176
210
|
|
|
@@ -178,7 +212,7 @@ gate_record({
|
|
|
178
212
|
/gate-enter-implement
|
|
179
213
|
```
|
|
180
214
|
|
|
181
|
-
主代理派 `gate-implement` worker 实施;完成后 `gate_record({node:'implement', workerSessionIds})` 进入 `code-review`。review 通过后进入 `verify`;verify PASS 后:非 mechanical 进入 `note-lifecycle`,mechanical 直接回 discuss 并提示提交。
|
|
215
|
+
主代理派 `gate-implement` worker 实施;完成后 `gate_record({node:'implement', workerSessionIds})` 进入 `code-review`。review findings 回到 `implement`,修复后再次 review;review 通过后进入 `verify`;verify PASS 后:非 mechanical 进入 `note-lifecycle`,mechanical 直接回 discuss 并提示提交。
|
|
182
216
|
|
|
183
217
|
Note lifecycle:
|
|
184
218
|
|
|
@@ -204,14 +238,6 @@ gate 不自动 `git add`/`git commit`;完成 note-lifecycle 后由用户或主
|
|
|
204
238
|
|
|
205
239
|
主代理派只读 verify worker,使用 `gate-user-verify`;PASS 后 `gate_record({node:'verify-standalone', verification, workerSessionIds})` 回 discuss。
|
|
206
240
|
|
|
207
|
-
### 缺陷修复
|
|
208
|
-
|
|
209
|
-
```text
|
|
210
|
-
/gate-fix-bug 修复空指针异常
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
主代理派 fix worker 执行修复,再派独立 review worker 复核;完成后 `gate_record({node:'fix-bug', workerSessionIds})`。
|
|
214
|
-
|
|
215
241
|
### 提案评审
|
|
216
242
|
|
|
217
243
|
```text
|
|
@@ -292,9 +318,10 @@ gate_record({
|
|
|
292
318
|
})
|
|
293
319
|
```
|
|
294
320
|
|
|
295
|
-
- `node`:`plan`、`plan-review`、`proposal-review`、`
|
|
296
|
-
- `plan` 必须带 `task
|
|
297
|
-
- worker 节点必须带当前 root 的、已 settled 的 child `workerSessionIds`。
|
|
321
|
+
- `node`:`plan`、`plan-review`、`proposal-review`、`implement`、`code-review`、`verify`、`verify-standalone`、`code-review-standalone`、`note-lifecycle`、`docs`。
|
|
322
|
+
- 首次 `plan` 必须带 `task`;review findings 后的修订记录不重置 task。
|
|
323
|
+
- 首次 plan/implement、review、verify 等 worker 节点必须带当前 root 的、已 settled 的 child `workerSessionIds`。
|
|
324
|
+
- plan/implement 修订记录可省略 workerSessionIds;root 自己修订时直接记录。
|
|
298
325
|
- `plan-review`/`proposal-review` 需要 Standards/Spec/Architecture 三轴;`code-review`/`code-review-standalone` 需要 Standards/Spec 两轴。
|
|
299
326
|
- `requiresDiscussion=true` 进入 blocked,等待用户决定。
|
|
300
327
|
- review 达到 `reviewLimit` 仍有 findings 时 blocked,不能靠重新进入 implement 绕过。
|
|
@@ -315,6 +342,20 @@ gate_status()
|
|
|
315
342
|
|
|
316
343
|
root-only;在 discuss 或 `orchestrating/plan` 派 research worker。worker 只能通过 artifact policy 写 research 文档,不获得通用 workspace 写。
|
|
317
344
|
|
|
345
|
+
### gate_init_verify
|
|
346
|
+
|
|
347
|
+
root-only 只读校验 `/gate-init` 产物:
|
|
348
|
+
|
|
349
|
+
- `.agents/gate/init-manifest.json` 是否存在且有效;
|
|
350
|
+
- 5 个 CI 脚本 + `verify-notes.mjs` 的 hash;
|
|
351
|
+
- `artifact-policy.json` schema(custom 有效也通过);
|
|
352
|
+
- AGENTS managed block;
|
|
353
|
+
- `scripts.verify-notes`;
|
|
354
|
+
- workflow 存在性;
|
|
355
|
+
- notes 四目录。
|
|
356
|
+
|
|
357
|
+
不修改文件,不运行 `verify-notes`;Note 内容校验仍用 `npm run verify-notes`。
|
|
358
|
+
|
|
318
359
|
### Note 工具
|
|
319
360
|
|
|
320
361
|
- `gate_note_write`:planning worker 写 proposed Note,或原地更新 implemented Note;通用 `write`/`edit`/`apply_patch` 和仓库写被拒绝,只读 shell 可用。
|
|
@@ -402,17 +443,16 @@ discuss 和 plan 默认不允许普通文件写。`handoff`、PRD、research 等
|
|
|
402
443
|
- `complete`
|
|
403
444
|
- `orchestrating/plan`
|
|
404
445
|
- `orchestrating/plan-review`
|
|
405
|
-
- `orchestrating/plan-revise`
|
|
406
446
|
- `orchestrating/implement`
|
|
407
447
|
- `orchestrating/code-review`
|
|
408
|
-
- `orchestrating/implement-revise`
|
|
409
448
|
- `orchestrating/verify`
|
|
410
449
|
- `orchestrating/note-lifecycle`
|
|
411
|
-
- `orchestrating/fix-bug`
|
|
412
450
|
- `reviewing/code-review-standalone`
|
|
413
451
|
- `reviewing/proposal-review`
|
|
414
452
|
- `reviewing/verify-standalone`
|
|
415
453
|
|
|
454
|
+
旧 artifact policy 中的 `orchestrating/plan-revise` / `orchestrating/implement-revise` 仍可解析,但当前状态不会再产生这些 key;可删除。
|
|
455
|
+
|
|
416
456
|
`*` 表示任意**非 blocked** 状态。`blocked` 始终拒绝,即使规则写了 `*`。
|
|
417
457
|
|
|
418
458
|
#### roles
|
|
@@ -527,6 +567,27 @@ discuss 和 plan 默认不允许普通文件写。`handoff`、PRD、research 等
|
|
|
527
567
|
|
|
528
568
|
`reviewLimit` 是每个 review 节点的最大轮次;默认 5,范围 1–20。达到上限仍有 findings 时进入 blocked。
|
|
529
569
|
|
|
570
|
+
它**不是项目文件**,而是 DSH profile 的插件 Config。当前 profile 的覆盖文件是:
|
|
571
|
+
|
|
572
|
+
```text
|
|
573
|
+
%USERPROFILE%\.dsh\profiles\<profile>\cordis.patch.yml
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
在 profile patch 中按 bundle 的 `id: gate` 覆盖:
|
|
577
|
+
|
|
578
|
+
```yaml
|
|
579
|
+
- id: gate
|
|
580
|
+
config:
|
|
581
|
+
reviewLimit: 8
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
- 没有 `gate` 条目时使用默认值 5;
|
|
585
|
+
- 修改后重启 DSH 才生效;
|
|
586
|
+
- 不要修改 `packages/gate/cordis.patch.yml` 来配置已有 profile;那是 bundle 默认层,profile patch 会覆盖它;
|
|
587
|
+
- 如果使用自定义 Agent Preset,配置应放在该 preset 中对应的 `dsh-gate-agent` 条目。
|
|
588
|
+
|
|
589
|
+
`.agents/gate/artifact-policy.json` 是项目级 artifact 白名单,与这里的插件 Config 是两套配置。
|
|
590
|
+
|
|
530
591
|
|
|
531
592
|
## 使用边界
|
|
532
593
|
|