@fitlab-ai/agent-infra 0.9.13 → 0.9.15

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 (428) hide show
  1. package/README.md +10 -0
  2. package/README.zh-CN.md +10 -0
  3. package/bin/cli.ts +26 -9
  4. package/bin/internal-cli.sh +45 -0
  5. package/dist/bin/cli.js +173 -157
  6. package/dist/bin/internal-cli.js +126 -42
  7. package/dist/lib/agent-client.js +5 -0
  8. package/dist/lib/agent-clients/adapters/codex-lifecycle/capability-store.js +165 -27
  9. package/dist/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.js +3 -2
  10. package/dist/lib/defaults.json +103 -103
  11. package/dist/lib/fs/durable-write.js +37 -0
  12. package/dist/lib/fs/file-lock.js +111 -0
  13. package/dist/lib/host-control/audit.js +19 -0
  14. package/dist/lib/host-control/client.js +142 -0
  15. package/dist/lib/host-control/command.js +49 -0
  16. package/dist/lib/host-control/path.js +160 -0
  17. package/dist/lib/host-control/secure-fs.js +140 -0
  18. package/dist/lib/host-control/server.js +159 -0
  19. package/dist/lib/host-control/service.js +112 -0
  20. package/dist/lib/init.js +11 -2
  21. package/dist/lib/internal/agent-client.js +5 -2
  22. package/dist/lib/internal/cli-route-inventory.js +154 -0
  23. package/dist/lib/internal/codex-lifecycle.js +15 -12
  24. package/dist/lib/internal/codex-sandbox-controller.js +8 -2
  25. package/dist/lib/internal/demo-promotion.js +322 -0
  26. package/dist/lib/internal/demo-transcript.js +454 -0
  27. package/dist/lib/internal/git-workflow.js +10 -6
  28. package/dist/lib/internal/host-control.js +28 -0
  29. package/dist/lib/internal/manual-validation.js +322 -0
  30. package/dist/lib/internal/platform-checks.js +16 -4
  31. package/dist/lib/internal/platform-comment.js +16 -4
  32. package/dist/lib/internal/platform-context.js +4 -1
  33. package/dist/lib/internal/platform-issue.js +12 -4
  34. package/dist/lib/internal/platform-metadata.js +88 -0
  35. package/dist/lib/internal/platform-pr-review.js +16 -3
  36. package/dist/lib/internal/platform-pr.js +42 -14
  37. package/dist/lib/internal/platform-release-notes.js +6 -3
  38. package/dist/lib/internal/platform-security.js +93 -0
  39. package/dist/lib/internal/pr-review-grade.js +14 -3
  40. package/dist/lib/internal/release-workflow.js +82 -89
  41. package/dist/lib/internal/sandbox-control.js +171 -7
  42. package/dist/lib/internal/task-activity.js +13 -4
  43. package/dist/lib/internal/task-artifact.js +19 -107
  44. package/dist/lib/internal/task-context.js +4 -1
  45. package/dist/lib/internal/task-create.js +48 -14
  46. package/dist/lib/internal/task-delivery.js +4 -1
  47. package/dist/lib/internal/task-event.js +38 -35
  48. package/dist/lib/internal/task-finalization.js +4 -1
  49. package/dist/lib/internal/task-invalidation.js +4 -1
  50. package/dist/lib/internal/task-ledger.js +12 -1
  51. package/dist/lib/internal/task-lifecycle.js +4 -1
  52. package/dist/lib/internal/task-operation-registry.js +519 -0
  53. package/dist/lib/internal/task-orchestration.js +12 -0
  54. package/dist/lib/internal/task-override.js +10 -3
  55. package/dist/lib/internal/task-qualification.js +90 -0
  56. package/dist/lib/internal/task-review.js +10 -52
  57. package/dist/lib/internal/task-short-id.js +11 -1
  58. package/dist/lib/internal/task-snapshot.js +4 -1
  59. package/dist/lib/internal/task-validate.js +37 -12
  60. package/dist/lib/internal/task-verify.js +5 -1
  61. package/dist/lib/internal/task-warning.js +8 -1
  62. package/dist/lib/owned-path.js +33 -0
  63. package/dist/lib/platform/check-status.js +11 -0
  64. package/dist/lib/platform/comment-safety.js +229 -0
  65. package/dist/lib/platform/completion-backfill.js +1 -1
  66. package/dist/lib/platform/github-data.js +241 -0
  67. package/dist/lib/platform/github-provider.js +248 -26
  68. package/dist/lib/platform/issue-comments.js +146 -34
  69. package/dist/lib/platform/issues.js +1 -179
  70. package/dist/lib/platform/pr-change-report.js +6 -12
  71. package/dist/lib/platform/pr-checks.js +12 -65
  72. package/dist/lib/platform/pr-summary.js +83 -10
  73. package/dist/lib/platform/provider-contract.d.ts +67 -1
  74. package/dist/lib/platform/provider-contract.js +6 -2
  75. package/dist/lib/platform/provider-validation.js +76 -3
  76. package/dist/lib/platform/pull-requests.js +117 -275
  77. package/dist/lib/platform/repository-metadata.js +377 -0
  78. package/dist/lib/platform/security-alerts.js +155 -0
  79. package/dist/lib/platform/snapshots.js +2 -0
  80. package/dist/lib/platform/verification-sync.js +154 -162
  81. package/dist/lib/process-data/index.js +7 -0
  82. package/dist/lib/release/workflow.js +1 -1
  83. package/dist/lib/run/index.js +5 -0
  84. package/dist/lib/sandbox/commands/control-status.js +22 -0
  85. package/dist/lib/sandbox/commands/create.js +39 -8
  86. package/dist/lib/sandbox/commands/ls.js +5 -0
  87. package/dist/lib/sandbox/commands/rm.js +3 -807
  88. package/dist/lib/sandbox/commands/show.js +16 -0
  89. package/dist/lib/sandbox/control/audit.js +203 -0
  90. package/dist/lib/sandbox/control/client.js +125 -12
  91. package/dist/lib/sandbox/control/completed-reentry.js +85 -0
  92. package/dist/lib/sandbox/control/container-identity.js +28 -31
  93. package/dist/lib/sandbox/control/executor.js +233 -34
  94. package/dist/lib/sandbox/control/finalization-response.js +27 -0
  95. package/dist/lib/sandbox/control/identity-sentinel.js +107 -0
  96. package/dist/lib/sandbox/control/lifecycle.js +656 -128
  97. package/dist/lib/sandbox/control/native-file-lock.js +85 -0
  98. package/dist/lib/sandbox/control/protocol.js +55 -4
  99. package/dist/lib/sandbox/control/server.js +720 -79
  100. package/dist/lib/sandbox/control/state.js +63 -3
  101. package/dist/lib/sandbox/control/task-view.js +183 -0
  102. package/dist/lib/sandbox/control/task-workflow.js +74 -0
  103. package/dist/lib/sandbox/control/workflow-executor.js +99 -0
  104. package/dist/lib/sandbox/engines/authority.js +289 -0
  105. package/dist/lib/sandbox/engines/docker-exact-discovery.js +97 -0
  106. package/dist/lib/sandbox/index.js +7 -2
  107. package/dist/lib/sandbox/recovery.js +49 -5
  108. package/dist/lib/sandbox/removal.js +1717 -0
  109. package/dist/lib/sandbox/task-cleanup.js +217 -0
  110. package/dist/lib/sandbox/workspace-view.js +15 -15
  111. package/dist/lib/sandbox/worktree-safety.js +4 -1
  112. package/dist/lib/server/index.js +8 -0
  113. package/dist/lib/task/activity-intent.js +2 -1
  114. package/dist/lib/task/activity-log.js +30 -24
  115. package/dist/lib/task/artifact-command.js +101 -0
  116. package/dist/lib/task/artifact-lifecycle.js +71 -40
  117. package/dist/lib/task/artifact-name.js +36 -0
  118. package/dist/lib/task/artifact-operations.js +474 -0
  119. package/dist/lib/task/artifact-receipts.js +3 -15
  120. package/dist/lib/task/artifact-repair-intent.js +130 -0
  121. package/dist/lib/task/artifact-schema.js +127 -0
  122. package/dist/lib/task/capabilities.js +83 -19
  123. package/dist/lib/task/codex-orchestration.js +71 -25
  124. package/dist/lib/task/commit-identity.js +28 -0
  125. package/dist/lib/task/commit-operation.js +2 -16
  126. package/dist/lib/task/control-authority.js +375 -5
  127. package/dist/lib/task/control-recovery.js +128 -0
  128. package/dist/lib/task/create-service.js +103 -4
  129. package/dist/lib/task/create.js +80 -2
  130. package/dist/lib/task/decision-details.js +2 -46
  131. package/dist/lib/task/events.js +306 -76
  132. package/dist/lib/task/finalization-state.js +9 -0
  133. package/dist/lib/task/human-override.js +3 -6
  134. package/dist/lib/task/implementation-inputs.js +3 -3
  135. package/dist/lib/task/index.js +11 -3
  136. package/dist/lib/task/intermediate-cleanup.js +383 -0
  137. package/dist/lib/task/invalidation.js +18 -65
  138. package/dist/lib/task/ledger-intents.js +7 -22
  139. package/dist/lib/task/ledger.js +1 -3
  140. package/dist/lib/task/lifecycle.js +19 -1
  141. package/dist/lib/task/local-artifact-finalization.js +190 -290
  142. package/dist/lib/task/manual-validation-completion.js +26 -0
  143. package/dist/lib/task/manual-validation-evidence.js +130 -0
  144. package/dist/lib/task/manual-validation-receipt.js +101 -0
  145. package/dist/lib/task/manual-validation-shared.js +40 -0
  146. package/dist/lib/task/manual-validation-transaction.js +243 -0
  147. package/dist/lib/task/markdown.js +47 -0
  148. package/dist/lib/task/orchestration.js +206 -69
  149. package/dist/lib/task/qualification-audit.js +476 -0
  150. package/dist/lib/task/qualification-confirmation.js +109 -0
  151. package/dist/lib/task/qualification-intents.js +148 -0
  152. package/dist/lib/task/review-artifacts.js +23 -40
  153. package/dist/lib/task/review-command.js +25 -0
  154. package/dist/lib/task/review-finalization.js +146 -97
  155. package/dist/lib/task/review-fingerprint.js +2 -2
  156. package/dist/lib/task/sections.js +34 -54
  157. package/dist/lib/task/verification-config.js +11 -0
  158. package/dist/lib/task/verification-engine.js +170 -327
  159. package/dist/lib/task/verification.js +1 -1
  160. package/dist/lib/task/workflow-command.js +17 -0
  161. package/dist/lib/task/workflow-warning-intents.js +0 -16
  162. package/dist/lib/task/workflow-warnings.js +28 -2
  163. package/dist/lib/update.js +2 -0
  164. package/dist/lifecycle-build-manifest.json +3 -3
  165. package/lib/agent-client.ts +9 -0
  166. package/lib/agent-clients/adapters/codex-lifecycle/capability-store.ts +223 -33
  167. package/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.ts +3 -2
  168. package/lib/fs/durable-write.ts +29 -0
  169. package/lib/fs/file-lock.ts +113 -0
  170. package/lib/host-control/audit.ts +22 -0
  171. package/lib/host-control/client.ts +172 -0
  172. package/lib/host-control/command.ts +60 -0
  173. package/lib/host-control/path.ts +167 -0
  174. package/lib/host-control/secure-fs.ts +135 -0
  175. package/lib/host-control/server.ts +180 -0
  176. package/lib/host-control/service.ts +133 -0
  177. package/lib/init.ts +15 -2
  178. package/lib/internal/agent-client.ts +4 -2
  179. package/lib/internal/cli-route-inventory.ts +142 -0
  180. package/lib/internal/codex-lifecycle.ts +14 -12
  181. package/lib/internal/codex-sandbox-controller.ts +7 -2
  182. package/lib/internal/demo-promotion.ts +354 -0
  183. package/lib/internal/demo-transcript.ts +419 -0
  184. package/lib/internal/git-workflow.ts +9 -6
  185. package/lib/internal/host-control.ts +28 -0
  186. package/lib/internal/manual-validation.ts +306 -0
  187. package/lib/internal/platform-checks.ts +12 -4
  188. package/lib/internal/platform-comment.ts +12 -4
  189. package/lib/internal/platform-context.ts +3 -1
  190. package/lib/internal/platform-issue.ts +11 -4
  191. package/lib/internal/platform-metadata.ts +70 -0
  192. package/lib/internal/platform-pr-review.ts +14 -3
  193. package/lib/internal/platform-pr.ts +38 -14
  194. package/lib/internal/platform-release-notes.ts +5 -3
  195. package/lib/internal/platform-security.ts +83 -0
  196. package/lib/internal/pr-review-grade.ts +10 -3
  197. package/lib/internal/release-workflow.ts +91 -87
  198. package/lib/internal/sandbox-control.ts +181 -6
  199. package/lib/internal/task-activity.ts +12 -4
  200. package/lib/internal/task-artifact.ts +15 -79
  201. package/lib/internal/task-context.ts +3 -1
  202. package/lib/internal/task-create.ts +76 -15
  203. package/lib/internal/task-delivery.ts +3 -1
  204. package/lib/internal/task-event.ts +21 -10
  205. package/lib/internal/task-finalization.ts +3 -1
  206. package/lib/internal/task-invalidation.ts +3 -1
  207. package/lib/internal/task-ledger.ts +11 -1
  208. package/lib/internal/task-lifecycle.ts +3 -1
  209. package/lib/internal/task-operation-registry.ts +590 -0
  210. package/lib/internal/task-orchestration.ts +12 -0
  211. package/lib/internal/task-override.ts +9 -3
  212. package/lib/internal/task-qualification.ts +61 -0
  213. package/lib/internal/task-review.ts +7 -50
  214. package/lib/internal/task-short-id.ts +10 -1
  215. package/lib/internal/task-snapshot.ts +3 -1
  216. package/lib/internal/task-validate.ts +32 -12
  217. package/lib/internal/task-verify.ts +4 -1
  218. package/lib/internal/task-warning.ts +7 -1
  219. package/lib/owned-path.ts +26 -0
  220. package/lib/platform/check-status.ts +9 -0
  221. package/lib/platform/comment-safety.ts +255 -0
  222. package/lib/platform/completion-backfill.ts +1 -1
  223. package/lib/platform/github-data.ts +322 -0
  224. package/lib/platform/github-provider.ts +244 -27
  225. package/lib/platform/issue-comments.ts +159 -35
  226. package/lib/platform/issues.ts +4 -245
  227. package/lib/platform/pr-change-report.ts +6 -12
  228. package/lib/platform/pr-checks.ts +13 -77
  229. package/lib/platform/pr-summary.ts +88 -11
  230. package/lib/platform/provider-contract.ts +78 -3
  231. package/lib/platform/provider-validation.ts +85 -3
  232. package/lib/platform/pull-requests.ts +129 -348
  233. package/lib/platform/repository-metadata.ts +453 -0
  234. package/lib/platform/security-alerts.ts +191 -0
  235. package/lib/platform/snapshots.ts +53 -0
  236. package/lib/platform/verification-sync.ts +171 -177
  237. package/lib/process-data/index.ts +7 -0
  238. package/lib/release/workflow.ts +3 -3
  239. package/lib/run/index.ts +5 -0
  240. package/lib/sandbox/commands/control-status.ts +26 -0
  241. package/lib/sandbox/commands/create.ts +53 -12
  242. package/lib/sandbox/commands/ls.ts +7 -0
  243. package/lib/sandbox/commands/rm.ts +3 -996
  244. package/lib/sandbox/commands/show.ts +16 -0
  245. package/lib/sandbox/control/audit.ts +253 -0
  246. package/lib/sandbox/control/client.ts +150 -13
  247. package/lib/sandbox/control/completed-reentry.ts +98 -0
  248. package/lib/sandbox/control/container-identity.ts +27 -43
  249. package/lib/sandbox/control/executor.ts +262 -37
  250. package/lib/sandbox/control/finalization-response.ts +29 -0
  251. package/lib/sandbox/control/identity-sentinel.ts +137 -0
  252. package/lib/sandbox/control/lifecycle.ts +672 -18
  253. package/lib/sandbox/control/native-file-lock.ts +108 -0
  254. package/lib/sandbox/control/protocol.ts +80 -8
  255. package/lib/sandbox/control/server.ts +779 -82
  256. package/lib/sandbox/control/state.ts +84 -3
  257. package/lib/sandbox/control/task-view.ts +240 -0
  258. package/lib/sandbox/control/task-workflow.ts +95 -0
  259. package/lib/sandbox/control/workflow-executor.ts +102 -0
  260. package/lib/sandbox/engines/authority.ts +365 -0
  261. package/lib/sandbox/engines/docker-exact-discovery.ts +132 -0
  262. package/lib/sandbox/index.ts +9 -2
  263. package/lib/sandbox/recovery.ts +49 -6
  264. package/lib/sandbox/removal.ts +2144 -0
  265. package/lib/sandbox/task-cleanup.ts +209 -0
  266. package/lib/sandbox/workspace-view.ts +26 -18
  267. package/lib/sandbox/worktree-safety.ts +4 -1
  268. package/lib/server/index.ts +10 -0
  269. package/lib/task/activity-intent.ts +2 -2
  270. package/lib/task/activity-log.ts +27 -19
  271. package/lib/task/artifact-command.ts +104 -0
  272. package/lib/task/artifact-lifecycle.ts +66 -39
  273. package/lib/task/artifact-name.ts +55 -0
  274. package/lib/task/artifact-operations.ts +580 -0
  275. package/lib/task/artifact-receipts.ts +3 -14
  276. package/lib/task/artifact-repair-intent.ts +152 -0
  277. package/lib/task/artifact-schema.ts +163 -0
  278. package/lib/task/capabilities.ts +82 -22
  279. package/lib/task/codex-orchestration.ts +85 -24
  280. package/lib/task/commit-identity.ts +31 -0
  281. package/lib/task/commit-operation.ts +2 -16
  282. package/lib/task/control-authority.ts +513 -6
  283. package/lib/task/control-recovery.ts +174 -0
  284. package/lib/task/create-service.ts +131 -6
  285. package/lib/task/create.ts +83 -1
  286. package/lib/task/decision-details.ts +3 -71
  287. package/lib/task/events.ts +292 -75
  288. package/lib/task/finalization-state.ts +11 -0
  289. package/lib/task/human-override.ts +3 -8
  290. package/lib/task/implementation-inputs.ts +3 -3
  291. package/lib/task/index.ts +16 -3
  292. package/lib/task/intermediate-cleanup.ts +455 -0
  293. package/lib/task/invalidation.ts +18 -62
  294. package/lib/task/ledger-intents.ts +7 -24
  295. package/lib/task/ledger.ts +1 -3
  296. package/lib/task/lifecycle.ts +17 -1
  297. package/lib/task/local-artifact-finalization.ts +223 -388
  298. package/lib/task/manual-validation-completion.ts +40 -0
  299. package/lib/task/manual-validation-evidence.ts +209 -0
  300. package/lib/task/manual-validation-receipt.ts +152 -0
  301. package/lib/task/manual-validation-shared.ts +50 -0
  302. package/lib/task/manual-validation-transaction.ts +304 -0
  303. package/lib/task/markdown.ts +70 -0
  304. package/lib/task/orchestration.ts +191 -68
  305. package/lib/task/qualification-audit.ts +588 -0
  306. package/lib/task/qualification-confirmation.ts +117 -0
  307. package/lib/task/qualification-intents.ts +150 -0
  308. package/lib/task/review-artifacts.ts +21 -41
  309. package/lib/task/review-command.ts +23 -0
  310. package/lib/task/review-finalization.ts +154 -153
  311. package/lib/task/review-fingerprint.ts +2 -2
  312. package/lib/task/sections.ts +33 -52
  313. package/lib/task/verification-config.ts +12 -0
  314. package/lib/task/verification-engine.ts +165 -370
  315. package/lib/task/verification-types.ts +17 -0
  316. package/lib/task/verification.ts +1 -1
  317. package/lib/task/workflow-command.ts +18 -0
  318. package/lib/task/workflow-warning-intents.ts +0 -13
  319. package/lib/task/workflow-warnings.ts +21 -2
  320. package/lib/update.ts +6 -0
  321. package/package.json +7 -2
  322. package/templates/.agents/hooks/lifecycle-delegation.js +6 -6
  323. package/templates/.agents/rules/README.en.md +2 -0
  324. package/templates/.agents/rules/README.zh-CN.md +2 -0
  325. package/templates/.agents/rules/decision-qualification.en.md +22 -0
  326. package/templates/.agents/rules/decision-qualification.zh-CN.md +22 -0
  327. package/templates/.agents/rules/evidence-reporting.en.md +28 -0
  328. package/templates/.agents/rules/evidence-reporting.zh-CN.md +28 -0
  329. package/templates/.agents/rules/label-milestone-setup.en.md +7 -7
  330. package/templates/.agents/rules/label-milestone-setup.zh-CN.md +7 -7
  331. package/templates/.agents/rules/local-artifact-repair.en.md +5 -1
  332. package/templates/.agents/rules/local-artifact-repair.zh-CN.md +5 -1
  333. package/templates/.agents/rules/security-alerts.en.md +8 -8
  334. package/templates/.agents/rules/security-alerts.zh-CN.md +8 -8
  335. package/templates/.agents/rules/testing-discipline.en.md +2 -0
  336. package/templates/.agents/rules/testing-discipline.zh-CN.md +2 -0
  337. package/templates/.agents/scripts/package.json +3 -0
  338. package/templates/.agents/skills/analyze-task/SKILL.en.md +15 -2
  339. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +19 -2
  340. package/templates/.agents/skills/analyze-task/config/verify.en.json +1 -12
  341. package/templates/.agents/skills/analyze-task/config/verify.zh-CN.json +1 -12
  342. package/templates/.agents/skills/close-codescan/SKILL.en.md +2 -2
  343. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +2 -2
  344. package/templates/.agents/skills/close-dependabot/SKILL.en.md +2 -2
  345. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +2 -2
  346. package/templates/.agents/skills/code-task/SKILL.en.md +14 -1
  347. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +14 -1
  348. package/templates/.agents/skills/code-task/config/verify.en.json +5 -14
  349. package/templates/.agents/skills/code-task/config/verify.zh-CN.json +5 -14
  350. package/templates/.agents/skills/code-task/reference/code-rules.en.md +5 -4
  351. package/templates/.agents/skills/code-task/reference/code-rules.zh-CN.md +5 -4
  352. package/templates/.agents/skills/code-task/reference/dual-mode.en.md +1 -1
  353. package/templates/.agents/skills/code-task/reference/dual-mode.zh-CN.md +1 -1
  354. package/templates/.agents/skills/code-task/reference/fix-mode.en.md +3 -1
  355. package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +3 -1
  356. package/templates/.agents/skills/code-task/reference/report-template.en.md +42 -15
  357. package/templates/.agents/skills/code-task/reference/report-template.zh-CN.md +39 -12
  358. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +37 -21
  359. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +37 -21
  360. package/templates/.agents/skills/complete-manual-validation/config/verify.en.json +1 -1
  361. package/templates/.agents/skills/complete-manual-validation/config/verify.zh-CN.json +1 -1
  362. package/templates/.agents/skills/complete-manual-validation/reference/report-template.en.md +4 -0
  363. package/templates/.agents/skills/complete-manual-validation/reference/report-template.zh-CN.md +4 -0
  364. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +16 -7
  365. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +16 -7
  366. package/templates/.agents/skills/complete-task/SKILL.en.md +10 -23
  367. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +10 -23
  368. package/templates/.agents/skills/create-task/SKILL.en.md +8 -0
  369. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +7 -0
  370. package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
  371. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  372. package/templates/.agents/skills/import-dependabot/SKILL.en.md +1 -1
  373. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +1 -1
  374. package/templates/.agents/skills/init-labels/SKILL.en.md +8 -8
  375. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +8 -8
  376. package/templates/.agents/skills/init-milestones/SKILL.en.md +9 -11
  377. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +9 -11
  378. package/templates/.agents/skills/plan-task/SKILL.en.md +14 -1
  379. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +16 -1
  380. package/templates/.agents/skills/plan-task/config/verify.en.json +4 -14
  381. package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +4 -14
  382. package/templates/.agents/skills/release/SKILL.en.md +7 -3
  383. package/templates/.agents/skills/release/SKILL.zh-CN.md +7 -3
  384. package/templates/.agents/skills/review-analysis/SKILL.en.md +14 -1
  385. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +14 -1
  386. package/templates/.agents/skills/review-analysis/config/verify.en.json +1 -18
  387. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +1 -18
  388. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +50 -23
  389. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +45 -18
  390. package/templates/.agents/skills/review-code/SKILL.en.md +14 -1
  391. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +14 -1
  392. package/templates/.agents/skills/review-code/config/verify.en.json +1 -23
  393. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -23
  394. package/templates/.agents/skills/review-code/reference/report-template.en.md +49 -22
  395. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +45 -18
  396. package/templates/.agents/skills/review-plan/SKILL.en.md +14 -1
  397. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +14 -1
  398. package/templates/.agents/skills/review-plan/config/verify.en.json +1 -18
  399. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +1 -18
  400. package/templates/.agents/skills/review-plan/reference/report-template.en.md +49 -22
  401. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +45 -18
  402. package/templates/.agents/skills/review-pr/SKILL.en.md +5 -1
  403. package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +5 -1
  404. package/templates/.agents/skills/review-pr/reference/report-template.en.md +4 -3
  405. package/templates/.agents/skills/review-pr/reference/report-template.zh-CN.md +4 -3
  406. package/templates/.agents/skills/run-manual-validation/SKILL.en.md +25 -4
  407. package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +25 -4
  408. package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.en.md +4 -1
  409. package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.zh-CN.md +4 -1
  410. package/templates/.agents/skills/run-manual-validation/reference/report-template.en.md +5 -1
  411. package/templates/.agents/skills/run-manual-validation/reference/report-template.zh-CN.md +5 -1
  412. package/templates/.agents/skills/run-task/SKILL.en.md +1 -1
  413. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +1 -1
  414. package/templates/.agents/skills/test/SKILL.en.md +29 -7
  415. package/templates/.agents/skills/test/SKILL.zh-CN.md +29 -7
  416. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +14 -0
  417. package/templates/.agents/templates/task.en.md +6 -0
  418. package/templates/.agents/templates/task.zh-CN.md +6 -0
  419. package/templates/.claude/commands/run-manual-validation.en.md +1 -1
  420. package/templates/.claude/commands/run-manual-validation.zh-CN.md +1 -1
  421. package/dist/lib/platform/adapters.js +0 -56
  422. package/lib/platform/adapters.ts +0 -197
  423. package/templates/.agents/scripts/security-alerts.github.sh +0 -151
  424. package/templates/.agents/scripts/security-alerts.sh +0 -31
  425. package/templates/.agents/skills/init-labels/scripts/init-labels.github.sh +0 -146
  426. package/templates/.agents/skills/init-labels/scripts/init-labels.sh +0 -32
  427. package/templates/.agents/skills/init-milestones/scripts/init-milestones.github.sh +0 -294
  428. package/templates/.agents/skills/init-milestones/scripts/init-milestones.sh +0 -6
@@ -9,14 +9,18 @@ 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
16
16
 
17
+ ### Persisted Report Evidence
18
+
19
+ Before generating the validation completion report, read `.agents/rules/evidence-reporting.md`. Record commands, scope, structured results, actual conclusions, and uncovered parts for state checks and synchronization; keep the stricter basename-only and sanitized-result boundaries for manual validation.
20
+
17
21
  - This skill closes the manual-validation status in an existing PR summary comment; it does not create a parallel ordinary validation comment.
18
22
  - It must write `manual-validation.md` or `manual-validation-r{N}.md` so later PR summary refreshes can reuse the validation result.
19
- - 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.
20
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.
21
25
  - After this skill runs, update `task.md` immediately.
22
26
 
@@ -26,7 +30,7 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
26
30
 
27
31
  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.
28
32
 
29
- Run these commands and paste the raw output into this round's `## State Check` section:
33
+ 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:
30
34
 
31
35
  ```bash
32
36
  agent-infra-internal task-snapshot {task-id} --format text
@@ -38,10 +42,6 @@ agent-infra-internal task-snapshot {task-id} --format text
38
42
 
39
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.
40
44
 
41
- ## Step Start: Write the started Marker
42
-
43
- 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`.
44
-
45
45
  ## Steps
46
46
 
47
47
  ### 1. Parse Arguments
@@ -66,33 +66,49 @@ Stop if the task is missing, the validation summary is missing, or no valid PR c
66
66
 
67
67
  ### 3. Resolve the Artifact Context
68
68
 
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. 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
+
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
+ ```
70
80
 
71
- ### 4. Update the PR Summary
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
72
88
 
73
89
  Before this step, read:
74
90
  - `.agents/rules/issue-sync.md`
75
91
  - `.agents/rules/pr-sync.md`
76
92
  - `reference/summary-update.md`
77
93
 
78
- 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:
79
95
 
80
- ### 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
+ ```
81
102
 
82
- Before this step, read `reference/report-template.md`. Create `{manual-validation-artifact}` and record:
83
- - State check
84
- - Validation verdict
85
- - Validation scope
86
- - Validation details
87
- - 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.
88
104
 
89
- ### 6. Update task.md
105
+ ### 7. Update task.md
90
106
 
91
- 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.
92
108
 
93
109
  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}`.
94
110
 
95
- ### 7. Verification Gate
111
+ ### 8. Verification Gate
96
112
 
97
113
  Run:
98
114
 
@@ -105,7 +121,7 @@ Handle the result:
105
121
  - Exit code 1 -> fix the reported problem and rerun
106
122
  - Exit code 2 -> stop and report that manual intervention is required
107
123
 
108
- ### 8. Tell the User
124
+ ### 9. Tell the User
109
125
 
110
126
  Report:
111
127
  - Artifact path
@@ -9,14 +9,18 @@ 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
  ## 行为边界 / 关键规则
16
16
 
17
+ ### 持久化报告证据
18
+
19
+ 生成验证完成报告时,先读取 `.agents/rules/evidence-reporting.md`。状态核对和同步结果记录命令、范围、结构化结果、实际结论和未覆盖部分;继续遵守人工验证的 basename-only 与 sanitized result 脱敏边界。
20
+
17
21
  - 本技能用于收尾已有 PR 摘要评论中的人工校验状态,不创建并行的普通验证留言。
18
22
  - 必须写入 `manual-validation.md` 或 `manual-validation-r{N}.md`,让后续 PR 摘要刷新可复用人工验证结果。
19
- - 找不到 `sync-pr` 摘要评论时失败,不创建部分摘要兜底。
23
+ - 找不到 `sync-pr` 摘要评论时失败,不创建部分摘要兜底;receipt、通过日志和 final summary 未全部提交前,远端只允许 pending/non-pass 状态。
20
24
  - 生成会同步到 Issue 的人工验证 artifact Markdown 前,先读取 `.agents/rules/sync-content-generation.md` 并遵循其中的生成端约束;Issue 同步保持透明,不解析或改写正文。
21
25
  - 执行本技能后必须立即更新 `task.md`。
22
26
 
@@ -26,7 +30,7 @@ description: >
26
30
 
27
31
  在加载 workflow / skill / rules 指令之后、做任何任务状态判断或用户可见结论之前,必须先执行状态核对。指令类文件读取不算对外动作或结论。
28
32
 
29
- 运行以下命令,并把原文粘贴到本轮产物的 `## 状态核对` 段:
33
+ 运行以下命令,并在本轮产物的 `## 状态核对` 段记录任务/产物范围、关键结果和未覆盖部分;正常成功不粘贴完整目录清单或 `task.md` 尾部。失败、阻塞、身份不一致或争议时,附决定性原文行:
30
34
 
31
35
  ```bash
32
36
  agent-infra-internal task-snapshot {task-id} --format text
@@ -38,10 +42,6 @@ agent-infra-internal task-snapshot {task-id} --format text
38
42
 
39
43
  > 解析任务引用,并确认任务位于本技能支持的状态或目录且存在 `task.md`;无法定位时按未找到任务处理并停止。
40
44
 
41
- ## 步骤开始:声明 started 事件
42
-
43
- 确认前置条件和产物上下文后、本轮第一个产出动作之前执行 `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` 记录本轮身份。
44
-
45
45
  ## 执行步骤
46
46
 
47
47
  ### 1. 解析入参
@@ -66,33 +66,49 @@ complete-manual-validation [--task <ref> | -t <ref>] [{pr-ref}] {verification-su
66
66
 
67
67
  ### 3. 解析产物上下文
68
68
 
69
- 运行 `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
+
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
+ ```
70
80
 
71
- ### 4. 更新 PR 摘要
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 摘要
72
88
 
73
89
  执行此步骤前,先读取:
74
90
  - `.agents/rules/issue-sync.md`
75
91
  - `.agents/rules/pr-sync.md`
76
92
  - `reference/summary-update.md`
77
93
 
78
- 按 `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:
79
95
 
80
- ### 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
+ ```
81
102
 
82
- 执行此步骤前,先读取 `reference/report-template.md`。创建 `{manual-validation-artifact}`,记录:
83
- - 状态核对
84
- - 验证结论
85
- - 验证范围
86
- - 验证详情
87
- - 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 文件。
88
104
 
89
- ### 6. 更新 task.md
105
+ ### 7. 更新 task.md
90
106
 
91
- 执行 `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。
92
108
 
93
109
  如任务存在有效 `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}`。
94
110
 
95
- ### 7. 完成校验
111
+ ### 8. 完成校验
96
112
 
97
113
  运行完成校验:
98
114
 
@@ -105,7 +121,7 @@ agent-infra-internal task-verify {task-id} manual-validation.completed --artifac
105
121
  - 退出码 1 -> 修复问题后重新运行
106
122
  - 退出码 2 -> 停止并告知需要人工介入
107
123
 
108
- ### 8. 告知用户
124
+ ### 9. 告知用户
109
125
 
110
126
  输出:
111
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,
@@ -7,6 +7,7 @@ Read this file before creating `manual-validation.md` / `manual-validation-r{N}.
7
7
 
8
8
  - **Validation Round**: Round {N}
9
9
  - **Artifact File**: `manual-validation.md`
10
+ - **Human Validation Basis**: Maintainer's PR validation comment and validation summary
10
11
 
11
12
  ## State Check
12
13
 
@@ -15,6 +16,7 @@ $ git status -s
15
16
  $ ls -la .agents/workspace/active/{task-id}/
16
17
  $ tail .agents/workspace/active/{task-id}/task.md
17
18
  ```
19
+ > 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
20
 
19
21
  ## Validation Verdict
20
22
 
@@ -38,6 +40,7 @@ $ tail .agents/workspace/active/{task-id}/task.md
38
40
  - Result: {summary-result}
39
41
  - Summary comment: {comment-id or URL}
40
42
  - Updated status: `### ✅ Manual Validation Passed`
43
+ - Transaction: `{transaction-id}`; receipt=`{receipt-digest}`; head=`{pr-head-sha}`
41
44
  ````
42
45
 
43
46
  ## Filling Rules
@@ -46,3 +49,4 @@ $ tail .agents/workspace/active/{task-id}/task.md
46
49
  - Derive `Validation Scope` from the PR summary's manual-verification section.
47
50
  - `PR Summary Sync` must record success, skip, or failure.
48
51
  - Only write a passing artifact after the summary comment is updated or skipped because there is no diff.
52
+ - Successful synchronization records the command, scope, structured result, and actual conclusion; failures, blocking conditions, or disputes retain decisive excerpts and manual-validation redaction boundaries.
@@ -7,6 +7,7 @@
7
7
 
8
8
  - **验证轮次**:Round {N}
9
9
  - **产物文件**:`manual-validation.md`
10
+ - **人工验证依据**:维护者提供的 PR 验证留言和验证说明
10
11
 
11
12
  ## 状态核对
12
13
 
@@ -15,6 +16,7 @@ $ git status -s
15
16
  $ ls -la .agents/workspace/active/{task-id}/
16
17
  $ tail .agents/workspace/active/{task-id}/task.md
17
18
  ```
19
+ > 按 `.agents/rules/evidence-reporting.md` 记录任务范围、关键结果和未覆盖部分;正常成功不粘贴完整目录清单或 task tail。
18
20
 
19
21
  ## 验证结论
20
22
 
@@ -38,6 +40,7 @@ $ tail .agents/workspace/active/{task-id}/task.md
38
40
  - 结果:{summary-result}
39
41
  - 摘要评论:{comment-id 或 URL}
40
42
  - 更新状态:`### ✅ 人工验证已通过`
43
+ - Transaction:`{transaction-id}`;receipt=`{receipt-digest}`;head=`{pr-head-sha}`
41
44
  ````
42
45
 
43
46
  ## 填写规则
@@ -46,3 +49,4 @@ $ tail .agents/workspace/active/{task-id}/task.md
46
49
  - `验证范围` 来自 PR 摘要评论中的 `### ⚠️ 需人工校验` 段。
47
50
  - `PR 摘要同步` 必须记录成功、跳过或失败结果。
48
51
  - 只有在摘要评论已成功更新或无 diff 跳过时,才写入通过产物。
52
+ - 成功同步记录命令、范围、结构化结果和实际结论;失败、阻塞或争议保留决定性摘录,并继续遵守人工验证脱敏边界。
@@ -4,14 +4,23 @@ Run only for a valid `{task-id}` whose task.md binds a verified `pr_delivery_fac
4
4
 
5
5
  Follow `.agents/rules/pr-sync.md` for the shared summary structure and failure semantics.
6
6
 
7
- 1. After the canonical `manual-validation*` artifact is written, run `agent-infra-internal platform-pr summary-context {task-id}`.
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 with exactly one `<!-- canonical-pr-change-report -->` placeholder to a temporary file and run:
7
+ 1. Run `agent-infra-internal platform-pr summary-context {task-id}` to obtain the canonical summary body; the maintainer's PR validation comment and validation summary are the human-validation authority.
8
+ 2. Before creating the canonical `manual-validation*` artifact, call the transaction coordinator in prepare mode to record `started` before writing the prepared transaction:
10
9
 
11
10
  ```bash
12
- agent-infra-internal platform-pr summary-sync {task-id} \
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
11
+ agent-infra-internal manual-validation transaction {task-id} --prepare \
12
+ --artifact {manual-validation-artifact} \
13
+ --summary-file {summary-body-file} --agent {standard-agent-token}
15
14
  ```
16
15
 
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.
16
+ 3. After prepare succeeds, write the canonical `manual-validation*` artifact, write the pending plain body with exactly one `<!-- canonical-pr-change-report -->` placeholder to a temporary file, and run the transaction coordinator:
17
+
18
+ ```bash
19
+ agent-infra-internal manual-validation transaction {task-id} \
20
+ --artifact {manual-validation-artifact} \
21
+ --summary-file {summary-body-file} \
22
+ --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json \
23
+ --agent {standard-agent-token} --result no_op
24
+ ```
25
+
26
+ The core owns the rendered report, marker/authoritative PR-head wrapping, pagination, pending-first ordering, receipt, completion log, final promotion, and in-place reconciliation. Before the receipt and completion log exist, the summary must not contain `### ✅ Manual Validation Passed`. If context says no manual validation is required, stop without marking it passed.
@@ -4,16 +4,25 @@
4
4
 
5
5
  摘要结构与失败语义统一遵循 `.agents/rules/pr-sync.md`。
6
6
 
7
- 1. 在 canonical `manual-validation*` artifact 落盘后,调用 `agent-infra-internal platform-pr summary-context {task-id}`。
8
- 2. 从返回的最新产物重新聚合摘要,将人工校验段渲染为 `### ✅ 人工验证已通过`,写明验证时间和说明。
9
- 3. 把只含一次 `<!-- canonical-pr-change-report -->` 的纯正文写入临时文件,调用:
7
+ 1. 调用 `agent-infra-internal platform-pr summary-context {task-id}`,取得 canonical 摘要正文;维护者提供的 PR 人工验证留言和验证说明作为完成人工校验依据。
8
+ 2. 在创建 canonical `manual-validation*` artifact 前,调用 transaction coordinator 的 prepare 模式,先登记 started,再写 prepared transaction:
10
9
 
11
10
  ```bash
12
- agent-infra-internal platform-pr summary-sync {task-id} \
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
11
+ agent-infra-internal manual-validation transaction {task-id} --prepare \
12
+ --artifact {manual-validation-artifact} \
13
+ --summary-file {summary-body-file} --agent {standard-agent-token}
15
14
  ```
16
15
 
17
- marker、报告段、权威 PR head、分页查找和原地更新由 core 负责。若当前 context 表明无需人工校验,则停止并返回 `summary failed: no manual validation required`,不误标通过。
16
+ 3. prepare 成功后写入 canonical `manual-validation*` artifact,并把只含一次 `<!-- canonical-pr-change-report -->` 的 pending 正文写入临时文件,调用 transaction coordinator:
17
+
18
+ ```bash
19
+ agent-infra-internal manual-validation transaction {task-id} \
20
+ --artifact {manual-validation-artifact} \
21
+ --summary-file {summary-body-file} \
22
+ --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json \
23
+ --agent {standard-agent-token} --result no_op
24
+ ```
25
+
26
+ marker、报告段、权威 PR head、分页查找、pending-first 顺序、receipt、通过日志和 final promotion 由 core 负责。若当前 context 表明无需人工校验,则停止并返回 `summary failed: no manual validation required`,不误标通过。receipt/log 前不得出现 `### ✅ 人工验证已通过`。
18
27
 
19
28
  结果回传:`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
@@ -100,7 +104,7 @@ Run /create-pr --task {task-ref} first, then complete; --skip-pr is not accepted
100
104
  Before lifecycle, verify only the hard gates:
101
105
  - [ ] Task identity, active state, concurrency locks, and local atomic lifecycle operations are available
102
106
  - [ ] Required-PR delivery is satisfied when `prFlow=required`
103
- - [ ] Other business evidence (workflow, review, commit, tests, disagreement ledger, manual validation, and platform sync) is recorded or can be checked after lifecycle
107
+ - [ ] Other business evidence (workflow, review, commit, tests, disagreement ledger, manual validation, and platform sync) is recorded or can be checked after lifecycle; manual validation requires a committed transaction, receipt, current artifact digest, and an identity-bearing completion log
104
108
 
105
109
  > **⚠️ Prerequisite Branch Check — you must decide whether to continue or stop before proceeding:**
106
110
  >
@@ -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,19 @@ 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:
189
-
190
- ```bash
191
- agent-infra-internal task-verify {task-id} complete-task.completed --format text
192
- ```
193
-
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.
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.
200
187
 
201
188
  ### Accepted sandbox-control result recovery
202
189
 
@@ -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
@@ -99,7 +103,7 @@ agent-infra-internal platform-pr resolve-external {task-id} --agent {standard-ag
99
103
  生命周期前只验证硬门禁:
100
104
  - [ ] task 身份、active 状态、并发锁和本地原子生命周期操作可用
101
105
  - [ ] `prFlow=required` 时已满足 required-PR delivery
102
- - [ ] 其余业务证据(工作流、审查、提交、测试、分歧账本、人工校验和平台同步)已记录或可在生命周期后校验
106
+ - [ ] 其余业务证据(工作流、审查、提交、测试、分歧账本、人工校验和平台同步)已记录或可在生命周期后校验;人工验证只能由 committed transaction、receipt、当前 artifact 摘要和带 identity 的通过日志满足
103
107
 
104
108
  > **⚠️ 前置条件分支判断 — 你必须先判断“继续”还是“停止”:**
105
109
  >
@@ -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,19 @@ 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 的结构化输出,确认任务产物和同步状态符合规范:
188
-
189
- ```bash
190
- agent-infra-internal task-verify {task-id} complete-task.completed --format text
191
- ```
192
-
193
- 处理结果:
194
- - `status=completed` / 退出码 0(全部通过)-> 继续到「告知用户」步骤
195
- - `status=failed` / 退出码 1 -> 根据输出修复问题后重新运行 finalization
196
- - `status=blocked` / 退出码 2 -> 保留 receipt 与已完成的步骤并停止;稍后重跑 complete-task 进入 `finalization-retry`
197
-
198
- 将校验输出保留在回复中作为当次验证输出。没有当次校验输出,不得声明完成。
185
+ 完成结果必须直接消费本次宿主 finalization 的结构化输出、receipt 和 warning projection。`completed` 或 `completed_with_warnings` 才允许继续;`failed` / `blocked` / `unknown` 必须保留 receipt 并停止,之后通过同一 finalization 入口重试。不要在沙箱旧挂载中另行运行 `ls completed` 或 `task-verify complete-task.completed`,也不要用其结果推翻宿主结果。
199
186
 
200
187
  ### accepted 后的 sandbox-control 结果恢复
201
188
 
@@ -126,6 +126,14 @@ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
126
126
  - `blocked`: retain the candidate and retry the same file after the transient problem is fixed.
127
127
  - `failed`: report the stable error code. Never modify and retry a candidate under the same idempotency key.
128
128
 
129
+ A controlled invocation may return `control` request evidence: `accepted: true`
130
+ with `recovery: none` means the current result can be consumed; `accepted: false`
131
+ with `recovery: new-request-id` means the request was not admitted and the same
132
+ candidate may be retried with a new outer request ID after the transient problem
133
+ is fixed; `recovery: same-request-id` or `recovery: inspect-domain-state` means
134
+ the request was accepted, so do not create a new candidate or replay it
135
+ automatically. Recover with the original request or inspect host task state first.
136
+
129
137
  ### 4. Platform Failure Compatibility
130
138
 
131
139
  The host service owns platform cascading. The compatibility recovery commands remain visible in the host warning and are not run from the sandbox:
@@ -125,6 +125,13 @@ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
125
125
  - `blocked`:保留 candidate 文件,修复暂态问题后用同一文件重试。
126
126
  - `failed`:报告稳定错误码;幂等冲突时不得改写原 key 或原 candidate 后重试。
127
127
 
128
+ 受控调用可能在结果中返回 `control` 请求证据:`accepted: true` 且
129
+ `recovery: none` 表示可以消费当前结果;`accepted: false` 且
130
+ `recovery: new-request-id` 表示请求尚未受理,暂态问题恢复后才能用同一份
131
+ candidate 和新的 outer request ID 重试;`recovery: same-request-id` 或
132
+ `recovery: inspect-domain-state` 表示请求已经受理,不得创建新的 candidate 或
133
+ 自动重放,必须先使用原 request 检查结果或宿主任务状态。
134
+
128
135
  ### 4. 平台失败兼容说明
129
136
 
130
137
  平台级联由宿主服务完成。兼容的人工恢复命令仍由宿主 warning 指引,不在沙箱内执行:
@@ -34,7 +34,7 @@ This skill **creates** task.md, so there is no file to write at the start. Captu
34
34
 
35
35
  ### 1. Retrieve Alert Information
36
36
 
37
- Read `.agents/rules/security-alerts.md` before this step, then run `bash .agents/scripts/security-alerts.sh read-codescan --number {alert-number}` and parse its JSON result to fetch the alert details.
37
+ Read `.agents/rules/security-alerts.md` before this step, then run `agent-infra-internal platform-security read --kind code-scanning --number {alert-number}` and parse its JSON result to fetch the alert details.
38
38
 
39
39
  Extract key information:
40
40
  - `number`: alert number
@@ -34,7 +34,7 @@ description: >
34
34
 
35
35
  ### 1. 获取告警信息
36
36
 
37
- 执行前先读取 `.agents/rules/security-alerts.md`,然后运行 `bash .agents/scripts/security-alerts.sh read-codescan --number {alert-number}`,解析其 JSON 结果获取告警详情。
37
+ 执行前先读取 `.agents/rules/security-alerts.md`,然后运行 `agent-infra-internal platform-security read --kind code-scanning --number {alert-number}`,解析其 JSON 结果获取告警详情。
38
38
 
39
39
  提取关键信息:
40
40
  - `number`:告警编号
@@ -34,7 +34,7 @@ This skill **creates** task.md, so there is no file to write at the start. Captu
34
34
 
35
35
  ### 1. Retrieve Alert Information
36
36
 
37
- Read `.agents/rules/security-alerts.md` before this step, then run `bash .agents/scripts/security-alerts.sh read-dependabot --number {alert-number}` and parse its JSON result to fetch the alert details.
37
+ Read `.agents/rules/security-alerts.md` before this step, then run `agent-infra-internal platform-security read --kind dependabot --number {alert-number}` and parse its JSON result to fetch the alert details.
38
38
 
39
39
  Extract key information:
40
40
  - `number`: alert number
@@ -34,7 +34,7 @@ description: >
34
34
 
35
35
  ### 1. 获取告警信息
36
36
 
37
- 执行前先读取 `.agents/rules/security-alerts.md`,然后运行 `bash .agents/scripts/security-alerts.sh read-dependabot --number {alert-number}`,解析其 JSON 结果获取告警详情。
37
+ 执行前先读取 `.agents/rules/security-alerts.md`,然后运行 `agent-infra-internal platform-security read --kind dependabot --number {alert-number}`,解析其 JSON 结果获取告警详情。
38
38
 
39
39
  提取关键信息:
40
40
  - `number`:告警编号