@fitlab-ai/agent-infra 0.9.12 → 0.9.14

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 (402) hide show
  1. package/README.md +11 -11
  2. package/README.zh-CN.md +11 -11
  3. package/bin/cli.ts +26 -9
  4. package/dist/bin/cli.js +173 -157
  5. package/dist/bin/internal-cli.js +66 -40
  6. package/dist/lib/agent-client.js +5 -0
  7. package/dist/lib/agent-clients/next-steps.js +6 -1
  8. package/dist/lib/decide.js +3 -3
  9. package/dist/lib/internal/agent-client.js +5 -2
  10. package/dist/lib/internal/cli-route-inventory.js +152 -0
  11. package/dist/lib/internal/codex-lifecycle.js +9 -6
  12. package/dist/lib/internal/codex-sandbox-controller.js +8 -2
  13. package/dist/lib/internal/git-workflow.js +10 -6
  14. package/dist/lib/internal/platform-checks.js +19 -7
  15. package/dist/lib/internal/platform-comment.js +25 -13
  16. package/dist/lib/internal/platform-context.js +6 -3
  17. package/dist/lib/internal/platform-issue.js +20 -13
  18. package/dist/lib/internal/platform-metadata.js +88 -0
  19. package/dist/lib/internal/platform-pr-review.js +26 -13
  20. package/dist/lib/internal/platform-pr.js +84 -31
  21. package/dist/lib/internal/platform-release-notes.js +9 -6
  22. package/dist/lib/internal/platform-security.js +93 -0
  23. package/dist/lib/internal/pr-review-grade.js +25 -12
  24. package/dist/lib/internal/release-workflow.js +23 -9
  25. package/dist/lib/internal/sandbox-control.js +50 -7
  26. package/dist/lib/internal/task-activity.js +16 -7
  27. package/dist/lib/internal/task-artifact.js +235 -24
  28. package/dist/lib/internal/task-context.js +4 -1
  29. package/dist/lib/internal/task-create.js +50 -17
  30. package/dist/lib/internal/task-delivery.js +4 -1
  31. package/dist/lib/internal/task-event.js +10 -4
  32. package/dist/lib/internal/task-finalization.js +6 -3
  33. package/dist/lib/internal/task-invalidation.js +63 -0
  34. package/dist/lib/internal/task-ledger.js +20 -6
  35. package/dist/lib/internal/task-lifecycle.js +6 -3
  36. package/dist/lib/internal/task-operation-registry.js +421 -0
  37. package/dist/lib/internal/task-orchestration.js +12 -0
  38. package/dist/lib/internal/task-override.js +14 -7
  39. package/dist/lib/internal/task-qualification.js +90 -0
  40. package/dist/lib/internal/task-review.js +7 -4
  41. package/dist/lib/internal/task-short-id.js +11 -1
  42. package/dist/lib/internal/task-snapshot.js +4 -1
  43. package/dist/lib/internal/task-validate.js +7 -2
  44. package/dist/lib/internal/task-verify.js +11 -7
  45. package/dist/lib/internal/task-warning.js +11 -4
  46. package/dist/lib/platform/adapters.js +1 -3
  47. package/dist/lib/platform/change-request-git-evidence.js +27 -7
  48. package/dist/lib/platform/comment-safety.js +226 -0
  49. package/dist/lib/platform/completion-backfill.js +6 -5
  50. package/dist/lib/platform/context.js +70 -130
  51. package/dist/lib/platform/github-client.js +1 -1
  52. package/dist/lib/platform/github-provider.js +1130 -0
  53. package/dist/lib/platform/in-label-sync.js +143 -0
  54. package/dist/lib/platform/issue-comments.js +237 -72
  55. package/dist/lib/platform/issues.js +335 -189
  56. package/dist/lib/platform/metadata-labels.js +6 -2
  57. package/dist/lib/platform/none-provider.js +28 -0
  58. package/dist/lib/platform/pr-change-report.js +545 -0
  59. package/dist/lib/platform/pr-checks.js +119 -104
  60. package/dist/lib/platform/pr-review.js +88 -72
  61. package/dist/lib/platform/pr-summary.js +541 -50
  62. package/dist/lib/platform/provider-bridge.js +45 -0
  63. package/dist/lib/platform/provider-contract.d.ts +553 -0
  64. package/dist/lib/platform/provider-contract.js +99 -0
  65. package/dist/lib/platform/provider-loader.js +251 -0
  66. package/dist/lib/platform/provider-validation.js +577 -0
  67. package/dist/lib/platform/pull-request-metadata.js +8 -6
  68. package/dist/lib/platform/pull-requests.js +734 -543
  69. package/dist/lib/platform/release-notes.js +78 -55
  70. package/dist/lib/platform/releases.js +79 -50
  71. package/dist/lib/platform/repository-metadata.js +377 -0
  72. package/dist/lib/platform/resource-identity.d.ts +26 -0
  73. package/dist/lib/platform/resource-identity.js +92 -0
  74. package/dist/lib/platform/security-alerts.js +155 -0
  75. package/dist/lib/platform/task-identities.js +31 -0
  76. package/dist/lib/platform/verification-required.js +11 -12
  77. package/dist/lib/platform/verification-sync.js +129 -248
  78. package/dist/lib/pr-review/evidence-grading.js +19 -6
  79. package/dist/lib/process-data/index.js +7 -0
  80. package/dist/lib/run/index.js +68 -23
  81. package/dist/lib/sandbox/commands/control-status.js +22 -0
  82. package/dist/lib/sandbox/commands/create.js +32 -6
  83. package/dist/lib/sandbox/commands/ls.js +5 -0
  84. package/dist/lib/sandbox/commands/rm.js +827 -120
  85. package/dist/lib/sandbox/commands/show.js +16 -0
  86. package/dist/lib/sandbox/control/client.js +174 -19
  87. package/dist/lib/sandbox/control/completed-reentry.js +85 -0
  88. package/dist/lib/sandbox/control/container-identity.js +28 -31
  89. package/dist/lib/sandbox/control/executor.js +151 -16
  90. package/dist/lib/sandbox/control/lifecycle.js +621 -127
  91. package/dist/lib/sandbox/control/native-file-lock.js +177 -0
  92. package/dist/lib/sandbox/control/protocol.js +77 -0
  93. package/dist/lib/sandbox/control/server.js +677 -34
  94. package/dist/lib/sandbox/control/state.js +209 -4
  95. package/dist/lib/sandbox/control/task-view.js +183 -0
  96. package/dist/lib/sandbox/engines/authority.js +289 -0
  97. package/dist/lib/sandbox/engines/docker-exact-discovery.js +97 -0
  98. package/dist/lib/sandbox/index.js +5 -0
  99. package/dist/lib/sandbox/recovery.js +21 -1
  100. package/dist/lib/sandbox/workspace-view.js +2 -1
  101. package/dist/lib/sandbox/worktree-safety.js +4 -1
  102. package/dist/lib/server/index.js +8 -0
  103. package/dist/lib/server/protocol.js +38 -1
  104. package/dist/lib/task/activity-log.js +8 -1
  105. package/dist/lib/task/artifact-lifecycle.js +75 -18
  106. package/dist/lib/task/artifact-operations.js +520 -0
  107. package/dist/lib/task/artifact-repair-intent.js +59 -0
  108. package/dist/lib/task/artifact-schema.js +135 -0
  109. package/dist/lib/task/capabilities.js +310 -0
  110. package/dist/lib/task/commands/status.js +32 -0
  111. package/dist/lib/task/commit-operation.js +12 -1
  112. package/dist/lib/task/control-authority.js +12 -5
  113. package/dist/lib/task/create-service.js +111 -12
  114. package/dist/lib/task/create.js +25 -0
  115. package/dist/lib/task/current-contract.js +5 -1
  116. package/dist/lib/task/decision-details.js +1 -1
  117. package/dist/lib/task/events.js +416 -17
  118. package/dist/lib/task/finalization.js +37 -13
  119. package/dist/lib/task/human-override.js +58 -36
  120. package/dist/lib/task/index.js +11 -3
  121. package/dist/lib/task/invalidation-command.js +86 -0
  122. package/dist/lib/task/invalidation.js +260 -0
  123. package/dist/lib/task/ledger-intents.js +37 -0
  124. package/dist/lib/task/local-artifact-finalization.js +299 -0
  125. package/dist/lib/task/orchestration.js +240 -144
  126. package/dist/lib/task/pr-delivery-fact.js +102 -101
  127. package/dist/lib/task/qualification-audit.js +490 -0
  128. package/dist/lib/task/qualification-confirmation.js +109 -0
  129. package/dist/lib/task/qualification-intents.js +148 -0
  130. package/dist/lib/task/review-artifacts.js +22 -23
  131. package/dist/lib/task/review-finalization.js +121 -4
  132. package/dist/lib/task/review-fingerprint.js +24 -2
  133. package/dist/lib/task/rework-intent.js +138 -0
  134. package/dist/lib/task/sections.js +6 -4
  135. package/dist/lib/task/skill-scope.js +23 -0
  136. package/dist/lib/task/task-execution-lock.js +27 -17
  137. package/dist/lib/task/verification-config.js +11 -0
  138. package/dist/lib/task/verification-engine.js +93 -16
  139. package/dist/lib/task/verification.js +3 -3
  140. package/dist/lib/task/workflow-warning-intents.js +1 -1
  141. package/dist/lib/task/write.js +11 -0
  142. package/dist/lib/version.js +11 -1
  143. package/dist/lifecycle-build-manifest.json +3 -3
  144. package/lib/agent-client.ts +9 -0
  145. package/lib/agent-clients/next-steps.ts +6 -1
  146. package/lib/decide.ts +3 -3
  147. package/lib/init.ts +1 -1
  148. package/lib/internal/agent-client.ts +4 -2
  149. package/lib/internal/cli-route-inventory.ts +140 -0
  150. package/lib/internal/codex-lifecycle.ts +8 -6
  151. package/lib/internal/codex-sandbox-controller.ts +7 -2
  152. package/lib/internal/git-workflow.ts +9 -6
  153. package/lib/internal/platform-checks.ts +14 -6
  154. package/lib/internal/platform-comment.ts +20 -12
  155. package/lib/internal/platform-context.ts +5 -3
  156. package/lib/internal/platform-issue.ts +17 -11
  157. package/lib/internal/platform-metadata.ts +70 -0
  158. package/lib/internal/platform-pr-review.ts +23 -12
  159. package/lib/internal/platform-pr.ts +65 -27
  160. package/lib/internal/platform-release-notes.ts +8 -6
  161. package/lib/internal/platform-security.ts +83 -0
  162. package/lib/internal/pr-review-grade.ts +20 -11
  163. package/lib/internal/release-workflow.ts +21 -9
  164. package/lib/internal/sandbox-control.ts +44 -6
  165. package/lib/internal/task-activity.ts +15 -7
  166. package/lib/internal/task-artifact.ts +204 -22
  167. package/lib/internal/task-context.ts +3 -1
  168. package/lib/internal/task-create.ts +78 -17
  169. package/lib/internal/task-delivery.ts +3 -1
  170. package/lib/internal/task-event.ts +9 -4
  171. package/lib/internal/task-finalization.ts +6 -4
  172. package/lib/internal/task-invalidation.ts +41 -0
  173. package/lib/internal/task-ledger.ts +21 -8
  174. package/lib/internal/task-lifecycle.ts +5 -3
  175. package/lib/internal/task-operation-registry.ts +482 -0
  176. package/lib/internal/task-orchestration.ts +12 -0
  177. package/lib/internal/task-override.ts +15 -9
  178. package/lib/internal/task-qualification.ts +61 -0
  179. package/lib/internal/task-review.ts +6 -4
  180. package/lib/internal/task-short-id.ts +10 -1
  181. package/lib/internal/task-snapshot.ts +3 -1
  182. package/lib/internal/task-validate.ts +6 -2
  183. package/lib/internal/task-verify.ts +10 -7
  184. package/lib/internal/task-warning.ts +10 -4
  185. package/lib/platform/adapters.ts +3 -2
  186. package/lib/platform/change-request-git-evidence.ts +36 -9
  187. package/lib/platform/comment-safety.ts +250 -0
  188. package/lib/platform/completion-backfill.ts +9 -8
  189. package/lib/platform/context.ts +97 -134
  190. package/lib/platform/github-client.ts +2 -2
  191. package/lib/platform/github-provider.ts +1132 -0
  192. package/lib/platform/in-label-sync.ts +208 -0
  193. package/lib/platform/issue-comments.ts +255 -80
  194. package/lib/platform/issues.ts +344 -174
  195. package/lib/platform/metadata-labels.ts +5 -2
  196. package/lib/platform/none-provider.ts +35 -0
  197. package/lib/platform/pr-change-report.ts +639 -0
  198. package/lib/platform/pr-checks.ts +126 -106
  199. package/lib/platform/pr-review.ts +88 -85
  200. package/lib/platform/pr-summary.ts +581 -53
  201. package/lib/platform/provider-bridge.ts +82 -0
  202. package/lib/platform/provider-contract.ts +611 -0
  203. package/lib/platform/provider-loader.ts +307 -0
  204. package/lib/platform/provider-validation.ts +611 -0
  205. package/lib/platform/pull-request-metadata.ts +10 -7
  206. package/lib/platform/pull-requests.ts +781 -550
  207. package/lib/platform/release-notes.ts +76 -59
  208. package/lib/platform/releases.ts +77 -43
  209. package/lib/platform/repository-metadata.ts +453 -0
  210. package/lib/platform/resource-identity.ts +121 -0
  211. package/lib/platform/security-alerts.ts +191 -0
  212. package/lib/platform/task-identities.ts +40 -0
  213. package/lib/platform/types.ts +4 -2
  214. package/lib/platform/verification-required.ts +11 -13
  215. package/lib/platform/verification-sync.ts +128 -304
  216. package/lib/pr-review/evidence-grading.ts +25 -8
  217. package/lib/process-data/index.ts +7 -0
  218. package/lib/run/index.ts +62 -22
  219. package/lib/sandbox/commands/control-status.ts +26 -0
  220. package/lib/sandbox/commands/create.ts +46 -6
  221. package/lib/sandbox/commands/ls.ts +7 -0
  222. package/lib/sandbox/commands/rm.ts +1000 -87
  223. package/lib/sandbox/commands/show.ts +16 -0
  224. package/lib/sandbox/control/client.ts +203 -19
  225. package/lib/sandbox/control/completed-reentry.ts +98 -0
  226. package/lib/sandbox/control/container-identity.ts +27 -43
  227. package/lib/sandbox/control/executor.ts +180 -15
  228. package/lib/sandbox/control/lifecycle.ts +629 -17
  229. package/lib/sandbox/control/native-file-lock.ts +209 -0
  230. package/lib/sandbox/control/protocol.ts +118 -2
  231. package/lib/sandbox/control/server.ts +724 -34
  232. package/lib/sandbox/control/state.ts +257 -4
  233. package/lib/sandbox/control/task-view.ts +240 -0
  234. package/lib/sandbox/engines/authority.ts +365 -0
  235. package/lib/sandbox/engines/docker-exact-discovery.ts +132 -0
  236. package/lib/sandbox/index.ts +7 -0
  237. package/lib/sandbox/recovery.ts +21 -1
  238. package/lib/sandbox/workspace-view.ts +9 -3
  239. package/lib/sandbox/worktree-safety.ts +4 -1
  240. package/lib/server/index.ts +10 -0
  241. package/lib/server/protocol.ts +36 -1
  242. package/lib/task/activity-log.ts +8 -0
  243. package/lib/task/artifact-lifecycle.ts +70 -22
  244. package/lib/task/artifact-operations.ts +626 -0
  245. package/lib/task/artifact-repair-intent.ts +71 -0
  246. package/lib/task/artifact-schema.ts +192 -0
  247. package/lib/task/capabilities.ts +331 -0
  248. package/lib/task/commands/status.ts +38 -0
  249. package/lib/task/commit-operation.ts +12 -1
  250. package/lib/task/control-authority.ts +22 -9
  251. package/lib/task/create-service.ts +139 -14
  252. package/lib/task/create.ts +27 -0
  253. package/lib/task/current-contract.ts +6 -1
  254. package/lib/task/decision-details.ts +6 -2
  255. package/lib/task/events.ts +392 -16
  256. package/lib/task/finalization.ts +50 -14
  257. package/lib/task/human-override.ts +70 -46
  258. package/lib/task/index.ts +16 -3
  259. package/lib/task/invalidation-command.ts +86 -0
  260. package/lib/task/invalidation.ts +332 -0
  261. package/lib/task/ledger-intents.ts +35 -1
  262. package/lib/task/local-artifact-finalization.ts +432 -0
  263. package/lib/task/orchestration.ts +223 -133
  264. package/lib/task/pr-delivery-fact.ts +131 -148
  265. package/lib/task/qualification-audit.ts +599 -0
  266. package/lib/task/qualification-confirmation.ts +117 -0
  267. package/lib/task/qualification-intents.ts +150 -0
  268. package/lib/task/review-artifacts.ts +21 -22
  269. package/lib/task/review-finalization.ts +133 -4
  270. package/lib/task/review-fingerprint.ts +23 -2
  271. package/lib/task/rework-intent.ts +165 -0
  272. package/lib/task/sections.ts +6 -4
  273. package/lib/task/skill-scope.ts +24 -0
  274. package/lib/task/task-execution-lock.ts +23 -14
  275. package/lib/task/verification-config.ts +12 -0
  276. package/lib/task/verification-engine.ts +103 -17
  277. package/lib/task/verification.ts +4 -4
  278. package/lib/task/workflow-warning-intents.ts +1 -1
  279. package/lib/task/write.ts +19 -0
  280. package/lib/update.ts +1 -1
  281. package/lib/version.ts +15 -1
  282. package/package.json +12 -1
  283. package/templates/.agents/rules/README.en.md +3 -1
  284. package/templates/.agents/rules/README.zh-CN.md +3 -1
  285. package/templates/.agents/rules/decision-qualification.en.md +22 -0
  286. package/templates/.agents/rules/decision-qualification.zh-CN.md +22 -0
  287. package/templates/.agents/rules/evidence-reporting.en.md +28 -0
  288. package/templates/.agents/rules/evidence-reporting.zh-CN.md +28 -0
  289. package/templates/.agents/rules/issue-pr-commands.en.md +1 -1
  290. package/templates/.agents/rules/issue-pr-commands.zh-CN.md +1 -1
  291. package/templates/.agents/rules/issue-sync.en.md +2 -0
  292. package/templates/.agents/rules/issue-sync.zh-CN.md +2 -0
  293. package/templates/.agents/rules/label-milestone-setup.en.md +7 -7
  294. package/templates/.agents/rules/label-milestone-setup.zh-CN.md +7 -7
  295. package/templates/.agents/rules/local-artifact-repair.en.md +13 -2
  296. package/templates/.agents/rules/local-artifact-repair.zh-CN.md +13 -2
  297. package/templates/.agents/rules/pr-sync.en.md +10 -4
  298. package/templates/.agents/rules/pr-sync.zh-CN.md +17 -4
  299. package/templates/.agents/rules/security-alerts.en.md +8 -8
  300. package/templates/.agents/rules/security-alerts.zh-CN.md +8 -8
  301. package/templates/.agents/rules/task-short-id.en.md +1 -4
  302. package/templates/.agents/rules/task-short-id.zh-CN.md +1 -3
  303. package/templates/.agents/skills/analyze-task/SKILL.en.md +28 -5
  304. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +29 -5
  305. package/templates/.agents/skills/analyze-task/config/verify.en.json +1 -12
  306. package/templates/.agents/skills/analyze-task/config/verify.zh-CN.json +1 -12
  307. package/templates/.agents/skills/check-task/SKILL.en.md +16 -37
  308. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +16 -37
  309. package/templates/.agents/skills/close-codescan/SKILL.en.md +2 -2
  310. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +2 -2
  311. package/templates/.agents/skills/close-dependabot/SKILL.en.md +2 -2
  312. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +2 -2
  313. package/templates/.agents/skills/code-task/SKILL.en.md +41 -9
  314. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +43 -11
  315. package/templates/.agents/skills/code-task/config/verify.en.json +6 -14
  316. package/templates/.agents/skills/code-task/config/verify.zh-CN.json +6 -14
  317. package/templates/.agents/skills/code-task/reference/code-rules.en.md +5 -4
  318. package/templates/.agents/skills/code-task/reference/code-rules.zh-CN.md +5 -4
  319. package/templates/.agents/skills/code-task/reference/dual-mode.en.md +1 -1
  320. package/templates/.agents/skills/code-task/reference/dual-mode.zh-CN.md +1 -1
  321. package/templates/.agents/skills/code-task/reference/fix-mode.en.md +3 -1
  322. package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +3 -1
  323. package/templates/.agents/skills/code-task/reference/report-template.en.md +42 -15
  324. package/templates/.agents/skills/code-task/reference/report-template.zh-CN.md +39 -12
  325. package/templates/.agents/skills/commit/reference/issue-metadata-sync.en.md +2 -0
  326. package/templates/.agents/skills/commit/reference/issue-metadata-sync.zh-CN.md +2 -0
  327. package/templates/.agents/skills/commit/reference/pr-summary-sync.en.md +3 -3
  328. package/templates/.agents/skills/commit/reference/pr-summary-sync.zh-CN.md +3 -3
  329. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +10 -4
  330. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +10 -4
  331. package/templates/.agents/skills/complete-manual-validation/reference/report-template.en.md +2 -0
  332. package/templates/.agents/skills/complete-manual-validation/reference/report-template.zh-CN.md +2 -0
  333. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +4 -3
  334. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +4 -3
  335. package/templates/.agents/skills/complete-task/SKILL.en.md +26 -21
  336. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +25 -21
  337. package/templates/.agents/skills/create-pr/SKILL.en.md +7 -6
  338. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +7 -7
  339. package/templates/.agents/skills/create-pr/config/verify.json +1 -0
  340. package/templates/.agents/skills/create-pr/reference/change-report.en.md +16 -4
  341. package/templates/.agents/skills/create-pr/reference/change-report.zh-CN.md +16 -4
  342. package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +5 -3
  343. package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +5 -3
  344. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +1 -1
  345. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +1 -1
  346. package/templates/.agents/skills/create-pr/scripts/change-report.mjs +3 -0
  347. package/templates/.agents/skills/create-task/SKILL.en.md +8 -0
  348. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +7 -0
  349. package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
  350. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  351. package/templates/.agents/skills/import-dependabot/SKILL.en.md +1 -1
  352. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +1 -1
  353. package/templates/.agents/skills/init-labels/SKILL.en.md +8 -8
  354. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +8 -8
  355. package/templates/.agents/skills/init-milestones/SKILL.en.md +9 -11
  356. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +9 -11
  357. package/templates/.agents/skills/plan-task/SKILL.en.md +27 -4
  358. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +26 -4
  359. package/templates/.agents/skills/plan-task/config/verify.en.json +4 -14
  360. package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +4 -14
  361. package/templates/.agents/skills/review-analysis/SKILL.en.md +17 -4
  362. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +17 -4
  363. package/templates/.agents/skills/review-analysis/config/verify.en.json +1 -18
  364. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +1 -18
  365. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +50 -23
  366. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +45 -18
  367. package/templates/.agents/skills/review-code/SKILL.en.md +18 -5
  368. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +18 -5
  369. package/templates/.agents/skills/review-code/config/verify.en.json +1 -23
  370. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -23
  371. package/templates/.agents/skills/review-code/reference/report-template.en.md +49 -22
  372. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +45 -18
  373. package/templates/.agents/skills/review-plan/SKILL.en.md +17 -4
  374. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +17 -4
  375. package/templates/.agents/skills/review-plan/config/verify.en.json +1 -18
  376. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +1 -18
  377. package/templates/.agents/skills/review-plan/reference/report-template.en.md +49 -22
  378. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +45 -18
  379. package/templates/.agents/skills/review-pr/SKILL.en.md +5 -1
  380. package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +5 -1
  381. package/templates/.agents/skills/review-pr/reference/report-template.en.md +4 -3
  382. package/templates/.agents/skills/review-pr/reference/report-template.zh-CN.md +4 -3
  383. package/templates/.agents/skills/run-manual-validation/SKILL.en.md +9 -3
  384. package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +9 -3
  385. package/templates/.agents/skills/run-manual-validation/reference/report-template.en.md +3 -1
  386. package/templates/.agents/skills/run-manual-validation/reference/report-template.zh-CN.md +3 -1
  387. package/templates/.agents/skills/test/SKILL.en.md +13 -2
  388. package/templates/.agents/skills/test/SKILL.zh-CN.md +13 -2
  389. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +14 -0
  390. package/templates/.agents/skills/watch-pr/SKILL.en.md +2 -2
  391. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +2 -2
  392. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +6 -0
  393. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +6 -0
  394. package/templates/.agents/templates/task.en.md +24 -1
  395. package/templates/.agents/templates/task.zh-CN.md +24 -1
  396. package/templates/.github/workflows/pr-label.yml +7 -26
  397. package/templates/.agents/scripts/security-alerts.github.sh +0 -151
  398. package/templates/.agents/scripts/security-alerts.sh +0 -31
  399. package/templates/.agents/skills/init-labels/scripts/init-labels.github.sh +0 -146
  400. package/templates/.agents/skills/init-labels/scripts/init-labels.sh +0 -32
  401. package/templates/.agents/skills/init-milestones/scripts/init-milestones.github.sh +0 -294
  402. package/templates/.agents/skills/init-milestones/scripts/init-milestones.sh +0 -6
@@ -9,9 +9,15 @@ 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 使用同一组值。
13
+
12
14
 
13
15
  ## 行为边界 / 关键规则
14
16
 
17
+ ### 持久化报告证据
18
+
19
+ 生成验证完成报告时,先读取 `.agents/rules/evidence-reporting.md`。状态核对和同步结果记录命令、范围、结构化结果、实际结论和未覆盖部分;继续遵守人工验证的 basename-only 与 sanitized result 脱敏边界。
20
+
15
21
  - 本技能用于收尾已有 PR 摘要评论中的人工校验状态,不创建并行的普通验证留言。
16
22
  - 必须写入 `manual-validation.md` 或 `manual-validation-r{N}.md`,让后续 PR 摘要刷新可复用人工验证结果。
17
23
  - 找不到 `sync-pr` 摘要评论时失败,不创建部分摘要兜底。
@@ -24,7 +30,7 @@ description: >
24
30
 
25
31
  在加载 workflow / skill / rules 指令之后、做任何任务状态判断或用户可见结论之前,必须先执行状态核对。指令类文件读取不算对外动作或结论。
26
32
 
27
- 运行以下命令,并把原文粘贴到本轮产物的 `## 状态核对` 段:
33
+ 运行以下命令,并在本轮产物的 `## 状态核对` 段记录任务/产物范围、关键结果和未覆盖部分;正常成功不粘贴完整目录清单或 `task.md` 尾部。失败、阻塞、身份不一致或争议时,附决定性原文行:
28
34
 
29
35
  ```bash
30
36
  agent-infra-internal task-snapshot {task-id} --format text
@@ -38,7 +44,7 @@ agent-infra-internal task-snapshot {task-id} --format text
38
44
 
39
45
  ## 步骤开始:声明 started 事件
40
46
 
41
- 确认前置条件和产物上下文后、本轮第一个产出动作之前执行 `agent-infra-internal task-event {task-id} manual-validation.started --agent {standard-agent-token}`,并以返回的 `artifactContext` 记录本轮身份。
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` 记录本轮身份。
42
48
 
43
49
  ## 执行步骤
44
50
 
@@ -86,7 +92,7 @@ complete-manual-validation [--task <ref> | -t <ref>] [{pr-ref}] {verification-su
86
92
 
87
93
  ### 6. 更新 task.md
88
94
 
89
- 执行 `agent-infra-internal task-event {task-id} manual-validation.completed --agent {standard-agent-token} --artifact {manual-validation-artifact} --summary-result "{summary-result}"`,由核心在保持 `current_step` 不变的同时原子登记实现备注链接、时间/版本和完成日志。
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` 不变的同时原子登记实现备注链接、时间/版本和完成日志。
90
96
 
91
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}`。
92
98
 
@@ -109,7 +115,7 @@ agent-infra-internal task-verify {task-id} manual-validation.completed --artifac
109
115
  - 产物路径
110
116
  - PR 摘要同步结果
111
117
  - 当次完成校验输出
112
- - 下一步建议:进入最终收尾流程,运行 /complete-task {task-ref}
118
+ - 下一步建议:进入最终收尾流程,运行 /complete-task --task {task-ref}
113
119
 
114
120
  渲染最终输出前,先读取 `.agents/rules/next-step-output.md`,并在绝对最后一行追加 `Completed at: YYYY-MM-DD HH:mm:ss`。
115
121
 
@@ -15,6 +15,7 @@ $ git status -s
15
15
  $ ls -la .agents/workspace/active/{task-id}/
16
16
  $ tail .agents/workspace/active/{task-id}/task.md
17
17
  ```
18
+ > Follow `.agents/rules/evidence-reporting.md`: record task scope, key result, and uncovered parts; do not paste the complete directory listing or task tail for normal success.
18
19
 
19
20
  ## Validation Verdict
20
21
 
@@ -46,3 +47,4 @@ $ tail .agents/workspace/active/{task-id}/task.md
46
47
  - Derive `Validation Scope` from the PR summary's manual-verification section.
47
48
  - `PR Summary Sync` must record success, skip, or failure.
48
49
  - Only write a passing artifact after the summary comment is updated or skipped because there is no diff.
50
+ - Successful synchronization records the command, scope, structured result, and actual conclusion; failures, blocking conditions, or disputes retain decisive excerpts and manual-validation redaction boundaries.
@@ -15,6 +15,7 @@ $ git status -s
15
15
  $ ls -la .agents/workspace/active/{task-id}/
16
16
  $ tail .agents/workspace/active/{task-id}/task.md
17
17
  ```
18
+ > 按 `.agents/rules/evidence-reporting.md` 记录任务范围、关键结果和未覆盖部分;正常成功不粘贴完整目录清单或 task tail。
18
19
 
19
20
  ## 验证结论
20
21
 
@@ -46,3 +47,4 @@ $ tail .agents/workspace/active/{task-id}/task.md
46
47
  - `验证范围` 来自 PR 摘要评论中的 `### ⚠️ 需人工校验` 段。
47
48
  - `PR 摘要同步` 必须记录成功、跳过或失败结果。
48
49
  - 只有在摘要评论已成功更新或无 diff 跳过时,才写入通过产物。
50
+ - 成功同步记录命令、范围、结构化结果和实际结论;失败、阻塞或争议保留决定性摘录,并继续遵守人工验证脱敏边界。
@@ -6,11 +6,12 @@ Follow `.agents/rules/pr-sync.md` for the shared summary structure and failure s
6
6
 
7
7
  1. After the canonical `manual-validation*` artifact is written, run `agent-infra-internal platform-pr summary-context {task-id}`.
8
8
  2. Rebuild the summary from canonical inputs and render `### ✅ Manual Validation Passed` with the validation time and explanation.
9
- 3. Write the plain body to a temporary file and run:
9
+ 3. Write the plain body with exactly one `<!-- canonical-pr-change-report -->` placeholder to a temporary file and run:
10
10
 
11
11
  ```bash
12
12
  agent-infra-internal platform-pr summary-sync {task-id} \
13
- --agent {standard-agent-token} --body-file {summary-body-file}
13
+ --agent {standard-agent-token} --body-file {summary-body-file} \
14
+ --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json --result no_op
14
15
  ```
15
16
 
16
- The core owns marker/HEAD wrapping, pagination, and in-place reconciliation. If context says no manual validation is required, stop without marking it passed.
17
+ The core owns the rendered report, marker/authoritative PR-head wrapping, pagination, and in-place reconciliation. If context says no manual validation is required, stop without marking it passed.
@@ -6,13 +6,14 @@
6
6
 
7
7
  1. 在 canonical `manual-validation*` artifact 落盘后,调用 `agent-infra-internal platform-pr summary-context {task-id}`。
8
8
  2. 从返回的最新产物重新聚合摘要,将人工校验段渲染为 `### ✅ 人工验证已通过`,写明验证时间和说明。
9
- 3. 把纯正文写入临时文件,调用:
9
+ 3. 把只含一次 `<!-- canonical-pr-change-report -->` 的纯正文写入临时文件,调用:
10
10
 
11
11
  ```bash
12
12
  agent-infra-internal platform-pr summary-sync {task-id} \
13
- --agent {standard-agent-token} --body-file {summary-body-file}
13
+ --agent {standard-agent-token} --body-file {summary-body-file} \
14
+ --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json --result no_op
14
15
  ```
15
16
 
16
- marker、当前 HEAD、分页查找和原地更新由 core 负责。若当前 context 表明无需人工校验,则停止并返回 `summary failed: no manual validation required`,不误标通过。
17
+ marker、报告段、权威 PR head、分页查找和原地更新由 core 负责。若当前 context 表明无需人工校验,则停止并返回 `summary failed: no manual validation required`,不误标通过。
17
18
 
18
19
  结果回传:`summary updated`、`summary skipped (no diff)` 或 `summary failed: <reason>`。
@@ -14,6 +14,10 @@ Host finalization uses receipt v2 with an immutable `receiptId`, monotonic `revi
14
14
 
15
15
  ## Boundary / Critical Rules
16
16
 
17
+ ### Persisted Report Evidence
18
+
19
+ Before generating a completion report or synchronized content, read `.agents/rules/evidence-reporting.md`. Successful checks record the command, scope, status or structured result, actual result, and uncovered parts; failures, blocking conditions, or disputes retain a reproducible entry point, exact location, and decisive excerpt.
20
+
17
21
  - This command updates task metadata AND physically moves the task directory
18
22
  - Do not move a task that has incomplete workflow steps unless forced
19
23
  - The entry point accepts optional `--external-pr <N>` only to select among ambiguous external-delivery candidates; it never bypasses identity or platform gates
@@ -24,7 +28,7 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
24
28
 
25
29
  After loading workflow / skill / rules instructions, and before any task-state judgment or user-visible conclusion, run the state check first. Reading instruction files does not count as an external-state action or conclusion.
26
30
 
27
- Run these commands and paste the raw output into this round's `## State Check` section:
31
+ Run these commands and record the task/artifact scope, key result, and uncovered parts in this round's `## State Check` section; do not paste complete directory listings or task tails on normal success. Retain decisive raw lines only for failures, blocking conditions, identity mismatches, or disputes:
28
32
 
29
33
  ```bash
30
34
  agent-infra-internal task-snapshot {task-id} --format text
@@ -87,14 +91,14 @@ agent-infra-internal platform-pr resolve-external {task-id} --agent {standard-ag
87
91
  Two-option guidance for absent + `pending`:
88
92
  ```
89
93
  Task {task-id} has no PR delivery decision yet (pr_delivery_fact: unbound). Choose one:
90
- - Go through the PR flow: /create-pr {task-ref}
91
- - Explicitly skip and complete: /complete-task {task-ref} --skip-pr
94
+ - Go through the PR flow: /create-pr --task {task-ref}
95
+ - Explicitly skip and complete: /complete-task --task {task-ref} --skip-pr
92
96
  ```
93
97
 
94
98
  Stop message for `required` + `pending`/`skipped`:
95
99
  ```
96
100
  This project enforces the PR flow (prFlow: "required") and the task has no PR yet.
97
- Run /create-pr {task-ref} first, then complete; --skip-pr is not accepted under a mandatory PR flow.
101
+ Run /create-pr --task {task-ref} first, then complete; --skip-pr is not accepted under a mandatory PR flow.
98
102
  ```
99
103
 
100
104
  Before lifecycle, verify only the hard gates:
@@ -123,7 +127,7 @@ If a hard gate is not met, stop immediately and do not execute Steps 3-8.
123
127
  ### 3. Complete Business-Only Content
124
128
 
125
129
  Update only content that the lifecycle core does not own:
126
- - Add or update the `## State Check` section with the raw Step 0 audit command output, including `$ ` prompt lines, before `## Activity Log`
130
+ - Add or update the `## State Check` section with the Step 0 audit command, task/artifact scope, key result, and uncovered parts; for normal success, do not copy the full directory listing or `task.md` tail, and include decisive raw lines only for failures, blocking, identity mismatches, or disputes, before `## Activity Log`
127
131
  - Mark all workflow steps as complete
128
132
  - Verify and check off all items in `## Completion Checklist` (change `- [ ]` to `- [x]`)
129
133
 
@@ -167,36 +171,37 @@ If a summary must mirror a human-decided `post-review-commit` exemption, make a
167
171
 
168
172
  `--force` cannot lift identity, concurrency, local atomicity, or required-PR hard gates; failures there must stop. Other review, manual-validation, and platform evidence is recorded by terminal verification as warning/pending and can be repaired by retrying.
169
173
 
170
- ### 6. Run the Host Finalization Entry Point and Verify the Terminal State
174
+ ### 6. Run the Host Finalization Entry Point
171
175
 
172
176
  ```bash
173
177
  agent-infra-internal task-finalization {task-id} complete --agent {standard-agent-token}
174
178
  ```
175
179
 
176
- Finalization runs lifecycle -> the terminal task comment -> the `complete-task.completed` gate in a fixed order and records each step in the host receipt. `result=completed` means lifecycle completed safely; if peripheral warnings remain, return `result=completed_with_warnings`, warnings, and pending steps. Use `result=failed` or `result=blocked` only for hard or receipt/capability failures, then fix the cause and retry through the same entry point; do not claim completion or hand-repair partial state.
177
-
178
- ```bash
179
- ls .agents/workspace/completed/{task-id}/task.md
180
- ```
181
-
182
- Check the task directory only after finalization returns `status=completed`.
180
+ Finalization runs lifecycle -> the terminal task comment -> the `complete-task.completed` gate in a fixed order and records each step in the host receipt. `result=completed` means the host safely completed the task from structured results and the receipt; if peripheral warnings remain, return `result=completed_with_warnings`, warnings, and pending steps. Use `result=failed` or `result=blocked` only for hard or receipt/capability failures, then fix the cause and retry through the same entry point; do not claim completion or hand-repair partial state. A sandbox must not run `ls completed` or a local terminal verification against its historical mount to re-decide this result.
183
181
 
184
182
  ### 7. Handle Finalization Retries and Results
185
183
 
186
184
  Both Scenario A and Scenario B `finalization-retry` run the same `task-finalization` entry point from the host. The receipt is only a re-entry hint, not canonical truth: every re-entry revalidates the terminal task comment and completion gate; only an already `completed` task with its short-id registry entry released may skip the irreversible lifecycle. Do not split the operation into the former lifecycle, comment-sync, or completion-gate commands. If the task comment or gate is blocked by the network, preserve the receipt and completed steps, fix the network, and rerun complete-task. If lifecycle has not completed, keep the task active and resume the pending steps from the receipt.
187
185
 
188
- The result must include the structured output from this finalization run, confirming that the task artifact and sync state are valid:
186
+ Consume the structured finalization result, receipt, and warning projection directly. Continue only for `completed` or `completed_with_warnings`; preserve the receipt and stop for `failed`, `blocked`, or `unknown`, then retry through the same finalization entry point. Do not run `ls completed` or `task-verify complete-task.completed` from a stale sandbox mount, and do not let that local result overrule the host result.
187
+
188
+ ### Accepted sandbox-control result recovery
189
+
190
+ When this skill is invoked from a sandbox and the control client reports an
191
+ accepted request without a terminal result, preserve the request identity. The
192
+ client prints `SANDBOX_CONTROL_REQUEST_ID: <request-id>` on stderr for this
193
+ case. After the broker is healthy again, recover the same terminal response:
189
194
 
190
195
  ```bash
191
- agent-infra-internal task-verify {task-id} complete-task.completed --format text
196
+ agent-infra-internal sandbox-control recover <request-id>
192
197
  ```
193
198
 
194
- Handle the result as follows:
195
- - `status=completed` / exit code 0 (all checks passed) -> continue to the "Inform User" step
196
- - `status=failed` / exit code 1 -> fix the reported issues and run finalization again
197
- - `status=blocked` / exit code 2 -> preserve the receipt and completed steps and stop; rerun complete-task later to enter `finalization-retry`
198
-
199
- Keep the gate output in your reply as fresh evidence. Do not claim completion without output from this run.
199
+ Do not submit a new request for an accepted task finalization. The broker's
200
+ `processing/<request-id>/result.json` is private transport evidence; it is not
201
+ a task receipt and cannot by itself prove completion. The finalization receipt
202
+ and the host completion gate remain authoritative. If the request was rejected
203
+ before acceptance, a new request ID may be used according to the error's
204
+ retryability.
200
205
 
201
206
  ### 8. Inform User
202
207
 
@@ -14,6 +14,10 @@ description: >
14
14
 
15
15
  ## 行为边界 / 关键规则
16
16
 
17
+ ### 持久化报告证据
18
+
19
+ 生成收尾报告或同步内容时,先读取 `.agents/rules/evidence-reporting.md`。成功检查记录命令、范围、状态/结构化结果、实际结果和未覆盖部分;失败、阻塞或争议保留复现入口、准确位置和决定性摘录。
20
+
17
21
  - 本命令更新任务元数据并物理移动任务目录
18
22
  - 除非强制执行,不要转移有未完成工作流步骤的任务
19
23
  - 入口接受可选 `--external-pr <N>`;仅用于外部交付候选歧义时的显式选择,不绕过身份或平台门禁
@@ -24,7 +28,7 @@ description: >
24
28
 
25
29
  在加载 workflow / skill / rules 指令之后、做任何任务状态判断或用户可见结论之前,必须先执行状态核对。指令类文件读取不算对外动作或结论。
26
30
 
27
- 运行以下命令,并把原文粘贴到本轮产物的 `## 状态核对` 段:
31
+ 运行以下命令,并在本轮产物的 `## 状态核对` 段记录任务/产物范围、关键结果和未覆盖部分;正常成功不粘贴完整目录清单或 `task.md` 尾部。失败、阻塞、身份不一致或争议时,附决定性原文行:
28
32
 
29
33
  ```bash
30
34
  agent-infra-internal task-snapshot {task-id} --format text
@@ -86,14 +90,14 @@ agent-infra-internal platform-pr resolve-external {task-id} --agent {standard-ag
86
90
  缺省 + `pending` 的二选一引导消息:
87
91
  ```
88
92
  任务 {task-id} 尚未决定 PR 交付(pr_delivery_fact: unbound)。请二选一:
89
- - 走 PR 流程:/create-pr {task-ref}
90
- - 显式跳过并完成:/complete-task {task-ref} --skip-pr
93
+ - 走 PR 流程:/create-pr --task {task-ref}
94
+ - 显式跳过并完成:/complete-task --task {task-ref} --skip-pr
91
95
  ```
92
96
 
93
97
  `required` + `pending`/`skipped` 的停止消息:
94
98
  ```
95
99
  当前项目强制 PR 流程(prFlow: "required"),任务尚未创建 PR。
96
- 请先运行 /create-pr {task-ref} 创建 PR 后再完成;--skip-pr 在强制 PR 下不被接受。
100
+ 请先运行 /create-pr --task {task-ref} 创建 PR 后再完成;--skip-pr 在强制 PR 下不被接受。
97
101
  ```
98
102
 
99
103
  生命周期前只验证硬门禁:
@@ -122,7 +126,7 @@ Please satisfy the hard prerequisite first, then retry complete-task.
122
126
  ### 3. 完成业务内容更新
123
127
 
124
128
  在 `.agents/workspace/active/{task-id}/task.md` 中只更新生命周期核心不负责的业务内容:
125
- - 新增或更新 `## 状态核对` 段,粘贴第 0 步审计命令原文(含 `$ ` 前缀行),放在 `## 活动日志` 之前
129
+ - 新增或更新 `## 状态核对` 段,记录第 0 步审计命令、任务/产物范围、关键结果和未覆盖部分;正常成功不复制完整目录清单或 `task.md` 尾部,失败、阻塞、身份不一致或争议时附决定性原文行,放在 `## 活动日志` 之前
126
130
  - 标记所有工作流步骤为已完成
127
131
  - 逐项验证并勾选 `## 完成检查清单` 中的所有条目(将 `- [ ]` 改为 `- [x]`)
128
132
 
@@ -166,36 +170,36 @@ agent-infra-internal task-verify {task-id} complete-task.preflight --format text
166
170
 
167
171
  `--force` 不能解除身份、并发、本地原子性或 required-PR hard gate;这些能力失败时必须停止。其余审查、人工校验和平台证据由 terminal verification 记录为 warning/pending,并通过后续重试恢复。
168
172
 
169
- ### 6. 执行宿主 finalization 入口并验证终态
173
+ ### 6. 执行宿主 finalization 入口
170
174
 
171
175
  ```bash
172
176
  agent-infra-internal task-finalization {task-id} complete --agent {standard-agent-token}
173
177
  ```
174
178
 
175
- finalization 按 lifecycle → task 评论 → `complete-task.completed` 校验的固定顺序执行,并将每一步的状态写入宿主 receipt。`result=completed` 即表示 lifecycle 已安全完成;若还有外围 warning,返回 `result=completed_with_warnings`、warnings 和 pending steps。`result=failed` 或 `result=blocked` 仅用于硬失败或 receipt/capability 失败,修复原因后以同一入口重试,不得宣称完成或手工补写局部状态。
176
-
177
- ```bash
178
- ls .agents/workspace/completed/{task-id}/task.md
179
- ```
180
-
181
- 仅在 finalization 返回 `status=completed` 后确认任务目录已成功移动。
179
+ finalization 按 lifecycle → task 评论 → `complete-task.completed` 校验的固定顺序执行,并将每一步的状态写入宿主 receipt。`result=completed` 即表示宿主已依据结构化结果和 receipt 安全完成;若还有外围 warning,返回 `result=completed_with_warnings`、warnings 和 pending steps。`result=failed` 或 `result=blocked` 仅用于硬失败或 receipt/capability 失败,修复原因后以同一入口重试,不得宣称完成或手工补写局部状态。沙箱不得从旧挂载执行 `ls completed` 或本地终态校验来重新裁决该结果。
182
180
 
183
181
  ### 7. 处理 finalization 重试与结果
184
182
 
185
183
  场景 A 与场景 B `finalization-retry` 都从宿主执行同一个 `task-finalization` 入口。receipt 只是重入提示,不是 canonical truth:每次重入都要重新验证终态 task 评论和完成校验;只有任务已处于 `completed` 且短号 registry 已释放时,才可跳过不可逆的 lifecycle。不得拆开调用旧的 lifecycle、评论同步或完成校验命令。若 task 评论或校验因网络问题返回 `blocked`,保留 receipt 和已完成状态,修复网络后重跑 complete-task;若生命周期仍未完成,任务保持 active 并从 receipt 的待处理步骤继续。
186
184
 
187
- 完成结果必须包含本次 finalization 的结构化输出,确认任务产物和同步状态符合规范:
185
+ 完成结果必须直接消费本次宿主 finalization 的结构化输出、receipt 和 warning projection。`completed` 或 `completed_with_warnings` 才允许继续;`failed` / `blocked` / `unknown` 必须保留 receipt 并停止,之后通过同一 finalization 入口重试。不要在沙箱旧挂载中另行运行 `ls completed` 或 `task-verify complete-task.completed`,也不要用其结果推翻宿主结果。
186
+
187
+ ### accepted 后的 sandbox-control 结果恢复
188
+
189
+ 如果本技能在沙箱内执行,且 control client 报告请求已经 accepted 但没有
190
+ terminal result,必须保留原 request identity。此时 client 会在 stderr 输出
191
+ `SANDBOX_CONTROL_REQUEST_ID: <request-id>`。broker 恢复健康后,使用同一个
192
+ request ID 读取 terminal response:
188
193
 
189
194
  ```bash
190
- agent-infra-internal task-verify {task-id} complete-task.completed --format text
195
+ agent-infra-internal sandbox-control recover <request-id>
191
196
  ```
192
197
 
193
- 处理结果:
194
- - `status=completed` / 退出码 0(全部通过)-> 继续到「告知用户」步骤
195
- - `status=failed` / 退出码 1 -> 根据输出修复问题后重新运行 finalization
196
- - `status=blocked` / 退出码 2 -> 保留 receipt 与已完成的步骤并停止;稍后重跑 complete-task 进入 `finalization-retry`
197
-
198
- 将校验输出保留在回复中作为当次验证输出。没有当次校验输出,不得声明完成。
198
+ accepted 的 task finalization 不得提交新请求。broker 的
199
+ `processing/<request-id>/result.json` 只是私有 transport evidence,不是 task
200
+ receipt,单凭它不能证明任务完成;finalization receipt 和宿主完成校验仍是
201
+ 权威。如果请求在 accepted 之前已被拒绝,则可依据错误的 retryability 使用
202
+ 新的 request ID。
199
203
 
200
204
  ### 8. 告知用户
201
205
 
@@ -74,19 +74,19 @@ If `{task-id}` is available and the related task provides `issue_number`, keep `
74
74
 
75
75
  ### 6. Sync PR Metadata
76
76
 
77
- Capture the `result` field from `platform-pr create` (`pr_created`, `pr_reused`, or `no_op`), then run `agent-infra-internal platform-pr sync {task-id} --agent {standard-agent-token} --metadata --closing-issue --result {primary-result}`. The core copies type / `in:` labels, assignee, and a specific milestone from the Issue and maintains the closing association. Permission-bound items degrade independently, and the Issue is never updated in reverse. After the PR identity is bound, metadata or summary sync failures produce `pr_created_with_warnings`, `pr_reused_with_warnings`, or `no_op_with_warnings` from that primary result, preserve the primary-action fact, and retry only unfinished sync steps.
77
+ Capture the `result` field from `platform-pr create` (`pr_created`, `pr_reused`, or `no_op`), then run `agent-infra-internal platform-pr sync {task-id} --agent {standard-agent-token} --metadata --closing-issue --result {primary-result}`. The shared core computes one `in:` target from task-bound diff/PR evidence and the repository mapping, converges a unique closing Issue before the PR, and syncs other metadata from the Issue. It never copies `in:` labels back from the Issue or removes unrelated labels. Permission failures degrade independently; partial side effects return blocked/`IN_LABEL_SYNC_PARTIAL`.
78
78
 
79
79
  ### 7. Generate the PR Code Change Report
80
80
 
81
- After creating or uniquely reusing the PR, run `agent-infra-internal platform-pr inspect {task-id}` to obtain the authoritative base/head SHAs, then follow `reference/change-report.md` to classify the complete PR line counts, Git blob byte sizes, renames, and potentially unnecessary changes. Read that reference before this step.
81
+ After creating or uniquely reusing the PR, run `agent-infra-internal platform-pr inspect {task-id}` to obtain the authoritative base/head SHAs, then follow `reference/change-report.md` for the mechanical complete-PR report. Combine the task goal with the complete three-dot diff to produce a six-check precheck candidate with file evidence, then run `platform-pr change-report` to write the task-bound `pr-change-report.json` sidecar. Read that reference before this step.
82
82
 
83
- The report is part of the reviewer summary below and must also appear in the final user response. Do not provide only total lines, omit byte changes, or inspect only the last commit.
83
+ The core renderer owns the report section. It is part of the reviewer summary below and must also appear in the final user response. Do not provide only total lines, omit byte changes, inspect only the last commit, or let the caller assemble the report section.
84
84
 
85
85
  ### 8. Publish the Review Summary
86
86
 
87
87
  Read the latest context artifacts when they exist: `plan.md` / `plan-r{N}.md`, `review-plan.md` / `review-plan-r{N}.md`, `code.md` / `code-r{N}.md`, and `review-code.md` / `review-code-r{N}.md`.
88
88
 
89
- Aggregate a reviewer-facing summary from those artifacts, append the `### PR Code Changes` section generated in step 7, and maintain a single idempotent summary comment via the hidden marker. Pass the same `--result {primary-result}` to `summary-sync`; a sync substep must not infer whether the PR was created or reused.
89
+ Aggregate a reviewer-facing summary from those artifacts with exactly one `<!-- canonical-pr-change-report -->` placeholder, and maintain a single idempotent summary comment via the hidden marker. Pass `--change-report-file .agents/workspace/active/{task-id}/pr-change-report.json` and the same `--result {primary-result}` to `summary-sync`; a sync substep must not infer whether the PR was created or reused.
90
90
 
91
91
  > Canonical context, aggregation, and the `summary-sync` call live in `reference/comment-publish.md`, which points to `.agents/rules/pr-sync.md`. Read that reference before publishing.
92
92
 
@@ -139,14 +139,15 @@ Next step (alternative) - Skip active monitoring and attempt completion:
139
139
 
140
140
  - Review every commit in the branch, not only the latest one
141
141
  - `create-pr` must not defer type-label mapping to another skill; inline the mapping here when `{task-id}` is available
142
- - The summary marker and current HEAD are wrapped by `platform-pr summary-sync`
142
+ - The summary marker, authoritative PR head, and `### PR Code Changes` section are wrapped by `platform-pr summary-sync`
143
+ - An existing PR still goes through binding, report generation, summary synchronization, and result verification; reuse must not end the flow early
143
144
  - When metadata inheritance from the Issue fails, continue with task.md and branch-based fallbacks
144
145
 
145
146
  ## Error Handling
146
147
 
147
148
  - No commits found between `{target}` and `HEAD`
148
149
  - Push rejected: suggest `git pull --rebase`
149
- - Existing PR found: show the current PR URL and stop
150
+ - Existing PR found: continue through binding, report generation, summary synchronization, and result verification before showing the current PR URL
150
151
  - Inaccessible Issue metadata: skip inheritance and continue
151
152
  - PR creation failed with an associated `{task-id}`: run `agent-infra-internal task-warning {task-id} add --step create-pr --severity ACTION_REQUIRED --code PR_CREATE_FAILED --target pr --message "{reason}" --action "Fix push, permission, or platform issues and rerun create-pr"` to submit a structured warning intent, and do not write an incomplete `pr_delivery_fact`
152
153
  - PR summary comment failed with an associated `{task-id}`: record a `COMMENT_SYNC_FAILED` warning per `.agents/rules/pr-sync.md`, without rolling back an already-created PR
@@ -74,19 +74,19 @@ description: >
74
74
 
75
75
  ### 6. 同步 PR 元数据
76
76
 
77
- 记录 `platform-pr create` 结构化结果中的 `result`(`pr_created`、`pr_reused` 或 `no_op`),并调用 `agent-infra-internal platform-pr sync {task-id} --agent {standard-agent-token} --metadata --closing-issue --result {primary-result}`。core 从 Issue 复制 type / `in:` labels、assignee 和具体 milestone,并维护 Development 关联;逐项权限不足返回 degraded,不反向更新 Issue。PR 已成功绑定后,metadata/summary 同步失败只产生与 primary result 对应的 `pr_created_with_warnings`、`pr_reused_with_warnings` 或 `no_op_with_warnings`,保留主动作事实,重试只执行未完成的同步步骤。
77
+ 记录 `platform-pr create` 结构化结果中的 `result`(`pr_created`、`pr_reused` 或 `no_op`),并调用 `agent-infra-internal platform-pr sync {task-id} --agent {standard-agent-token} --metadata --closing-issue --result {primary-result}`。`in:` target 由 shared core 根据 task-bound diff/PR evidence 和仓库映射计算,唯一 closing Issue 按 Issue→PR 顺序收敛,其他 metadata 仍从 Issue 同步;不从 Issue 反向复制 `in:`,也不清除非 `in:` labels。权限不足逐项返回 degraded,部分副作用返回 blocked/`IN_LABEL_SYNC_PARTIAL`。
78
78
 
79
79
  ### 7. 生成 PR 代码增减报告
80
80
 
81
- 创建或唯一复用 PR 后,调用 `agent-infra-internal platform-pr inspect {task-id}` 取得权威 base/head SHA,并按 `reference/change-report.md` 统计完整 PR 的分类行数、Git blob 字节数、rename 与疑似不必要变化。执行本步骤前先读取该 reference。
81
+ 创建或唯一复用 PR 后,调用 `agent-infra-internal platform-pr inspect {task-id}` 取得权威 base/head SHA,并按 `reference/change-report.md` 生成完整 PR 的机械统计。结合任务目标与完整三点 diff 生成六项带文件证据的 precheck candidate,再调用 `platform-pr change-report` 写入任务绑定的 `pr-change-report.json` sidecar。执行本步骤前先读取该 reference。
82
82
 
83
- 报告既是下方 reviewer 摘要的一部分,也必须出现在最终用户回复中;不得只给总行数、忽略字节变化或只统计最后一个 commit。
83
+ 报告由 core renderer 生成,既是下方 reviewer 摘要的一部分,也必须出现在最终用户回复中;不得只给总行数、忽略字节变化、只统计最后一个 commit,或由调用方自行拼接报告段。
84
84
 
85
85
  ### 8. 发布审查摘要
86
86
 
87
87
  读取最新的上下文产物:`plan.md` / `plan-r{N}.md`、`review-plan.md` / `review-plan-r{N}.md`、`code.md` / `code-r{N}.md`、`review-code.md` / `review-code-r{N}.md`(存在时)。
88
88
 
89
- 基于这些产物聚合 reviewer 摘要,并追加第 7 步生成的 `### PR 代码增减` 段落,再使用隐藏标记维护唯一且幂等的摘要评论。调用 `summary-sync` 时继续传递同一个 `--result {primary-result}`,不得根据同步子步骤猜测 PR 是创建还是复用。
89
+ 基于这些产物聚合 reviewer 摘要,正文只放一次 `<!-- canonical-pr-change-report -->` 占位符,再使用隐藏标记维护唯一且幂等的摘要评论。调用 `summary-sync` 时传入 `--change-report-file .agents/workspace/active/{task-id}/pr-change-report.json`,并继续传递同一个 `--result {primary-result}`;不得根据同步子步骤猜测 PR 是创建还是复用。
90
90
 
91
91
  > canonical context、摘要聚合和 `summary-sync` 调用见 `reference/comment-publish.md`(其引用 `.agents/rules/pr-sync.md`)。发布摘要前先读取该 reference。
92
92
 
@@ -139,15 +139,15 @@ agent-infra-internal task-verify {task-id} create-pr.completed --format text
139
139
 
140
140
  - 必须检查分支中的全部提交,而不是只看最后一个
141
141
  - `create-pr` 不能把 type label 映射委托给其他技能,必须在获取到 `{task-id}` 时于本技能内内联处理
142
- - summary marker 与当前 HEAD 由 `platform-pr summary-sync` 统一包装
143
- - 如果当前分支已存在 PR,直接告知用户 PR URL 并结束,不做重复同步
142
+ - summary marker、权威 PR head 和 `### PR 代码增减` 由 `platform-pr summary-sync` 统一包装
143
+ - 如果当前分支已存在 PR,仍须完成绑定、报告生成、摘要同步和结果校验;不得因复用而直接结束
144
144
  - 如果从 Issue 继承元数据失败,继续使用 task.md 和分支推断兜底
145
145
 
146
146
  ## 错误处理
147
147
 
148
148
  - `{target}` 与 `HEAD` 之间没有可提交内容
149
149
  - 推送被拒绝:建议执行 `git pull --rebase`
150
- - 已存在 PR:直接输出当前 PR URL 并结束
150
+ - 已存在 PR:继续完成绑定、报告生成、摘要同步和结果校验后输出当前 PR URL
151
151
  - 无法访问 Issue 元数据:跳过继承并继续
152
152
  - PR 创建失败且已关联 `{task-id}`:调用 `agent-infra-internal task-warning {task-id} add --step create-pr --severity ACTION_REQUIRED --code PR_CREATE_FAILED --target pr --message "{reason}" --action "修复推送、权限或平台问题后重跑 create-pr"` 提交结构化 warning 意图,不写不完整 `pr_delivery_fact`
153
153
  - PR 摘要评论失败且已关联 `{task-id}`:按 `.agents/rules/pr-sync.md` 记录 `COMMENT_SYNC_FAILED` 告警,不回滚已创建 PR
@@ -21,6 +21,7 @@
21
21
  "when": "issue_number_exists",
22
22
  "expected_pr_comment_marker": "<!-- sync-pr:{task-id}:summary -->",
23
23
  "verify_in_labels_match_pr": true,
24
+ "verify_in_labels_computed": true,
24
25
  "verify_pr_type_label": true,
25
26
  "verify_pr_assignee": true,
26
27
  "verify_issue_fields": true,
@@ -4,7 +4,7 @@
4
4
  {"source":"platform-pr-inspect","diff":"three-dot-find-renames","metrics":["numstat-lines","git-blob-bytes"],"publish":["pr-summary","user-response"]}
5
5
  -->
6
6
 
7
- After a PR is created or uniquely reused, use the authoritative `base.sha` and `head.sha` returned by `platform-pr inspect` to measure the complete PR diff. Do not substitute the last commit or current worktree state.
7
+ After a PR is created or uniquely reused, use the authoritative `base.sha` and `head.sha` returned by `platform-pr inspect` to measure the complete PR diff. Do not substitute the last commit or current worktree state. The task-intent digest covers only the semantic section from `# Task`/`# 任务` through `## Context`/`## 上下文`, so lifecycle logs, receipts, and version metadata do not stale a sidecar for the same head.
8
8
 
9
9
  ## Evidence Commands
10
10
 
@@ -14,6 +14,18 @@ git diff --find-renames --name-status {base-sha}...{head-sha}
14
14
  git diff --find-renames --summary {base-sha}...{head-sha}
15
15
  ```
16
16
 
17
+ Pass the script JSON and the model-generated six-check precheck candidate to the typed core:
18
+
19
+ ```bash
20
+ agent-infra-internal platform-pr change-report {task-id} \
21
+ --agent {standard-agent-token} --mechanical-file {mechanical-report-file} \
22
+ --precheck-file {precheck-candidate-file}
23
+ ```
24
+
25
+ The core validates the task-intent digest, PR identity, complete patch SHA, totals, and the ordered checks `target-alignment`, `change-composition`, `compatibility-policy`, `legacy-path-cleanup`, `redundancy`, and `scope-discipline`. A `needs-review` check routes to `review-code`; `formalReview` remains `false`.
26
+
27
+ When generating the candidate, each check's `rationale` must state its actual finding: `target-alignment` explains the goal relationship, `change-composition` summarizes where new code concentrates responsibilities, `compatibility-policy` states the compatibility result, `legacy-path-cleanup` states how legacy paths were handled, `redundancy` states the redundancy result, and `scope-discipline` states the scope judgment. Do not reuse generic phrases such as "within scope" across checks; each check must provide at least one directly relevant path, line range, and concise `detail`, using the deployed skill's language. Chinese skill deployments must use Chinese. These high-level rationales and evidence are rendered in the canonical summary.
28
+
17
29
  The script calculates both `numstat` line counts and exact Git blob byte sizes between the merge base and head. Bytes provide a stable unit, cover binary files, and reveal same-line compaction; submodules are not blobs and contribute zero bytes. Added files have zero old bytes, deleted files have zero new bytes, pure renames have zero net bytes, and copies count only the new destination content.
18
30
 
19
31
  Count binary files in the file total but do not invent line counts for `-` numstat values. Explain renames and copies from the script's per-file records, `name-status`, and `summary` so moves are not reported as full rewrites.
@@ -31,7 +43,7 @@ Using the repository's actual structure, assign every file to exactly one closes
31
43
 
32
44
  The table must contain component, file count, added lines, deleted lines, net lines, old bytes, new bytes, and net bytes, followed by a total row. Byte columns describe the blob content size of files involved in this change, not disk usage for the entire repository or worktree. Use exact integers; optional KiB/MiB values may aid readability but must not replace byte counts.
33
45
 
34
- Category line and byte totals must each reconcile exactly with the script's `totals`. Then list the largest files by line change and absolute net-byte change, distinguishing source, tests, template mirrors, and pure renames.
46
+ Category line and byte totals must each reconcile exactly with the script's `totals`. Then, for text files only, list the largest files by line change and absolute net-byte change, distinguishing source, tests, and template mirrors. Keep binary files in the category totals only; do not rank or interpret their content. Show renames as path changes without inferring a "pure rename" label.
35
47
 
36
48
  ## Required Analysis
37
49
 
@@ -40,7 +52,7 @@ Briefly explain:
40
52
  - where growth is concentrated and how runtime code compares with tests, docs, and templates;
41
53
  - whether net line and net byte changes tell different stories, especially for substantial same-line compaction or expansion;
42
54
  - which line changes are path moves, bilingual mirrors, or mechanical synchronization;
43
- - whether any change cannot be traced directly to the PR goal and may be unnecessary; if none, state the evidence;
55
+ - whether any change cannot be traced directly to the PR goal and may be unnecessary; if none, state the evidence; every check must cite file and line evidence;
44
56
  - when a test fixture is much larger than production changes, what risk it covers instead of judging it only by size.
45
57
 
46
- Add the complete report as a `### PR Code Changes` section in the reviewer summary body. Preserve the same table and conclusion in the user-visible create-pr completion response. Do not create a second PR comment for this report.
58
+ Do not write the `### PR Code Changes` section in the caller. Put exactly one `<!-- canonical-pr-change-report -->` placeholder in the plain body and let `summary-sync --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json --result {primary-result}` replace it through the core renderer. Do not create a second PR comment for this report.
@@ -4,7 +4,7 @@
4
4
  {"source":"platform-pr-inspect","diff":"three-dot-find-renames","metrics":["numstat-lines","git-blob-bytes"],"publish":["pr-summary","user-response"]}
5
5
  -->
6
6
 
7
- PR 创建或复用成功后,使用 `platform-pr inspect` 返回的权威 `base.sha` 与 `head.sha` 统计完整 PR 差异,不以最后一个 commit 或工作树状态代替。
7
+ PR 创建或复用成功后,使用 `platform-pr inspect` 返回的权威 `base.sha` 与 `head.sha` 统计完整 PR 差异,不以最后一个 commit 或工作树状态代替。任务意图 digest 只覆盖 `# 任务`/`# Task` 到 `## 上下文`/`## Context` 的语义区间,因此生命周期日志、收据和版本元数据不会使同一 head 的 sidecar 失效。
8
8
 
9
9
  ## 证据命令
10
10
 
@@ -14,6 +14,18 @@ git diff --find-renames --name-status {base-sha}...{head-sha}
14
14
  git diff --find-renames --summary {base-sha}...{head-sha}
15
15
  ```
16
16
 
17
+ 将脚本 JSON 和模型生成的六项 precheck candidate 交给 typed core:
18
+
19
+ ```bash
20
+ agent-infra-internal platform-pr change-report {task-id} \
21
+ --agent {standard-agent-token} --mechanical-file {mechanical-report-file} \
22
+ --precheck-file {precheck-candidate-file}
23
+ ```
24
+
25
+ core 校验任务意图 digest、PR identity、完整 patch SHA、统计合计和固定顺序的 `target-alignment`、`change-composition`、`compatibility-policy`、`legacy-path-cleanup`、`redundancy`、`scope-discipline`。任一项为 `needs-review` 时路由到 `review-code`,`formalReview` 仍为 `false`。
26
+
27
+ 生成 candidate 时,六项 `rationale` 必须分别写出实际检查结论:`target-alignment` 说明目标对应关系,`change-composition` 概括新增代码集中承担的职责,`compatibility-policy` 说明兼容策略,`legacy-path-cleanup` 说明旧路径处理,`redundancy` 说明冗余检查结果,`scope-discipline` 说明范围判断。不得六项复用“符合范围”等泛化套话;每项至少提供一条直接支持结论的路径、行号和简短 `detail`,并遵循当前已部署技能的语言。中文技能必须使用中文。这些高层理由和证据会直接展示在 canonical 摘要中。
28
+
17
29
  脚本在 merge base 与 head 之间同时计算 `numstat` 行数和 Git blob 的精确字节数。字节比字符具有稳定口径,也能覆盖二进制文件和同行内缩减;子模块不是 blob,按 0 字节贡献核算。新增文件的旧字节数为 0,删除文件的新字节数为 0,纯 rename 的净字节数为 0,copy 只计新增目标内容。
18
30
 
19
31
  `numstat` 中的二进制文件计入文件数,但不虚构行数。rename/copy 依据脚本的逐文件记录、`name-status` 与 `summary` 单独说明,避免把移动误报为整文件重写。
@@ -31,7 +43,7 @@ git diff --find-renames --summary {base-sha}...{head-sha}
31
43
 
32
44
  输出表格必须包含“部分、文件数、新增行、删除行、净增行、旧字节、新字节、净字节”,并有合计行。字节列表示本次变更涉及文件的 blob 内容体积,不表示整个仓库或工作树的磁盘占用。使用精确整数;可附加 KiB/MiB 便于阅读,但不能替代字节数。
33
45
 
34
- 各类别的行数和字节数之和必须分别与脚本的 `totals` 一致。随后分别列出行数变化和绝对净字节变化最大的文件,并区分源码、测试、模板镜像和纯 rename。
46
+ 各类别的行数和字节数之和必须分别与脚本的 `totals` 一致。随后仅针对文本文件,分别列出行数变化和绝对净字节变化最大的文件,并区分源码、测试和模板镜像;二进制文件只保留在分类合计中,不参与代表性文件排序或内容判断。rename 只按路径变化展示,不推断“纯 rename”。
35
47
 
36
48
  ## 分析要求
37
49
 
@@ -40,7 +52,7 @@ git diff --find-renames --summary {base-sha}...{head-sha}
40
52
  - 增长主要集中在哪里,运行时代码与测试/文档/模板各占多少;
41
53
  - 行数净变化与净字节变化是否给出不同结论,尤其指出同行内明显缩减或膨胀;
42
54
  - 哪些行数只是路径迁移、双语镜像或机械同步;
43
- - 是否存在与 PR 目标无法直接对应、疑似不必要的变化;若没有,明确说明判断依据;
55
+ - 是否存在与 PR 目标无法直接对应、疑似不必要的变化;若没有,明确说明判断依据;每项结论必须给出文件和行号证据;
44
56
  - 若某个测试 fixture 明显大于生产改动,解释它覆盖的风险,而不是仅以行数评价。
45
57
 
46
- 将完整报告以 `### PR 代码增减` 段落写入 reviewer 摘要正文,并在 create-pr 的用户可见完成回复中原样保留同一张统计表与结论。不要把报告另建成第二条 PR 评论。
58
+ 调用方不要自行写入 `### PR 代码增减`。把恰好包含一次 `<!-- canonical-pr-change-report -->` 的普通摘要正文交给 `summary-sync --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json --result {primary-result}`,由 core renderer 替换并发布。报告不另建第二条 PR 评论。
@@ -2,11 +2,13 @@
2
2
 
3
3
  After PR creation, run `agent-infra-internal platform-pr summary-context {task-id}` and aggregate the reviewer summary only from its canonical artifacts according to `.agents/rules/pr-sync.md`.
4
4
 
5
- Write the plain summary body to a temporary file, then run:
5
+ Write the plain summary body, containing exactly one `<!-- canonical-pr-change-report -->` placeholder and no report heading/JSON, marker, or HEAD metadata, to a temporary file, then run:
6
6
 
7
7
  ```bash
8
8
  agent-infra-internal platform-pr summary-sync {task-id} \
9
- --agent {standard-agent-token} --body-file {summary-body-file} --result {primary-result}
9
+ --agent {standard-agent-token} --body-file {summary-body-file} \
10
+ --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json \
11
+ --result {primary-result}
10
12
  ```
11
13
 
12
- The caller does not add markers, HEAD metadata, or comment API parameters. `--result` is required and must be passed unchanged from `platform-pr create`; `no_op` maps to `no_op_with_warnings` if summary synchronization degrades. Summary failures do not roll back a created or reused PR.
14
+ The caller does not add markers, HEAD metadata, report sections, or comment API parameters. The typed core rechecks the task-bound sidecar against the authoritative PR snapshot and renders the report. `--result` is required and must be passed unchanged from `platform-pr create`; `no_op` maps to `no_op_with_warnings` if summary synchronization degrades. Missing/stale/invalid sidecars or body bypasses do not publish, and summary failures do not roll back a created or reused PR.
@@ -2,11 +2,13 @@
2
2
 
3
3
  创建 PR 后先调用 `agent-infra-internal platform-pr summary-context {task-id}`,只根据返回的 canonical 产物按 `.agents/rules/pr-sync.md` 聚合 reviewer 摘要。
4
4
 
5
- 把纯摘要正文写入临时文件,再调用:
5
+ 把恰好包含一次 `<!-- canonical-pr-change-report -->` 且不含报告标题/JSON、marker 或 HEAD 元数据的纯摘要正文写入临时文件,再调用:
6
6
 
7
7
  ```bash
8
8
  agent-infra-internal platform-pr summary-sync {task-id} \
9
- --agent {standard-agent-token} --body-file {summary-body-file} --result {primary-result}
9
+ --agent {standard-agent-token} --body-file {summary-body-file} \
10
+ --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json \
11
+ --result {primary-result}
10
12
  ```
11
13
 
12
- 调用方不添加 marker、HEAD 或评论 API 参数。`--result` 是必填的,必须把 `platform-pr create` 的 `result` 原样传入;摘要失败沿用该 primary result 映射 warning(`no_op` 对应 `no_op_with_warnings`),不回滚已创建或复用的 PR。结果映射沿用 `.agents/rules/pr-sync.md`。
14
+ 调用方不添加 marker、HEAD、报告段或评论 API 参数。typed core 会重新校验任务绑定 sidecar 与权威 PR snapshot 并渲染报告。`--result` 是必填的,必须把 `platform-pr create` 的 `result` 原样传入;sidecar 缺失/过期/非法或正文旁路时不发布,摘要失败沿用该 primary result 映射 warning(`no_op` 对应 `no_op_with_warnings`),不回滚已创建或复用的 PR。结果映射沿用 `.agents/rules/pr-sync.md`。
@@ -42,7 +42,7 @@ Type label mapping:
42
42
 
43
43
  Metadata sync order:
44
44
  1. query Issue labels and milestone via the Issue read command in `.agents/rules/issue-pr-commands.md`
45
- 2. build `{label-args}` from the mapped type label, non-`type:` / non-`status:` Issue labels, and the current Issue `in:` labels (commit already computed them, so do not recompute them here and do not write back to the Issue)
45
+ 2. build `{label-args}` from the mapped type label and non-`type:` / non-`status:` Issue labels; `in:` labels are computed once by the shared platform core from task-bound diff/PR evidence, so do not recompute them here or copy them back from the Issue
46
46
  3. build `{milestone-arg}` by following "Phase 3: `create-pr`" in `.agents/rules/milestone-inference.md` and reusing the Issue milestone directly
47
47
  4. pass `{label-args}` and `{milestone-arg}` atomically by using the create-PR command template and permission-degradation rules in `.agents/rules/issue-pr-commands.md`
48
48
  5. ensure the PR body contains `Closes #{issue-number}` or an equivalent closing keyword
@@ -42,7 +42,7 @@ git diff <target-branch>...HEAD
42
42
 
43
43
  元数据同步顺序:
44
44
  1. 通过 `.agents/rules/issue-pr-commands.md` 的 Issue 读取命令查询 Issue labels 和 milestone
45
- 2. 从映射出的 type label、非 `type:` / 非 `status:` 的 Issue labels,以及当前 Issue `in:` labels 构建 `{label-args}`(commit 已经计算过,不在此重算,也不写回 Issue)
45
+ 2. 从映射出的 type label 和非 `type:` / 非 `status:` 的 Issue labels 构建 `{label-args}`;`in:` labels 由 shared platform core 根据 task-bound diff/PR evidence 统一计算,不在正文生成步骤重算,也不从 Issue 反向复制
46
46
  3. 按 `.agents/rules/milestone-inference.md` 的 "阶段 3:`create-pr`" 复用 Issue milestone 构建 `{milestone-arg}`
47
47
  4. 按 `.agents/rules/issue-pr-commands.md` 的创建 PR 命令模板与权限降级规则,将 `{label-args}` 和 `{milestone-arg}` 原子化传入
48
48
  5. 确保 PR 正文包含 `Closes #{issue-number}` 或等价关闭关键字