@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
@@ -19,6 +19,9 @@
19
19
  "file_pattern": "review-code.md|review-code-r{N}.md",
20
20
  "required_sections": [
21
21
  "Review Summary",
22
+ "Review Coverage Declaration",
23
+ "Code Implementation Coverage",
24
+ "Traceability Matrix",
22
25
  "Findings",
23
26
  "Non-blocking Advisories",
24
27
  "Manual Validation Items",
@@ -33,10 +36,14 @@
33
36
  "^\\$ ",
34
37
  "^- \\*\\*Overall Verdict\\*\\*[::]\\s*(?:通过|需要修改|拒绝|Approved|Changes Requested|Rejected)\\s*$",
35
38
  "^- \\*\\*Review Baseline Commit\\*\\*[::]\\s*\\S",
39
+ "^- \\*\\*Reviewed Diff Base\\*\\*[::]\\s*[0-9a-f]{40,64}\\s*$",
36
40
  "^- \\*\\*Reviewed Diff Fingerprint\\*\\*[::]\\s*sha256:[0-9a-f]{64}\\s*$",
37
41
  "^- \\*\\*Reviewed Snapshot Tree\\*\\*[::]\\s*[0-9a-f]{40,64}\\s*$"
38
42
  ]
39
43
  },
44
+ "review-summary": {
45
+ "stage": "code"
46
+ },
40
47
  "review-fact": {},
41
48
  "activity-log": {
42
49
  "expected_action_pattern": "(Review Code|Code Review) \\(Round \\d+\\)"
@@ -19,6 +19,9 @@
19
19
  "file_pattern": "review-code.md|review-code-r{N}.md",
20
20
  "required_sections": [
21
21
  "审查摘要",
22
+ "检视覆盖声明",
23
+ "代码实现专项覆盖",
24
+ "追踪矩阵",
22
25
  "问题清单",
23
26
  "非阻塞建议",
24
27
  "人工校验项",
@@ -33,10 +36,14 @@
33
36
  "^\\$ ",
34
37
  "^- \\*\\*总体结论\\*\\*[::]\\s*(?:通过|需要修改|拒绝|Approved|Changes Requested|Rejected)\\s*$",
35
38
  "^- \\*\\*审查基线提交\\*\\*[::]\\s*\\S",
39
+ "^- \\*\\*审查差异基线\\*\\*[::]\\s*[0-9a-f]{40,64}\\s*$",
36
40
  "^- \\*\\*审查差异指纹\\*\\*[::]\\s*sha256:[0-9a-f]{64}\\s*$",
37
41
  "^- \\*\\*审查快照树\\*\\*[::]\\s*[0-9a-f]{40,64}\\s*$"
38
42
  ]
39
43
  },
44
+ "review-summary": {
45
+ "stage": "code"
46
+ },
40
47
  "review-fact": {},
41
48
  "activity-log": {
42
49
  "expected_action_pattern": "(Review Code|Code Review) \\(Round \\d+\\)"
@@ -0,0 +1,25 @@
1
+ # Concurrency Risk Review
2
+
3
+ ## Scope
4
+
5
+ Use when changes touch asynchronous coordination, shared state, locks, retries, idempotency, races, cancellation, or timeouts.
6
+
7
+ ## Review Questions
8
+
9
+ - Are shared-state ownership, atomic boundaries, and visibility explicit?
10
+ - Do retries, timeouts, cancellation, and duplicate delivery remain idempotent and resource-safe?
11
+ - Can competing order or failure interleavings cause lost updates, duplicate side effects, or deadlocks?
12
+
13
+ ## Evidence Requirements
14
+
15
+ Record key state transitions, event order, and synchronization boundaries. Support conclusions with deterministic concurrency tests, call chains, or data flows.
16
+
17
+ ## Common Counterexamples
18
+
19
+ - Inferring concurrency safety from one successful sequential execution.
20
+ - Checking only that a lock exists without its granularity, ordering, and release paths.
21
+ - Replacing explainable evidence with one successful randomized stress run.
22
+
23
+ ## When Closure Is Not Possible
24
+
25
+ Record reproducible races or leaks as findings, checks requiring a real scheduler or load environment as manual-validation, and uncovered interleavings as a gap.
@@ -0,0 +1,25 @@
1
+ # 并发风险检视
2
+
3
+ ## 适用范围
4
+
5
+ 当变更触及异步协调、共享状态、锁、重试、幂等、竞态、取消或超时时使用。
6
+
7
+ ## 检视问题
8
+
9
+ - 共享状态的所有权、原子边界和可见性是否明确。
10
+ - 重试、超时、取消和重复交付是否保持幂等且不会泄漏资源。
11
+ - 竞争顺序和失败交错是否会产生丢失更新、重复副作用或死锁。
12
+
13
+ ## 证据要求
14
+
15
+ 记录关键状态转换、事件顺序和同步边界;使用确定性并发测试、调用链或数据流支撑结论。
16
+
17
+ ## 常见反例
18
+
19
+ - 单次顺序执行通过就推断并发安全。
20
+ - 只检查加锁存在,不检查锁粒度、顺序和释放路径。
21
+ - 用随机压力测试的单次成功替代可解释证据。
22
+
23
+ ## 无法闭环时
24
+
25
+ 可重现的竞态或资源泄漏形成 finding;需要真实调度器或负载环境的检查进入 manual-validation;未覆盖交错记录为 gap。
@@ -0,0 +1,27 @@
1
+ # Cross-platform Risk Review
2
+
3
+ ## Scope
4
+
5
+ Use when changes touch OS branches, path or case behavior, shells and commands, permissions, symlinks, newlines or encodings, signals and processes, or platform fallbacks.
6
+
7
+ When the change also touches test files and must express real platform guards or test execution scope, read `.agents/rules/cross-platform-tests.md` in full. That second-level rule governs test scope only; this file governs implementation semantics. Do not load the second level when tests are unchanged.
8
+
9
+ ## Review Questions
10
+
11
+ - Do paths, shells, permissions, and process behavior use the real semantics of each target platform?
12
+ - Do platform fallbacks preserve consistent outcomes and distinguish unsupported behavior from runtime failure?
13
+ - Do tests execute on genuinely supported platforms instead of simulating coverage with early returns?
14
+
15
+ ## Evidence Requirements
16
+
17
+ Record affected platforms, implementation branches, and fallback paths. When test scope is involved, also record second-level rule readiness and `onPlatforms()` guards.
18
+
19
+ ## Common Counterexamples
20
+
21
+ - Inferring equivalence across platforms from success on the development platform.
22
+ - Simulating path or shell behavior with string concatenation.
23
+ - Loading the test-guard rule unconditionally for formal completeness.
24
+
25
+ ## When Closure Is Not Possible
26
+
27
+ Record reproducible platform defects as findings, checks that only a specific real platform can close as manual-validation, and actual platform risks left uncovered by missing, unloaded, or insufficient rules as a gap. A structural gate cannot replace semantic judgment.
@@ -0,0 +1,27 @@
1
+ # 跨平台风险检视
2
+
3
+ ## 适用范围
4
+
5
+ 当变更触及 OS 分支、路径与大小写、shell/命令、权限、符号链接、换行/编码、信号/进程或平台回退时使用。
6
+
7
+ 若变更同时触及测试文件,且需要表达真实平台守卫或测试运行范围,继续完整读取 `.agents/rules/cross-platform-tests.md`。该二级规则只约束测试运行范围;本文件负责实现层的平台语义。没有测试变更时不加载二级规则。
8
+
9
+ ## 检视问题
10
+
11
+ - 路径、shell、权限和进程行为是否使用目标平台真实语义。
12
+ - 平台回退是否保留一致结果,并区分不支持与运行失败。
13
+ - 测试是否在真实支持平台执行,而非用测试体内早返回伪装覆盖。
14
+
15
+ ## 证据要求
16
+
17
+ 记录受影响平台、实现分支和回退路径;涉及测试范围时同时记录二级规则加载证据和 `onPlatforms()` 守卫。
18
+
19
+ ## 常见反例
20
+
21
+ - 用当前开发平台成功推断所有平台等价。
22
+ - 以字符串拼接模拟路径或 shell 行为。
23
+ - 为形式完整无条件加载测试守卫规则。
24
+
25
+ ## 无法闭环时
26
+
27
+ 可复现的平台缺陷形成 finding;只能在特定真实平台闭环的事项进入 manual-validation;规则缺失、未加载或未覆盖的实际平台风险记录为 gap,不得用结构 gate 替代语义判断。
@@ -0,0 +1,13 @@
1
+ # Documentation Anti-patterns
2
+
3
+ When reviewing new or changed documentation, require it to describe the current behavior after the change instead of using historical differences as a substitute for current facts.
4
+
5
+ ## Backward-looking Descriptions of Removed Functionality
6
+
7
+ When functionality has been removed, current-behavior documentation should not keep saying that the functionality "no longer exists" or "was removed." Such wording keeps a deleted concept in the set of current knowledge that readers must understand.
8
+
9
+ Terms such as `不再`, `no longer`, `已被移除`, `removed`, and `used to` can locate candidate text, but a match is not a finding by itself. Judge the documentation's purpose and change context:
10
+
11
+ - Current reference documentation, rules, and usage instructions should directly describe supported behavior.
12
+ - Migration guides, changelogs, and historical records may preserve necessary before-and-after differences when their historical or migration context is explicit.
13
+ - Record a finding only when backward-looking wording preserves a deleted concept as current knowledge, and cite the exact file and line.
@@ -0,0 +1,13 @@
1
+ # 文档反模式
2
+
3
+ 审查新增或修改的文档时,文档应描述变更后的当前行为,而不是用历史差异替代当前事实。
4
+
5
+ ## 已删除功能的反向描述
6
+
7
+ 当功能已经删除时,面向当前行为的文档不应继续写“该功能不再存在”或“该能力已被移除”。这类反向描述会让已删除概念继续成为读者必须理解的现行知识。
8
+
9
+ `不再`、`no longer`、`已被移除`、`removed` 和 `used to` 等词可用于定位候选文本,但命中本身不是 finding。审查者必须结合文档用途和变更上下文判断:
10
+
11
+ - 当前参考文档、规则和使用说明应直接描述现在支持的行为。
12
+ - 迁移指南、变更日志和历史记录可以保留必要的前后差异,但应明确其历史或迁移语境。
13
+ - 只有当反向措辞把已删除概念保留为现行知识时,才应登记 finding,并引用准确的文件和行号。
@@ -0,0 +1,25 @@
1
+ # Migration and Compatibility Risk Review
2
+
3
+ ## Scope
4
+
5
+ Use when changes touch persistent formats, schemas, configuration/frontmatter, compatibility reads, migrations, or rollback behavior.
6
+
7
+ ## Review Questions
8
+
9
+ - Can old data or configuration be read safely, and is the post-write version boundary explicit?
10
+ - Is migration repeatable, and can execution recover or continue after partial failure?
11
+ - Does the rollback path match the compatibility window between old and new formats?
12
+
13
+ ## Evidence Requirements
14
+
15
+ Record the transition from old input to new state, version decisions, and failure states. Prefer migration tests, fixtures, state transitions, or specification conflicts.
16
+
17
+ ## Common Counterexamples
18
+
19
+ - Testing only fresh installation and ignoring existing state.
20
+ - Assuming migration succeeds once while ignoring retries and partial writes.
21
+ - Replacing data-semantic validation with format-existence checks.
22
+
23
+ ## When Closure Is Not Possible
24
+
25
+ Record reproducible corruption or compatibility failures as findings, checks requiring real historical data as manual-validation, and missing samples or rollback evidence as a gap.
@@ -0,0 +1,25 @@
1
+ # 迁移与兼容风险检视
2
+
3
+ ## 适用范围
4
+
5
+ 当变更触及持久化格式、schema、配置/frontmatter、兼容读取、迁移或回滚行为时使用。
6
+
7
+ ## 检视问题
8
+
9
+ - 旧数据或旧配置能否被安全读取,写入后的版本边界是否明确。
10
+ - 迁移是否可重复执行,部分失败后能否恢复或继续。
11
+ - 回滚路径是否与新旧格式的兼容窗口一致。
12
+
13
+ ## 证据要求
14
+
15
+ 记录旧输入到新状态的转换、版本判定和失败状态;优先使用迁移测试、fixture、状态转换或规范冲突。
16
+
17
+ ## 常见反例
18
+
19
+ - 只验证全新安装,不验证已有状态。
20
+ - 假设迁移一次成功,忽略重试和部分写入。
21
+ - 用格式存在性测试替代数据语义验证。
22
+
23
+ ## 无法闭环时
24
+
25
+ 可复现的数据损坏或兼容失败形成 finding;需要真实历史数据的验证进入 manual-validation;缺少样本或回滚证据时记录 gap。
@@ -17,11 +17,9 @@ Prohibitions:
17
17
  - never mix text from different branches
18
18
  - if `Blocker > 0`, never output an approval template
19
19
  - never count manual-validation findings as blockers / major issues / minor issues, and never use them to trigger Branch B/C/D
20
- - always include every TUI command format in the selected branch
20
+ - generate `{next-step-commands}` for the selected branch through the shared helper
21
21
  - The count line shows 5 numbers. Manual-validation (`{e}`) does not affect selection. `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.
22
22
 
23
- For Branches B/C/D, follow the revision commands with re-review commands: `/review-code {task-ref}`, `/{{project}}:review-code {task-ref}`, and `$review-code {task-ref}`.
24
-
25
23
  ### Branch A: Approved with No Findings
26
24
 
27
25
  Do not route by review round. Compare reviewed snapshot tree `T` with the tree of baseline `R`, then read `prFlow` / `pr_number`; when a PR exists, call `agent-infra-internal platform-checks inspect {task-id}`. Select exactly one mutually exclusive exit:
@@ -45,51 +43,51 @@ Reminder: manual-validation findings must be carried in the PR description as a
45
43
 
46
44
  #### Branch A1: Commit or Push
47
45
 
46
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill commit --task-ref {task-ref}`.
47
+
48
48
  ```text
49
49
  Next step - commit or push the code:
50
- - Claude Code / OpenCode: /commit {task-ref}
51
- - Gemini CLI: /{{project}}:commit {task-ref}
52
- - Codex CLI: $commit {task-ref}
50
+ {next-step-commands}
53
51
  ```
54
52
 
55
53
  #### Branch A2: Create a Pull Request
56
54
 
55
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill create-pr --task-ref {task-ref}`.
56
+
57
57
  ```text
58
58
  Next step - create a Pull Request:
59
- - Claude Code / OpenCode: /create-pr {task-ref}
60
- - Gemini CLI: /{{project}}:create-pr {task-ref}
61
- - Codex CLI: $create-pr {task-ref}
59
+ {next-step-commands}
62
60
  ```
63
61
 
64
62
  #### Branch A3: Watch Required Checks
65
63
 
64
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill watch-pr --task-ref {task-ref}`.
65
+
66
66
  ```text
67
67
  Next step - watch PR checks:
68
- - Claude Code / OpenCode: /watch-pr {task-ref}
69
- - Gemini CLI: /{{project}}:watch-pr {task-ref}
70
- - Codex CLI: $watch-pr {task-ref}
68
+ {next-step-commands}
71
69
  ```
72
70
 
73
71
  #### Branch A4: Complete and Archive
74
72
 
73
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}`.
74
+
75
75
  ```text
76
76
  Next step - complete and archive the task:
77
- - Claude Code / OpenCode: /complete-task {task-ref}
78
- - Gemini CLI: /{{project}}:complete-task {task-ref}
79
- - Codex CLI: $complete-task {task-ref}
77
+ {next-step-commands}
80
78
  ```
81
79
 
82
80
  ### Branch B: Changes Requested (Major / Minor)
83
81
 
82
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill code-task --task-ref {task-ref}`.
83
+
84
84
  ```text
85
85
  Task {task-id} review completed. Verdict: changes requested.
86
86
  - Blockers: 0 | Major: {n} | Minor: {n} | Manual-validation: {e} | Human-decision: {h}
87
87
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
88
88
 
89
89
  Next step - fix the findings:
90
- - Claude Code / OpenCode: /code-task {task-ref}
91
- - Gemini CLI: /{{project}}:code-task {task-ref}
92
- - Codex CLI: $code-task {task-ref}
90
+ {next-step-commands}
93
91
 
94
92
  [When manual-validation > 0, append this final line:]
95
93
  Reminder: manual-validation findings must be carried in the PR description as a "manual verification required" checklist and should not trigger /code-task.
@@ -97,15 +95,15 @@ Reminder: manual-validation findings must be carried in the PR description as a
97
95
 
98
96
  ### Branch C: Changes Requested
99
97
 
98
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill code-task --task-ref {task-ref}`.
99
+
100
100
  ```text
101
101
  Task {task-id} review completed. Verdict: changes requested.
102
102
  - Blockers: {n} | Major: {n} | Minor: {n} | Manual-validation: {e} | Human-decision: {h}
103
103
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
104
104
 
105
105
  Next step - fix the findings:
106
- - Claude Code / OpenCode: /code-task {task-ref}
107
- - Gemini CLI: /{{project}}:code-task {task-ref}
108
- - Codex CLI: $code-task {task-ref}
106
+ {next-step-commands}
109
107
 
110
108
  [When manual-validation > 0, append this final line:]
111
109
  Reminder: manual-validation findings must be carried in the PR description as a "manual verification required" checklist and should not trigger /code-task.
@@ -113,15 +111,15 @@ Reminder: manual-validation findings must be carried in the PR description as a
113
111
 
114
112
  ### Branch D: Rejected
115
113
 
114
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill plan-task --task-ref {task-ref}`.
115
+
116
116
  ```text
117
117
  Task {task-id} review completed. Verdict: rejected, re-design the technical plan.
118
118
  - Blockers: {n} | Major: {n} | Minor: {n} | Manual-validation: {e} | Human-decision: {h}
119
119
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
120
120
 
121
121
  Next step - re-design the technical plan:
122
- - Claude Code / OpenCode: /plan-task {task-ref}
123
- - Gemini CLI: /{{project}}:plan-task {task-ref}
124
- - Codex CLI: $plan-task {task-ref}
122
+ {next-step-commands}
125
123
 
126
124
  > Note: Rejected means the implementation direction needs to be reworked end-to-end, not patched locally. Core artifact lifecycle branch #7 refuses a direct `/code-task` and requires a fresh plan first.
127
125
 
@@ -17,11 +17,9 @@
17
17
  - 不要混用不同场景的文案
18
18
  - 只要 `Blocker > 0`,就绝对不能输出通过模板
19
19
  - manual-validation 项绝对不能被计入 blocker / major / minor 计数,也不能用作触发场景 B/C/D 的依据
20
- - 所选场景中必须包含所有 TUI 命令格式
20
+ - 所选场景必须通过统一 helper 生成 `{next-step-commands}`
21
21
  - 计数行固定显示 5 个数字。manual-validation(`{e}`)不影响分支;`人工裁决`(`{h}`)是本阶段 `needs-human-decision` 行数,属于未闭环账本状态,因此 `{h} > 0` 时 `canAdvance=false`,必须按 `.agents/rules/next-step-output.md` 的「人工裁决待办前置块」展开详情,并只输出修订与复审路径。
22
22
 
23
- 场景 B/C/D 在修订命令后继续列出复审命令:`/review-code {task-ref}`、`/{{project}}:review-code {task-ref}`、`$review-code {task-ref}`。
24
-
25
23
  ### 场景 A:通过且无问题
26
24
 
27
25
  通过后不得按轮次路由。先比较审查快照树 `T` 与基线 `R` 的树,再读取任务的 `prFlow` / `pr_number`;存在 PR 时调用 `agent-infra-internal platform-checks inspect {task-id}`。只选择以下一个互斥出口:
@@ -45,51 +43,51 @@
45
43
 
46
44
  #### 场景 A1:提交或推送
47
45
 
46
+ 使用 `agent-infra-internal agent-client next-steps --skill commit --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
47
+
48
48
  ```text
49
49
  下一步 - 提交或推送代码:
50
- - Claude Code / OpenCode:/commit {task-ref}
51
- - Gemini CLI:/{{project}}:commit {task-ref}
52
- - Codex CLI:$commit {task-ref}
50
+ {next-step-commands}
53
51
  ```
54
52
 
55
53
  #### 场景 A2:创建 Pull Request
56
54
 
55
+ 使用 `agent-infra-internal agent-client next-steps --skill create-pr --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
56
+
57
57
  ```text
58
58
  下一步 - 创建 Pull Request:
59
- - Claude Code / OpenCode:/create-pr {task-ref}
60
- - Gemini CLI:/{{project}}:create-pr {task-ref}
61
- - Codex CLI:$create-pr {task-ref}
59
+ {next-step-commands}
62
60
  ```
63
61
 
64
62
  #### 场景 A3:监控 required checks
65
63
 
64
+ 使用 `agent-infra-internal agent-client next-steps --skill watch-pr --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
65
+
66
66
  ```text
67
67
  下一步 - 监控 PR 检查:
68
- - Claude Code / OpenCode:/watch-pr {task-ref}
69
- - Gemini CLI:/{{project}}:watch-pr {task-ref}
70
- - Codex CLI:$watch-pr {task-ref}
68
+ {next-step-commands}
71
69
  ```
72
70
 
73
71
  #### 场景 A4:完成并归档
74
72
 
73
+ 使用 `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
74
+
75
75
  ```text
76
76
  下一步 - 完成并归档任务:
77
- - Claude Code / OpenCode:/complete-task {task-ref}
78
- - Gemini CLI:/{{project}}:complete-task {task-ref}
79
- - Codex CLI:$complete-task {task-ref}
77
+ {next-step-commands}
80
78
  ```
81
79
 
82
80
  ### 场景 B:需要修改(major / minor)
83
81
 
82
+ 使用 `agent-infra-internal agent-client next-steps --skill code-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
83
+
84
84
  ```text
85
85
  任务 {task-id} 代码审查完成。结论:需要修改。
86
86
  - 阻塞项:0 | 主要问题:{n} | 次要问题:{n} | 人工校验点:{e} | 人工裁决:{h}
87
87
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
88
88
 
89
89
  下一步 - 修复问题:
90
- - Claude Code / OpenCode:/code-task {task-ref}
91
- - Gemini CLI:/{{project}}:code-task {task-ref}
92
- - Codex CLI:$code-task {task-ref}
90
+ {next-step-commands}
93
91
 
94
92
  [当 manual-validation > 0 时,在最后附加一行:]
95
93
  提醒:manual-validation 项需在 PR description 的「待人工验证」清单中承接,不应触发 /code-task。
@@ -97,15 +95,15 @@
97
95
 
98
96
  ### 场景 C:需要修改
99
97
 
98
+ 使用 `agent-infra-internal agent-client next-steps --skill code-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
99
+
100
100
  ```text
101
101
  任务 {task-id} 代码审查完成。结论:需要修改。
102
102
  - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n} | 人工校验点:{e} | 人工裁决:{h}
103
103
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
104
104
 
105
105
  下一步 - 修复问题:
106
- - Claude Code / OpenCode:/code-task {task-ref}
107
- - Gemini CLI:/{{project}}:code-task {task-ref}
108
- - Codex CLI:$code-task {task-ref}
106
+ {next-step-commands}
109
107
 
110
108
  [当 manual-validation > 0 时,在最后附加一行:]
111
109
  提醒:manual-validation 项需在 PR description 的「待人工验证」清单中承接,不应触发 /code-task。
@@ -113,15 +111,15 @@
113
111
 
114
112
  ### 场景 D:拒绝
115
113
 
114
+ 使用 `agent-infra-internal agent-client next-steps --skill plan-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
115
+
116
116
  ```text
117
117
  任务 {task-id} 代码审查完成。结论:拒绝,需要重新设计方案。
118
118
  - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n} | 人工校验点:{e} | 人工裁决:{h}
119
119
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
120
120
 
121
121
  下一步 - 重新设计技术方案:
122
- - Claude Code / OpenCode:/plan-task {task-ref}
123
- - Gemini CLI:/{{project}}:plan-task {task-ref}
124
- - Codex CLI:$plan-task {task-ref}
122
+ {next-step-commands}
125
123
 
126
124
  > 注意:Rejected 表示实现方向需要整体重做,不是局部修复。核心 artifact lifecycle 的分支 #7 会拒绝直接 `/code-task`,要求先重新方案设计。
127
125
 
@@ -21,11 +21,50 @@ Use this template when writing `review-code.md` or `review-code-r{N}.md`.
21
21
  - **Reviewer**: {reviewer-name}
22
22
  - **Review Time**: {timestamp}
23
23
  - **Scope**: {file-count and major modules}
24
- - **Review Baseline Commit**: {raw R captured once for this round} (diff base only; see `.agents/rules/review-handshake.md`)
24
+ - **Review Baseline Commit**: {raw reviewed commit R captured once for this round; must equal this round's HEAD}
25
+ - **Reviewed Diff Base**: {raw D used for the complete diff/fingerprint; the merge-base of R and the PR base SHA when a PR is bound, otherwise R}
25
26
  - **Reviewed Diff Fingerprint**: {fingerprint field from git-workflow snapshot}
26
27
  - **Reviewed Snapshot Tree**: {tree field from git-workflow snapshot}
27
28
  - **Overall Verdict**: {Approved / Changes Requested / Rejected} (pick exactly one; combined phrases will fail the verify gate)
28
- - **Findings (AI-actionable)**: 0 blockers, 0 majors, 0 minors / **Manual validation**: 0
29
+ - **Findings (AI-actionable)**: {unresolved-blockers} blockers, {unresolved-major} majors, {unresolved-minor} minors / **Manual validation**: 0
30
+
31
+ ## Review Coverage Declaration
32
+
33
+ | pass_id | scope | evidence | result | gaps_or_assumptions |
34
+ |---------|-------|----------|--------|---------------------|
35
+ | pass-1..5 | {scope actually reviewed} | {artifact / diff / file:line / command} | {finding or conclusion} | {gap or assumption} |
36
+
37
+ | lens_id | trigger_evidence | loaded | result |
38
+ |---------|------------------|--------|--------|
39
+ | {registry token} | {trigger or non-trigger evidence} | {yes / no / not-applicable} | {lens result} |
40
+
41
+ ## Code Implementation Coverage
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
+ ## Traceability Matrix
64
+
65
+ | source_id | upstream | reviewed_target | verification | status_or_gap |
66
+ |-----------|----------|-----------------|--------------|---------------|
67
+ | {requirement/plan step} | {approved requirement or design} | {code diff} | {automated test or manual validation} | {covered / gap} |
29
68
 
30
69
  ## Findings
31
70
 
@@ -33,15 +72,23 @@ Use this template when writing `review-code.md` or `review-code-r{N}.md`.
33
72
 
34
73
  #### 1. {Issue title}
35
74
  **File**: `{file-path}:{line-number}`
36
- **Description**: {details}
37
- **Suggested Fix**: {fix suggestion}
75
+ **Scenario**: {scenario}
76
+ **Impact**: {impact}
77
+ **Evidence**: {evidence_type: test / call-chain / state-transition / data-flow / specification-conflict / file-location} — {reproducible evidence}
78
+ **Confidence**: {high / medium / low}
79
+ **Unverified Assumptions**: {assumptions or none}
80
+ **Fix Direction**: {fix direction}
38
81
 
39
82
  ### Major Issues (should fix)
40
83
 
41
84
  #### 1. {Issue title}
42
85
  **File**: `{file-path}:{line-number}`
43
- **Description**: {details}
44
- **Suggested Fix**: {fix suggestion}
86
+ **Scenario**: {scenario}
87
+ **Impact**: {impact}
88
+ **Evidence**: {evidence_type: test / call-chain / state-transition / data-flow / specification-conflict / file-location} — {reproducible evidence}
89
+ **Confidence**: {high / medium / low}
90
+ **Unverified Assumptions**: {assumptions or none}
91
+ **Fix Direction**: {fix direction}
45
92
 
46
93
  ### Minor Issues (low impact, closure required)
47
94
 
@@ -75,7 +122,7 @@ Use this template when writing `review-code.md` or `review-code-r{N}.md`.
75
122
 
76
123
  ## Evidence
77
124
 
78
- > Pair each "I verified X" claim with the corresponding raw tool output; the gate only checks that this section exists and at least one `$ ` line is present. Every Blocker must be backed by a reproducible command (rg/grep/sed/nl) and its raw output; a judgment that cannot be reproduced must be downgraded or moved to Self-Doubt.
125
+ > Pair each "I verified X" claim with the corresponding raw tool output; the gate only checks that this section exists and at least one `$ ` line is present. Every Blocker must use reproducible test, call-chain, state-transition, data-flow, specification-conflict, or accurate-location evidence; a judgment that cannot be reproduced must be downgraded or moved to Self-Doubt.
79
126
 
80
127
  - Claim: {verified claim}
81
128
  ```text