@guanlin4924/devflow-pi 0.1.18 → 0.1.20

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.
Files changed (30) hide show
  1. package/README.md +20 -1
  2. package/package.json +3 -3
  3. package/plugins/devflow-core/extensions/devflow-core.ts +339 -20
  4. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/acceptance_test_runner.py +394 -0
  5. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/acceptance_test_suite.rb +86 -0
  6. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/advance_state.rb +192 -1
  7. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/api_test_matrix.py +829 -0
  8. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/execution_contract.rb +7 -5
  9. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/init_state.rb +11 -1
  10. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/inspect_state.rb +5 -1
  11. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/machine_evidence.rb +39 -3
  12. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/requirement_graph.rb +309 -23
  13. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/tdd_evidence.py +311 -0
  14. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/test_command_policy.py +53 -0
  15. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/test_task_binding_check.py +254 -0
  16. package/plugins/devflow-core/skills/workflow-orchestrator/templates/feature-development.yaml +109 -4
  17. package/plugins/devflow-core/skills/workflow-orchestrator/templates/uat-remediation.yaml +21 -1
  18. package/plugins/devflow-design/skills/workflow-api-contract/SKILL.md +38 -0
  19. package/plugins/devflow-implementation/agents/implementation-worker.md +3 -0
  20. package/plugins/devflow-implementation/skills/workflow-change-plan/SKILL.md +7 -0
  21. package/plugins/devflow-implementation/skills/workflow-change-plan/references/output-template.md +2 -0
  22. package/plugins/devflow-implementation/skills/workflow-execute-phase/SKILL.md +3 -3
  23. package/plugins/devflow-quality/skills/workflow-acceptance-test-design/SKILL.md +63 -0
  24. package/plugins/devflow-quality/skills/workflow-acceptance-test-design/agents/openai.yaml +4 -0
  25. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/SKILL.md +7 -6
  26. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/intermediate-format.md +3 -0
  27. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/compile_dsl.py +49 -3
  28. package/plugins/devflow-quality/skills/workflow-run-acceptance-tests/SKILL.md +48 -0
  29. package/plugins/devflow-quality/skills/workflow-run-acceptance-tests/agents/openai.yaml +4 -0
  30. package/plugins/devflow-quality/skills/workflow-verify-work/SKILL.md +9 -3
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: workflow-run-acceptance-tests
3
+ description: "Execute the frozen TC acceptance suite after code review. Use the requirement baseline and frozen TC nodes for test intent; use current code only to bind execution adapters."
4
+ ---
5
+
6
+ # 冻结验收测试执行
7
+
8
+ 此步骤在代码审查后、UAT 前运行。它的目标是执行冻结的 `TC-*`,而不是根据交付总结重新猜测要测什么。
9
+
10
+ ## 输入边界
11
+
12
+ 测试意图只能读取:
13
+
14
+ - `.planning/requirements/{feature}/tests.json` 中已冻结且未 stale 的 `TC-*`;
15
+ - 图谱中被 TC 引用的已确认 REQ / BR / BC / AC、契约与架构风险;
16
+ - 初始化发现的测试工具链能力。
17
+
18
+ 可以读取当前源码和代码索引,但**仅**用来绑定入口、选择器、请求地址、测试数据与命令适配器。
19
+
20
+ 禁止读取或使用以下内容来扩大、缩小或补造验收范围:
21
+
22
+ - `.planning/phases/{phase}/SUMMARY.md`;
23
+ - agent 的交付自述、代码 diff 或“已完成”结论;
24
+ - 未冻结的临时需求列表。
25
+
26
+ ## 过程
27
+
28
+ 1. 用 `devflow_acceptance_tests(feature)` 检查测试集已由 CP-3 冻结。若有 stale 或候选 TC,停止并回到需求/测试设计。
29
+ 2. 读取冻结 TC 与其 oracle、前置数据、身份和自动化模式。
30
+ 对 `api_refs`、`workload_refs` 和 `risk_refs` 指向的专项用例,保留其契约、性能/迁移或韧性义务;没有适配器或环境时必须写为 blocked,不能用普通主流程替代。
31
+ 3. 读取代码审查报告、代码索引和实际源码,仅为每个 TC 绑定运行适配器;不得改变 TC 的断言、范围或预期。
32
+ 4. 写入 `.planning/features/{feature}/acceptance-test-bindings.json`:
33
+ - 固定 `test_suite.graph_revision` 与 `fingerprint`;
34
+ - 每个 TC 恰好一条绑定;
35
+ - `mode` 必须与冻结 TC 的 `automation_mode` 一致;
36
+ - 通用自动化用例使用 `{ "kind": "command", "argv": [ ... ] }`,不使用 shell 字符串;
37
+ - Core 生成的 API TC 可直接使用 `{ "kind": "http", "base_url_env": "DEVFLOW_TEST_BASE_URL", "headers_env": { "Authorization": "DEVFLOW_TEST_AUTHORIZATION" } }`。请求、HTTP 状态和异常码断言来自冻结 TC 的 `execution`,绑定只能提供环境地址和鉴权,不得重写测试意图;若场景需要专用夹具,可额外配置 `{ "setup": { "argv": [ ... ] } }`,Core 会先记录并执行该受控命令,再发 HTTP 请求;
38
+ - 人工或环境阻塞用例必须有 owner 与原因/阻塞源。
39
+ 5. 调用 `devflow_run_acceptance_tests(action="validate", feature=...)`。不通过时修正绑定,不得绕过。
40
+ 6. 调用 `devflow_run_acceptance_tests(action="run", feature=...)`。该 Core 工具记录每个 TC 的命令哈希、退出码和输出摘要。
41
+ 7. 失败、未执行或 blocked 的 TC 只能报告为 `blocked`/`failed`,不得在 CP-4 或 UAT 中宣称验收通过。
42
+
43
+ ## 输出
44
+
45
+ - `.planning/features/{feature}/acceptance-test-bindings.json`
46
+ - `.planning/test-runs/{feature}/acceptance-results.json`
47
+
48
+ `acceptance-results.json` 是 Core-owned 的执行事实;Markdown 结论不能替代它。
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Run Frozen Acceptance Tests"
3
+ short_description: "执行冻结 TC 验收测试"
4
+ default_prompt: "基于冻结的 TC-* 绑定并执行验收测试;源码只能用于运行适配,不能改变测试意图。"
@@ -72,18 +72,24 @@ Verification must include these gates when project artifacts exist:
72
72
  - Run or require the commands declared by `.planning/toolchain.md`, `.planning/execution-contract.md`, `.context/workflow/verification.md`, or the change list.
73
73
  - Include target tests, full tests, build, codegen/mock/DI checks, migration checks, and integration tests when applicable.
74
74
 
75
- 5. **Compatibility gate**
75
+ 5. **冻结验收测试门禁**
76
+ - 读取 `.planning/requirements/{feature}/tests.json`、`.planning/features/{feature}/acceptance-test-bindings.json` 和 `.planning/test-runs/{feature}/acceptance-results.json`。
77
+ - 调用 `devflow_run_acceptance_tests(action="validate_results", feature=...)`;它验证结果仍引用当前冻结 suite,且每个 `TC-*` 都已通过。
78
+ - 任一 TC 未执行、失败、人工待执行或因环境阻塞时,验证状态只能是 `blocked` 或 `failed`,CP-4 不得宣称验收通过。
79
+ - Markdown、UAT 口述或 agent 自述不能替代该 Core-owned 结果。
80
+
81
+ 6. **Compatibility gate**
76
82
  - Check interface, database, config, data migration, permission, and consumer compatibility risks.
77
83
  - For frontend-visible API/VO/schema changes, record backward compatibility or migration handling.
78
84
  - For database/model/config changes, record migration, rollback, and deployment ordering risk.
79
85
  - Record accepted residual risks explicitly.
80
86
 
81
- 6. **Baseline decision gate**
87
+ 7. **Baseline decision gate**
82
88
  - Compare implementation against `.planning/requirements/baseline.md`, especially `反向审视与用户拍板`, `待确认事项`, and `下游输入契约`.
83
89
  - Confirm implemented behavior maps to `FP-*`, `BR-*`, `BC-*`, and confirmed `CR-*` decisions.
84
90
  - Any implemented scope based on a pending decision is a verification failure unless the user explicitly approved it.
85
91
 
86
- 7. **Lessons extraction gate**
92
+ 8. **Lessons extraction gate**
87
93
  - After verification is complete, review the findings for lessons worth preserving.
88
94
  - Candidate triggers for a lesson:
89
95
  - A regression was caught early — what pattern prevented it?