@boyingliu01/xp-gate 0.18.5 → 0.19.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.
Files changed (254) hide show
  1. package/adapter-common.sh +27 -0
  2. package/adapters/gate-3.sh +0 -0
  3. package/adapters/gate-4.sh +0 -0
  4. package/adapters/gate-7.sh +0 -0
  5. package/adapters/gate-8.sh +0 -0
  6. package/adapters/gate-9.sh +0 -0
  7. package/adapters/powershell.sh +85 -33
  8. package/adapters/typescript.sh +8 -8
  9. package/build-integrity/__tests__/import-resolver.test.ts +22 -0
  10. package/build-integrity/__tests__/orchestrator.test.ts +1 -2
  11. package/build-integrity/gate-10.ts +7 -0
  12. package/gate-12-file-hygiene.sh +230 -0
  13. package/hooks/adapter-common.sh +27 -0
  14. package/hooks/gate-10.sh +105 -0
  15. package/hooks/gate-12-file-hygiene.sh +0 -0
  16. package/hooks/lib/validate-code-walkthrough.cjs +125 -0
  17. package/hooks/pre-commit +130 -33
  18. package/hooks/pre-push +15 -91
  19. package/lib/__tests__/check-version.test.js +67 -46
  20. package/lib/__tests__/doctor.test.js +7 -6
  21. package/lib/__tests__/gate-runner.test.js +267 -0
  22. package/lib/__tests__/init.test.js +32 -0
  23. package/lib/__tests__/npm-package.test.js +13 -0
  24. package/lib/__tests__/phase-transition.test.js +604 -12
  25. package/lib/__tests__/sprint-discovery.test.ts +0 -1
  26. package/lib/__tests__/sprint-status-rework.test.js +100 -1
  27. package/lib/__tests__/update-hooks.test.js +143 -10
  28. package/lib/__tests__/upgrade-exec.test.js +73 -45
  29. package/lib/__tests__/upgrade-skill-sync.test.js +1 -1
  30. package/lib/__tests__/upgrade.test.js +12 -11
  31. package/lib/doctor.js +2 -1
  32. package/lib/gate-runner.js +68 -23
  33. package/lib/init.js +34 -5
  34. package/lib/install-skill.js +1 -0
  35. package/lib/mattpocock-license-verdict.json +1 -1
  36. package/lib/phase-transition.js +203 -23
  37. package/lib/shared-paths.js +2 -0
  38. package/lib/sprint-status.js +15 -4
  39. package/lib/test-alignment.ts +3 -13
  40. package/lib/update-hooks.js +129 -15
  41. package/mock-policy/AGENTS.md +5 -5
  42. package/mock-policy/__tests__/gate-m3.test.ts +0 -5
  43. package/mock-policy/__tests__/scope-scanner.test.ts +8 -2
  44. package/mutation/AGENTS.md +4 -4
  45. package/mutation/__tests__/mutmut-runner.test.ts +443 -2
  46. package/mutation/__tests__/update-baseline.test.ts +0 -2
  47. package/mutation/runners/mutmut-runner.ts +67 -17
  48. package/package.json +9 -3
  49. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  50. package/plugins/claude-code/skills/clipboard-vision/SKILL.md +47 -0
  51. package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
  52. package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
  53. package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
  54. package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
  55. package/plugins/claude-code/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
  56. package/plugins/claude-code/skills/clipboard-vision/describe-clipboard.sh +161 -0
  57. package/plugins/claude-code/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
  58. package/plugins/claude-code/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
  59. package/plugins/claude-code/skills/delphi-review/.delphi-config.json.example +24 -27
  60. package/plugins/claude-code/skills/delphi-review/AGENTS.md +13 -12
  61. package/plugins/claude-code/skills/delphi-review/INSTALL.md +15 -17
  62. package/plugins/claude-code/skills/delphi-review/SKILL.md +30 -29
  63. package/plugins/claude-code/skills/delphi-review/opencode.json.delphi.example +6 -10
  64. package/plugins/claude-code/skills/delphi-review/references/code-walkthrough.md +33 -49
  65. package/plugins/claude-code/skills/delphi-review/references/requirements.md +66 -54
  66. package/plugins/claude-code/skills/delphi-review/references/round-templates.md +7 -7
  67. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +5 -5
  68. package/plugins/claude-code/skills/sprint-flow/SKILL.md +4 -4
  69. package/plugins/claude-code/skills/sprint-flow/references/components/skill-invocations.md +2 -2
  70. package/plugins/claude-code/skills/sprint-flow/references/force-levels.md +37 -35
  71. package/plugins/claude-code/skills/sprint-flow/references/orchestration-rules.md +1 -1
  72. package/plugins/claude-code/skills/sprint-flow/references/phase-1-prep.md +1 -1
  73. package/plugins/claude-code/skills/sprint-flow/references/phase-2-design.md +24 -14
  74. package/plugins/claude-code/skills/sprint-flow/references/phase-4-verify.md +6 -6
  75. package/plugins/claude-code/skills/sprint-flow/references/phase-overview.md +2 -2
  76. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +4 -4
  77. package/plugins/dsh/README.md +25 -0
  78. package/plugins/dsh/cordis.patch.yml +7 -0
  79. package/plugins/dsh/package.json +70 -0
  80. package/plugins/dsh/scripts/prepack.cjs +82 -0
  81. package/plugins/dsh/skills/admin-template-guidelines/SKILL.md +113 -0
  82. package/plugins/dsh/skills/admin-template-guidelines/references/rule-1.md +91 -0
  83. package/plugins/dsh/skills/admin-template-guidelines/references/rule-2.md +155 -0
  84. package/plugins/dsh/skills/admin-template-guidelines/references/rule-3.md +70 -0
  85. package/plugins/dsh/skills/admin-template-guidelines/references/rule-4.md +154 -0
  86. package/plugins/dsh/skills/admin-template-guidelines/references/rule-5.md +126 -0
  87. package/plugins/dsh/skills/admin-template-guidelines/references/rule-6.md +180 -0
  88. package/plugins/dsh/skills/batch-grill-me/SKILL.md +15 -0
  89. package/plugins/dsh/skills/clipboard-vision/SKILL.md +47 -0
  90. package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
  91. package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
  92. package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
  93. package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
  94. package/plugins/dsh/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
  95. package/plugins/dsh/skills/clipboard-vision/describe-clipboard.sh +161 -0
  96. package/plugins/dsh/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
  97. package/plugins/dsh/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
  98. package/plugins/dsh/skills/delphi-review/.delphi-config.json.example +70 -0
  99. package/plugins/dsh/skills/delphi-review/AGENTS.md +67 -0
  100. package/plugins/dsh/skills/delphi-review/INSTALL.md +150 -0
  101. package/plugins/dsh/skills/delphi-review/SKILL.md +559 -0
  102. package/plugins/dsh/skills/delphi-review/hooks.md +19 -0
  103. package/plugins/dsh/skills/delphi-review/opencode.json.delphi.example +52 -0
  104. package/plugins/dsh/skills/delphi-review/references/code-walkthrough.md +470 -0
  105. package/plugins/dsh/skills/delphi-review/references/orchestrator-dispatch.md +64 -0
  106. package/plugins/dsh/skills/delphi-review/references/requirements.md +402 -0
  107. package/plugins/dsh/skills/delphi-review/references/round-templates.md +134 -0
  108. package/plugins/dsh/skills/delphi-review/scripts/verify-consensus.sh +43 -0
  109. package/plugins/dsh/skills/delphi-review/tools.md +29 -0
  110. package/plugins/dsh/skills/domain-modeling/ADR-FORMAT.md +64 -0
  111. package/plugins/dsh/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  112. package/plugins/dsh/skills/domain-modeling/SKILL.md +74 -0
  113. package/plugins/dsh/skills/grill-with-docs/SKILL.md +7 -0
  114. package/plugins/dsh/skills/grilling/SKILL.md +12 -0
  115. package/plugins/dsh/skills/improve-codebase-architecture/SKILL.md +156 -0
  116. package/plugins/dsh/skills/ralph-loop/SKILL.md +198 -0
  117. package/plugins/dsh/skills/ralph-loop/references/components.md +113 -0
  118. package/plugins/dsh/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
  119. package/plugins/dsh/skills/ralph-loop/references/workflow-details.md +99 -0
  120. package/plugins/dsh/skills/ralph-loop/templates/progress-log.md +36 -0
  121. package/plugins/dsh/skills/sprint-flow/AGENTS.md +103 -0
  122. package/plugins/dsh/skills/sprint-flow/SKILL.md +411 -0
  123. package/plugins/dsh/skills/sprint-flow/__tests__/sprint-flow.test.cjs +457 -0
  124. package/plugins/dsh/skills/sprint-flow/hooks.md +18 -0
  125. package/plugins/dsh/skills/sprint-flow/references/components/memory.md +87 -0
  126. package/plugins/dsh/skills/sprint-flow/references/components/middleware.md +75 -0
  127. package/plugins/dsh/skills/sprint-flow/references/components/skill-invocations.md +105 -0
  128. package/plugins/dsh/skills/sprint-flow/references/components/system-prompt.md +27 -0
  129. package/plugins/dsh/skills/sprint-flow/references/components/tool-descriptions.md +95 -0
  130. package/plugins/dsh/skills/sprint-flow/references/force-levels.md +204 -0
  131. package/plugins/dsh/skills/sprint-flow/references/orchestration-rules.md +236 -0
  132. package/plugins/dsh/skills/sprint-flow/references/phase-1-prep.md +294 -0
  133. package/plugins/dsh/skills/sprint-flow/references/phase-2-design.md +273 -0
  134. package/plugins/dsh/skills/sprint-flow/references/phase-3-build.md +348 -0
  135. package/plugins/dsh/skills/sprint-flow/references/phase-4-verify.md +225 -0
  136. package/plugins/dsh/skills/sprint-flow/references/phase-5-ship.md +222 -0
  137. package/plugins/dsh/skills/sprint-flow/references/phase-6-close.md +266 -0
  138. package/plugins/dsh/skills/sprint-flow/references/phase-overview.md +486 -0
  139. package/plugins/dsh/skills/sprint-flow/scripts/verify-sprint-state.sh +38 -0
  140. package/plugins/dsh/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
  141. package/plugins/dsh/skills/sprint-flow/templates/auto-estimate-output-template.md +110 -0
  142. package/plugins/dsh/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
  143. package/plugins/dsh/skills/sprint-flow/templates/pain-document-template.md +115 -0
  144. package/plugins/dsh/skills/sprint-flow/templates/sprint-progress-template.md +140 -0
  145. package/plugins/dsh/skills/sprint-flow/templates/sprint-summary-template.md +121 -0
  146. package/plugins/dsh/skills/sprint-flow/tools.md +29 -0
  147. package/plugins/dsh/skills/test-driven-development/SKILL.md +371 -0
  148. package/plugins/dsh/skills/test-driven-development/testing-anti-patterns.md +299 -0
  149. package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +56 -0
  150. package/plugins/dsh/skills/test-specification-alignment/SKILL.md +205 -0
  151. package/plugins/dsh/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
  152. package/plugins/dsh/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
  153. package/plugins/dsh/skills/test-specification-alignment/references/specification-format.md +348 -0
  154. package/plugins/dsh/skills/to-issues/SKILL.md +277 -0
  155. package/plugins/dsh/src/command.test.ts +102 -0
  156. package/plugins/dsh/src/command.ts +75 -0
  157. package/plugins/dsh/src/contract.test.ts +62 -0
  158. package/plugins/dsh/src/gate-runner.test.ts +100 -0
  159. package/plugins/dsh/src/gate-runner.ts +58 -0
  160. package/plugins/dsh/src/index.test.ts +97 -0
  161. package/plugins/dsh/src/index.ts +94 -0
  162. package/plugins/dsh/src/skills.test.ts +58 -0
  163. package/plugins/dsh/tsconfig.build.json +13 -0
  164. package/plugins/dsh/tsconfig.json +19 -0
  165. package/plugins/dsh/vitest.config.ts +8 -0
  166. package/plugins/opencode/package.json +1 -1
  167. package/plugins/opencode/scripts/prepack.cjs +1 -0
  168. package/plugins/opencode/skills/clipboard-vision/SKILL.md +47 -0
  169. package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
  170. package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
  171. package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
  172. package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
  173. package/plugins/opencode/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
  174. package/plugins/opencode/skills/clipboard-vision/describe-clipboard.sh +161 -0
  175. package/plugins/opencode/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
  176. package/plugins/opencode/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
  177. package/plugins/opencode/skills/delphi-review/.delphi-config.json.example +24 -27
  178. package/plugins/opencode/skills/delphi-review/AGENTS.md +13 -12
  179. package/plugins/opencode/skills/delphi-review/INSTALL.md +15 -17
  180. package/plugins/opencode/skills/delphi-review/SKILL.md +30 -29
  181. package/plugins/opencode/skills/delphi-review/opencode.json.delphi.example +6 -10
  182. package/plugins/opencode/skills/delphi-review/references/code-walkthrough.md +33 -49
  183. package/plugins/opencode/skills/delphi-review/references/requirements.md +66 -54
  184. package/plugins/opencode/skills/delphi-review/references/round-templates.md +7 -7
  185. package/plugins/opencode/skills/sprint-flow/AGENTS.md +5 -5
  186. package/plugins/opencode/skills/sprint-flow/SKILL.md +4 -4
  187. package/plugins/opencode/skills/sprint-flow/references/components/skill-invocations.md +2 -2
  188. package/plugins/opencode/skills/sprint-flow/references/force-levels.md +37 -35
  189. package/plugins/opencode/skills/sprint-flow/references/orchestration-rules.md +1 -1
  190. package/plugins/opencode/skills/sprint-flow/references/phase-1-prep.md +1 -1
  191. package/plugins/opencode/skills/sprint-flow/references/phase-2-design.md +24 -14
  192. package/plugins/opencode/skills/sprint-flow/references/phase-4-verify.md +6 -6
  193. package/plugins/opencode/skills/sprint-flow/references/phase-overview.md +2 -2
  194. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +4 -4
  195. package/plugins/qoder/plugin.json +1 -1
  196. package/plugins/qoder/skills/clipboard-vision/SKILL.md +47 -0
  197. package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
  198. package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
  199. package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
  200. package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
  201. package/plugins/qoder/skills/clipboard-vision/clipboard-vision/SKILL.md +47 -0
  202. package/plugins/qoder/skills/clipboard-vision/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
  203. package/plugins/qoder/skills/clipboard-vision/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
  204. package/plugins/qoder/skills/clipboard-vision/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
  205. package/plugins/qoder/skills/clipboard-vision/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
  206. package/plugins/qoder/skills/clipboard-vision/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
  207. package/plugins/qoder/skills/clipboard-vision/clipboard-vision/scripts/clipboard-vision.sh +137 -0
  208. package/plugins/qoder/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
  209. package/plugins/qoder/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
  210. package/plugins/qoder/skills/delphi-review/.delphi-config.json.example +3 -11
  211. package/plugins/qoder/skills/delphi-review/AGENTS.md +15 -17
  212. package/plugins/qoder/skills/delphi-review/INSTALL.md +12 -12
  213. package/plugins/qoder/skills/delphi-review/SKILL.md +58 -25
  214. package/plugins/qoder/skills/delphi-review/opencode.json.delphi.example +1 -1
  215. package/plugins/qoder/skills/delphi-review/references/code-walkthrough.md +33 -49
  216. package/plugins/qoder/skills/sprint-flow/AGENTS.md +5 -5
  217. package/plugins/qoder/skills/sprint-flow/SKILL.md +2 -2
  218. package/plugins/qoder/skills/sprint-flow/references/force-levels.md +38 -35
  219. package/plugins/qoder/skills/sprint-flow/references/phase-1-prep.md +1 -1
  220. package/plugins/qoder/skills/sprint-flow/references/phase-2-design.md +48 -6
  221. package/plugins/qoder/skills/sprint-flow/references/phase-4-verify.md +5 -6
  222. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +4 -4
  223. package/principles/AGENTS.md +4 -4
  224. package/scripts/__tests__/sync-package-content.test.js +30 -0
  225. package/scripts/delphi-external-review.cjs +194 -63
  226. package/scripts/sync-package-content.js +9 -2
  227. package/skills/clipboard-vision/SKILL.md +47 -0
  228. package/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
  229. package/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
  230. package/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
  231. package/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
  232. package/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
  233. package/skills/clipboard-vision/describe-clipboard.sh +161 -0
  234. package/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
  235. package/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
  236. package/skills/delphi-review/.delphi-config.json.example +24 -27
  237. package/skills/delphi-review/AGENTS.md +13 -12
  238. package/skills/delphi-review/INSTALL.md +15 -17
  239. package/skills/delphi-review/SKILL.md +30 -29
  240. package/skills/delphi-review/opencode.json.delphi.example +6 -10
  241. package/skills/delphi-review/references/code-walkthrough.md +33 -49
  242. package/skills/delphi-review/references/requirements.md +66 -54
  243. package/skills/delphi-review/references/round-templates.md +7 -7
  244. package/skills/sprint-flow/AGENTS.md +5 -5
  245. package/skills/sprint-flow/SKILL.md +4 -4
  246. package/skills/sprint-flow/references/components/skill-invocations.md +2 -2
  247. package/skills/sprint-flow/references/force-levels.md +37 -35
  248. package/skills/sprint-flow/references/orchestration-rules.md +1 -1
  249. package/skills/sprint-flow/references/phase-1-prep.md +1 -1
  250. package/skills/sprint-flow/references/phase-2-design.md +24 -14
  251. package/skills/sprint-flow/references/phase-4-verify.md +6 -6
  252. package/skills/sprint-flow/references/phase-overview.md +2 -2
  253. package/skills/test-specification-alignment/AGENTS.md +4 -4
  254. package/sprint-gate.sh +291 -0
@@ -14,11 +14,11 @@
14
14
 
15
15
  ## Five Core Properties
16
16
 
17
- 1. **匿名性** — Expert A/B 互不知道对方意见
17
+ 1. **匿名性** — Expert A/B/C 在 Round 1 互不知道对方意见
18
18
  2. **迭代共识** — 多轮直到 APPROVED
19
19
  3. **零容忍** — Critical Issues 必须修复
20
20
  4. **零降级** — 环境/资源问题必须阻断,通知用户解决
21
- 5. **强制覆盖** — 超过阈值必须 BLOCK,不能跳过
21
+ 5. **强制覆盖** — 变更必须完整评审;大型变更由用户选择完整评审或在评审前拆分
22
22
 
23
23
  ---
24
24
 
@@ -72,11 +72,13 @@ pre-push hook
72
72
  │ │
73
73
  │ ├─→ Expert B (实现 + 代码质量) 匿名评审 (含 principles_findings)
74
74
  │ │
75
+ │ ├─→ Expert C (可行性) 匿名评审 (含 principles_findings)
76
+ │ │
75
77
  │ ├─→ 共识检查
76
78
  │ │ │
77
- │ │ ├─→ 2/2 APPROVED → 允许推送
79
+ │ │ ├─→ 三份成功结果、三个 distinct requested_model、≥90% → 允许推送
78
80
  │ │ │
79
- │ │ ├─→ 分歧 → Expert C 仲裁
81
+ │ │ ├─→ 分歧 → 继续下一轮(最多 5 轮)
80
82
  │ │ │
81
83
  │ │ └─→ REQUEST_CHANGES → 阻塞推送
82
84
  │ │
@@ -93,9 +95,9 @@ pre-push hook
93
95
  |------|------|------|
94
96
  | Expert A | 架构 + 设计评审 | `.delphi-config.json` → `experts.architecture` |
95
97
  | Expert B | 实现 + 代码质量 | `.delphi-config.json` → `experts.technical` |
96
- | Expert C (仲裁) | 冲突裁决 | `.delphi-config.json` → `experts.feasibility` |
98
+ | Expert C | 可行性评审 | `.delphi-config.json` → `experts.feasibility` |
97
99
 
98
- > ⚠️ **注意**: 至少配置 **两个不同 provider** 的模型。详见 [INSTALL.md](./INSTALL.md)。
100
+ > 必须成功执行三个专家角色,并验证三个 distinct trimmed requested_model。Provider、vendor、gateway 和模型国籍均不受限制。`provider: local` fallback 不能计数,local hosted endpoint 可作为普通 callable provider。
99
101
 
100
102
  ---
101
103
 
@@ -171,8 +173,9 @@ pre-push hook
171
173
  │ │
172
174
  │ └─→ Step 2: Delphi Code Walkthrough
173
175
  │ │
174
- │ ├─→ Expert A 评审 (含 principles_findings)
175
- │ ├─→ Expert B 评审 (含 principles_findings)
176
+ │ ├─→ Expert A / architecture 评审 (含 principles_findings)
177
+ │ ├─→ Expert B / technical 评审 (含 principles_findings)
178
+ │ ├─→ Expert C / feasibility 评审 (含 principles_findings)
176
179
  │ └─→ 共识检查
177
180
  │
178
181
  └─→ 允许/阻塞推送
@@ -237,10 +240,10 @@ pre-push hook
237
240
 
238
241
  | 条件 | 结果 |
239
242
  |------|------|
240
- | 2/2 APPROVED + 无 Critical Issues | ✅ 允许推送 |
241
- | 2/2 APPROVED + 有 Minor Issues | ✅ 允许推送(记录问题) |
242
- | 1/2 APPROVED | ⚠️ 需要 Expert C 仲裁 |
243
- | 0/2 APPROVED | ❌ 阻塞推送 |
243
+ | 三份成功结果、三个 distinct requested_model、≥90% 且无 Critical Issues | ✅ 允许推送 |
244
+ | 三份成功结果、≥90% 且有 Minor Issues | ✅ 允许推送(记录问题) |
245
+ | 任一专家失败、缺失或模型重复 | ❌ 阻塞推送 |
246
+ | 共识不足或有 Critical Issues | ❌ 阻塞推送 |
244
247
  | 有 Critical Issues | ❌ 阻塞推送 |
245
248
  | 有 Major Issues 且未处理 | ❌ 阻塞推送 |
246
249
 
@@ -251,26 +254,9 @@ pre-push hook
251
254
  | 指标 | 阈值 | 处理 |
252
255
  |------|------|------|
253
256
  | 单次走查成本 | ~$0.03 | 正常执行 |
254
- | 最大评审文件数 | 20 个文件 | 超过 → **BLOCK** |
255
- | 最大 diff 行数 | 500 行 | 超过 → **BLOCK** |
257
+ | 变更规模 | 无硬性文件数或行数上限 | 大型变更必须完整评审或由用户选择拆分 |
256
258
 
257
- **超过阈值处理 (零降级)**:
258
-
259
- ```
260
- IF 超过阈值:
261
- → BLOCK 推送
262
- → 通知用户:变更过大,无法有效评审
263
- → 用户选项:
264
- A. 拆分变更(推荐)
265
- B. 用户明确授权跳过走查(需书面确认风险)
266
-
267
- ❌ 禁止自动跳过走查
268
- ❌ 禁止自动分批并批准
269
- ```
270
-
271
- **设计原则**:
272
- - 大变更跳过评审 = 质量风险泄露到生产环境
273
- - 用户有权决定是否接受风险,AI 不能自动跳过
259
+ 大型变更没有自动跳过或绕过路径。用户可以选择完整评审,或在评审前主动拆分变更;每个变更仍须通过完整的走查和证据验证。
274
260
 
275
261
  ---
276
262
 
@@ -282,7 +268,7 @@ IF 超过阈值:
282
268
  BEFORE code walkthrough:
283
269
  ├─ 检查 Expert A 模型可用性
284
270
  ├─ 检查 Expert B 模型可用性
285
- ├─ 检查 Expert C 模型可用性(仲裁时需要)
271
+ ├─ 检查 Expert C 模型可用性
286
272
  └─ 检查 OpenCode CLI 可用性
287
273
 
288
274
  IF 任何检查失败:
@@ -296,8 +282,7 @@ IF 任何检查失败:
296
282
 
297
283
  | 情况 | 处理 |
298
284
  |------|------|
299
- | Expert A API 错误 | BLOCK + 提示用户检查 API key |
300
- | Expert B API 错误 | BLOCK + 提示用户检查 API key |
285
+ | 任一专家 API 错误 | BLOCK + 提示用户检查 provider/API key |
301
286
  | OpenCode CLI 缺失 | BLOCK + 提示用户安装 OpenCode |
302
287
 
303
288
  ---
@@ -305,7 +290,7 @@ IF 任何检查失败:
305
290
  ## Expert 评审输出格式
306
291
 
307
292
  ```markdown
308
- ## Code Walkthrough - Expert [A/B]
293
+ ## Code Walkthrough - Expert [A/B/C]
309
294
 
310
295
  ### 变更摘要
311
296
  [变更的主要内容]
@@ -340,6 +325,7 @@ IF 任何检查失败:
340
325
  ### 专家意见汇总
341
326
  - Expert A: [APPROVED / REQUEST_CHANGES]
342
327
  - Expert B: [APPROVED / REQUEST_CHANGES]
328
+ - Expert C: [APPROVED / REQUEST_CHANGES]
343
329
 
344
330
  ### 共识结果
345
331
  [CONSENSUS / DISAGREEMENT]
@@ -370,8 +356,9 @@ IF 任何检查失败:
370
356
  "verdict": "APPROVED",
371
357
  "confidence": 9,
372
358
  "experts": [
373
- { "id": "Expert A", "verdict": "APPROVED", "confidence": 9 },
374
- { "id": "Expert B", "verdict": "APPROVED", "confidence": 8 }
359
+ { "id": "Expert A", "role": "architecture", "verdict": "APPROVED", "confidence": 9, "result_type": "delphi_expert_result", "requested_model": "provider/model-a", "resolved_model": "provider/model-a" },
360
+ { "id": "Expert B", "role": "technical", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-b", "resolved_model": null },
361
+ { "id": "Expert C", "role": "feasibility", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-c", "resolved_model": "provider/model-c" }
375
362
  ],
376
363
  "issues": [],
377
364
  "consensus_ratio": 1.0,
@@ -409,7 +396,8 @@ Hook 验证以下条件(全部满足才允许 push):
409
396
  2. JSON 格式有效
410
397
  3. commit hash 匹配当前 HEAD
411
398
  4. verdict = APPROVED
412
- 5. timestamp 未过期 (< 1小时)
399
+ 5. timestamp 未过期
400
+ 6. expires 必须是 timestamp 之后恰好 1 小时
413
401
 
414
402
  ---
415
403
 
@@ -430,8 +418,7 @@ Hook 验证以下条件(全部满足才允许 push):
430
418
  | 错误 | 正确 |
431
419
  |------|------|
432
420
  | Expert 不可用时跳过走查 | BLOCK + 提示用户修复环境 |
433
- | 超过阈值自动跳过走查 | BLOCK + 提示用户拆分变更 |
434
- | 超过阈值自动分批评审 | BLOCK + 用户决定是否拆分或授权跳过 |
421
+ | 大型变更 | 完整评审或由用户在评审前拆分 |
435
422
  | OpenCode CLI 缺失时允许推送 | BLOCK + 提示用户安装 OpenCode |
436
423
  | 模型 API 错误时降级单模型 | BLOCK + 提示用户检查 API 配置 |
437
424
  | 未写入 `.code-walkthrough-result.json` 就声明完成 | MUST 写入结果文件后才能完成 |
@@ -443,15 +430,17 @@ Hook 验证以下条件(全部满足才允许 push):
443
430
 
444
431
  **Pre-requisites (MANDATORY - BLOCK if missing):**
445
432
  - [ ] OpenCode CLI 已安装且可用
446
- - [ ] Expert A 模型 API 可用
447
- - [ ] Expert B 模型 API 可用
448
- - [ ] 变更大小在阈值内(文件 ≤20,行数 ≤500)
433
+ - [ ] 三个专家模型 API 均可用
434
+ - [ ] 变更已由用户选择完整评审或拆分为可审阅的变更
449
435
  - [ ] Expert A 完成匿名评审
450
436
  - [ ] Expert B 完成匿名评审
437
+ - [ ] Expert C 完成匿名评审
451
438
  - [ ] 共识检查完成
452
439
 
453
440
  **CRITICAL - 共识验证 (code-walkthrough):**
454
- - [ ] 至少 2/2 或 2/3 专家 APPROVED
441
+ - [ ] 三个成功结果均为 `result_type=delphi_expert_result`
442
+ - [ ] 三个 `requested_model` trimmed 后 distinct
443
+ - [ ] 聚合共识 >=90%,并在 exact HEAD 上写入结果
455
444
  - [ ] 无 Critical Issues 未解决
456
445
  - [ ] 无 Major Issues 未处理(或有处理计划)
457
446
 
@@ -471,11 +460,6 @@ Hook 验证以下条件(全部满足才允许 push):
471
460
  - **CANNOT 允许推送**
472
461
  - **MUST 修复后重新走查**
473
462
 
474
- **IF 超过大小阈值:**
475
- - **CANNOT 允许推送**
476
- - **MUST BLOCK 并提示拆分变更**
477
- - **用户可明确授权跳过(需确认风险)**
478
-
479
463
  **⭐ APPROVED 后必做 (code-walkthrough mode):写入结果文件**
480
464
 
481
465
  IF mode == `code-walkthrough` AND 最终裁决是 APPROVED,评审完成后必须:
@@ -13,7 +13,7 @@
13
13
  **设计背景**: Issue #368 识别出原始意图中"需求评审一次 + 设计评审一次"的第一次评审被完全丢弃。本模式恢复该评审点,在需求探索(grill-with-docs)与设计文档生成之间插入一道轻量质量门禁。
14
14
 
15
15
  **定位**:
16
- - **轻量**: 2 专家(architecture + feasibility)、最多 1 轮(循环语义下最多 2 轮)
16
+ - **固定三专家**: architecture + technical + feasibility,最多 5 轮
17
17
  - **需求焦点**: 评审对象是需求陈述 + CONTEXT.md,不是设计文档或代码
18
18
  - **程序化阻塞**: 输出 `requirements-reviewed.json`,由 `phase-transition 2 completed` 校验
19
19
  - **防陈旧绑定**: `requirements_hash`(SHA-256)绑定需求内容,防止旧证据复用
@@ -22,11 +22,11 @@
22
22
 
23
23
  ## Five Core Properties
24
24
 
25
- 1. **匿名性** — Expert A/B 互不知道对方意见(Round 1)
26
- 2. **迭代共识** — GAPS_FOUND 时回到 grill-with-docs 补充,最多 2 轮循环
25
+ 1. **匿名性** — Expert A/B/C 互不知道对方意见(Round 1)
26
+ 2. **迭代共识** — GAPS_FOUND 时回到 grill-with-docs 补充,最多 5 轮循环
27
27
  3. **关键缺口零容忍** — Critical requirement gaps 必须在进入设计前解决
28
28
  4. **防陈旧绑定** — requirements_hash 绑定需求内容 + CONTEXT.md,旧证据不可复用
29
- 5. **轻量但严格** — 2 专家配置,但共识要求 2/2(100%),不因轻量而降标
29
+ 5. **执行可验证** — 三个专家都必须成功返回结构化结果,且 requested_model 三个 distinct
30
30
 
31
31
  ---
32
32
 
@@ -53,7 +53,7 @@ sprint-flow Phase 2 THINK:
53
53
  Step 4: HARD-GATE(用户审批设计文档)
54
54
  ```
55
55
 
56
- **lightweight sprint 例外**: 当 `change_type == "修改已存在代码"` 时,sprint-flow 跳过 R1 需求评审,需求维度合并入 R2 设计评审。
56
+ 所有 Sprint 路径都执行 R1。Force level 只调整上下文深度和后续迭代预算,不跳过需求评审,也不减少三位专家执行。
57
57
 
58
58
  ---
59
59
 
@@ -70,19 +70,21 @@ delphi-review --mode requirements
70
70
  ├─→ Expert A (architecture) anonymous review — focus: requirements completeness,
71
71
  │ requirement→AC coverage, scenario coverage
72
72
  │
73
- ├─→ Expert B (feasibility) anonymous review — focus: testability of acceptance criteria,
73
+ ├─→ Expert B (technical) anonymous review — focus: technical clarity and edge cases
74
+ │
75
+ ├─→ Expert C (feasibility) anonymous review — focus: testability of acceptance criteria,
74
76
  │ user persona clarity, scope boundaries
75
77
  │
76
78
  ├─→ Consensus check
77
79
  │ │
78
- │ ├─→ Both APPROVED → write requirements-reviewed.json verdict=APPROVED
80
+ │ ├─→ All three APPROVED → write requirements-reviewed.json verdict=APPROVED
79
81
  │ │
80
- │ └─→ Either GAPS_FOUND → record gaps, set verdict=GAPS_FOUND
82
+ │ └─→ Any GAPS_FOUND → record gaps, set verdict=GAPS_FOUND
81
83
  │
82
84
  └─→ Return to sprint-flow orchestrator
83
85
  │
84
86
  ├─→ APPROVED → proceed to design doc generation
85
- └─→ GAPS_FOUND → loop back to grill-with-docs (1 more round, max 2 total)
87
+ └─→ GAPS_FOUND → loop back to grill-with-docs (up to 5 total rounds)
86
88
  ```
87
89
 
88
90
  ---
@@ -92,16 +94,15 @@ delphi-review --mode requirements
92
94
  | 专家 | 视角 | 配置 |
93
95
  |------|------|------|
94
96
  | Expert A (architecture) | 需求完整性 + 需求→AC 映射 + 场景覆盖 | `.delphi-config.json` → `experts.architecture` |
95
- | Expert B (feasibility) | AC 可测试性 + 用户画像 + 范围边界 | `.delphi-config.json` → `experts.feasibility` |
97
+ | Expert B (technical) | 技术清晰度 + 边界条件 + 实现约束 | `.delphi-config.json` → `experts.technical` |
98
+ | Expert C (feasibility) | AC 可测试性 + 用户画像 + 范围边界 | `.delphi-config.json` → `experts.feasibility` |
96
99
 
97
- > ⚠️ **注意**: requirements 模式**不使用** technical 专家。技术实现细节属于设计/实现阶段(design / code-walkthrough 模式),不属于需求评审范畴。
100
+ > 三个角色必须使用三个 distinct trimmed executable model IDs。Provider、vendor、gateway 和模型国籍均不受限制;一个 provider 和 token plan 可以服务全部三个角色。
98
101
 
99
- > ⚠️ **注意**: 至少配置 **两个不同 provider** 的模型。详见 [INSTALL.md](./INSTALL.md)。
100
-
101
- **专家选择理由**(设计决策 §16.4 C3):
102
+ **专家选择理由**:
102
103
  - **architecture 专家**: 天然映射范围/覆盖到需求层面——需求完整性、需求→AC 映射、场景覆盖、领域术语一致性
103
104
  - **feasibility 专家**: 天然映射可测试性/假设到验收标准——AC 可测试性、用户画像清晰度、范围边界、隐含假设
104
- - **technical 专家**: 排除——技术实现细节在需求阶段尚未确定,评审无意义
105
+ - **technical 专家**: 检查需求中的技术清晰度、边界条件和实现约束
105
106
 
106
107
  ---
107
108
 
@@ -117,7 +118,7 @@ delphi-review --mode requirements
117
118
  | **领域术语一致性** | 需求陈述中的术语是否与 CONTEXT.md 领域模型一致(交叉引用) |
118
119
  | **AC 精确度** | 验收标准是否具体、可度量、无歧义 |
119
120
 
120
- ### Expert B (feasibility) — 需求模式焦点
121
+ ### Expert C (feasibility) — 需求模式焦点
121
122
 
122
123
  | 维度 | 检查内容 |
123
124
  |------|---------|
@@ -133,13 +134,13 @@ delphi-review --mode requirements
133
134
 
134
135
  | 条件 | 结果 |
135
136
  |------|------|
136
- | 2/2 APPROVED + 无 Critical gaps | ✅ verdict=APPROVED,进入设计文档生成 |
137
- | 2/2 APPROVED + 有 Minor gaps | ✅ verdict=APPROVED(记录 gaps 供参考) |
138
- | 1/2 APPROVED, 1/2 GAPS_FOUND | ❌ verdict=GAPS_FOUND,记录 gaps |
139
- | 0/2 APPROVED | ❌ verdict=GAPS_FOUND,记录 gaps |
137
+ | 3/3 successful APPROVED + 无 Critical gaps | ✅ verdict=APPROVED,进入设计文档生成 |
138
+ | 3/3 successful APPROVED + 有 Minor gaps | ✅ verdict=APPROVED(记录 gaps 供参考) |
139
+ | 任一专家失败或缺失 | ❌ BLOCK,不能聚合或降级 |
140
+ | 任一专家 GAPS_FOUND | ❌ verdict=GAPS_FOUND,记录 gaps |
140
141
  | 有 Critical requirement gaps | ❌ verdict=GAPS_FOUND |
141
142
 
142
- **共识要求**: 2/2 一致 APPROVED(100%)。轻量配置不降低共识标准。
143
+ **共识要求**: 三个成功结果全部参与聚合,达到 >=90% 且最终 APPROVED。单个专家结果不能代表全局批准。
143
144
 
144
145
  ---
145
146
 
@@ -167,8 +168,8 @@ Round 2: delphi-review --mode requirements(带 Round 1 gaps 上下文)
167
168
  ```
168
169
 
169
170
  **硬性限制**:
170
- - **最多 2 轮**(Round 1 + 可选 Round 2)
171
- - **禁止无界循环** — Round 2 后仍 GAPS_FOUND 必须升级
171
+ - **最多 5 轮**(Round 1 + 可选后续轮次)
172
+ - **禁止无界循环** — Round 5 后仍 GAPS_FOUND 必须升级
172
173
  - **Round 2 上下文**: 专家看到 Round 1 的 gaps 列表,评估是否已修复
173
174
  - **升级语义**: `escalation_needed: true` 写入 requirements-reviewed.json,sprint-flow 负责 UX
174
175
 
@@ -183,14 +184,16 @@ Round 2: delphi-review --mode requirements(带 Round 1 gaps 上下文)
183
184
  "mode": "requirements",
184
185
  "verdict": "APPROVED",
185
186
  "timestamp": "2026-07-25T10:30:00Z",
186
- "requirements_hash": "a1b2c3d4e5f6...(SHA-256 hex digest)",
187
+ "consensus_ratio": 1.0,
188
+ "requirements_hash": "7f650ddf715ebe75ca0317efa1e8618ae39d2c0bafea7a6f85aacfdbf3735a5f",
187
189
  "head_commit": "abc123def456789...",
188
- "context_file_used": "CONTEXT.md",
190
+ "context_file_used": null,
189
191
  "round": 1,
190
- "expert_verdicts": [
191
- { "role": "architecture", "verdict": "APPROVED", "confidence": 9 },
192
- { "role": "feasibility", "verdict": "APPROVED", "confidence": 8 }
193
- ],
192
+ "expert_verdicts": [
193
+ { "role": "architecture", "verdict": "APPROVED", "confidence": 9, "result_type": "delphi_expert_result", "requested_model": "bailian-tp/qwen-plus" },
194
+ { "role": "technical", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "bailian-tp/deepseek-v3" },
195
+ { "role": "feasibility", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "bailian-tp/glm-4.5" }
196
+ ],
194
197
  "requirements_statement": "实现用户注册流程,支持邮箱验证和密码重置",
195
198
  "gaps_found": [],
196
199
  "rounds_used": 1,
@@ -205,13 +208,15 @@ Round 2: delphi-review --mode requirements(带 Round 1 gaps 上下文)
205
208
  "mode": "requirements",
206
209
  "verdict": "GAPS_FOUND",
207
210
  "timestamp": "2026-07-25T10:30:00Z",
208
- "requirements_hash": "a1b2c3d4e5f6...",
211
+ "consensus_ratio": 0.67,
212
+ "requirements_hash": "7f650ddf715ebe75ca0317efa1e8618ae39d2c0bafea7a6f85aacfdbf3735a5f",
209
213
  "head_commit": "abc123def456789...",
210
- "context_file_used": "CONTEXT.md",
214
+ "context_file_used": null,
211
215
  "round": 1,
212
216
  "expert_verdicts": [
213
- { "role": "architecture", "verdict": "APPROVED", "confidence": 8 },
214
- { "role": "feasibility", "verdict": "GAPS_FOUND", "confidence": 7 }
217
+ { "role": "architecture", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-a" },
218
+ { "role": "technical", "verdict": "GAPS_FOUND", "confidence": 7, "result_type": "delphi_expert_result", "requested_model": "provider/model-b" },
219
+ { "role": "feasibility", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-c" }
215
220
  ],
216
221
  "requirements_statement": "实现用户注册流程,支持邮箱验证和密码重置",
217
222
  "gaps_found": [
@@ -231,15 +236,16 @@ Round 2: delphi-review --mode requirements(带 Round 1 gaps 上下文)
231
236
  | `mode` | string | 固定值 `"requirements"` |
232
237
  | `verdict` | string | `APPROVED` 或 `GAPS_FOUND` |
233
238
  | `timestamp` | string | 评审完成时间 (ISO 8601 UTC) |
239
+ | `consensus_ratio` | number | 三位专家的共识比例;APPROVED 必须为 `0.90` 至 `1.0` |
234
240
  | `requirements_hash` | string | SHA-256 hex digest(防陈旧绑定,见下文) |
235
241
  | `head_commit` | string | 当前 `git rev-parse HEAD` |
236
- | `context_file_used` | string | 引用的 CONTEXT.md 路径 |
237
- | `round` | number | 当前轮次(1 或 2) |
238
- | `expert_verdicts` | array | 各专家裁决(2 项:architecture + feasibility) |
242
+ | `context_file_used` | string \| null | 项目根目录内引用的 context 文件相对路径;未使用时为 `null` 或空字符串 |
243
+ | `round` | number | 当前轮次(1 至 5) |
244
+ | `expert_verdicts` | array | 三位专家的成功结构化结果,包含 `result_type` 和 `requested_model` |
239
245
  | `requirements_statement` | string | 被评审需求的简短摘要 |
240
246
  | `gaps_found` | array | GAPS_FOUND 时的缺口列表(APPROVED 时为空数组) |
241
247
  | `rounds_used` | number | 实际使用的轮次数 |
242
- | `escalation_needed` | boolean | Round 2 后仍 GAPS_FOUND 时为 `true` |
248
+ | `escalation_needed` | boolean | Round 5 后仍 GAPS_FOUND 时为 `true` |
243
249
 
244
250
  ### 状态文件: `.sprint-state/delphi-reviewed.json`
245
251
 
@@ -267,23 +273,28 @@ requirements_statement + CONTEXT.md content + ISO timestamp prefix (YYYY-MM-DD)
267
273
  ```
268
274
 
269
275
  **计算规则**:
270
- 1. 拼接: `requirements_statement` 字符串 + `CONTEXT.md` 文件完整内容(若存在)+ 当日日期前缀 `YYYY-MM-DD`
271
- 2. 对拼接结果计算 SHA-256 hex digest
272
- 3. 若 CONTEXT.md 不存在,仅拼接 `requirements_statement` + 日期前缀
276
+ 1. 从 evidence `timestamp` 解析严格有效的 ISO 8601 UTC 时间,并取其 `YYYY-MM-DD` 前缀
277
+ 2. 若 `context_file_used` 非空,只允许项目根目录内的相对路径;拒绝绝对路径、`..` 穿越、缺失/非普通文件,以及 realpath 逃出项目根目录的符号链接
278
+ 3. 按 UTF-8 原样读取 context 文件,不添加分隔符或换行;拼接精确字符串 `requirements_statement + context content + YYYY-MM-DD`
279
+ 4. 对拼接结果计算 SHA-256;生成值使用 64 位小写 hex,校验时大小写不敏感
280
+ 5. 未使用 context 时,精确拼接 `requirements_statement + YYYY-MM-DD`
273
281
 
274
282
  **目的**: 防止旧证据复用。`phase-transition 2 completed` 校验时:
275
283
  - 文件必须存在
276
284
  - `verdict` 必须为 `APPROVED`
277
- - `requirements_hash` 必须为非空字符串
285
+ - `requirements_hash` 必须为 64 位 hex,并与运行时重新计算值匹配
278
286
  - 若 hash 与当前需求内容不匹配 → BLOCK(防陈旧绑定)
279
287
 
280
- **与 phase-transition.js 的集成**(v0.17.1 已实现):
288
+ **与 phase-transition.js 的集成**:
281
289
 
282
290
  ```javascript
283
291
  // EVIDENCE_FILES[2] — 已存在于 phase-transition.js
284
292
  {
285
293
  path: '.sprint-state/phase-outputs/requirements-reviewed.json',
286
- requiredFields: ['verdict', 'requirements_hash'],
294
+ requiredFields: [
295
+ 'verdict', 'requirements_statement', 'timestamp', 'consensus_ratio',
296
+ 'expert_verdicts', 'head_commit', 'requirements_hash'
297
+ ],
287
298
  blockingCheck: (data) => data.verdict === 'APPROVED',
288
299
  blockingMessage: 'Requirements review verdict is not APPROVED',
289
300
  }
@@ -306,15 +317,15 @@ requirements_statement + CONTEXT.md content + ISO timestamp prefix (YYYY-MM-DD)
306
317
 
307
318
  | ❌ Don't | ✅ Do | Why |
308
319
  |----------|------|-----|
309
- | 使用全部 3 个专家 | 仅使用 architecture + feasibility | 轻量配置(设计决策 §16.4 C3),technical 属设计阶段 |
310
- | 无界循环评审 | 最多 2 轮,之后升级 | 防止无限循环(设计 §5.3 step 3) |
320
+ | 使用少于 3 个专家 | 必须使用 architecture + technical + feasibility | 三个角色共同构成全局证据 |
321
+ | 无界循环评审 | 最多 5 轮,之后升级 | 防止无限循环 |
311
322
  | 跳过 CONTEXT.md 交叉引用 | 始终交叉引用领域术语 | 需求应使用 CONTEXT.md 中的规范术语 |
312
323
  | 输出泛化批准 | 输出 hash 绑定的需求陈述 | 防陈旧绑定(§8.4,Round 1 设计反馈 #14) |
313
- | 接受 1/2 APPROVED | 要求 2/2 共识(100%) | 轻量配置仍需严格共识 |
324
+ | 接受单个专家批准 | 要求三份成功结果参与聚合,并达到 >=90% 共识 | 单个结果不能代表全局批准 |
314
325
  | Round 2 中复用 Round 1 gaps 作为新发现 | Round 2 专家获得 Round 1 gaps 上下文 | 迭代改进,避免重复劳动 |
315
326
  | 评审设计文档或代码 | 仅评审需求陈述 + CONTEXT.md | 设计/代码评审是 design / code-walkthrough 模式的职责 |
316
327
  | GAPS_FOUND 时写入 delphi-reviewed.json | 仅 APPROVED 时写入状态文件 | GAPS_FOUND 表示评审未完成 |
317
- | 在 lightweight sprint 中执行 R1 | `change_type == "修改已存在代码"` 时跳过 R1 | 需求维度合并入 R2 设计评审 |
328
+ | 在 lightweight sprint 中减少或跳过 R1 | 所有路径都执行三专家 R1,仅缩短上下文 | Force level 不改变专家数或批准证据 |
318
329
 
319
330
  ---
320
331
 
@@ -323,7 +334,7 @@ requirements_statement + CONTEXT.md content + ISO timestamp prefix (YYYY-MM-DD)
323
334
  - **只读评审**: requirements 模式不修改任何源文件,仅写入证据文件到 `.sprint-state/`
324
335
  - **Hash 完整性**: `requirements_hash` 使用 SHA-256,防止需求内容被篡改后复用旧证据
325
336
  - **Commit 绑定**: `head_commit` 记录评审时的 git HEAD,提供时间线追溯
326
- - **无外部 API 泄露**: 评审内容仅传递给配置的国产模型 provider,不经过第三方服务
337
+ - **调用边界**: 评审内容只传递给用户配置的 callable provider;provider、vendor、gateway 和模型国籍不作额外限制
327
338
  - **证据不可伪造**: phase-transition.js 程序化校验证据文件,LLM 无法绕过
328
339
 
329
340
  ---
@@ -350,11 +361,12 @@ requirements_statement + CONTEXT.md content + ISO timestamp prefix (YYYY-MM-DD)
350
361
  **Pre-requisites (MANDATORY - BLOCK if missing):**
351
362
  - [ ] grill-with-docs 已完成(或 CONTEXT.md 快速路径)
352
363
  - [ ] 需求陈述可用(非空)
353
- - [ ] Expert A (architecture) 模型 API 可用
354
- - [ ] Expert B (feasibility) 模型 API 可用
364
+ - [ ] Expert A (architecture)、Expert B (technical)、Expert C (feasibility) 均成功执行
365
+ - [ ] 三个 `requested_model` trimmed 后 distinct
366
+ - [ ] 三份结果均为 `result_type=delphi_expert_result`
355
367
 
356
368
  **CRITICAL - 共识验证 (requirements):**
357
- - [ ] 2/2 专家 APPROVED
369
+ - [ ] 聚合共识 >=90%,且所有 Critical gaps 已处理
358
370
  - [ ] 无 Critical requirement gaps 未解决
359
371
  - [ ] requirements_hash 已计算并写入
360
372
 
@@ -364,7 +376,7 @@ requirements_statement + CONTEXT.md content + ISO timestamp prefix (YYYY-MM-DD)
364
376
  - [ ] verdict 为 APPROVED 或 GAPS_FOUND
365
377
  - [ ] IF APPROVED: `.sprint-state/delphi-reviewed.json` 已写入(mode=requirements)
366
378
  - [ ] IF GAPS_FOUND: gaps_found 数组非空,escalation_needed 正确设置
367
- - [ ] IF Round 2 后仍 GAPS_FOUND: escalation_needed = true
379
+ - [ ] IF Round 5 后仍 GAPS_FOUND: escalation_needed = true
368
380
 
369
381
  **IF 任何 Pre-requisite 缺失:**
370
382
  - **CANNOT 完成评审**
@@ -374,7 +386,7 @@ requirements_statement + CONTEXT.md content + ISO timestamp prefix (YYYY-MM-DD)
374
386
  - 返回 sprint-flow → grill-with-docs 补充
375
387
  - 重新执行 requirements 评审(Round 2)
376
388
 
377
- **IF GAPS_FOUND (Round 2):**
389
+ **IF GAPS_FOUND (Round 5):**
378
390
  - **escalation_needed = true**
379
391
  - **MUST 升级给用户决策**
380
392
  - **CANNOT 自动继续**
@@ -386,5 +398,5 @@ IF mode == `requirements` AND 最终裁决是 APPROVED,评审完成后必须
386
398
  1. 写入 `.sprint-state/phase-outputs/requirements-reviewed.json`
387
399
  2. 写入 `.sprint-state/delphi-reviewed.json`(状态文件)
388
400
  3. 验证 JSON 格式有效
389
- 4. 验证 requirements_hash 非空
401
+ 4. 验证 requirements_hash 为 64 位 hex 且运行时重新计算匹配
390
402
  5. 验证 head_commit 匹配当前 HEAD
@@ -47,7 +47,7 @@
47
47
 
48
48
  ## Round 3: 最终立场(如需要)
49
49
 
50
- 触发条件:Round 2 后仍无共识。所有专家提交最终绑定立场。3 专家模式下若仍无完全一致,2/3 或 3/3 多数裁决生效,记录少数派意见。
50
+ 触发条件:Round 2 后仍无共识。所有专家提交最终绑定立场。必须基于三份成功结果聚合达到 ≥90% 共识,不能以多数票或单个专家结果替代全局批准。
51
51
 
52
52
  ### 输出格式
53
53
 
@@ -72,12 +72,12 @@
72
72
 
73
73
  ### 执行方式
74
74
 
75
- 2 位专家(architecture + feasibility)独立收到:需求陈述 + CONTEXT.md + grill session 摘要 + "独立评审需求完整性,不知道其他专家意见"。
75
+ architecture、technical、feasibility 三位专家分别独立收到:需求陈述 + CONTEXT.md + grill session 摘要 + "独立评审需求完整性,不知道其他专家意见"。三次执行必须全部成功,且每份结果都记录 `result_type=delphi_expert_result` 和实际请求的 `requested_model`;模型 ID、provider、vendor、gateway 和国籍不受限制。
76
76
 
77
77
  ### 输出格式
78
78
 
79
79
  ```markdown
80
- ## Requirements Review - Expert [A(architecture)/B(feasibility)]
80
+ ## Requirements Review - Expert [A(architecture)/B(technical)/C(feasibility)]
81
81
 
82
82
  ### 需求摘要
83
83
  [被评审需求的简短概括]
@@ -106,16 +106,16 @@
106
106
 
107
107
  ### 触发条件
108
108
 
109
- Round 1 裁决为 GAPS_FOUND,grill-with-docs 补充访谈后重新评审。
109
+ 前一轮裁决为 GAPS_FOUND,grill-with-docs 补充访谈后重新评审。最多执行 5 轮。
110
110
 
111
111
  ### 执行方式
112
112
 
113
- 2 位专家收到:更新后的需求陈述 + CONTEXT.md + **Round 1 gaps 列表** + "评估 Round 1 缺口是否已修复,是否有新缺口"。
113
+ 三位专家分别收到:更新后的需求陈述 + CONTEXT.md + **前一轮 gaps 列表** + "评估已有缺口是否已修复,是否有新缺口"。每轮仍需三份成功、可验证的独立结果,不得减少专家数。
114
114
 
115
115
  ### 输出格式
116
116
 
117
117
  ```markdown
118
- ## Requirements Review Round 2 - Expert [A(architecture)/B(feasibility)]
118
+ ## Requirements Review Round [2-5] - Expert [A(architecture)/B(technical)/C(feasibility)]
119
119
 
120
120
  ### Round 1 缺口修复验证
121
121
  | Round 1 Gap | 状态 | 说明 |
@@ -131,4 +131,4 @@ Round 1 裁决为 GAPS_FOUND,grill-with-docs 补充访谈后重新评审。
131
131
  [与 Round 1 相比的立场变化]
132
132
  ```
133
133
 
134
- > ⚠️ Round 2 后仍 GAPS_FOUND → `escalation_needed: true`,升级给用户决策。禁止 Round 3。
134
+ > ⚠️ Round 5 后仍 GAPS_FOUND → `escalation_needed: true`,升级给用户决策。任何较早轮次都不能以两位专家、多数票或单个结果产生 APPROVED 证据。
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-07-29
4
- **Commit:** 05d23ae
5
- **Branch:** main
6
- **Version:** 0.18.5.0
3
+ **Generated:** 2026-08-24
4
+ **Commit:** a1a4683
5
+ **Branch:** dsh-plugin
6
+ **Version:** 0.19.0.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
@@ -64,7 +64,7 @@ skills/sprint-flow/
64
64
 
65
65
  ## CONVENTIONS
66
66
  - **ralph-loop is Phase 3/6 BUILD default**. Each REQ runs in a clean context, saving 40-67% tokens.
67
- - **delphi-review HARD-GATE in Phase 2/6 DESIGN**: design must reach ≥90% consensus across ≥2 model providers, domestic models only. Unapproved → BLOCK coding.
67
+ - **delphi-review HARD-GATE in Phase 2/6 DESIGN**: all three expert roles must execute with three distinct requested model IDs, then aggregate ≥90% consensus within 5 rounds. Unapproved or unverifiable → BLOCK coding.
68
68
  - **`learn` is called twice**: once per REQ in Phase 3/6 (ralph-loop internal) and once in Phase 4/6 VERIFY (Sprint-level retro).
69
69
  - **Phase isolation**: each phase has explicit entry/exit criteria documented in its `references/phase-*.md` file.
70
70
  - **Emergent Requirements** discovered in Phase 6/6 CLOSE (USER ACCEPTANCE) are explicitly captured via `templates/emergent-issues-template.md` — never silently merged.
@@ -165,14 +165,14 @@ PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
165
165
  | Phase | Name | Key Actions | Output |
166
166
  |-------|------|-------------|--------|
167
167
  | 1/6 | PREP | Detect protected branch → Create git worktree → AUTO-ESTIMATE sizing → Classify (lightweight/standard/complex) | Worktree path + impact assessment |
168
- | 2/6 | DESIGN | CONTEXT.md 预检 (#322) → grill-with-docs → R1 需求评审 → 设计文档+APPROVAL (HARD-GATE) → batch-grill-me → R2 delphi-review (≥90% consensus) → to-issues → specification.yaml | specification.yaml + slices-manifest.json + requirements-reviewed.json |
168
+ | 2/6 | DESIGN | CONTEXT.md 预检 (#322) → grill-with-docs → R1 需求评审 → 设计文档+APPROVAL (HARD-GATE) → batch-grill-me → R2 delphi-review (3 distinct models, ≥90% consensus, max 5 rounds) → to-issues → specification.yaml | specification.yaml + slices-manifest.json + requirements-reviewed.json |
169
169
  | 3/6 | BUILD | BUILD-ENTRY-CONTRACT → GITHOOKS-GATE → DELPHI-GATE → ralph-loop (default) or parallel → TDD → blind-review (read-only subagent) → verification | MVP code |
170
170
  | 4/6 | VERIFY | delphi-review --mode code-walkthrough → test-specification-alignment (#367 HARD-GATE) → xp-gate check --all → browser (Layer 4) → learnings + xp-gate retro | Review report + feedback-log.md + test-alignment-report.json |
171
171
  | 5/6 | SHIP | VERSION-GATE → 分支完成决策 (4选项) → native ship (create PR) → native land (merge + CI + canary) | PR URL + deploy status + merge confirmation |
172
172
  | 6/6 | CLOSE | SHIP→CLOSE GATE (merge verified) → Backup sprint-state → #369 返工指标 → USER ACCEPTANCE (⚠️ mandatory manual) → Capture emergent issues → Cleanup worktree + branch | Emergent issues list + cleanup report + metrics |
173
173
 
174
174
  **Hard Gates**:
175
- - **DESIGN → BUILD**: R1 需求评审 APPROVED + 设计文档用户 APPROVED + R2 delphi-review APPROVED (≥90% consensus) + GITHOOKS-GATE + DELPHI-GATE + BUILD-ENTRY-CONTRACT (manifest schema + slice↔REQ)
175
+ - **DESIGN → BUILD**: R1 and R2 invoke all three expert roles independently, verify successful results with three distinct requested models, then aggregate APPROVED consensus ≥90% within 5 rounds, plus GITHOOKS-GATE + DELPHI-GATE + BUILD-ENTRY-CONTRACT (manifest schema + slice↔REQ)
176
176
  - **VERIFY → SHIP**: feedback-log.md must exist + test-alignment-report.json PASS (#367 程序化 HARD-GATE)
177
177
  - **SHIP → CLOSE**: PR must be merged to main + release completed (HARD-GATE)
178
178
 
@@ -339,7 +339,7 @@ stateDiagram-v2
339
339
  [*] --> PREP : trigger matched
340
340
  PREP --> DESIGN : worktree ready
341
341
  DESIGN --> BUILD : APPROVED ≥90%
342
- DESIGN --> DESIGN : REQUEST_CHANGES (max 3 rounds)
342
+ DESIGN --> DESIGN : REQUEST_CHANGES (max 5 Delphi rounds)
343
343
  BUILD --> VERIFY : tests pass
344
344
  BUILD --> BUILD : fix cycle (max 3)
345
345
  VERIFY --> SHIP : feedback-log exists
@@ -348,7 +348,7 @@ stateDiagram-v2
348
348
  SHIP --> SHIP : CI failed (retry)
349
349
  CLOSE --> [*] : UAT confirmed
350
350
  BUILD --> BLOCKED : 3 fix cycles exhausted
351
- DESIGN --> BLOCKED : 3 redesign rounds exhausted
351
+ DESIGN --> BLOCKED : 5 Delphi rounds exhausted
352
352
  BLOCKED --> [*] : user decision
353
353
  ```
354
354
 
@@ -16,7 +16,7 @@
16
16
  | Skill | 来源 | 触发条件 | 输出 |
17
17
  |-------|------|---------|------|
18
18
  | `grill-with-docs` | Matt Pocock (内置) | CONTEXT.md 不存在时(首个 Skill) | 访谈记录 + CONTEXT.md + ADR |
19
- | `delphi-review --mode requirements` | xp-gate | R1 需求评审(轻量 2 专家 1 轮) | requirements-reviewed.json |
19
+ | `delphi-review --mode requirements` | xp-gate | R1 三专家独立评审,验证 distinct model IDs 后聚合 ≥90% | requirements-reviewed.json |
20
20
  | 原生设计文档生成 | sprint-flow 编排层 | R1 APPROVED 后 | docs/plans/YYYY-MM-DD-<topic>-design.md |
21
21
  | **硬闸门** | — | 设计未批准 → 停止 | 禁止进入 Plan |
22
22
 
@@ -25,7 +25,7 @@
25
25
  | Skill | 来源 | 触发条件 | 条件分支 |
26
26
  |-------|------|---------|---------|
27
27
  | `batch-grill-me` | Matt Pocock (内置) | 标准路径(change_type != "修改已存在代码") | 批量前置决策 |
28
- | `delphi-review` | xp-gate | R2 设计评审;lightweight 路径使用 2 专家 1 轮 | 必须产生 `.sprint-state/delphi-reviewed.json` 且 verdict=APPROVED |
28
+ | `delphi-review` | xp-gate | R2 三专家独立评审,最多 5 轮 | 必须产生 `.sprint-state/delphi-reviewed.json` 且 verdict=APPROVED |
29
29
  | `to-issues` | xp-gate | delphi-review APPROVED 后 | 拆解为垂直切片 → slices-manifest.json |
30
30
 
31
31
  ### Phase 2: BUILD