@fitlab-ai/agent-infra 0.9.2 → 0.9.3

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 (318) hide show
  1. package/README.md +10 -9
  2. package/README.zh-CN.md +10 -9
  3. package/dist/bin/internal-cli.js +15 -0
  4. package/dist/lib/agent-clients/adapter.js +45 -2
  5. package/dist/lib/agent-clients/adapters/antigravity-cli.js +64 -0
  6. package/dist/lib/agent-clients/adapters/claude-code.js +10 -1
  7. package/dist/lib/agent-clients/adapters/codex.js +9 -0
  8. package/dist/lib/agent-clients/adapters/index.js +2 -2
  9. package/dist/lib/agent-clients/adapters/opencode.js +9 -0
  10. package/dist/lib/agent-clients/config.js +42 -4
  11. package/dist/lib/agent-clients/next-steps.js +11 -2
  12. package/dist/lib/agent-clients/reconcile.js +2 -1
  13. package/dist/lib/agent-clients/registry.js +7 -1
  14. package/dist/lib/agent-clients/schema.js +18 -0
  15. package/dist/lib/agent-clients/tokens.js +49 -0
  16. package/dist/lib/agent-clients/types.js +1 -1
  17. package/dist/lib/defaults.json +1 -1
  18. package/dist/lib/git/workflow.js +54 -1
  19. package/dist/lib/internal/agent-client.js +61 -4
  20. package/dist/lib/internal/git-workflow.js +6 -1
  21. package/dist/lib/internal/platform-checks.js +3 -3
  22. package/dist/lib/internal/platform-comment.js +29 -2
  23. package/dist/lib/internal/platform-issue.js +7 -0
  24. package/dist/lib/internal/platform-pr-review.js +132 -0
  25. package/dist/lib/internal/platform-pr.js +20 -2
  26. package/dist/lib/internal/platform-release-notes.js +52 -16
  27. package/dist/lib/internal/pr-review-grade.js +140 -0
  28. package/dist/lib/internal/release-workflow.js +13 -6
  29. package/dist/lib/internal/task-activity.js +73 -0
  30. package/dist/lib/internal/task-event.js +17 -1
  31. package/dist/lib/internal/task-lifecycle.js +7 -0
  32. package/dist/lib/internal/task-orchestration.js +51 -6
  33. package/dist/lib/internal/task-review.js +8 -3
  34. package/dist/lib/platform/adapters.js +8 -1
  35. package/dist/lib/platform/completion-backfill.js +122 -0
  36. package/dist/lib/platform/issue-comments.js +3 -2
  37. package/dist/lib/platform/merged-pr-equivalence.js +115 -5
  38. package/dist/lib/platform/pr-checks.js +64 -41
  39. package/dist/lib/platform/pr-review.js +166 -0
  40. package/dist/lib/platform/pull-requests.js +324 -3
  41. package/dist/lib/platform/release-notes.js +85 -3
  42. package/dist/lib/pr-review/evidence-grading.js +229 -0
  43. package/dist/lib/run/tui.js +3 -5
  44. package/dist/lib/sandbox/commands/create.js +0 -20
  45. package/dist/lib/sandbox/commands/show.js +1 -1
  46. package/dist/lib/task/activity-intent.js +101 -0
  47. package/dist/lib/task/artifact-lifecycle.js +2 -1
  48. package/dist/lib/task/commands/log.js +15 -14
  49. package/dist/lib/task/delegation-receipts.js +23 -2
  50. package/dist/lib/task/events.js +67 -28
  51. package/dist/lib/task/finalization-artifacts.js +35 -0
  52. package/dist/lib/task/lifecycle-execution.js +46 -0
  53. package/dist/lib/task/orchestration.js +408 -44
  54. package/dist/lib/task/review-finalization.js +29 -9
  55. package/dist/lib/task/task-execution-lock.js +231 -0
  56. package/dist/lib/task/verification-checks.js +1 -1
  57. package/dist/lib/task/verification-engine.js +218 -2
  58. package/dist/lib/task/verification.js +4 -3
  59. package/dist/lib/task/workspace-snapshot.js +17 -5
  60. package/lib/agent-clients/adapter.ts +75 -2
  61. package/lib/agent-clients/adapters/antigravity-cli.ts +65 -0
  62. package/lib/agent-clients/adapters/claude-code.ts +10 -1
  63. package/lib/agent-clients/adapters/codex.ts +9 -0
  64. package/lib/agent-clients/adapters/index.ts +2 -2
  65. package/lib/agent-clients/adapters/opencode.ts +9 -0
  66. package/lib/agent-clients/config.ts +49 -4
  67. package/lib/agent-clients/next-steps.ts +15 -2
  68. package/lib/agent-clients/reconcile.ts +2 -1
  69. package/lib/agent-clients/registry.ts +10 -0
  70. package/lib/agent-clients/schema.ts +18 -0
  71. package/lib/agent-clients/tokens.ts +53 -0
  72. package/lib/agent-clients/types.ts +15 -1
  73. package/lib/defaults.json +1 -1
  74. package/lib/git/workflow.ts +66 -2
  75. package/lib/internal/agent-client.ts +59 -4
  76. package/lib/internal/git-workflow.ts +5 -1
  77. package/lib/internal/platform-checks.ts +4 -4
  78. package/lib/internal/platform-comment.ts +17 -2
  79. package/lib/internal/platform-issue.ts +4 -0
  80. package/lib/internal/platform-pr-review.ts +104 -0
  81. package/lib/internal/platform-pr.ts +14 -1
  82. package/lib/internal/platform-release-notes.ts +59 -16
  83. package/lib/internal/pr-review-grade.ts +130 -0
  84. package/lib/internal/release-workflow.ts +13 -6
  85. package/lib/internal/task-activity.ts +55 -0
  86. package/lib/internal/task-event.ts +9 -1
  87. package/lib/internal/task-lifecycle.ts +4 -0
  88. package/lib/internal/task-orchestration.ts +45 -6
  89. package/lib/internal/task-review.ts +8 -3
  90. package/lib/platform/adapters.ts +29 -2
  91. package/lib/platform/completion-backfill.ts +134 -0
  92. package/lib/platform/issue-comments.ts +3 -2
  93. package/lib/platform/merged-pr-equivalence.ts +127 -5
  94. package/lib/platform/pr-checks.ts +72 -45
  95. package/lib/platform/pr-review.ts +201 -0
  96. package/lib/platform/pull-requests.ts +395 -2
  97. package/lib/platform/release-notes.ts +100 -4
  98. package/lib/pr-review/evidence-grading.ts +318 -0
  99. package/lib/run/tui.ts +3 -4
  100. package/lib/sandbox/commands/create.ts +0 -20
  101. package/lib/sandbox/commands/show.ts +1 -1
  102. package/lib/server/server.schema.json +2 -2
  103. package/lib/task/activity-intent.ts +128 -0
  104. package/lib/task/artifact-lifecycle.ts +2 -1
  105. package/lib/task/commands/log.ts +15 -14
  106. package/lib/task/delegation-receipts.ts +32 -3
  107. package/lib/task/events.ts +75 -30
  108. package/lib/task/finalization-artifacts.ts +58 -0
  109. package/lib/task/lifecycle-execution.ts +106 -0
  110. package/lib/task/orchestration.ts +543 -64
  111. package/lib/task/review-finalization.ts +40 -9
  112. package/lib/task/task-execution-lock.ts +296 -0
  113. package/lib/task/verification-checks.ts +1 -1
  114. package/lib/task/verification-engine.ts +249 -2
  115. package/lib/task/verification.ts +5 -3
  116. package/lib/task/workspace-snapshot.ts +26 -5
  117. package/package.json +3 -3
  118. package/templates/.agents/QUICKSTART.en.md +25 -8
  119. package/templates/.agents/QUICKSTART.zh-CN.md +25 -8
  120. package/templates/.agents/README.en.md +10 -7
  121. package/templates/.agents/README.zh-CN.md +10 -7
  122. package/templates/.agents/hooks/lifecycle-delegation.js +15 -4
  123. package/templates/.agents/rules/create-issue.github.en.md +4 -2
  124. package/templates/.agents/rules/create-issue.github.zh-CN.md +4 -2
  125. package/templates/.agents/rules/issue-fields.github.en.md +3 -1
  126. package/templates/.agents/rules/issue-fields.github.zh-CN.md +3 -1
  127. package/templates/.agents/rules/issue-pr-commands.en.md +5 -3
  128. package/templates/.agents/rules/issue-pr-commands.github.en.md +5 -3
  129. package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +5 -3
  130. package/templates/.agents/rules/issue-pr-commands.zh-CN.md +5 -3
  131. package/templates/.agents/rules/issue-sync.github.en.md +7 -3
  132. package/templates/.agents/rules/issue-sync.github.zh-CN.md +8 -4
  133. package/templates/.agents/rules/lifecycle-orchestration.en.md +5 -2
  134. package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +5 -2
  135. package/templates/.agents/rules/milestone-inference.github.en.md +4 -2
  136. package/templates/.agents/rules/milestone-inference.github.zh-CN.md +4 -2
  137. package/templates/.agents/rules/next-step-output.en.md +3 -1
  138. package/templates/.agents/rules/next-step-output.zh-CN.md +3 -1
  139. package/templates/.agents/rules/no-mid-flow-questions.en.md +17 -0
  140. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +17 -0
  141. package/templates/.agents/rules/pr-checks-commands.en.md +3 -3
  142. package/templates/.agents/rules/pr-checks-commands.github.en.md +2 -2
  143. package/templates/.agents/rules/pr-checks-commands.github.zh-CN.md +2 -2
  144. package/templates/.agents/rules/pr-checks-commands.zh-CN.md +3 -3
  145. package/templates/.agents/rules/pr-sync.en.md +3 -1
  146. package/templates/.agents/rules/pr-sync.github.en.md +11 -1
  147. package/templates/.agents/rules/pr-sync.github.zh-CN.md +11 -1
  148. package/templates/.agents/rules/pr-sync.zh-CN.md +3 -1
  149. package/templates/.agents/rules/release-commands.en.md +1 -1
  150. package/templates/.agents/rules/release-commands.github.en.md +12 -2
  151. package/templates/.agents/rules/release-commands.github.zh-CN.md +12 -2
  152. package/templates/.agents/rules/release-commands.zh-CN.md +1 -1
  153. package/templates/.agents/rules/task-management.en.md +11 -0
  154. package/templates/.agents/rules/task-management.zh-CN.md +11 -0
  155. package/templates/.agents/skills/analyze-task/SKILL.en.md +10 -7
  156. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +10 -7
  157. package/templates/.agents/skills/block-task/SKILL.en.md +7 -5
  158. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +7 -5
  159. package/templates/.agents/skills/cancel-task/SKILL.en.md +6 -4
  160. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +6 -4
  161. package/templates/.agents/skills/close-codescan/SKILL.en.md +3 -1
  162. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +3 -1
  163. package/templates/.agents/skills/close-dependabot/SKILL.en.md +3 -1
  164. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +3 -1
  165. package/templates/.agents/skills/code-task/SKILL.en.md +9 -6
  166. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +11 -8
  167. package/templates/.agents/skills/commit/SKILL.en.md +3 -1
  168. package/templates/.agents/skills/commit/SKILL.zh-CN.md +3 -1
  169. package/templates/.agents/skills/commit/reference/commit-message.en.md +1 -1
  170. package/templates/.agents/skills/commit/reference/commit-message.zh-CN.md +1 -1
  171. package/templates/.agents/skills/commit/reference/issue-metadata-sync.en.md +1 -1
  172. package/templates/.agents/skills/commit/reference/issue-metadata-sync.zh-CN.md +1 -1
  173. package/templates/.agents/skills/commit/reference/pr-summary-sync.en.md +1 -1
  174. package/templates/.agents/skills/commit/reference/pr-summary-sync.zh-CN.md +1 -1
  175. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +6 -4
  176. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +6 -4
  177. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +1 -1
  178. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +1 -1
  179. package/templates/.agents/skills/complete-task/SKILL.en.md +21 -6
  180. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +21 -6
  181. package/templates/.agents/skills/complete-task/config/verify.en.json +1 -0
  182. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +1 -0
  183. package/templates/.agents/skills/complete-task/reference/external-delivery.en.md +17 -0
  184. package/templates/.agents/skills/complete-task/reference/external-delivery.zh-CN.md +17 -0
  185. package/templates/.agents/skills/create-pr/SKILL.en.md +3 -1
  186. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +3 -1
  187. package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +1 -1
  188. package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +1 -1
  189. package/templates/.agents/skills/create-release-note/SKILL.en.md +17 -16
  190. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +17 -16
  191. package/templates/.agents/skills/create-task/SKILL.en.md +5 -3
  192. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +5 -3
  193. package/templates/.agents/skills/import-issue/SKILL.en.md +5 -3
  194. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -3
  195. package/templates/.agents/skills/plan-task/SKILL.en.md +8 -5
  196. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +8 -5
  197. package/templates/.agents/skills/post-release/SKILL.en.md +2 -0
  198. package/templates/.agents/skills/post-release/SKILL.zh-CN.md +2 -0
  199. package/templates/.agents/skills/release/SKILL.en.md +16 -10
  200. package/templates/.agents/skills/release/SKILL.zh-CN.md +16 -10
  201. package/templates/.agents/skills/restore-task/SKILL.en.md +4 -1
  202. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +4 -1
  203. package/templates/.agents/skills/review-analysis/SKILL.en.md +7 -4
  204. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +7 -4
  205. package/templates/.agents/skills/review-code/SKILL.en.md +9 -6
  206. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +9 -6
  207. package/templates/.agents/skills/review-plan/SKILL.en.md +7 -4
  208. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +7 -4
  209. package/templates/.agents/skills/review-pr/SKILL.en.md +158 -0
  210. package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +158 -0
  211. package/templates/.agents/skills/review-pr/config/verify.en.json +37 -0
  212. package/templates/.agents/skills/review-pr/config/verify.zh-CN.json +37 -0
  213. package/templates/.agents/skills/review-pr/reference/evidence-grading.en.md +65 -0
  214. package/templates/.agents/skills/review-pr/reference/evidence-grading.zh-CN.md +65 -0
  215. package/templates/.agents/skills/review-pr/reference/output-guidance.en.md +18 -0
  216. package/templates/.agents/skills/review-pr/reference/output-guidance.zh-CN.md +18 -0
  217. package/templates/.agents/skills/review-pr/reference/report-template.en.md +85 -0
  218. package/templates/.agents/skills/review-pr/reference/report-template.zh-CN.md +85 -0
  219. package/templates/.agents/skills/run-task/SKILL.en.md +8 -8
  220. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +8 -8
  221. package/templates/.agents/skills/run-task/config/verify.en.json +2 -1
  222. package/templates/.agents/skills/run-task/config/verify.zh-CN.json +2 -1
  223. package/templates/.agents/skills/run-task/reference/host-validation.en.md +20 -0
  224. package/templates/.agents/skills/run-task/reference/host-validation.zh-CN.md +20 -0
  225. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +35 -61
  226. package/templates/.agents/skills/watch-pr/SKILL.en.md +13 -13
  227. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +13 -13
  228. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +27 -6
  229. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +26 -5
  230. package/templates/.agents/templates/task.en.md +1 -1
  231. package/templates/.agents/templates/task.zh-CN.md +1 -1
  232. package/templates/.agents/workflows/bug-fix.en.yaml +3 -3
  233. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +3 -3
  234. package/templates/.agents/workflows/code-review.en.yaml +1 -1
  235. package/templates/.agents/workflows/code-review.zh-CN.yaml +1 -1
  236. package/templates/.agents/workflows/feature-development.en.yaml +4 -4
  237. package/templates/.agents/workflows/feature-development.zh-CN.yaml +4 -4
  238. package/templates/.agents/workflows/refactoring.en.yaml +3 -3
  239. package/templates/.agents/workflows/refactoring.zh-CN.yaml +3 -3
  240. package/templates/.claude/commands/post-release.en.md +1 -0
  241. package/templates/.claude/commands/post-release.zh-CN.md +1 -0
  242. package/templates/.claude/commands/review-pr.en.md +8 -0
  243. package/templates/.claude/commands/review-pr.zh-CN.md +8 -0
  244. package/templates/.gemini/commands/_project_/review-pr.en.toml +10 -0
  245. package/templates/.gemini/commands/_project_/review-pr.zh-CN.toml +10 -0
  246. package/templates/.opencode/commands/post-release.en.md +2 -0
  247. package/templates/.opencode/commands/post-release.zh-CN.md +2 -0
  248. package/templates/.opencode/commands/review-pr.en.md +11 -0
  249. package/templates/.opencode/commands/review-pr.zh-CN.md +11 -0
  250. package/dist/lib/agent-clients/adapters/gemini-cli.js +0 -64
  251. package/lib/agent-clients/adapters/gemini-cli.ts +0 -65
  252. package/templates/.gemini/commands/_project_/analyze-task.en.toml +0 -10
  253. package/templates/.gemini/commands/_project_/analyze-task.zh-CN.toml +0 -10
  254. package/templates/.gemini/commands/_project_/archive-tasks.en.toml +0 -10
  255. package/templates/.gemini/commands/_project_/archive-tasks.zh-CN.toml +0 -10
  256. package/templates/.gemini/commands/_project_/block-task.en.toml +0 -10
  257. package/templates/.gemini/commands/_project_/block-task.zh-CN.toml +0 -10
  258. package/templates/.gemini/commands/_project_/cancel-task.en.toml +0 -10
  259. package/templates/.gemini/commands/_project_/cancel-task.zh-CN.toml +0 -10
  260. package/templates/.gemini/commands/_project_/check-task.en.toml +0 -10
  261. package/templates/.gemini/commands/_project_/check-task.zh-CN.toml +0 -10
  262. package/templates/.gemini/commands/_project_/close-codescan.en.toml +0 -8
  263. package/templates/.gemini/commands/_project_/close-codescan.zh-CN.toml +0 -8
  264. package/templates/.gemini/commands/_project_/close-dependabot.en.toml +0 -8
  265. package/templates/.gemini/commands/_project_/close-dependabot.zh-CN.toml +0 -8
  266. package/templates/.gemini/commands/_project_/code-task.en.toml +0 -10
  267. package/templates/.gemini/commands/_project_/code-task.zh-CN.toml +0 -10
  268. package/templates/.gemini/commands/_project_/commit.en.toml +0 -10
  269. package/templates/.gemini/commands/_project_/commit.zh-CN.toml +0 -10
  270. package/templates/.gemini/commands/_project_/complete-manual-validation.en.toml +0 -10
  271. package/templates/.gemini/commands/_project_/complete-manual-validation.zh-CN.toml +0 -10
  272. package/templates/.gemini/commands/_project_/complete-task.en.toml +0 -10
  273. package/templates/.gemini/commands/_project_/complete-task.zh-CN.toml +0 -10
  274. package/templates/.gemini/commands/_project_/create-pr.en.toml +0 -10
  275. package/templates/.gemini/commands/_project_/create-pr.zh-CN.toml +0 -10
  276. package/templates/.gemini/commands/_project_/create-release-note.en.toml +0 -8
  277. package/templates/.gemini/commands/_project_/create-release-note.zh-CN.toml +0 -8
  278. package/templates/.gemini/commands/_project_/create-task.en.toml +0 -8
  279. package/templates/.gemini/commands/_project_/create-task.zh-CN.toml +0 -8
  280. package/templates/.gemini/commands/_project_/import-codescan.en.toml +0 -8
  281. package/templates/.gemini/commands/_project_/import-codescan.zh-CN.toml +0 -8
  282. package/templates/.gemini/commands/_project_/import-dependabot.en.toml +0 -8
  283. package/templates/.gemini/commands/_project_/import-dependabot.zh-CN.toml +0 -8
  284. package/templates/.gemini/commands/_project_/import-issue.en.toml +0 -8
  285. package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +0 -8
  286. package/templates/.gemini/commands/_project_/init-labels.en.toml +0 -8
  287. package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +0 -8
  288. package/templates/.gemini/commands/_project_/init-milestones.en.toml +0 -10
  289. package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +0 -10
  290. package/templates/.gemini/commands/_project_/plan-task.en.toml +0 -10
  291. package/templates/.gemini/commands/_project_/plan-task.zh-CN.toml +0 -10
  292. package/templates/.gemini/commands/_project_/post-release.en.toml +0 -6
  293. package/templates/.gemini/commands/_project_/post-release.zh-CN.toml +0 -6
  294. package/templates/.gemini/commands/_project_/refine-title.en.toml +0 -8
  295. package/templates/.gemini/commands/_project_/refine-title.zh-CN.toml +0 -8
  296. package/templates/.gemini/commands/_project_/release.en.toml +0 -8
  297. package/templates/.gemini/commands/_project_/release.zh-CN.toml +0 -8
  298. package/templates/.gemini/commands/_project_/restore-task.en.toml +0 -8
  299. package/templates/.gemini/commands/_project_/restore-task.zh-CN.toml +0 -8
  300. package/templates/.gemini/commands/_project_/review-analysis.en.toml +0 -10
  301. package/templates/.gemini/commands/_project_/review-analysis.zh-CN.toml +0 -10
  302. package/templates/.gemini/commands/_project_/review-code.en.toml +0 -10
  303. package/templates/.gemini/commands/_project_/review-code.zh-CN.toml +0 -10
  304. package/templates/.gemini/commands/_project_/review-plan.en.toml +0 -10
  305. package/templates/.gemini/commands/_project_/review-plan.zh-CN.toml +0 -10
  306. package/templates/.gemini/commands/_project_/run-task.en.toml +0 -8
  307. package/templates/.gemini/commands/_project_/run-task.zh-CN.toml +0 -8
  308. package/templates/.gemini/commands/_project_/test-integration.en.toml +0 -6
  309. package/templates/.gemini/commands/_project_/test-integration.zh-CN.toml +0 -6
  310. package/templates/.gemini/commands/_project_/test.en.toml +0 -6
  311. package/templates/.gemini/commands/_project_/test.zh-CN.toml +0 -6
  312. package/templates/.gemini/commands/_project_/update-agent-infra.en.toml +0 -6
  313. package/templates/.gemini/commands/_project_/update-agent-infra.zh-CN.toml +0 -6
  314. package/templates/.gemini/commands/_project_/upgrade-dependency.en.toml +0 -8
  315. package/templates/.gemini/commands/_project_/upgrade-dependency.zh-CN.toml +0 -8
  316. package/templates/.gemini/commands/_project_/watch-pr.en.toml +0 -10
  317. package/templates/.gemini/commands/_project_/watch-pr.zh-CN.toml +0 -10
  318. package/templates/.gemini/settings.json +0 -3
@@ -7,11 +7,14 @@ description: >
7
7
  ---
8
8
 
9
9
  # 完成任务
10
+ > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」:标准 AI 短名(`claude`/`codex`/`antigravity`/`opencode`/`cursor`)、长名归一化(`claude-code`→`claude`、`antigravity-cli`→`antigravity`)或人工例外 `human`。
11
+
10
12
 
11
13
  ## 行为边界 / 关键规则
12
14
 
13
15
  - 本命令更新任务元数据并物理移动任务目录
14
16
  - 除非强制执行,不要转移有未完成工作流步骤的任务
17
+ - 入口接受可选 `--external-pr <N>`;仅用于外部交付候选歧义时的显式选择,不绕过身份或平台门禁
15
18
 
16
19
  版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
17
20
 
@@ -53,6 +56,16 @@ agent-infra-internal task-snapshot {task-id} --format text
53
56
 
54
57
  ### 2. 验证完成前置条件(未满足则必须停止)
55
58
 
59
+ 先读取 `reference/external-delivery.md`,然后在 active 任务上调用:
60
+
61
+ ```bash
62
+ agent-infra-internal platform-pr resolve-external {task-id} --agent {standard-agent-token} [--pr {external-pr}]
63
+ ```
64
+
65
+ - `mode=external`:只以本次 typed result 的 `authorization` 和 `selected` 作为外部交付授权与绑定身份,继续本步骤的既有硬门禁。
66
+ - `mode=normal`:走现有本地生命周期前置条件;历史 `pr_number` / `pr_status` 不构成外部授权。
67
+ - `status=failed|blocked`:立即停止并展示稳定错误;`--force` 不得绕过。
68
+
56
69
  **门控读取(项目级 PR 流程策略)**:在执行本步骤前,读取 `.agents/.airc.json` 的 `prFlow` 字段(三态:字段缺省 = 默认推荐 PR、允许跳过;`"required"` = 强制 PR;`"disabled"` = 强制无 PR),以及 `task.md` frontmatter 的 `pr_status`(`pending` / `created` / `skipped`)。
57
70
 
58
71
  **PR 维度判定(先判 `prFlow` 强约束,后看 `pr_status`)**:
@@ -87,6 +100,7 @@ agent-infra-internal task-snapshot {task-id} --format text
87
100
  - [ ] 代码已提交(没有与此任务相关的未提交变更)
88
101
  - [ ] 测试通过
89
102
  - [ ] 审查分歧账本无未关闭分歧、无未复审的 post-review 提交;绑定 PR 路径中本地 HEAD、`last_reviewed_commit`、PR head 严格一致,或已合并 squash 的平台快照与远端 Git 等价证据完整且当前 Git 凭据可读取证据 refs;无有效 PR 路径中本地单父重写与 `last_reviewed_commit` 内容等价且之后无受保护提交
103
+ - [ ] 人工校验项已完成(最新 review-code 的 Manual validation 计数 > 0 时,须存在通过校验的 manual-validation 产物及其完成记录,且该完成记录位于最新 review-code 之后;计数为 0 或无未决项时跳过)
90
104
 
91
105
  > **⚠️ 前置条件分支判断 — 你必须先判断“继续”还是“停止”:**
92
106
  >
@@ -123,9 +137,9 @@ Please complete the missing steps first, or use --force to override.
123
137
 
124
138
  如果存在有效的 `issue_number`,严格按以下顺序执行:
125
139
 
126
- 1. 按 artifact catalog 顺序,对本地已有产物逐项调用 `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {artifact} --agent {artifact-agent} --backfill`。
127
- 2. 调用 `agent-infra-internal platform-issue sync {task-id} --agent {agent} --requirements --fields`。
128
- 3. 把业务摘要写入临时文件,并调用 `agent-infra-internal platform-comment sync {task-id} --kind summary --body-file {path} --agent {agent}`。
140
+ 1. 调用 `agent-infra-internal platform-comment backfill {task-id} --agent {standard-agent-token}`,由 core 仅按 completion canonical inventory 固定顺序补发产物并在全部成功后精确恢复目标历史告警。
141
+ 2. 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --requirements --fields`。
142
+ 3. 把业务摘要写入临时文件,并调用 `agent-infra-internal platform-comment sync {task-id} --kind summary --body-file {path} --agent {standard-agent-token}`。
129
143
 
130
144
  不要在本步骤同步 task 评论;它依赖 lifecycle 写入后的完整终态 task.md。不要设置 `status:` label,平台自动化应在 Issue 关闭后清理状态标签。
131
145
 
@@ -145,14 +159,14 @@ agent-infra-internal task-warning {task-id} add --step complete-task --severity
145
159
  agent-infra-internal task-verify {task-id} complete-task.preflight --format text
146
160
  ```
147
161
 
148
- 该事件依次执行 `review-ledger`、`post-review-commit`、`platform-sync-preflight`。任一退出码非 0(fail/blocked)时,任务必须继续留在 active;从 gate 结果取稳定 code/target,通过 `task-warning ... add --step complete-task ...` 落账后停止。若审查基线或 head 不一致,必须先重新 `commit` / `review-code`;不得回退审查基线。
162
+ 该事件依次执行 `review-ledger`、`manual-validation`、`post-review-commit`、`platform-sync-preflight`。任一退出码非 0(fail/blocked)时,任务必须继续留在 active;从 gate 结果取稳定 code/target,通过 `task-warning ... add --step complete-task ...` 落账后停止。若审查基线或 head 不一致,必须先重新 `commit` / `review-code`;不得回退审查基线。
149
163
 
150
164
  `--force` 不解除本硬门禁:未关闭分歧必须先在账本闭合,未复审提交必须重新审查、具备有效豁免,或由平台适配器为绑定的变更请求(PR/MR)提供权威合并快照与远端 refs,并在隔离临时仓库中证明单父 squash merge 等价,或在无有效变更请求时由本地 Git 对象证明唯一受保护提交是内容等价的单父重写且之后无受保护提交;平台 preflight 必须通过。适配器不支持所需能力,平台事实、Git 对象、拓扑、内容证据缺失,或当前 Git 凭据不能读取远端证据 refs 时 fail closed。required checks 由平台适配器提供规范化状态,并在合并前通过分支保护 / ruleset 以及 `review-code` / `watch-pr` 路由承担。
151
165
 
152
166
  ### 6. 执行本地生命周期意图并验证转移
153
167
 
154
168
  ```bash
155
- agent-infra-internal task-lifecycle {task-id} complete --agent {agent}
169
+ agent-infra-internal task-lifecycle {task-id} complete --agent {standard-agent-token}
156
170
  ```
157
171
 
158
172
  仅 `status=applied|no-op` 视为本地完成。`status=failed` 时展示 `error` 与 completed/pending steps,以同一 intent 重试;不得宣称完成或手工补写局部状态。
@@ -168,7 +182,7 @@ ls .agents/workspace/completed/{task-id}/task.md
168
182
  场景 A 与场景 B `finalization-retry` 都从 completed 目录执行本步骤。若存在有效的 `issue_number`,先调用:
169
183
 
170
184
  ```bash
171
- agent-infra-internal platform-comment sync {task-id} --kind task --agent {agent}
185
+ agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}
172
186
  ```
173
187
 
174
188
  该调用失败时任务已归档,不能调用只接受 active 任务的 `task-warning`;保留 completed 状态并停止。修复网络或平台问题后重跑 complete-task,会由步骤 1 进入 `finalization-retry`,只重复本步骤。
@@ -231,6 +245,7 @@ Completed at: {completion-time}
231
245
  - 代码已提交但未审查
232
246
  - 审查发现阻塞项但未修复
233
247
  - PR 已创建但未合并
248
+ - 人工校验项未完成
234
249
 
235
250
  2. **回滚**:如果任务被错误转移:
236
251
  ```bash
@@ -25,6 +25,7 @@
25
25
  "require_all_checked": true
26
26
  },
27
27
  "review-ledger": {},
28
+ "manual-validation": {},
28
29
  "post-review-commit": {},
29
30
  "platform-sync-preflight": {
30
31
  "when": "issue_number_exists",
@@ -25,6 +25,7 @@
25
25
  "require_all_checked": true
26
26
  },
27
27
  "review-ledger": {},
28
+ "manual-validation": {},
28
29
  "post-review-commit": {},
29
30
  "platform-sync-preflight": {
30
31
  "when": "issue_number_exists",
@@ -0,0 +1,17 @@
1
+ # External PR Delivery
2
+
3
+ This scenario applies only to an active task whose completion canonical inventory is empty because an already-merged external PR delivered the implementation.
4
+
5
+ ## Typed State Machine
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`.
8
+
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
+
11
+ ## Authorization and Persistent Audit
12
+
13
+ Only the current typed result's `mode=external`, `authorization`, and `selected` fields control the machine branch. `pr_status: created` is a compatibility shim for existing verifiers: it means a verifiable PR is bound, not that this task created it, and it cannot authorize lifecycle skipping by itself.
14
+
15
+ A successful bind atomically writes PR fields and appends a `Bind External PR` Activity Log entry containing the authorization source, Issue, PR URL/number, base/head repository/ref/SHA, merge time, and merge commit. Replaying identical complete evidence is a no-op; an existing same-number binding without the signature adds it once; number or identity changes fail. The PR create path must never run.
16
+
17
+ External mode still passes review-ledger, manual-validation, post-review-commit, platform-sync, preflight, and terminal gates. Without a canonical review-code artifact, only existing verifier N/A rules apply. `--force` does not disable any hard gate.
@@ -0,0 +1,17 @@
1
+ # 外部 PR 交付
2
+
3
+ 本场景只适用于 completion canonical inventory 为空、实现实际由已合并的外部 PR 交付的 active 任务。
4
+
5
+ ## Typed 状态机
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`。
8
+
9
+ core 通过平台 adapter 读取 Issue 的权威 closing change requests,穷尽分页后只把 base 仓库匹配任务仓库且已经合并、身份字段完整的候选视为 eligible。唯一候选自动选择;多候选、身份冲突或证据缺失均 fail closed。`--pr` 只能从权威 closing eligible 集合中显式选择,不能绕过仓库、Issue、合并或身份校验。
10
+
11
+ ## 授权与持久审计
12
+
13
+ 当次调用只以 typed result 的 `mode=external`、`authorization` 和 `selected` 为机器分支依据。`pr_status: created` 只是现有 verifier 的兼容 shim,表示任务已绑定可验证的 PR;它既不表示 PR 由本任务创建,也不能单独授权跳过 lifecycle。
14
+
15
+ 成功绑定会原子写入 PR 字段并追加 `Bind External PR` Activity Log,记录授权来源、Issue、PR URL/编号、base/head repository/ref/SHA、合并时间和 merge commit。相同完整证据重试为 no-op;已有同号但缺审计签名时补写一次;编号或身份变化失败。不得调用 PR create 路径。
16
+
17
+ 外部模式仍须通过 review ledger、manual validation、post-review commit、平台同步、preflight 与终态校验。无 canonical review-code 时仅沿用 verifier 已定义的 N/A 规则;`--force` 不解除任何硬门禁。
@@ -6,6 +6,8 @@ description: >
6
6
  ---
7
7
 
8
8
  # Create Pull Request
9
+ > `--agent` values follow the "Collaborator Token Specification" in `.agents/rules/task-management.md`: standard AI short tokens (`claude`/`codex`/`antigravity`/`opencode`/`cursor`), long-name normalization (`claude-code`->`claude`, `antigravity-cli`->`antigravity`), or the `human` manual exception.
10
+
9
11
 
10
12
  Create a Pull Request and, when task-related, sync the essential metadata and reviewer summary immediately.
11
13
 
@@ -72,7 +74,7 @@ If `{task-id}` is available and the related task provides `issue_number`, keep `
72
74
 
73
75
  ### 6. Sync PR Metadata
74
76
 
75
- Run `agent-infra-internal platform-pr sync {task-id} --agent {agent} --metadata --closing-issue`. The core copies type / `in:` labels, assignee, and a specific milestone from the Issue and maintains the closing association. Permission-bound items degrade independently, and the Issue is never updated in reverse.
77
+ Run `agent-infra-internal platform-pr sync {task-id} --agent {standard-agent-token} --metadata --closing-issue`. The core copies type / `in:` labels, assignee, and a specific milestone from the Issue and maintains the closing association. Permission-bound items degrade independently, and the Issue is never updated in reverse.
76
78
 
77
79
  ### 7. Publish the Review Summary
78
80
 
@@ -6,6 +6,8 @@ description: >
6
6
  ---
7
7
 
8
8
  # 创建 Pull Request
9
+ > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」:标准 AI 短名(`claude`/`codex`/`antigravity`/`opencode`/`cursor`)、长名归一化(`claude-code`→`claude`、`antigravity-cli`→`antigravity`)或人工例外 `human`。
10
+
9
11
 
10
12
  创建 Pull Request,并在与任务关联时立即补齐核心元数据和 reviewer 摘要。
11
13
 
@@ -72,7 +74,7 @@ description: >
72
74
 
73
75
  ### 6. 同步 PR 元数据
74
76
 
75
- 调用 `agent-infra-internal platform-pr sync {task-id} --agent {agent} --metadata --closing-issue`。core 从 Issue 复制 type / `in:` labels、assignee 和具体 milestone,并维护 Development 关联;逐项权限不足返回 degraded,不反向更新 Issue。
77
+ 调用 `agent-infra-internal platform-pr sync {task-id} --agent {standard-agent-token} --metadata --closing-issue`。core 从 Issue 复制 type / `in:` labels、assignee 和具体 milestone,并维护 Development 关联;逐项权限不足返回 degraded,不反向更新 Issue。
76
78
 
77
79
  ### 7. 发布审查摘要
78
80
 
@@ -6,7 +6,7 @@ Write the plain summary body to a temporary file, then run:
6
6
 
7
7
  ```bash
8
8
  agent-infra-internal platform-pr summary-sync {task-id} \
9
- --agent {agent} --body-file {summary-body-file}
9
+ --agent {standard-agent-token} --body-file {summary-body-file}
10
10
  ```
11
11
 
12
12
  The caller does not add markers, HEAD metadata, or comment API parameters. A summary failure records the existing `create-pr` warning and does not roll back the PR.
@@ -6,7 +6,7 @@
6
6
 
7
7
  ```bash
8
8
  agent-infra-internal platform-pr summary-sync {task-id} \
9
- --agent {agent} --body-file {summary-body-file}
9
+ --agent {standard-agent-token} --body-file {summary-body-file}
10
10
  ```
11
11
 
12
12
  调用方不添加 marker、HEAD 或评论 API 参数。摘要失败沿用 `create-pr` 错误处理并记录 warning,不回滚已创建 PR。结果映射沿用 `.agents/rules/pr-sync.md`。
@@ -126,35 +126,36 @@ If no historical release notes exist, use the following default Markdown format:
126
126
  - Sort reporters by reported Issue count descending, then lexicographically by login for ties
127
127
  5. Empty sections: Omit sections with no entries
128
128
 
129
- ### 8. Present and Confirm
129
+ ### 8. Stage, Present, and Confirm
130
130
 
131
- Show the generated release notes to the user.
132
-
133
- Ask:
134
- 1. Need any adjustments?
135
- 2. Write these notes onto the Release for this version?
136
-
137
- ### 9. Publish the Release Notes (If Confirmed)
138
-
139
- 9.1 Write the generated notes to a temp file **outside the working tree** so no uncommitted artifact is left behind in the repo (do not write into `.agents/workspace/` or any version-controlled directory):
131
+ Write the candidate notes to a temporary file outside the working tree, then call typed stage to normalize the file and retain its structured `sha256`:
140
132
 
141
133
  ```bash
142
134
  NOTES_FILE="$(mktemp "${TMPDIR:-/tmp}/agent-infra-release-notes.XXXXXX")"
135
+ agent-infra-internal platform-release-notes stage \
136
+ --notes-file "$NOTES_FILE"
143
137
  ```
144
138
 
145
- Write the notes content to `$NOTES_FILE`.
139
+ Present the exact staged file and delete it before asking. Adjustments invalidate the digest. Only an unambiguous affirmative reply for this preview in the current session authorizes publishing; denial, questions, ambiguity, or interruption stop without publish.
140
+
141
+ ### 9. Recheck and Publish Release Notes
146
142
 
147
- 9.2 Call the typed publish intent (use `$NOTES_FILE` for `{notes-file}`); it updates an existing Release or creates a missing one:
143
+ After confirmation, write the confirmed normalized text to a new external temporary file and stage it again. Delete and return to preview if its digest differs. On a match, call:
148
144
 
149
145
  ```bash
150
146
  agent-infra-internal platform-release-notes publish \
151
- --tag "v<version>" --title "v<version>" --notes-file "$NOTES_FILE"
147
+ --tag "v<version>" \
148
+ --title "v<version>" \
149
+ --notes-file "$NOTES_FILE" \
150
+ --expected-sha256 "{preview-sha256}"
152
151
  ```
153
152
 
154
- 9.3 Remove the temp file whether publishing succeeds or fails:
153
+ Delete the temporary file on every exit path. After success, render:
155
154
 
156
155
  ```bash
157
- rm -f "$NOTES_FILE"
156
+ agent-infra-internal agent-client next-steps \
157
+ --skill post-release \
158
+ --version <version>
158
159
  ```
159
160
 
160
161
  Output:
@@ -174,7 +175,7 @@ The notes have been written to the Release. Edit further at the URL above if nee
174
175
  2. **Tags must exist**: Run the release skill first to create tags
175
176
  3. **Release auto-published**: the `v{version}` Release is created and published by the release workflow (the upload target for Homebrew bottles); this skill writes/refreshes the notes on that Release
176
177
  4. **Classification accuracy**: Auto-classification is based on title/scope/files; complex PRs may need manual adjustment
177
- 5. **No leftover artifacts**: Always write notes to a temp file outside the working tree (`mktemp`) and delete it after publishing; never write into the repo directory
178
+ 5. **No leftover artifacts**: Delete preview files before asking and publish files on every exit path; interruption invalidates session-only notes and authorization
178
179
 
179
180
  ## Error Handling
180
181
 
@@ -126,35 +126,36 @@ agent-infra-internal platform-release-notes context \
126
126
  - Reporter 之间按报告的 Issue 数量降序排列,数量相同时按 login 字典序
127
127
  5. 空部分:省略没有条目的部分
128
128
 
129
- ### 8. 展示并确认
129
+ ### 8. Stage、展示并确认
130
130
 
131
- 向用户展示生成的发布说明。
132
-
133
- 询问:
134
- 1. 需要调整吗?
135
- 2. 是否把 notes 写入该版本的 Release?
136
-
137
- ### 9. 发布 Release notes(如确认)
138
-
139
- 9.1 把生成的 notes 写入**工作树之外**的临时文件,避免在仓库残留未提交产物(不要写入 `.agents/workspace/` 或任何受版本控制的目录):
131
+ 把候选 notes 写入工作树外临时文件,调用 typed stage 规范化并保存结构化 `sha256`:
140
132
 
141
133
  ```bash
142
134
  NOTES_FILE="$(mktemp "${TMPDIR:-/tmp}/agent-infra-release-notes.XXXXXX")"
135
+ agent-infra-internal platform-release-notes stage \
136
+ --notes-file "$NOTES_FILE"
143
137
  ```
144
138
 
145
- 把 notes 内容写入 `$NOTES_FILE`。
139
+ 只展示 stage 后同一文件的精确内容,在询问前删除文件。调整会使旧 digest 失效。只有当前会话中针对当前预览的无歧义明确肯定答复才授权发布;否定、疑问、歧义或中断均停止。
140
+
141
+ ### 9. 复核并发布 Release notes
146
142
 
147
- 9.2 调用 typed publish intent(命令中的 `{notes-file}` 用 `$NOTES_FILE`);它会更新已存在的 Release,不存在时创建:
143
+ 确认后把已确认文本写入新的工作树外临时文件并再次 stage。digest 不一致时删除并回到预览;一致时调用:
148
144
 
149
145
  ```bash
150
146
  agent-infra-internal platform-release-notes publish \
151
- --tag "v<version>" --title "v<version>" --notes-file "$NOTES_FILE"
147
+ --tag "v<version>" \
148
+ --title "v<version>" \
149
+ --notes-file "$NOTES_FILE" \
150
+ --expected-sha256 "{preview-sha256}"
152
151
  ```
153
152
 
154
- 9.3 无论发布成功或失败,都删除临时文件:
153
+ 所有退出路径删除临时文件。成功后渲染:
155
154
 
156
155
  ```bash
157
- rm -f "$NOTES_FILE"
156
+ agent-infra-internal agent-client next-steps \
157
+ --skill post-release \
158
+ --version <version>
158
159
  ```
159
160
 
160
161
  输出:
@@ -174,7 +175,7 @@ Release notes 已更新。
174
175
  2. **标签必须存在**:先执行 release 技能创建标签
175
176
  3. **Release 已自动发布**:`v{version}` 的 Release 由 release 工作流自动创建并发布(给 Homebrew bottle 提供上传落点);本技能往该 Release 写入/刷新 notes
176
177
  4. **分类准确性**:自动分类基于标题/scope/文件;复杂的 PR 可能需要手动调整
177
- 5. **不留残留产物**:notes 一律写入工作树之外的临时文件(`mktemp`)并在发布后删除,禁止写入仓库目录
178
+ 5. **不留残留产物**:预览文件在询问前删除,发布文件在所有退出路径删除;会话中断时授权和草稿失效
178
179
 
179
180
  ## 错误处理
180
181
 
@@ -6,6 +6,8 @@ description: >
6
6
  ---
7
7
 
8
8
  # Create Task
9
+ > `--agent` values follow the "Collaborator Token Specification" in `.agents/rules/task-management.md`: standard AI short tokens (`claude`/`codex`/`antigravity`/`opencode`/`cursor`), long-name normalization (`claude-code`->`claude`, `antigravity-cli`->`antigravity`), or the `human` manual exception.
10
+
9
11
 
10
12
  ## Boundary / Critical Rules
11
13
 
@@ -131,12 +133,12 @@ Update `.agents/workspace/active/{task-id}/task.md`:
131
133
  After task.md is written, call the declarative intents; the internal core owns templates, body rendering, identity validation, capability degradation, idempotency, and task binding:
132
134
 
133
135
  ```bash
134
- agent-infra-internal platform-issue create {task-id} --agent {agent}
135
- agent-infra-internal platform-issue sync {task-id} --agent {agent} --status waiting-for-triage --assignees current --milestone initial --issue-type --fields
136
+ agent-infra-internal platform-issue create {task-id} --agent {standard-agent-token}
137
+ agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status waiting-for-triage --assignees current --milestone initial --issue-type --fields
136
138
  ```
137
139
 
138
140
  Handle the result:
139
- - Intent created the Issue: `issue_number` was written through the task writer; run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {agent}`
141
+ - Intent created the Issue: `issue_number` was written through the task writer; run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
140
142
  - Rule failed (auth / network / template parse / etc.): do not roll back task.md or append an extra Activity Log entry; run `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"` to submit a structured warning intent (callers do not allocate ids or edit rows), then follow Scenario C
141
143
  - Intent returned no-op/degraded: continue applicable operations without blocking the workflow
142
144
  - task.md already has a valid `issue_number`: create validates the binding and returns no-op without creating a duplicate
@@ -6,6 +6,8 @@ description: >
6
6
  ---
7
7
 
8
8
  # 创建任务
9
+ > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」:标准 AI 短名(`claude`/`codex`/`antigravity`/`opencode`/`cursor`)、长名归一化(`claude-code`→`claude`、`antigravity-cli`→`antigravity`)或人工例外 `human`。
10
+
9
11
 
10
12
  ## 行为边界 / 关键规则
11
13
 
@@ -130,12 +132,12 @@ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
130
132
  在 task.md 落盘并记录 `Create Task` 后调用声明式 Issue intent;标题、正文、模板、身份校验、权限降级、幂等创建和 task.md 绑定均由 internal core 处理:
131
133
 
132
134
  ```bash
133
- agent-infra-internal platform-issue create {task-id} --agent {agent}
134
- agent-infra-internal platform-issue sync {task-id} --agent {agent} --status waiting-for-triage --assignees current --milestone initial --issue-type --fields
135
+ agent-infra-internal platform-issue create {task-id} --agent {standard-agent-token}
136
+ agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status waiting-for-triage --assignees current --milestone initial --issue-type --fields
135
137
  ```
136
138
 
137
139
  处理结果:
138
- - intent 成功创建 Issue:`issue_number` 已由任务写入内核回写;调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {agent}`
140
+ - intent 成功创建 Issue:`issue_number` 已由任务写入内核回写;调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
139
141
  - 规则失败(认证 / 网络 / 模板解析等):不回滚 task.md;不追加额外 Activity Log;先调用 `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"` 提交结构化 warning 意图(调用方不分配编号或写表格);再按"场景 C:Issue 创建失败"输出
140
142
  - intent 为 no-op/degraded:按结构化 operations 继续可执行部分;自定义或空平台不创建评论且不阻塞工作流
141
143
  - task.md 已存在有效 `issue_number`:create intent 校验绑定后返回 no-op,不重复创建
@@ -6,6 +6,8 @@ description: >
6
6
  ---
7
7
 
8
8
  # Import Issue
9
+ > `--agent` values follow the "Collaborator Token Specification" in `.agents/rules/task-management.md`: standard AI short tokens (`claude`/`codex`/`antigravity`/`opencode`/`cursor`), long-name normalization (`claude-code`->`claude`, `antigravity-cli`->`antigravity`), or the `human` manual exception.
10
+
9
11
 
10
12
  Import the specified Issue and create a task. Argument: issue number.
11
13
 
@@ -145,9 +147,9 @@ Update `.agents/workspace/active/{task-id}/task.md`:
145
147
  ### 5. Bind and Sync the Issue
146
148
 
147
149
  If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
148
- - Run `agent-infra-internal platform-issue bind {task-id} --issue {issue-number} --agent {agent}`
149
- - Run `agent-infra-internal platform-issue sync {task-id} --agent {agent} --assignees current --milestone initial`
150
- - After every scenario, run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {agent}`
150
+ - Run `agent-infra-internal platform-issue bind {task-id} --issue {issue-number} --agent {standard-agent-token}`
151
+ - Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --assignees current --milestone initial`
152
+ - After every scenario, run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
151
153
 
152
154
  ### 6. Verification Gate
153
155
 
@@ -6,6 +6,8 @@ description: >
6
6
  ---
7
7
 
8
8
  # 导入 Issue
9
+ > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」:标准 AI 短名(`claude`/`codex`/`antigravity`/`opencode`/`cursor`)、长名归一化(`claude-code`→`claude`、`antigravity-cli`→`antigravity`)或人工例外 `human`。
10
+
9
11
 
10
12
  导入指定的 Issue 并创建任务。参数:issue 编号。
11
13
 
@@ -145,9 +147,9 @@ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
145
147
  ### 5. 绑定并同步 Issue
146
148
 
147
149
  如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
148
- - 调用 `agent-infra-internal platform-issue bind {task-id} --issue {issue-number} --agent {agent}` 校验并原子绑定
149
- - 调用 `agent-infra-internal platform-issue sync {task-id} --agent {agent} --assignees current --milestone initial`
150
- - 所有场景结束后,必须调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {agent}`
150
+ - 调用 `agent-infra-internal platform-issue bind {task-id} --issue {issue-number} --agent {standard-agent-token}` 校验并原子绑定
151
+ - 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --assignees current --milestone initial`
152
+ - 所有场景结束后,必须调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
151
153
 
152
154
  ### 6. 完成校验
153
155
 
@@ -7,6 +7,9 @@ description: >
7
7
  ---
8
8
 
9
9
  # Design Technical Plan
10
+ > `--agent` values follow the "Collaborator Token Specification" in `.agents/rules/task-management.md`: standard AI short tokens (`claude`/`codex`/`antigravity`/`opencode`/`cursor`), long-name normalization (`claude-code`->`claude`, `antigravity-cli`->`antigravity`), or the `human` manual exception.
11
+
12
+ If the entry operands contain `--orchestrated`, bind `{execution-flag}` to `--orchestrated` and forward it unchanged to the completed event; otherwise bind it to an empty value. Never infer it from `orchestration.json`, environment variables, or prior artifacts.
10
13
 
11
14
  ## Boundary / Critical Rules
12
15
 
@@ -36,7 +39,7 @@ Before the state check is complete, do not make external-state assertions such a
36
39
 
37
40
  ## Step Start: Write the started Marker
38
41
 
39
- After resolving the artifact context and before this round's first artifact action, run `agent-infra-internal task-event {task-id} plan.started --agent {agent}` and verify the returned `artifactContext`.
42
+ After resolving the artifact context and before this round's first artifact action, run `agent-infra-internal task-event {task-id} plan.started --agent {standard-agent-token}` and verify the returned `artifactContext`.
40
43
 
41
44
  ## Steps
42
45
 
@@ -110,14 +113,14 @@ Update `.agents/workspace/active/{task-id}/task.md`:
110
113
  - Overwrite the `effort` field in frontmatter with the new value
111
114
  - Append a `## Effort Re-estimate` section to this round's plan artifact `{plan-artifact}`, recording: `effort {old} → {new} (rationale: {short basis grounded in this plan})`
112
115
  If the re-estimated value matches the current value, skip it: do not write the `## Effort Re-estimate` section. The Flow A sync that follows reads the possibly updated frontmatter and propagates the new value to the Issue automatically.
113
- After the business fields are updated, run `agent-infra-internal task-event {task-id} plan.completed --agent {agent} --artifact {plan-artifact}` so the core atomically records the link, stage, agent, metadata, and Activity Log.
116
+ After the business fields are updated, run `agent-infra-internal task-event {task-id} plan.completed --agent {standard-agent-token} --artifact {plan-artifact} {execution-flag}` so the core atomically records the link, stage, agent, metadata, and Activity Log.
114
117
  - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Plan Task (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
115
118
  ```
116
119
 
117
120
  If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
118
- - Run `agent-infra-internal platform-issue sync {task-id} --agent {agent} --status pending-design-work --fields`
119
- - Run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {agent}`
120
- - Run `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {plan-artifact} --agent {agent}`
121
+ - Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status pending-design-work --fields`
122
+ - Run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
123
+ - Run `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {plan-artifact} --agent {standard-agent-token}`
121
124
 
122
125
  ### 8. Verification Gate
123
126
 
@@ -7,6 +7,9 @@ description: >
7
7
  ---
8
8
 
9
9
  # 设计技术方案
10
+ > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」:标准 AI 短名(`claude`/`codex`/`antigravity`/`opencode`/`cursor`)、长名归一化(`claude-code`→`claude`、`antigravity-cli`→`antigravity`)或人工例外 `human`。
11
+
12
+ 若入口业务操作数包含 `--orchestrated`,绑定 `{execution-flag}` = `--orchestrated` 并原样转发给 completed 事件;否则绑定为空。不得从 `orchestration.json`、环境变量或历史产物推断该标记。
10
13
 
11
14
  ## 行为边界 / 关键规则
12
15
 
@@ -39,7 +42,7 @@ agent-infra-internal task-snapshot {task-id} --format text
39
42
  确认前置条件和轮次后、本轮第一个产出动作之前执行:
40
43
 
41
44
  ```bash
42
- agent-infra-internal task-event {task-id} plan.started --agent {agent}
45
+ agent-infra-internal task-event {task-id} plan.started --agent {standard-agent-token}
43
46
  ```
44
47
 
45
48
  ## 执行步骤
@@ -109,12 +112,12 @@ agent-infra-internal task-event {task-id} plan.started --agent {agent}
109
112
  - 用新值覆盖 frontmatter 的 `effort` 字段
110
113
  - 在本轮方案产物 `{plan-artifact}` 中追加 `## 工作量重估` 段,记录一条:`effort {old} → {new} (rationale: {基于本轮方案的简短依据})`
111
114
  若重估值与当前值一致,跳过:不写入 `## 工作量重估` 段。后续 Flow A 同步会读取可能更新过的 frontmatter,并自动把新值同步到 Issue。
112
- - 完成业务内容更新后执行 `agent-infra-internal task-event {task-id} plan.completed --agent {agent} --artifact {plan-artifact}`,由核心原子登记链接、阶段、代理、时间、版本和 Activity Log。
115
+ - 完成业务内容更新后执行 `agent-infra-internal task-event {task-id} plan.completed --agent {standard-agent-token} --artifact {plan-artifact} {execution-flag}`,由核心原子登记链接、阶段、代理、时间、版本和 Activity Log。
113
116
 
114
117
  如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
115
- - 调用 `agent-infra-internal platform-issue sync {task-id} --agent {agent} --status pending-design-work --fields`
116
- - 调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {agent}`
117
- - 调用 `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {plan-artifact} --agent {agent}`
118
+ - 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status pending-design-work --fields`
119
+ - 调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
120
+ - 调用 `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {plan-artifact} --agent {standard-agent-token}`
118
121
 
119
122
  ### 8. 完成校验
120
123
 
@@ -7,6 +7,8 @@ description: >
7
7
 
8
8
  # Post-release
9
9
 
10
+ Require one explicit canonical SemVer `{version}`. Do not fall back to the latest tag.
11
+
10
12
  ## 1. Inspect Channel Facts
11
13
 
12
14
  ```bash
@@ -7,6 +7,8 @@ description: >
7
7
 
8
8
  # 发布后处理
9
9
 
10
+ 要求用户显式提供唯一规范 SemVer `{version}`,不得回退到最新 tag。
11
+
10
12
  ## 1. 检查渠道事实
11
13
 
12
14
  ```bash
@@ -7,36 +7,42 @@ description: >
7
7
 
8
8
  # Release
9
9
 
10
- Release state is derived from external facts and prepare/publish require separate authorization.
10
+ Prepare, present the latest fact snapshot, and request one remote-publish authorization in a single invocation. External facts remain the source of truth.
11
11
 
12
- ## 1. Validate Input and Entropy Report
12
+ ## 1. Validate Input and Entropy Checkpoint
13
13
 
14
- Confirm SemVer and the human release checkpoint.
14
+ Require one canonical SemVer `{version}` and a satisfied entropy checkpoint.
15
15
 
16
- ## 2. Inspect Facts
16
+ ## 2. Prepare and Inspect Facts
17
17
 
18
18
  ```bash
19
19
  agent-infra-internal release-workflow inspect {version}
20
20
  ```
21
21
 
22
- ## 3. Prepare
22
+ Run prepare and inspect again only when the snapshot is not prepared. Reuse prepared or partially published facts. Unknown state is blocked.
23
23
 
24
24
  ```bash
25
25
  agent-infra-internal release-workflow prepare {version} --entropy-report {path}
26
26
  ```
27
27
 
28
- Stop after prepare; never publish implicitly.
28
+ ## 3. Present and Confirm
29
29
 
30
- ## 4. Publish Separately
30
+ Present the latest snapshot. Only an unambiguous affirmative reply for that snapshot in the current session authorizes publishing. A denial, adjustment, question, ambiguity, interruption, or changed snapshot stops the write and requires a new preview.
31
31
 
32
- Only after explicit user authorization:
32
+ ## 4. Publish and Reinspect
33
33
 
34
34
  ```bash
35
35
  agent-infra-internal release-workflow publish {version}
36
36
  ```
37
37
 
38
- Push refs normally, preserve partial success for replay, and never force push.
38
+ Push refs normally, preserve partial success for replay, never force push, and inspect again after the operation.
39
39
 
40
40
  ## 5. Report Facts
41
41
 
42
- Show the snapshot and render next-step client commands through the shared helper. Treat unknown external state as blocked.
42
+ After a complete publish, render the versioned next step without exposing internal actions or skipping directly to post-release:
43
+
44
+ ```bash
45
+ agent-infra-internal agent-client next-steps \
46
+ --skill create-release-note \
47
+ --version {version}
48
+ ```
@@ -7,36 +7,42 @@ description: >
7
7
 
8
8
  # 版本发布
9
9
 
10
- 发布由事实驱动,并拆为独立授权的 prepare 与 publish。
10
+ 在单次调用中准备发布、展示最新事实快照并请求一次远端发布授权。状态由外部事实重建。
11
11
 
12
- ## 1. 检查输入与 entropy 报告
12
+ ## 1. 验证输入与人工检查点
13
13
 
14
- 确认 SemVer 和人工发布检查点已满足。
14
+ 验证唯一参数 `{version}` 是规范 SemVer,并确认 entropy 人工检查点已满足。
15
15
 
16
- ## 2. 检查事实
16
+ ## 2. 准备并检查发布事实
17
17
 
18
18
  ```bash
19
19
  agent-infra-internal release-workflow inspect {version}
20
20
  ```
21
21
 
22
- ## 3. 准备发布
22
+ 未 prepared 时执行 prepare 并重新 inspect;已准备或部分发布时复用当前事实。unknown 必须 blocked。
23
23
 
24
24
  ```bash
25
25
  agent-infra-internal release-workflow prepare {version} --entropy-report {path}
26
26
  ```
27
27
 
28
- prepare 后停止,不得隐式 publish。
28
+ ## 3. 展示快照并确认
29
29
 
30
- ## 4. 独立发布
30
+ 展示最新 snapshot。只有当前会话中针对该快照的无歧义明确肯定答复才授权发布;否定、调整、疑问、歧义或中断均停止。快照变化后重新确认。
31
31
 
32
- 仅在用户明确授权后执行:
32
+ ## 4. 发布并复核
33
33
 
34
34
  ```bash
35
35
  agent-infra-internal release-workflow publish {version}
36
36
  ```
37
37
 
38
- 逐 ref 普通 push;部分成功可重放,禁止 force push。
38
+ 逐 ref 普通 push;部分成功可重放,禁止 force push。操作后重新 inspect。
39
39
 
40
40
  ## 5. 输出事实摘要
41
41
 
42
- 完整展示 snapshot 和后续 TUI 命令;unknown 必须视为 blocked。
42
+ 完整发布后渲染携带版本的下一步,不显示内部 action,也不直接跳到 post-release:
43
+
44
+ ```bash
45
+ agent-infra-internal agent-client next-steps \
46
+ --skill create-release-note \
47
+ --version {version}
48
+ ```