@fitlab-ai/agent-infra 0.12.0 → 0.12.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 (331) hide show
  1. package/README.md +0 -2
  2. package/README.zh-CN.md +0 -2
  3. package/dist/bin/internal-cli.js +2 -17
  4. package/dist/lib/agent-clients/adapter.js +0 -13
  5. package/dist/lib/agent-clients/adapters/antigravity-cli.js +0 -5
  6. package/dist/lib/agent-clients/adapters/claude-code-credentials.js +0 -17
  7. package/dist/lib/agent-clients/adapters/claude-code.js +0 -9
  8. package/dist/lib/agent-clients/adapters/codex.js +0 -52
  9. package/dist/lib/agent-clients/adapters/opencode.js +0 -5
  10. package/dist/lib/agent-clients/adapters/traecli.js +0 -5
  11. package/dist/lib/agent-clients/config.js +19 -54
  12. package/dist/lib/agent-clients/registry.js +1 -12
  13. package/dist/lib/agent-clients/schema.js +0 -18
  14. package/dist/lib/agent-clients/tokens.js +1 -2
  15. package/dist/lib/agent-clients/types.js +0 -1
  16. package/dist/lib/decide.js +2 -0
  17. package/dist/lib/git/worktree-identity.js +1 -9
  18. package/dist/lib/internal/agent-client.js +2 -62
  19. package/dist/lib/internal/cli-route-inventory.js +1 -5
  20. package/dist/lib/internal/manual-validation.js +29 -27
  21. package/dist/lib/internal/platform-comment.js +56 -7
  22. package/dist/lib/internal/task-create.js +1 -1
  23. package/dist/lib/internal/task-event.js +1 -8
  24. package/dist/lib/internal/task-finalization.js +0 -1
  25. package/dist/lib/internal/task-lifecycle.js +2 -2
  26. package/dist/lib/internal/task-operation-registry.js +4 -20
  27. package/dist/lib/internal/task-review.js +4 -4
  28. package/dist/lib/platform/comment-safety.js +1 -7
  29. package/dist/lib/platform/in-label-sync.js +1 -14
  30. package/dist/lib/platform/issue-comments.js +373 -282
  31. package/dist/lib/platform/issue-summary-content.js +112 -0
  32. package/dist/lib/platform/issues.js +1 -1
  33. package/dist/lib/platform/operation-coordinator.js +4 -2
  34. package/dist/lib/platform/pr-change-report.js +176 -30
  35. package/dist/lib/platform/pr-checks.js +2 -8
  36. package/dist/lib/platform/pr-summary-content.js +54 -0
  37. package/dist/lib/platform/pr-summary.js +318 -284
  38. package/dist/lib/platform/provider-validation.js +0 -20
  39. package/dist/lib/platform/pull-requests.js +73 -84
  40. package/dist/lib/platform/releases.js +1 -43
  41. package/dist/lib/platform/summary-content-pipeline.js +18 -0
  42. package/dist/lib/platform/verification-required.js +0 -2
  43. package/dist/lib/platform/verification-sync.js +1 -79
  44. package/dist/lib/process-data/normalize.js +1 -185
  45. package/dist/lib/process-data/privacy.js +1 -16
  46. package/dist/lib/process-data/sources.js +2 -279
  47. package/dist/lib/render.js +0 -12
  48. package/dist/lib/run/index.js +15 -10
  49. package/dist/lib/run/skills.js +0 -3
  50. package/dist/lib/sandbox/commands/create.js +40 -53
  51. package/dist/lib/sandbox/commands/list-running.js +0 -18
  52. package/dist/lib/sandbox/commands/start.js +7 -8
  53. package/dist/lib/sandbox/constants.js +0 -6
  54. package/dist/lib/sandbox/control/client.js +0 -1
  55. package/dist/lib/sandbox/control/container-identity.js +1 -16
  56. package/dist/lib/sandbox/control/executor.js +0 -4
  57. package/dist/lib/sandbox/control/identity-sentinel.js +0 -7
  58. package/dist/lib/sandbox/control/lifecycle.js +21 -37
  59. package/dist/lib/sandbox/control/native-file-lock.js +0 -3
  60. package/dist/lib/sandbox/control/server.js +18 -38
  61. package/dist/lib/sandbox/control/state.js +1 -9
  62. package/dist/lib/sandbox/dockerfile.js +0 -6
  63. package/dist/lib/sandbox/engine.js +0 -14
  64. package/dist/lib/sandbox/engines/docker-exact-discovery.js +1 -4
  65. package/dist/lib/sandbox/engines/wsl2-paths.js +0 -3
  66. package/dist/lib/sandbox/recovery.js +24 -26
  67. package/dist/lib/sandbox/removal.js +67 -518
  68. package/dist/lib/sandbox/task-resolver.js +0 -41
  69. package/dist/lib/sandbox/tools.js +1 -4
  70. package/dist/lib/sandbox/workspace-view.js +1 -2
  71. package/dist/lib/server/display.js +0 -6
  72. package/dist/lib/task/activity-intent.js +45 -40
  73. package/dist/lib/task/activity-log.js +9 -16
  74. package/dist/lib/task/artifact-command.js +1 -1
  75. package/dist/lib/task/artifact-lifecycle.js +61 -63
  76. package/dist/lib/task/artifact-name.js +0 -6
  77. package/dist/lib/task/artifact-operations.js +3 -3
  78. package/dist/lib/task/capabilities.js +4 -5
  79. package/dist/lib/task/commands/log.js +0 -6
  80. package/dist/lib/task/commands/status.js +17 -60
  81. package/dist/lib/task/commit-operation.js +28 -39
  82. package/dist/lib/task/completion-facts.js +56 -43
  83. package/dist/lib/task/control-authority.js +23 -256
  84. package/dist/lib/task/control-recovery.js +3 -5
  85. package/dist/lib/task/create.js +2 -4
  86. package/dist/lib/task/decision-intents.js +8 -9
  87. package/dist/lib/task/delivery-target.js +1 -40
  88. package/dist/lib/task/events.js +84 -107
  89. package/dist/lib/task/finalization.js +60 -15
  90. package/dist/lib/task/ledger-intents.js +1 -1
  91. package/dist/lib/task/lifecycle-execution.js +38 -33
  92. package/dist/lib/task/lifecycle.js +49 -41
  93. package/dist/lib/task/local-artifact-finalization.js +1 -4
  94. package/dist/lib/task/manual-validation-evidence.js +1 -37
  95. package/dist/lib/task/platform-operation-recovery.js +151 -108
  96. package/dist/lib/task/pr-delivery-fact.js +2 -5
  97. package/dist/lib/task/qualification-confirmation.js +5 -7
  98. package/dist/lib/task/resolve-ref.js +1 -25
  99. package/dist/lib/task/review-command.js +2 -2
  100. package/dist/lib/task/review-finalization.js +1 -21
  101. package/dist/lib/task/review-fingerprint.js +0 -4
  102. package/dist/lib/task/secure-fs.js +0 -56
  103. package/dist/lib/task/short-id.js +1 -39
  104. package/dist/lib/task/skill-scope.js +0 -1
  105. package/dist/lib/task/verification-engine.js +58 -282
  106. package/dist/lib/task/verification.js +6 -3
  107. package/dist/lib/task/write.js +11 -1
  108. package/lib/agent-clients/adapter.ts +0 -76
  109. package/lib/agent-clients/adapters/antigravity-cli.ts +0 -5
  110. package/lib/agent-clients/adapters/claude-code-credentials.ts +0 -19
  111. package/lib/agent-clients/adapters/claude-code.ts +0 -9
  112. package/lib/agent-clients/adapters/codex.ts +0 -56
  113. package/lib/agent-clients/adapters/opencode.ts +0 -5
  114. package/lib/agent-clients/adapters/traecli.ts +0 -5
  115. package/lib/agent-clients/config.ts +20 -61
  116. package/lib/agent-clients/registry.ts +1 -34
  117. package/lib/agent-clients/schema.ts +0 -18
  118. package/lib/agent-clients/tokens.ts +1 -2
  119. package/lib/agent-clients/types.ts +0 -15
  120. package/lib/decide.ts +1 -0
  121. package/lib/git/worktree-identity.ts +0 -10
  122. package/lib/internal/agent-client.ts +2 -70
  123. package/lib/internal/cli-route-inventory.ts +1 -4
  124. package/lib/internal/manual-validation.ts +28 -27
  125. package/lib/internal/platform-comment.ts +46 -4
  126. package/lib/internal/task-create.ts +0 -1
  127. package/lib/internal/task-event.ts +1 -5
  128. package/lib/internal/task-finalization.ts +0 -1
  129. package/lib/internal/task-lifecycle.ts +3 -5
  130. package/lib/internal/task-operation-registry.ts +3 -19
  131. package/lib/internal/task-review.ts +4 -4
  132. package/lib/platform/comment-safety.ts +0 -10
  133. package/lib/platform/github-provider.ts +0 -2
  134. package/lib/platform/in-label-sync.ts +0 -16
  135. package/lib/platform/issue-comments.ts +478 -301
  136. package/lib/platform/issue-summary-content.ts +132 -0
  137. package/lib/platform/issues.ts +0 -2
  138. package/lib/platform/operation-coordinator.ts +4 -2
  139. package/lib/platform/pr-change-report.ts +165 -25
  140. package/lib/platform/pr-checks.ts +1 -10
  141. package/lib/platform/pr-review.ts +1 -1
  142. package/lib/platform/pr-summary-content.ts +60 -0
  143. package/lib/platform/pr-summary.ts +364 -257
  144. package/lib/platform/provider-bridge.ts +0 -1
  145. package/lib/platform/provider-loader.ts +1 -5
  146. package/lib/platform/provider-validation.ts +1 -49
  147. package/lib/platform/pull-requests.ts +64 -99
  148. package/lib/platform/releases.ts +1 -40
  149. package/lib/platform/summary-content-pipeline.ts +23 -0
  150. package/lib/platform/verification-required.ts +0 -2
  151. package/lib/platform/verification-sync.ts +0 -94
  152. package/lib/process-data/normalize.ts +1 -186
  153. package/lib/process-data/privacy.ts +2 -19
  154. package/lib/process-data/sources.ts +3 -283
  155. package/lib/render.ts +0 -15
  156. package/lib/run/index.ts +13 -7
  157. package/lib/run/skills.ts +0 -4
  158. package/lib/sandbox/commands/create.ts +37 -74
  159. package/lib/sandbox/commands/list-running.ts +0 -19
  160. package/lib/sandbox/commands/start.ts +7 -10
  161. package/lib/sandbox/constants.ts +0 -8
  162. package/lib/sandbox/control/client.ts +0 -1
  163. package/lib/sandbox/control/container-identity.ts +1 -16
  164. package/lib/sandbox/control/executor.ts +1 -5
  165. package/lib/sandbox/control/identity-sentinel.ts +0 -8
  166. package/lib/sandbox/control/lifecycle.ts +18 -51
  167. package/lib/sandbox/control/native-file-lock.ts +0 -8
  168. package/lib/sandbox/control/protocol.ts +0 -2
  169. package/lib/sandbox/control/server.ts +13 -39
  170. package/lib/sandbox/control/state.ts +1 -10
  171. package/lib/sandbox/dockerfile.ts +0 -11
  172. package/lib/sandbox/engine.ts +0 -17
  173. package/lib/sandbox/engines/docker-exact-discovery.ts +1 -5
  174. package/lib/sandbox/engines/wsl2-paths.ts +0 -4
  175. package/lib/sandbox/recovery.ts +24 -26
  176. package/lib/sandbox/removal.ts +58 -687
  177. package/lib/sandbox/shell.ts +1 -1
  178. package/lib/sandbox/task-resolver.ts +0 -48
  179. package/lib/sandbox/tools.ts +1 -5
  180. package/lib/sandbox/workspace-view.ts +2 -4
  181. package/lib/server/display.ts +0 -14
  182. package/lib/server/process-control.ts +1 -1
  183. package/lib/task/activity-intent.ts +36 -44
  184. package/lib/task/activity-log.ts +9 -22
  185. package/lib/task/artifact-command.ts +1 -1
  186. package/lib/task/artifact-lifecycle.ts +58 -67
  187. package/lib/task/artifact-name.ts +0 -7
  188. package/lib/task/artifact-operations.ts +3 -3
  189. package/lib/task/capabilities.ts +5 -6
  190. package/lib/task/commands/log.ts +0 -7
  191. package/lib/task/commands/status.ts +14 -79
  192. package/lib/task/commit-operation.ts +29 -51
  193. package/lib/task/completion-facts.ts +45 -42
  194. package/lib/task/control-authority.ts +27 -317
  195. package/lib/task/control-recovery.ts +2 -5
  196. package/lib/task/create.ts +2 -5
  197. package/lib/task/decision-intents.ts +5 -5
  198. package/lib/task/delivery-target.ts +0 -40
  199. package/lib/task/events.ts +89 -123
  200. package/lib/task/finalization.ts +52 -15
  201. package/lib/task/ledger-intents.ts +1 -1
  202. package/lib/task/lifecycle-execution.ts +37 -89
  203. package/lib/task/lifecycle.ts +48 -44
  204. package/lib/task/local-artifact-finalization.ts +0 -7
  205. package/lib/task/manual-validation-evidence.ts +1 -47
  206. package/lib/task/platform-operation-recovery.ts +117 -104
  207. package/lib/task/pr-delivery-fact.ts +2 -11
  208. package/lib/task/qualification-confirmation.ts +6 -6
  209. package/lib/task/resolve-ref.ts +0 -23
  210. package/lib/task/review-command.ts +2 -2
  211. package/lib/task/review-finalization.ts +1 -27
  212. package/lib/task/review-fingerprint.ts +0 -8
  213. package/lib/task/secure-fs.ts +0 -42
  214. package/lib/task/short-id.ts +0 -43
  215. package/lib/task/skill-scope.ts +0 -1
  216. package/lib/task/verification-engine.ts +56 -287
  217. package/lib/task/verification.ts +5 -5
  218. package/lib/task/write.ts +12 -1
  219. package/package.json +2 -2
  220. package/templates/.agents/README.en.md +1 -3
  221. package/templates/.agents/README.zh-CN.md +0 -2
  222. package/templates/.agents/rules/README.en.md +0 -1
  223. package/templates/.agents/rules/README.zh-CN.md +0 -1
  224. package/templates/.agents/rules/commit-and-pr.en.md +1 -1
  225. package/templates/.agents/rules/commit-and-pr.zh-CN.md +1 -1
  226. package/templates/.agents/rules/no-mid-flow-questions.en.md +0 -10
  227. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +0 -10
  228. package/templates/.agents/rules/pr-sync.en.md +4 -2
  229. package/templates/.agents/rules/pr-sync.zh-CN.md +6 -9
  230. package/templates/.agents/rules/task-management.en.md +3 -3
  231. package/templates/.agents/rules/task-management.zh-CN.md +3 -3
  232. package/templates/.agents/skills/analyze-task/SKILL.en.md +3 -3
  233. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +3 -3
  234. package/templates/.agents/skills/cancel-task/SKILL.en.md +2 -2
  235. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +2 -2
  236. package/templates/.agents/skills/code-task/SKILL.en.md +2 -2
  237. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +4 -4
  238. package/templates/.agents/skills/commit/SKILL.en.md +2 -2
  239. package/templates/.agents/skills/commit/SKILL.zh-CN.md +2 -2
  240. package/templates/.agents/skills/commit/reference/commit-orchestration.en.md +6 -6
  241. package/templates/.agents/skills/commit/reference/commit-orchestration.zh-CN.md +6 -6
  242. package/templates/.agents/skills/commit/reference/pr-summary-sync.en.md +1 -1
  243. package/templates/.agents/skills/commit/reference/pr-summary-sync.zh-CN.md +1 -1
  244. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +2 -2
  245. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +2 -2
  246. package/templates/.agents/skills/complete-task/SKILL.en.md +10 -25
  247. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +11 -26
  248. package/templates/.agents/skills/create-pr/SKILL.en.md +1 -1
  249. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +1 -1
  250. package/templates/.agents/skills/create-pr/reference/change-report.en.md +9 -2
  251. package/templates/.agents/skills/create-pr/reference/change-report.zh-CN.md +9 -2
  252. package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +2 -2
  253. package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +2 -2
  254. package/templates/.agents/skills/create-task/SKILL.en.md +0 -18
  255. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +0 -18
  256. package/templates/.agents/skills/plan-task/SKILL.en.md +2 -2
  257. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +2 -2
  258. package/templates/.agents/skills/review-analysis/SKILL.en.md +3 -3
  259. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +3 -3
  260. package/templates/.agents/skills/review-code/SKILL.en.md +5 -5
  261. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +5 -5
  262. package/templates/.agents/skills/review-plan/SKILL.en.md +3 -3
  263. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +3 -3
  264. package/templates/.agents/skills/review-pr/SKILL.en.md +4 -4
  265. package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +4 -4
  266. package/templates/.agents/skills/run-manual-validation/SKILL.en.md +1 -1
  267. package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +1 -1
  268. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +3 -75
  269. package/templates/.agents/skills/watch-pr/SKILL.en.md +1 -1
  270. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +1 -1
  271. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +3 -3
  272. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +3 -3
  273. package/templates/.agents/templates/task.en.md +1 -0
  274. package/templates/.agents/templates/task.zh-CN.md +1 -0
  275. package/templates/.claude/settings.json +0 -24
  276. package/templates/.codex/hooks.json +0 -50
  277. package/dist/lib/agent-clients/adapters/codex-lifecycle/app-server.js +0 -582
  278. package/dist/lib/agent-clients/adapters/codex-lifecycle/binding.js +0 -114
  279. package/dist/lib/agent-clients/adapters/codex-lifecycle/build-identity.js +0 -237
  280. package/dist/lib/agent-clients/adapters/codex-lifecycle/cli.js +0 -443
  281. package/dist/lib/agent-clients/adapters/codex-lifecycle/evidence.js +0 -236
  282. package/dist/lib/agent-clients/adapters/codex-lifecycle/recovery.js +0 -292
  283. package/dist/lib/agent-clients/adapters/codex-lifecycle/store.js +0 -267
  284. package/dist/lib/agent-clients/adapters/codex-orchestration.js +0 -466
  285. package/dist/lib/internal/task-orchestration.js +0 -71
  286. package/dist/lib/platform/verification.js +0 -6
  287. package/dist/lib/run/prompt.js +0 -2
  288. package/dist/lib/sandbox/engines/authority.js +0 -289
  289. package/dist/lib/task/delegation-receipts.js +0 -410
  290. package/dist/lib/task/orchestration.js +0 -1233
  291. package/dist/lib/task/verification-checks.js +0 -9
  292. package/dist/lib/task/workspace-snapshot.js +0 -121
  293. package/dist/lifecycle-build-manifest.json +0 -6
  294. package/lib/agent-clients/adapters/codex-lifecycle/app-server.ts +0 -688
  295. package/lib/agent-clients/adapters/codex-lifecycle/binding.ts +0 -147
  296. package/lib/agent-clients/adapters/codex-lifecycle/build-identity.ts +0 -349
  297. package/lib/agent-clients/adapters/codex-lifecycle/cli.ts +0 -506
  298. package/lib/agent-clients/adapters/codex-lifecycle/evidence.ts +0 -385
  299. package/lib/agent-clients/adapters/codex-lifecycle/manifest-files.json +0 -41
  300. package/lib/agent-clients/adapters/codex-lifecycle/recovery.ts +0 -418
  301. package/lib/agent-clients/adapters/codex-lifecycle/store.ts +0 -354
  302. package/lib/agent-clients/adapters/codex-orchestration.ts +0 -630
  303. package/lib/internal/task-orchestration.ts +0 -74
  304. package/lib/platform/verification.ts +0 -11
  305. package/lib/run/prompt.ts +0 -1
  306. package/lib/sandbox/engines/authority.ts +0 -365
  307. package/lib/task/delegation-receipts.ts +0 -547
  308. package/lib/task/orchestration.ts +0 -1651
  309. package/lib/task/verification-checks.ts +0 -10
  310. package/lib/task/workspace-snapshot.ts +0 -144
  311. package/templates/.agents/hooks/lifecycle-delegation.js +0 -140
  312. package/templates/.agents/rules/lifecycle-orchestration.en.md +0 -44
  313. package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +0 -44
  314. package/templates/.agents/skills/run-task/SKILL.en.md +0 -29
  315. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +0 -29
  316. package/templates/.agents/skills/run-task/config/verify.en.json +0 -10
  317. package/templates/.agents/skills/run-task/config/verify.zh-CN.json +0 -10
  318. package/templates/.agents/skills/run-task/reference/host-validation.en.md +0 -24
  319. package/templates/.agents/skills/run-task/reference/host-validation.zh-CN.md +0 -24
  320. package/templates/.claude/agents/agent-infra-lifecycle-executor.en.md +0 -6
  321. package/templates/.claude/agents/agent-infra-lifecycle-executor.zh-CN.md +0 -6
  322. package/templates/.claude/agents/agent-infra-lifecycle-reviewer.en.md +0 -6
  323. package/templates/.claude/agents/agent-infra-lifecycle-reviewer.zh-CN.md +0 -6
  324. package/templates/.claude/commands/run-task.en.md +0 -8
  325. package/templates/.claude/commands/run-task.zh-CN.md +0 -8
  326. package/templates/.codex/agents/agent-infra-lifecycle-executor.en.toml +0 -3
  327. package/templates/.codex/agents/agent-infra-lifecycle-executor.zh-CN.toml +0 -3
  328. package/templates/.codex/agents/agent-infra-lifecycle-reviewer.en.toml +0 -3
  329. package/templates/.codex/agents/agent-infra-lifecycle-reviewer.zh-CN.toml +0 -3
  330. package/templates/.opencode/commands/run-task.en.md +0 -11
  331. package/templates/.opencode/commands/run-task.zh-CN.md +0 -11
@@ -3,7 +3,7 @@
3
3
  仅当 `{task-id}` 有效且 `task.md` 存在 `bound/verified` 的 `pr_delivery_fact` 时执行;否则跳过。
4
4
 
5
5
  1. 调用 `agent-infra-internal platform-pr summary-context {task-id}` 获取 canonical 聚合输入和报告状态;sidecar stale/missing 时先按 `change-report` 流程重建当前 head 报告。
6
- 2. 按 `.agents/rules/pr-sync.md` 生成只含一次 `<!-- canonical-pr-change-report -->` 的纯摘要正文并写入临时文件。
6
+ 2. 按 `.agents/rules/pr-sync.md` 生成完整 PR 摘要 JSON payload 并写入临时文件;字段和零值状态由内容合同规定。
7
7
  3. 调用 `agent-infra-internal platform-pr summary-sync {task-id} --agent {standard-agent-token} --body-file {summary-body-file} --change-report-file <task-workspace>/active/{task-id}/pr-change-report.json --result no_op`。commit 路径只同步已有 PR 摘要,不创建或复用 PR,因此固定使用 `no_op` 表示 PR 身份未变化。
8
8
 
9
9
  同步失败只记录 warning,不阻塞或回滚已经完成的 commit。`no-op` 回传 `summary skipped (no diff)`。
@@ -4,7 +4,7 @@ Run only for a valid `{task-id}` whose task.md binds a verified `pr_delivery_fac
4
4
 
5
5
  Follow `.agents/rules/pr-sync.md` for the shared summary structure and failure semantics.
6
6
 
7
- 1. Run `agent-infra-internal platform-pr summary-context {task-id}` to obtain the canonical summary body; the maintainer's PR validation comment and validation summary are the human-validation authority.
7
+ 1. Run `agent-infra-internal platform-pr summary-context {task-id}` to obtain canonical summary facts. `--summary-file` uses the complete PR summary JSON payload; the maintainer's PR validation comment and validation summary are the human-validation authority.
8
8
  2. Before creating the canonical `manual-validation*` artifact, call the transaction coordinator in prepare mode to record `started` before writing the prepared transaction:
9
9
 
10
10
  ```bash
@@ -13,7 +13,7 @@ agent-infra-internal manual-validation transaction {task-id} --prepare \
13
13
  --summary-file {summary-body-file} --agent {standard-agent-token}
14
14
  ```
15
15
 
16
- 3. After prepare succeeds, write the canonical `manual-validation*` artifact, write the pending plain body with exactly one `<!-- canonical-pr-change-report -->` placeholder to a temporary file, and run the transaction coordinator:
16
+ 3. After prepare succeeds, write the canonical `manual-validation*` artifact, set the JSON payload's `manualValidation.state` to `pending` with a non-empty explanation, and run the transaction coordinator:
17
17
 
18
18
  ```bash
19
19
  agent-infra-internal manual-validation transaction {task-id} \
@@ -4,7 +4,7 @@
4
4
 
5
5
  摘要结构与失败语义统一遵循 `.agents/rules/pr-sync.md`。
6
6
 
7
- 1. 调用 `agent-infra-internal platform-pr summary-context {task-id}`,取得 canonical 摘要正文;维护者提供的 PR 人工验证留言和验证说明作为完成人工校验依据。
7
+ 1. 调用 `agent-infra-internal platform-pr summary-context {task-id}`,取得 canonical 摘要事实;`--summary-file` 使用完整 PR 摘要 JSON payload,维护者提供的 PR 人工验证留言和验证说明作为完成人工校验依据。
8
8
  2. 在创建 canonical `manual-validation*` artifact 前,调用 transaction coordinator 的 prepare 模式,先登记 started,再写 prepared transaction:
9
9
 
10
10
  ```bash
@@ -13,7 +13,7 @@ agent-infra-internal manual-validation transaction {task-id} --prepare \
13
13
  --summary-file {summary-body-file} --agent {standard-agent-token}
14
14
  ```
15
15
 
16
- 3. prepare 成功后写入 canonical `manual-validation*` artifact,并把只含一次 `<!-- canonical-pr-change-report -->` 的 pending 正文写入临时文件,调用 transaction coordinator:
16
+ 3. prepare 成功后写入 canonical `manual-validation*` artifact,并将 JSON payload 中 `manualValidation` 设置为 `pending`、提供非空说明后写入临时文件,调用 transaction coordinator:
17
17
 
18
18
  ```bash
19
19
  agent-infra-internal manual-validation transaction {task-id} \
@@ -18,8 +18,7 @@ Host finalization uses receipt v4 with an immutable `receiptId`, monotonic `revi
18
18
 
19
19
  Before generating a completion report or synchronized content, read `.agents/rules/evidence-reporting.md`. Successful checks record the command, scope, status or structured result, actual result, and uncovered parts; failures, blocking conditions, or disputes retain a reproducible entry point, exact location, and decisive excerpt.
20
20
 
21
- - This command updates task metadata AND physically moves the task directory
22
- - Do not move a task that has incomplete workflow steps unless forced
21
+ - Host finalization updates task metadata and atomically moves the task directory
23
22
  - The entry point accepts optional `--external-pr <N>` only to select among ambiguous external-delivery candidates; it never bypasses identity or platform gates
24
23
 
25
24
  Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
@@ -142,7 +141,7 @@ Check whether task.md has a valid `platform_issue_identity`. If it does not, ski
142
141
  When a valid `platform_issue_identity` exists, execute in this exact order:
143
142
 
144
143
  1. Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --requirements --fields`.
145
- 2. Write the business summary to a temporary file and run `agent-infra-internal platform-comment stage-summary {task-id} --body-file {path}`. This stores the body and SHA-256 in the task's durable staging record; it must not publish the summary comment directly.
144
+ 2. Write the completion summary as JSON fields `taskId`, `title`, `summary`, `artifacts`, and `verification:{state,detail}`, then run `agent-infra-internal platform-comment stage-summary {task-id} --body-file {path}`. Use the current artifact registry (`[]` when empty). If final verification has not run, use `state:"not-run"` with a non-empty explanation. The command persists the normalized payload; do not publish the summary comment in this step.
146
145
 
147
146
  The summary body records only delivery results, the associated PR and actual merge facts, verification commands with their scope/results/uncovered areas, and known todo items supported by current task evidence. Include the related commit when it helps explain verification scope. Do not infer unsupported facts; list unfinished work as a todo. This is an Issue closeout summary, not a PR comment.
148
147
 
@@ -225,32 +224,18 @@ ai sandbox rm {task-id} # or use the task's retained short id
225
224
 
226
225
  ## Completion Checklist
227
226
 
228
- - [ ] Verified all workflow steps are complete
229
- - [ ] Updated task.md with completed status and timestamp
230
- - [ ] Moved task directory to `<task-workspace>/completed/`
231
- - [ ] Verified move succeeded
232
- - [ ] Informed user of completion
227
+ - [ ] Hard prerequisites are satisfied and the pre-completion gate passes
228
+ - [ ] Host finalization returns `result=completed` or `result=completed_with_warnings`
229
+ - [ ] Completion verification passes
230
+ - [ ] The structured completion result and applicable warnings are reported to the user
233
231
 
234
232
  ## Notes
235
233
 
236
- 1. **Premature completion**: Do not move a task that has incomplete steps. Examples of incomplete situations:
237
- - Code is written but not committed
238
- - Code is committed but not reviewed
239
- - Review found blockers that haven't been fixed
240
- - PR is created but not merged
241
- - Manual validation items are incomplete
242
-
243
- 2. **Rollback**: If a task was incorrectly moved:
244
- ```bash
245
- mv <task-workspace>/completed/{task-id} <task-workspace>/active/{task-id}
246
- ```
247
- Then update task.md status back to `active`.
248
-
249
- 3. **Multiple contributors**: If multiple AI agents worked on the task, ensure all contributions are committed before completing.
234
+ - When multiple AI agents contributed, ensure all contributions are included in the local checkpoint.
250
235
 
251
236
  ## Error Handling
252
237
 
253
238
  - Task not found: Prompt "Task {task-id} not found in active directory"
254
- - Already completed: Prompt "Task {task-id} is already in completed directory"
255
- - Task is blocked: Prompt "Task {task-id} is blocked. Unblock it first by moving to active/"
256
- - Move failed: Prompt error and suggest manual move
239
+ - Already completed: Enter `finalization-retry` only when a matching Complete Task Activity Log exists; otherwise report incomplete terminal identity and stop
240
+ - Task is blocked: Satisfy the recorded unblock condition, then reactivate it through `task-lifecycle activate` before retrying
241
+ - Finalization failed or blocked: Preserve source data and the receipt, then recover through the same finalization entry point using its structured error; do not manually rewrite terminal state or move the task directory
@@ -18,8 +18,7 @@ description: >
18
18
 
19
19
  生成收尾报告或同步内容时,先读取 `.agents/rules/evidence-reporting.md`。成功检查记录命令、范围、状态/结构化结果、实际结果和未覆盖部分;失败、阻塞或争议保留复现入口、准确位置和决定性摘录。
20
20
 
21
- - 本命令更新任务元数据并物理移动任务目录
22
- - 除非强制执行,不要转移有未完成工作流步骤的任务
21
+ - 本命令由宿主更新任务元数据并原子移动任务目录
23
22
  - 入口接受可选 `--external-pr <N>`;仅用于外部交付候选歧义时的显式选择,不绕过身份或平台门禁
24
23
 
25
24
  版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
@@ -141,9 +140,9 @@ Please satisfy the hard prerequisite first, then retry complete-task.
141
140
  如果存在有效的 `platform_issue_identity`,严格按以下顺序执行:
142
141
 
143
142
  1. 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --requirements --fields`。
144
- 2. 把业务摘要写入临时文件,并调用 `agent-infra-internal platform-comment stage-summary {task-id} --body-file {path}`。该命令把正文和 SHA-256 写入 task 目录的 durable staging record;本步骤不得直接发布 summary 评论。
143
+ 2. 把完成摘要字段写成 JSON 临时文件,并调用 `agent-infra-internal platform-comment stage-summary {task-id} --body-file {path}`。字段为 `taskId`、`title`、`summary`、`artifacts`、`verification:{state,detail}`;`taskId` 必须是当前完整任务 ID,`title` 来自 task.md,`artifacts` 来自当前 artifact registry(无产物用 `[]`)。验证尚未执行时写 `state:"not-run"` 和非空说明,不等待之后的终态事件或最终验证。命令把规范 payload 与摘要写入 durable staging record;本步骤不得直接发布 summary 评论。
145
144
 
146
- 摘要正文只记录当前任务证据能够支持的交付结果、关联 PR 与实际合入事实、验证命令及其范围/结果/未覆盖部分,以及已知待办;需要说明验证范围时可注明对应提交。没有证据支持的事实不推断,未完成事项写入待办。这是 Issue 收尾摘要,不是 PR 留言。
145
+ `summary` 字段只记录当前任务证据能够支持的交付结果、关联 PR 与实际合入事实、验证命令及其范围/结果/未覆盖部分,以及已知待办;需要说明验证范围时可注明对应提交。没有证据支持的事实不推断,未完成事项写入待办。这是 Issue 收尾摘要,不是 PR 留言。
147
146
 
148
147
  摘要默认使用当前技能的语言:中文技能生成中文摘要,英文技能生成英文摘要。中英文摘要保持相同字段结构。
149
148
 
@@ -224,32 +223,18 @@ ai sandbox rm {task-id} # 或使用本任务仍保留的短号
224
223
 
225
224
  ## 完成检查清单
226
225
 
227
- - [ ] 验证了所有工作流步骤已完成
228
- - [ ] 更新了 task.md 的完成状态和时间戳
229
- - [ ] 将任务目录移动到 `<task-workspace>/completed/`
230
- - [ ] 验证了转移成功
231
- - [ ] 告知了用户完成情况
226
+ - [ ] 满足了硬性前置条件并通过预完成门禁
227
+ - [ ] 宿主 finalization 返回 `result=completed` 或 `result=completed_with_warnings`
228
+ - [ ] 完成校验通过
229
+ - [ ] 已向用户报告结构化完成结果和适用的警告
232
230
 
233
231
  ## 注意事项
234
232
 
235
- 1. **过早完成**:不要转移有未完成步骤的任务。未完成的情况示例:
236
- - 代码已编写但未提交
237
- - 代码已提交但未审查
238
- - 审查发现阻塞项但未修复
239
- - PR 已创建但未合并
240
- - 人工校验项未完成
241
-
242
- 2. **回滚**:如果任务被错误转移:
243
- ```bash
244
- mv <task-workspace>/completed/{task-id} <task-workspace>/active/{task-id}
245
- ```
246
- 然后将 task.md 中的状态改回 `active`。
247
-
248
- 3. **多贡献者**:如果多个 AI 代理参与了任务,确保所有贡献都已提交后再完成。
233
+ - 如果多个 AI 代理参与任务,确保所有贡献都包含在本地 checkpoint 中。
249
234
 
250
235
  ## 错误处理
251
236
 
252
237
  - 任务未找到:提示 "Task {task-id} not found in active directory"
253
- - 已完成:提示 "Task {task-id} is already in completed directory"
254
- - 任务被阻塞:提示 "Task {task-id} is blocked. Unblock it first by moving to active/"
255
- - 移动失败:提示错误并建议手动移动
238
+ - 已完成:仅当存在匹配的 Complete Task Activity Log 时进入 `finalization-retry`;否则说明终态身份不完整并停止
239
+ - 任务被阻塞:满足记录的解除条件后,通过 `task-lifecycle activate` 恢复任务,再重试
240
+ - finalization 失败或阻塞:保留源数据和 receipt,根据结构化错误通过同一 finalization 入口恢复;不要手工改写终态或移动任务目录
@@ -86,7 +86,7 @@ The core renderer owns the report section. It is part of the reviewer summary be
86
86
 
87
87
  Read the latest context artifacts when they exist: `plan.md` / `plan-r{N}.md`, `review-plan.md` / `review-plan-r{N}.md`, `code.md` / `code-r{N}.md`, and `review-code.md` / `review-code-r{N}.md`.
88
88
 
89
- Aggregate a reviewer-facing summary from those artifacts with exactly one `<!-- canonical-pr-change-report -->` placeholder, and maintain a single idempotent summary comment via the hidden marker. Pass `--change-report-file <task-workspace>/active/{task-id}/pr-change-report.json` and the same `--result {primary-result}` to `summary-sync`; a sync substep must not infer whether the PR was created or reused.
89
+ Assemble a structured reviewer summary JSON from those artifacts with overview, tests, review, manual validation, open decisions, and risks. Report valid not-started states honestly; do not include later validation or event results in advance. Maintain one idempotent summary comment via the hidden marker; the core renderer generates the fixed summary sections and change report. Pass the summary JSON, `--change-report-file <task-workspace>/active/{task-id}/pr-change-report.json`, and the same `--result {primary-result}` to `summary-sync`; a sync substep must not infer whether the PR was created or reused.
90
90
 
91
91
  > Canonical context, aggregation, and the `summary-sync` call live in `reference/comment-publish.md`, which points to `.agents/rules/pr-sync.md`. Read that reference before publishing.
92
92
 
@@ -86,7 +86,7 @@ description: >
86
86
 
87
87
  读取最新的上下文产物:`plan.md` / `plan-r{N}.md`、`review-plan.md` / `review-plan-r{N}.md`、`code.md` / `code-r{N}.md`、`review-code.md` / `review-code-r{N}.md`(存在时)。
88
88
 
89
- 基于这些产物聚合 reviewer 摘要,正文只放一次 `<!-- canonical-pr-change-report -->` 占位符,再使用隐藏标记维护唯一且幂等的摘要评论。调用 `summary-sync` 时传入 `--change-report-file <task-workspace>/active/{task-id}/pr-change-report.json`,并继续传递同一个 `--result {primary-result}`;不得根据同步子步骤猜测 PR 是创建还是复用。
89
+ 基于这些产物组装结构化 reviewer 摘要 JSON,包含概览、测试、Review、人工校验、待决事项和风险;将合法未启动状态如实传入,不提前写入后续验证或事件结果。使用隐藏标记维护唯一且幂等的摘要评论;核心 renderer 负责生成固定摘要段落和 change report。调用 `summary-sync` 时传入摘要 JSON 与 `--change-report-file <task-workspace>/active/{task-id}/pr-change-report.json`,并继续传递同一个 `--result {primary-result}`;不得根据同步子步骤猜测 PR 是创建还是复用。
90
90
 
91
91
  > canonical context、摘要聚合和 `summary-sync` 调用见 `reference/comment-publish.md`(其引用 `.agents/rules/pr-sync.md`)。发布摘要前先读取该 reference。
92
92
 
@@ -24,9 +24,16 @@ agent-infra-internal platform-pr change-report {task-id} \
24
24
 
25
25
  The core validates the task-intent digest, PR identity, complete patch SHA, totals, and the ordered checks `target-alignment`, `change-composition`, `compatibility-policy`, `legacy-path-cleanup`, `redundancy`, and `scope-discipline`. A `needs-review` check routes to `review-code`; `formalReview` remains `false`.
26
26
 
27
- When generating the candidate, use the six existing `rationale` fields and `Evidence[]` as readable analysis for each logical change group; do not add group fields. For each group, explain its goal and acceptance-criteria alignment, added and removed behavior, necessity, redundancy or duplicate implementation, scope, related tests, and whether the tests are sufficient. Cite paths, line ranges, and concise evidence for the conclusions. Each check must still state its actual finding: `target-alignment` explains the goal relationship, `change-composition` summarizes responsibilities and behavior changes, `compatibility-policy` states the compatibility result, `legacy-path-cleanup` states how legacy paths were handled, `redundancy` states the redundancy result, and `scope-discipline` states the scope judgment. Do not reuse generic boilerplate; mark unsupported conclusions as unconfirmed. Use the deployed skill's language. Chinese skill deployments must use Chinese. The canonical renderer displays every item in each `Evidence[]`.
27
+ Before generating the candidate, list functional change groups from the task goal and complete diff; file responsibilities or category totals are not functional groups. Represent each group as a typed object in the existing `change-composition.groups[]` with `id`, `target`, `behaviorChange`, `necessity`, `files[]`, and `tests:{coverage,cost}`. `rationale` and `Evidence[]` may support the judgment and locations but cannot replace group objects.
28
28
 
29
- Explain applicable production-code, test, and documentation changes for each group. Keep source line changes, execution/call-count changes, and workflow unification distinct. Diff line counts support text changes only; they do not prove fewer executions or a unified workflow. Execution behavior and test adequacy need their own direct evidence. State gaps where evidence is missing. Green CI does not prove necessity or absence of redundancy.
29
+ - `files[]` must reference canonical paths (`oldPath ?? newPath`) from the complete formal diff. A rename remains one mechanical file record with both old and new paths. Assign every formal diff file to exactly one group; do not omit, duplicate, or invent paths.
30
+ - Do not enter group line counts in the candidate. Core derives each group's additions, deletions, and net from the bound formal diff's per-file counts and reconciles group totals with the complete diff. A `null` count stays uncountable; the file still belongs to one group and must not be represented as zero.
31
+ - `Evidence[].detail` may cite relevant code, test, or documentation changes. Use `tests.coverage` and `tests.cost` for existing/new test coverage and fixture/test cost. If no test changed, state why existing coverage is sufficient.
32
+ - List and reconcile complete-PR changes separately from the current head-to-head increment. Do not infer increment values when the previous head is unconfirmed.
33
+
34
+ `target-alignment` passes only when every group maps to a task goal or acceptance criterion. Typed structure, file membership, and derived counts are structural checks; the existing semantic review still decides whether groups, behavior added/removed, necessity, test coverage/cost, and evidence are adequately explained. Missing, contradictory, or unverifiable structure or explanation remains `needs-review`; state the gap so the core routes to `review-code`. Complete structure or green CI does not establish sufficient explanation.
35
+
36
+ State the actual finding for each of the other four checks. Use the deployed skill's language for evidence; Chinese deployments must use Chinese. The canonical renderer displays every rationale and evidence item. Source line counts describe text additions/deletions only; they do not prove execution counts or workflow unification.
30
37
 
31
38
  ## Complete PR and Per-Round Increment
32
39
 
@@ -24,9 +24,16 @@ agent-infra-internal platform-pr change-report {task-id} \
24
24
 
25
25
  core 校验任务意图 digest、PR identity、完整 patch SHA、统计合计和固定顺序的 `target-alignment`、`change-composition`、`compatibility-policy`、`legacy-path-cleanup`、`redundancy`、`scope-discipline`。任一项为 `needs-review` 时路由到 `review-code`,`formalReview` 仍为 `false`。
26
26
 
27
- 生成 candidate 时,按逻辑变化组用六项 `rationale` 和 `Evidence[]` 给出可读分析,不新增组级字段。每组说明其目标/验收对应、行为增加与减少、必要性、冗余或重复实现、范围、对应测试及测试是否充分;列出支撑结论的路径、行号和简短证据。六项检查各自仍须写实际结论:`target-alignment` 说明目标对应关系,`change-composition` 概括职责和行为变化,`compatibility-policy` 说明兼容策略,`legacy-path-cleanup` 说明旧路径处理,`redundancy` 说明重复/冗余结果,`scope-discipline` 说明范围判断。不得复用泛化套话;证据不足的维度明确标记未确认,不推断结论。证据详情遵循当前已部署技能的语言,中文技能必须使用中文。canonical renderer 会完整展示每项 `Evidence[]`。
27
+ 生成 candidate 前,先根据任务目标和完整 diff 列出功能变化组;不得把文件职责概述或类别总数当作功能组。每个功能组作为现有 `change-composition` 检查中的 typed `groups[]` 对象,包含 `id`、`target`、`behaviorChange`、`necessity`、`files[]` 和 `tests:{coverage,cost}`。`rationale`/`Evidence[]` 仅补充判断和定位,不能替代组对象。
28
28
 
29
- 每组解释覆盖生产代码、测试和文档中适用的变化,并区分源码行数变化、执行/调用次数变化和流程统一。diff 行数仅支持代码文本增减;不能据此推断执行次数减少或流程统一。执行次数、流程行为和测试充分性须有各自直接证据;没有证据时明确说明缺口。CI 全绿不能代替必要性或冗余判断。
29
+ - `files[]` 只能引用完整正式 diff 中的 canonical 文件路径(机械报告的 `oldPath ?? newPath`);rename 仍作为一条机械记录保留 old/new 两端。正式 diff 中每个文件必须恰好归入一个组,不得遗漏、重复或引用 diff 外文件。
30
+ - 不要在 candidate 中填写组级行数。core 从绑定的正式 diff 逐文件 additions/deletions 聚合各组的新增、删除和净增,并将各组加总与正式 diff totals 对账。`null` 行数保持不可计数,文件仍需归组且不能改写为零。
31
+ - 每条 `Evidence[].detail` 可引用具体代码、测试或文档变更;`tests.coverage` 与 `tests.cost` 分别说明覆盖风险/已有覆盖依据,以及本次新增 fixture / 测试的成本。没有测试变更时说明现有覆盖依据。
32
+ - 完整 PR 与本轮 head-to-head 增量分别列示和对账;上一 head 未确认时不得推算增量数值。
33
+
34
+ `target-alignment` 只有在每个功能组都能对应任务目标或验收标准时才能判为 `pass`。`change-composition` 的 typed 结构、文件集合和机械计数通过结构校验后,仍须按现有语义判断组别、行为增减、必要性、测试覆盖/成本和证据是否充分;结构或解释缺项、矛盾、无法核实时保持 `needs-review` 并说明缺口,使 core 路由到 `review-code`。不得因结构完整或 CI 通过而自动判定内容充分。
35
+
36
+ 其他四项检查仍分别给出实际结论;证据详情遵循当前已部署技能的语言,中文技能必须使用中文。canonical renderer 会展示全部 rationale 和 evidence。源码行数只说明文本增删;不能据此推断执行次数或流程统一。
30
37
 
31
38
  ## 完整 PR 与本轮增量
32
39
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  After PR creation, run `agent-infra-internal platform-pr summary-context {task-id}` and aggregate the reviewer summary only from its canonical artifacts according to `.agents/rules/pr-sync.md`.
4
4
 
5
- Write the plain summary body, containing exactly one `<!-- canonical-pr-change-report -->` placeholder and no report heading/JSON, marker, or HEAD metadata, to a temporary file, then run:
5
+ Write the PR summary JSON fields from `.agents/rules/pr-sync.md` to a temporary file, then run. The core renderer adds the feature change section from the canonical report:
6
6
 
7
7
  ```bash
8
8
  agent-infra-internal platform-pr summary-sync {task-id} \
@@ -11,4 +11,4 @@ agent-infra-internal platform-pr summary-sync {task-id} \
11
11
  --result {primary-result}
12
12
  ```
13
13
 
14
- The caller does not add markers, HEAD metadata, report sections, or comment API parameters. The typed core rechecks the task-bound sidecar against the authoritative PR snapshot and renders the report. `--result` is required and must be passed unchanged from `platform-pr create`; `no_op` maps to `no_op_with_warnings` if summary synchronization degrades. Missing/stale/invalid sidecars or body bypasses do not publish, and summary failures do not roll back a created or reused PR.
14
+ The caller does not add markers, HEAD metadata, report sections, or comment API parameters. The typed core validates fields, renders fixed sections, rechecks the task-bound sidecar against the authoritative PR snapshot, then reads back and compares the remote body. `--result` is required and passed unchanged from `platform-pr create`; incomplete structure does not publish, and summary failures do not roll back a created or reused PR.
@@ -2,7 +2,7 @@
2
2
 
3
3
  创建 PR 后先调用 `agent-infra-internal platform-pr summary-context {task-id}`,只根据返回的 canonical 产物按 `.agents/rules/pr-sync.md` 聚合 reviewer 摘要。
4
4
 
5
- 把恰好包含一次 `<!-- canonical-pr-change-report -->` 且不含报告标题/JSON、marker 或 HEAD 元数据的纯摘要正文写入临时文件,再调用:
5
+ 按 `.agents/rules/pr-sync.md` 填写 PR 摘要 JSON 字段(overview、tests、review、manualValidation、humanDecisions、risks),写入临时文件,再调用。功能增减章节由 core renderer 从 canonical report 生成:
6
6
 
7
7
  ```bash
8
8
  agent-infra-internal platform-pr summary-sync {task-id} \
@@ -11,4 +11,4 @@ agent-infra-internal platform-pr summary-sync {task-id} \
11
11
  --result {primary-result}
12
12
  ```
13
13
 
14
- 调用方不添加 marker、HEAD、报告段或评论 API 参数。typed core 会重新校验任务绑定 sidecar 与权威 PR snapshot 并渲染报告。`--result` 是必填的,必须把 `platform-pr create` 的 `result` 原样传入;sidecar 缺失/过期/非法或正文旁路时不发布,摘要失败沿用该 primary result 映射 warning(`no_op` 对应 `no_op_with_warnings`),不回滚已创建或复用的 PR。结果映射沿用 `.agents/rules/pr-sync.md`。
14
+ 调用方不添加 marker、HEAD、报告段或评论 API 参数。typed core 会校验字段结构、渲染固定章节、重新校验任务绑定 sidecar 与权威 PR snapshot,并在发布后回读比较远端正文。`--result` 是必填的,必须把 `platform-pr create` 的 `result` 原样传入;sidecar 缺失/过期/非法或结构不完整时不发布,摘要失败沿用该 primary result 映射 warning(`no_op` 对应 `no_op_with_warnings`),不回滚已创建或复用的 PR。结果映射沿用 `.agents/rules/pr-sync.md`。
@@ -93,24 +93,6 @@ agent-infra-internal task-create --input "$candidate_file"
93
93
 
94
94
  The host owns TASK-id/timestamps/version, workflow and branch derivation, template rendering, atomic persistence, short ids, Issue sync, and warnings. The skill must not create task directories, copy templates, allocate short ids, or call platform subcommands directly.
95
95
 
96
- Task metadata (`task.md` YAML front matter):
97
- ```yaml
98
- id: TASK-{yyyyMMdd-HHmmss}
99
- type: feature|bugfix|refactor|docs|chore
100
- branch: <project>-<type>-<slug>
101
- workflow: feature-development|bug-fix|refactoring
102
- status: active
103
- created_at: {YYYY-MM-DD HH:mm:ss±HH:MM}
104
- updated_at: {YYYY-MM-DD HH:mm:ss±HH:MM}
105
- agent_infra_version: {agent_infra_version}
106
- priority: # required; inferred by the AI from the title/description; Urgent | High | Medium | Low
107
- effort: # required; inferred by the AI from the title/description; High | Medium | Low
108
- start_date: # optional; YYYY-MM-DD
109
- target_date: # optional; YYYY-MM-DD
110
- current_step: requirement-analysis
111
- assigned_to: {current AI agent}
112
- ```
113
-
114
96
  priority / effort are required: the AI infers them from the task title and description (candidates in `.agents/rules/issue-fields.md`; normalize localized input). Leave start_date / target_date empty at creation: `start_date` is written by the analyze stage and `target_date` by the complete stage; do not invent dates.
115
97
 
116
98
  ### 3. Handle the Structured Result
@@ -92,24 +92,6 @@ agent-infra-internal task-create --input "$candidate_file"
92
92
 
93
93
  宿主负责 TASK-id/时间戳/版本戳、workflow/branch 派生、模板渲染、原子持久化、短号、Issue 与 warning。技能不得自行 `mkdir`、复制任务模板、分配短号或直接调用平台子命令。
94
94
 
95
- 任务元数据(task.md YAML front matter):
96
- ```yaml
97
- id: TASK-{yyyyMMdd-HHmmss}
98
- type: feature|bugfix|refactor|docs|chore
99
- branch: <project>-<type>-<slug>
100
- workflow: feature-development|bug-fix|refactoring
101
- status: active
102
- created_at: {YYYY-MM-DD HH:mm:ss±HH:MM}
103
- updated_at: {YYYY-MM-DD HH:mm:ss±HH:MM}
104
- agent_infra_version: {agent_infra_version}
105
- priority: # 必填;由 AI 从标题/描述推断;Urgent | High | Medium | Low
106
- effort: # 必填;由 AI 从标题/描述推断;High | Medium | Low
107
- start_date: # 可选;YYYY-MM-DD
108
- target_date: # 可选;YYYY-MM-DD
109
- current_step: requirement-analysis
110
- assigned_to: {当前 AI 代理}
111
- ```
112
-
113
95
  priority / effort 必填:由 AI 从任务标题与描述推断后填入(候选值见 `.agents/rules/issue-fields.md`;中文输入按本地化映射规范化)。start_date / target_date 创建时保持留空:`start_date` 由 analyze 阶段写入、`target_date` 由 complete 阶段写入;不要臆测日期。
114
96
 
115
97
  ### 3. 处理结构化结果
@@ -9,7 +9,7 @@ description: >
9
9
  # Design Technical Plan
10
10
  > `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
11
11
 
12
- If the entry operands contain `--orchestrated`, bind `{execution-flag}` to `--orchestrated` and forward it unchanged to the completed event; otherwise bind it to an empty value. Never infer it from `orchestration.json`, environment variables, or prior artifacts. Lifecycle events also require explicit trigger data: use `{trigger-initiator}=orchestrator` for orchestration and `model` otherwise; `{request-id}` is a stable single-line identifier for this task and artifact round, and `{reason-code}` is `user-request`, `new-requirement`, or `upstream-fact-doubt`. Reuse the same values for started and completed.
12
+ Lifecycle events require explicit trigger data: ordinary skill invocation uses `model`; use `human` only when the user explicitly requests it. `{request-id}` is a stable single-line identifier for this task and artifact round, and `{reason-code}` use `user-request`, `new-requirement`, or `upstream-fact-doubt`. Reuse the same values for started and completed.
13
13
 
14
14
  ## Boundary / Critical Rules
15
15
 
@@ -145,7 +145,7 @@ agent-infra-internal task-artifact {task-id} finalize-local --family plan --arti
145
145
  - On `status=failed`, correct the formal artifact directly and rerun the finalizer completely; if the current diagnostic remains unresolved, continue to the next attempt.
146
146
  - On an external formal-artifact change, an unsafe repair, repeated diagnostics or fingerprints, no progress, or the shared edit limit, stop without publishing a completed event.
147
147
 
148
- Use the digests from that same `status=passed` result in `agent-infra-internal task-event {task-id} plan.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {plan-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} {execution-flag}` so the core records the link, stage, agent, metadata, and Activity Log atomically.
148
+ Use the digests from that same `status=passed` result in `agent-infra-internal task-event {task-id} plan.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {plan-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest}` so the core records the link, stage, agent, metadata, and Activity Log atomically.
149
149
  - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Plan Task (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
150
150
  ```
151
151
 
@@ -9,7 +9,7 @@ description: >
9
9
  # 设计技术方案
10
10
  > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
11
11
 
12
- 若入口业务操作数包含 `--orchestrated`,绑定 `{execution-flag}` = `--orchestrated` 并原样转发给 completed 事件;否则绑定为空。不得从 `orchestration.json`、环境变量或历史产物推断该标记。生命周期事件还必须携带显式触发信息:编排调用使用 `{trigger-initiator}=orchestrator`,否则使用 `model`;`{request-id}` 是本任务与本轮产物的稳定单行标识,`{reason-code}` 使用 `user-request`、`new-requirement` 或 `upstream-fact-doubt`;started 与 completed 使用同一组值。
12
+ 生命周期事件必须携带显式触发信息:普通技能调用使用 `model`;仅用户明确要求时使用 `human`。`{request-id}` 是本任务与本轮产物的稳定单行标识,`{reason-code}` 使用 `user-request`、`new-requirement` 或 `upstream-fact-doubt`;started 与 completed 使用同一组值。
13
13
 
14
14
  ## 行为边界 / 关键规则
15
15
 
@@ -143,7 +143,7 @@ agent-infra-internal task-artifact {task-id} init --family plan --artifact {plan
143
143
  - `status=passed`:保存本次返回的 `artifactSha256` 和 `semanticDigest`;finalizer 已记录对应的一次性本地 provenance intent。
144
144
  - `status=failed`:直接修正正式产物并完整重跑 finalizer;若仍失败且诊断未解决,继续下一轮。
145
145
  - 当前正式产物发生外部变化、无法安全修复、诊断或指纹重复、无进展,或达到共享规则的编辑上限时停止,不发布 completed 事件。
146
- - 使用同一次 `status=passed` 返回的摘要执行 `agent-infra-internal task-event {task-id} plan.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {plan-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} {execution-flag}`,由核心登记链接、阶段、代理、时间、版本和 Activity Log。
146
+ - 使用同一次 `status=passed` 返回的摘要执行 `agent-infra-internal task-event {task-id} plan.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {plan-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest}`,由核心登记链接、阶段、代理、时间、版本和 Activity Log。
147
147
 
148
148
  如果 task.md 中存在有效的 `platform_issue_identity`,执行以下同步操作(任一失败则跳过并继续):
149
149
  - 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status pending-design-work --fields`
@@ -9,7 +9,7 @@ description: >
9
9
  # Requirement Analysis Review
10
10
  > `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
11
11
 
12
- If the entry operands contain `--orchestrated`, bind `{execution-flag}` to `--orchestrated` and forward it unchanged to both the summary finalizer and completed event; otherwise bind it to an empty value. Never infer it from `orchestration.json`, environment variables, or prior artifacts. Lifecycle events also require explicit trigger data: use `{trigger-initiator}=orchestrator` for orchestration and `model` otherwise; `{request-id}` is a stable single-line identifier for this task and artifact round, and `{reason-code}` is `user-request` or `review-finding`. Reuse the same values for started and completed.
12
+ Lifecycle events require explicit trigger data: ordinary skill invocation uses `model`; use `human` only when the user explicitly requests it. `{request-id}` is a stable single-line identifier for this task and artifact round, and `{reason-code}` use `user-request` or `review-finding`. Reuse the same values for started and completed.
13
13
 
14
14
  Review the latest analysis artifact and produce `review-analysis.md` or `review-analysis-r{N}.md`.
15
15
 
@@ -87,7 +87,7 @@ Create `<task-workspace>/active/{task-id}/{review-artifact}`.
87
87
 
88
88
  ### 6. Update Task Status
89
89
 
90
- After the report, call `agent-infra-internal task-review {task-id} preflight --stage analysis --artifact {review-artifact} {execution-flag}` before any ledger write. On failure, correct the formal artifact directly and rerun it. Only after preflight passes, submit each new finding with `agent-infra-internal task-ledger {task-id} finding-upsert --stage analysis --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}` or 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 analysis --artifact {review-artifact} {execution-flag}`; never treat an error type or `changed=false` as automatic authorization.
90
+ After the report, call `agent-infra-internal task-review {task-id} preflight --stage analysis --artifact {review-artifact}` before any ledger write. On failure, correct the formal artifact directly and rerun it. Only after preflight passes, submit each new finding with `agent-infra-internal task-ledger {task-id} finding-upsert --stage analysis --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}` or 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 analysis --artifact {review-artifact}`; never treat an error type or `changed=false` as automatic authorization.
91
91
 
92
92
  Bind and reuse this structured mapping from that one response:
93
93
 
@@ -97,7 +97,7 @@ Bind and reuse this structured mapping from that one response:
97
97
  {unresolved-minor} = stageStatus.unresolvedFindingCounts.minor
98
98
  ```
99
99
 
100
- 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. After a failure, the model may edit the same controlled artifact and rerun the same intent only when the shared rule's mechanical gates pass; reassess convergence after every failure. The final complete result determines the verdict and counts from that same snapshot: `stageStatus.canAdvance=true` with an Approved conclusion permits cross-stage advancement; `stageStatus.canAdvance=false` still requires `agent-infra-internal task-event {task-id} review-analysis.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n} {execution-flag}`, using `changes-requested` and routing to same-stage revision/review (use `rejected` when the report explicitly rejects). On failure, model stop, lack of progress, or the emergency cap, do not publish a completion event or cross-stage command; use the `repair-stop` scenario in `reference/output-templates.md` to show existing summary/findings, the artifact, actual repair attempts, the last diagnostic, and the stop reason.
100
+ 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. After a failure, the model may edit the same controlled artifact and rerun the same intent only when the shared rule's mechanical gates pass; reassess convergence after every failure. The final complete result determines the verdict and counts from that same snapshot: `stageStatus.canAdvance=true` with an Approved conclusion permits cross-stage advancement; `stageStatus.canAdvance=false` still requires `agent-infra-internal task-event {task-id} review-analysis.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}`, using `changes-requested` and routing to same-stage revision/review (use `rejected` when the report explicitly rejects). On failure, model stop, lack of progress, or the emergency cap, do not publish a completion event or cross-stage command; use the `repair-stop` scenario in `reference/output-templates.md` to show existing summary/findings, the artifact, actual repair attempts, the last diagnostic, and the stop reason.
101
101
 
102
102
  `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.
103
103
 
@@ -9,7 +9,7 @@ description: >
9
9
  # 需求分析审查
10
10
  > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
11
11
 
12
- 若入口业务操作数包含 `--orchestrated`,绑定 `{execution-flag}` = `--orchestrated` 并原样转发给 summary finalizer 与 completed 事件;否则绑定为空。不得从 `orchestration.json`、环境变量或历史产物推断该标记。生命周期事件还必须携带显式触发信息:编排调用使用 `{trigger-initiator}=orchestrator`,否则使用 `model`;`{request-id}` 是本任务与本轮产物的稳定单行标识,`{reason-code}` 使用 `user-request` 或 `review-finding`;started 与 completed 使用同一组值。
12
+ 生命周期事件必须携带显式触发信息:普通技能调用使用 `model`;仅用户明确要求时使用 `human`。`{request-id}` 是本任务与本轮产物的稳定单行标识,`{reason-code}` 使用 `user-request` 或 `review-finding`;started 与 completed 使用同一组值。
13
13
 
14
14
  审查最新需求分析产物,并产出 `review-analysis.md` 或 `review-analysis-r{N}.md`。
15
15
 
@@ -90,7 +90,7 @@ agent-infra-internal task-artifact {task-id} init --family review-analysis --art
90
90
 
91
91
  ### 6. 更新任务状态
92
92
 
93
- 报告完成后,先调用 `agent-infra-internal task-review {task-id} preflight --stage analysis --artifact {review-artifact} {execution-flag}`,不得先写入账本。失败后直接修正正式产物并重跑;只有 preflight 通过后,才逐条调用 `agent-infra-internal task-ledger {task-id} finding-upsert --stage analysis --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 analysis --artifact {review-artifact} {execution-flag}`;不能把失败类型或 `changed=false` 当作自动授权。
93
+ 报告完成后,先调用 `agent-infra-internal task-review {task-id} preflight --stage analysis --artifact {review-artifact}`,不得先写入账本。失败后直接修正正式产物并重跑;只有 preflight 通过后,才逐条调用 `agent-infra-internal task-ledger {task-id} finding-upsert --stage analysis --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 analysis --artifact {review-artifact}`;不能把失败类型或 `changed=false` 当作自动授权。
94
94
 
95
95
  从该次返回值绑定并复用以下结构化映射:
96
96
 
@@ -100,7 +100,7 @@ agent-infra-internal task-artifact {task-id} init --family review-analysis --art
100
100
  {unresolved-minor} = stageStatus.unresolvedFindingCounts.minor
101
101
  ```
102
102
 
103
- 该 intent 原子最终化报告摘要并返回同一次账本快照;不得再调用 `stage-status`、手工替换占位符或扫描问题清单。失败后,模型只能在共享规则的机械安全门通过时修改同一个受控 artifact,并完整重跑相同 intent;每次失败都重新判断是否收敛。最终一次完整成功返回决定同一快照的 verdict 和计数:`stageStatus.canAdvance=true` 且结论为 Approved 时允许跨阶段推进;`stageStatus.canAdvance=false` 时仍须执行 `agent-infra-internal task-event {task-id} review-analysis.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n} {execution-flag}`,使用 `changes-requested` 并路由到同阶段修订/复审(报告明确拒绝时使用 `rejected`)。失败、模型停止、无进展或紧急熔断时,不发布完成事件或跨阶段命令,但必须按 `reference/output-templates.md` 的 `repair-stop` 场景展示已有 summary/findings、artifact、实际修复次数、最后诊断和停止原因。
103
+ 该 intent 原子最终化报告摘要并返回同一次账本快照;不得再调用 `stage-status`、手工替换占位符或扫描问题清单。失败后,模型只能在共享规则的机械安全门通过时修改同一个受控 artifact,并完整重跑相同 intent;每次失败都重新判断是否收敛。最终一次完整成功返回决定同一快照的 verdict 和计数:`stageStatus.canAdvance=true` 且结论为 Approved 时允许跨阶段推进;`stageStatus.canAdvance=false` 时仍须执行 `agent-infra-internal task-event {task-id} review-analysis.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}`,使用 `changes-requested` 并路由到同阶段修订/复审(报告明确拒绝时使用 `rejected`)。失败、模型停止、无进展或紧急熔断时,不发布完成事件或跨阶段命令,但必须按 `reference/output-templates.md` 的 `repair-stop` 场景展示已有 summary/findings、artifact、实际修复次数、最后诊断和停止原因。
104
104
 
105
105
  `manual-validation` 是 `ai task log` 中 review 行「人工校验点」(EN `Manual-validation`)计数的数据源;不要新增并行人工验证字段。
106
106
 
@@ -9,7 +9,7 @@ description: >
9
9
  # Code Review
10
10
  > `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
11
11
 
12
- If the entry operands contain `--orchestrated`, bind `{execution-flag}` to `--orchestrated` and forward it unchanged to both the summary finalizer and completed event; otherwise bind it to an empty value. Never infer it from `orchestration.json`, environment variables, or prior artifacts. Lifecycle events also require explicit trigger data: use `{trigger-initiator}=orchestrator` for orchestration and `model` otherwise; `{request-id}` is a stable single-line identifier for this task and artifact round, and `{reason-code}` is `user-request` or `review-finding` for ordinary reviews. Only an explicitly requested supplemental human review uses `--initiator human --reason-code manual-review-supplement`. Reuse the same values for started and completed.
12
+ Lifecycle events require explicit trigger data: ordinary review uses `model`; only an explicitly requested supplemental human review uses `--initiator human --reason-code manual-review-supplement`. `{request-id}` is a stable single-line identifier for this task and artifact round, and `{reason-code}` use `user-request` or `review-finding` for ordinary reviews. Reuse the same values for started and completed.
13
13
 
14
14
  Review the latest code round and produce `review-code.md` or `review-code-r{N}.md`.
15
15
 
@@ -114,9 +114,9 @@ Create `<task-workspace>/active/{task-id}/{review-artifact}`.
114
114
  ### 6. Update Task Status
115
115
 
116
116
  Update task.md:
117
- - After the report, call `agent-infra-internal task-review {task-id} preflight --stage code --artifact {review-artifact} {execution-flag}` before any ledger write. On failure, correct the formal artifact directly and rerun it.
117
+ - After the report, call `agent-infra-internal task-review {task-id} preflight --stage code --artifact {review-artifact}` before any ledger write. On failure, correct the formal artifact directly and rerun it.
118
118
  - Only after preflight passes, submit each new finding with `agent-infra-internal task-ledger {task-id} finding-upsert --stage code --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}`. When escalating to `needs-human-decision`, append `--needs-implementation true|false` using the judgment recorded in the detail block. Do not scan ids or edit ledger rows
119
- - After all ledger writes, call `agent-infra-internal task-review {task-id} finalize-summary --stage code --artifact {review-artifact} {execution-flag}`; never treat an error type or `changed=false` as automatic authorization
119
+ - After all ledger writes, call `agent-infra-internal task-review {task-id} finalize-summary --stage code --artifact {review-artifact}`; never treat an error type or `changed=false` as automatic authorization
120
120
 
121
121
  Bind and reuse this structured mapping from that one response:
122
122
 
@@ -126,10 +126,10 @@ Update task.md:
126
126
  {unresolved-minor} = stageStatus.unresolvedFindingCounts.minor
127
127
  ```
128
128
 
129
- 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. After a failure, the model may edit the same controlled artifact and rerun the same intent only when the shared rule's mechanical gates pass; reassess convergence after every failure. The final complete result determines the verdict and counts from that same snapshot: `stageStatus.canAdvance=true` with an Approved conclusion permits cross-stage advancement; `stageStatus.canAdvance=false` still requires `agent-infra-internal task-event {task-id} review-code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n} {execution-flag}`, using `changes-requested` and routing to same-stage revision/review (use `rejected` when the report explicitly rejects). On failure, model stop, lack of progress, or the emergency cap, do not publish a completion event or cross-stage command; use the `repair-stop` scenario in `reference/output-templates.md` to show existing summary/findings, the artifact, actual repair attempts, the last diagnostic, and the stop reason
129
+ 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. After a failure, the model may edit the same controlled artifact and rerun the same intent only when the shared rule's mechanical gates pass; reassess convergence after every failure. The final complete result determines the verdict and counts from that same snapshot: `stageStatus.canAdvance=true` with an Approved conclusion permits cross-stage advancement; `stageStatus.canAdvance=false` still requires `agent-infra-internal task-event {task-id} review-code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}`, using `changes-requested` and routing to same-stage revision/review (use `rejected` when the report explicitly rejects). On failure, model stop, lack of progress, or the emergency cap, do not publish a completion event or cross-stage command; use the `repair-stop` scenario in `reference/output-templates.md` to show existing summary/findings, the artifact, actual repair attempts, the last diagnostic, and the stop reason
130
130
  - Only when `canAdvance=true`, the verdict is Approved, and `T == R^{tree}`, write `last_reviewed_commit: {R}`. Clear an old value for an Approved snapshot with uncommitted differences; otherwise preserve the existing value and do not advance it
131
131
  - For an Approved exit, use `reference/output-templates.md` to select one branch and its `agent-client next-steps` helper to generate the next command.
132
- - After handling `last_reviewed_commit`, run `agent-infra-internal task-event {task-id} review-code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n} {execution-flag}`
132
+ - After handling `last_reviewed_commit`, run `agent-infra-internal task-event {task-id} review-code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}`
133
133
 
134
134
  Always include the `Manual-validation: {n}` field in the done log, including when it is 0.
135
135
  `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.
@@ -9,7 +9,7 @@ description: >
9
9
  # 代码审查
10
10
  > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
11
11
 
12
- 若入口业务操作数包含 `--orchestrated`,绑定 `{execution-flag}` = `--orchestrated` 并原样转发给 summary finalizer 与 completed 事件;否则绑定为空。不得从 `orchestration.json`、环境变量或历史产物推断该标记。生命周期事件还必须携带显式触发信息:编排调用使用 `{trigger-initiator}=orchestrator`,否则使用 `model`;`{request-id}` 是本任务与本轮产物的稳定单行标识,普通调用的 `{reason-code}` 使用 `user-request` 或 `review-finding`;仅用户明确要求补充审查时,使用 `--initiator human --reason-code manual-review-supplement`。started 与 completed 使用同一组值。
12
+ 生命周期事件必须携带显式触发信息:普通调用使用 `model`;仅用户明确要求补充审查时,使用 `--initiator human --reason-code manual-review-supplement`。`{request-id}` 是本任务与本轮产物的稳定单行标识,`{reason-code}` 普通审查使用 `user-request` 或 `review-finding`;started 与 completed 使用同一组值。
13
13
 
14
14
  审查最新代码轮次,并产出 `review-code.md` 或 `review-code-r{N}.md`。
15
15
 
@@ -112,9 +112,9 @@ agent-infra-internal task-artifact {task-id} init --family review-code --artifac
112
112
 
113
113
  ### 6. 更新任务状态
114
114
 
115
- - 报告完成后,先调用 `agent-infra-internal task-review {task-id} preflight --stage code --artifact {review-artifact} {execution-flag}`,不得先写入账本。失败后直接修正正式产物并重跑。
115
+ - 报告完成后,先调用 `agent-infra-internal task-review {task-id} preflight --stage code --artifact {review-artifact}`,不得先写入账本。失败后直接修正正式产物并重跑。
116
116
  - 只有 preflight 通过后,新 finding 才逐条调用 `agent-infra-internal task-ledger {task-id} finding-upsert --stage code --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 {相称证据}`。升级为 `needs-human-decision` 时,按详情块中的判断追加 `--needs-implementation true|false`。不得扫描编号或手写账本行
117
- - 全部账本写入完成后调用 `agent-infra-internal task-review {task-id} finalize-summary --stage code --artifact {review-artifact} {execution-flag}`;不能把失败类型或 `changed=false` 当作自动授权
117
+ - 全部账本写入完成后调用 `agent-infra-internal task-review {task-id} finalize-summary --stage code --artifact {review-artifact}`;不能把失败类型或 `changed=false` 当作自动授权
118
118
 
119
119
  从该次返回值绑定并复用以下结构化映射:
120
120
 
@@ -124,10 +124,10 @@ agent-infra-internal task-artifact {task-id} init --family review-code --artifac
124
124
  {unresolved-minor} = stageStatus.unresolvedFindingCounts.minor
125
125
  ```
126
126
 
127
- 该 intent 原子最终化报告摘要并返回同一次账本快照;不得再调用 `stage-status`、手工替换占位符或扫描问题清单。失败后,模型只能在共享规则的机械安全门通过时修改同一个受控 artifact,并完整重跑相同 intent;每次失败都重新判断是否收敛。最终一次完整成功返回决定同一快照的 verdict 和计数:`stageStatus.canAdvance=true` 且结论为 Approved 时允许跨阶段推进;`stageStatus.canAdvance=false` 时仍须执行 `agent-infra-internal task-event {task-id} review-code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n} {execution-flag}`,使用 `changes-requested` 并路由到同阶段修订/复审(报告明确拒绝时使用 `rejected`)。失败、模型停止、无进展或紧急熔断时,不发布完成事件或跨阶段命令,但必须按 `reference/output-templates.md` 的 `repair-stop` 场景展示已有 summary/findings、artifact、实际修复次数、最后诊断和停止原因
127
+ 该 intent 原子最终化报告摘要并返回同一次账本快照;不得再调用 `stage-status`、手工替换占位符或扫描问题清单。失败后,模型只能在共享规则的机械安全门通过时修改同一个受控 artifact,并完整重跑相同 intent;每次失败都重新判断是否收敛。最终一次完整成功返回决定同一快照的 verdict 和计数:`stageStatus.canAdvance=true` 且结论为 Approved 时允许跨阶段推进;`stageStatus.canAdvance=false` 时仍须执行 `agent-infra-internal task-event {task-id} review-code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}`,使用 `changes-requested` 并路由到同阶段修订/复审(报告明确拒绝时使用 `rejected`)。失败、模型停止、无进展或紧急熔断时,不发布完成事件或跨阶段命令,但必须按 `reference/output-templates.md` 的 `repair-stop` 场景展示已有 summary/findings、artifact、实际修复次数、最后诊断和停止原因
128
128
  - 仅当 `canAdvance=true`、本轮结论为 Approved 且 `T == R^{tree}` 时写入 `last_reviewed_commit: {R}`;Approved 快照包含未提交差异时清除旧值。否则保留既有值,不得推进或清空
129
129
  - Approved 出口按 `reference/output-templates.md` 选择唯一场景,并使用对应的 `agent-client next-steps` helper 生成下一步命令。
130
- - 完成 `last_reviewed_commit` 处理后执行 `agent-infra-internal task-event {task-id} review-code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n} {execution-flag}`
130
+ - 完成 `last_reviewed_commit` 处理后执行 `agent-infra-internal task-event {task-id} review-code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}`
131
131
 
132
132
  完成日志必须始终写入 `Manual-validation: {n}` 字段,0 也保留。
133
133
  `manual-validation` 是 `ai task log` 中 review 行「人工校验点」(EN `Manual-validation`)计数的数据源;不要新增并行人工验证字段。
@@ -9,7 +9,7 @@ description: >
9
9
  # Technical Plan Review
10
10
  > `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
11
11
 
12
- If the entry operands contain `--orchestrated`, bind `{execution-flag}` to `--orchestrated` and forward it unchanged to both the summary finalizer and completed event; otherwise bind it to an empty value. Never infer it from `orchestration.json`, environment variables, or prior artifacts. Lifecycle events also require explicit trigger data: use `{trigger-initiator}=orchestrator` for orchestration and `model` otherwise; `{request-id}` is a stable single-line identifier for this task and artifact round, and `{reason-code}` is `user-request` or `review-finding`. Reuse the same values for started and completed.
12
+ Lifecycle events require explicit trigger data: ordinary skill invocation uses `model`; use `human` only when the user explicitly requests it. `{request-id}` is a stable single-line identifier for this task and artifact round, and `{reason-code}` use `user-request` or `review-finding`. Reuse the same values for started and completed.
13
13
 
14
14
  Review the latest plan artifact and produce `review-plan.md` or `review-plan-r{N}.md`.
15
15
 
@@ -87,7 +87,7 @@ Create `<task-workspace>/active/{task-id}/{review-artifact}`.
87
87
 
88
88
  ### 6. Update Task Status
89
89
 
90
- After the report, call `agent-infra-internal task-review {task-id} preflight --stage plan --artifact {review-artifact} {execution-flag}` before any ledger write. On failure, correct the formal artifact directly and rerun it. Only after preflight passes, 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}` or 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} {execution-flag}`; never treat an error type or `changed=false` as automatic authorization.
90
+ After the report, call `agent-infra-internal task-review {task-id} preflight --stage plan --artifact {review-artifact}` before any ledger write. On failure, correct the formal artifact directly and rerun it. Only after preflight passes, 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}` or 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}`; never treat an error type or `changed=false` as automatic authorization.
91
91
 
92
92
  Bind and reuse this structured mapping from that one response:
93
93
 
@@ -97,7 +97,7 @@ Bind and reuse this structured mapping from that one response:
97
97
  {unresolved-minor} = stageStatus.unresolvedFindingCounts.minor
98
98
  ```
99
99
 
100
- 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. After a failure, the model may edit the same controlled artifact and rerun the same intent only when the shared rule's mechanical gates pass; reassess convergence after every failure. The final complete result determines the verdict and counts from that same snapshot: `stageStatus.canAdvance=true` with an Approved conclusion permits cross-stage advancement; `stageStatus.canAdvance=false` still requires `agent-infra-internal task-event {task-id} review-plan.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n} {execution-flag}`, using `changes-requested` and routing to same-stage revision/review (use `rejected` when the report explicitly rejects). On failure, model stop, lack of progress, or the emergency cap, do not publish a completion event or cross-stage command; use the `repair-stop` scenario in `reference/output-templates.md` to show existing summary/findings, the artifact, actual repair attempts, the last diagnostic, and the stop reason.
100
+ 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. After a failure, the model may edit the same controlled artifact and rerun the same intent only when the shared rule's mechanical gates pass; reassess convergence after every failure. The final complete result determines the verdict and counts from that same snapshot: `stageStatus.canAdvance=true` with an Approved conclusion permits cross-stage advancement; `stageStatus.canAdvance=false` still requires `agent-infra-internal task-event {task-id} review-plan.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}`, using `changes-requested` and routing to same-stage revision/review (use `rejected` when the report explicitly rejects). On failure, model stop, lack of progress, or the emergency cap, do not publish a completion event or cross-stage command; use the `repair-stop` scenario in `reference/output-templates.md` to show existing summary/findings, the artifact, actual repair attempts, the last diagnostic, and the stop reason.
101
101
 
102
102
  `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.
103
103