@fitlab-ai/agent-infra 0.9.1 → 0.9.2

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 (283) hide show
  1. package/README.md +16 -4
  2. package/README.zh-CN.md +16 -4
  3. package/bin/cli.ts +12 -0
  4. package/dist/bin/cli.js +14 -0
  5. package/dist/bin/internal-cli.js +15 -0
  6. package/dist/lib/agent-client.js +163 -0
  7. package/dist/lib/agent-clients/adapter.js +294 -0
  8. package/dist/lib/agent-clients/adapters/claude-code.js +62 -0
  9. package/dist/lib/agent-clients/adapters/codex-sandbox.js +210 -0
  10. package/dist/lib/agent-clients/adapters/codex.js +54 -0
  11. package/dist/lib/agent-clients/adapters/gemini-cli.js +64 -0
  12. package/dist/lib/agent-clients/adapters/index.js +20 -0
  13. package/dist/lib/agent-clients/adapters/opencode.js +64 -0
  14. package/dist/lib/agent-clients/config.js +177 -0
  15. package/dist/lib/agent-clients/custom-tuis.js +99 -0
  16. package/dist/lib/agent-clients/invocation.js +9 -0
  17. package/dist/lib/agent-clients/next-steps.js +38 -0
  18. package/dist/lib/agent-clients/project-assets.js +45 -0
  19. package/dist/lib/agent-clients/reconcile.js +235 -0
  20. package/dist/lib/agent-clients/registry.js +72 -0
  21. package/dist/lib/agent-clients/schema.js +57 -0
  22. package/dist/lib/agent-clients/types.js +29 -0
  23. package/dist/lib/builtin-tuis.js +9 -14
  24. package/dist/lib/defaults.json +85 -73
  25. package/dist/lib/git/review-snapshot.js +25 -10
  26. package/dist/lib/git/reviewed-commit-equivalence.js +110 -0
  27. package/dist/lib/init.js +47 -91
  28. package/dist/lib/internal/agent-client.js +117 -0
  29. package/dist/lib/internal/git-workflow.js +1 -1
  30. package/dist/lib/internal/release-workflow.js +71 -16
  31. package/dist/lib/internal/task-orchestration.js +151 -0
  32. package/dist/lib/internal/task-review.js +65 -0
  33. package/dist/lib/merge.js +2 -1
  34. package/dist/lib/platform/adapters.js +38 -1
  35. package/dist/lib/platform/change-request-git-evidence.js +113 -0
  36. package/dist/lib/platform/merged-pr-equivalence.js +41 -11
  37. package/dist/lib/platform/pr-checks.js +38 -10
  38. package/dist/lib/platform/pull-requests.js +110 -6
  39. package/dist/lib/platform/releases.js +1 -1
  40. package/dist/lib/platform/verification-required.js +8 -10
  41. package/dist/lib/prompt.js +15 -3
  42. package/dist/lib/release/channels.js +4 -1
  43. package/dist/lib/release/workflow.js +4 -2
  44. package/dist/lib/remove-dir.js +25 -0
  45. package/dist/lib/run/tui.js +8 -2
  46. package/dist/lib/sandbox/agent-client-reconciler.js +234 -0
  47. package/dist/lib/sandbox/clipboard/linux.js +2 -1
  48. package/dist/lib/sandbox/commands/create.js +76 -180
  49. package/dist/lib/sandbox/commands/enter.js +17 -1
  50. package/dist/lib/sandbox/commands/prune.js +2 -2
  51. package/dist/lib/sandbox/commands/rm.js +3 -2
  52. package/dist/lib/sandbox/config.js +21 -4
  53. package/dist/lib/sandbox/constants.js +3 -0
  54. package/dist/lib/sandbox/dockerfile.js +2 -1
  55. package/dist/lib/sandbox/managed-fs.js +10 -5
  56. package/dist/lib/sandbox/recovery.js +52 -36
  57. package/dist/lib/sandbox/shell.js +1 -1
  58. package/dist/lib/sandbox/tool-types.js +8 -0
  59. package/dist/lib/sandbox/tools.js +2 -126
  60. package/dist/lib/task/artifact-lifecycle.js +1 -49
  61. package/dist/lib/task/commands/decisions.js +50 -20
  62. package/dist/lib/task/delegation-receipts.js +107 -0
  63. package/dist/lib/task/events.js +100 -1
  64. package/dist/lib/task/orchestration.js +420 -0
  65. package/dist/lib/task/review-artifacts.js +143 -59
  66. package/dist/lib/task/review-finalization.js +166 -0
  67. package/dist/lib/task/review-fingerprint.js +4 -0
  68. package/dist/lib/task/verification-checks.js +2 -1
  69. package/dist/lib/task/verification-engine.js +156 -28
  70. package/dist/lib/task/verification-review.js +1 -1
  71. package/dist/lib/task/verification.js +3 -1
  72. package/dist/lib/task/workspace-snapshot.js +34 -0
  73. package/dist/lib/update.js +42 -161
  74. package/lib/agent-client.ts +214 -0
  75. package/lib/agent-clients/adapter.ts +461 -0
  76. package/lib/agent-clients/adapters/claude-code.ts +70 -0
  77. package/lib/agent-clients/adapters/codex-sandbox.ts +245 -0
  78. package/lib/agent-clients/adapters/codex.ts +58 -0
  79. package/lib/agent-clients/adapters/gemini-cli.ts +65 -0
  80. package/lib/agent-clients/adapters/index.ts +27 -0
  81. package/lib/agent-clients/adapters/opencode.ts +66 -0
  82. package/lib/agent-clients/config.ts +278 -0
  83. package/lib/agent-clients/custom-tuis.ts +149 -0
  84. package/lib/agent-clients/invocation.ts +19 -0
  85. package/lib/agent-clients/next-steps.ts +72 -0
  86. package/lib/agent-clients/project-assets.ts +96 -0
  87. package/lib/agent-clients/reconcile.ts +324 -0
  88. package/lib/agent-clients/registry.ts +144 -0
  89. package/lib/agent-clients/schema.ts +62 -0
  90. package/lib/agent-clients/types.ts +78 -0
  91. package/lib/benchmark/schemas/v1.0.0/case-manifest.schema.json +120 -0
  92. package/lib/benchmark/schemas/v1.0.0/common.schema.json +109 -0
  93. package/lib/benchmark/schemas/v1.0.0/grader-result.schema.json +160 -0
  94. package/lib/benchmark/schemas/v1.0.0/run-manifest.schema.json +122 -0
  95. package/lib/benchmark/schemas/v1.0.0/subject.schema.json +227 -0
  96. package/lib/builtin-tuis.ts +16 -15
  97. package/lib/defaults.json +24 -12
  98. package/lib/git/review-snapshot.ts +39 -9
  99. package/lib/git/reviewed-commit-equivalence.ts +135 -0
  100. package/lib/init.ts +53 -121
  101. package/lib/internal/agent-client.ts +131 -0
  102. package/lib/internal/git-workflow.ts +1 -1
  103. package/lib/internal/release-workflow.ts +68 -16
  104. package/lib/internal/task-orchestration.ts +132 -0
  105. package/lib/internal/task-review.ts +65 -0
  106. package/lib/merge.ts +2 -1
  107. package/lib/platform/adapters.ts +142 -3
  108. package/lib/platform/change-request-git-evidence.ts +159 -0
  109. package/lib/platform/merged-pr-equivalence.ts +51 -14
  110. package/lib/platform/pr-checks.ts +50 -22
  111. package/lib/platform/pull-requests.ts +134 -25
  112. package/lib/platform/releases.ts +1 -1
  113. package/lib/platform/verification-required.ts +12 -10
  114. package/lib/prompt.ts +16 -3
  115. package/lib/release/channels.ts +4 -1
  116. package/lib/release/workflow.ts +4 -3
  117. package/lib/remove-dir.ts +28 -0
  118. package/lib/run/tui.ts +9 -1
  119. package/lib/sandbox/agent-client-reconciler.ts +378 -0
  120. package/lib/sandbox/clipboard/linux.ts +2 -1
  121. package/lib/sandbox/commands/create.ts +111 -192
  122. package/lib/sandbox/commands/enter.ts +23 -1
  123. package/lib/sandbox/commands/prune.ts +2 -2
  124. package/lib/sandbox/commands/rm.ts +3 -2
  125. package/lib/sandbox/config.ts +31 -4
  126. package/lib/sandbox/constants.ts +6 -0
  127. package/lib/sandbox/dockerfile.ts +2 -1
  128. package/lib/sandbox/managed-fs.ts +18 -5
  129. package/lib/sandbox/recovery.ts +98 -67
  130. package/lib/sandbox/shell.ts +1 -1
  131. package/lib/sandbox/tool-types.ts +143 -0
  132. package/lib/sandbox/tools.ts +5 -157
  133. package/lib/task/artifact-lifecycle.ts +1 -38
  134. package/lib/task/commands/decisions.ts +53 -20
  135. package/lib/task/delegation-receipts.ts +170 -0
  136. package/lib/task/events.ts +110 -2
  137. package/lib/task/orchestration.ts +543 -0
  138. package/lib/task/review-artifacts.ts +201 -69
  139. package/lib/task/review-finalization.ts +275 -0
  140. package/lib/task/review-fingerprint.ts +5 -0
  141. package/lib/task/verification-checks.ts +2 -1
  142. package/lib/task/verification-engine.ts +177 -28
  143. package/lib/task/verification-review.ts +1 -0
  144. package/lib/task/verification.ts +5 -2
  145. package/lib/task/workspace-snapshot.ts +36 -0
  146. package/lib/update.ts +48 -184
  147. package/package.json +2 -2
  148. package/templates/.agents/README.en.md +21 -20
  149. package/templates/.agents/README.zh-CN.md +21 -20
  150. package/templates/.agents/hooks/lifecycle-delegation.js +64 -0
  151. package/templates/.agents/rules/README.en.md +2 -0
  152. package/templates/.agents/rules/README.zh-CN.md +2 -0
  153. package/templates/.agents/rules/commit-and-pr.en.md +1 -0
  154. package/templates/.agents/rules/commit-and-pr.zh-CN.md +1 -0
  155. package/templates/.agents/rules/human-decision-context.en.md +14 -12
  156. package/templates/.agents/rules/human-decision-context.zh-CN.md +14 -12
  157. package/templates/.agents/rules/lifecycle-orchestration.en.md +21 -0
  158. package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +21 -0
  159. package/templates/.agents/rules/next-step-output.en.md +16 -0
  160. package/templates/.agents/rules/next-step-output.zh-CN.md +16 -0
  161. package/templates/.agents/rules/no-mid-flow-questions.en.md +2 -0
  162. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +2 -0
  163. package/templates/.agents/rules/release-commands.github.en.md +11 -5
  164. package/templates/.agents/rules/release-commands.github.zh-CN.md +11 -5
  165. package/templates/.agents/rules/review-handshake.en.md +4 -4
  166. package/templates/.agents/rules/review-handshake.zh-CN.md +4 -4
  167. package/templates/.agents/rules/review-method.en.md +113 -0
  168. package/templates/.agents/rules/review-method.zh-CN.md +98 -0
  169. package/templates/.agents/skills/analyze-task/SKILL.en.md +5 -5
  170. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +5 -5
  171. package/templates/.agents/skills/block-task/SKILL.en.md +4 -4
  172. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +4 -4
  173. package/templates/.agents/skills/cancel-task/SKILL.en.md +4 -4
  174. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +5 -5
  175. package/templates/.agents/skills/check-task/SKILL.en.md +16 -16
  176. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +16 -16
  177. package/templates/.agents/skills/close-codescan/SKILL.en.md +4 -4
  178. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +4 -4
  179. package/templates/.agents/skills/close-dependabot/SKILL.en.md +4 -4
  180. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +4 -4
  181. package/templates/.agents/skills/code-task/SKILL.en.md +1 -1
  182. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +2 -2
  183. package/templates/.agents/skills/code-task/reference/fix-mode.en.md +14 -16
  184. package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +14 -16
  185. package/templates/.agents/skills/code-task/reference/output-template.en.md +3 -3
  186. package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +3 -3
  187. package/templates/.agents/skills/commit/SKILL.en.md +11 -1
  188. package/templates/.agents/skills/commit/SKILL.zh-CN.md +11 -1
  189. package/templates/.agents/skills/commit/reference/task-status-update.en.md +24 -28
  190. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +24 -28
  191. package/templates/.agents/skills/complete-task/SKILL.en.md +2 -2
  192. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +2 -2
  193. package/templates/.agents/skills/create-pr/SKILL.en.md +10 -10
  194. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +10 -10
  195. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +3 -3
  196. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +3 -3
  197. package/templates/.agents/skills/create-task/SKILL.en.md +11 -11
  198. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +11 -11
  199. package/templates/.agents/skills/import-codescan/SKILL.en.md +5 -5
  200. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +5 -5
  201. package/templates/.agents/skills/import-dependabot/SKILL.en.md +5 -5
  202. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +5 -5
  203. package/templates/.agents/skills/import-issue/SKILL.en.md +5 -5
  204. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -5
  205. package/templates/.agents/skills/init-labels/SKILL.en.md +4 -4
  206. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +4 -4
  207. package/templates/.agents/skills/init-milestones/SKILL.en.md +4 -4
  208. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +4 -4
  209. package/templates/.agents/skills/plan-task/SKILL.en.md +5 -5
  210. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +5 -5
  211. package/templates/.agents/skills/refine-title/SKILL.en.md +1 -1
  212. package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +1 -1
  213. package/templates/.agents/skills/release/SKILL.en.md +1 -1
  214. package/templates/.agents/skills/review-analysis/SKILL.en.md +13 -2
  215. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +14 -3
  216. package/templates/.agents/skills/review-analysis/config/verify.en.json +6 -0
  217. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +6 -0
  218. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +13 -15
  219. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +13 -15
  220. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +51 -5
  221. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +52 -6
  222. package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +25 -22
  223. package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +25 -22
  224. package/templates/.agents/skills/review-code/SKILL.en.md +28 -8
  225. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +28 -8
  226. package/templates/.agents/skills/review-code/config/verify.en.json +7 -0
  227. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +7 -0
  228. package/templates/.agents/skills/review-code/reference/concurrency-risks.en.md +25 -0
  229. package/templates/.agents/skills/review-code/reference/concurrency-risks.zh-CN.md +25 -0
  230. package/templates/.agents/skills/review-code/reference/cross-platform-risks.en.md +27 -0
  231. package/templates/.agents/skills/review-code/reference/cross-platform-risks.zh-CN.md +27 -0
  232. package/templates/.agents/skills/review-code/reference/documentation-antipatterns.en.md +13 -0
  233. package/templates/.agents/skills/review-code/reference/documentation-antipatterns.zh-CN.md +13 -0
  234. package/templates/.agents/skills/review-code/reference/migration-risks.en.md +25 -0
  235. package/templates/.agents/skills/review-code/reference/migration-risks.zh-CN.md +25 -0
  236. package/templates/.agents/skills/review-code/reference/output-templates.en.md +22 -24
  237. package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +22 -24
  238. package/templates/.agents/skills/review-code/reference/report-template.en.md +54 -7
  239. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +54 -7
  240. package/templates/.agents/skills/review-code/reference/review-criteria.en.md +29 -24
  241. package/templates/.agents/skills/review-code/reference/review-criteria.zh-CN.md +29 -24
  242. package/templates/.agents/skills/review-code/reference/security-risks.en.md +25 -0
  243. package/templates/.agents/skills/review-code/reference/security-risks.zh-CN.md +25 -0
  244. package/templates/.agents/skills/review-plan/SKILL.en.md +13 -2
  245. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +14 -3
  246. package/templates/.agents/skills/review-plan/config/verify.en.json +6 -0
  247. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +6 -0
  248. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +13 -15
  249. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +13 -15
  250. package/templates/.agents/skills/review-plan/reference/report-template.en.md +61 -5
  251. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +61 -5
  252. package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +21 -24
  253. package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +21 -24
  254. package/templates/.agents/skills/run-task/SKILL.en.md +22 -0
  255. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +22 -0
  256. package/templates/.agents/skills/run-task/config/verify.en.json +9 -0
  257. package/templates/.agents/skills/run-task/config/verify.zh-CN.json +9 -0
  258. package/templates/.agents/skills/test/SKILL.en.md +4 -4
  259. package/templates/.agents/skills/test/SKILL.zh-CN.md +4 -4
  260. package/templates/.agents/skills/test-integration/SKILL.en.md +4 -4
  261. package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +4 -4
  262. package/templates/.agents/skills/update-agent-infra/SKILL.en.md +5 -5
  263. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +5 -5
  264. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +647 -203
  265. package/templates/.agents/skills/upgrade-dependency/SKILL.en.md +4 -4
  266. package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +4 -4
  267. package/templates/.agents/skills/watch-pr/SKILL.en.md +8 -8
  268. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +8 -8
  269. package/templates/.claude/agents/agent-infra-lifecycle-executor.en.md +6 -0
  270. package/templates/.claude/agents/agent-infra-lifecycle-executor.zh-CN.md +6 -0
  271. package/templates/.claude/agents/agent-infra-lifecycle-reviewer.en.md +6 -0
  272. package/templates/.claude/agents/agent-infra-lifecycle-reviewer.zh-CN.md +6 -0
  273. package/templates/.claude/commands/run-task.en.md +8 -0
  274. package/templates/.claude/commands/run-task.zh-CN.md +8 -0
  275. package/templates/.claude/settings.json +24 -0
  276. package/templates/.codex/agents/agent-infra-lifecycle-executor.en.toml +3 -0
  277. package/templates/.codex/agents/agent-infra-lifecycle-executor.zh-CN.toml +3 -0
  278. package/templates/.codex/agents/agent-infra-lifecycle-reviewer.en.toml +3 -0
  279. package/templates/.codex/agents/agent-infra-lifecycle-reviewer.zh-CN.toml +3 -0
  280. package/templates/.gemini/commands/_project_/run-task.en.toml +8 -0
  281. package/templates/.gemini/commands/_project_/run-task.zh-CN.toml +8 -0
  282. package/templates/.opencode/commands/run-task.en.md +11 -0
  283. package/templates/.opencode/commands/run-task.zh-CN.md +11 -0
@@ -21,11 +21,50 @@
21
21
  - **审查者**:{reviewer-name}
22
22
  - **审查时间**:{timestamp}
23
23
  - **审查范围**:{file-count and major modules}
24
- - **审查基线提交**:{本轮一次性捕获的 R 原文}(仅表示 diff base;详见 `.agents/rules/review-handshake.md`)
24
+ - **审查基线提交**:{本轮一次性捕获的审查提交 R 原文;必须等于本轮 HEAD}
25
+ - **审查差异基线**:{用于完整 diff/fingerprint 的 D 原文;已绑定 PR 时为 R 与 PR base SHA 的 merge-base,否则为 R}
25
26
  - **审查差异指纹**:{git-workflow snapshot 输出的 fingerprint 字段}
26
27
  - **审查快照树**:{git-workflow snapshot 输出的 tree 字段}
27
28
  - **总体结论**:{通过 / 需要修改 / 拒绝}(恰取一个;禁止写组合短语,否则 verify gate 失败)
28
- - **发现(AI 可处理)**:0 阻塞项,0 主要,0 次要 / **人工校验**:0
29
+ - **发现(AI 可处理)**:{unresolved-blockers} 阻塞项,{unresolved-major} 主要,{unresolved-minor} 次要 / **人工校验**:0
30
+
31
+ ## 检视覆盖声明
32
+
33
+ | pass_id | scope | evidence | result | gaps_or_assumptions |
34
+ |---------|-------|----------|--------|---------------------|
35
+ | pass-1..5 | {本遍实际范围} | {artifact / diff / file:line / command} | {发现或结论} | {缺口或假设} |
36
+
37
+ | lens_id | trigger_evidence | loaded | result |
38
+ |---------|------------------|--------|--------|
39
+ | {registry token} | {命中或未命中证据} | {yes / no / not-applicable} | {专项结论} |
40
+
41
+ ## 代码实现专项覆盖
42
+
43
+ | context_id | changed_lines | related_context | uncovered_area | result_or_gap |
44
+ |------------|---------------|-----------------|----------------|---------------|
45
+ | {file/module} | {changed line ranges} | {callers/callees/state/data flow} | {not reviewed or none} | {result / gap} |
46
+
47
+ | quality_id | applicability | evidence | result_or_gap |
48
+ |------------|---------------|----------|---------------|
49
+ | responsibility | {applicable / not-applicable} | {code or call evidence} | {result / gap} |
50
+ | cohesion | {applicable / not-applicable} | {code or call evidence} | {result / gap} |
51
+ | coupling | {applicable / not-applicable} | {dependency evidence} | {result / gap} |
52
+ | dependency-direction | {applicable / not-applicable} | {dependency evidence} | {result / gap} |
53
+ | abstraction-fit | {applicable / not-applicable} | {variation evidence} | {result / gap} |
54
+ | pattern-cost | {applicable / not-applicable} | {problem, conditions, cost, simpler alternative} | {result / gap} |
55
+ | change-locality | {applicable / not-applicable} | {change propagation evidence} | {result / gap} |
56
+ | testability | {applicable / not-applicable} | {test seam or behavior evidence} | {result / gap} |
57
+ | architecture-boundary | {applicable / not-applicable} | {approved plan boundary} | {result / gap} |
58
+
59
+ | acceptance_id | plan_source | implementation_location | test_or_validation_evidence | status_or_gap |
60
+ |---------------|-------------|-------------------------|-----------------------------|---------------|
61
+ | {acceptance token} | {approved requirement/plan} | {file:line or diff} | {automated test / manual-validation / explicit gap} | {covered / gap} |
62
+
63
+ ## 追踪矩阵
64
+
65
+ | source_id | upstream | reviewed_target | verification | status_or_gap |
66
+ |-----------|----------|-----------------|--------------|---------------|
67
+ | {需求/方案步骤} | {已批准需求或设计} | {代码 diff} | {自动化测试或人工校验} | {covered / gap} |
29
68
 
30
69
  ## 问题清单
31
70
 
@@ -33,15 +72,23 @@
33
72
 
34
73
  #### 1. {问题标题}
35
74
  **文件**:`{file-path}:{line-number}`
36
- **说明**:{details}
37
- **修复建议**:{fix suggestion}
75
+ **场景**:{scenario}
76
+ **影响**:{impact}
77
+ **证据**:{evidence_type: test / call-chain / state-transition / data-flow / specification-conflict / file-location} — {reproducible evidence}
78
+ **置信度**:{high / medium / low}
79
+ **未验证假设**:{assumptions or none}
80
+ **修复方向**:{fix direction}
38
81
 
39
82
  ### 主要问题(建议修复)
40
83
 
41
84
  #### 1. {问题标题}
42
85
  **文件**:`{file-path}:{line-number}`
43
- **说明**:{details}
44
- **修复建议**:{fix suggestion}
86
+ **场景**:{scenario}
87
+ **影响**:{impact}
88
+ **证据**:{evidence_type: test / call-chain / state-transition / data-flow / specification-conflict / file-location} — {reproducible evidence}
89
+ **置信度**:{high / medium / low}
90
+ **未验证假设**:{assumptions or none}
91
+ **修复方向**:{fix direction}
45
92
 
46
93
  ### 次要问题(低影响但需闭环)
47
94
 
@@ -75,7 +122,7 @@
75
122
 
76
123
  ## 证据原文
77
124
 
78
- > 每条“我验证了 X”断言都要配对对应 tool output 原文;gate 仅校验本段存在和至少一行 `$ `。每条 Blocker 必须配可复现命令(rg/grep/sed/nl)及其原文;无法复现的判断须降级或移入「自我质疑」。
125
+ > 每条“我验证了 X”断言都要配对对应 tool output 原文;gate 仅校验本段存在和至少一行 `$ `。每条 Blocker 必须配可复现的测试、调用链、状态转换、数据流、规范冲突或准确位置证据;无法复现的判断须降级或移入「自我质疑」。
79
126
 
80
127
  - 断言:{verified claim}
81
128
  ```text
@@ -13,10 +13,12 @@ Follow the `code-review` step in `.agents/workflows/feature-development.yaml`.
13
13
  - [ ] Error handling and edge cases
14
14
  - [ ] Performance and security risks
15
15
  - [ ] Comments and documentation
16
+ - [ ] New or changed documentation accurately reflects the current behavior after the change
17
+ - [ ] Documentation changes are deterministically routed to mandatory references by the shared risk-lens registry
16
18
  - [ ] Consistency with the approved technical plan
17
19
  - [ ] The reviewer checked whether the executor missed any key design decision that should be upgraded to `[needs-human-decision]`
18
20
  - [ ] Every `needs-human-decision` detail produced this round follows the self-contained structure in `.agents/rules/human-decision-context.md`
19
- - [ ] Every blocker is backed by reproducible grep/sed/nl evidence; conclusions not directly verified are declared under Self-Doubt
21
+ - [ ] Every blocker/major uses semantic evidence proportionate to the issue; conclusions not directly verified are declared under Self-Doubt
20
22
 
21
23
  **Common anti-examples**:
22
24
  - Checking only whether tests pass without reading the actual diff
@@ -24,35 +26,38 @@ Follow the `code-review` step in `.agents/workflows/feature-development.yaml`.
24
26
  - Misclassifying environment-limited verification gaps as blockers
25
27
  - Asserting a `file:line` or behavior from memory or impression without verifying via rg/nl
26
28
 
27
- ## Common Review Principles
29
+ ## Shared Method and Classification Boundary
28
30
 
29
- 1. **Strict but fair**: identify issues and acknowledge solid work
30
- 2. **Specific**: cite exact file paths and line numbers
31
- 3. **Actionable**: suggest a concrete fix
32
- 4. **Severity-based**: clearly distinguish blockers, major issues, and minor issues
31
+ Read `.agents/rules/review-method.md` first and apply its five-pass protocol, risk lenses, and finding evidence contract. Finding, manual-validation, advisory, and `needs-human-decision` state semantics remain governed by `.agents/rules/review-handshake.md`. This file adds only code-stage criteria.
33
32
 
34
- ## Three-category Decision Tree
33
+ Also inspect `git diff`, the latest code artifact, latest technical-plan review artifact, and `task.md` Activity Log so the report reflects the full change context.
35
34
 
36
- 1. A correctness, completeness, security, performance, test, or acceptance gap in the current implementation is a formal finding. Assign blocker / major / minor by impact; severity does not control closure, so minor findings must also reach a terminal state.
37
- 2. When there is no known defect but validation requires a real environment, permission, or human operation, classify it as manual-validation.
38
- 3. Only a future optimization that does not affect the current implementation's completeness, correctness, or acceptance is an advisory. Put it only in Non-blocking Advisories; do not add it to the ledger, finding counts, or verdict.
35
+ ## Five Code-stage Passes
39
36
 
40
- ## Manual Validation Classification
37
+ | pass_id | code-stage action |
38
+ |---------|-------------------|
39
+ | pass-1 | Read the complete diff, untracked files, implementation/plan artifacts, task source, and raw test results |
40
+ | pass-2 | Map acceptance/plan → implementation → verification and record changed lines, call context, state/data flow, and uncovered areas |
41
+ | pass-3 | Review overall design before per-file semantics; evaluate every shared registry trigger and read each matched reference in full |
42
+ | pass-4 | Check guards, call constraints, test coverage, and narrower impact boundaries as counterevidence |
43
+ | pass-5 | Reconcile findings, manual-validation, advisories, evidence types, unverified assumptions, ledger state, and verdict |
41
44
 
42
- Some findings cannot be closed by an AI agent in the current execution environment, for example:
45
+ Line-by-line diff reading does not replace necessary call-chain, state-transition, or data-flow analysis.
43
46
 
44
- - Missing Docker / sandbox access for end-to-end validation
45
- - Missing a specific OS for macOS-only behavior
46
- - Missing third-party accounts / OAuth
47
- - Missing privileged operations such as root, sudo, or special network access
47
+ ## Structural Design Lenses
48
48
 
49
- **Decision tree**: "Can the AI agent close this item independently without changing the environment?"
50
- - Yes -> blocker / major / minor, based on risk
51
- - No -> **manual-validation** (a manual-validation meta-category, not part of severity ordering)
49
+ | quality_id | review focus |
50
+ |------------|--------------|
51
+ | responsibility | Whether each module or function has a clear responsibility boundary |
52
+ | cohesion | Whether behavior and data in one unit serve the same purpose |
53
+ | coupling | Whether dependency count, knowledge leakage, and coordination cost are justified |
54
+ | dependency-direction | Whether dependencies point toward approved stable boundaries |
55
+ | abstraction-fit | Whether abstractions match real variation without being deficient or excessive |
56
+ | pattern-cost | Whether the problem, applicability, cost, and simpler alternative justify a pattern |
57
+ | change-locality | Whether one business change can remain local |
58
+ | testability | Whether key behavior and failure paths can be observed and controlled reliably |
59
+ | architecture-boundary | Whether implementation follows the approved architecture without reopening major selection during code review |
52
60
 
53
- Where manual-validation items go:
54
- - Record them in an independent review report section named "Manual Validation Items"
55
- - Record the done-note source field as `Manual-validation: 1`; `ai task log` normalizes it into review rows
56
- - Do **not** include them in the code-task fix loop; maintainers carry them in the PR description under manual verification
61
+ ## Evidence Types
57
62
 
58
- Also inspect `git diff`, the latest code artifact, latest technical-plan review artifact, and `task.md` Activity Log so the report reflects the full change context.
63
+ Blocker/major evidence may use `test`, `call-chain`, `state-transition`, `data-flow`, `specification-conflict`, or `file-location`. Commands and `file:line` are location aids, not the only valid evidence; evidence must reproduce the scenario and explain its impact.
@@ -13,10 +13,12 @@
13
13
  - [ ] 错误处理和边界情况
14
14
  - [ ] 性能与安全风险
15
15
  - [ ] 代码注释和文档
16
+ - [ ] 新增或修改的文档准确反映变更后的当前行为
17
+ - [ ] 文档变更由共享风险镜头注册表确定性路由到必读专项 reference
16
18
  - [ ] 与已批准技术方案的一致性
17
19
  - [ ] 已复核执行方是否漏标应升级为 `[needs-human-decision]` 的关键设计决策
18
20
  - [ ] 本轮所有 `needs-human-decision` 详情均符合 `.agents/rules/human-decision-context.md` 的自足结构
19
- - [ ] 每条 blocker 都配可复现的 grep/sed/nl 证据,未直接验证的结论已在「自我质疑」声明
21
+ - [ ] 每条 blocker/major 都配与问题相称的语义证据,未直接验证的结论已在「自我质疑」声明
20
22
 
21
23
  **常见反例**:
22
24
  - 只检查测试是否通过,没有阅读实际 diff
@@ -24,35 +26,38 @@
24
26
  - 把环境缺失导致无法验证的事项误归类为 blocker
25
27
  - 凭印象或记忆断言 `file:line`/行为,没有用 rg/nl 复核就下结论
26
28
 
27
- ## 通用审查原则
29
+ ## 共享方法与分类边界
28
30
 
29
- 1. **严格但公正**:既要指出问题,也要承认做得好的部分
30
- 2. **具体**:引用准确的文件路径和行号
31
- 3. **可执行**:给出明确可落地的修复建议
32
- 4. **按严重程度分类**:明确区分 blocker、major 和 minor
31
+ 先读取 `.agents/rules/review-method.md`,按其五遍协议、风险镜头和 finding 证据契约执行;finding、manual-validation、advisory 与 `needs-human-decision` 的状态语义以 `.agents/rules/review-handshake.md` 为准。本文件只补充代码实现阶段的专项判断。
33
32
 
34
- ## 三类审查项决策树
33
+ 同时检查 `git diff`、最新实现产物、最新技术方案审查产物和 `task.md` Activity Log,确保报告反映完整的变更上下文。
35
34
 
36
- 1. 若问题揭示当前实现或测试存在正确性、完整性、安全性、性能或验收缺口,登记为正式 finding,并按影响赋予 blocker / major / minor;severity 只表示影响大小,minor 也必须闭环。
37
- 2. 若没有已知缺陷,但只能依赖真实环境、权限或人工操作完成验证,归为 manual-validation。
38
- 3. 仅当建议属于未来优化且不影响当前实现的完整性、正确性和验收时,归为 advisory。advisory 只写入「非阻塞建议」,不进入账本、问题计数或 verdict。
35
+ ## 代码阶段五遍动作
39
36
 
40
- ## 人工校验项分类
37
+ | pass_id | code-stage action |
38
+ |---------|-------------------|
39
+ | pass-1 | 读取完整 diff、未跟踪文件、实现/方案产物、任务来源和测试原始结果 |
40
+ | pass-2 | 建立验收/方案—实现—验证映射,并记录 changed lines、调用上下文、状态/数据流和未覆盖区域 |
41
+ | pass-3 | 先检查整体设计,再检查逐文件语义;判断共享注册表的每个触发器并完整加载命中 reference |
42
+ | pass-4 | 检查保护条件、调用约束、测试覆盖和更窄影响范围等反证 |
43
+ | pass-5 | 核对 finding、manual-validation、advisory、证据类型、未验证假设、账本和 verdict |
41
44
 
42
- 某些发现项是 AI agent 在本执行环境**无法闭环**的,例如:
45
+ 逐行 diff 阅读不能替代必要的调用链、状态转换或数据流检查。
43
46
 
44
- - 缺 Docker / 沙箱而无法跑端到端验证
45
- - 缺特定 OS(macOS-only 行为)
46
- - 缺第三方账号 / OAuth
47
- - 缺特权操作(root、sudo、特殊网络)
47
+ ## 结构设计镜头
48
48
 
49
- **分类决策树**:「AI agent 能否在不改环境的前提下独立闭环这一项?」
50
- - 是 -> blocker / major / minor 之一(按风险定档)
51
- - 否 -> **manual-validation**(人工校验元类目,不参与严重程度排序)
49
+ | quality_id | review focus |
50
+ |------------|--------------|
51
+ | responsibility | 单个模块或函数的职责边界是否清晰 |
52
+ | cohesion | 同一单元内的行为和数据是否共同服务一个目的 |
53
+ | coupling | 依赖数量、知识泄漏和跨模块协调成本是否合理 |
54
+ | dependency-direction | 依赖是否指向已批准的稳定边界 |
55
+ | abstraction-fit | 抽象是否匹配实际变化点,避免不足或过度抽象 |
56
+ | pattern-cost | 模式解决的问题、适用条件、成本和更简单替代是否相称 |
57
+ | change-locality | 同一业务变化是否能局部完成 |
58
+ | testability | 关键行为和失败路径能否被可靠观察与控制 |
59
+ | architecture-boundary | 实现是否遵守已批准架构,不在代码审查阶段首次重选重大架构 |
52
60
 
53
- manual-validation 项的去向:
54
- - 写入 review 报告独立段落「人工校验项」
55
- - 在 done note 中写入源字段 `Manual-validation: 1`;`ai task log` 归一化展示到 review 行
56
- - **不**进入 code-task 修复循环;维护者在 PR description 中以「待人工验证」清单形式承接
61
+ ## 证据类型
57
62
 
58
- 同时检查 `git diff`、最新实现产物、最新技术方案审查产物和 `task.md` Activity Log,确保报告反映完整的变更上下文。
63
+ blocker/major 可使用 `test`、`call-chain`、`state-transition`、`data-flow`、`specification-conflict` 或 `file-location`。命令和 `file:line` 是定位手段,不是唯一有效证据;证据必须能复现问题场景并解释影响。
@@ -0,0 +1,25 @@
1
+ # Security Risk Review
2
+
3
+ ## Scope
4
+
5
+ Use when changes touch authentication, authorization, untrusted input, sensitive data, credentials, cryptography, dependencies, or system boundaries.
6
+
7
+ ## Review Questions
8
+
9
+ - Are trust boundaries, permission checks, and deny-by-default behavior explicit?
10
+ - Do input validation, output encoding, secret handling, and logging avoid expanding exposure?
11
+ - Do new dependencies or system calls introduce capabilities or supply-chain risks outside the approved plan?
12
+
13
+ ## Evidence Requirements
14
+
15
+ Trace the call chain or data flow from entry through validation, authorization, use, and failure exits. Support conclusions with tests, specification conflicts, or accurate locations.
16
+
17
+ ## Common Counterexamples
18
+
19
+ - Assuming safety merely because a security-related API is used.
20
+ - Checking only the happy path while ignoring bypasses and failure defaults.
21
+ - Treating unavailable real credentials or external systems as blockers by default.
22
+
23
+ ## When Closure Is Not Possible
24
+
25
+ Record reproducible defects as findings, checks requiring real permissions or external systems as manual-validation, and unsupported uncovered boundaries as a gap. Do not approve unconditionally.
@@ -0,0 +1,25 @@
1
+ # 安全风险检视
2
+
3
+ ## 适用范围
4
+
5
+ 当变更触及认证授权、非可信输入、敏感数据、凭据、加密、依赖或系统边界时使用。
6
+
7
+ ## 检视问题
8
+
9
+ - 信任边界、权限检查和默认拒绝行为是否保持清晰。
10
+ - 输入验证、输出编码、秘密处理和日志记录是否避免扩大暴露面。
11
+ - 新依赖或系统调用是否引入未被方案覆盖的能力或供应链风险。
12
+
13
+ ## 证据要求
14
+
15
+ 沿入口、校验、授权、数据使用和失败出口记录调用链或数据流;用测试、规范冲突或准确位置支撑结论。
16
+
17
+ ## 常见反例
18
+
19
+ - 仅因使用了安全相关 API 就判定安全。
20
+ - 只检查正常路径,不检查绕过路径和失败默认值。
21
+ - 把无法访问真实凭据或外部系统直接归为 blocker。
22
+
23
+ ## 无法闭环时
24
+
25
+ 可复现缺陷形成 finding;必须在真实权限或外部系统中执行的检查进入 manual-validation;证据不足的未覆盖边界记录为 gap,不得无条件通过。
@@ -55,6 +55,7 @@ Read `{plan-artifact}`, the latest analysis artifact, `task.md`, and Issue conte
55
55
 
56
56
  Check simplicity, executability, risk control, test strategy, file coverage, and phase boundaries.
57
57
 
58
+ > Read `.agents/rules/review-method.md` before this step and follow its five-pass protocol for coverage, risk-lens decisions, traceability, and counterevidence.
58
59
  > Read `reference/review-criteria.md` before this step.
59
60
 
60
61
  ### 5. Write Review Report
@@ -65,7 +66,17 @@ Create `.agents/workspace/active/{task-id}/{review-artifact}`.
65
66
 
66
67
  ### 6. Update Task Status
67
68
 
68
- After the report, submit each new finding with `agent-infra-internal task-ledger {task-id} finding-upsert --stage plan --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}`; submit prior-response dispositions with `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {evidence}`. Do not scan ids or edit ledger rows. After all ledger writes, call `agent-infra-internal task-ledger {task-id} stage-status --stage plan` exactly once. Derive the verdict and next-step branch from `stageStatus.canAdvance`, and blocker/major/minor event counts from `unresolvedFindingCounts`: only `canAdvance=true` permits `approved`; otherwise use `changes-requested` or `rejected`. Then run `agent-infra-internal task-event {task-id} review-plan.completed --agent {agent} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {n} --major {n} --minor {n} --manual-validation {n}`.
69
+ After the report, submit each new finding with `agent-infra-internal task-ledger {task-id} finding-upsert --stage plan --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}`; submit prior-response dispositions with `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {evidence}`. Do not scan ids or edit ledger rows. After all ledger writes, call `agent-infra-internal task-review {task-id} finalize-summary --stage plan --artifact {review-artifact}` exactly once.
70
+
71
+ Bind and reuse this structured mapping from that one response:
72
+
73
+ ```text
74
+ {unresolved-blockers} = stageStatus.unresolvedFindingCounts.blocker
75
+ {unresolved-major} = stageStatus.unresolvedFindingCounts.major
76
+ {unresolved-minor} = stageStatus.unresolvedFindingCounts.minor
77
+ ```
78
+
79
+ The intent atomically finalizes the report summary and returns the same ledger snapshot. Do not call `stage-status`, replace placeholders manually, or rescan the finding list. If finalization fails or a response field is missing, stop before the completion event. Derive the verdict and next-step branch from the same response's `stageStatus.canAdvance`: only `canAdvance=true` permits `approved`; otherwise use `changes-requested` or `rejected`. Then run `agent-infra-internal task-event {task-id} review-plan.completed --agent {agent} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}`.
69
80
 
70
81
  `manual-validation` is the data source for the `Manual-validation` count folded into review rows in `ai task log`; do not add a parallel manual-verification field.
71
82
 
@@ -79,6 +90,6 @@ agent-infra-internal task-verify {task-id} review-plan.completed --artifact {rev
79
90
 
80
91
  ### 8. Tell the User
81
92
 
82
- Use the conclusion branch in `reference/output-templates.md` and show all TUI command formats.
93
+ Use the conclusion branch in `reference/output-templates.md` and render the selected next-step commands through the shared helper.
83
94
 
84
95
  > Before rendering the final output, read `.agents/rules/next-step-output.md` and apply both of its rules: (1) render `{task-ref}` in the "Next steps" commands as the current task's short id `NN` (see that file for lookup and fallback), while other `{task-id}` placeholders (report titles, paths) keep the full TASK-id form; (2) append the `Completed at` line as the very last line of the user-facing output (this applies to every user-facing output — success, error, and early-return paths alike, not only the success path).
@@ -58,6 +58,7 @@ agent-infra-internal task-snapshot {task-id} --format text
58
58
 
59
59
  重点检查方案的简洁性、可执行性、风险控制、测试策略、文件清单和阶段边界。
60
60
 
61
+ > 共享检视方法见 `.agents/rules/review-method.md`。执行此步骤前先读取该规则,并按五遍协议完成覆盖声明、风险镜头判断、追踪矩阵和反证检视。
61
62
  > 详细审查标准见 `reference/review-criteria.md`。执行此步骤前先读取 `reference/review-criteria.md`。
62
63
 
63
64
  ### 5. 编写审查报告
@@ -68,7 +69,17 @@ agent-infra-internal task-snapshot {task-id} --format text
68
69
 
69
70
  ### 6. 更新任务状态
70
71
 
71
- 报告完成后,新 finding 逐条调用 `agent-infra-internal task-ledger {task-id} finding-upsert --stage plan --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}`;复核上一轮响应时调用 `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {相称证据}`。不得扫描编号或手写账本行。全部账本写入完成后只调用一次 `agent-infra-internal task-ledger {task-id} stage-status --stage plan`,以 `stageStatus.canAdvance` 决定 verdict 和下一步,并以 `unresolvedFindingCounts` 填写 blocker/major/minor:仅 `canAdvance=true` 可用 `approved`,否则必须用 `changes-requested` 或 `rejected`。随后执行 `agent-infra-internal task-event {task-id} review-plan.completed --agent {agent} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {n} --major {n} --minor {n} --manual-validation {n}`。
72
+ 报告完成后,新 finding 逐条调用 `agent-infra-internal task-ledger {task-id} finding-upsert --stage plan --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}`;复核上一轮响应时调用 `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {相称证据}`。不得扫描编号或手写账本行。全部账本写入完成后只调用一次 `agent-infra-internal task-review {task-id} finalize-summary --stage plan --artifact {review-artifact}`。
73
+
74
+ 从该次返回值绑定并复用以下结构化映射:
75
+
76
+ ```text
77
+ {unresolved-blockers} = stageStatus.unresolvedFindingCounts.blocker
78
+ {unresolved-major} = stageStatus.unresolvedFindingCounts.major
79
+ {unresolved-minor} = stageStatus.unresolvedFindingCounts.minor
80
+ ```
81
+
82
+ 该 intent 原子最终化报告摘要并返回同一次账本快照;不得再调用 `stage-status`、手工替换占位符或扫描问题清单。最终化失败或返回字段缺失时,停止在完成事件之前。以同一次返回的 `stageStatus.canAdvance` 决定 verdict 和下一步:仅 `canAdvance=true` 可用 `approved`,否则必须用 `changes-requested` 或 `rejected`。随后执行 `agent-infra-internal task-event {task-id} review-plan.completed --agent {agent} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}`。
72
83
 
73
84
  `manual-validation` 是 `ai task log` 中 review 行「人工校验点」(EN `Manual-validation`)计数的数据源;不要新增并行人工验证字段。
74
85
 
@@ -84,7 +95,7 @@ agent-infra-internal task-verify {task-id} review-plan.completed --artifact {rev
84
95
 
85
96
  ### 8. 告知用户
86
97
 
87
- 按 `reference/output-templates.md` 的结论分支输出,并展示所有 TUI 的下一步命令。
98
+ 按 `reference/output-templates.md` 的结论分支输出,并通过统一 helper 渲染已选场景的下一步命令。
88
99
 
89
100
  > 渲染最终输出前先读取 `.agents/rules/next-step-output.md` 并落实其两类规则:(1) 「下一步」命令的 `{task-ref}` 渲染为当前任务短号 `NN`(取值与回退见该文件),其他 `{task-id}` 占位(报告标题、路径)保持完整 TASK-id 形式;(2) 在面向用户输出的绝对最后一行追加 `Completed at` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
90
101
 
@@ -93,7 +104,7 @@ agent-infra-internal task-verify {task-id} review-plan.completed --artifact {rev
93
104
  - [ ] 已审查最新方案上下文
94
105
  - [ ] 已创建 `{review-artifact}`
95
106
  - [ ] 已更新 task.md 并追加 Activity Log
96
- - [ ] 已展示所有 TUI 的下一步命令
107
+ - [ ] 已通过统一 helper 渲染已选场景的下一步命令
97
108
 
98
109
  ## 注意事项
99
110
 
@@ -19,6 +19,9 @@
19
19
  "file_pattern": "review-plan.md|review-plan-r{N}.md",
20
20
  "required_sections": [
21
21
  "Review Summary",
22
+ "Review Coverage Declaration",
23
+ "Technical Plan Architecture Coverage",
24
+ "Traceability Matrix",
22
25
  "Findings",
23
26
  "Non-blocking Advisories",
24
27
  "Manual Validation Items",
@@ -33,6 +36,9 @@
33
36
  "^\\$ "
34
37
  ]
35
38
  },
39
+ "review-summary": {
40
+ "stage": "plan"
41
+ },
36
42
  "activity-log": {
37
43
  "expected_action_pattern": "(Review Plan|Plan Review) \\(Round \\d+\\)"
38
44
  },
@@ -19,6 +19,9 @@
19
19
  "file_pattern": "review-plan.md|review-plan-r{N}.md",
20
20
  "required_sections": [
21
21
  "审查摘要",
22
+ "检视覆盖声明",
23
+ "技术方案架构覆盖",
24
+ "追踪矩阵",
22
25
  "问题清单",
23
26
  "非阻塞建议",
24
27
  "人工校验项",
@@ -33,6 +36,9 @@
33
36
  "^\\$ "
34
37
  ]
35
38
  },
39
+ "review-summary": {
40
+ "stage": "plan"
41
+ },
36
42
  "activity-log": {
37
43
  "expected_action_pattern": "(Review Plan|Plan Review) \\(Round \\d+\\)"
38
44
  },
@@ -15,22 +15,20 @@ Rules:
15
15
  - Do not mix text from multiple scenarios
16
16
  - If `Blocker > 0`, never use an approved template
17
17
  - Never count manual-validation items as blocker / major / minor or use them to trigger Scenario B/C/D
18
- - The selected scenario must include all TUI command formats
18
+ - The selected scenario must generate `{next-step-commands}` through the shared helper
19
19
  - The count line shows 4 numbers. `Human-decision` (`{h}`) counts this stage's `needs-human-decision` rows; because those rows are unresolved, `{h} > 0` means `canAdvance=false`. Expand the "Pending human-decision pre-block" from `.agents/rules/next-step-output.md` and show revision and re-review paths only.
20
20
 
21
- For Scenarios B/C/D, follow the revision commands with re-review commands: `/review-plan {task-ref}`, `/{{project}}:review-plan {task-ref}`, and `$review-plan {task-ref}`.
22
-
23
21
  ### Scenario A: Approved with no findings
24
22
 
23
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill code-task --task-ref {task-ref}`.
24
+
25
25
  ```text
26
26
  Task {task-id} technical plan review completed. Verdict: approved.
27
27
  - Blockers: 0 | Major issues: 0 | Minor issues: 0 | Human-decision: {h}
28
28
  [- Review report: .agents/workspace/active/{task-id}/{review-artifact}]
29
29
 
30
30
  Next step - write code:
31
- - Claude Code / OpenCode: /code-task {task-ref}
32
- - Gemini CLI: /{{project}}:code-task {task-ref}
33
- - Codex CLI: $code-task {task-ref}
31
+ {next-step-commands}
34
32
 
35
33
  [When manual-validation > 0, append:]
36
34
  Reminder: manual-validation items belong in the PR description manual verification checklist and should not trigger /plan-task.
@@ -38,15 +36,15 @@ Reminder: manual-validation items belong in the PR description manual verificati
38
36
 
39
37
  ### Scenario B: Changes requested (major / minor)
40
38
 
39
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill plan-task --task-ref {task-ref}`.
40
+
41
41
  ```text
42
42
  Task {task-id} technical plan review completed. Verdict: changes requested.
43
43
  - Blockers: 0 | Major issues: {n} | Minor issues: {n} | Human-decision: {h}
44
44
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
45
45
 
46
46
  Next step - revise technical plan:
47
- - Claude Code / OpenCode: /plan-task {task-ref}
48
- - Gemini CLI: /{{project}}:plan-task {task-ref}
49
- - Codex CLI: $plan-task {task-ref}
47
+ {next-step-commands}
50
48
 
51
49
  [When manual-validation > 0, append:]
52
50
  Reminder: manual-validation items belong in the PR description manual verification checklist and should not trigger /plan-task.
@@ -54,15 +52,15 @@ Reminder: manual-validation items belong in the PR description manual verificati
54
52
 
55
53
  ### Scenario C: Changes requested
56
54
 
55
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill plan-task --task-ref {task-ref}`.
56
+
57
57
  ```text
58
58
  Task {task-id} technical plan review completed. Verdict: changes requested.
59
59
  - Blockers: {n} | Major issues: {n} | Minor issues: {n} | Human-decision: {h}
60
60
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
61
61
 
62
62
  Next step - revise technical plan:
63
- - Claude Code / OpenCode: /plan-task {task-ref}
64
- - Gemini CLI: /{{project}}:plan-task {task-ref}
65
- - Codex CLI: $plan-task {task-ref}
63
+ {next-step-commands}
66
64
 
67
65
  [When manual-validation > 0, append:]
68
66
  Reminder: manual-validation items belong in the PR description manual verification checklist and should not trigger /plan-task.
@@ -70,15 +68,15 @@ Reminder: manual-validation items belong in the PR description manual verificati
70
68
 
71
69
  ### Scenario D: Rejected
72
70
 
71
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill plan-task --task-ref {task-ref}`.
72
+
73
73
  ```text
74
74
  Task {task-id} technical plan review completed. Verdict: rejected, redesign required.
75
75
  - Blockers: {n} | Major issues: {n} | Minor issues: {n} | Human-decision: {h}
76
76
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
77
77
 
78
78
  Next step - redesign:
79
- - Claude Code / OpenCode: /plan-task {task-ref}
80
- - Gemini CLI: /{{project}}:plan-task {task-ref}
81
- - Codex CLI: $plan-task {task-ref}
79
+ {next-step-commands}
82
80
 
83
81
  [When manual-validation > 0, append:]
84
82
  Reminder: manual-validation items belong in the PR description manual verification checklist and should not trigger /plan-task.
@@ -15,22 +15,20 @@
15
15
  - 不要混用不同场景的文案
16
16
  - 只要 `Blocker > 0`,就绝对不能输出通过模板
17
17
  - manual-validation 项绝对不能被计入 blocker / major / minor 计数,也不能用作触发场景 B/C/D 的依据
18
- - 所选场景中必须包含所有 TUI 命令格式
18
+ - 所选场景必须通过统一 helper 生成 `{next-step-commands}`
19
19
  - 计数行固定显示 4 个数字。`人工裁决`(`{h}`)是本阶段 `needs-human-decision` 行数;它属于未闭环账本状态,因此 `{h} > 0` 时 `canAdvance=false`,必须按 `.agents/rules/next-step-output.md` 的「人工裁决待办前置块」展开详情,并只输出修订与复审路径。
20
20
 
21
- 场景 B/C/D 在修订命令后继续列出复审命令:`/review-plan {task-ref}`、`/{{project}}:review-plan {task-ref}`、`$review-plan {task-ref}`。
22
-
23
21
  ### 场景 A:通过且无问题
24
22
 
23
+ 使用 `agent-infra-internal agent-client next-steps --skill code-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
24
+
25
25
  ```text
26
26
  任务 {task-id} 技术方案审查完成。结论:通过。
27
27
  - 阻塞项:0 | 主要问题:0 | 次要问题:0 | 人工裁决:{h}
28
28
  [- 审查报告:.agents/workspace/active/{task-id}/{review-artifact}]
29
29
 
30
30
  下一步 - 编写代码:
31
- - Claude Code / OpenCode:/code-task {task-ref}
32
- - Gemini CLI:/{{project}}:code-task {task-ref}
33
- - Codex CLI:$code-task {task-ref}
31
+ {next-step-commands}
34
32
 
35
33
  [当 manual-validation > 0 时,在最后附加一行:]
36
34
  提醒:manual-validation 项需在 PR description 的「待人工验证」清单中承接,不应触发 /plan-task。
@@ -38,15 +36,15 @@
38
36
 
39
37
  ### 场景 B:需要修改(major / minor)
40
38
 
39
+ 使用 `agent-infra-internal agent-client next-steps --skill plan-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
40
+
41
41
  ```text
42
42
  任务 {task-id} 技术方案审查完成。结论:需要修改。
43
43
  - 阻塞项:0 | 主要问题:{n} | 次要问题:{n} | 人工裁决:{h}
44
44
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
45
45
 
46
46
  下一步 - 修订技术方案:
47
- - Claude Code / OpenCode:/plan-task {task-ref}
48
- - Gemini CLI:/{{project}}:plan-task {task-ref}
49
- - Codex CLI:$plan-task {task-ref}
47
+ {next-step-commands}
50
48
 
51
49
  [当 manual-validation > 0 时,在最后附加一行:]
52
50
  提醒:manual-validation 项需在 PR description 的「待人工验证」清单中承接,不应触发 /plan-task。
@@ -54,15 +52,15 @@
54
52
 
55
53
  ### 场景 C:需要修改
56
54
 
55
+ 使用 `agent-infra-internal agent-client next-steps --skill plan-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
56
+
57
57
  ```text
58
58
  任务 {task-id} 技术方案审查完成。结论:需要修改。
59
59
  - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n} | 人工裁决:{h}
60
60
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
61
61
 
62
62
  下一步 - 修订技术方案:
63
- - Claude Code / OpenCode:/plan-task {task-ref}
64
- - Gemini CLI:/{{project}}:plan-task {task-ref}
65
- - Codex CLI:$plan-task {task-ref}
63
+ {next-step-commands}
66
64
 
67
65
  [当 manual-validation > 0 时,在最后附加一行:]
68
66
  提醒:manual-validation 项需在 PR description 的「待人工验证」清单中承接,不应触发 /plan-task。
@@ -70,15 +68,15 @@
70
68
 
71
69
  ### 场景 D:拒绝
72
70
 
71
+ 使用 `agent-infra-internal agent-client next-steps --skill plan-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
72
+
73
73
  ```text
74
74
  任务 {task-id} 技术方案审查完成。结论:拒绝,需要重新设计。
75
75
  - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n} | 人工裁决:{h}
76
76
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
77
77
 
78
78
  下一步 - 重新设计:
79
- - Claude Code / OpenCode:/plan-task {task-ref}
80
- - Gemini CLI:/{{project}}:plan-task {task-ref}
81
- - Codex CLI:$plan-task {task-ref}
79
+ {next-step-commands}
82
80
 
83
81
  [当 manual-validation > 0 时,在最后附加一行:]
84
82
  提醒:manual-validation 项需在 PR description 的「待人工验证」清单中承接,不应触发 /plan-task。