@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
@@ -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-plan.md` 或 `review-plan-r{N}.md`。
15
15
 
@@ -90,7 +90,7 @@ agent-infra-internal task-artifact {task-id} init --family review-plan --artifac
90
90
 
91
91
  ### 6. 更新任务状态
92
92
 
93
- 报告完成后,先调用 `agent-infra-internal task-review {task-id} preflight --stage plan --artifact {review-artifact} {execution-flag}`,不得先写入账本。失败后直接修正正式产物并重跑;只有 preflight 通过后,才逐条调用 `agent-infra-internal task-ledger {task-id} finding-upsert --stage plan --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}`,或复核上一轮响应时调用 `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {相称证据}`。不得扫描编号或手写账本行。全部账本写入完成后调用 `agent-infra-internal task-review {task-id} finalize-summary --stage plan --artifact {review-artifact} {execution-flag}`;不能把失败类型或 `changed=false` 当作自动授权。
93
+ 报告完成后,先调用 `agent-infra-internal task-review {task-id} preflight --stage plan --artifact {review-artifact}`,不得先写入账本。失败后直接修正正式产物并重跑;只有 preflight 通过后,才逐条调用 `agent-infra-internal task-ledger {task-id} finding-upsert --stage plan --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}`,或复核上一轮响应时调用 `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {相称证据}`。不得扫描编号或手写账本行。全部账本写入完成后调用 `agent-infra-internal task-review {task-id} finalize-summary --stage plan --artifact {review-artifact}`;不能把失败类型或 `changed=false` 当作自动授权。
94
94
 
95
95
  从该次返回值绑定并复用以下结构化映射:
96
96
 
@@ -100,7 +100,7 @@ agent-infra-internal task-artifact {task-id} init --family review-plan --artifac
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-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}`,使用 `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-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}`,使用 `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
 
@@ -135,7 +135,7 @@ After closure, re-run step 1 for the next canonical round; never start the new r
135
135
 
136
136
  ### 6. Write back the publication result and task state
137
137
 
138
- - **Task-anchored path**: write the actual publication status in the `pr-review-rN.md` "Publication Result" section. Record the Review ID/URL for `applied` / `no-op`; for a failed write with a durable journal entry, record `blocked` / `failed`, the error code, and recovery action. Then close the local Activity Log with the verdict/counts frozen in step 3:
138
+ - **Task-anchored path**: write the actual publication status in the `pr-review-rN.md` "Publication Result" section. Record the Review ID/URL for `applied` / `no-op`; for a failed write with a durable journal entry, record `blocked` / `failed`, the error code, and recovery action. Then close the local review state with the verdict/counts frozen in step 3:
139
139
 
140
140
  ```bash
141
141
  agent-infra-internal task-activity {task-id} pr-review-complete --agent {agent} \
@@ -143,13 +143,13 @@ After closure, re-run step 1 for the next canonical round; never start the new r
143
143
  --blockers {blockers} --major {major} --minor {minor}
144
144
  ```
145
145
 
146
- `task-activity` generates `Verdict: <result>, blockers: N, major: N, minor: N → {pr-review-artifact}` from the typed payload and atomically writes the Activity Log, `## Review Feedback` link, and version stamp through `writeTask`. It never changes `current_step` or puts receipt/head/Review URL into the NOTE.
146
+ `task-activity` generates `Verdict: <result>, blockers: N, major: N, minor: N → {pr-review-artifact}` from the typed payload and atomically writes the structured review state, `## Review Feedback` link, and version stamp through `writeTask`. It appends the log when safe and otherwise returns a diagnostic. It never changes `current_step` or puts receipt/head/Review URL into the NOTE.
147
147
 
148
148
  - **One-shot path (no task)**: record the actual publication status in the `pr-review-rN.md` "Publication Result" section. Record the Review ID/URL on success, or the error and lack of automatic recovery on failure. Do not call `task-activity`.
149
149
 
150
150
  ### 7. Re-sync after write-back (task-anchored path)
151
151
 
152
- Step 6 rewrote the local `pr-review-rN.md` "Publication Result" section and task.md (Activity Log), while step 4 synced the older snapshot. Attempt the syncs again in order; record failures as warnings for `complete-task` to restore before archiving:
152
+ Step 6 rewrote the local `pr-review-rN.md` "Publication Result" section and task.md (review state and available log), while step 4 synced the older snapshot. Attempt the syncs again in order; record failures as warnings for `complete-task` to restore before archiving:
153
153
 
154
154
  ```bash
155
155
  agent-infra-internal platform-comment sync {task-id} --kind task --agent {agent}
@@ -186,7 +186,7 @@ Pick the single exit branch per `reference/output-guidance.md` (local review com
186
186
  - [ ] Published the formal Review, durably recorded its pending publication, or accurately recorded a one-shot publication failure
187
187
  - [ ] Synced the Issue artifact/task comments or recorded their pending recovery on the task-anchored path
188
188
  - [ ] Ran the completion verification (`task-verify` or `verify-artifact`)
189
- - [ ] Updated task.md and appended the Activity Log entry (task-anchored path)
189
+ - [ ] Updated task.md review state and recorded log diagnostics when applicable
190
190
 
191
191
  ## Stop
192
192
 
@@ -135,7 +135,7 @@ agent-infra-internal task-activity {task-id} pr-review-terminate --agent {agent}
135
135
 
136
136
  ### 6. 回写发布结果与任务状态
137
137
 
138
- - **任务锚定路径**:把 publish 的实际状态写入 `pr-review-rN.md`「发布结果」段。`applied` / `no-op` 时记录 Review ID/URL;写入失败且已有任务账本记录时写 `blocked` / `failed`、错误码和恢复动作。随后以步骤 3 冻结的同一组 verdict/counts 闭合本地活动日志:
138
+ - **任务锚定路径**:把 publish 的实际状态写入 `pr-review-rN.md`「发布结果」段。`applied` / `no-op` 时记录 Review ID/URL;写入失败且已有任务账本记录时写 `blocked` / `failed`、错误码和恢复动作。随后以步骤 3 冻结的同一组 verdict/counts 闭合本地审查状态:
139
139
 
140
140
  ```bash
141
141
  agent-infra-internal task-activity {task-id} pr-review-complete --agent {agent} \
@@ -143,13 +143,13 @@ agent-infra-internal task-activity {task-id} pr-review-terminate --agent {agent}
143
143
  --blockers {blockers} --major {major} --minor {minor}
144
144
  ```
145
145
 
146
- `task-activity` 由 typed payload 生成 `Verdict: <结论>, blockers: N, major: N, minor: N → {pr-review-artifact}`,并经 `writeTask` 原子完成 Activity Log、`## 审查反馈` 链接与版本戳刷新;不改 `current_step`,也不把 receipt/head/Review URL 写入 NOTE。
146
+ `task-activity` 由 typed payload 生成 `Verdict: <结论>, blockers: N, major: N, minor: N → {pr-review-artifact}`,并经 `writeTask` 原子完成结构化审查状态、`## 审查反馈` 链接与版本戳刷新;日志可安全追加时一并写入,否则返回诊断;不改 `current_step`,也不把 receipt/head/Review URL 写入 NOTE。
147
147
 
148
148
  - **一次性路径(无任务)**:把实际发布状态写入 `pr-review-rN.md`「发布结果」段;成功时记录 Review ID/URL,失败时记录错误与不可自动恢复的限制。不调用 `task-activity`。
149
149
 
150
150
  ### 7. 发布后回写再同步(任务锚定路径)
151
151
 
152
- 步骤 6 已改写本地 `pr-review-rN.md`「发布结果」段与 task.md(活动日志),而步骤 4 同步的是旧快照。依次尝试再同步;失败记录 warning,由 `complete-task` 在归档前补齐:
152
+ 步骤 6 已改写本地 `pr-review-rN.md`「发布结果」段与 task.md(审查状态及可用日志),而步骤 4 同步的是旧快照。依次尝试再同步;失败记录 warning,由 `complete-task` 在归档前补齐:
153
153
 
154
154
  ```bash
155
155
  agent-infra-internal platform-comment sync {task-id} --kind task --agent {agent}
@@ -186,7 +186,7 @@ agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact
186
186
  - [ ] 正式 Review 已发布、任务账本已记录待恢复操作,或一次性路径已如实记录发布失败
187
187
  - [ ] 任务锚定路径的 Issue artifact/task 评论已同步,或失败已记录待恢复
188
188
  - [ ] 已完成校验(`task-verify` 或 `verify-artifact`)
189
- - [ ] 已更新 task.md 并追加 Activity Log(任务锚定路径)
189
+ - [ ] 已更新 task.md 中的审查状态并记录日志诊断(如适用)
190
190
 
191
191
  ## 停止
192
192
 
@@ -8,7 +8,7 @@ description: >
8
8
 
9
9
  # Run Manual Validation
10
10
 
11
- Lifecycle events 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 `validation-rerun`. Reuse the same values for started and completed.
11
+ 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 `validation-rerun`. Reuse the same values for started and completed.
12
12
 
13
13
  ## Task Context Resolution
14
14
 
@@ -8,7 +8,7 @@ description: >
8
8
 
9
9
  # 运行人工校验
10
10
 
11
- 生命周期事件必须携带显式触发信息:编排调用使用 `{trigger-initiator}=orchestrator`,否则使用 `model`;`{request-id}` 是本任务与本轮产物的稳定单行标识,`{reason-code}` 使用 `user-request` 或 `validation-rerun`;started 与 completed 使用同一组值。
11
+ 生命周期事件必须携带显式触发信息:普通技能调用使用 `model`;仅用户明确要求时使用 `human`。`{request-id}` 是本任务与本轮产物的稳定单行标识,`{reason-code}` 使用 `user-request` 或 `validation-rerun`;started 与 completed 使用同一组值。
12
12
 
13
13
  ## 任务上下文解析
14
14
 
@@ -251,11 +251,10 @@ function normalizeAgentClientConfig(cfg) {
251
251
  }
252
252
  const keys = Object.keys(candidate);
253
253
  if (
254
- (keys.length !== 3 && keys.length !== 4)
254
+ keys.length !== 3
255
255
  || !own(candidate, 'id')
256
256
  || !own(candidate, 'enabled')
257
257
  || !own(candidate, 'installInSandbox')
258
- || (keys.length === 4 && !own(candidate, 'orchestration'))
259
258
  ) {
260
259
  return failure('INVALID_AGENT_CLIENTS', entryPath);
261
260
  }
@@ -266,52 +265,9 @@ function normalizeAgentClientConfig(cfg) {
266
265
  if (typeof candidate.enabled !== 'boolean' || typeof candidate.installInSandbox !== 'boolean') {
267
266
  return failure('INVALID_AGENT_CLIENTS', entryPath);
268
267
  }
269
- let orchestration;
270
- if (own(candidate, 'orchestration')) {
271
- const policy = candidate.orchestration;
272
- if (
273
- !policy
274
- || typeof policy !== 'object'
275
- || Array.isArray(policy)
276
- || Object.keys(policy).length !== 2
277
- || !own(policy, 'executor')
278
- || !own(policy, 'reviewer')
279
- ) {
280
- return failure('INVALID_AGENT_CLIENTS', `${entryPath}.orchestration`);
281
- }
282
- const parseExact = (value, path) => {
283
- if (typeof value !== 'string' || value.length === 0 || value.trim() !== value) {
284
- return failure('INVALID_AGENT_CLIENTS', path);
285
- }
286
- return value;
287
- };
288
- const parseRole = (role, rolePath) => {
289
- if (
290
- !role
291
- || typeof role !== 'object'
292
- || Array.isArray(role)
293
- || Object.keys(role).length !== 2
294
- || !own(role, 'model')
295
- || !own(role, 'reasoningEffort')
296
- ) {
297
- return failure('INVALID_AGENT_CLIENTS', rolePath);
298
- }
299
- const model = parseExact(role.model, `${rolePath}.model`);
300
- if (typeof model !== 'string') return model;
301
- const reasoningEffort = parseExact(role.reasoningEffort, `${rolePath}.reasoningEffort`);
302
- if (typeof reasoningEffort !== 'string') return reasoningEffort;
303
- return { model, reasoningEffort };
304
- };
305
- const executor = parseRole(policy.executor, `${entryPath}.orchestration.executor`);
306
- if (executor.errorCode) return executor;
307
- const reviewer = parseRole(policy.reviewer, `${entryPath}.orchestration.reviewer`);
308
- if (reviewer.errorCode) return reviewer;
309
- orchestration = { executor, reviewer };
310
- }
311
268
  entries.set(candidate.id, {
312
269
  enabled: candidate.enabled,
313
- installInSandbox: candidate.installInSandbox,
314
- ...(orchestration ? { orchestration } : {})
270
+ installInSandbox: candidate.installInSandbox
315
271
  });
316
272
  }
317
273
  if (AGENT_CLIENT_IDS.some((id) => !entries.has(id))) {
@@ -676,22 +632,6 @@ function mergeTemplateSources(baseRoot, sources, report) {
676
632
  };
677
633
  }
678
634
 
679
- function writeIfChanged(projectRoot, targetPath, content, reportBucket) {
680
- const fullPath = path.join(projectRoot, targetPath);
681
- const exists = fs.existsSync(fullPath);
682
-
683
- if (exists && fs.readFileSync(fullPath, 'utf8') === content) {
684
- reportBucket.unchanged.push(targetPath);
685
- return;
686
- }
687
-
688
- const dir = path.dirname(fullPath);
689
- if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
690
- fs.writeFileSync(fullPath, content, 'utf8');
691
-
692
- (exists ? reportBucket.updated : reportBucket.generated).push(targetPath);
693
- }
694
-
695
635
  function syncCustomSkillSources(projectRoot, sources, report, templateSkillNames) {
696
636
  const skillsDir = path.join(projectRoot, '.agents/skills');
697
637
  const syncedSkills = new Map();
@@ -1102,7 +1042,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
1102
1042
  && !Array.isArray(cfg.files.managedBaselines)
1103
1043
  ? { ...cfg.files.managedBaselines }
1104
1044
  : {};
1105
- let baselinesChanged = false;
1045
+
1106
1046
 
1107
1047
  for (const target of Object.keys(managedBaselines)) {
1108
1048
  if (
@@ -1111,7 +1051,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
1111
1051
  && !allClientManaged.some((entry) => assetMatches(entry, target))
1112
1052
  ) {
1113
1053
  delete managedBaselines[target];
1114
- baselinesChanged = true;
1115
1054
  }
1116
1055
  }
1117
1056
 
@@ -1206,7 +1145,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
1206
1145
  if (!fs.existsSync(candidatePath)) {
1207
1146
  if (Object.prototype.hasOwnProperty.call(managedBaselines, candidate)) {
1208
1147
  delete managedBaselines[candidate];
1209
- baselinesChanged = true;
1210
1148
  }
1211
1149
  continue;
1212
1150
  }
@@ -1232,7 +1170,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
1232
1170
  }
1233
1171
  if (Object.prototype.hasOwnProperty.call(managedBaselines, candidate)) {
1234
1172
  delete managedBaselines[candidate];
1235
- baselinesChanged = true;
1236
1173
  }
1237
1174
  }
1238
1175
  removeEmptyDirs(target);
@@ -1252,7 +1189,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
1252
1189
  report.managed.removed.push(entry);
1253
1190
  if (Object.prototype.hasOwnProperty.call(managedBaselines, entry)) {
1254
1191
  delete managedBaselines[entry];
1255
- baselinesChanged = true;
1256
1192
  }
1257
1193
  } else {
1258
1194
  report.managed.protected.push({
@@ -1321,7 +1257,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
1321
1257
 
1322
1258
  if (rawBaseline !== undefined && baseline === null) {
1323
1259
  delete managedBaselines[target];
1324
- baselinesChanged = true;
1325
1260
  }
1326
1261
  if (baseline === null && localHash !== null && localHash !== templateHash) {
1327
1262
  report.managed.conflicts.push({
@@ -1362,7 +1297,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
1362
1297
  bucket.unchanged.push(target);
1363
1298
  if (managedBaselines[target] !== templateHash) {
1364
1299
  managedBaselines[target] = templateHash;
1365
- baselinesChanged = true;
1366
1300
  }
1367
1301
  return false;
1368
1302
  }
@@ -1371,7 +1305,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
1371
1305
  if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
1372
1306
  fs.writeFileSync(dstFull, content);
1373
1307
  managedBaselines[target] = templateHash;
1374
- baselinesChanged = true;
1375
1308
  if (Object.prototype.hasOwnProperty.call(bucket, 'written')) {
1376
1309
  (exists ? bucket.written : bucket.created).push(target);
1377
1310
  } else {
@@ -1417,7 +1350,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
1417
1350
  report.managed.removed.push(renderedTarget);
1418
1351
  if (Object.prototype.hasOwnProperty.call(managedBaselines, renderedTarget)) {
1419
1352
  delete managedBaselines[renderedTarget];
1420
- baselinesChanged = true;
1421
1353
  }
1422
1354
  continue;
1423
1355
  }
@@ -1479,7 +1411,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
1479
1411
  if (localHash === null) {
1480
1412
  if (Object.prototype.hasOwnProperty.call(managedBaselines, target)) {
1481
1413
  delete managedBaselines[target];
1482
- baselinesChanged = true;
1483
1414
  }
1484
1415
  continue;
1485
1416
  }
@@ -1492,7 +1423,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
1492
1423
  report.managed.removed.push(target);
1493
1424
  if (Object.prototype.hasOwnProperty.call(managedBaselines, target)) {
1494
1425
  delete managedBaselines[target];
1495
- baselinesChanged = true;
1496
1426
  }
1497
1427
  removeEmptyDirs(path.dirname(dstFull));
1498
1428
  continue;
@@ -1608,7 +1538,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
1608
1538
  if (baseline !== null && localHash === baseline) {
1609
1539
  fs.unlinkSync(path.join(projectRoot, projFile));
1610
1540
  delete managedBaselines[projFile];
1611
- baselinesChanged = true;
1612
1541
  report.managed.removed.push(projFile);
1613
1542
  } else {
1614
1543
  report.managed.protected.push({
@@ -1715,7 +1644,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
1715
1644
  if (Object.keys(managedBaselines).length > 0) {
1716
1645
  cfg.files.managedBaselines = managedBaselines;
1717
1646
  } else {
1718
- if (Object.prototype.hasOwnProperty.call(cfg.files, 'managedBaselines')) baselinesChanged = true;
1719
1647
  delete cfg.files.managedBaselines;
1720
1648
  }
1721
1649
  cfg.templateVersion = version;
@@ -61,7 +61,7 @@ process.stdout.write(`${JSON.stringify(previous)}\n`);
61
61
  ' {task-id}
62
62
  ```
63
63
 
64
- Then run `platform-pr summary-context` and compare the retained repository/resource identity with the authoritative snapshot; discard a mismatch and mark the increment unconfirmed. Rebuild the task-bound `pr-change-report.json` for the authoritative PR head using the shared PR change-report contract, and refresh the single summary with a body containing one `<!-- canonical-pr-change-report -->` placeholder via `summary-sync --change-report-file ... --result no_op --strict`. Complete-PR statistics keep the current base/head/merge-base/patch and existing totals. Only when the prior report is valid, the PR identity matches, and the heads differ, describe the separate head-to-head tree diff using `git diff --find-renames --numstat {previous-head} {current-head}`, `--name-status`, and `--summary`. Do not substitute a merge-base diff for this range or add increment totals to the full PR. If no valid prior head exists, state that it is unconfirmed; do not infer from complete-PR statistics or fill in zeroes. Matching heads mean there was no new head transition.
64
+ Then run `platform-pr summary-context` and compare the retained repository/resource identity with the authoritative snapshot; discard a mismatch and mark the increment unconfirmed. Rebuild the task-bound `pr-change-report.json` for the authoritative PR head using the shared PR change-report contract, and refresh the single summary with structured summary JSON via `summary-sync --change-report-file ... --result no_op --strict`. Preserve the actual test, review, and manual validation states; do not depend on later events or final verification. Complete-PR statistics keep the current base/head/merge-base/patch and existing totals. Only when the prior report is valid, the PR identity matches, and the heads differ, describe the separate head-to-head tree diff using `git diff --find-renames --numstat {previous-head} {current-head}`, `--name-status`, and `--summary`. Do not substitute a merge-base diff for this range or add increment totals to the full PR. If no valid prior head exists, state that it is unconfirmed; do not infer from complete-PR statistics or fill in zeroes. Matching heads mean there was no new head transition.
65
65
 
66
66
  `--strict` preserves report or summary refresh failures as `failed/blocked` instead of treating warnings as success. A report or summary refresh failure must not enter the ready/complete exit; use step 4. After a successful refresh, consume `nextAction` from the structured `summary-sync` result: `review-code` exits readiness/self-heal and follows the code-review branch in step 7; only `watch-pr` continues to `agent-infra-internal platform-checks watch {task-id} --interval-seconds 30 --deadline-seconds 1800`. Missing or invalid `nextAction` follows the refresh-failure exit; do not infer `watch-pr`. Route readiness only by `readiness.state`: `ready` to step 7, `conflicting|checks-failed` to step 3, and `pending|timed-out|cancelled` to step 4.
67
67
 
@@ -61,7 +61,7 @@ process.stdout.write(`${JSON.stringify(previous)}\n`);
61
61
  ' {task-id}
62
62
  ```
63
63
 
64
- 随后调用 `platform-pr summary-context`,比较暂存的 repository/resource identity 与当前权威 snapshot;不匹配时丢弃旧 head 并标记增量未确认。按共享 PR change-report contract 用当前权威 PR head 重建任务绑定的 `pr-change-report.json`,再用含唯一 `<!-- canonical-pr-change-report -->` 占位符的正文调用 `summary-sync --change-report-file ... --result no_op --strict` 刷新同一条摘要。完整 PR 仍使用当前 base/head/merge-base/patch 与现有 totals。只有在上一报告有效、PR identity 相同且两个 head 不同的情况下,才用 `git diff --find-renames --numstat {previous-head} {current-head}`、`--name-status`、`--summary` 描述独立的 head→head 树差异;不使用 merge-base 替代该范围,不把增量 totals 加入完整 PR。无有效上一 head 时写明未确认,不从完整 PR 推算或填零;head 相同只说明没有新的 head 转换。
64
+ 随后调用 `platform-pr summary-context`,比较暂存的 repository/resource identity 与当前权威 snapshot;不匹配时丢弃旧 head 并标记增量未确认。按共享 PR change-report contract 用当前权威 PR head 重建任务绑定的 `pr-change-report.json`,用结构化摘要 JSON 调用 `summary-sync --change-report-file ... --result no_op --strict` 刷新同一条摘要;保留测试、Review 和人工校验的真实状态,不能依赖后续事件或最终验证。完整 PR 仍使用当前 base/head/merge-base/patch 与现有 totals。只有在上一报告有效、PR identity 相同且两个 head 不同的情况下,才用 `git diff --find-renames --numstat {previous-head} {current-head}`、`--name-status`、`--summary` 描述独立的 head→head 树差异;不使用 merge-base 替代该范围,不把增量 totals 加入完整 PR。无有效上一 head 时写明未确认,不从完整 PR 推算或填零;head 相同只说明没有新的 head 转换。
65
65
 
66
66
  `--strict` 将报告或摘要刷新失败保留为 `failed/blocked`,不得把 warning 当作成功;刷新失败时不得进入 ready/complete 出口,按步骤 4 记录阻塞。刷新成功后,消费 `summary-sync` 结构化结果的 `nextAction`:`review-code` 立即结束 readiness/self-heal 路径,按步骤 7 的代码审查分支退出;`watch-pr` 才继续调用 `agent-infra-internal platform-checks watch {task-id} --interval-seconds 30 --deadline-seconds 1800`。缺失或 invalid `nextAction` 按刷新失败处理,不推断为 `watch-pr`。readiness 只按结构化 `readiness.state` 分流:`ready` 进入步骤 7,`conflicting` 或 `checks-failed` 进入步骤 3,`pending|timed-out|cancelled` 进入步骤 4。
67
67
 
@@ -13,11 +13,11 @@ After the watch command, route by structured `readiness.state`:
13
13
 
14
14
  ## Summary Refresh Boundary
15
15
 
16
- Before readiness in every round, and after an external push, self-heal commit, or successful rebase changes the PR head, rerun `summary-context` → mechanical report and six-check precheck → `platform-pr change-report` → `summary-sync --change-report-file ... --result no_op --strict` with exactly one `<!-- canonical-pr-change-report -->` placeholder. `--strict` preserves report or summary refresh failures as `failed/blocked` so warnings cannot reach the ready/complete route. The core revalidates the sidecar against the authoritative PR snapshot, task-intent digest, and complete patch; missing, stale, invalid, bypassed, or raced publication must not continue to a ready/complete route and must enter the help exit with a warning.
16
+ Before readiness in every round, and after an external push, self-heal commit, or successful rebase changes the PR head, rerun `summary-context` → mechanical report and six-check precheck → `platform-pr change-report` → update the full PR summary JSON per `.agents/rules/pr-sync.md` → `summary-sync --change-report-file ... --result no_op --strict`. `--strict` preserves report or summary refresh failures as `failed/blocked`. The core revalidates the sidecar and reads back the remote body; missing, stale, invalid, incomplete, or raced publication must not continue to a ready/complete route.
17
17
 
18
- When rebuilding the precheck, each of the six `rationale` fields must state the corresponding high-level finding and include at least one path, line range, and concise `detail` as evidence. `change-composition` must describe where responsibilities are concentrated; compatibility, legacy-path, redundancy, and scope checks must state their actual results separately, without reused generic boilerplate. Use the deployed skill's language for rationales and evidence details; Chinese skill deployments must use Chinese.
18
+ When rebuilding the precheck, each of the six `rationale` fields must state its actual finding and include at least one item of evidence with a path, line range, and concise `detail`; state compatibility, legacy-path, redundancy, and scope findings separately without generic boilerplate. Use the deployed skill's language for rationales and evidence; Chinese deployments must use Chinese.
19
19
 
20
- Use the six existing `rationale` fields and `Evidence[]` to explain each logical change group: its goal and acceptance-criteria alignment, behavior added or removed, necessity, redundancy or duplication, scope, related tests, and test adequacy. Cite locatable code, test, or documentation evidence; mark unsupported points as unconfirmed. The renderer displays every evidence item. Source line counts, execution/call counts, and workflow unification are distinct claims: diff line counts cannot prove execution-count or workflow-behavior changes, and green CI cannot prove necessity. Analysis must not expand self-heal or refactoring authority.
20
+ Use the candidate content contract in `.agents/skills/create-pr/reference/change-report.md` for functional grouping, per-group fields, unique line attribution, and `needs-review` criteria. Rebuild groups from the current task goal and patch on every refresh; do not reuse prior-head explanations as evidence for the current increment. Reconcile complete-PR statistics separately from the previous valid head → current head increment; explicitly mark the increment unconfirmed when no previous head can be verified. If any group lacks goal alignment, behavior added/removed, necessity, line-count reconciliation, test coverage/cost, or locatable evidence, mark `target-alignment` or `change-composition` as `needs-review` and identify the gap. Reuse the existing `nextAction=review-code` route; structural completeness or green CI must not continue to `watch-pr`.
21
21
 
22
22
  Keep complete-PR scope bound to the current authoritative base/head/merge-base/patch and its full statistics. Report the increment separately as previous valid report head → current head. Before overwriting the prior sidecar, validate it with `readPrChangeReport`; use its `identity.head.sha` only when its repository/resource identity matches the current PR. Compare the two head trees directly and state both SHAs. Do not substitute a merge-base diff for these endpoints or add increment totals to complete-PR totals. If no prior report exists, it is invalid, or its identity differs, mark the previous head unconfirmed; do not infer values from the full PR or fill in zeroes. Identical SHAs mean the head did not change. After a rebase, compare the old and new head trees. An invalid sidecar makes only the increment unconfirmed; the existing full-PR report flow continues.
23
23
 
@@ -13,11 +13,11 @@
13
13
 
14
14
  ## 摘要刷新边界
15
15
 
16
- 每轮 readiness 之前,以及外部 push、自愈 commit 或 rebase 成功改变 PR head 之后,必须重新执行 `summary-context` → 机械报告与六项 precheck → `platform-pr change-report` → 含一次 `<!-- canonical-pr-change-report -->` 的 `summary-sync --change-report-file ... --result no_op --strict`。`--strict` 将报告或摘要刷新失败保留为 `failed/blocked`,不允许 warning 穿透到 ready/complete 路由。core 以权威 PR snapshot、任务意图 digest 和完整 patch 重新校验 sidecar;报告缺失、stale、invalid、占位符绕过或发布竞态时,不得继续 ready/complete 路由,转入求助出口并登记 warning。
16
+ 每轮 readiness 之前,以及外部 push、自愈 commit 或 rebase 成功改变 PR head 之后,必须重新执行 `summary-context` → 机械报告与六项 precheck → `platform-pr change-report` → 按 `.agents/rules/pr-sync.md` 更新完整 PR 摘要 JSON 并调用 `summary-sync --change-report-file ... --result no_op --strict`。`--strict` 将报告或摘要刷新失败保留为 `failed/blocked`,不允许 warning 穿透到 ready/complete 路由。core 以权威 PR snapshot、任务意图 digest 和完整 patch 重新校验 sidecar,并回读远端正文;报告缺失、stale、invalid、结构不完整或发布竞态时,不得继续 ready/complete 路由,转入求助出口并登记 warning。
17
17
 
18
- 每轮重建 precheck 时,六项 `rationale` 都必须是对应检查的实际高层结论,并各带至少一条路径、行号和简短 `detail` 证据;`change-composition` 要说明职责集中位置,兼容、旧路径、冗余和范围检查要分别说明实际结果,禁止复用泛化套话。理由和证据详情遵循当前已部署技能的语言,中文技能必须使用中文。
18
+ 每轮重建 precheck 时,除执行下方功能级报告门槛外,六项 `rationale` 都必须陈述对应检查的实际结论,并至少带一条含路径、行号和简短 `detail` 的证据;兼容、旧路径、冗余和范围检查分别说明,不复用泛化套话。理由和证据遵循当前部署语言,中文技能必须使用中文。
19
19
 
20
- 按逻辑变化组使用现有六项 `rationale` 和 `Evidence[]` 说明目标/验收对应、行为增减、必要性、冗余或重复、范围、相关测试及测试充分性。列出可定位的代码/测试/文档证据;缺证据时明确写未确认。renderer 会展示每项的全部 evidence。源码行数、执行/调用次数和流程统一是不同结论:diff 行数不能证明执行次数或流程行为变化;CI 全绿也不能证明必要性。不得由分析建议自行扩大自愈或重构权限。
20
+ 功能分组、逐组字段、行数唯一归属及 `needs-review` 条件统一遵循 `.agents/skills/create-pr/reference/change-report.md` 的 candidate 内容契约。每次刷新都重新按当前任务目标和 patch 建立功能组,不沿用上一 head 的说明代替本轮证据。完整 PR 统计与上一有效 head → 当前 head 的增量分开核算;没有可验证的上一 head 时明确标为未确认。任何功能组缺少目标对应、行为增减、必要性、行数对账、测试覆盖/成本或定位证据时,将 `target-alignment` 或 `change-composition` 标为 `needs-review` 并指出缺口。沿用现有 `nextAction=review-code` 路由;不得以结构完整或 CI 全绿继续 `watch-pr`。
21
21
 
22
22
  完整 PR 的范围继续绑定当前权威 base/head/merge-base/patch 与完整统计。增量单独绑定上一有效报告 head → 当前 head:在覆盖旧 sidecar 前,用 `readPrChangeReport` 校验旧报告,只在 repository/resource identity 匹配当前 PR 时采用旧 `identity.head.sha`。对两个 head 做 tree-to-tree diff 并明确列出 SHA,不用 merge-base 替代端点差异,不把增量 totals 加到完整 PR totals。没有旧报告、报告无效或身份不符时标注上一 head 未确认,不从全量推算或填零。两个 SHA 相同只报告 head 未变化;rebase 后仍比较原 head 和新 head 的树差异。sidecar 无效只使增量不可确认,不改变现有 full-PR 报告流程。
23
23
 
@@ -13,6 +13,7 @@ start_date: # Optional Issue field for Feature: YYYY-MM-DD
13
13
  target_date: # Optional Issue field for Feature: YYYY-MM-DD
14
14
  current_step: requirement-analysis # requirement-analysis | requirement-analysis-review | technical-design | technical-design-review | code | code-review | completed
15
15
  assigned_to: # claude | codex | antigravity | opencode | human
16
+ lifecycle_execution: '{"version":1,"open":[],"prReview":{"open":null,"terminals":[]}}'
16
17
  pr_delivery_fact: '{"version":2,"state":"unbound","reason":"initial"}'
17
18
  delivery_remote: origin # Git remote used to deliver the task branch
18
19
  delivery_base_ref: main # Target branch for the task PR
@@ -13,6 +13,7 @@ start_date: # Feature 可选 Issue 字段:YYYY-MM-DD
13
13
  target_date: # Feature 可选 Issue 字段:YYYY-MM-DD
14
14
  current_step: requirement-analysis # requirement-analysis | requirement-analysis-review | technical-design | technical-design-review | code | code-review | completed
15
15
  assigned_to: # claude | codex | antigravity | opencode | human
16
+ lifecycle_execution: '{"version":1,"open":[],"prReview":{"open":null,"terminals":[]}}'
16
17
  pr_delivery_fact: '{"version":2,"state":"unbound","reason":"initial"}'
17
18
  delivery_remote: origin # 任务分支交付使用的 Git remote
18
19
  delivery_base_ref: main # 任务 PR 的目标分支
@@ -30,30 +30,6 @@
30
30
  ]
31
31
  }
32
32
  ],
33
- "SubagentStart": [
34
- {
35
- "matcher": "agent-infra-lifecycle-(executor|reviewer)",
36
- "hooks": [
37
- {
38
- "type": "command",
39
- "command": "node \"$(git rev-parse --show-toplevel)/.agents/hooks/lifecycle-delegation.js\" --client claude-code",
40
- "timeout": 10
41
- }
42
- ]
43
- }
44
- ],
45
- "SubagentStop": [
46
- {
47
- "matcher": "agent-infra-lifecycle-(executor|reviewer)",
48
- "hooks": [
49
- {
50
- "type": "command",
51
- "command": "node \"$(git rev-parse --show-toplevel)/.agents/hooks/lifecycle-delegation.js\" --client claude-code",
52
- "timeout": 10
53
- }
54
- ]
55
- }
56
- ],
57
33
  "StopFailure": [
58
34
  {
59
35
  "matcher": "",
@@ -11,56 +11,6 @@
11
11
  "statusMessage": "Checking template version before git commit"
12
12
  }
13
13
  ]
14
- },
15
- {
16
- "matcher": "^collaborationspawn_agent$",
17
- "hooks": [
18
- {
19
- "type": "command",
20
- "command": "node \"$(git rev-parse --show-toplevel)/.agents/hooks/lifecycle-delegation.js\" --client codex --event pre-tool",
21
- "timeout": 30,
22
- "statusMessage": "Recording Codex lifecycle spawn evidence"
23
- }
24
- ]
25
- }
26
- ],
27
- "PostToolUse": [
28
- {
29
- "matcher": "",
30
- "hooks": [
31
- {
32
- "type": "command",
33
- "command": "node \"$(git rev-parse --show-toplevel)/.agents/hooks/lifecycle-delegation.js\" --client codex --event post-tool",
34
- "timeout": 30,
35
- "statusMessage": "Recording Codex lifecycle tool completion"
36
- }
37
- ]
38
- }
39
- ],
40
- "SubagentStart": [
41
- {
42
- "matcher": "",
43
- "hooks": [
44
- {
45
- "type": "command",
46
- "command": "node \"$(git rev-parse --show-toplevel)/.agents/hooks/lifecycle-delegation.js\" --client codex --event subagent-start",
47
- "timeout": 30,
48
- "statusMessage": "Recording Codex child identity"
49
- }
50
- ]
51
- }
52
- ],
53
- "SubagentStop": [
54
- {
55
- "matcher": "",
56
- "hooks": [
57
- {
58
- "type": "command",
59
- "command": "node \"$(git rev-parse --show-toplevel)/.agents/hooks/lifecycle-delegation.js\" --client codex --event subagent-stop",
60
- "timeout": 30,
61
- "statusMessage": "Recording Codex child stop evidence"
62
- }
63
- ]
64
14
  }
65
15
  ]
66
16
  }