agentic-flow-kit 0.9.4 → 1.0.0
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/modules/hosts/claude/commands/wf-new-task.md +1 -0
- package/modules/hosts/claude/commands/wf-pipeline-run.md +35 -0
- package/modules/hosts/codex/commands/wf-new-task.md +1 -0
- package/modules/hosts/codex/commands/wf-pipeline-run.md +35 -0
- package/modules/hosts/cursor/commands/wf-new-task.md +1 -0
- package/modules/hosts/cursor/commands/wf-pipeline-run.md +35 -0
- package/modules/hosts/opencode/commands/wf-new-task.md +1 -0
- package/modules/hosts/opencode/commands/wf-pipeline-run.md +35 -0
- package/modules/hosts/trae/commands/wf-new-task.md +1 -0
- package/modules/hosts/trae/commands/wf-pipeline-run.md +36 -0
- package/package.json +1 -1
- package/templates/_agents/commands/new-task.md +1 -0
- package/templates/_agents/commands/pipeline-run.md +43 -0
- package/templates/_agents/scripts/check-loop.mjs +12 -3
- package/templates/_agents/scripts/check-loop.test.mjs +55 -6
- package/templates/_agents/scripts/pipeline-run.mjs +999 -0
- package/templates/_agents/scripts/pipeline-run.test.mjs +537 -0
|
@@ -31,6 +31,7 @@ description: AI-Native 闭环总入口:6 阶段指令索引(Plan→Design→Buil
|
|
|
31
31
|
|
|
32
32
|
## 路由判断
|
|
33
33
|
|
|
34
|
+
- **自动化驱动(并列入口,可选)**:一句话全程走 [pipeline-run.md](pipeline-run.md)——状态机驱动+工单协议+原话代录,与下述手动路由二选一,同一任务不混用
|
|
34
35
|
- **新需求 / 功能**:从 `plan.md` 进,立 **intent**(`workflow/intents/`)
|
|
35
36
|
- **修复类任务 / 事故**:从 `maintain.md` 进,立 **incident**(`workflow/incidents/`);incident 在 L1+ 即 **intent 等价物**(check-loop 认 incident≡intent),不必另立 intent。先检索同类历史(`node .agents/scripts/kb-search.mjs "<关键词>" --scope workflow --type incidents,plans`),有同类先读其历史三件套;再按级别走:
|
|
36
37
|
- L0 → 直接修复;L1 → 立 incident 后进 `build.md` 起草并确认同名 Quick-Plan → `test.md`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: pipeline-run 自动化驱动入口——单命令驱动六阶段闭环(工单协议+机器门+原话代录)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# pipeline-run · 全自动闭环执行器入口
|
|
6
|
+
|
|
7
|
+
> 确定性部分由 `pipeline-run.mjs` 状态机驱动(机器门序列:fill-* → confirm-doc → verify.mjs → git,退出码全记录);
|
|
8
|
+
> AI 槽位经工单协议交宿主执行;人件门到点即停、原话代录。宿主只按本协议驱动,不自行改状态。
|
|
9
|
+
|
|
10
|
+
## 驱动协议(宿主 AI 逐条执行)
|
|
11
|
+
|
|
12
|
+
1. **启动**:`node .agents/scripts/pipeline-run.mjs start "<需求原文>"`(可预判则加 `--hint "kind=… level=… module=…"`)。
|
|
13
|
+
2. **循环读停机点**:每次命令的 stdout 末行是机器标记 `PIPELINE-STOP <type> …`,按 type 分流:
|
|
14
|
+
- `work-order <runId> <工单id>`——读工单全文(目标/步骤/约束/验收),**按单干活**:
|
|
15
|
+
- triage:判级回填 `next --triage "kind=… level=… module=… topic=<英文kebab>"`(就高不就低)
|
|
16
|
+
- draft:起草指定文档;implement/fix:按授权文件实现(**偏离即停**——公共接口/计划外文件/新依赖→停机向用户上报,不自行放行);review/closeout:按单产出并写入指定位
|
|
17
|
+
- 干完回跑 `next`(implement/fix 须 `--files "a,b"` 回填改动清单;review-only 汇报后 `--done` 收尾)
|
|
18
|
+
- `await-confirm <runId> <doc>`——**人件门**:向用户转述「要点」索确认;用户明确放行后
|
|
19
|
+
`next --delegated "<用户原话>"`(逐字原话,**永不编造、永不复用旧句**;一次一份)
|
|
20
|
+
- `gate-fail <runId> <stage>`——读 problems 原因,修复后原路重跑(不绕门、不加 `--no-verify`)
|
|
21
|
+
- `done <runId>`——向用户汇报总结(阶段条/门数/提交链),流程结束
|
|
22
|
+
- `aborted <runId>`——已显式放弃,汇报放弃态与留档位置
|
|
23
|
+
3. **放弃**:用户明确不做时 `abort --run <id> --to superseded|cancelled --delegated "<原话>"`(approved 文档逐份走 confirm-doc --to)。
|
|
24
|
+
4. **观测**(可选):`status [--run <id>] [--json]` 全量事件流水;`watch` 终端轮询视图。
|
|
25
|
+
|
|
26
|
+
## 硬纪律(违反即协议破坏)
|
|
27
|
+
|
|
28
|
+
- 状态迁移唯一入口是脚本内部的 confirm-doc 调用——宿主**永不直改** workflow 文档 frontmatter 状态。
|
|
29
|
+
- `--delegated` 的原话必须是用户当次对话原话(台账 `confirmations.jsonl` 留痕可对质)。
|
|
30
|
+
- 修复环超限(3 次)时停机交人工,不带病推进;verify 非绿不关单。
|
|
31
|
+
- run 文件(.agents/cache/pipeline-runs/)是脚本亲写的机器事实——宿主只读不写。
|
|
32
|
+
|
|
33
|
+
## 与 new-task 的关系
|
|
34
|
+
|
|
35
|
+
本命令是**自动化驱动的并列入口**(单命令走全程);new-task.md 是手动阶段路由入口。同一套门禁与确认语义,二者只选其一驱动一个任务,不混用。
|
|
@@ -31,6 +31,7 @@ description: AI-Native 闭环总入口:6 阶段指令索引(Plan→Design→Buil
|
|
|
31
31
|
|
|
32
32
|
## 路由判断
|
|
33
33
|
|
|
34
|
+
- **自动化驱动(并列入口,可选)**:一句话全程走 [pipeline-run.md](pipeline-run.md)——状态机驱动+工单协议+原话代录,与下述手动路由二选一,同一任务不混用
|
|
34
35
|
- **新需求 / 功能**:从 `plan.md` 进,立 **intent**(`workflow/intents/`)
|
|
35
36
|
- **修复类任务 / 事故**:从 `maintain.md` 进,立 **incident**(`workflow/incidents/`);incident 在 L1+ 即 **intent 等价物**(check-loop 认 incident≡intent),不必另立 intent。先检索同类历史(`node .agents/scripts/kb-search.mjs "<关键词>" --scope workflow --type incidents,plans`),有同类先读其历史三件套;再按级别走:
|
|
36
37
|
- L0 → 直接修复;L1 → 立 incident 后进 `build.md` 起草并确认同名 Quick-Plan → `test.md`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: pipeline-run 自动化驱动入口——单命令驱动六阶段闭环(工单协议+机器门+原话代录)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# pipeline-run · 全自动闭环执行器入口
|
|
6
|
+
|
|
7
|
+
> 确定性部分由 `pipeline-run.mjs` 状态机驱动(机器门序列:fill-* → confirm-doc → verify.mjs → git,退出码全记录);
|
|
8
|
+
> AI 槽位经工单协议交宿主执行;人件门到点即停、原话代录。宿主只按本协议驱动,不自行改状态。
|
|
9
|
+
|
|
10
|
+
## 驱动协议(宿主 AI 逐条执行)
|
|
11
|
+
|
|
12
|
+
1. **启动**:`node .agents/scripts/pipeline-run.mjs start "<需求原文>"`(可预判则加 `--hint "kind=… level=… module=…"`)。
|
|
13
|
+
2. **循环读停机点**:每次命令的 stdout 末行是机器标记 `PIPELINE-STOP <type> …`,按 type 分流:
|
|
14
|
+
- `work-order <runId> <工单id>`——读工单全文(目标/步骤/约束/验收),**按单干活**:
|
|
15
|
+
- triage:判级回填 `next --triage "kind=… level=… module=… topic=<英文kebab>"`(就高不就低)
|
|
16
|
+
- draft:起草指定文档;implement/fix:按授权文件实现(**偏离即停**——公共接口/计划外文件/新依赖→停机向用户上报,不自行放行);review/closeout:按单产出并写入指定位
|
|
17
|
+
- 干完回跑 `next`(implement/fix 须 `--files "a,b"` 回填改动清单;review-only 汇报后 `--done` 收尾)
|
|
18
|
+
- `await-confirm <runId> <doc>`——**人件门**:向用户转述「要点」索确认;用户明确放行后
|
|
19
|
+
`next --delegated "<用户原话>"`(逐字原话,**永不编造、永不复用旧句**;一次一份)
|
|
20
|
+
- `gate-fail <runId> <stage>`——读 problems 原因,修复后原路重跑(不绕门、不加 `--no-verify`)
|
|
21
|
+
- `done <runId>`——向用户汇报总结(阶段条/门数/提交链),流程结束
|
|
22
|
+
- `aborted <runId>`——已显式放弃,汇报放弃态与留档位置
|
|
23
|
+
3. **放弃**:用户明确不做时 `abort --run <id> --to superseded|cancelled --delegated "<原话>"`(approved 文档逐份走 confirm-doc --to)。
|
|
24
|
+
4. **观测**(可选):`status [--run <id>] [--json]` 全量事件流水;`watch` 终端轮询视图。
|
|
25
|
+
|
|
26
|
+
## 硬纪律(违反即协议破坏)
|
|
27
|
+
|
|
28
|
+
- 状态迁移唯一入口是脚本内部的 confirm-doc 调用——宿主**永不直改** workflow 文档 frontmatter 状态。
|
|
29
|
+
- `--delegated` 的原话必须是用户当次对话原话(台账 `confirmations.jsonl` 留痕可对质)。
|
|
30
|
+
- 修复环超限(3 次)时停机交人工,不带病推进;verify 非绿不关单。
|
|
31
|
+
- run 文件(.agents/cache/pipeline-runs/)是脚本亲写的机器事实——宿主只读不写。
|
|
32
|
+
|
|
33
|
+
## 与 new-task 的关系
|
|
34
|
+
|
|
35
|
+
本命令是**自动化驱动的并列入口**(单命令走全程);new-task.md 是手动阶段路由入口。同一套门禁与确认语义,二者只选其一驱动一个任务,不混用。
|
|
@@ -31,6 +31,7 @@ description: AI-Native 闭环总入口:6 阶段指令索引(Plan→Design→Buil
|
|
|
31
31
|
|
|
32
32
|
## 路由判断
|
|
33
33
|
|
|
34
|
+
- **自动化驱动(并列入口,可选)**:一句话全程走 [pipeline-run.md](pipeline-run.md)——状态机驱动+工单协议+原话代录,与下述手动路由二选一,同一任务不混用
|
|
34
35
|
- **新需求 / 功能**:从 `plan.md` 进,立 **intent**(`workflow/intents/`)
|
|
35
36
|
- **修复类任务 / 事故**:从 `maintain.md` 进,立 **incident**(`workflow/incidents/`);incident 在 L1+ 即 **intent 等价物**(check-loop 认 incident≡intent),不必另立 intent。先检索同类历史(`node .agents/scripts/kb-search.mjs "<关键词>" --scope workflow --type incidents,plans`),有同类先读其历史三件套;再按级别走:
|
|
36
37
|
- L0 → 直接修复;L1 → 立 incident 后进 `build.md` 起草并确认同名 Quick-Plan → `test.md`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: pipeline-run 自动化驱动入口——单命令驱动六阶段闭环(工单协议+机器门+原话代录)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# pipeline-run · 全自动闭环执行器入口
|
|
6
|
+
|
|
7
|
+
> 确定性部分由 `pipeline-run.mjs` 状态机驱动(机器门序列:fill-* → confirm-doc → verify.mjs → git,退出码全记录);
|
|
8
|
+
> AI 槽位经工单协议交宿主执行;人件门到点即停、原话代录。宿主只按本协议驱动,不自行改状态。
|
|
9
|
+
|
|
10
|
+
## 驱动协议(宿主 AI 逐条执行)
|
|
11
|
+
|
|
12
|
+
1. **启动**:`node .agents/scripts/pipeline-run.mjs start "<需求原文>"`(可预判则加 `--hint "kind=… level=… module=…"`)。
|
|
13
|
+
2. **循环读停机点**:每次命令的 stdout 末行是机器标记 `PIPELINE-STOP <type> …`,按 type 分流:
|
|
14
|
+
- `work-order <runId> <工单id>`——读工单全文(目标/步骤/约束/验收),**按单干活**:
|
|
15
|
+
- triage:判级回填 `next --triage "kind=… level=… module=… topic=<英文kebab>"`(就高不就低)
|
|
16
|
+
- draft:起草指定文档;implement/fix:按授权文件实现(**偏离即停**——公共接口/计划外文件/新依赖→停机向用户上报,不自行放行);review/closeout:按单产出并写入指定位
|
|
17
|
+
- 干完回跑 `next`(implement/fix 须 `--files "a,b"` 回填改动清单;review-only 汇报后 `--done` 收尾)
|
|
18
|
+
- `await-confirm <runId> <doc>`——**人件门**:向用户转述「要点」索确认;用户明确放行后
|
|
19
|
+
`next --delegated "<用户原话>"`(逐字原话,**永不编造、永不复用旧句**;一次一份)
|
|
20
|
+
- `gate-fail <runId> <stage>`——读 problems 原因,修复后原路重跑(不绕门、不加 `--no-verify`)
|
|
21
|
+
- `done <runId>`——向用户汇报总结(阶段条/门数/提交链),流程结束
|
|
22
|
+
- `aborted <runId>`——已显式放弃,汇报放弃态与留档位置
|
|
23
|
+
3. **放弃**:用户明确不做时 `abort --run <id> --to superseded|cancelled --delegated "<原话>"`(approved 文档逐份走 confirm-doc --to)。
|
|
24
|
+
4. **观测**(可选):`status [--run <id>] [--json]` 全量事件流水;`watch` 终端轮询视图。
|
|
25
|
+
|
|
26
|
+
## 硬纪律(违反即协议破坏)
|
|
27
|
+
|
|
28
|
+
- 状态迁移唯一入口是脚本内部的 confirm-doc 调用——宿主**永不直改** workflow 文档 frontmatter 状态。
|
|
29
|
+
- `--delegated` 的原话必须是用户当次对话原话(台账 `confirmations.jsonl` 留痕可对质)。
|
|
30
|
+
- 修复环超限(3 次)时停机交人工,不带病推进;verify 非绿不关单。
|
|
31
|
+
- run 文件(.agents/cache/pipeline-runs/)是脚本亲写的机器事实——宿主只读不写。
|
|
32
|
+
|
|
33
|
+
## 与 new-task 的关系
|
|
34
|
+
|
|
35
|
+
本命令是**自动化驱动的并列入口**(单命令走全程);new-task.md 是手动阶段路由入口。同一套门禁与确认语义,二者只选其一驱动一个任务,不混用。
|
|
@@ -31,6 +31,7 @@ description: AI-Native 闭环总入口 · 6 阶段路由(新需求 → plan /
|
|
|
31
31
|
|
|
32
32
|
## 路由判断
|
|
33
33
|
|
|
34
|
+
- **自动化驱动(并列入口,可选)**:一句话全程走 [pipeline-run.md](pipeline-run.md)——状态机驱动+工单协议+原话代录,与下述手动路由二选一,同一任务不混用
|
|
34
35
|
- **新需求 / 功能**:从 `plan.md` 进,立 **intent**(`workflow/intents/`)
|
|
35
36
|
- **修复类任务 / 事故**:从 `maintain.md` 进,立 **incident**(`workflow/incidents/`);incident 在 L1+ 即 **intent 等价物**(check-loop 认 incident≡intent),不必另立 intent。先检索同类历史(`node .agents/scripts/kb-search.mjs "<关键词>" --scope workflow --type incidents,plans`),有同类先读其历史三件套;再按级别走:
|
|
36
37
|
- L0 → 直接修复;L1 → 立 incident 后进 `build.md` 起草并确认同名 Quick-Plan → `test.md`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: pipeline-run 自动化驱动入口——单命令驱动六阶段闭环(工单协议+机器门+原话代录)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# pipeline-run · 全自动闭环执行器入口
|
|
6
|
+
|
|
7
|
+
> 确定性部分由 `pipeline-run.mjs` 状态机驱动(机器门序列:fill-* → confirm-doc → verify.mjs → git,退出码全记录);
|
|
8
|
+
> AI 槽位经工单协议交宿主执行;人件门到点即停、原话代录。宿主只按本协议驱动,不自行改状态。
|
|
9
|
+
|
|
10
|
+
## 驱动协议(宿主 AI 逐条执行)
|
|
11
|
+
|
|
12
|
+
1. **启动**:`node .agents/scripts/pipeline-run.mjs start "<需求原文>"`(可预判则加 `--hint "kind=… level=… module=…"`)。
|
|
13
|
+
2. **循环读停机点**:每次命令的 stdout 末行是机器标记 `PIPELINE-STOP <type> …`,按 type 分流:
|
|
14
|
+
- `work-order <runId> <工单id>`——读工单全文(目标/步骤/约束/验收),**按单干活**:
|
|
15
|
+
- triage:判级回填 `next --triage "kind=… level=… module=… topic=<英文kebab>"`(就高不就低)
|
|
16
|
+
- draft:起草指定文档;implement/fix:按授权文件实现(**偏离即停**——公共接口/计划外文件/新依赖→停机向用户上报,不自行放行);review/closeout:按单产出并写入指定位
|
|
17
|
+
- 干完回跑 `next`(implement/fix 须 `--files "a,b"` 回填改动清单;review-only 汇报后 `--done` 收尾)
|
|
18
|
+
- `await-confirm <runId> <doc>`——**人件门**:向用户转述「要点」索确认;用户明确放行后
|
|
19
|
+
`next --delegated "<用户原话>"`(逐字原话,**永不编造、永不复用旧句**;一次一份)
|
|
20
|
+
- `gate-fail <runId> <stage>`——读 problems 原因,修复后原路重跑(不绕门、不加 `--no-verify`)
|
|
21
|
+
- `done <runId>`——向用户汇报总结(阶段条/门数/提交链),流程结束
|
|
22
|
+
- `aborted <runId>`——已显式放弃,汇报放弃态与留档位置
|
|
23
|
+
3. **放弃**:用户明确不做时 `abort --run <id> --to superseded|cancelled --delegated "<原话>"`(approved 文档逐份走 confirm-doc --to)。
|
|
24
|
+
4. **观测**(可选):`status [--run <id>] [--json]` 全量事件流水;`watch` 终端轮询视图。
|
|
25
|
+
|
|
26
|
+
## 硬纪律(违反即协议破坏)
|
|
27
|
+
|
|
28
|
+
- 状态迁移唯一入口是脚本内部的 confirm-doc 调用——宿主**永不直改** workflow 文档 frontmatter 状态。
|
|
29
|
+
- `--delegated` 的原话必须是用户当次对话原话(台账 `confirmations.jsonl` 留痕可对质)。
|
|
30
|
+
- 修复环超限(3 次)时停机交人工,不带病推进;verify 非绿不关单。
|
|
31
|
+
- run 文件(.agents/cache/pipeline-runs/)是脚本亲写的机器事实——宿主只读不写。
|
|
32
|
+
|
|
33
|
+
## 与 new-task 的关系
|
|
34
|
+
|
|
35
|
+
本命令是**自动化驱动的并列入口**(单命令走全程);new-task.md 是手动阶段路由入口。同一套门禁与确认语义,二者只选其一驱动一个任务,不混用。
|
|
@@ -32,6 +32,7 @@ description: 闭环总入口 · 路由判断(新需求 → wf-plan / 修复
|
|
|
32
32
|
|
|
33
33
|
## 路由判断
|
|
34
34
|
|
|
35
|
+
- **自动化驱动(并列入口,可选)**:一句话全程走 [pipeline-run.md](pipeline-run.md)——状态机驱动+工单协议+原话代录,与下述手动路由二选一,同一任务不混用
|
|
35
36
|
- **新需求 / 功能**:从 `plan.md` 进,立 **intent**(`workflow/intents/`)
|
|
36
37
|
- **修复类任务 / 事故**:从 `maintain.md` 进,立 **incident**(`workflow/incidents/`);incident 在 L1+ 即 **intent 等价物**(check-loop 认 incident≡intent),不必另立 intent。先检索同类历史(`node .agents/scripts/kb-search.mjs "<关键词>" --scope workflow --type incidents,plans`),有同类先读其历史三件套;再按级别走:
|
|
37
38
|
- L0 → 直接修复;L1 → 立 incident 后进 `build.md` 起草并确认同名 Quick-Plan → `test.md`
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wf-pipeline-run
|
|
3
|
+
description: pipeline-run 自动化驱动入口——单命令驱动六阶段闭环(工单协议+机器门+原话代录)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# pipeline-run · 全自动闭环执行器入口
|
|
7
|
+
|
|
8
|
+
> 确定性部分由 `pipeline-run.mjs` 状态机驱动(机器门序列:fill-* → confirm-doc → verify.mjs → git,退出码全记录);
|
|
9
|
+
> AI 槽位经工单协议交宿主执行;人件门到点即停、原话代录。宿主只按本协议驱动,不自行改状态。
|
|
10
|
+
|
|
11
|
+
## 驱动协议(宿主 AI 逐条执行)
|
|
12
|
+
|
|
13
|
+
1. **启动**:`node .agents/scripts/pipeline-run.mjs start "<需求原文>"`(可预判则加 `--hint "kind=… level=… module=…"`)。
|
|
14
|
+
2. **循环读停机点**:每次命令的 stdout 末行是机器标记 `PIPELINE-STOP <type> …`,按 type 分流:
|
|
15
|
+
- `work-order <runId> <工单id>`——读工单全文(目标/步骤/约束/验收),**按单干活**:
|
|
16
|
+
- triage:判级回填 `next --triage "kind=… level=… module=… topic=<英文kebab>"`(就高不就低)
|
|
17
|
+
- draft:起草指定文档;implement/fix:按授权文件实现(**偏离即停**——公共接口/计划外文件/新依赖→停机向用户上报,不自行放行);review/closeout:按单产出并写入指定位
|
|
18
|
+
- 干完回跑 `next`(implement/fix 须 `--files "a,b"` 回填改动清单;review-only 汇报后 `--done` 收尾)
|
|
19
|
+
- `await-confirm <runId> <doc>`——**人件门**:向用户转述「要点」索确认;用户明确放行后
|
|
20
|
+
`next --delegated "<用户原话>"`(逐字原话,**永不编造、永不复用旧句**;一次一份)
|
|
21
|
+
- `gate-fail <runId> <stage>`——读 problems 原因,修复后原路重跑(不绕门、不加 `--no-verify`)
|
|
22
|
+
- `done <runId>`——向用户汇报总结(阶段条/门数/提交链),流程结束
|
|
23
|
+
- `aborted <runId>`——已显式放弃,汇报放弃态与留档位置
|
|
24
|
+
3. **放弃**:用户明确不做时 `abort --run <id> --to superseded|cancelled --delegated "<原话>"`(approved 文档逐份走 confirm-doc --to)。
|
|
25
|
+
4. **观测**(可选):`status [--run <id>] [--json]` 全量事件流水;`watch` 终端轮询视图。
|
|
26
|
+
|
|
27
|
+
## 硬纪律(违反即协议破坏)
|
|
28
|
+
|
|
29
|
+
- 状态迁移唯一入口是脚本内部的 confirm-doc 调用——宿主**永不直改** workflow 文档 frontmatter 状态。
|
|
30
|
+
- `--delegated` 的原话必须是用户当次对话原话(台账 `confirmations.jsonl` 留痕可对质)。
|
|
31
|
+
- 修复环超限(3 次)时停机交人工,不带病推进;verify 非绿不关单。
|
|
32
|
+
- run 文件(.agents/cache/pipeline-runs/)是脚本亲写的机器事实——宿主只读不写。
|
|
33
|
+
|
|
34
|
+
## 与 new-task 的关系
|
|
35
|
+
|
|
36
|
+
本命令是**自动化驱动的并列入口**(单命令走全程);new-task.md 是手动阶段路由入口。同一套门禁与确认语义,二者只选其一驱动一个任务,不混用。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-flow-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "AI-Native 闭环工作流 + wiki 知识层脚手架——flow-kit init 一条命令为新项目装好 .agents 工作流引擎(阶段命令/角色契约/门禁钩子/kb 检索/看板/规则面预算)+ workflow 文档闭环 + wiki 知识库,装完自包含、零运行时依赖",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -39,6 +39,7 @@ next: 按阶段路由
|
|
|
39
39
|
|
|
40
40
|
## 路由判断
|
|
41
41
|
|
|
42
|
+
- **自动化驱动(并列入口,可选)**:一句话全程走 [pipeline-run.md](pipeline-run.md)——状态机驱动+工单协议+原话代录,与下述手动路由二选一,同一任务不混用
|
|
42
43
|
- **新需求 / 功能**:从 `plan.md` 进,立 **intent**(`workflow/intents/`)
|
|
43
44
|
- **修复类任务 / 事故**:从 `maintain.md` 进,立 **incident**(`workflow/incidents/`);incident 在 L1+ 即 **intent 等价物**(check-loop 认 incident≡intent),不必另立 intent。先检索同类历史(`node .agents/scripts/kb-search.mjs "<关键词>" --scope workflow --type incidents,plans`),有同类先读其历史三件套;再按级别走:
|
|
44
45
|
- L0 → 直接修复;L1 → 立 incident 后进 `build.md` 起草并确认同名 Quick-Plan → `test.md`
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: pipeline-run 自动化驱动入口——单命令驱动六阶段闭环(工单协议+机器门+原话代录)
|
|
3
|
+
stage: entry
|
|
4
|
+
triggers:
|
|
5
|
+
- "pipeline-run"
|
|
6
|
+
- "跑执行器"
|
|
7
|
+
- "全自动跑"
|
|
8
|
+
approval_required: true
|
|
9
|
+
fallback: 主智能体亲自做 AI 槽位(工单由主智能体完成,不依赖子智能体)
|
|
10
|
+
next: 按 run 停机点循环推进至 done
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# pipeline-run · 全自动闭环执行器入口
|
|
14
|
+
|
|
15
|
+
> 确定性部分由 `pipeline-run.mjs` 状态机驱动(机器门序列:fill-* → confirm-doc → verify.mjs → git,退出码全记录);
|
|
16
|
+
> AI 槽位经工单协议交宿主执行;人件门到点即停、原话代录。宿主只按本协议驱动,不自行改状态。
|
|
17
|
+
|
|
18
|
+
## 驱动协议(宿主 AI 逐条执行)
|
|
19
|
+
|
|
20
|
+
1. **启动**:`node .agents/scripts/pipeline-run.mjs start "<需求原文>"`(可预判则加 `--hint "kind=… level=… module=…"`)。
|
|
21
|
+
2. **循环读停机点**:每次命令的 stdout 末行是机器标记 `PIPELINE-STOP <type> …`,按 type 分流:
|
|
22
|
+
- `work-order <runId> <工单id>`——读工单全文(目标/步骤/约束/验收),**按单干活**:
|
|
23
|
+
- triage:判级回填 `next --triage "kind=… level=… module=… topic=<英文kebab>"`(就高不就低)
|
|
24
|
+
- draft:起草指定文档;implement/fix:按授权文件实现(**偏离即停**——公共接口/计划外文件/新依赖→停机向用户上报,不自行放行);review/closeout:按单产出并写入指定位
|
|
25
|
+
- 干完回跑 `next`(implement/fix 须 `--files "a,b"` 回填改动清单;review-only 汇报后 `--done` 收尾)
|
|
26
|
+
- `await-confirm <runId> <doc>`——**人件门**:向用户转述「要点」索确认;用户明确放行后
|
|
27
|
+
`next --delegated "<用户原话>"`(逐字原话,**永不编造、永不复用旧句**;一次一份)
|
|
28
|
+
- `gate-fail <runId> <stage>`——读 problems 原因,修复后原路重跑(不绕门、不加 `--no-verify`)
|
|
29
|
+
- `done <runId>`——向用户汇报总结(阶段条/门数/提交链),流程结束
|
|
30
|
+
- `aborted <runId>`——已显式放弃,汇报放弃态与留档位置
|
|
31
|
+
3. **放弃**:用户明确不做时 `abort --run <id> --to superseded|cancelled --delegated "<原话>"`(approved 文档逐份走 confirm-doc --to)。
|
|
32
|
+
4. **观测**(可选):`status [--run <id>] [--json]` 全量事件流水;`watch` 终端轮询视图。
|
|
33
|
+
|
|
34
|
+
## 硬纪律(违反即协议破坏)
|
|
35
|
+
|
|
36
|
+
- 状态迁移唯一入口是脚本内部的 confirm-doc 调用——宿主**永不直改** workflow 文档 frontmatter 状态。
|
|
37
|
+
- `--delegated` 的原话必须是用户当次对话原话(台账 `confirmations.jsonl` 留痕可对质)。
|
|
38
|
+
- 修复环超限(3 次)时停机交人工,不带病推进;verify 非绿不关单。
|
|
39
|
+
- run 文件(.agents/cache/pipeline-runs/)是脚本亲写的机器事实——宿主只读不写。
|
|
40
|
+
|
|
41
|
+
## 与 new-task 的关系
|
|
42
|
+
|
|
43
|
+
本命令是**自动化驱动的并列入口**(单命令走全程);new-task.md 是手动阶段路由入口。同一套门禁与确认语义,二者只选其一驱动一个任务,不混用。
|
|
@@ -608,9 +608,18 @@ function verifyEvidenceTruth(evidenceStr, planBase, root) {
|
|
|
608
608
|
|
|
609
609
|
const changedFiles = show.stdout.split(/\r?\n/).filter(Boolean);
|
|
610
610
|
const hasIntersection = changedFiles.some(f => declaredFiles.some(df => f.includes(df) || df.includes(f)));
|
|
611
|
-
|
|
612
|
-
if (!hasIntersection)
|
|
613
|
-
|
|
611
|
+
|
|
612
|
+
if (!hasIntersection) {
|
|
613
|
+
// 过程证据(2026-10-03 check-evidence-process):执行器驱动的提交可作验收证据——提交信息带
|
|
614
|
+
// 「pipeline-run <runId>」标记(docsCommit 四种格式共有段,runId 严格形态 日期8-时间4-主题-尾;
|
|
615
|
+
// 与 run 事件流同源,git 历史留痕可对质)。只救 irrelevant:forged(SHA 不存在)在前已判,其余判据不动。
|
|
616
|
+
const subj = spawnSync(GIT, ['log', '-1', '--format=%s', sha], { cwd: ROOT, encoding: 'utf8' });
|
|
617
|
+
if (subj.status === 0 && /pipeline-run [0-9]{8}-[0-9]{4}-[A-Za-z0-9-]+/.test(subj.stdout)) {
|
|
618
|
+
return { ok: true, type: 'process' };
|
|
619
|
+
}
|
|
620
|
+
return { ok: false, type: 'irrelevant', msg: `提交 ${sha} 未触及 plan 声明的任何文件` };
|
|
621
|
+
}
|
|
622
|
+
|
|
614
623
|
return { ok: true, type: 'sha' };
|
|
615
624
|
}
|
|
616
625
|
|
|
@@ -599,6 +599,44 @@ const mkConfirmedDoc = (root, rel, fmBody) => {
|
|
|
599
599
|
r.status === 0 && !outOf(r).includes('模板未填'), `exit=${r.status}\n${outOf(r)}`);
|
|
600
600
|
rmfix(T);
|
|
601
601
|
}
|
|
602
|
+
|
|
603
|
+
// ---- 场景 5x/5y/5z:检查 8 证据核验——过程证据形态(2026-10-03 check-evidence-process)----
|
|
604
|
+
// 造法:gitInit(激活证据核验的 rev-parse 路径)+ 锚前自报日期(豁免检查 15 存量面);
|
|
605
|
+
// 证据引用「改动面外文件的提交」:带执行器标记 → process 放行;无标记 → irrelevant 拦;SHA 不存在 → forged 拦。
|
|
606
|
+
{
|
|
607
|
+
const T = mkfix();
|
|
608
|
+
gitInit(T);
|
|
609
|
+
w(T, 'workflow/plans/2026-09-26-pe1.md', PLAN('pe1', '状态: done\n级别: L1\n模块: material', '\n## 改动方案\n\n- src/app.mjs:实现功能\n'));
|
|
610
|
+
fs.mkdirSync(path.join(T, 'notes'), { recursive: true });
|
|
611
|
+
w(T, 'notes/other.md', 'x\n');
|
|
612
|
+
gitCommitAll(T, 'docs(x): 演练穿越(pipeline-run 20260926-0900-pe1-abc1)');
|
|
613
|
+
const G = process.platform === 'win32' ? 'git.exe' : 'git';
|
|
614
|
+
const sha = spawnSync(G, ['rev-parse', '--short', 'HEAD'], { cwd: T, encoding: 'utf8' }).stdout.trim();
|
|
615
|
+
w(T, 'workflow/intents/2026-09-26-pe1.md', INTENT('pe1', '状态: done\n级别: L1\n日期: 2026-09-26', `\n## 验收标准(可测试)\n- [x] 演练穿越(证据:${sha})\n`));
|
|
616
|
+
expectOk('过程证据:提交信息带执行器标记(改动面外)→ 放行 exit 0', T);
|
|
617
|
+
rmfix(T);
|
|
618
|
+
}
|
|
619
|
+
{
|
|
620
|
+
const T = mkfix();
|
|
621
|
+
gitInit(T);
|
|
622
|
+
w(T, 'workflow/plans/2026-09-26-pe2.md', PLAN('pe2', '状态: done\n级别: L1\n模块: material', '\n## 改动方案\n\n- src/app.mjs:实现功能\n'));
|
|
623
|
+
fs.mkdirSync(path.join(T, 'notes'), { recursive: true });
|
|
624
|
+
w(T, 'notes/other.md', 'x\n');
|
|
625
|
+
gitCommitAll(T, 'docs(x): 演练穿越(L0,无标记提交)');
|
|
626
|
+
const G = process.platform === 'win32' ? 'git.exe' : 'git';
|
|
627
|
+
const sha = spawnSync(G, ['rev-parse', '--short', 'HEAD'], { cwd: T, encoding: 'utf8' }).stdout.trim();
|
|
628
|
+
w(T, 'workflow/intents/2026-09-26-pe2.md', INTENT('pe2', '状态: done\n级别: L1\n日期: 2026-09-26', `\n## 验收标准(可测试)\n- [x] 演练穿越(证据:${sha})\n`));
|
|
629
|
+
expectHard('过程证据:无标记无关提交 → 仍拦 证据无关', T, '证据无关');
|
|
630
|
+
rmfix(T);
|
|
631
|
+
}
|
|
632
|
+
{
|
|
633
|
+
const T = mkfix();
|
|
634
|
+
gitInit(T);
|
|
635
|
+
w(T, 'workflow/plans/2026-09-26-pe3.md', PLAN('pe3', '状态: done\n级别: L1\n模块: material', '\n## 改动方案\n\n- src/app.mjs:实现功能\n'));
|
|
636
|
+
w(T, 'workflow/intents/2026-09-26-pe3.md', INTENT('pe3', '状态: done\n级别: L1\n日期: 2026-09-26', '\n## 验收标准(可测试)\n- [x] 演练穿越(证据:deadbee)\n'));
|
|
637
|
+
expectHard('过程证据:SHA 不存在 → forged 仍拦(防伪线不放松)', T, '证据伪造');
|
|
638
|
+
rmfix(T);
|
|
639
|
+
}
|
|
602
640
|
// ---- 场景 45:检查 2——真未填占位(标题 <主题>,无 .md)→ 仍报模板未填 ----
|
|
603
641
|
{
|
|
604
642
|
const T = mkfix();
|
|
@@ -1676,14 +1714,25 @@ const mkConfirmedDoc = (root, rel, fmBody) => {
|
|
|
1676
1714
|
w(T, 'workflow/plans/2026-09-29-after.md', PLAN('after', '状态: draft\n级别: L1'));
|
|
1677
1715
|
gitCommitAll(T, 'draft after release');
|
|
1678
1716
|
r = run(T, { git: true });
|
|
1679
|
-
|
|
1680
|
-
|
|
1717
|
+
check('检查17 发版之后新建的 draft 不拦', r.status === 0 && !outOf(r).includes('发版草稿'), `exit=${r.status}\n${outOf(r)}`);
|
|
1718
|
+
rmfix(T);
|
|
1681
1719
|
}
|
|
1682
1720
|
{
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1721
|
+
const T = mkfix();
|
|
1722
|
+
gitInit(T);
|
|
1723
|
+
w(T, 'package.json', '{"name":"t","version":"0.1.0"}\n');
|
|
1724
|
+
w(T, 'workflow/incidents/2026-09-12-inc17.md', `---\n状态: open\n级别: L1\n发现: 2026-09-12\n模块: pipeline\n---\n# INCIDENT — inc17\n\n${三件套(false)}`);
|
|
1725
|
+
w(T, 'workflow/plans/2026-09-12-inc17.md', PLAN('inc17', '状态: draft\n级别: L1\n模块: pipeline'));
|
|
1726
|
+
gitCommitAll(T, 'v0.1.0');
|
|
1727
|
+
const r = run(T, { git: true });
|
|
1728
|
+
check('检查17 发版树上的 open incident 不参与(阻断由 plan 触发且不含 incident 路径)', r.status === 1 && outOf(r).includes('发版草稿') && !outOf(r).includes('workflow/incidents/2026-09-12-inc17.md'), `exit=${r.status}\n${outOf(r)}`);
|
|
1729
|
+
rmfix(T);
|
|
1730
|
+
}
|
|
1731
|
+
{
|
|
1732
|
+
const T = mkfix();
|
|
1733
|
+
gitInit(T);
|
|
1734
|
+
w(T, 'package.json', '{"name":"t","version":"0.1.0"}\n');
|
|
1735
|
+
w(T, 'workflow/intents/2026-09-12-deep.md', INTENT('deep', '状态: draft\n级别: L1\n日期: 2026-09-12'));
|
|
1687
1736
|
w(T, 'workflow/plans/2026-09-12-deep.md', PLAN('deep', '状态: draft\n级别: L1'));
|
|
1688
1737
|
gitCommitAll(T, 'v0.1.0');
|
|
1689
1738
|
for (let i = 1; i <= 41; i++) {
|