@guanlin4924/devflow-pi 0.1.13 → 0.1.15
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/package.json +1 -1
- package/plugins/devflow-core/extensions/devflow-core.ts +119 -12
- package/plugins/devflow-core/skills/workflow-orchestrator/SKILL.md +4 -4
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/advance_state.rb +47 -15
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/control_io.rb +42 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/init_state.rb +21 -2
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/phase_ownership.rb +154 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/repair_control_plane.rb +35 -26
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/sync_artifacts.rb +18 -7
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/traceability_check.py +160 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/validate_state.rb +60 -8
- package/plugins/devflow-core/skills/workflow-orchestrator/templates/feature-development.yaml +25 -3
- package/plugins/devflow-core/skills/workflow-orchestrator/templates/traceability.json +23 -0
- package/plugins/devflow-design/skills/workflow-api-contract/SKILL.md +4 -1
- package/plugins/devflow-design/skills/workflow-backend-tech-spec/SKILL.md +4 -0
- package/plugins/devflow-design/skills/workflow-frontend-tech-spec/SKILL.md +4 -0
- package/plugins/devflow-design/skills/workflow-integration-verify/SKILL.md +10 -0
- package/plugins/devflow-implementation/skills/workflow-change-plan/SKILL.md +8 -0
- package/plugins/devflow-requirements/skills/workflow-requirement-baseline/SKILL.md +9 -0
package/plugins/devflow-core/skills/workflow-orchestrator/templates/feature-development.yaml
CHANGED
|
@@ -126,6 +126,7 @@ checkpoints:
|
|
|
126
126
|
producing_step: requirement-baseline
|
|
127
127
|
required_outputs:
|
|
128
128
|
- ".planning/requirements/baseline.md"
|
|
129
|
+
- ".planning/requirements/{feature}/traceability.json"
|
|
129
130
|
required_meta_output: ".planning/requirements/baseline.meta.json"
|
|
130
131
|
required_meta_fields:
|
|
131
132
|
- review_status
|
|
@@ -138,6 +139,7 @@ checkpoints:
|
|
|
138
139
|
- code_reality_missing_count
|
|
139
140
|
- current_feature
|
|
140
141
|
- depends_on_count
|
|
142
|
+
- traceability_status
|
|
141
143
|
summary_fields:
|
|
142
144
|
- fp_count
|
|
143
145
|
- br_count
|
|
@@ -146,9 +148,10 @@ checkpoints:
|
|
|
146
148
|
- critical_image_missing_count
|
|
147
149
|
- challenge_pending_count
|
|
148
150
|
- code_reality_missing_count
|
|
151
|
+
- traceability_status
|
|
149
152
|
- key_decisions
|
|
150
153
|
- risks
|
|
151
|
-
prompt: "
|
|
154
|
+
prompt: "确认需求基线和需求追溯清单均完整;每个 REQ 都有六维验收定义,并允许进入 UI/功能拆解和技术方案阶段。"
|
|
152
155
|
confirm_options:
|
|
153
156
|
- approve
|
|
154
157
|
- needs_fix
|
|
@@ -196,6 +199,7 @@ checkpoints:
|
|
|
196
199
|
- contract_frontend_mismatch_count
|
|
197
200
|
- unhandled_api_supplement_count
|
|
198
201
|
- blocking_issue_count
|
|
202
|
+
- traceability_status
|
|
199
203
|
summary_fields:
|
|
200
204
|
- merge_gate_status
|
|
201
205
|
- api_required
|
|
@@ -203,7 +207,8 @@ checkpoints:
|
|
|
203
207
|
- contract_frontend_mismatch_count
|
|
204
208
|
- unhandled_api_supplement_count
|
|
205
209
|
- blocking_issue_count
|
|
206
|
-
|
|
210
|
+
- traceability_status
|
|
211
|
+
prompt: "确认 API 契约、后端方案、前端调用三方一致,且所有 REQ 都已有设计覆盖,并允许进入变更清单。"
|
|
207
212
|
confirm_options:
|
|
208
213
|
- approve
|
|
209
214
|
- needs_fix
|
|
@@ -215,13 +220,19 @@ checkpoints:
|
|
|
215
220
|
producing_step: change-plan
|
|
216
221
|
required_outputs:
|
|
217
222
|
- ".planning/features/{feature}/变更清单.md"
|
|
223
|
+
- ".planning/features/{feature}/变更清单.meta.json"
|
|
224
|
+
required_meta_output: ".planning/features/{feature}/变更清单.meta.json"
|
|
225
|
+
required_meta_fields:
|
|
226
|
+
- traceability_status
|
|
227
|
+
- uncovered_requirement_count
|
|
228
|
+
- orphan_task_count
|
|
218
229
|
summary_fields:
|
|
219
230
|
- task_count
|
|
220
231
|
- ddl_count
|
|
221
232
|
- migration_steps
|
|
222
233
|
- verification_steps
|
|
223
234
|
- risks
|
|
224
|
-
prompt: "确认变更清单中的 DDL
|
|
235
|
+
prompt: "确认变更清单中的 DDL、代码任务、上线步骤和验收标准可执行;每项 REQ 都有任务、每项任务都有 REQ 来源,并允许进入代码执行。"
|
|
225
236
|
confirm_options:
|
|
226
237
|
- approve
|
|
227
238
|
- needs_fix
|
|
@@ -379,6 +390,9 @@ steps:
|
|
|
379
390
|
- path: ".planning/requirements/baseline.md"
|
|
380
391
|
type: requirement-baseline
|
|
381
392
|
required: true
|
|
393
|
+
- path: ".planning/requirements/{feature}/traceability.json"
|
|
394
|
+
type: requirement-traceability
|
|
395
|
+
required: true
|
|
382
396
|
meta_output:
|
|
383
397
|
path: ".planning/requirements/baseline.meta.json"
|
|
384
398
|
fields:
|
|
@@ -395,6 +409,7 @@ steps:
|
|
|
395
409
|
pending_items: { type: array, required: false }
|
|
396
410
|
risks: { type: array, required: false }
|
|
397
411
|
key_decisions: { type: array, max: 5, required: false }
|
|
412
|
+
traceability_status: { type: string, required: true }
|
|
398
413
|
checkpoint: CP-1
|
|
399
414
|
|
|
400
415
|
- id: api-contract
|
|
@@ -420,6 +435,7 @@ steps:
|
|
|
420
435
|
breaking_change_count: { type: integer, required: true }
|
|
421
436
|
permission_rule_count: { type: integer, required: true }
|
|
422
437
|
error_case_count: { type: integer, required: true }
|
|
438
|
+
traceability_status: { type: string, required: true }
|
|
423
439
|
checkpoint: CP-API
|
|
424
440
|
|
|
425
441
|
- id: ui-spec
|
|
@@ -587,6 +603,12 @@ steps:
|
|
|
587
603
|
- path: ".planning/features/{feature}/变更清单.md"
|
|
588
604
|
type: change-plan
|
|
589
605
|
required: true
|
|
606
|
+
meta_output:
|
|
607
|
+
path: ".planning/features/{feature}/变更清单.meta.json"
|
|
608
|
+
fields:
|
|
609
|
+
traceability_status: { type: string, required: true }
|
|
610
|
+
uncovered_requirement_count: { type: integer, required: true }
|
|
611
|
+
orphan_task_count: { type: integer, required: true }
|
|
590
612
|
checkpoint: CP-3
|
|
591
613
|
|
|
592
614
|
- id: phase-structure
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"feature": "{feature}",
|
|
4
|
+
"requirements": [
|
|
5
|
+
{
|
|
6
|
+
"id": "REQ-001",
|
|
7
|
+
"title": "原子且可验收的需求",
|
|
8
|
+
"status": "confirmed",
|
|
9
|
+
"scope": "in",
|
|
10
|
+
"dimensions": {
|
|
11
|
+
"input": "输入、前置条件与参数",
|
|
12
|
+
"output": "输出、持久化或界面结果",
|
|
13
|
+
"behavior": "正常业务语义",
|
|
14
|
+
"orchestration": "遍历、触发、顺序、并发或调度;无则写 N/A",
|
|
15
|
+
"failure": "异常、兼容、幂等、资源限制;无则写 N/A",
|
|
16
|
+
"verification": "可执行的验收证据"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"designs": [],
|
|
21
|
+
"tasks": [],
|
|
22
|
+
"verification": []
|
|
23
|
+
}
|
|
@@ -27,11 +27,14 @@ description: "Use after requirement-baseline, before dual-track fork. Defines sh
|
|
|
27
27
|
- `.planning/features/{功能名}/api-contract.md`
|
|
28
28
|
- `.planning/features/{功能名}/api-contract.meta.json`
|
|
29
29
|
|
|
30
|
+
The meta file must also set `traceability_status: "passed"` only after every API design has been written to `traceability.json.designs` and `traceability_check.py --stage design` succeeds; otherwise set `failed` and do not advance.
|
|
31
|
+
|
|
30
32
|
## 输入
|
|
31
33
|
|
|
32
34
|
- `.planning/requirements/baseline.md` — 需求基线(FP/BR/BC)
|
|
33
35
|
- `.planning/navigation/INDEX.md` 和相关 codebase navigation — 粗定位已有接口
|
|
34
36
|
- `.planning/code-index/`(如存在)— 查询已有 route/handler/API symbol 与 `routes_to` / `calls` 关系,确认接口复用和冲突
|
|
37
|
+
- `.planning/requirements/{feature}/traceability.json` — 每个接口必须回指它的 `REQ-*`,不能只写 FP 标题
|
|
35
38
|
|
|
36
39
|
使用 code-index 时,必须回读 `evidence_path:evidence_line` 附近源码后再把既有接口写入契约;不得只凭 Markdown navigation 或 relation 摘要判断。
|
|
37
40
|
|
|
@@ -39,7 +42,7 @@ description: "Use after requirement-baseline, before dual-track fork. Defines sh
|
|
|
39
42
|
|
|
40
43
|
1. **只定义接口契约,不谈实现细节** — 不写数据表结构、不写具体代码、不写业务流程内部逻辑
|
|
41
44
|
2. **分叉后不变更** — 一旦确定,Track A/B 都基于此契约工作。变更走 `api-supplement` 异常路径
|
|
42
|
-
3. **接口签名必须完整** — 包括 endpoint、method
|
|
45
|
+
3. **接口签名必须完整** — 包括 endpoint、method、请求参数(含类型约束)、响应结构(含状态码)、错误契约与行为语义(过滤、排序、权限、幂等/兼容规则)
|
|
43
46
|
4. **数据模型共享** — 核心业务实体定义在这里,前后端共用一个数据模型
|
|
44
47
|
5. **切片对齐** — 若 baseline 包含 `SL-*`,先读取 `skill://workflow-pipeline/references/slice-safety-guide.md`,只为当前执行切片定义 API。后置切片接口不得提前进入契约。
|
|
45
48
|
6. **既有接口优先查事实索引** — 当 `.planning/code-index/` 存在时,先用 Symbol/Relation 定位候选接口、调用方和处理器,再读取源码证据;缺失或过期时再按 navigation 和 `rg` 兜底。
|
|
@@ -42,6 +42,10 @@ allowed-tools:
|
|
|
42
42
|
|
|
43
43
|
# 后端技术方案生成器
|
|
44
44
|
|
|
45
|
+
## 需求追溯硬约束
|
|
46
|
+
|
|
47
|
+
读取 `.planning/requirements/{feature}/traceability.json`。每个设计章节必须列 `覆盖 REQ: REQ-*`;定时任务、批处理、导入和通知至少拆为“编排(扫描/触发/锁/重试)”与“业务算法(判定/计算/写入)”两个可独立验证的小节。不得把遍历全部活跃组织、发送通知、文件解析等编排事实藏在算法描述中。
|
|
48
|
+
|
|
45
49
|
根据需求基线和项目现有代码,生成聚焦于影响分析的后端技术方案。
|
|
46
50
|
|
|
47
51
|
## 核心原则
|
|
@@ -34,6 +34,7 @@ description: "Use after both Track A (api-call-guide) and Track B (frontend-tech
|
|
|
34
34
|
{
|
|
35
35
|
"api_required": true,
|
|
36
36
|
"merge_gate_status": "passed",
|
|
37
|
+
"traceability_status": "passed",
|
|
37
38
|
"contract_backend_mismatch_count": 0,
|
|
38
39
|
"contract_frontend_mismatch_count": 0,
|
|
39
40
|
"unhandled_api_supplement_count": 0,
|
|
@@ -50,6 +51,7 @@ description: "Use after both Track A (api-call-guide) and Track B (frontend-tech
|
|
|
50
51
|
- `.planning/features/{功能名}/后端技术方案.md` — Track A 产出的后端方案
|
|
51
52
|
- `.planning/features/{功能名}/api-supplement-requests.md` —(可选)Track B 提交的 API 补充需求
|
|
52
53
|
- `.planning/code-index/`(如存在)— 用于抽查 API route/handler、frontend API calls、imports/calls 关系,并回读源码 evidence
|
|
54
|
+
- `.planning/requirements/{feature}/traceability.json` — 原子 REQ 的唯一追溯源
|
|
53
55
|
|
|
54
56
|
## 核心原则
|
|
55
57
|
|
|
@@ -107,6 +109,13 @@ description: "Use after both Track A (api-call-guide) and Track B (frontend-tech
|
|
|
107
109
|
- 可以用已有接口拼吗?
|
|
108
110
|
- 必须新增的对 Track A 影响多大?
|
|
109
111
|
|
|
112
|
+
### Step 5:需求→设计闭环(不可跳过)
|
|
113
|
+
|
|
114
|
+
1. 将后端、前端、UI、API 契约中的设计项写入 `traceability.json.designs`,每项以 `requirements: ["REQ-…"]` 回指来源。
|
|
115
|
+
2. 所有 API 类型设计必须在 `contract` 中同时写 `request`、`response`、`errors`、`behavior`;禁止只对齐响应字段。
|
|
116
|
+
3. 执行 `python3 <workflow-orchestrator>/scripts/traceability_check.py --file .planning/requirements/{feature}/traceability.json --stage design`。
|
|
117
|
+
4. 结果不为 passed 时,`merge_gate_status` 必须为 failed,`blocking_issue_count` 必须大于 0,回到对应方案修复;不得进入变更清单。
|
|
118
|
+
|
|
110
119
|
## 产出模板
|
|
111
120
|
|
|
112
121
|
```
|
|
@@ -169,4 +178,5 @@ description: "Use after both Track A (api-call-guide) and Track B (frontend-tech
|
|
|
169
178
|
- [ ] 验证结论已写入报告
|
|
170
179
|
- [ ] meta.json 中 `merge_gate_status` 为 `passed`
|
|
171
180
|
- [ ] meta.json 中所有 mismatch / supplement / blocking 计数均为 0
|
|
181
|
+
- [ ] `traceability_check.py --stage design` 通过,且 meta.json 的 `traceability_status` 为 `passed`
|
|
172
182
|
- [ ] 无 API 变更时生成 no-op meta,`api_required` 为 false,`merge_gate_status` 为 `skipped`
|
|
@@ -58,6 +58,7 @@ description: "Use after workflow-integration-verify has passed or produced an ap
|
|
|
58
58
|
5. 读取功能点梳理(如存在)→ 确认 FP 覆盖完整性
|
|
59
59
|
6. 读取 baseline.md 的审查结论和风险标记
|
|
60
60
|
7. 若输入包含 `SL-*` 切片计划,读取 `skill://workflow-pipeline/references/slice-safety-guide.md`,只生成当前执行切片的任务。后置切片只能写入风险/后续范围,不得生成实现任务。
|
|
61
|
+
8. 读取 `.planning/requirements/{feature}/traceability.json`;它是任务覆盖判断的唯一 REQ 清单,不能仅凭技术方案标题推断覆盖。
|
|
61
62
|
|
|
62
63
|
### 第二阶段:扫描项目上下文
|
|
63
64
|
|
|
@@ -70,6 +71,8 @@ description: "Use after workflow-integration-verify has passed or produced an ap
|
|
|
70
71
|
|
|
71
72
|
输出到 `.planning/features/{feature}/变更清单.md`。
|
|
72
73
|
|
|
74
|
+
同时输出 `.planning/features/{feature}/变更清单.meta.json`。只有 `traceability_check.py --stage change-plan` 成功时才允许写入 `traceability_status: "passed"`;`uncovered_requirement_count` 和 `orphan_task_count` 必须为 0。
|
|
75
|
+
|
|
73
76
|
## 输出结构
|
|
74
77
|
|
|
75
78
|
```markdown
|
|
@@ -109,6 +112,7 @@ description: "Use after workflow-integration-verify has passed or produced an ap
|
|
|
109
112
|
- **参考实现**:`path/to/similar/file.py:line`(有则填写)
|
|
110
113
|
- **Code Index 证据**:相关 symbol/relation/evidence(有 `.planning/code-index/` 时填写;无则写"未使用:原因")
|
|
111
114
|
- **需求来源**:FP-001 / BR-001 / 技术方案第X章
|
|
115
|
+
- **REQ 覆盖**:`REQ-001`(必须是 traceability.json 中的原子 ID;无来源任务必须显式标为获批技术债)
|
|
112
116
|
- **Slice**:SL-001
|
|
113
117
|
- **适用规范**:`.context/spec/backend/service.md` 等(有则填写)
|
|
114
118
|
- **相关经验教训**:lesson ID 或"无"
|
|
@@ -119,6 +123,7 @@ description: "Use after workflow-integration-verify has passed or produced an ap
|
|
|
119
123
|
- **完成标准**:(每条必须使用 `- [ ]` checkbox 格式,可被 code_review 门禁自动验证)
|
|
120
124
|
- [ ] 具体可验证的检查项(可映射到代码中具体元素)
|
|
121
125
|
- [ ] 另一条检查项(可映射到验证命令)
|
|
126
|
+
- **六维验收**:输入、输出、行为、编排、失败、验证各写一条可验证结论;算法与遍历/调度等编排必须分列,不能相互替代。
|
|
122
127
|
- **验证命令**:`pytest tests/test_xxx.py -k test_yyy`
|
|
123
128
|
|
|
124
129
|
## 四、配置变更
|
|
@@ -158,3 +163,6 @@ graph TD
|
|
|
158
163
|
- [ ] 若 `.planning/code-index/` 存在,涉及已有代码的任务已标注相关 symbol/relation/evidence 或说明未使用原因
|
|
159
164
|
- [ ] 每个任务包含审查要求、适用规范、需求来源字段(至少标注"无")
|
|
160
165
|
- [ ] 文件路径与技术方案一致
|
|
166
|
+
- [ ] 变更清单任务同步写入 `traceability.json.tasks`,每项包含 `id`、`requirements` 和六维 `acceptance`
|
|
167
|
+
- [ ] 执行 `traceability_check.py --stage change-plan` 通过;没有漏 REQ,也没有无 REQ 来源的任务
|
|
168
|
+
- [ ] 输出 `变更清单.meta.json`,至少包含 `traceability_status: passed`、`uncovered_requirement_count: 0`、`orphan_task_count: 0`
|
|
@@ -107,6 +107,15 @@ Always create or update:
|
|
|
107
107
|
|
|
108
108
|
- `.planning/requirements/baseline.md` — unified requirement baseline
|
|
109
109
|
- `.planning/requirements/baseline.meta.json` — structured metadata. Schema defined in `feature-development.yaml` under `steps[requirement-baseline].meta_output.fields`: `review_status`, `fp_count`, `br_count`, `bc_count`, `blocking_pending_count`, `critical_image_missing_count`, `challenge_pending_count`, `code_reality_missing_count`, `current_feature`, `depends_on_count`, plus optional `pending_items`, `risks`, and `key_decisions`.
|
|
110
|
+
- `.planning/requirements/{feature}/traceability.json` — copy the orchestrator `templates/traceability.json` schema and create one atomic `REQ-*` record for every confirmed in-scope requirement. Every record must define `input`、`output`、`behavior`、`orchestration`、`failure`、`verification`; use `N/A` only with a reason when a dimension truly does not apply.
|
|
111
|
+
|
|
112
|
+
Before the CP-1 result is reported, run:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
python3 <workflow-orchestrator>/scripts/traceability_check.py --file .planning/requirements/{feature}/traceability.json --stage baseline
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Set `baseline.meta.json.traceability_status` to `passed` only when that command succeeds. A failed traceability check is a blocking baseline defect, not a deferred documentation suggestion.
|
|
110
119
|
|
|
111
120
|
Do not create by default:
|
|
112
121
|
|