@fitlab-ai/agent-infra 0.9.14 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/README.md +10 -0
  2. package/README.zh-CN.md +10 -0
  3. package/bin/internal-cli.sh +45 -0
  4. package/dist/bin/internal-cli.js +93 -30
  5. package/dist/lib/agent-clients/adapters/codex-lifecycle/capability-store.js +165 -27
  6. package/dist/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.js +9 -4
  7. package/dist/lib/agent-clients/adapters/codex-lifecycle/store.js +43 -3
  8. package/dist/lib/defaults.json +103 -103
  9. package/dist/lib/fs/durable-write.js +39 -0
  10. package/dist/lib/fs/file-lock.js +111 -0
  11. package/dist/lib/host-control/audit.js +19 -0
  12. package/dist/lib/host-control/client.js +142 -0
  13. package/dist/lib/host-control/command.js +49 -0
  14. package/dist/lib/host-control/path.js +160 -0
  15. package/dist/lib/host-control/secure-fs.js +140 -0
  16. package/dist/lib/host-control/server.js +159 -0
  17. package/dist/lib/host-control/service.js +112 -0
  18. package/dist/lib/init.js +11 -2
  19. package/dist/lib/internal/cli-route-inventory.js +4 -2
  20. package/dist/lib/internal/codex-lifecycle.js +6 -6
  21. package/dist/lib/internal/demo-promotion.js +322 -0
  22. package/dist/lib/internal/demo-transcript.js +454 -0
  23. package/dist/lib/internal/host-control.js +28 -0
  24. package/dist/lib/internal/manual-validation.js +331 -0
  25. package/dist/lib/internal/platform-pr.js +18 -4
  26. package/dist/lib/internal/release-workflow.js +63 -84
  27. package/dist/lib/internal/sandbox-control.js +149 -2
  28. package/dist/lib/internal/task-artifact.js +16 -263
  29. package/dist/lib/internal/task-create.js +6 -5
  30. package/dist/lib/internal/task-event.js +37 -37
  31. package/dist/lib/internal/task-lifecycle.js +2 -2
  32. package/dist/lib/internal/task-operation-registry.js +101 -4
  33. package/dist/lib/internal/task-review.js +11 -56
  34. package/dist/lib/internal/task-validate.js +30 -10
  35. package/dist/lib/owned-path.js +33 -0
  36. package/dist/lib/platform/check-status.js +11 -0
  37. package/dist/lib/platform/comment-safety.js +4 -1
  38. package/dist/lib/platform/completion-backfill.js +1 -1
  39. package/dist/lib/platform/github-data.js +241 -0
  40. package/dist/lib/platform/github-provider.js +15 -20
  41. package/dist/lib/platform/issue-comments.js +18 -12
  42. package/dist/lib/platform/issues.js +2 -180
  43. package/dist/lib/platform/pr-change-report.js +5 -4
  44. package/dist/lib/platform/pr-checks.js +12 -65
  45. package/dist/lib/platform/pr-summary.js +117 -33
  46. package/dist/lib/platform/pull-requests.js +5 -108
  47. package/dist/lib/platform/snapshots.js +2 -0
  48. package/dist/lib/platform/task-identities.js +2 -9
  49. package/dist/lib/platform/verification-sync.js +132 -143
  50. package/dist/lib/pr-review/evidence-grading.js +4 -8
  51. package/dist/lib/release/workflow.js +1 -1
  52. package/dist/lib/sandbox/commands/create.js +7 -2
  53. package/dist/lib/sandbox/commands/rm.js +19 -1511
  54. package/dist/lib/sandbox/control/audit.js +203 -0
  55. package/dist/lib/sandbox/control/client.js +93 -54
  56. package/dist/lib/sandbox/control/executor.js +129 -65
  57. package/dist/lib/sandbox/control/finalization-response.js +27 -0
  58. package/dist/lib/sandbox/control/identity-sentinel.js +107 -0
  59. package/dist/lib/sandbox/control/lifecycle.js +36 -2
  60. package/dist/lib/sandbox/control/native-file-lock.js +6 -98
  61. package/dist/lib/sandbox/control/protocol.js +55 -4
  62. package/dist/lib/sandbox/control/server.js +518 -127
  63. package/dist/lib/sandbox/control/state.js +64 -0
  64. package/dist/lib/sandbox/control/task-workflow.js +74 -0
  65. package/dist/lib/sandbox/control/workflow-executor.js +89 -0
  66. package/dist/lib/sandbox/index.js +1 -2
  67. package/dist/lib/sandbox/recovery.js +28 -4
  68. package/dist/lib/sandbox/removal.js +822 -0
  69. package/dist/lib/sandbox/task-cleanup.js +217 -0
  70. package/dist/lib/sandbox/workspace-identity.js +17 -1
  71. package/dist/lib/sandbox/workspace-view.js +13 -14
  72. package/dist/lib/task/activity-intent.js +2 -1
  73. package/dist/lib/task/activity-log.js +30 -24
  74. package/dist/lib/task/artifact-command.js +79 -0
  75. package/dist/lib/task/artifact-lifecycle.js +30 -28
  76. package/dist/lib/task/artifact-name.js +36 -0
  77. package/dist/lib/task/artifact-operations.js +29 -289
  78. package/dist/lib/task/artifact-receipts.js +3 -15
  79. package/dist/lib/task/artifact-recovery.js +430 -0
  80. package/dist/lib/task/artifact-repair-intent.js +134 -29
  81. package/dist/lib/task/artifact-schema.js +6 -14
  82. package/dist/lib/task/capabilities.js +12 -19
  83. package/dist/lib/task/codex-orchestration.js +71 -25
  84. package/dist/lib/task/commit-identity.js +28 -0
  85. package/dist/lib/task/commit-operation.js +33 -20
  86. package/dist/lib/task/control-authority.js +403 -6
  87. package/dist/lib/task/control-recovery.js +140 -0
  88. package/dist/lib/task/create-service.js +1 -8
  89. package/dist/lib/task/create.js +62 -9
  90. package/dist/lib/task/decision-details.js +2 -46
  91. package/dist/lib/task/delegation-receipts.js +64 -3
  92. package/dist/lib/task/events.js +275 -22
  93. package/dist/lib/task/finalization-state.js +9 -0
  94. package/dist/lib/task/human-override.js +8 -14
  95. package/dist/lib/task/implementation-inputs.js +3 -3
  96. package/dist/lib/task/intermediate-cleanup.js +441 -0
  97. package/dist/lib/task/invalidation.js +18 -65
  98. package/dist/lib/task/ledger-intents.js +7 -22
  99. package/dist/lib/task/ledger.js +1 -3
  100. package/dist/lib/task/lifecycle-recovery.js +549 -0
  101. package/dist/lib/task/lifecycle.js +31 -4
  102. package/dist/lib/task/local-artifact-finalization.js +197 -197
  103. package/dist/lib/task/manual-validation-completion.js +26 -0
  104. package/dist/lib/task/manual-validation-evidence.js +130 -0
  105. package/dist/lib/task/manual-validation-receipt.js +105 -0
  106. package/dist/lib/task/manual-validation-shared.js +40 -0
  107. package/dist/lib/task/manual-validation-transaction.js +243 -0
  108. package/dist/lib/task/markdown.js +47 -0
  109. package/dist/lib/task/orchestration.js +66 -19
  110. package/dist/lib/task/pr-delivery-fact.js +12 -56
  111. package/dist/lib/task/qualification-audit.js +20 -34
  112. package/dist/lib/task/recovery-warning.js +19 -0
  113. package/dist/lib/task/review-artifacts.js +2 -18
  114. package/dist/lib/task/review-command.js +26 -0
  115. package/dist/lib/task/review-finalization.js +175 -216
  116. package/dist/lib/task/review-fingerprint.js +2 -2
  117. package/dist/lib/task/sections.js +34 -56
  118. package/dist/lib/task/short-id.js +15 -7
  119. package/dist/lib/task/task-execution-lock.js +1 -1
  120. package/dist/lib/task/verification-engine.js +119 -337
  121. package/dist/lib/task/verification.js +1 -1
  122. package/dist/lib/task/workflow-command.js +16 -0
  123. package/dist/lib/task/workflow-warning-intents.js +0 -16
  124. package/dist/lib/task/workflow-warnings.js +28 -2
  125. package/dist/lib/update.js +2 -0
  126. package/dist/lib/version.js +1 -11
  127. package/dist/lifecycle-build-manifest.json +3 -3
  128. package/lib/agent-clients/adapters/codex-lifecycle/capability-store.ts +223 -33
  129. package/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.ts +10 -4
  130. package/lib/agent-clients/adapters/codex-lifecycle/store.ts +55 -3
  131. package/lib/fs/durable-write.ts +30 -0
  132. package/lib/fs/file-lock.ts +113 -0
  133. package/lib/host-control/audit.ts +22 -0
  134. package/lib/host-control/client.ts +172 -0
  135. package/lib/host-control/command.ts +60 -0
  136. package/lib/host-control/path.ts +167 -0
  137. package/lib/host-control/secure-fs.ts +135 -0
  138. package/lib/host-control/server.ts +180 -0
  139. package/lib/host-control/service.ts +133 -0
  140. package/lib/init.ts +15 -2
  141. package/lib/internal/cli-route-inventory.ts +4 -2
  142. package/lib/internal/codex-lifecycle.ts +6 -6
  143. package/lib/internal/demo-promotion.ts +354 -0
  144. package/lib/internal/demo-transcript.ts +419 -0
  145. package/lib/internal/host-control.ts +28 -0
  146. package/lib/internal/manual-validation.ts +315 -0
  147. package/lib/internal/platform-pr.ts +15 -4
  148. package/lib/internal/release-workflow.ts +74 -82
  149. package/lib/internal/sandbox-control.ts +162 -1
  150. package/lib/internal/task-artifact.ts +14 -217
  151. package/lib/internal/task-create.ts +5 -5
  152. package/lib/internal/task-event.ts +20 -11
  153. package/lib/internal/task-lifecycle.ts +4 -3
  154. package/lib/internal/task-operation-registry.ts +111 -4
  155. package/lib/internal/task-review.ts +9 -54
  156. package/lib/internal/task-validate.ts +26 -10
  157. package/lib/owned-path.ts +26 -0
  158. package/lib/platform/check-status.ts +9 -0
  159. package/lib/platform/comment-safety.ts +5 -0
  160. package/lib/platform/completion-backfill.ts +1 -1
  161. package/lib/platform/github-data.ts +322 -0
  162. package/lib/platform/github-provider.ts +15 -20
  163. package/lib/platform/issue-comments.ts +21 -14
  164. package/lib/platform/issues.ts +5 -246
  165. package/lib/platform/pr-change-report.ts +7 -5
  166. package/lib/platform/pr-checks.ts +13 -77
  167. package/lib/platform/pr-summary.ts +123 -35
  168. package/lib/platform/pull-requests.ts +6 -173
  169. package/lib/platform/snapshots.ts +53 -0
  170. package/lib/platform/task-identities.ts +3 -14
  171. package/lib/platform/verification-sync.ts +150 -156
  172. package/lib/pr-review/evidence-grading.ts +4 -9
  173. package/lib/release/workflow.ts +3 -3
  174. package/lib/sandbox/commands/create.ts +7 -6
  175. package/lib/sandbox/commands/rm.ts +21 -1895
  176. package/lib/sandbox/control/audit.ts +253 -0
  177. package/lib/sandbox/control/client.ts +109 -66
  178. package/lib/sandbox/control/executor.ts +134 -74
  179. package/lib/sandbox/control/finalization-response.ts +29 -0
  180. package/lib/sandbox/control/identity-sentinel.ts +137 -0
  181. package/lib/sandbox/control/lifecycle.ts +45 -3
  182. package/lib/sandbox/control/native-file-lock.ts +6 -107
  183. package/lib/sandbox/control/protocol.ts +80 -6
  184. package/lib/sandbox/control/server.ts +567 -132
  185. package/lib/sandbox/control/state.ts +86 -0
  186. package/lib/sandbox/control/task-workflow.ts +95 -0
  187. package/lib/sandbox/control/workflow-executor.ts +92 -0
  188. package/lib/sandbox/index.ts +1 -2
  189. package/lib/sandbox/recovery.ts +28 -5
  190. package/lib/sandbox/removal.ts +1142 -0
  191. package/lib/sandbox/task-cleanup.ts +209 -0
  192. package/lib/sandbox/workspace-identity.ts +19 -3
  193. package/lib/sandbox/workspace-view.ts +17 -15
  194. package/lib/task/activity-intent.ts +2 -2
  195. package/lib/task/activity-log.ts +27 -19
  196. package/lib/task/artifact-command.ts +85 -0
  197. package/lib/task/artifact-lifecycle.ts +31 -26
  198. package/lib/task/artifact-name.ts +55 -0
  199. package/lib/task/artifact-operations.ts +34 -310
  200. package/lib/task/artifact-receipts.ts +3 -14
  201. package/lib/task/artifact-recovery.ts +519 -0
  202. package/lib/task/artifact-repair-intent.ts +162 -33
  203. package/lib/task/artifact-schema.ts +5 -34
  204. package/lib/task/capabilities.ts +13 -22
  205. package/lib/task/codex-orchestration.ts +85 -24
  206. package/lib/task/commit-identity.ts +31 -0
  207. package/lib/task/commit-operation.ts +37 -20
  208. package/lib/task/control-authority.ts +540 -10
  209. package/lib/task/control-recovery.ts +186 -0
  210. package/lib/task/create-service.ts +1 -10
  211. package/lib/task/create.ts +63 -8
  212. package/lib/task/decision-details.ts +3 -71
  213. package/lib/task/delegation-receipts.ts +73 -2
  214. package/lib/task/events.ts +309 -24
  215. package/lib/task/finalization-state.ts +11 -0
  216. package/lib/task/human-override.ts +8 -16
  217. package/lib/task/implementation-inputs.ts +3 -3
  218. package/lib/task/intermediate-cleanup.ts +493 -0
  219. package/lib/task/invalidation.ts +18 -62
  220. package/lib/task/ledger-intents.ts +7 -24
  221. package/lib/task/ledger.ts +1 -3
  222. package/lib/task/lifecycle-recovery.ts +691 -0
  223. package/lib/task/lifecycle.ts +30 -5
  224. package/lib/task/local-artifact-finalization.ts +244 -234
  225. package/lib/task/manual-validation-completion.ts +40 -0
  226. package/lib/task/manual-validation-evidence.ts +209 -0
  227. package/lib/task/manual-validation-receipt.ts +156 -0
  228. package/lib/task/manual-validation-shared.ts +50 -0
  229. package/lib/task/manual-validation-transaction.ts +304 -0
  230. package/lib/task/markdown.ts +70 -0
  231. package/lib/task/orchestration.ts +84 -19
  232. package/lib/task/pr-delivery-fact.ts +15 -62
  233. package/lib/task/qualification-audit.ts +22 -33
  234. package/lib/task/recovery-warning.ts +21 -0
  235. package/lib/task/review-artifacts.ts +1 -20
  236. package/lib/task/review-command.ts +24 -0
  237. package/lib/task/review-finalization.ts +183 -292
  238. package/lib/task/review-fingerprint.ts +2 -2
  239. package/lib/task/sections.ts +33 -54
  240. package/lib/task/short-id.ts +27 -5
  241. package/lib/task/task-execution-lock.ts +1 -1
  242. package/lib/task/verification-engine.ts +113 -383
  243. package/lib/task/verification-types.ts +15 -0
  244. package/lib/task/verification.ts +1 -1
  245. package/lib/task/workflow-command.ts +17 -0
  246. package/lib/task/workflow-warning-intents.ts +0 -13
  247. package/lib/task/workflow-warnings.ts +21 -2
  248. package/lib/update.ts +6 -0
  249. package/lib/version.ts +1 -15
  250. package/package.json +6 -6
  251. package/templates/.agents/hooks/lifecycle-delegation.js +6 -6
  252. package/templates/.agents/rules/create-issue.en.md +1 -1
  253. package/templates/.agents/rules/create-issue.zh-CN.md +1 -1
  254. package/templates/.agents/rules/issue-sync.en.md +4 -2
  255. package/templates/.agents/rules/issue-sync.zh-CN.md +4 -3
  256. package/templates/.agents/rules/local-artifact-repair.en.md +46 -39
  257. package/templates/.agents/rules/local-artifact-repair.zh-CN.md +43 -36
  258. package/templates/.agents/rules/testing-discipline.en.md +2 -0
  259. package/templates/.agents/rules/testing-discipline.zh-CN.md +2 -0
  260. package/templates/.agents/scripts/package.json +3 -0
  261. package/templates/.agents/skills/analyze-task/SKILL.en.md +6 -6
  262. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +6 -6
  263. package/templates/.agents/skills/analyze-task/config/verify.en.json +1 -1
  264. package/templates/.agents/skills/analyze-task/config/verify.zh-CN.json +1 -1
  265. package/templates/.agents/skills/block-task/SKILL.en.md +2 -2
  266. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +2 -2
  267. package/templates/.agents/skills/block-task/config/verify.json +1 -1
  268. package/templates/.agents/skills/cancel-task/SKILL.en.md +3 -3
  269. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +3 -3
  270. package/templates/.agents/skills/cancel-task/config/verify.json +1 -1
  271. package/templates/.agents/skills/code-task/SKILL.en.md +7 -7
  272. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +7 -7
  273. package/templates/.agents/skills/code-task/config/verify.en.json +1 -1
  274. package/templates/.agents/skills/code-task/config/verify.zh-CN.json +1 -1
  275. package/templates/.agents/skills/commit/reference/issue-metadata-sync.en.md +1 -1
  276. package/templates/.agents/skills/commit/reference/issue-metadata-sync.zh-CN.md +1 -1
  277. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +33 -21
  278. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +33 -21
  279. package/templates/.agents/skills/complete-manual-validation/config/verify.en.json +1 -1
  280. package/templates/.agents/skills/complete-manual-validation/config/verify.zh-CN.json +1 -1
  281. package/templates/.agents/skills/complete-manual-validation/reference/report-template.en.md +2 -0
  282. package/templates/.agents/skills/complete-manual-validation/reference/report-template.zh-CN.md +2 -0
  283. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +16 -7
  284. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +16 -7
  285. package/templates/.agents/skills/complete-task/SKILL.en.md +3 -3
  286. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +3 -3
  287. package/templates/.agents/skills/complete-task/config/verify.en.json +2 -2
  288. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +2 -2
  289. package/templates/.agents/skills/complete-task/reference/external-delivery.en.md +1 -1
  290. package/templates/.agents/skills/complete-task/reference/external-delivery.zh-CN.md +1 -1
  291. package/templates/.agents/skills/create-pr/SKILL.en.md +2 -2
  292. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +2 -2
  293. package/templates/.agents/skills/create-pr/config/verify.json +1 -1
  294. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +2 -2
  295. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +2 -2
  296. package/templates/.agents/skills/create-task/SKILL.en.md +5 -5
  297. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +5 -5
  298. package/templates/.agents/skills/create-task/config/verify.json +1 -1
  299. package/templates/.agents/skills/import-issue/SKILL.en.md +8 -8
  300. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +8 -8
  301. package/templates/.agents/skills/import-issue/config/verify.json +2 -2
  302. package/templates/.agents/skills/plan-task/SKILL.en.md +4 -4
  303. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +4 -4
  304. package/templates/.agents/skills/plan-task/config/verify.en.json +1 -1
  305. package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +1 -1
  306. package/templates/.agents/skills/release/SKILL.en.md +7 -3
  307. package/templates/.agents/skills/release/SKILL.zh-CN.md +7 -3
  308. package/templates/.agents/skills/restore-task/SKILL.en.md +2 -2
  309. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +2 -2
  310. package/templates/.agents/skills/restore-task/config/verify.json +1 -1
  311. package/templates/.agents/skills/review-analysis/SKILL.en.md +2 -2
  312. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +2 -2
  313. package/templates/.agents/skills/review-analysis/config/verify.en.json +1 -1
  314. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +1 -1
  315. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +7 -7
  316. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +6 -6
  317. package/templates/.agents/skills/review-code/SKILL.en.md +2 -2
  318. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +2 -2
  319. package/templates/.agents/skills/review-code/config/verify.en.json +1 -1
  320. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -1
  321. package/templates/.agents/skills/review-code/reference/report-template.en.md +12 -12
  322. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +12 -12
  323. package/templates/.agents/skills/review-plan/SKILL.en.md +2 -2
  324. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +2 -2
  325. package/templates/.agents/skills/review-plan/config/verify.en.json +1 -1
  326. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +1 -1
  327. package/templates/.agents/skills/review-plan/reference/report-template.en.md +7 -7
  328. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +7 -7
  329. package/templates/.agents/skills/review-pr/config/verify.en.json +1 -1
  330. package/templates/.agents/skills/review-pr/config/verify.zh-CN.json +1 -1
  331. package/templates/.agents/skills/review-pr/reference/evidence-grading.en.md +3 -3
  332. package/templates/.agents/skills/review-pr/reference/evidence-grading.zh-CN.md +3 -3
  333. package/templates/.agents/skills/run-manual-validation/SKILL.en.md +20 -3
  334. package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +20 -3
  335. package/templates/.agents/skills/run-manual-validation/config/verify.en.json +1 -1
  336. package/templates/.agents/skills/run-manual-validation/config/verify.zh-CN.json +1 -1
  337. package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.en.md +4 -1
  338. package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.zh-CN.md +4 -1
  339. package/templates/.agents/skills/run-manual-validation/reference/report-template.en.md +2 -0
  340. package/templates/.agents/skills/run-manual-validation/reference/report-template.zh-CN.md +2 -0
  341. package/templates/.agents/skills/run-task/SKILL.en.md +1 -1
  342. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +1 -1
  343. package/templates/.agents/skills/test/SKILL.en.md +17 -6
  344. package/templates/.agents/skills/test/SKILL.zh-CN.md +17 -6
  345. package/templates/.agents/templates/task.en.md +1 -1
  346. package/templates/.agents/templates/task.zh-CN.md +1 -1
  347. package/templates/.claude/commands/import-issue.en.md +1 -1
  348. package/templates/.claude/commands/import-issue.zh-CN.md +1 -1
  349. package/templates/.claude/commands/restore-task.en.md +1 -1
  350. package/templates/.claude/commands/restore-task.zh-CN.md +1 -1
  351. package/templates/.claude/commands/run-manual-validation.en.md +1 -1
  352. package/templates/.claude/commands/run-manual-validation.zh-CN.md +1 -1
  353. package/dist/lib/platform/adapters.js +0 -56
  354. package/lib/platform/adapters.ts +0 -197
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -72,7 +72,7 @@ Read `task.md` carefully to understand:
72
72
  - currently known affected files and constraints
73
73
 
74
74
  If `task.md` contains these source fields, also read the corresponding source information:
75
- - `issue_number` - Issue
75
+ - `platform_issue_identity` - canonical Issue identity
76
76
  - `codescan_alert_number` - Code Scanning alert
77
77
  - `security_alert_number` - Dependabot alert
78
78
 
@@ -114,7 +114,7 @@ Runs after Step 0 state check and Step 3 (questioning is an external-state actio
114
114
  - if a `pending_question` already exists (the previous question is still unanswered) → restate that `pending_question`, do **not** modify it and do **not** increment `question_count`;
115
115
  - otherwise (no pending question) → pick the single highest-value question (acceptance criteria > scope > ambiguity) and write `## Brainstorming`: `status: asking`, `pending_question: <question>`, `question_count += 1`.
116
116
  2. If `start_date` is empty, write today (`date +%F`), then run `agent-infra-internal task-event {task-id} analyze.awaiting-input --agent {standard-agent-token} --question {question_count}` so the core updates base metadata and Activity Log.
117
- 3. Issue sync (when `issue_number` exists, skip on any failure): run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}` to update only the **task comment**; keep the `status` label at `pending-design-work`; do **not** publish an analysis artifact comment.
117
+ 3. Issue sync (when a valid `platform_issue_identity` exists, skip on any failure): run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}` to update only the **task comment**; keep the `status` label at `pending-design-work`; do **not** publish an analysis artifact comment.
118
118
  4. Verification (replaces the step 8 artifact gate): `agent-infra-internal task-verify {task-id} analyze.awaiting-input --format text` (the early-exit set `current_step: requirement-analysis` and wrote `start_date`, so it should pass); also keep `rg -n 'Analyze Task \(Brainstorming\)' .agents/workspace/active/{task-id}/task.md` and the task-comment sync evidence. Do **not** run the artifact gate, nor `check activity-log` / `check platform-sync` (both bind to the analysis artifact path).
119
119
  5. User output: show only the current **single question** plus how to answer/continue (re-trigger `analyze-task {task-ref}` with the answer), and append the `Completed at` line per `.agents/rules/next-step-output.md`.
120
120
  6. **STOP** and wait for the answer. The next trigger returns to this step.
@@ -140,7 +140,7 @@ Before writing this round's `{analysis-artifact}`, create the controlled report
140
140
  agent-infra-internal task-artifact {task-id} init --family analysis --artifact {analysis-artifact} --locale en
141
141
  ```
142
142
 
143
- The skeleton contains identity metadata, stable section markers, and required headings only; real analysis content is required before the completion gate can pass. If the finalizer returns one provably safe structural error, call `task-artifact {task-id} repair --family analysis --artifact {analysis-artifact} --expected-sha256 {artifact-sha256} --expected-semantic-digest {semantic-digest}`, then rerun the same finalizer.
143
+ The skeleton contains identity metadata, stable section markers, and required headings only; real analysis content is required before the completion gate can pass. If the finalizer returns one provably safe structural error, it returns a controlled recovery candidate; edit only its `candidatePath`, then rerun `task-artifact {task-id} finalize-local --family analysis --artifact {analysis-artifact} --recovery-id {recovery-id}` with the same `recoveryId`. Candidate-only is a protocol authorization boundary, not OS isolation; arbitrary same-UID host writers are outside the protocol's protection claim, and fingerprint/state checks fail closed on anomalies.
144
144
 
145
145
  > Steps 6–9 are the **Scenario A (normal output)** path. **Scenario B (ask and early-exit)** already finished its state update, task-comment sync, and verification inside step 4 and STOPped, so it does not enter these steps.
146
146
 
@@ -223,14 +223,14 @@ agent-infra-internal task-artifact {task-id} finalize-local --family analysis --
223
223
  ```
224
224
 
225
225
  - On `status=passed`, save that result's `artifactSha256` and `semanticDigest`; the finalizer has recorded the matching one-shot local provenance intent.
226
- - On `status=failed` with `repairable=true`, apply only the diagnostic's `replace-line` operation once, then rerun the same command completely; count an attempt only after bytes change, up to 8 attempts.
227
- - The first repairable failure's `semanticDigest` is retained as the baseline; a retried `status=passed` result must match it. On baseline mismatch, any other failure, no progress, or a repeated diagnostic, stop without publishing a completed event.
226
+ - On `status=failed` with recovery context, edit only the returned `candidatePath` once after the completion gates pass, then rerun the finalizer completely with the same `recoveryId`; the formal artifact must remain unchanged until commit.
227
+ - The recovery candidate must match the recorded task, round, artifact, baseline, and request identity. On baseline conflict, unknown state, no progress, or repeated failure, stop without publishing a completed event.
228
228
 
229
229
  Use the digests from that same `status=passed` result in `agent-infra-internal task-event {task-id} analyze.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {analysis-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} {execution-flag}` so the core records the link, stage, agent, metadata, and Activity Log atomically.
230
230
  - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Analyze Task (Round {N})** by {agent} — Analysis completed → {analysis-artifact}
231
231
  ```
232
232
 
233
- If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
233
+ If task.md contains a valid `platform_issue_identity`, perform these sync actions (skip and continue on any failure):
234
234
  - Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status pending-design-work --fields`
235
235
  - Run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
236
236
  - Run `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {analysis-artifact} --agent {standard-agent-token}`
@@ -75,7 +75,7 @@ agent-infra-internal task-event {task-id} analyze.started --agent {standard-agen
75
75
  - 当前已知的受影响文件和约束
76
76
 
77
77
  如 `task.md` 包含以下来源字段,补充读取对应来源信息:
78
- - `issue_number` - Issue
78
+ - `platform_issue_identity` - Issue 的 canonical identity
79
79
  - `codescan_alert_number` - Code Scanning 告警
80
80
  - `security_alert_number` - Dependabot 告警
81
81
 
@@ -117,7 +117,7 @@ agent-infra-internal task-event {task-id} analyze.started --agent {standard-agen
117
117
  - 若已存在 `pending_question`(上一问尚未得到答案)→ 复述该 `pending_question`,**不**修改它、**不**增加 `question_count`;
118
118
  - 否则(无待答问题)→ 选最高价值的一个问题(验收标准 > 范围 > 歧义),写入 `## Brainstorming`:`status: asking`、`pending_question: <问题>`、`question_count += 1`。
119
119
  2. 若 `start_date` 为空,写入当日日期(`date +%F`);随后执行 `agent-infra-internal task-event {task-id} analyze.awaiting-input --agent {standard-agent-token} --question {question_count}`,由核心统一更新基础 frontmatter 和 Activity Log。
120
- 3. Issue 同步(存在 `issue_number` 时,任一失败跳过):调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}` 更新 **task 评论**;`status` label 维持 `pending-design-work`;**不**发布分析产物评论。
120
+ 3. Issue 同步(存在有效 `platform_issue_identity` 时,任一失败跳过):调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}` 更新 **task 评论**;`status` label 维持 `pending-design-work`;**不**发布分析产物评论。
121
121
  4. 校验(替代步骤 8 的 artifact gate):`agent-infra-internal task-verify {task-id} analyze.awaiting-input --format text`(早退已置 `current_step: requirement-analysis` 且已写入 `start_date`,预期通过);并保留 `rg -n 'Analyze Task \(Brainstorming\)' .agents/workspace/active/{task-id}/task.md` 与 task 评论同步证据。**不**跑 artifact gate,也不跑 `check activity-log` / `check platform-sync`(二者绑定分析产物路径)。
122
122
  5. 用户输出:只展示当前**单个问题** + 如何回答/继续(再次触发 `analyze-task {task-ref}` 并附答案),并按 `.agents/rules/next-step-output.md` 在末行追加 `Completed at`。
123
123
  6. **STOP**,等待回答。下一次触发回到本步骤。
@@ -143,7 +143,7 @@ agent-infra-internal task-event {task-id} analyze.started --agent {standard-agen
143
143
  agent-infra-internal task-artifact {task-id} init --family analysis --artifact {analysis-artifact}
144
144
  ```
145
145
 
146
- 骨架只包含身份元数据、稳定 section marker 和必需标题;必须填入真实分析内容后才能通过完成门禁。finalizer 返回可证明的单个结构错误时,使用其 SHA 和 semantic digest 调用 `task-artifact {task-id} repair --family analysis --artifact {analysis-artifact} --expected-sha256 {artifact-sha256} --expected-semantic-digest {semantic-digest}`,然后完整重跑 finalizer。
146
+ 骨架只包含身份元数据、稳定 section marker 和必需标题;必须填入真实分析内容后才能通过完成门禁。finalizer 返回可证明的单个结构错误时,会返回受控 recovery candidate;只能编辑返回的 `candidatePath`,然后使用同一个 `recoveryId` 重跑 `task-artifact {task-id} finalize-local --family analysis --artifact {analysis-artifact} --recovery-id {recovery-id}`。candidate-only 是协议授权边界,不是操作系统隔离;同 UID 的任意宿主写入者不在本协议的防护承诺内,异常由指纹/状态校验失败关闭。
147
147
 
148
148
  > 步骤 6–9 属**场景 A(正常产出)**路径。**场景 B(提问早退)**已在步骤 4 内完成状态更新、task 评论同步与校验并 STOP,不进入这些步骤。
149
149
 
@@ -226,11 +226,11 @@ agent-infra-internal task-artifact {task-id} init --family analysis --artifact {
226
226
  agent-infra-internal task-artifact {task-id} finalize-local --family analysis --artifact {analysis-artifact}
227
227
  ```
228
228
  - `status=passed`:保存本次返回的 `artifactSha256` 和 `semanticDigest`;finalizer 已记录对应的一次性本地 provenance intent。
229
- - `status=failed` 且 `repairable=true`:仅按诊断中的 `replace-line` 操作做一次最小修改,然后完整重跑同一命令;实际字节发生变化才计一次 `repairAttempts`,最多 8 次。
230
- - 首次可修复失败的 `semanticDigest` 由 finalizer 保留为基线;重试后的 `status=passed` 必须匹配该基线。基线不匹配、其他失败、无进展或重复诊断:停止,不发布 completed 事件。
229
+ - `status=failed` 且返回 recovery context:完成门禁通过后,只编辑返回的 `candidatePath` 一次,然后使用同一个 `recoveryId` 完整重跑 finalizer;formal artifact 在 commit 前必须保持不变。
230
+ - recovery candidate 必须与记录的任务、轮次、产物、baseline 和 request identity 匹配;基线冲突、未知状态、无进展或重复失败:停止,不发布 completed 事件。
231
231
  - 使用同一次 `status=passed` 返回的摘要执行 `agent-infra-internal task-event {task-id} analyze.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {analysis-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} {execution-flag}`,由核心登记链接、阶段、代理、时间、版本和 Activity Log。
232
232
 
233
- 如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
233
+ 如果 task.md 中存在有效的 `platform_issue_identity`,执行以下同步操作(任一失败则跳过并继续):
234
234
  - 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status pending-design-work --fields`
235
235
  - 调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
236
236
  - 调用 `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {analysis-artifact} --agent {standard-agent-token}`
@@ -24,7 +24,7 @@
24
24
  "expected_action_pattern": "(Analyze Task|Requirement Analysis) \\(Round \\d+\\)"
25
25
  },
26
26
  "platform-sync": {
27
- "when": "issue_number_exists",
27
+ "when": "platform_issue_identity_exists",
28
28
  "expected_status_label": "status: pending-design-work",
29
29
  "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
30
30
  "verify_comment_content": true,
@@ -24,7 +24,7 @@
24
24
  "expected_action_pattern": "(Analyze Task|Requirement Analysis) \\(Round \\d+\\)"
25
25
  },
26
26
  "platform-sync": {
27
- "when": "issue_number_exists",
27
+ "when": "platform_issue_identity_exists",
28
28
  "expected_status_label": "status: pending-design-work",
29
29
  "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
30
30
  "verify_comment_content": true,
@@ -73,9 +73,9 @@ ls .agents/workspace/blocked/{task-id}/task.md
73
73
 
74
74
  ### 6. Sync to Issue (Optional)
75
75
 
76
- Check whether `task.md` includes a valid `issue_number`. If not, skip this step.
76
+ Check whether `task.md` includes a valid `platform_issue_identity`. If not, skip this step.
77
77
 
78
- If a valid `issue_number` exists, run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status blocked`.
78
+ If a valid `platform_issue_identity` exists, run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status blocked`.
79
79
  Then run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`.
80
80
 
81
81
  ### 7. Verification Gate
@@ -74,9 +74,9 @@ ls .agents/workspace/blocked/{task-id}/task.md
74
74
 
75
75
  ### 6. 同步到 Issue(可选)
76
76
 
77
- 检查 `task.md` 中是否存在有效的 `issue_number`。如果没有,跳过。
77
+ 检查 `task.md` 中是否存在有效的 `platform_issue_identity`。如果没有,跳过。
78
78
 
79
- 如果存在有效的 `issue_number`,调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status blocked`。
79
+ 如果存在有效的 `platform_issue_identity`,调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status blocked`。
80
80
  随后调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}` 更新 task 评论。
81
81
 
82
82
  ### 7. 完成校验
@@ -21,7 +21,7 @@
21
21
  "expected_action_pattern": "(Block Task|Blocked)"
22
22
  },
23
23
  "platform-sync": {
24
- "when": "issue_number_exists",
24
+ "when": "platform_issue_identity_exists",
25
25
  "expected_status_label": "status: blocked",
26
26
  "expected_status_label_key": "blocked"
27
27
  }
@@ -14,7 +14,7 @@ description: >
14
14
 
15
15
  - This command terminates a task that no longer needs to continue and moves it into `completed/`
16
16
  - Cancel only when the task no longer needs implementation, review, or follow-up work
17
- - When a valid `issue_number` exists, Issue sync is required
17
+ - When a valid `platform_issue_identity` exists, Issue sync is required
18
18
 
19
19
  Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
20
20
 
@@ -74,9 +74,9 @@ Confirm the task directory was moved successfully.
74
74
 
75
75
  ### 6. Sync to Issue
76
76
 
77
- Check whether `task.md` contains a valid `issue_number`. If not, skip this step.
77
+ Check whether `task.md` contains a valid `platform_issue_identity`. If not, skip this step.
78
78
 
79
- If a valid `issue_number` exists:
79
+ If a valid `platform_issue_identity` exists:
80
80
  - Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status {reason} --in-labels none --assignees none --milestone none --state closed --close-reason not_planned`
81
81
  - Write the cancellation body to a temporary file and run `agent-infra-internal platform-comment sync {task-id} --kind cancel --body-file {path} --agent {standard-agent-token}`
82
82
  - Run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
@@ -14,7 +14,7 @@ description: >
14
14
 
15
15
  - 本命令用于终止一个不再需要继续执行的任务,并转移到 `completed/`
16
16
  - 只有在确认该任务无需继续实现、审查或修复时才可取消
17
- - 有效 `issue_number` 存在时,Issue 同步属于必做项
17
+ - 有效 `platform_issue_identity` 存在时,Issue 同步属于必做项
18
18
 
19
19
  版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
20
20
 
@@ -73,9 +73,9 @@ ls .agents/workspace/completed/{task-id}/task.md
73
73
 
74
74
  ### 6. 同步到 Issue
75
75
 
76
- 检查 `task.md` 中是否存在有效的 `issue_number`。如果没有,跳过此步骤。
76
+ 检查 `task.md` 中是否存在有效的 `platform_issue_identity`。如果没有,跳过此步骤。
77
77
 
78
- 如果存在有效的 `issue_number`:
78
+ 如果存在有效的 `platform_issue_identity`:
79
79
  - 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status {reason} --in-labels none --assignees none --milestone none --state closed --close-reason not_planned`
80
80
  - 将取消正文写入临时文件,调用 `agent-infra-internal platform-comment sync {task-id} --kind cancel --body-file {path} --agent {standard-agent-token}`
81
81
  - 调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
@@ -22,7 +22,7 @@
22
22
  "expected_action_pattern": "(Cancel Task|Cancelled)"
23
23
  },
24
24
  "platform-sync": {
25
- "when": "issue_number_exists",
25
+ "when": "platform_issue_identity_exists",
26
26
  "expected_comment_marker": "<!-- sync-issue:{task-id}:cancel -->",
27
27
  "verify_task_comment_content": true,
28
28
  "expected_comment_marker_key": "cancel"
@@ -24,7 +24,7 @@ Before generating the implementation report, read `.agents/rules/evidence-report
24
24
  - Before generating task or lifecycle Markdown that will be synchronized to an Issue, read `.agents/rules/sync-content-generation.md` and apply its producer-side constraints; the sync path does not parse or rewrite the body
25
25
  - Read `.agents/rules/compatibility-policy.md` before implementation. Implement only the compatibility budget explicitly approved by the plan; never retain old branches, result contracts, or migration shims merely to be “safe”
26
26
  - Fix mode verifies each finding of the latest `review-code` one by one: fix it if it holds, or rebut it and record it under unresolved if it is unfounded/hallucinated; do not expand to issues the review did not list; manual-validation items are out of scope
27
- - Before `code.completed`, the implementation report must pass `task-artifact ... finalize-local --family code`; follow `.agents/rules/local-artifact-repair.md` for any provably safe minimal structural repair in that same report, and pass only that successful call's digests to the completion event
27
+ - Before `code.completed`, the implementation report must pass `task-artifact ... finalize-local --family code`; follow `.agents/rules/local-artifact-repair.md` for controlled recovery candidates in that same report, and pass only that successful call's digests to the completion event
28
28
  - If implementation encounters a key design decision not covered by the plan, run `agent-infra-internal task-ledger {task-id} decision-next-id`, write the returned `HD-N` detail block per `.agents/rules/human-decision-context.md` and determine whether implementation is required, then run `decision-upsert --id {HD-N} --stage code --artifact {code-artifact} --needs-implementation {true|false}`. Do not scan ids, assemble ledger rows, ask mid-flow, or silently expand scope
29
29
  - Do not invoke the `commit` skill or push to a remote; after tests pass, call the shared commit core with `delivery: { mode: 'local' }` to create the local checkpoint. The durable intent must close only after the checkpoint and task state sync succeed; only then emit `code.completed`
30
30
  - Create a new code artifact for each round and never overwrite an older one
@@ -64,7 +64,7 @@ Read `reference/branch-management.md`, ensure the current branch matches the tas
64
64
 
65
65
  ### 3. Narrow the Milestone
66
66
 
67
- **Mandatory; do not skip.** If task.md has a valid `issue_number`, run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --milestone specific`.
67
+ **Mandatory; do not skip.** If task.md has a valid `platform_issue_identity`, run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --milestone specific`.
68
68
 
69
69
  > If the milestone remains `X.Y.x`, step 12 `task-verify code.completed` blocks through the typed milestone check.
70
70
 
@@ -112,7 +112,7 @@ When triaging a test failure or unexpected behavior, first read `.agents/rules/d
112
112
 
113
113
  After tests pass, call the shared commit core with `agent-infra-internal git-workflow commit --input {checkpoint-input}`. Pass `delivery: { "mode": "local" }`, explicit paths, expected HEAD/tree, task ref, agent, and the code round. This creates only a local checkpoint and does not contact a remote. The core writes a durable intent before committing and removes it after task-writer synchronization; do not emit `code.completed` if either checkpoint or task synchronization fails.
114
114
 
115
- After the checkpoint succeeds, when task.md has an `issue_number`, run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --in-labels from-diff --base {delivery-base-ref}`. The task-bound `delivery_base_ref` is the only source for Issue `in:` evidence; record a warning and stop this round without emitting `code.completed` if this sync fails.
115
+ After the checkpoint succeeds, when task.md has a `platform_issue_identity`, run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --in-labels from-diff --base {delivery-base-ref}`. The task-bound `delivery_base_ref` is the only source for Issue `in:` evidence; record a warning and stop this round without emitting `code.completed` if this sync fails.
116
116
 
117
117
  ### 9. Write the Code Report
118
118
 
@@ -122,7 +122,7 @@ Before writing this round's `{code-artifact}`, create the controlled report skel
122
122
  agent-infra-internal task-artifact {task-id} init --family code --artifact {code-artifact} --locale en
123
123
  ```
124
124
 
125
- The skeleton contains identity metadata, stable section markers, and required headings only; real implementation and verification content is required before the completion gate can pass. If the finalizer returns one provably safe structural error, call `task-artifact {task-id} repair --family code --artifact {code-artifact} --expected-sha256 {artifact-sha256} --expected-semantic-digest {semantic-digest}`, then rerun the same finalizer.
125
+ The skeleton contains identity metadata, stable section markers, and required headings only; real implementation and verification content is required before the completion gate can pass. If the finalizer returns one provably safe structural error, it returns a controlled recovery candidate; edit only its `candidatePath`, then rerun `task-artifact {task-id} finalize-local --family code --artifact {code-artifact} --recovery-id {recovery-id}` with the same `recoveryId`. Candidate-only is a protocol authorization boundary, not OS isolation; arbitrary same-UID host writers are outside the protocol's protection claim, and fingerprint/state checks fail closed on anomalies.
126
126
 
127
127
  Create `.agents/workspace/active/{task-id}/{code-artifact}`.
128
128
 
@@ -139,8 +139,8 @@ echo "$finalizer"
139
139
  ```
140
140
 
141
141
  - `status=0` with `finalizer.status="passed"`: bind `{artifact-sha256}` and `{semantic-digest}` from this result.
142
- - `status=1` with `repairable=true` and a diagnostic explicitly describing a one-line replacement: confirm task, round, artifact, and provenance are unchanged; edit only that `code*.md` once, confirm the bytes changed, then rerun the same command completely.
143
- - For any other failure, lack of progress, repeated diagnostic, or eight actual report edits, stop without publishing `code.completed`.
142
+ - `status=1` with recovery context: confirm task, round, artifact, baseline, and request identity are unchanged; edit only the returned `candidatePath` once, confirm the bytes changed, then rerun the same finalizer completely with the same `recoveryId`; `baseline`, `final`, `publish`, and `intent` remain framework-internal state and must not be edited.
143
+ - For any other failure, external formal-artifact change, lack of progress, or recovery identity mismatch, stop without publishing `code.completed`.
144
144
 
145
145
  Do not rescan or manually write digest data; the completion event must include `--artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest}` from the successful finalizer result.
146
146
 
@@ -148,7 +148,7 @@ Do not rescan or manually write digest data; the completion event must include `
148
148
 
149
149
  After requirement checkboxes are updated, run the initial event `agent-infra-internal task-event {task-id} code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {code-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} --files-modified {n} --tests-passed {n} {execution-flag}`; in fix mode add `--fix-for {review-artifact} --blockers {n} --major {n} --minor {n} --manual-validation {n} {execution-flag}` instead; in decision mode add `--implementation-input {input-id}` to the initial counts. The core atomically records the artifact link, stage, metadata, done log, and decision-input consumption.
150
150
 
151
- If task.md has a valid `issue_number`, read `.agents/rules/issue-sync.md`, then (status/comment failures follow the warning rules; an Issue `in:` evidence failure must not emit `code.completed`):
151
+ If task.md has a valid `platform_issue_identity`, read `.agents/rules/issue-sync.md`, then (status/comment failures follow the warning rules; an Issue `in:` evidence failure must not emit `code.completed`):
152
152
  - Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status in-progress`
153
153
  - Run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
154
154
  - Run `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {code-artifact} --agent {standard-agent-token}`
@@ -24,7 +24,7 @@ description: >
24
24
  - 生成会同步到 Issue 的任务或生命周期 Markdown 前,先读取 `.agents/rules/sync-content-generation.md` 并遵循其中的生成端约束;同步端不解析或改写正文
25
25
  - 实现前读取 `.agents/rules/compatibility-policy.md`;只实现方案明确批准的兼容预算,不以“稳妥”为由保留旧分支、旧结果契约或迁移 shim
26
26
  - 修复模式逐条核实最新 `review-code` 的发现:成立则修复,判定为不成立/幻觉则在报告中反驳并记入 unresolved;不擅自扩大到审查未列出的问题;manual-validation 项不在修复范围
27
- - 实现报告在 `code.completed` 前必须通过 `task-artifact ... finalize-local --family code`;按 `.agents/rules/local-artifact-repair.md` 处理同一报告内可证明安全的最小结构修复,并只把同一次通过结果的摘要传给完成事件
27
+ - 实现报告在 `code.completed` 前必须通过 `task-artifact ... finalize-local --family code`;按 `.agents/rules/local-artifact-repair.md` 使用受控 recovery candidate 处理同一报告内可证明安全的结构修复,并只把同一次通过结果的摘要传给完成事件
28
28
  - 实现中遇到方案未覆盖的关键设计决策时,先调用 `agent-infra-internal task-ledger {task-id} decision-next-id` 取得 `HD-N`,按 `.agents/rules/human-decision-context.md` 写入实现报告的 `## 人工裁决待办` 详情块并判断是否需要实现,再调用 `decision-upsert --id {HD-N} --stage code --artifact {code-artifact} --needs-implementation {true|false}`;不得扫描编号、手写账本行、中途提问或擅自扩范围
29
29
  - 不调用 `commit` 技能,也不推送远端;测试通过后直接调用共享 commit core 的 `delivery: { mode: 'local' }` 创建本地 checkpoint。checkpoint 使用 durable intent,只有 checkpoint 与 task 状态同步成功后才发送 `code.completed`
30
30
  - 每轮实现都创建新的实现产物,不覆盖旧文件
@@ -91,7 +91,7 @@ agent-infra-internal task-snapshot {task-id} --format text
91
91
 
92
92
  ### 3. 收窄里程碑
93
93
 
94
- **必须执行,不得跳过。** 如果 task.md 中存在有效的 `issue_number`,调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --milestone specific`;里程碑推断、权限降级与幂等写入由 internal core 处理。
94
+ **必须执行,不得跳过。** 如果 task.md 中存在有效的 `platform_issue_identity`,调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --milestone specific`;里程碑推断、权限降级与幂等写入由 internal core 处理。
95
95
 
96
96
  > 若跳过或收窄后仍为 `X.Y.x`,步骤 12 的 `task-verify code.completed` 会通过 typed milestone check 截停本轮。
97
97
 
@@ -150,7 +150,7 @@ echo "$result"
150
150
 
151
151
  测试通过后,通过 `agent-infra-internal git-workflow commit --input {checkpoint-input}` 调用共享 commit core,输入 `delivery: { "mode": "local" }`、明确 paths、expected HEAD/tree、task ref、agent 和 code round。该调用只创建本地 checkpoint,不访问远端;core 会在 commit 前写入 durable intent,并在 task writer 成功后清理 intent。checkpoint 失败或 task 状态未闭合时,不得发送 `code.completed`。
152
152
 
153
- checkpoint 成功后,若任务存在 `issue_number`,调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --in-labels from-diff --base {delivery-base-ref}`,由 task-bound `delivery_base_ref` 产生 Issue 的 `in:` target;该同步失败时记录 warning 并停止本轮,不发送 `code.completed`。
153
+ checkpoint 成功后,若任务存在 `platform_issue_identity`,调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --in-labels from-diff --base {delivery-base-ref}`,由 task-bound `delivery_base_ref` 产生 Issue 的 `in:` target;该同步失败时记录 warning 并停止本轮,不发送 `code.completed`。
154
154
 
155
155
  排查测试失败或行为不符合预期时,先读取 `.agents/rules/debugging-guide.md`,按其四阶段流程定位根因,禁止盲目改代码重试。
156
156
 
@@ -162,7 +162,7 @@ checkpoint 成功后,若任务存在 `issue_number`,调用 `agent-infra-inte
162
162
  agent-infra-internal task-artifact {task-id} init --family code --artifact {code-artifact}
163
163
  ```
164
164
 
165
- 骨架只包含身份元数据、稳定 section marker 和必需标题;必须填入真实实现与验证内容后才能通过完成门禁。finalizer 返回可证明的单个结构错误时,使用其 SHA 和 semantic digest 调用 `task-artifact {task-id} repair --family code --artifact {code-artifact} --expected-sha256 {artifact-sha256} --expected-semantic-digest {semantic-digest}`,然后完整重跑 finalizer。
165
+ 骨架只包含身份元数据、稳定 section marker 和必需标题;必须填入真实实现与验证内容后才能通过完成门禁。finalizer 返回可证明的单个结构错误时,会返回受控 recovery candidate;只能编辑返回的 `candidatePath`,然后使用同一个 `recoveryId` 重跑 `task-artifact {task-id} finalize-local --family code --artifact {code-artifact} --recovery-id {recovery-id}`。candidate-only 是协议授权边界,不是操作系统隔离;同 UID 的任意宿主写入者不在本协议的防护承诺内,异常由指纹/状态校验失败关闭。
166
166
 
167
167
  创建 `.agents/workspace/active/{task-id}/{code-artifact}`。
168
168
 
@@ -179,8 +179,8 @@ echo "$finalizer"
179
179
  ```
180
180
 
181
181
  - `status=0` 且 `finalizer.status="passed"`:绑定这一次返回的 `{artifact-sha256}` 和 `{semantic-digest}`。
182
- - `status=1` 且返回 `repairable=true`、诊断明确为当前报告中的单行替换:确认任务、轮次、产物和 provenance 未变化后,只编辑该 `code*.md` 一次,确认字节确实变化,再完整重跑同一命令。
183
- - 其他失败、无进展、诊断重复或达到 8 次实际报告编辑:停止,不发布 `code.completed`。
182
+ - `status=1` 且返回 recovery context:确认任务、轮次、产物、baseline 和 request identity 未变化后,只编辑返回的 `candidatePath` 一次,确认字节确实变化,再使用同一个 `recoveryId` 完整重跑同一 finalizer;baseline、final、publish 和 intent 均属于框架内部状态,不得编辑。
183
+ - 其他失败、formal artifact 外部变化、无进展或 recovery identity 不匹配:停止,不发布 `code.completed`。
184
184
 
185
185
  不得重新扫描或手工补写摘要;完成事件必须携带本次 `passed` 结果的 `--artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest}`。
186
186
 
@@ -194,7 +194,7 @@ echo "$finalizer"
194
194
  - 修复模式:`agent-infra-internal task-event {task-id} code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {code-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} --fix-for {review-artifact} --blockers {n} --major {n} --minor {n} --manual-validation {n} {execution-flag}`
195
195
  - 裁决模式:`agent-infra-internal task-event {task-id} code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {code-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} --implementation-input {input-id} --files-modified {n} --tests-passed {n} {execution-flag}`
196
196
 
197
- 如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(状态/评论失败按规则记录 warning;Issue `in:` evidence 同步失败不得发送 `code.completed`;边界见 `.agents/rules/issue-sync.md`):
197
+ 如果 task.md 中存在有效的 `platform_issue_identity`,执行以下同步操作(状态/评论失败按规则记录 warning;Issue `in:` evidence 同步失败不得发送 `code.completed`;边界见 `.agents/rules/issue-sync.md`):
198
198
  - 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status in-progress`
199
199
  - 调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
200
200
  - 调用 `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {code-artifact} --agent {standard-agent-token}`
@@ -30,7 +30,7 @@
30
30
  ]
31
31
  },
32
32
  "platform-sync": {
33
- "when": "issue_number_exists",
33
+ "when": "platform_issue_identity_exists",
34
34
  "expected_status_label": "status: in-progress",
35
35
  "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
36
36
  "verify_comment_content": true,
@@ -30,7 +30,7 @@
30
30
  ]
31
31
  },
32
32
  "platform-sync": {
33
- "when": "issue_number_exists",
33
+ "when": "platform_issue_identity_exists",
34
34
  "expected_status_label": "status: in-progress",
35
35
  "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
36
36
  "verify_comment_content": true,
@@ -4,7 +4,7 @@
4
4
 
5
5
  Run this step only when all of the following are true:
6
6
  - `{task-id}` is valid
7
- - `task.md` frontmatter contains a valid `issue_number`
7
+ - `task.md` frontmatter contains a valid `platform_issue_identity`
8
8
 
9
9
  If either condition is missing, skip this step.
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  仅当以下条件同时满足时执行:
6
6
  - `{task-id}` 有效
7
- - `task.md` frontmatter 中存在有效 `issue_number`
7
+ - `task.md` frontmatter 中存在有效 `platform_issue_identity`
8
8
 
9
9
  任一条件不满足时,跳过本步骤。
10
10
 
@@ -9,7 +9,7 @@ description: >
9
9
  # Complete Manual Validation
10
10
  > `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
11
11
 
12
- 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.
12
+ The transaction coordinator appends lifecycle events and the final PR summary state. The maintainer's validation summary and PR manual-validation comment are the human-validation authority; the transaction receipt provides state-transition and recovery consistency.
13
13
 
14
14
 
15
15
  ## Boundary / Critical Rules
@@ -20,7 +20,7 @@ Before generating the validation completion report, read `.agents/rules/evidence
20
20
 
21
21
  - This skill closes the manual-validation status in an existing PR summary comment; it does not create a parallel ordinary validation comment.
22
22
  - It must write `manual-validation.md` or `manual-validation-r{N}.md` so later PR summary refreshes can reuse the validation result.
23
- - If the `sync-pr` summary comment is missing, fail instead of creating a partial fallback summary.
23
+ - If the `sync-pr` summary comment is missing, fail instead of creating a partial fallback summary; before the receipt, completion log, and final summary are all committed, the remote summary may only be pending/non-pass.
24
24
  - Before generating manual-validation artifact Markdown that will be synced to an Issue, read `.agents/rules/sync-content-generation.md` and follow its generator-side constraints; Issue sync remains transparent and does not parse or rewrite the body.
25
25
  - After this skill runs, update `task.md` immediately.
26
26
 
@@ -42,10 +42,6 @@ agent-infra-internal task-snapshot {task-id} --format text
42
42
 
43
43
  > Resolve the task reference, then confirm that the task is in a state or directory supported by this skill and that `task.md` exists; if it cannot be located, handle it as a missing task and stop.
44
44
 
45
- ## Step Start: Write the started Marker
46
-
47
- After resolving the artifact context and before this round's first artifact action, run `agent-infra-internal task-event {task-id} manual-validation.started --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code}` and record the returned `artifactContext`.
48
-
49
45
  ## Steps
50
46
 
51
47
  ### 1. Parse Arguments
@@ -70,33 +66,49 @@ Stop if the task is missing, the validation summary is missing, or no valid PR c
70
66
 
71
67
  ### 3. Resolve the Artifact Context
72
68
 
73
- Run `agent-infra-internal task-artifact {task-id} inspect --family manual-validation`. Continue only for `ready`; take the round and `{manual-validation-artifact}` from `next.round` / `next.name`. Do not scan rounds or construct names in the skill. Then run the started event and verify the returned identity.
69
+ Run `agent-infra-internal task-artifact {task-id} inspect --family manual-validation`. Continue only for `ready`; take the round and `{manual-validation-artifact}` from `next.round` / `next.name`. Do not scan rounds or construct names in the skill. The transaction coordinator owns the started event.
70
+
71
+ ### 4. Register Manual Validation Start
72
+
73
+ Before creating any manual-validation artifact, obtain the canonical summary body from `platform-pr summary-context`, then call the transaction coordinator in prepare mode:
74
74
 
75
- ### 4. Update the PR Summary
75
+ ```bash
76
+ agent-infra-internal manual-validation transaction {task-id} --prepare \
77
+ --artifact {manual-validation-artifact} \
78
+ --summary-file {summary-body-file} --agent {standard-agent-token}
79
+ ```
80
+
81
+ Prepare must idempotently record `manual-validation.started` before writing the prepared transaction; on failure, stop without creating the artifact.
82
+
83
+ ### 5. Create the Manual Validation Artifact
84
+
85
+ Before this step, read `reference/report-template.md`. After `started` is recorded, create `{manual-validation-artifact}` and record the state check, validation verdict, validation scope, validation details, and expected PR summary synchronization result; the transaction coordinator validates and commits this artifact in the next step.
86
+
87
+ ### 6. Update the PR Summary
76
88
 
77
89
  Before this step, read:
78
90
  - `.agents/rules/issue-sync.md`
79
91
  - `.agents/rules/pr-sync.md`
80
92
  - `reference/summary-update.md`
81
93
 
82
- Follow `reference/summary-update.md` to validate the PR binding, obtain canonical inputs from `platform-pr summary-context`, and update the manual-validation section through `platform-pr summary-sync` to `### ✅ Manual Validation Passed`.
94
+ Follow `reference/summary-update.md` to validate the PR binding, obtain canonical inputs from `platform-pr summary-context`, and call the transaction coordinator once:
83
95
 
84
- ### 5. Create the Manual Validation Artifact
96
+ ```bash
97
+ agent-infra-internal manual-validation transaction {task-id} \
98
+ --artifact {manual-validation-artifact} \
99
+ --summary-file {summary-body-file} --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json \
100
+ --agent {standard-agent-token} --result no_op
101
+ ```
85
102
 
86
- Before this step, read `reference/report-template.md`. Create `{manual-validation-artifact}` and record:
87
- - State check
88
- - Validation verdict
89
- - Validation scope
90
- - Validation details
91
- - PR summary sync result
103
+ The coordinator owns pending summary, receipt, completion log, final promotion, and post-write verification; it internally uses the controlled `agent-infra-internal task-event {task-id}` route. Do not call final `summary-sync` or `manual-validation.completed` separately. Raw evidence files from other hosts are not required.
92
104
 
93
- ### 6. Update task.md
105
+ ### 7. Update task.md
94
106
 
95
- Run `agent-infra-internal task-event {task-id} manual-validation.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {manual-validation-artifact} --summary-result "{summary-result}"`. The core keeps `current_step` unchanged while atomically recording the implementation-notes link, metadata, and done log.
107
+ After the transaction coordinator succeeds, the core has atomically recorded `manual-validation.completed` with the same transaction/receipt/head identity. Do not append the Activity Log manually.
96
108
 
97
- If the task has a valid `issue_number`, run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`, then `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {manual-validation-artifact} --agent {standard-agent-token}`.
109
+ If the task has a valid `platform_issue_identity`, run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`, then `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {manual-validation-artifact} --agent {standard-agent-token}`.
98
110
 
99
- ### 7. Verification Gate
111
+ ### 8. Verification Gate
100
112
 
101
113
  Run:
102
114
 
@@ -109,7 +121,7 @@ Handle the result:
109
121
  - Exit code 1 -> fix the reported problem and rerun
110
122
  - Exit code 2 -> stop and report that manual intervention is required
111
123
 
112
- ### 8. Tell the User
124
+ ### 9. Tell the User
113
125
 
114
126
  Report:
115
127
  - Artifact path
@@ -9,7 +9,7 @@ description: >
9
9
  # 完成人工验证
10
10
  > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
11
11
 
12
- 生命周期事件必须携带显式触发信息:编排调用使用 `{trigger-initiator}=orchestrator`,否则使用 `model`;`{request-id}` 是本任务与本轮产物的稳定单行标识,`{reason-code}` 使用 `user-request` 或 `validation-rerun`;started 与 completed 使用同一组值。
12
+ 事务协调器统一追加 lifecycle 事件和 PR 摘要最终状态。维护者提供的验证说明和 PR 摘要留言就是人工验证依据;事务回执负责保证状态转换和恢复一致性。
13
13
 
14
14
 
15
15
  ## 行为边界 / 关键规则
@@ -20,7 +20,7 @@ description: >
20
20
 
21
21
  - 本技能用于收尾已有 PR 摘要评论中的人工校验状态,不创建并行的普通验证留言。
22
22
  - 必须写入 `manual-validation.md` 或 `manual-validation-r{N}.md`,让后续 PR 摘要刷新可复用人工验证结果。
23
- - 找不到 `sync-pr` 摘要评论时失败,不创建部分摘要兜底。
23
+ - 找不到 `sync-pr` 摘要评论时失败,不创建部分摘要兜底;receipt、通过日志和 final summary 未全部提交前,远端只允许 pending/non-pass 状态。
24
24
  - 生成会同步到 Issue 的人工验证 artifact Markdown 前,先读取 `.agents/rules/sync-content-generation.md` 并遵循其中的生成端约束;Issue 同步保持透明,不解析或改写正文。
25
25
  - 执行本技能后必须立即更新 `task.md`。
26
26
 
@@ -42,10 +42,6 @@ agent-infra-internal task-snapshot {task-id} --format text
42
42
 
43
43
  > 解析任务引用,并确认任务位于本技能支持的状态或目录且存在 `task.md`;无法定位时按未找到任务处理并停止。
44
44
 
45
- ## 步骤开始:声明 started 事件
46
-
47
- 确认前置条件和产物上下文后、本轮第一个产出动作之前执行 `agent-infra-internal task-event {task-id} manual-validation.started --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code}`,并以返回的 `artifactContext` 记录本轮身份。
48
-
49
45
  ## 执行步骤
50
46
 
51
47
  ### 1. 解析入参
@@ -70,33 +66,49 @@ complete-manual-validation [--task <ref> | -t <ref>] [{pr-ref}] {verification-su
70
66
 
71
67
  ### 3. 解析产物上下文
72
68
 
73
- 运行 `agent-infra-internal task-artifact {task-id} inspect --family manual-validation`。仅当结果为 `ready` 时继续;从 `next.round` / `next.name` 取得本轮 round 与 `{manual-validation-artifact}`。不得自行扫描轮次或拼装文件名。随后执行 started 事件并复核返回身份。
69
+ 运行 `agent-infra-internal task-artifact {task-id} inspect --family manual-validation`。仅当结果为 `ready` 时继续;从 `next.round` / `next.name` 取得本轮 round 与 `{manual-validation-artifact}`。不得自行扫描轮次或拼装文件名。事务协调器负责 started 事件。
70
+
71
+ ### 4. 登记人工验证开始
72
+
73
+ 在创建任何人工验证 artifact 前,先从 `platform-pr summary-context` 取得 canonical 摘要正文,然后调用事务协调器的 prepare 模式:
74
74
 
75
- ### 4. 更新 PR 摘要
75
+ ```bash
76
+ agent-infra-internal manual-validation transaction {task-id} --prepare \
77
+ --artifact {manual-validation-artifact} \
78
+ --summary-file {summary-body-file} --agent {standard-agent-token}
79
+ ```
80
+
81
+ prepare 必须先幂等登记 `manual-validation.started`,再写入 prepared transaction;失败时停止,不创建 artifact。
82
+
83
+ ### 5. 创建人工验证产物
84
+
85
+ 执行此步骤前,先读取 `reference/report-template.md`。在 started 已登记后创建 `{manual-validation-artifact}`,记录状态核对、验证结论、验证范围、验证详情和预期 PR 摘要同步结果;事务协调器将在后续步骤校验并提交这份 artifact。
86
+
87
+ ### 6. 更新 PR 摘要
76
88
 
77
89
  执行此步骤前,先读取:
78
90
  - `.agents/rules/issue-sync.md`
79
91
  - `.agents/rules/pr-sync.md`
80
92
  - `reference/summary-update.md`
81
93
 
82
- 按 `reference/summary-update.md` 校验 PR 绑定,从 `platform-pr summary-context` 取得 canonical 输入,并通过 `platform-pr summary-sync` 把人工校验段更新为 `### ✅ 人工验证已通过`。
94
+ 按 `reference/summary-update.md` 校验 PR 绑定,从 `platform-pr summary-context` 取得 canonical 输入,并调用一次 transaction coordinator:
83
95
 
84
- ### 5. 创建人工验证产物
96
+ ```bash
97
+ agent-infra-internal manual-validation transaction {task-id} \
98
+ --artifact {manual-validation-artifact} \
99
+ --summary-file {summary-body-file} --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json \
100
+ --agent {standard-agent-token} --result no_op
101
+ ```
85
102
 
86
- 执行此步骤前,先读取 `reference/report-template.md`。创建 `{manual-validation-artifact}`,记录:
87
- - 状态核对
88
- - 验证结论
89
- - 验证范围
90
- - 验证详情
91
- - PR 摘要同步结果
103
+ coordinator 负责 pending summary、receipt、通过日志、final promotion 和 post-write verification;内部受控调用 `agent-infra-internal task-event {task-id}`,不要分别调用 final `summary-sync` 或 `manual-validation.completed`。不要求调用方提供其他主机上的原始 evidence 文件。
92
104
 
93
- ### 6. 更新 task.md
105
+ ### 7. 更新 task.md
94
106
 
95
- 执行 `agent-infra-internal task-event {task-id} manual-validation.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {manual-validation-artifact} --summary-result "{summary-result}"`,由核心在保持 `current_step` 不变的同时原子登记实现备注链接、时间/版本和完成日志。
107
+ transaction coordinator 成功后,核心已使用同一 transaction/receipt/head identity 原子登记 `manual-validation.completed`;不要手工补写 Activity Log。
96
108
 
97
- 如任务存在有效 `issue_number`,调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`,再调用 `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {manual-validation-artifact} --agent {standard-agent-token}`。
109
+ 如任务存在有效 `platform_issue_identity`,调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`,再调用 `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {manual-validation-artifact} --agent {standard-agent-token}`。
98
110
 
99
- ### 7. 完成校验
111
+ ### 8. 完成校验
100
112
 
101
113
  运行完成校验:
102
114
 
@@ -109,7 +121,7 @@ agent-infra-internal task-verify {task-id} manual-validation.completed --artifac
109
121
  - 退出码 1 -> 修复问题后重新运行
110
122
  - 退出码 2 -> 停止并告知需要人工介入
111
123
 
112
- ### 8. 告知用户
124
+ ### 9. 告知用户
113
125
 
114
126
  输出:
115
127
  - 产物路径
@@ -37,7 +37,7 @@
37
37
  "when": "pr_fact_bound",
38
38
  "expected_pr_comment_marker_key": "prSummary",
39
39
  "expected_pr_comment_required_patterns": [
40
- "^### ✅ Manual Validation Passed$"
40
+ "^### ✅ (?:人工验证已通过|Manual Validation Passed)$"
41
41
  ],
42
42
  "verify_task_comment_content": true,
43
43
  "verify_issue_type": true,
@@ -37,7 +37,7 @@
37
37
  "when": "pr_fact_bound",
38
38
  "expected_pr_comment_marker_key": "prSummary",
39
39
  "expected_pr_comment_required_patterns": [
40
- "^### ✅ 人工验证已通过$"
40
+ "^### ✅ (?:人工验证已通过|Manual Validation Passed)$"
41
41
  ],
42
42
  "verify_task_comment_content": true,
43
43
  "verify_issue_type": true,