@fitlab-ai/agent-infra 0.9.14 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/README.md +10 -0
  2. package/README.zh-CN.md +10 -0
  3. package/bin/internal-cli.sh +45 -0
  4. package/dist/bin/internal-cli.js +93 -30
  5. package/dist/lib/agent-clients/adapters/codex-lifecycle/capability-store.js +165 -27
  6. package/dist/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.js +9 -4
  7. package/dist/lib/agent-clients/adapters/codex-lifecycle/store.js +43 -3
  8. package/dist/lib/defaults.json +103 -103
  9. package/dist/lib/fs/durable-write.js +39 -0
  10. package/dist/lib/fs/file-lock.js +111 -0
  11. package/dist/lib/host-control/audit.js +19 -0
  12. package/dist/lib/host-control/client.js +142 -0
  13. package/dist/lib/host-control/command.js +49 -0
  14. package/dist/lib/host-control/path.js +160 -0
  15. package/dist/lib/host-control/secure-fs.js +140 -0
  16. package/dist/lib/host-control/server.js +159 -0
  17. package/dist/lib/host-control/service.js +112 -0
  18. package/dist/lib/init.js +11 -2
  19. package/dist/lib/internal/cli-route-inventory.js +4 -2
  20. package/dist/lib/internal/codex-lifecycle.js +6 -6
  21. package/dist/lib/internal/demo-promotion.js +322 -0
  22. package/dist/lib/internal/demo-transcript.js +454 -0
  23. package/dist/lib/internal/host-control.js +28 -0
  24. package/dist/lib/internal/manual-validation.js +331 -0
  25. package/dist/lib/internal/platform-pr.js +18 -4
  26. package/dist/lib/internal/release-workflow.js +63 -84
  27. package/dist/lib/internal/sandbox-control.js +149 -2
  28. package/dist/lib/internal/task-artifact.js +16 -263
  29. package/dist/lib/internal/task-create.js +6 -5
  30. package/dist/lib/internal/task-event.js +37 -37
  31. package/dist/lib/internal/task-lifecycle.js +2 -2
  32. package/dist/lib/internal/task-operation-registry.js +101 -4
  33. package/dist/lib/internal/task-review.js +11 -56
  34. package/dist/lib/internal/task-validate.js +30 -10
  35. package/dist/lib/owned-path.js +33 -0
  36. package/dist/lib/platform/check-status.js +11 -0
  37. package/dist/lib/platform/comment-safety.js +4 -1
  38. package/dist/lib/platform/completion-backfill.js +1 -1
  39. package/dist/lib/platform/github-data.js +241 -0
  40. package/dist/lib/platform/github-provider.js +15 -20
  41. package/dist/lib/platform/issue-comments.js +18 -12
  42. package/dist/lib/platform/issues.js +2 -180
  43. package/dist/lib/platform/pr-change-report.js +5 -4
  44. package/dist/lib/platform/pr-checks.js +12 -65
  45. package/dist/lib/platform/pr-summary.js +117 -33
  46. package/dist/lib/platform/pull-requests.js +5 -108
  47. package/dist/lib/platform/snapshots.js +2 -0
  48. package/dist/lib/platform/task-identities.js +2 -9
  49. package/dist/lib/platform/verification-sync.js +132 -143
  50. package/dist/lib/pr-review/evidence-grading.js +4 -8
  51. package/dist/lib/release/workflow.js +1 -1
  52. package/dist/lib/sandbox/commands/create.js +7 -2
  53. package/dist/lib/sandbox/commands/rm.js +19 -1511
  54. package/dist/lib/sandbox/control/audit.js +203 -0
  55. package/dist/lib/sandbox/control/client.js +93 -54
  56. package/dist/lib/sandbox/control/executor.js +129 -65
  57. package/dist/lib/sandbox/control/finalization-response.js +27 -0
  58. package/dist/lib/sandbox/control/identity-sentinel.js +107 -0
  59. package/dist/lib/sandbox/control/lifecycle.js +36 -2
  60. package/dist/lib/sandbox/control/native-file-lock.js +6 -98
  61. package/dist/lib/sandbox/control/protocol.js +55 -4
  62. package/dist/lib/sandbox/control/server.js +518 -127
  63. package/dist/lib/sandbox/control/state.js +64 -0
  64. package/dist/lib/sandbox/control/task-workflow.js +74 -0
  65. package/dist/lib/sandbox/control/workflow-executor.js +89 -0
  66. package/dist/lib/sandbox/index.js +1 -2
  67. package/dist/lib/sandbox/recovery.js +28 -4
  68. package/dist/lib/sandbox/removal.js +822 -0
  69. package/dist/lib/sandbox/task-cleanup.js +217 -0
  70. package/dist/lib/sandbox/workspace-identity.js +17 -1
  71. package/dist/lib/sandbox/workspace-view.js +13 -14
  72. package/dist/lib/task/activity-intent.js +2 -1
  73. package/dist/lib/task/activity-log.js +30 -24
  74. package/dist/lib/task/artifact-command.js +79 -0
  75. package/dist/lib/task/artifact-lifecycle.js +30 -28
  76. package/dist/lib/task/artifact-name.js +36 -0
  77. package/dist/lib/task/artifact-operations.js +29 -289
  78. package/dist/lib/task/artifact-receipts.js +3 -15
  79. package/dist/lib/task/artifact-recovery.js +430 -0
  80. package/dist/lib/task/artifact-repair-intent.js +134 -29
  81. package/dist/lib/task/artifact-schema.js +6 -14
  82. package/dist/lib/task/capabilities.js +12 -19
  83. package/dist/lib/task/codex-orchestration.js +71 -25
  84. package/dist/lib/task/commit-identity.js +28 -0
  85. package/dist/lib/task/commit-operation.js +33 -20
  86. package/dist/lib/task/control-authority.js +403 -6
  87. package/dist/lib/task/control-recovery.js +140 -0
  88. package/dist/lib/task/create-service.js +1 -8
  89. package/dist/lib/task/create.js +62 -9
  90. package/dist/lib/task/decision-details.js +2 -46
  91. package/dist/lib/task/delegation-receipts.js +64 -3
  92. package/dist/lib/task/events.js +275 -22
  93. package/dist/lib/task/finalization-state.js +9 -0
  94. package/dist/lib/task/human-override.js +8 -14
  95. package/dist/lib/task/implementation-inputs.js +3 -3
  96. package/dist/lib/task/intermediate-cleanup.js +441 -0
  97. package/dist/lib/task/invalidation.js +18 -65
  98. package/dist/lib/task/ledger-intents.js +7 -22
  99. package/dist/lib/task/ledger.js +1 -3
  100. package/dist/lib/task/lifecycle-recovery.js +549 -0
  101. package/dist/lib/task/lifecycle.js +31 -4
  102. package/dist/lib/task/local-artifact-finalization.js +197 -197
  103. package/dist/lib/task/manual-validation-completion.js +26 -0
  104. package/dist/lib/task/manual-validation-evidence.js +130 -0
  105. package/dist/lib/task/manual-validation-receipt.js +105 -0
  106. package/dist/lib/task/manual-validation-shared.js +40 -0
  107. package/dist/lib/task/manual-validation-transaction.js +243 -0
  108. package/dist/lib/task/markdown.js +47 -0
  109. package/dist/lib/task/orchestration.js +66 -19
  110. package/dist/lib/task/pr-delivery-fact.js +12 -56
  111. package/dist/lib/task/qualification-audit.js +20 -34
  112. package/dist/lib/task/recovery-warning.js +19 -0
  113. package/dist/lib/task/review-artifacts.js +2 -18
  114. package/dist/lib/task/review-command.js +26 -0
  115. package/dist/lib/task/review-finalization.js +175 -216
  116. package/dist/lib/task/review-fingerprint.js +2 -2
  117. package/dist/lib/task/sections.js +34 -56
  118. package/dist/lib/task/short-id.js +15 -7
  119. package/dist/lib/task/task-execution-lock.js +1 -1
  120. package/dist/lib/task/verification-engine.js +119 -337
  121. package/dist/lib/task/verification.js +1 -1
  122. package/dist/lib/task/workflow-command.js +16 -0
  123. package/dist/lib/task/workflow-warning-intents.js +0 -16
  124. package/dist/lib/task/workflow-warnings.js +28 -2
  125. package/dist/lib/update.js +2 -0
  126. package/dist/lib/version.js +1 -11
  127. package/dist/lifecycle-build-manifest.json +3 -3
  128. package/lib/agent-clients/adapters/codex-lifecycle/capability-store.ts +223 -33
  129. package/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.ts +10 -4
  130. package/lib/agent-clients/adapters/codex-lifecycle/store.ts +55 -3
  131. package/lib/fs/durable-write.ts +30 -0
  132. package/lib/fs/file-lock.ts +113 -0
  133. package/lib/host-control/audit.ts +22 -0
  134. package/lib/host-control/client.ts +172 -0
  135. package/lib/host-control/command.ts +60 -0
  136. package/lib/host-control/path.ts +167 -0
  137. package/lib/host-control/secure-fs.ts +135 -0
  138. package/lib/host-control/server.ts +180 -0
  139. package/lib/host-control/service.ts +133 -0
  140. package/lib/init.ts +15 -2
  141. package/lib/internal/cli-route-inventory.ts +4 -2
  142. package/lib/internal/codex-lifecycle.ts +6 -6
  143. package/lib/internal/demo-promotion.ts +354 -0
  144. package/lib/internal/demo-transcript.ts +419 -0
  145. package/lib/internal/host-control.ts +28 -0
  146. package/lib/internal/manual-validation.ts +315 -0
  147. package/lib/internal/platform-pr.ts +15 -4
  148. package/lib/internal/release-workflow.ts +74 -82
  149. package/lib/internal/sandbox-control.ts +162 -1
  150. package/lib/internal/task-artifact.ts +14 -217
  151. package/lib/internal/task-create.ts +5 -5
  152. package/lib/internal/task-event.ts +20 -11
  153. package/lib/internal/task-lifecycle.ts +4 -3
  154. package/lib/internal/task-operation-registry.ts +111 -4
  155. package/lib/internal/task-review.ts +9 -54
  156. package/lib/internal/task-validate.ts +26 -10
  157. package/lib/owned-path.ts +26 -0
  158. package/lib/platform/check-status.ts +9 -0
  159. package/lib/platform/comment-safety.ts +5 -0
  160. package/lib/platform/completion-backfill.ts +1 -1
  161. package/lib/platform/github-data.ts +322 -0
  162. package/lib/platform/github-provider.ts +15 -20
  163. package/lib/platform/issue-comments.ts +21 -14
  164. package/lib/platform/issues.ts +5 -246
  165. package/lib/platform/pr-change-report.ts +7 -5
  166. package/lib/platform/pr-checks.ts +13 -77
  167. package/lib/platform/pr-summary.ts +123 -35
  168. package/lib/platform/pull-requests.ts +6 -173
  169. package/lib/platform/snapshots.ts +53 -0
  170. package/lib/platform/task-identities.ts +3 -14
  171. package/lib/platform/verification-sync.ts +150 -156
  172. package/lib/pr-review/evidence-grading.ts +4 -9
  173. package/lib/release/workflow.ts +3 -3
  174. package/lib/sandbox/commands/create.ts +7 -6
  175. package/lib/sandbox/commands/rm.ts +21 -1895
  176. package/lib/sandbox/control/audit.ts +253 -0
  177. package/lib/sandbox/control/client.ts +109 -66
  178. package/lib/sandbox/control/executor.ts +134 -74
  179. package/lib/sandbox/control/finalization-response.ts +29 -0
  180. package/lib/sandbox/control/identity-sentinel.ts +137 -0
  181. package/lib/sandbox/control/lifecycle.ts +45 -3
  182. package/lib/sandbox/control/native-file-lock.ts +6 -107
  183. package/lib/sandbox/control/protocol.ts +80 -6
  184. package/lib/sandbox/control/server.ts +567 -132
  185. package/lib/sandbox/control/state.ts +86 -0
  186. package/lib/sandbox/control/task-workflow.ts +95 -0
  187. package/lib/sandbox/control/workflow-executor.ts +92 -0
  188. package/lib/sandbox/index.ts +1 -2
  189. package/lib/sandbox/recovery.ts +28 -5
  190. package/lib/sandbox/removal.ts +1142 -0
  191. package/lib/sandbox/task-cleanup.ts +209 -0
  192. package/lib/sandbox/workspace-identity.ts +19 -3
  193. package/lib/sandbox/workspace-view.ts +17 -15
  194. package/lib/task/activity-intent.ts +2 -2
  195. package/lib/task/activity-log.ts +27 -19
  196. package/lib/task/artifact-command.ts +85 -0
  197. package/lib/task/artifact-lifecycle.ts +31 -26
  198. package/lib/task/artifact-name.ts +55 -0
  199. package/lib/task/artifact-operations.ts +34 -310
  200. package/lib/task/artifact-receipts.ts +3 -14
  201. package/lib/task/artifact-recovery.ts +519 -0
  202. package/lib/task/artifact-repair-intent.ts +162 -33
  203. package/lib/task/artifact-schema.ts +5 -34
  204. package/lib/task/capabilities.ts +13 -22
  205. package/lib/task/codex-orchestration.ts +85 -24
  206. package/lib/task/commit-identity.ts +31 -0
  207. package/lib/task/commit-operation.ts +37 -20
  208. package/lib/task/control-authority.ts +540 -10
  209. package/lib/task/control-recovery.ts +186 -0
  210. package/lib/task/create-service.ts +1 -10
  211. package/lib/task/create.ts +63 -8
  212. package/lib/task/decision-details.ts +3 -71
  213. package/lib/task/delegation-receipts.ts +73 -2
  214. package/lib/task/events.ts +309 -24
  215. package/lib/task/finalization-state.ts +11 -0
  216. package/lib/task/human-override.ts +8 -16
  217. package/lib/task/implementation-inputs.ts +3 -3
  218. package/lib/task/intermediate-cleanup.ts +493 -0
  219. package/lib/task/invalidation.ts +18 -62
  220. package/lib/task/ledger-intents.ts +7 -24
  221. package/lib/task/ledger.ts +1 -3
  222. package/lib/task/lifecycle-recovery.ts +691 -0
  223. package/lib/task/lifecycle.ts +30 -5
  224. package/lib/task/local-artifact-finalization.ts +244 -234
  225. package/lib/task/manual-validation-completion.ts +40 -0
  226. package/lib/task/manual-validation-evidence.ts +209 -0
  227. package/lib/task/manual-validation-receipt.ts +156 -0
  228. package/lib/task/manual-validation-shared.ts +50 -0
  229. package/lib/task/manual-validation-transaction.ts +304 -0
  230. package/lib/task/markdown.ts +70 -0
  231. package/lib/task/orchestration.ts +84 -19
  232. package/lib/task/pr-delivery-fact.ts +15 -62
  233. package/lib/task/qualification-audit.ts +22 -33
  234. package/lib/task/recovery-warning.ts +21 -0
  235. package/lib/task/review-artifacts.ts +1 -20
  236. package/lib/task/review-command.ts +24 -0
  237. package/lib/task/review-finalization.ts +183 -292
  238. package/lib/task/review-fingerprint.ts +2 -2
  239. package/lib/task/sections.ts +33 -54
  240. package/lib/task/short-id.ts +27 -5
  241. package/lib/task/task-execution-lock.ts +1 -1
  242. package/lib/task/verification-engine.ts +113 -383
  243. package/lib/task/verification-types.ts +15 -0
  244. package/lib/task/verification.ts +1 -1
  245. package/lib/task/workflow-command.ts +17 -0
  246. package/lib/task/workflow-warning-intents.ts +0 -13
  247. package/lib/task/workflow-warnings.ts +21 -2
  248. package/lib/update.ts +6 -0
  249. package/lib/version.ts +1 -15
  250. package/package.json +6 -6
  251. package/templates/.agents/hooks/lifecycle-delegation.js +6 -6
  252. package/templates/.agents/rules/create-issue.en.md +1 -1
  253. package/templates/.agents/rules/create-issue.zh-CN.md +1 -1
  254. package/templates/.agents/rules/issue-sync.en.md +4 -2
  255. package/templates/.agents/rules/issue-sync.zh-CN.md +4 -3
  256. package/templates/.agents/rules/local-artifact-repair.en.md +46 -39
  257. package/templates/.agents/rules/local-artifact-repair.zh-CN.md +43 -36
  258. package/templates/.agents/rules/testing-discipline.en.md +2 -0
  259. package/templates/.agents/rules/testing-discipline.zh-CN.md +2 -0
  260. package/templates/.agents/scripts/package.json +3 -0
  261. package/templates/.agents/skills/analyze-task/SKILL.en.md +6 -6
  262. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +6 -6
  263. package/templates/.agents/skills/analyze-task/config/verify.en.json +1 -1
  264. package/templates/.agents/skills/analyze-task/config/verify.zh-CN.json +1 -1
  265. package/templates/.agents/skills/block-task/SKILL.en.md +2 -2
  266. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +2 -2
  267. package/templates/.agents/skills/block-task/config/verify.json +1 -1
  268. package/templates/.agents/skills/cancel-task/SKILL.en.md +3 -3
  269. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +3 -3
  270. package/templates/.agents/skills/cancel-task/config/verify.json +1 -1
  271. package/templates/.agents/skills/code-task/SKILL.en.md +7 -7
  272. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +7 -7
  273. package/templates/.agents/skills/code-task/config/verify.en.json +1 -1
  274. package/templates/.agents/skills/code-task/config/verify.zh-CN.json +1 -1
  275. package/templates/.agents/skills/commit/reference/issue-metadata-sync.en.md +1 -1
  276. package/templates/.agents/skills/commit/reference/issue-metadata-sync.zh-CN.md +1 -1
  277. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +33 -21
  278. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +33 -21
  279. package/templates/.agents/skills/complete-manual-validation/config/verify.en.json +1 -1
  280. package/templates/.agents/skills/complete-manual-validation/config/verify.zh-CN.json +1 -1
  281. package/templates/.agents/skills/complete-manual-validation/reference/report-template.en.md +2 -0
  282. package/templates/.agents/skills/complete-manual-validation/reference/report-template.zh-CN.md +2 -0
  283. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +16 -7
  284. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +16 -7
  285. package/templates/.agents/skills/complete-task/SKILL.en.md +3 -3
  286. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +3 -3
  287. package/templates/.agents/skills/complete-task/config/verify.en.json +2 -2
  288. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +2 -2
  289. package/templates/.agents/skills/complete-task/reference/external-delivery.en.md +1 -1
  290. package/templates/.agents/skills/complete-task/reference/external-delivery.zh-CN.md +1 -1
  291. package/templates/.agents/skills/create-pr/SKILL.en.md +2 -2
  292. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +2 -2
  293. package/templates/.agents/skills/create-pr/config/verify.json +1 -1
  294. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +2 -2
  295. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +2 -2
  296. package/templates/.agents/skills/create-task/SKILL.en.md +5 -5
  297. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +5 -5
  298. package/templates/.agents/skills/create-task/config/verify.json +1 -1
  299. package/templates/.agents/skills/import-issue/SKILL.en.md +8 -8
  300. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +8 -8
  301. package/templates/.agents/skills/import-issue/config/verify.json +2 -2
  302. package/templates/.agents/skills/plan-task/SKILL.en.md +4 -4
  303. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +4 -4
  304. package/templates/.agents/skills/plan-task/config/verify.en.json +1 -1
  305. package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +1 -1
  306. package/templates/.agents/skills/release/SKILL.en.md +7 -3
  307. package/templates/.agents/skills/release/SKILL.zh-CN.md +7 -3
  308. package/templates/.agents/skills/restore-task/SKILL.en.md +2 -2
  309. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +2 -2
  310. package/templates/.agents/skills/restore-task/config/verify.json +1 -1
  311. package/templates/.agents/skills/review-analysis/SKILL.en.md +2 -2
  312. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +2 -2
  313. package/templates/.agents/skills/review-analysis/config/verify.en.json +1 -1
  314. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +1 -1
  315. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +7 -7
  316. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +6 -6
  317. package/templates/.agents/skills/review-code/SKILL.en.md +2 -2
  318. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +2 -2
  319. package/templates/.agents/skills/review-code/config/verify.en.json +1 -1
  320. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -1
  321. package/templates/.agents/skills/review-code/reference/report-template.en.md +12 -12
  322. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +12 -12
  323. package/templates/.agents/skills/review-plan/SKILL.en.md +2 -2
  324. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +2 -2
  325. package/templates/.agents/skills/review-plan/config/verify.en.json +1 -1
  326. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +1 -1
  327. package/templates/.agents/skills/review-plan/reference/report-template.en.md +7 -7
  328. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +7 -7
  329. package/templates/.agents/skills/review-pr/config/verify.en.json +1 -1
  330. package/templates/.agents/skills/review-pr/config/verify.zh-CN.json +1 -1
  331. package/templates/.agents/skills/review-pr/reference/evidence-grading.en.md +3 -3
  332. package/templates/.agents/skills/review-pr/reference/evidence-grading.zh-CN.md +3 -3
  333. package/templates/.agents/skills/run-manual-validation/SKILL.en.md +20 -3
  334. package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +20 -3
  335. package/templates/.agents/skills/run-manual-validation/config/verify.en.json +1 -1
  336. package/templates/.agents/skills/run-manual-validation/config/verify.zh-CN.json +1 -1
  337. package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.en.md +4 -1
  338. package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.zh-CN.md +4 -1
  339. package/templates/.agents/skills/run-manual-validation/reference/report-template.en.md +2 -0
  340. package/templates/.agents/skills/run-manual-validation/reference/report-template.zh-CN.md +2 -0
  341. package/templates/.agents/skills/run-task/SKILL.en.md +1 -1
  342. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +1 -1
  343. package/templates/.agents/skills/test/SKILL.en.md +17 -6
  344. package/templates/.agents/skills/test/SKILL.zh-CN.md +17 -6
  345. package/templates/.agents/templates/task.en.md +1 -1
  346. package/templates/.agents/templates/task.zh-CN.md +1 -1
  347. package/templates/.claude/commands/import-issue.en.md +1 -1
  348. package/templates/.claude/commands/import-issue.zh-CN.md +1 -1
  349. package/templates/.claude/commands/restore-task.en.md +1 -1
  350. package/templates/.claude/commands/restore-task.zh-CN.md +1 -1
  351. package/templates/.claude/commands/run-manual-validation.en.md +1 -1
  352. package/templates/.claude/commands/run-manual-validation.zh-CN.md +1 -1
  353. package/dist/lib/platform/adapters.js +0 -56
  354. package/lib/platform/adapters.ts +0 -197
@@ -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
 
@@ -39,6 +40,7 @@ $ tail .agents/workspace/active/{task-id}/task.md
39
40
  - Result: {summary-result}
40
41
  - Summary comment: {comment-id or URL}
41
42
  - Updated status: `### ✅ Manual Validation Passed`
43
+ - Transaction: `{transaction-id}`; receipt=`{receipt-digest}`; head=`{pr-head-sha}`
42
44
  ````
43
45
 
44
46
  ## Filling Rules
@@ -7,6 +7,7 @@
7
7
 
8
8
  - **验证轮次**:Round {N}
9
9
  - **产物文件**:`manual-validation.md`
10
+ - **人工验证依据**:维护者提供的 PR 验证留言和验证说明
10
11
 
11
12
  ## 状态核对
12
13
 
@@ -39,6 +40,7 @@ $ tail .agents/workspace/active/{task-id}/task.md
39
40
  - 结果:{summary-result}
40
41
  - 摘要评论:{comment-id 或 URL}
41
42
  - 更新状态:`### ✅ 人工验证已通过`
43
+ - Transaction:`{transaction-id}`;receipt=`{receipt-digest}`;head=`{pr-head-sha}`
42
44
  ````
43
45
 
44
46
  ## 填写规则
@@ -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>`。
@@ -104,7 +104,7 @@ Run /create-pr --task {task-ref} first, then complete; --skip-pr is not accepted
104
104
  Before lifecycle, verify only the hard gates:
105
105
  - [ ] Task identity, active state, concurrency locks, and local atomic lifecycle operations are available
106
106
  - [ ] Required-PR delivery is satisfied when `prFlow=required`
107
- - [ ] 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
108
108
 
109
109
  > **⚠️ Prerequisite Branch Check — you must decide whether to continue or stop before proceeding:**
110
110
  >
@@ -135,11 +135,11 @@ Do not write `status/current_step/completed_at/updated_at/agent_infra_version`,
135
135
 
136
136
  ### 4. Sync the Platform While Active
137
137
 
138
- Check whether task.md has a valid `issue_number`. If it does not, skip this step without output.
138
+ Check whether task.md has a valid `platform_issue_identity`. If it does not, skip this step without output.
139
139
 
140
140
  > Issue metadata boundaries live in `.agents/rules/issue-sync.md`; comments use internal platform intents.
141
141
 
142
- When an `issue_number` exists, execute in this exact order:
142
+ When a valid `platform_issue_identity` exists, execute in this exact order:
143
143
 
144
144
  1. Run `agent-infra-internal platform-comment backfill {task-id} --agent {standard-agent-token}` so core publishes only the completion canonical inventory in fixed order and resolves matching historical warnings only after full success.
145
145
  2. Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --requirements --fields`.
@@ -103,7 +103,7 @@ agent-infra-internal platform-pr resolve-external {task-id} --agent {standard-ag
103
103
  生命周期前只验证硬门禁:
104
104
  - [ ] task 身份、active 状态、并发锁和本地原子生命周期操作可用
105
105
  - [ ] `prFlow=required` 时已满足 required-PR delivery
106
- - [ ] 其余业务证据(工作流、审查、提交、测试、分歧账本、人工校验和平台同步)已记录或可在生命周期后校验
106
+ - [ ] 其余业务证据(工作流、审查、提交、测试、分歧账本、人工校验和平台同步)已记录或可在生命周期后校验;人工验证只能由 committed transaction、receipt、当前 artifact 摘要和带 identity 的通过日志满足
107
107
 
108
108
  > **⚠️ 前置条件分支判断 — 你必须先判断“继续”还是“停止”:**
109
109
  >
@@ -134,11 +134,11 @@ Please satisfy the hard prerequisite first, then retry complete-task.
134
134
 
135
135
  ### 4. 在 active 阶段同步平台
136
136
 
137
- 检查 `task.md` 中是否存在有效的 `issue_number`。如果没有,跳过本步骤且不输出任何内容。
137
+ 检查 `task.md` 中是否存在有效的 `platform_issue_identity`。如果没有,跳过本步骤且不输出任何内容。
138
138
 
139
139
  > Issue 元数据边界见 `.agents/rules/issue-sync.md`;评论同步统一调用 internal platform intent。
140
140
 
141
- 如果存在有效的 `issue_number`,严格按以下顺序执行:
141
+ 如果存在有效的 `platform_issue_identity`,严格按以下顺序执行:
142
142
 
143
143
  1. 调用 `agent-infra-internal platform-comment backfill {task-id} --agent {standard-agent-token}`,由 core 仅按 completion canonical inventory 固定顺序补发产物并在全部成功后精确恢复目标历史告警。
144
144
  2. 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --requirements --fields`。
@@ -28,7 +28,7 @@
28
28
  "manual-validation": {},
29
29
  "post-review-commit": {},
30
30
  "platform-sync-preflight": {
31
- "when": "issue_number_exists",
31
+ "when": "platform_issue_identity_exists",
32
32
  "expected_comment_marker": "<!-- sync-issue:{task-id}:summary -->",
33
33
  "verify_task_comment_content": false,
34
34
  "sync_checked_requirements": true,
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "required-pr-delivery": {},
42
42
  "platform-sync": {
43
- "when": "issue_number_exists",
43
+ "when": "platform_issue_identity_exists",
44
44
  "verify_task_comment_content": true,
45
45
  "verify_closed_issue_has_no_status_labels": true
46
46
  },
@@ -28,7 +28,7 @@
28
28
  "manual-validation": {},
29
29
  "post-review-commit": {},
30
30
  "platform-sync-preflight": {
31
- "when": "issue_number_exists",
31
+ "when": "platform_issue_identity_exists",
32
32
  "expected_comment_marker": "<!-- sync-issue:{task-id}:summary -->",
33
33
  "verify_task_comment_content": false,
34
34
  "sync_checked_requirements": true,
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "required-pr-delivery": {},
42
42
  "platform-sync": {
43
- "when": "issue_number_exists",
43
+ "when": "platform_issue_identity_exists",
44
44
  "verify_task_comment_content": true,
45
45
  "verify_closed_issue_has_no_status_labels": true
46
46
  },
@@ -4,7 +4,7 @@ This scenario applies only to an active task whose completion canonical inventor
4
4
 
5
5
  ## Typed State Machine
6
6
 
7
- Run `agent-infra-internal platform-pr resolve-external {task-id} --agent {agent} [--pr {N}]`. Core checks the completion inventory first. A non-empty inventory returns `mode=normal`, and supplying `--pr` then fails. An empty inventory requires a positive `issue_number`; otherwise core returns `EXTERNAL_DELIVERY_ISSUE_REQUIRED`.
7
+ Run `agent-infra-internal platform-pr resolve-external {task-id} --agent {agent} [--pr {N}]`. Core checks the completion inventory first. A non-empty inventory returns `mode=normal`, and supplying `--pr` then fails. An empty inventory requires a valid `platform_issue_identity`; otherwise core returns `EXTERNAL_DELIVERY_ISSUE_REQUIRED`.
8
8
 
9
9
  The platform adapter supplies authoritative Issue closing change requests across all pages. Only candidates with a matching base repository, complete identity, and merge evidence are eligible. One candidate is selected automatically; ambiguity, conflicts, and missing evidence fail closed. `--pr` may only select an authoritative eligible closing candidate and cannot bypass repository, Issue, merge, or identity validation.
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Typed 状态机
6
6
 
7
- 调用 `agent-infra-internal platform-pr resolve-external {task-id} --agent {agent} [--pr {N}]`。core 先检查 completion inventory;非空时返回 `mode=normal`,且显式 `--pr` 会失败。空 inventory 必须有正整数 `issue_number`,否则返回 `EXTERNAL_DELIVERY_ISSUE_REQUIRED`。
7
+ 调用 `agent-infra-internal platform-pr resolve-external {task-id} --agent {agent} [--pr {N}]`。core 先检查 completion inventory;非空时返回 `mode=normal`,且显式 `--pr` 会失败。空 inventory 必须有有效 `platform_issue_identity`,否则返回 `EXTERNAL_DELIVERY_ISSUE_REQUIRED`。
8
8
 
9
9
  core 通过平台 adapter 读取 Issue 的权威 closing change requests,穷尽分页后只把 base 仓库匹配任务仓库且已经合并、身份字段完整的候选视为 eligible。唯一候选自动选择;多候选、身份冲突或证据缺失均 fail closed。`--pr` 只能从权威 closing eligible 集合中显式选择,不能绕过仓库、Issue、合并或身份校验。
10
10
 
@@ -47,7 +47,7 @@ No Pull Request is required; run instead:
47
47
 
48
48
  Parse the task scope first: an optional `--task <ref>` or `-t <ref>` selects `{task-id}`; a positional task ref is not interpreted. The remaining positional argument, when present, is `{target-branch}`.
49
49
 
50
- If `{task-id}` is provided, read `.agents/workspace/active/{task-id}/task.md` to load task metadata such as `issue_number` and `type`.
50
+ If `{task-id}` is provided, read `.agents/workspace/active/{task-id}/task.md` to load task metadata such as `platform_issue_identity` and `type`.
51
51
  If `{task-id}` is omitted, try to resolve it from the current session context; if it still cannot be determined, skip task-association logic in later steps.
52
52
 
53
53
  ### 2. Determine the Target Branch
@@ -70,7 +70,7 @@ Run `agent-infra-internal task-delivery {task-id} deliver --agent {standard-agen
70
70
 
71
71
  Read `.agents/rules/issue-pr-commands.md`, write the title and body to temporary files, then invoke its `platform-pr create` intent. Under the task lock, core uses remote branch and exact head/base/PR identity facts: one existing PR is reused and bound, zero creates, and multiple matches fail deterministically. Review artifacts and task sync records are not create-pr prerequisites, and replays must not create duplicate PRs.
72
72
 
73
- If `{task-id}` is available and the related task provides `issue_number`, keep `Closes #{issue-number}` in the PR body.
73
+ If `{task-id}` is available and the related task provides `platform_issue_identity`, keep `Closes #{issue-number}` or the provider-equivalent closing keyword in the PR body when supported.
74
74
 
75
75
  ### 6. Sync PR Metadata
76
76
 
@@ -47,7 +47,7 @@ description: >
47
47
 
48
48
  先解析 task scope:可选的 `--task <ref>` 或 `-t <ref>` 绑定 `{task-id}`;位置 task ref 不再解释。剩余的可选位置参数绑定为 `{target-branch}`。
49
49
 
50
- 如果提供了 `{task-id}`,读取 `.agents/workspace/active/{task-id}/task.md` 获取任务信息(例如 `issue_number`、`type` 等)。
50
+ 如果提供了 `{task-id}`,读取 `.agents/workspace/active/{task-id}/task.md` 获取任务信息(例如 `platform_issue_identity`、`type` 等)。
51
51
  如果未提供,可从当前 session 上下文获取;仍无法确定 `{task-id}` 时,后续步骤中的任务关联逻辑跳过。
52
52
 
53
53
  ### 2. 确定目标分支
@@ -70,7 +70,7 @@ description: >
70
70
 
71
71
  执行前先读取 `.agents/rules/issue-pr-commands.md`,把标题和正文写入临时文件,并调用其中的 `platform-pr create` intent。core 在任务锁内按 remote branch、head/base 和 PR 身份事实执行:唯一既有 PR 会复用并绑定,零个才创建,多个稳定失败;review 或 task sync 记录不作为创建 PR 的前置门禁,重放不得产生重复 PR。
72
72
 
73
- 如果获取到 `{task-id}` 且对应任务提供了 `issue_number`,必须在 PR 正文中保留 `Closes #{issue-number}`。
73
+ 如果获取到 `{task-id}` 且对应任务提供了 `platform_issue_identity`,在 provider 支持 numeric closing reference 时必须在 PR 正文中保留 `Closes #{issue-number}` 或 provider 等价关闭关键字。
74
74
 
75
75
  ### 6. 同步 PR 元数据
76
76
 
@@ -18,7 +18,7 @@
18
18
  "expected_action_pattern": "(Create PR|PR Created)"
19
19
  },
20
20
  "platform-sync": {
21
- "when": "issue_number_exists",
21
+ "when": "platform_issue_identity_exists",
22
22
  "expected_pr_comment_marker": "<!-- sync-pr:{task-id}:summary -->",
23
23
  "verify_in_labels_match_pr": true,
24
24
  "verify_in_labels_computed": true,
@@ -55,8 +55,8 @@ Milestone rule:
55
55
 
56
56
  ## Create the PR
57
57
 
58
- - Extract `issue_number` from task.md when this work belongs to an active task
59
- - If `issue_number` exists, complete the prerequisite code-hosting platform detection steps first, then query the Issue via `.agents/rules/issue-pr-commands.md`
58
+ - Extract `platform_issue_identity` from task.md when this work belongs to an active task
59
+ - If `platform_issue_identity` exists, complete the prerequisite code-hosting platform detection steps first, then query the Issue via `.agents/rules/issue-pr-commands.md`
60
60
  - Before calling the PR creation command, check whether the current branch already has a PR. If it does, report the PR URL and state, then stop without repeating metadata sync or summary publication
61
61
  - Use HEREDOC to pass the PR body
62
62
  - Replace `{$IssueNumber}` in the template when present
@@ -55,8 +55,8 @@ Milestone 规则:
55
55
 
56
56
  ## 创建 PR
57
57
 
58
- - 当前工作属于 active task 时,从 task.md 提取 `issue_number`
59
- - 如果存在 `issue_number`,先完成代码托管平台检测,再通过 `.agents/rules/issue-pr-commands.md` 查询 Issue
58
+ - 当前工作属于 active task 时,从 task.md 提取 `platform_issue_identity`
59
+ - 如果存在 `platform_issue_identity`,先完成代码托管平台检测,再通过 `.agents/rules/issue-pr-commands.md` 查询 Issue
60
60
  - 调用 PR 创建命令前,先检查当前分支是否已有 PR;若已有,报告 PR URL 和状态后停止,不重复执行元数据同步或 summary 发布
61
61
  - 使用 HEREDOC 传入 PR 正文
62
62
  - 模板中存在 `{$IssueNumber}` 时进行替换
@@ -139,7 +139,7 @@ automatically. Recover with the original request or inspect host task state firs
139
139
  The host service owns platform cascading. The compatibility recovery commands remain visible in the host warning and are not run from the sandbox:
140
140
 
141
141
  ```bash
142
- agent-infra-internal task-warning {task-id} add --step create-task --severity ACTION_REQUIRED --code ISSUE_CREATE_FAILED --target issue --message "{error_code}: {error_message}" --action "Fix auth/network/template issues and manually retry Issue creation, or create/find an Issue and write issue_number"
142
+ agent-infra-internal task-warning {task-id} add --step create-task --severity ACTION_REQUIRED --code ISSUE_CREATE_FAILED --target issue --message "{error_code}: {error_message}" --action "Fix auth/network/template issues and manually retry Issue creation, or create/find an Issue and run platform-issue bind"
143
143
  agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}
144
144
  ```
145
145
 
@@ -177,7 +177,7 @@ Task information:
177
177
  - Title: {title}
178
178
  - Type: {type}
179
179
  - Workflow: {workflow}
180
- - Issue: #{issue_number} {issue_url}
180
+ - Issue: #{issue-number} {issue_url}
181
181
 
182
182
  Output file:
183
183
  - Task file: .agents/workspace/active/{task-id}/task.md
@@ -228,10 +228,10 @@ Output file:
228
228
  Next step - run requirements analysis:
229
229
  {next-step-commands}
230
230
 
231
- For later platform sync: after fixing auth / network / template issues, manually run the Issue creation flow in `.agents/rules/create-issue.md` for this task; or manually create/find an Issue and write `issue_number` into task.md so later skills can take over cascade sync.
231
+ For later platform sync: after fixing auth / network / template issues, manually run the Issue creation flow in `.agents/rules/create-issue.md` for this task; or manually create/find an Issue and run `platform-issue bind`, which resolves the token through the provider and writes `platform_issue_identity` so later skills can take over cascade sync.
232
232
 
233
233
  [ACTION REQUIRED] Workflow warnings are open:
234
- - WW-N ISSUE_CREATE_FAILED (issue): Fix auth/network/template issues and manually retry Issue creation, or create/find an Issue and write issue_number
234
+ - WW-N ISSUE_CREATE_FAILED (issue): Fix auth/network/template issues and manually retry Issue creation, or create/find an Issue and run `platform-issue bind`
235
235
  ```
236
236
 
237
237
 
@@ -256,7 +256,7 @@ Wait for the user to run the `analyze-task` skill.
256
256
  1. **Clarity**: if the user description is vague or missing key information, ask for clarification first
257
257
  2. **Difference from `import-issue`**: `import-issue` imports from an Issue; `create-task` creates from a free-form description
258
258
  3. **Workflow order**: after creating a task, typically run `analyze-task` before `plan-task`
259
- 4. **Issue cascade failure**: if the rule fails, task.md remains; when platform sync is needed later, manually write `issue_number` and continue the workflow
259
+ 4. **Issue cascade failure**: if the rule fails, task.md remains; when platform sync is needed later, run `platform-issue bind` and do not hand-write the legacy Issue field
260
260
 
261
261
  ## Error Handling
262
262
 
@@ -137,7 +137,7 @@ candidate 和新的 outer request ID 重试;`recovery: same-request-id` 或
137
137
  平台级联由宿主服务完成。兼容的人工恢复命令仍由宿主 warning 指引,不在沙箱内执行:
138
138
 
139
139
  ```bash
140
- agent-infra-internal task-warning {task-id} add --step create-task --severity ACTION_REQUIRED --code ISSUE_CREATE_FAILED --target issue --message "{error_code}: {error_message}" --action "修复认证/网络/模板问题后手动重试 Issue 创建,或手动创建/找到 Issue 后写入 issue_number"
140
+ agent-infra-internal task-warning {task-id} add --step create-task --severity ACTION_REQUIRED --code ISSUE_CREATE_FAILED --target issue --message "{error_code}: {error_message}" --action "修复认证/网络/模板问题后手动重试 Issue 创建,或手动创建/找到 Issue 后执行 platform-issue bind"
141
141
  agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}
142
142
  ```
143
143
 
@@ -175,7 +175,7 @@ agent-infra-internal task-verify {task-id} create-task.completed --format text
175
175
  - 标题:{title}
176
176
  - 类型:{type}
177
177
  - 工作流:{workflow}
178
- - Issue:#{issue_number} {issue_url}
178
+ - Issue:#{issue-number} {issue_url}
179
179
 
180
180
  产出文件:
181
181
  - 任务文件:.agents/workspace/active/{task-id}/task.md
@@ -226,10 +226,10 @@ Issue 创建失败:
226
226
  下一步 - 执行需求分析:
227
227
  {next-step-commands}
228
228
 
229
- 后续如需平台同步:修复认证/网络/模板问题后,可按 `.agents/rules/create-issue.md` 对当前任务手动执行一次 Issue 创建;或手动创建/查找 Issue,并把 `issue_number` 写入 task.md,后续技能会接管级联同步。
229
+ 后续如需平台同步:修复认证/网络/模板问题后,可按 `.agents/rules/create-issue.md` 对当前任务手动执行一次 Issue 创建;或手动创建/查找 Issue 后执行 `platform-issue bind`,由 provider 解析 token 并写入 `platform_issue_identity`,后续技能会接管级联同步。
230
230
 
231
231
  [ACTION REQUIRED] Workflow warnings are open:
232
- - WW-N ISSUE_CREATE_FAILED (issue): 修复认证/网络/模板问题后手动重试 Issue 创建,或手动创建/找到 Issue 后写入 issue_number
232
+ - WW-N ISSUE_CREATE_FAILED (issue): 修复认证/网络/模板问题后手动重试 Issue 创建,或手动创建/找到 Issue 后执行 `platform-issue bind`
233
233
  ```
234
234
 
235
235
 
@@ -254,7 +254,7 @@ Issue 创建失败:
254
254
  1. **清晰度**:如果用户描述模糊或缺少关键信息,先要求澄清
255
255
  2. **与 import-issue 的区别**:`import-issue` 从 Issue 导入任务;`create-task` 从自由描述创建
256
256
  3. **工作流顺序**:创建任务后,通常先执行 `analyze-task` 再进入 `plan-task`
257
- 4. **Issue 级联失败**:如果规则执行失败,task.md 仍保留;需要后续平台同步时,可手动写入 `issue_number` 后继续执行工作流
257
+ 4. **Issue 级联失败**:如果规则执行失败,task.md 仍保留;需要后续平台同步时,可手动执行 `platform-issue bind`,不得手工写入旧的 Issue 字段
258
258
 
259
259
  ## 错误处理
260
260
 
@@ -21,7 +21,7 @@
21
21
  "expected_action_pattern": "(Create Task|Task Created)"
22
22
  },
23
23
  "platform-sync": {
24
- "when": "issue_number_exists",
24
+ "when": "platform_issue_identity_exists",
25
25
  "issue_must_exist": true,
26
26
  "verify_task_comment_content": true,
27
27
  "verify_milestone": true,
@@ -9,7 +9,7 @@ description: >
9
9
  > `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
10
10
 
11
11
 
12
- Import the specified Issue and create a task. Argument: issue number.
12
+ Import the specified Issue and create a task. Argument: a raw Issue token, parsed after the provider is selected.
13
13
 
14
14
  ## Boundary / Critical Rules
15
15
 
@@ -43,7 +43,7 @@ This skill **creates** task.md, so there is no file to write at the start. Captu
43
43
 
44
44
  Read `.agents/rules/issue-pr-commands.md` first, follow its prerequisite steps to complete authentication and code-hosting platform detection, then load the Issue data with its "Read an Issue" command.
45
45
 
46
- Extract: issue number, title, description, and labels.
46
+ Extract: Issue identity, title, description, and labels.
47
47
 
48
48
  Derive the task title from the Issue title by stripping an optional single leading Conventional Commits prefix, following the contract below; preserve the rest of the description verbatim and in its original language. This fenced contract is the authoritative, language-neutral rule — keep it byte-for-byte identical across every `import-issue` variant:
49
49
 
@@ -67,7 +67,7 @@ Strip only the first layer, and only when the leading token is a `prefix-types`
67
67
  - If found, **reuse the existing task by default** (Scenario A); do not ask the user. State clearly in the final notice: "Reused existing task `{task-id}`; not re-imported." If the user wants to re-import, they must first archive or delete the existing task and run this skill again
68
68
  - If not found, continue to 2.2
69
69
 
70
- 2.2 Run `agent-infra-internal platform-comment list --issue {issue-number}` to scan registered markers for a recoverable historical task ID.
70
+ 2.2 Run `agent-infra-internal platform-comment list --issue {issue-token}` to scan registered markers for a recoverable historical task ID.
71
71
 
72
72
  This command depends on `$upstream_repo` being set in step 1.
73
73
 
@@ -101,7 +101,7 @@ date +%Y%m%d-%H%M%S
101
101
  Task metadata:
102
102
  ```yaml
103
103
  id: {task-id}
104
- issue_number: <issue-number>
104
+ platform_issue_identity: <canonical identity JSON string returned by the provider>
105
105
  type: feature|bugfix|refactor|docs|chore
106
106
  branch: <project>-<type>-<slug>
107
107
  workflow: feature-development|bug-fix|refactoring
@@ -146,8 +146,8 @@ Update `.agents/workspace/active/{task-id}/task.md`:
146
146
 
147
147
  ### 5. Bind and Sync the Issue
148
148
 
149
- If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
150
- - Run `agent-infra-internal platform-issue bind {task-id} --issue {issue-number} --agent {standard-agent-token}`
149
+ After creating task.md, always perform the following binding and sync actions (skip and continue on any platform failure):
150
+ - Run `agent-infra-internal platform-issue bind {task-id} --issue {issue-token} --agent {standard-agent-token}`; the provider parses the token and atomically writes `platform_issue_identity`
151
151
  - Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --assignees current --milestone initial`
152
152
  - After every scenario, run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
153
153
 
@@ -202,7 +202,7 @@ Next step - run requirements analysis:
202
202
  ## Completion Checklist
203
203
 
204
204
  - [ ] Created the task file `.agents/workspace/active/{task-id}/task.md`
205
- - [ ] Recorded `issue_number` in task.md
205
+ - [ ] Provider wrote the Issue identity to `platform_issue_identity` in task.md
206
206
  - [ ] Updated `current_step` to requirement-analysis
207
207
  - [ ] Updated `updated_at` to the current time
208
208
  - [ ] Appended an Activity Log entry to task.md
@@ -224,6 +224,6 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
224
224
 
225
225
  ## Error Handling
226
226
 
227
- - Issue not found: output "Issue #{number} not found, please check the issue number"
227
+ - Issue not found: output "Issue {issue-token} not found, please check the Issue token"
228
228
  - Network error: output "Cannot connect to the platform, please check network"
229
229
  - Permission error: output "No access to this repository"
@@ -9,7 +9,7 @@ description: >
9
9
  > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
10
10
 
11
11
 
12
- 导入指定的 Issue 并创建任务。参数:issue 编号。
12
+ 导入指定的 Issue 并创建任务。参数:Issue 原始 token,由选定 provider 解析。
13
13
 
14
14
  ## 行为边界 / 关键规则
15
15
 
@@ -43,7 +43,7 @@ description: >
43
43
 
44
44
  执行前先读取 `.agents/rules/issue-pr-commands.md`,并按其中的前置步骤完成认证和代码托管平台检测;随后按其中的 “读取 Issue” 命令获取 Issue 信息。
45
45
 
46
- 提取:issue 编号、标题、描述、标签。
46
+ 提取:Issue identity、标题、描述、标签。
47
47
 
48
48
  从 Issue 标题派生任务标题:按下方契约剥掉可选的单层前导 Conventional Commits 前缀,其余描述原文与原始语言保持不变。下方 fenced 契约是权威的、与语言无关的规则——在所有 `import-issue` 变体中保持逐字节一致:
49
49
 
@@ -67,7 +67,7 @@ example-single-layer: "feat: add A: B" => "add A: B"
67
67
  - 如果找到,**默认复用现有任务**(场景 A),不询问用户;在最终告知中明确「已复用现有任务 `{task-id}`,未重新导入」。若用户希望重新导入,需要先手动归档/删除已有任务再次执行本技能
68
68
  - 如果未找到,继续执行 2.2
69
69
 
70
- 2.2 调用 `agent-infra-internal platform-comment list --issue {issue-number}` 扫描注册 marker,查找可恢复的历史任务 ID。
70
+ 2.2 调用 `agent-infra-internal platform-comment list --issue {issue-token}` 扫描注册 marker,查找可恢复的历史任务 ID。
71
71
 
72
72
  该命令内部解析 upstream、认证与分页。
73
73
 
@@ -101,7 +101,7 @@ date +%Y%m%d-%H%M%S
101
101
  任务元数据:
102
102
  ```yaml
103
103
  id: {task-id}
104
- issue_number: <issue-number>
104
+ platform_issue_identity: <provider 返回的 canonical identity JSON 字符串>
105
105
  type: feature|bugfix|refactor|docs|chore
106
106
  branch: <project>-<type>-<slug>
107
107
  workflow: feature-development|bug-fix|refactoring
@@ -146,8 +146,8 @@ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
146
146
 
147
147
  ### 5. 绑定并同步 Issue
148
148
 
149
- 如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
150
- - 调用 `agent-infra-internal platform-issue bind {task-id} --issue {issue-number} --agent {standard-agent-token}` 校验并原子绑定
149
+ 创建 task.md 后始终执行以下绑定和同步操作(任一平台失败则跳过并继续):
150
+ - 调用 `agent-infra-internal platform-issue bind {task-id} --issue {issue-token} --agent {standard-agent-token}`,由 provider 解析并原子写入 `platform_issue_identity`
151
151
  - 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --assignees current --milestone initial`
152
152
  - 所有场景结束后,必须调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
153
153
 
@@ -202,7 +202,7 @@ Issue #{number} 已导入。
202
202
  ## 完成检查清单
203
203
 
204
204
  - [ ] 创建了任务文件 `.agents/workspace/active/{task-id}/task.md`
205
- - [ ] 在 task.md 中记录了 issue_number
205
+ - [ ] 已由 provider 将 Issue identity 写入 task.md 的 `platform_issue_identity`
206
206
  - [ ] 更新了 `current_step` 为 requirement-analysis
207
207
  - [ ] 更新了 `updated_at` 为当前时间
208
208
  - [ ] 追加了 Activity Log 条目到 task.md
@@ -224,6 +224,6 @@ Issue #{number} 已导入。
224
224
 
225
225
  ## 错误处理
226
226
 
227
- - Issue 未找到:提示 "Issue #{number} not found, please check the issue number"
227
+ - Issue 未找到:提示 "Issue {issue-token} not found, please check the Issue token"
228
228
  - 网络错误:提示 "Cannot connect to the platform, please check network"
229
229
  - 权限错误:提示 "No access to this repository"
@@ -15,13 +15,13 @@
15
15
  "assigned_to"
16
16
  ],
17
17
  "expected_step": "requirement-analysis",
18
- "require_issue_number": true
18
+ "require_platform_issue_identity": true
19
19
  },
20
20
  "activity-log": {
21
21
  "expected_action_pattern": "Import Issue"
22
22
  },
23
23
  "platform-sync": {
24
- "when": "issue_number_exists",
24
+ "when": "platform_issue_identity_exists",
25
25
  "issue_must_exist": true,
26
26
  "verify_task_comment_content": true
27
27
  }
@@ -114,7 +114,7 @@ Before writing this round's `{plan-artifact}`, create the controlled report skel
114
114
  agent-infra-internal task-artifact {task-id} init --family plan --artifact {plan-artifact} --locale en
115
115
  ```
116
116
 
117
- The skeleton contains identity metadata, stable section markers, and required headings only; real plan content is required before the completion gate can pass. If the finalizer returns one provably safe structural error, call `task-artifact {task-id} repair --family plan --artifact {plan-artifact} --expected-sha256 {artifact-sha256} --expected-semantic-digest {semantic-digest}`, then rerun the same finalizer.
117
+ The skeleton contains identity metadata, stable section markers, and required headings only; real plan content is required before the completion gate can pass. If the finalizer returns one provably safe structural error, it returns a controlled recovery candidate; edit only its `candidatePath`, then rerun `task-artifact {task-id} finalize-local --family plan --artifact {plan-artifact} --recovery-id {recovery-id}` with the same `recoveryId`. Candidate-only is a protocol authorization boundary, not OS isolation; arbitrary same-UID host writers are outside the protocol's protection claim, and fingerprint/state checks fail closed on anomalies.
118
118
 
119
119
  Create `.agents/workspace/active/{task-id}/{plan-artifact}`.
120
120
 
@@ -135,14 +135,14 @@ agent-infra-internal task-artifact {task-id} finalize-local --family plan --arti
135
135
  ```
136
136
 
137
137
  - On `status=passed`, save that result's `artifactSha256` and `semanticDigest`; the finalizer has recorded the matching one-shot local provenance intent.
138
- - On `status=failed` with `repairable=true`, apply only the diagnostic's `replace-line` operation once, then rerun the same command completely; count an attempt only after bytes change, up to 8 attempts.
139
- - The first repairable failure's `semanticDigest` is retained as the baseline; a retried `status=passed` result must match it. On baseline mismatch, any other failure, no progress, or a repeated diagnostic, stop without publishing a completed event.
138
+ - On `status=failed` with recovery context, edit only the returned `candidatePath` once after the completion gates pass, then rerun the finalizer completely with the same `recoveryId`; the formal artifact must remain unchanged until commit.
139
+ - The recovery candidate must match the recorded task, round, artifact, baseline, and request identity. On baseline conflict, unknown state, no progress, or repeated failure, stop without publishing a completed event.
140
140
 
141
141
  Use the digests from that same `status=passed` result in `agent-infra-internal task-event {task-id} plan.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {plan-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} {execution-flag}` so the core records the link, stage, agent, metadata, and Activity Log atomically.
142
142
  - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Plan Task (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
143
143
  ```
144
144
 
145
- If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
145
+ If task.md contains a valid `platform_issue_identity`, perform these sync actions (skip and continue on any failure):
146
146
  - Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status pending-design-work --fields`
147
147
  - Run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
148
148
  - Run `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {plan-artifact} --agent {standard-agent-token}`
@@ -117,7 +117,7 @@ agent-infra-internal task-event {task-id} plan.started --agent {standard-agent-t
117
117
  agent-infra-internal task-artifact {task-id} init --family plan --artifact {plan-artifact}
118
118
  ```
119
119
 
120
- 骨架只包含身份元数据、稳定 section marker 和必需标题;必须填入真实方案内容后才能通过完成门禁。finalizer 返回可证明的单个结构错误时,使用其 SHA 和 semantic digest 调用 `task-artifact {task-id} repair --family plan --artifact {plan-artifact} --expected-sha256 {artifact-sha256} --expected-semantic-digest {semantic-digest}`,然后完整重跑 finalizer。
120
+ 骨架只包含身份元数据、稳定 section marker 和必需标题;必须填入真实方案内容后才能通过完成门禁。finalizer 返回可证明的单个结构错误时,会返回受控 recovery candidate;只能编辑返回的 `candidatePath`,然后使用同一个 `recoveryId` 重跑 `task-artifact {task-id} finalize-local --family plan --artifact {plan-artifact} --recovery-id {recovery-id}`。candidate-only 是协议授权边界,不是操作系统隔离;同 UID 的任意宿主写入者不在本协议的防护承诺内,异常由指纹/状态校验失败关闭。
121
121
 
122
122
  创建 `.agents/workspace/active/{task-id}/{plan-artifact}`。
123
123
 
@@ -134,11 +134,11 @@ agent-infra-internal task-artifact {task-id} init --family plan --artifact {plan
134
134
  agent-infra-internal task-artifact {task-id} finalize-local --family plan --artifact {plan-artifact}
135
135
  ```
136
136
  - `status=passed`:保存本次返回的 `artifactSha256` 和 `semanticDigest`;finalizer 已记录对应的一次性本地 provenance intent。
137
- - `status=failed` 且 `repairable=true`:仅按诊断中的 `replace-line` 操作做一次最小修改,然后完整重跑同一命令;实际字节发生变化才计一次 `repairAttempts`,最多 8 次。
138
- - 首次可修复失败的 `semanticDigest` 由 finalizer 保留为基线;重试后的 `status=passed` 必须匹配该基线。基线不匹配、其他失败、无进展或重复诊断:停止,不发布 completed 事件。
137
+ - `status=failed` 且返回 recovery context:完成门禁通过后,只编辑返回的 `candidatePath` 一次,然后使用同一个 `recoveryId` 完整重跑 finalizer;formal artifact 在 commit 前必须保持不变。
138
+ - recovery candidate 必须与记录的任务、轮次、产物、baseline 和 request identity 匹配;基线冲突、未知状态、无进展或重复失败:停止,不发布 completed 事件。
139
139
  - 使用同一次 `status=passed` 返回的摘要执行 `agent-infra-internal task-event {task-id} plan.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {plan-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} {execution-flag}`,由核心登记链接、阶段、代理、时间、版本和 Activity Log。
140
140
 
141
- 如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
141
+ 如果 task.md 中存在有效的 `platform_issue_identity`,执行以下同步操作(任一失败则跳过并继续):
142
142
  - 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status pending-design-work --fields`
143
143
  - 调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
144
144
  - 调用 `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {plan-artifact} --agent {standard-agent-token}`
@@ -28,7 +28,7 @@
28
28
  ]
29
29
  },
30
30
  "platform-sync": {
31
- "when": "issue_number_exists",
31
+ "when": "platform_issue_identity_exists",
32
32
  "expected_status_label": "status: pending-design-work",
33
33
  "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
34
34
  "verify_comment_content": true,
@@ -28,7 +28,7 @@
28
28
  ]
29
29
  },
30
30
  "platform-sync": {
31
- "when": "issue_number_exists",
31
+ "when": "platform_issue_identity_exists",
32
32
  "expected_status_label": "status: pending-design-work",
33
33
  "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
34
34
  "verify_comment_content": true,