@fitlab-ai/agent-infra 0.9.10 → 0.9.12

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 (375) hide show
  1. package/README.md +19 -9
  2. package/README.zh-CN.md +19 -9
  3. package/bin/cli.ts +17 -4
  4. package/dist/bin/cli.js +19 -4
  5. package/dist/bin/internal-cli.js +55 -4
  6. package/dist/lib/agent-client.js +0 -1
  7. package/dist/lib/agent-clients/adapters/codex-lifecycle/build-identity.js +71 -10
  8. package/dist/lib/agent-clients/adapters/opencode-sandbox.js +0 -4
  9. package/dist/lib/agent-clients/adapters/traecli.js +7 -8
  10. package/dist/lib/agent-clients/config.js +14 -99
  11. package/dist/lib/agent-clients/reconcile.js +1 -11
  12. package/dist/lib/agent-clients/schema.js +5 -4
  13. package/dist/lib/agent-clients/tokens.js +5 -15
  14. package/dist/lib/decide.js +14 -30
  15. package/dist/lib/defaults.json +8 -0
  16. package/dist/lib/git/workflow.js +43 -1
  17. package/dist/lib/init.js +3 -2
  18. package/dist/lib/internal/git-workflow.js +8 -1
  19. package/dist/lib/internal/platform-pr.js +8 -2
  20. package/dist/lib/internal/release-workflow.js +0 -1
  21. package/dist/lib/internal/task-delivery.js +59 -0
  22. package/dist/lib/internal/task-finalization.js +19 -9
  23. package/dist/lib/internal/task-ledger.js +8 -2
  24. package/dist/lib/internal/task-lifecycle.js +17 -93
  25. package/dist/lib/internal/task-orchestration.js +30 -216
  26. package/dist/lib/internal/task-validate.js +2 -1
  27. package/dist/lib/merge.js +205 -103
  28. package/dist/lib/platform/github-client.js +7 -1
  29. package/dist/lib/platform/pr-checks.js +8 -5
  30. package/dist/lib/platform/pr-summary.js +12 -8
  31. package/dist/lib/platform/pull-requests.js +393 -91
  32. package/dist/lib/platform/verification-required.js +13 -2
  33. package/dist/lib/platform/verification-sync.js +9 -4
  34. package/dist/lib/pr-review/evidence-grading.js +12 -4
  35. package/dist/lib/process-data/normalize.js +2 -9
  36. package/dist/lib/run/host.js +46 -16
  37. package/dist/lib/sandbox/agent-client-reconciler.js +4 -12
  38. package/dist/lib/sandbox/commands/create.js +3 -3
  39. package/dist/lib/sandbox/commands/enter.js +18 -4
  40. package/dist/lib/sandbox/config.js +8 -12
  41. package/dist/lib/sandbox/control/executor.js +131 -39
  42. package/dist/lib/sandbox/control/lifecycle.js +55 -24
  43. package/dist/lib/sandbox/control/server.js +18 -16
  44. package/dist/lib/sandbox/mounts.js +3 -2
  45. package/dist/lib/sandbox/recovery.js +123 -22
  46. package/dist/lib/sandbox/workspace-identity.js +14 -0
  47. package/dist/lib/sandbox/workspace-view.js +8 -9
  48. package/dist/lib/self-update.js +278 -0
  49. package/dist/lib/server/process-state.js +2 -2
  50. package/dist/lib/server/protocol.js +5 -5
  51. package/dist/lib/task/activity-log.js +4 -1
  52. package/dist/lib/task/artifact-lifecycle.js +6 -4
  53. package/dist/lib/task/codex-orchestration.js +1 -1
  54. package/dist/lib/task/command-options.js +1 -3
  55. package/dist/lib/task/commands/cat.js +0 -5
  56. package/dist/lib/task/commands/decisions.js +76 -92
  57. package/dist/lib/task/commands/files.js +6 -6
  58. package/dist/lib/task/commands/grep.js +25 -61
  59. package/dist/lib/task/commands/issue-body.js +6 -6
  60. package/dist/lib/task/commands/log.js +25 -10
  61. package/dist/lib/task/commands/show.js +5 -6
  62. package/dist/lib/task/commands/status.js +8 -8
  63. package/dist/lib/task/commit-intent.js +100 -0
  64. package/dist/lib/task/commit-operation.js +181 -91
  65. package/dist/lib/task/commit-policy.js +1 -1
  66. package/dist/lib/task/control-authority.js +431 -0
  67. package/dist/lib/task/create.js +39 -8
  68. package/dist/lib/task/current-contract.js +35 -0
  69. package/dist/lib/task/decision-details.js +218 -0
  70. package/dist/lib/task/decision-intents.js +5 -2
  71. package/dist/lib/task/delivery-target.js +97 -0
  72. package/dist/lib/task/delivery.js +153 -0
  73. package/dist/lib/task/events.js +11 -5
  74. package/dist/lib/task/human-override.js +5 -2
  75. package/dist/lib/task/index.js +19 -20
  76. package/dist/lib/task/ledger-intents.js +8 -9
  77. package/dist/lib/task/ledger.js +13 -6
  78. package/dist/lib/task/lifecycle.js +122 -9
  79. package/dist/lib/task/orchestration.js +105 -75
  80. package/dist/lib/task/pr-delivery-fact.js +182 -0
  81. package/dist/lib/task/review-artifacts.js +31 -12
  82. package/dist/lib/task/review-finalization.js +13 -4
  83. package/dist/lib/task/review-fingerprint.js +8 -0
  84. package/dist/lib/task/verification-engine.js +86 -39
  85. package/dist/lib/task/verification-review.js +2 -2
  86. package/dist/lib/task/workspace-snapshot.js +5 -11
  87. package/dist/lib/task/write.js +11 -1
  88. package/dist/lib/update.js +13 -35
  89. package/dist/lib/version.js +5 -1
  90. package/dist/lifecycle-build-manifest.json +3 -3
  91. package/lib/agent-client.ts +0 -1
  92. package/lib/agent-clients/adapters/codex-lifecycle/build-identity.ts +105 -10
  93. package/lib/agent-clients/adapters/codex-lifecycle/manifest-files.json +12 -1
  94. package/lib/agent-clients/adapters/opencode-sandbox.ts +0 -5
  95. package/lib/agent-clients/adapters/traecli.ts +7 -8
  96. package/lib/agent-clients/config.ts +14 -144
  97. package/lib/agent-clients/reconcile.ts +1 -12
  98. package/lib/agent-clients/schema.ts +5 -4
  99. package/lib/agent-clients/tokens.ts +5 -18
  100. package/lib/decide.ts +12 -22
  101. package/lib/defaults.json +8 -0
  102. package/lib/git/workflow.ts +38 -1
  103. package/lib/init.ts +5 -2
  104. package/lib/internal/git-workflow.ts +7 -1
  105. package/lib/internal/platform-pr.ts +8 -1
  106. package/lib/internal/release-workflow.ts +0 -1
  107. package/lib/internal/task-delivery.ts +53 -0
  108. package/lib/internal/task-finalization.ts +27 -13
  109. package/lib/internal/task-ledger.ts +8 -2
  110. package/lib/internal/task-lifecycle.ts +33 -76
  111. package/lib/internal/task-orchestration.ts +33 -190
  112. package/lib/internal/task-validate.ts +3 -2
  113. package/lib/merge.ts +236 -120
  114. package/lib/platform/github-client.ts +8 -1
  115. package/lib/platform/pr-checks.ts +7 -5
  116. package/lib/platform/pr-summary.ts +10 -7
  117. package/lib/platform/pull-requests.ts +425 -87
  118. package/lib/platform/verification-required.ts +12 -2
  119. package/lib/platform/verification-sync.ts +9 -4
  120. package/lib/pr-review/evidence-grading.ts +7 -4
  121. package/lib/process-data/normalize.ts +2 -8
  122. package/lib/run/host.ts +63 -14
  123. package/lib/sandbox/agent-client-reconciler.ts +5 -15
  124. package/lib/sandbox/commands/create.ts +4 -4
  125. package/lib/sandbox/commands/enter.ts +24 -4
  126. package/lib/sandbox/config.ts +9 -14
  127. package/lib/sandbox/control/container-identity.ts +2 -2
  128. package/lib/sandbox/control/executor.ts +148 -51
  129. package/lib/sandbox/control/lifecycle.ts +59 -31
  130. package/lib/sandbox/control/protocol.ts +1 -3
  131. package/lib/sandbox/control/server.ts +15 -12
  132. package/lib/sandbox/control/state.ts +7 -7
  133. package/lib/sandbox/mounts.ts +4 -3
  134. package/lib/sandbox/recovery.ts +162 -34
  135. package/lib/sandbox/tools.ts +1 -1
  136. package/lib/sandbox/workspace-identity.ts +28 -0
  137. package/lib/sandbox/workspace-view.ts +14 -10
  138. package/lib/self-update.ts +341 -0
  139. package/lib/server/process-state.ts +2 -2
  140. package/lib/server/protocol.ts +5 -5
  141. package/lib/task/activity-log.ts +6 -1
  142. package/lib/task/artifact-lifecycle.ts +7 -5
  143. package/lib/task/codex-orchestration.ts +2 -1
  144. package/lib/task/command-options.ts +1 -2
  145. package/lib/task/commands/cat.ts +0 -4
  146. package/lib/task/commands/decisions.ts +80 -75
  147. package/lib/task/commands/files.ts +6 -6
  148. package/lib/task/commands/grep.ts +23 -51
  149. package/lib/task/commands/issue-body.ts +6 -6
  150. package/lib/task/commands/log.ts +22 -10
  151. package/lib/task/commands/show.ts +5 -6
  152. package/lib/task/commands/status.ts +8 -8
  153. package/lib/task/commit-intent.ts +137 -0
  154. package/lib/task/commit-operation.ts +161 -79
  155. package/lib/task/commit-policy.ts +1 -2
  156. package/lib/task/control-authority.ts +563 -0
  157. package/lib/task/create.ts +40 -10
  158. package/lib/task/current-contract.ts +49 -0
  159. package/lib/task/decision-details.ts +280 -0
  160. package/lib/task/decision-intents.ts +7 -2
  161. package/lib/task/delivery-target.ts +130 -0
  162. package/lib/task/delivery.ts +160 -0
  163. package/lib/task/events.ts +10 -5
  164. package/lib/task/human-override.ts +5 -2
  165. package/lib/task/index.ts +19 -20
  166. package/lib/task/ledger-intents.ts +6 -8
  167. package/lib/task/ledger.ts +17 -7
  168. package/lib/task/lifecycle.ts +113 -4
  169. package/lib/task/orchestration.ts +102 -80
  170. package/lib/task/pr-delivery-fact.ts +254 -0
  171. package/lib/task/review-artifacts.ts +53 -15
  172. package/lib/task/review-finalization.ts +21 -5
  173. package/lib/task/review-fingerprint.ts +10 -0
  174. package/lib/task/verification-engine.ts +78 -46
  175. package/lib/task/verification-review.ts +3 -1
  176. package/lib/task/workspace-snapshot.ts +4 -13
  177. package/lib/task/write.ts +20 -1
  178. package/lib/update.ts +14 -38
  179. package/lib/version.ts +6 -1
  180. package/package.json +1 -1
  181. package/templates/.agents/README.en.md +5 -3
  182. package/templates/.agents/README.zh-CN.md +5 -3
  183. package/templates/.agents/rules/README.en.md +4 -2
  184. package/templates/.agents/rules/README.zh-CN.md +4 -2
  185. package/templates/.agents/rules/compatibility-policy.en.md +5 -4
  186. package/templates/.agents/rules/compatibility-policy.zh-CN.md +5 -4
  187. package/templates/.agents/rules/create-issue.en.md +11 -2
  188. package/templates/.agents/rules/create-issue.zh-CN.md +24 -2
  189. package/templates/.agents/rules/human-decision-context.en.md +9 -7
  190. package/templates/.agents/rules/human-decision-context.zh-CN.md +9 -7
  191. package/templates/.agents/rules/{issue-fields.github.en.md → issue-fields.en.md} +1 -1
  192. package/templates/.agents/rules/{issue-fields.github.zh-CN.md → issue-fields.zh-CN.md} +1 -1
  193. package/templates/.agents/rules/issue-pr-commands.en.md +5 -18
  194. package/templates/.agents/rules/issue-pr-commands.zh-CN.md +1 -1
  195. package/templates/.agents/rules/issue-sync.en.md +26 -5
  196. package/templates/.agents/rules/issue-sync.zh-CN.md +62 -5
  197. package/templates/.agents/rules/label-milestone-setup.en.md +15 -2
  198. package/templates/.agents/rules/label-milestone-setup.zh-CN.md +15 -2
  199. package/templates/.agents/rules/local-artifact-repair.en.md +46 -0
  200. package/templates/.agents/rules/local-artifact-repair.zh-CN.md +46 -0
  201. package/templates/.agents/rules/milestone-inference.en.md +12 -2
  202. package/templates/.agents/rules/milestone-inference.zh-CN.md +25 -3
  203. package/templates/.agents/rules/next-step-output.en.md +3 -3
  204. package/templates/.agents/rules/next-step-output.zh-CN.md +3 -3
  205. package/templates/.agents/rules/no-mid-flow-questions.en.md +1 -1
  206. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +1 -1
  207. package/templates/.agents/rules/pr-sync.en.md +23 -14
  208. package/templates/.agents/rules/pr-sync.zh-CN.md +23 -2
  209. package/templates/.agents/rules/release-commands.en.md +42 -3
  210. package/templates/.agents/rules/release-commands.zh-CN.md +42 -3
  211. package/templates/.agents/rules/review-handshake.en.md +1 -1
  212. package/templates/.agents/rules/review-handshake.zh-CN.md +1 -1
  213. package/templates/.agents/rules/security-alerts.en.md +17 -2
  214. package/templates/.agents/rules/security-alerts.zh-CN.md +17 -2
  215. package/templates/.agents/rules/sync-content-generation.en.md +8 -0
  216. package/templates/.agents/rules/sync-content-generation.zh-CN.md +8 -0
  217. package/templates/.agents/rules/task-management.en.md +2 -3
  218. package/templates/.agents/rules/task-management.zh-CN.md +2 -3
  219. package/templates/.agents/scripts/security-alerts.github.sh +151 -0
  220. package/templates/.agents/scripts/security-alerts.sh +31 -0
  221. package/templates/.agents/skills/analyze-task/SKILL.en.md +4 -3
  222. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +4 -3
  223. package/templates/.agents/skills/block-task/SKILL.en.md +2 -2
  224. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +2 -2
  225. package/templates/.agents/skills/cancel-task/SKILL.en.md +2 -2
  226. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +2 -2
  227. package/templates/.agents/skills/check-task/SKILL.en.md +2 -2
  228. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +2 -2
  229. package/templates/.agents/skills/close-codescan/SKILL.en.md +3 -3
  230. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +3 -3
  231. package/templates/.agents/skills/close-dependabot/SKILL.en.md +3 -3
  232. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +3 -3
  233. package/templates/.agents/skills/code-task/SKILL.en.md +8 -5
  234. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +9 -6
  235. package/templates/.agents/skills/commit/SKILL.en.md +30 -10
  236. package/templates/.agents/skills/commit/SKILL.zh-CN.md +6 -7
  237. package/templates/.agents/skills/commit/config/verify.json +1 -1
  238. package/templates/.agents/skills/commit/reference/commit-orchestration.en.md +3 -3
  239. package/templates/.agents/skills/commit/reference/commit-orchestration.zh-CN.md +3 -3
  240. package/templates/.agents/skills/commit/reference/pr-summary-sync.en.md +1 -1
  241. package/templates/.agents/skills/commit/reference/pr-summary-sync.zh-CN.md +1 -1
  242. package/templates/.agents/skills/commit/reference/task-status-update.en.md +2 -2
  243. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +2 -2
  244. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +7 -6
  245. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +7 -6
  246. package/templates/.agents/skills/complete-manual-validation/config/verify.en.json +1 -1
  247. package/templates/.agents/skills/complete-manual-validation/config/verify.zh-CN.json +1 -1
  248. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +1 -1
  249. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +1 -1
  250. package/templates/.agents/skills/complete-task/SKILL.en.md +13 -13
  251. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +13 -13
  252. package/templates/.agents/skills/complete-task/reference/external-delivery.en.md +2 -2
  253. package/templates/.agents/skills/complete-task/reference/external-delivery.zh-CN.md +2 -2
  254. package/templates/.agents/skills/create-pr/SKILL.en.md +9 -11
  255. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +9 -11
  256. package/templates/.agents/skills/create-pr/reference/change-report.en.md +9 -4
  257. package/templates/.agents/skills/create-pr/reference/change-report.zh-CN.md +9 -4
  258. package/templates/.agents/skills/create-pr/scripts/change-report.mjs +203 -0
  259. package/templates/.agents/skills/create-release-note/SKILL.en.md +5 -6
  260. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +5 -6
  261. package/templates/.agents/skills/create-task/SKILL.en.md +2 -1
  262. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +2 -1
  263. package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
  264. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  265. package/templates/.agents/skills/import-dependabot/SKILL.en.md +1 -1
  266. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +1 -1
  267. package/templates/.agents/skills/import-issue/SKILL.en.md +1 -1
  268. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +1 -1
  269. package/templates/.agents/skills/init-labels/SKILL.en.md +9 -10
  270. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +9 -10
  271. package/templates/.agents/skills/init-labels/scripts/init-labels.github.sh +57 -1
  272. package/templates/.agents/skills/init-labels/scripts/init-labels.sh +27 -1
  273. package/templates/.agents/skills/init-milestones/SKILL.en.md +3 -5
  274. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +3 -5
  275. package/templates/.agents/skills/plan-task/SKILL.en.md +4 -3
  276. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +4 -3
  277. package/templates/.agents/skills/restore-task/SKILL.en.md +1 -1
  278. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +1 -1
  279. package/templates/.agents/skills/review-analysis/SKILL.en.md +8 -5
  280. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +8 -5
  281. package/templates/.agents/skills/review-analysis/config/verify.en.json +1 -0
  282. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +1 -0
  283. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +18 -0
  284. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +18 -0
  285. package/templates/.agents/skills/review-code/SKILL.en.md +11 -8
  286. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +11 -8
  287. package/templates/.agents/skills/review-code/config/verify.en.json +1 -0
  288. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -0
  289. package/templates/.agents/skills/review-code/reference/migration-risks.en.md +2 -1
  290. package/templates/.agents/skills/review-code/reference/migration-risks.zh-CN.md +2 -1
  291. package/templates/.agents/skills/review-code/reference/output-templates.en.md +19 -1
  292. package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +19 -1
  293. package/templates/.agents/skills/review-code/reference/report-template.en.md +4 -2
  294. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +4 -2
  295. package/templates/.agents/skills/review-plan/SKILL.en.md +8 -5
  296. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +8 -5
  297. package/templates/.agents/skills/review-plan/config/verify.en.json +1 -0
  298. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +1 -0
  299. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +18 -0
  300. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +18 -0
  301. package/templates/.agents/skills/review-pr/SKILL.en.md +1 -0
  302. package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +1 -0
  303. package/templates/.agents/skills/review-pr/reference/evidence-grading.en.md +2 -2
  304. package/templates/.agents/skills/review-pr/reference/evidence-grading.zh-CN.md +2 -2
  305. package/templates/.agents/skills/run-manual-validation/SKILL.en.md +5 -0
  306. package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +5 -0
  307. package/templates/.agents/skills/run-task/SKILL.en.md +5 -1
  308. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +5 -1
  309. package/templates/.agents/skills/update-agent-infra/SKILL.en.md +2 -2
  310. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +2 -2
  311. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +144 -109
  312. package/templates/.agents/skills/watch-pr/SKILL.en.md +5 -5
  313. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +5 -5
  314. package/templates/.agents/templates/task.en.md +6 -2
  315. package/templates/.agents/templates/task.zh-CN.md +6 -2
  316. package/templates/.agents/workflows/bug-fix.en.yaml +9 -8
  317. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +9 -8
  318. package/templates/.agents/workflows/feature-development.en.yaml +9 -8
  319. package/templates/.agents/workflows/feature-development.zh-CN.yaml +9 -8
  320. package/templates/.agents/workflows/refactoring.en.yaml +9 -8
  321. package/templates/.agents/workflows/refactoring.zh-CN.yaml +9 -8
  322. package/templates/.claude/commands/analyze-task.en.md +1 -1
  323. package/templates/.claude/commands/analyze-task.zh-CN.md +1 -1
  324. package/templates/.claude/commands/block-task.en.md +1 -1
  325. package/templates/.claude/commands/block-task.zh-CN.md +1 -1
  326. package/templates/.claude/commands/cancel-task.en.md +1 -1
  327. package/templates/.claude/commands/cancel-task.zh-CN.md +1 -1
  328. package/templates/.claude/commands/check-task.en.md +1 -1
  329. package/templates/.claude/commands/check-task.zh-CN.md +1 -1
  330. package/templates/.claude/commands/code-task.en.md +1 -1
  331. package/templates/.claude/commands/code-task.zh-CN.md +1 -1
  332. package/templates/.claude/commands/commit.en.md +1 -1
  333. package/templates/.claude/commands/commit.zh-CN.md +1 -1
  334. package/templates/.claude/commands/complete-manual-validation.en.md +1 -1
  335. package/templates/.claude/commands/complete-manual-validation.zh-CN.md +1 -1
  336. package/templates/.claude/commands/complete-task.en.md +1 -1
  337. package/templates/.claude/commands/complete-task.zh-CN.md +1 -1
  338. package/templates/.claude/commands/create-pr.en.md +1 -1
  339. package/templates/.claude/commands/create-pr.zh-CN.md +1 -1
  340. package/templates/.claude/commands/plan-task.en.md +1 -1
  341. package/templates/.claude/commands/plan-task.zh-CN.md +1 -1
  342. package/templates/.claude/commands/review-analysis.en.md +1 -1
  343. package/templates/.claude/commands/review-analysis.zh-CN.md +1 -1
  344. package/templates/.claude/commands/review-code.en.md +1 -1
  345. package/templates/.claude/commands/review-code.zh-CN.md +1 -1
  346. package/templates/.claude/commands/review-plan.en.md +1 -1
  347. package/templates/.claude/commands/review-plan.zh-CN.md +1 -1
  348. package/templates/.claude/commands/run-manual-validation.en.md +1 -1
  349. package/templates/.claude/commands/run-manual-validation.zh-CN.md +1 -1
  350. package/templates/.claude/commands/run-task.en.md +1 -1
  351. package/templates/.claude/commands/run-task.zh-CN.md +1 -1
  352. package/templates/.claude/commands/watch-pr.en.md +1 -1
  353. package/templates/.claude/commands/watch-pr.zh-CN.md +1 -1
  354. package/templates/{.trae/skills → .traecli/commands}/update-agent-infra.en.md +0 -1
  355. package/templates/{.trae/skills → .traecli/commands}/update-agent-infra.zh-CN.md +0 -1
  356. package/dist/lib/builtin-tuis.js +0 -40
  357. package/lib/builtin-tuis.ts +0 -56
  358. package/templates/.agents/rules/create-issue.github.en.md +0 -14
  359. package/templates/.agents/rules/create-issue.github.zh-CN.md +0 -27
  360. package/templates/.agents/rules/issue-pr-commands.github.en.md +0 -34
  361. package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +0 -49
  362. package/templates/.agents/rules/issue-sync.github.en.md +0 -40
  363. package/templates/.agents/rules/issue-sync.github.zh-CN.md +0 -76
  364. package/templates/.agents/rules/label-milestone-setup.github.en.md +0 -60
  365. package/templates/.agents/rules/label-milestone-setup.github.zh-CN.md +0 -60
  366. package/templates/.agents/rules/milestone-inference.github.en.md +0 -15
  367. package/templates/.agents/rules/milestone-inference.github.zh-CN.md +0 -27
  368. package/templates/.agents/rules/pr-checks-commands.github.en.md +0 -18
  369. package/templates/.agents/rules/pr-checks-commands.github.zh-CN.md +0 -34
  370. package/templates/.agents/rules/pr-sync.github.en.md +0 -43
  371. package/templates/.agents/rules/pr-sync.github.zh-CN.md +0 -69
  372. package/templates/.agents/rules/release-commands.github.en.md +0 -38
  373. package/templates/.agents/rules/release-commands.github.zh-CN.md +0 -38
  374. package/templates/.agents/rules/security-alerts.github.en.md +0 -43
  375. package/templates/.agents/rules/security-alerts.github.zh-CN.md +0 -43
@@ -1,56 +0,0 @@
1
- import { AGENT_CLIENT_IDS, isAgentClientId } from './agent-clients/types.ts';
2
- import type { AgentClientId } from './agent-clients/types.ts';
3
- import { listAgentClientAdapters } from './agent-clients/registry.ts';
4
-
5
- const BUILTIN_TUI_IDS = AGENT_CLIENT_IDS;
6
- type BuiltinTUIId = AgentClientId;
7
-
8
- const BUILTIN_TUI_DISPLAY = Object.fromEntries(
9
- listAgentClientAdapters().map((adapter) => [adapter.id, adapter.displayName])
10
- ) as Record<BuiltinTUIId, string>;
11
-
12
- const BUILTIN_TUI_OWNED_PATH_PREFIXES = Object.fromEntries(
13
- listAgentClientAdapters().map((adapter) => [
14
- adapter.id,
15
- [...adapter.project.ownedPathPrefixes]
16
- ])
17
- ) as Record<BuiltinTUIId, string[]>;
18
-
19
- function isBuiltinTUIId(value: unknown): value is BuiltinTUIId {
20
- return isAgentClientId(value);
21
- }
22
-
23
- function resolveEnabledTUIs(value: unknown): Set<BuiltinTUIId> {
24
- // Missing field / null / non-array → full set (backward compat for legacy
25
- // .airc.json predating the `tuis` field).
26
- if (!Array.isArray(value)) return new Set(BUILTIN_TUI_IDS);
27
- // Empty array is a meaningful, user-set value: "no built-in TUI managed".
28
- // This supports the customTUI-only project layout.
29
- const set = new Set<BuiltinTUIId>();
30
- for (const v of value) {
31
- if (isBuiltinTUIId(v)) set.add(v);
32
- }
33
- return set;
34
- }
35
-
36
- function isPathOwnedByDisabledTUI(rel: string, enabled: Set<BuiltinTUIId>): boolean {
37
- const normalized = String(rel || '').replace(/\\/g, '/').replace(/^\.\//, '');
38
- for (const tui of BUILTIN_TUI_IDS) {
39
- if (enabled.has(tui)) continue;
40
- for (const prefix of BUILTIN_TUI_OWNED_PATH_PREFIXES[tui]) {
41
- const trimmed = prefix.replace(/\/$/, '');
42
- if (normalized === trimmed || normalized.startsWith(prefix)) return true;
43
- }
44
- }
45
- return false;
46
- }
47
-
48
- export {
49
- BUILTIN_TUI_IDS,
50
- BUILTIN_TUI_DISPLAY,
51
- BUILTIN_TUI_OWNED_PATH_PREFIXES,
52
- isBuiltinTUIId,
53
- resolveEnabledTUIs,
54
- isPathOwnedByDisabledTUI
55
- };
56
- export type { BuiltinTUIId };
@@ -1,14 +0,0 @@
1
- # Issue Creation
2
-
3
- > `--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.
4
-
5
- After `create-task` writes task.md, create and initialize the Issue through declarative internal intents:
6
-
7
- ```bash
8
- agent-infra-internal platform-issue create {task-id} --agent {standard-agent-token}
9
- agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status waiting-for-triage --assignees current --milestone initial --issue-type --fields
10
- ```
11
-
12
- The core reads only persisted task identity, title, type, description, and requirements, and reuses deterministic `ai task issue-body` rendering. It owns template selection, upstream/capabilities, duplicate prevention, POST outcome boundaries, response validation, and atomic `issue_number` binding.
13
-
14
- `planned|applied|no-op|degraded` exit 0, `failed` exits 1, and `blocked` exits 2. Callers must not fall back to direct `gh issue` or GraphQL orchestration.
@@ -1,27 +0,0 @@
1
- # Issue 创建
2
-
3
- > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」:标准 AI 短名(`claude`/`codex`/`antigravity`/`opencode`/`cursor`)、长名归一化(`claude-code`→`claude`、`antigravity-cli`→`antigravity`)或人工例外 `human`。
4
-
5
- 当 `create-task` 完成本地 `task.md` 落盘后,通过声明式内部命令创建 Issue:
6
-
7
- ```bash
8
- agent-infra-internal platform-issue create {task-id} --agent {standard-agent-token}
9
- ```
10
-
11
- 命令只从已落盘 task.md 读取身份、标题、类型、描述与需求,并复用 `ai task issue-body` 的确定性正文渲染。它负责模板选择、upstream/capability、已有绑定检查、非幂等 POST 边界、响应身份校验及通过任务写入内核回写 `issue_number`。
12
-
13
- 创建后的初始元数据使用同一适配层同步:
14
-
15
- ```bash
16
- agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} \
17
- --status waiting-for-triage --assignees current --milestone initial --issue-type --fields
18
- ```
19
-
20
- ## 结果处理
21
-
22
- - `planned|applied|no-op|degraded`:exit 0;调用方按 operations 继续评论同步。
23
- - `failed`:exit 1;调用方登记 `ISSUE_CREATE_FAILED` warning,不伪造绑定。
24
- - `blocked`:exit 2;认证、网络或创建 outcome 不确定,调用方保留远端 identity 证据并停止盲目重试。
25
- - 已绑定有效 Issue 时只验证绑定并返回 no-op,绝不重复创建。
26
-
27
- 自定义或空平台返回 no-op/degraded;调用方不得回退到直接 `gh issue` 或 GraphQL 编排。
@@ -1,34 +0,0 @@
1
- # PR Platform Intents
2
-
3
- > `--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.
4
-
5
- PR lookup, creation, binding, and metadata synchronization go through typed internal intents. Skills decide branches and write titles/bodies; they do not assemble platform commands.
6
-
7
- ## Inspect
8
-
9
- ```bash
10
- agent-infra-internal platform-pr inspect {task-id}
11
- ```
12
-
13
- ## Create or recover
14
-
15
- ```bash
16
- agent-infra-internal platform-pr create {task-id} \
17
- --agent {standard-agent-token} --base {target-branch} --head {current-branch} \
18
- --title-file {title-file} --body-file {body-file}
19
- ```
20
-
21
- The core performs exact upstream/head/base lookup. One match is reused, zero creates, and multiple matches fail closed. Unknown create outcomes are reconciled by exact identity. `--dry-run` returns only the plan.
22
-
23
- ## Bind and synchronize
24
-
25
- ```bash
26
- agent-infra-internal platform-pr bind {task-id} --pr {pr-number} --agent {standard-agent-token}
27
-
28
- agent-infra-internal platform-pr sync {task-id} \
29
- --agent {standard-agent-token} --metadata --closing-issue
30
- ```
31
-
32
- Conflicting bindings do not change `task.md`. Metadata comes from the linked Issue, permission-bound items degrade independently, and an already-created PR is never rolled back.
33
-
34
- Statuses `planned|applied|no-op|degraded` exit 0, `failed` exits 1, and `blocked` exits 2.
@@ -1,49 +0,0 @@
1
- # PR 平台意图命令
2
-
3
- > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」:标准 AI 短名(`claude`/`codex`/`antigravity`/`opencode`/`cursor`)、长名归一化(`claude-code`→`claude`、`antigravity-cli`→`antigravity`)或人工例外 `human`。
4
-
5
- PR 资源的定位、创建、绑定和元数据同步统一通过 typed internal intent;SKILL 只负责决定分支、标题、正文和调用时机,不直接拼装平台命令。
6
-
7
- ## 定位
8
-
9
- ```bash
10
- agent-infra-internal platform-pr inspect {task-id}
11
- ```
12
-
13
- 返回已绑定 PR 的规范身份;未绑定时返回 `PR_NOT_LINKED`。调用方不得按标题模糊匹配。
14
-
15
- ## 创建或恢复
16
-
17
- 调用方把标题和正文分别写入临时文件,然后执行:
18
-
19
- ```bash
20
- agent-infra-internal platform-pr create {task-id} \
21
- --agent {standard-agent-token} --base {target-branch} --head {current-branch} \
22
- --title-file {title-file} --body-file {body-file}
23
- ```
24
-
25
- core 会先按 upstream、head 和 base 精确定位;唯一既有 PR 会复用并绑定,零个才创建,多个稳定失败。远端结果未知时重新精确定位,不盲重建。`--dry-run` 只返回计划。
26
-
27
- ## 显式绑定
28
-
29
- ```bash
30
- agent-infra-internal platform-pr bind {task-id} --pr {pr-number} --agent {standard-agent-token}
31
- ```
32
-
33
- 冲突绑定稳定失败且不修改 `task.md`。
34
-
35
- ## 元数据同步
36
-
37
- ```bash
38
- agent-infra-internal platform-pr sync {task-id} \
39
- --agent {standard-agent-token} --metadata --closing-issue
40
- ```
41
-
42
- core 从关联 Issue 复制 type / `in:` labels、assignee、具体 milestone,并确保 closing association。权限不足返回逐项 `skipped` 和顶层 `degraded`;不得反向修改 Issue。
43
-
44
- ## 状态语义
45
-
46
- - `planned|applied|no-op|degraded`:退出码 0。
47
- - `failed`:退出码 1,确定性输入或远端错误。
48
- - `blocked`:退出码 2,网络、认证或结果未知,需要人工介入或安全重跑。
49
- - 创建后摘要或元数据同步失败不得回滚 PR;调用方按所属 SKILL 记录 warning。
@@ -1,40 +0,0 @@
1
- # Issue Sync
2
-
3
- > `--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.
4
-
5
- ## Marker Registry
6
-
7
- | Key | Marker |
8
- |---|---|
9
- | `task` | `<!-- sync-issue:{task-id}:task -->` |
10
- | `artifact` | `<!-- sync-issue:{task-id}:{artifact-stem} -->` |
11
- | `artifactChunk` | `<!-- sync-issue:{task-id}:{artifact-stem}:{part}/{total} -->` |
12
- | `summary` | `<!-- sync-issue:{task-id}:summary -->` |
13
- | `cancel` | `<!-- sync-issue:{task-id}:cancel -->` |
14
-
15
- `pr-review` content is synced only as an Issue artifact comment (via the `artifact` / `artifactChunk` markers) and is never a `restore-task` recovery source; restore still accepts only an Issue number and reads only registered Issue markers, with no PR source.
16
-
17
- Comments use `platform-comment`; Issue resources use `platform-issue`:
18
-
19
- ```bash
20
- agent-infra-internal platform-issue inspect {task-id}
21
- agent-infra-internal platform-issue create {task-id} --agent {standard-agent-token}
22
- agent-infra-internal platform-issue bind {task-id} --issue {number} --agent {standard-agent-token}
23
- agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} {desired-state-flags}
24
- ```
25
-
26
- The core owns status/in labels, assignees, milestones, Issue Type, pinned fields, requirements, state, capabilities, dry-run, retries, errors, and idempotency. Omitted flags preserve values; `none` explicitly clears them. Status labels converge to at most one, and ambiguous requirement identity fails closed.
27
-
28
- `planned|applied|no-op|degraded` exit 0; `failed` exits 1; `blocked` exits 2.
29
-
30
- Map material degraded/failed/blocked results to workflow warnings through the structured intent; callers must not edit warning rows directly:
31
-
32
- ```bash
33
- agent-infra-internal task-warning {task-id} add \
34
- --step issue-sync --severity {severity} --code {code} \
35
- --target {target} --message {message} --action {action}
36
- ```
37
-
38
- ## Backfill
39
-
40
- During completion, artifact comments are replayed with `--kind artifact --artifact <file> --backfill`. If the remote Issue has no matching marker, the core creates a comment with a historical-backfill notice. If a valid base or chunk marker set already exists, the core returns `no-op` and preserves the existing bodies and chunks. Marker conflicts still fail without writes.
@@ -1,76 +0,0 @@
1
- # Issue 同步规则
2
-
3
- > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」:标准 AI 短名(`claude`/`codex`/`antigravity`/`opencode`/`cursor`)、长名归一化(`claude-code`→`claude`、`antigravity-cli`→`antigravity`)或人工例外 `human`。
4
-
5
- ## Marker 注册表
6
-
7
- 以下 key 及格式是 Issue 评论身份的兼容契约;调用方只传 key/资源,不自行拼 marker。
8
-
9
- | Key | Marker |
10
- |---|---|
11
- | `task` | `<!-- sync-issue:{task-id}:task -->` |
12
- | `artifact` | `<!-- sync-issue:{task-id}:{artifact-stem} -->` |
13
- | `artifactChunk` | `<!-- sync-issue:{task-id}:{artifact-stem}:{part}/{total} -->` |
14
- | `summary` | `<!-- sync-issue:{task-id}:summary -->` |
15
- | `cancel` | `<!-- sync-issue:{task-id}:cancel -->` |
16
-
17
- `prSummary` 属于 `.agents/rules/pr-sync.md`,本规则不实现 PR 聚合。
18
-
19
- `pr-review` 原文只通过 `artifact` / `artifactChunk` marker 同步为 Issue artifact 评论,不作为 `restore-task` 恢复来源;恢复仍只接受 Issue 编号并只读注册的 Issue marker,不新增 PR 来源。
20
-
21
- ## 平台 intent
22
-
23
- GitHub upstream、认证、capability、分页、marker 查找、幂等 create/update、分片、重试与错误分类由 typed platform core 统一处理:
24
-
25
- ```bash
26
- agent-infra-internal platform-context resolve [--cwd <path>]
27
- agent-infra-internal platform-comment list --issue <N> [--cwd <path>]
28
- agent-infra-internal platform-comment owner <task-ref>
29
- agent-infra-internal platform-comment sync <task-ref> \
30
- --kind task|artifact|summary|cancel --agent <standard-agent-token> \
31
- [--artifact <canonical.md>] [--body-file <path|->] [--backfill]
32
- ```
33
-
34
- - `applied|no-op|degraded` → exit 0;`failed` → exit 1;`blocked` → exit 2。
35
- - task 评论保持 `<details>` frontmatter 可逆格式;artifact 原文内联并在超过 profile 上限时使用 `artifactChunk`。
36
- - 相同 intent 重放必须收敛为 `no-op`;重复 marker 返回 `COMMENT_MARKER_CONFLICT` 且不写入。
37
- - 外部贡献者锁定统一使用 `platform-comment owner`;不同作者且无 triage 时返回 `COMMENT_OWNER_CONFLICT`。
38
-
39
- ## 降级与告警
40
-
41
- 平台结果不直接写 task.md。调用方在有关联任务时把关键失败映射为 workflow warning:
42
-
43
- - capability 不足:`IMPORTANT / PERMISSION_DEGRADED`
44
- - 评论同步永久失败:`ACTION_REQUIRED / COMMENT_SYNC_FAILED`
45
- - 网络重试耗尽:`ACTION_REQUIRED / NETWORK_RETRY_EXHAUSTED`
46
-
47
- 使用 `agent-infra-internal task-warning {task-id} add ...` 登记;不得手写 warning 表。
48
-
49
- ```bash
50
- agent-infra-internal task-warning {task-id} add \
51
- --step issue-sync --severity {severity} --code {code} \
52
- --target {target} --message {message} --action {action}
53
- ```
54
-
55
- ## Issue 元数据 intent
56
-
57
- 所有 Issue 元数据写入统一使用:
58
-
59
- ```bash
60
- agent-infra-internal platform-issue inspect {task-id}
61
- agent-infra-internal platform-issue create {task-id} --agent {standard-agent-token}
62
- agent-infra-internal platform-issue bind {task-id} --issue {number} --agent {standard-agent-token}
63
- agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} {desired-state-flags}
64
- ```
65
-
66
- `sync` 支持 status/in labels、assignee、milestone、Issue Type、pinned fields、需求复选框与 Issue state。省略 flag 表示 preserve,`none` 表示显式清空。适配层统一处理集合差集、动态 schema、权限降级、dry-run、重试、错误分类与幂等重放;SKILL 不得拼装 `gh issue`、GraphQL 或权限分支。
67
-
68
- - `planned|applied|no-op|degraded` → exit 0
69
- - `failed` → exit 1
70
- - `blocked` → exit 2
71
-
72
- status labels 始终至多一个;关闭后不保留 status label。`in:` labels 只从项目允许映射与仓库实际 labels 交集产生。需求复选框以 task.md 原文为身份,歧义时 fail closed。
73
-
74
- ## 补发
75
-
76
- complete-task 按 artifact catalog 时间线遍历本地已有产物:task 使用 `--kind task`,其余使用 `--kind artifact --artifact <file> --backfill`;最后用 `--kind summary --body-file <path>` 原地同步交付摘要。artifact backfill 在远端缺少 marker 时创建带“历史产物补发”提示的评论;已存在合法 marker 集合时保持原评论和分片不变并返回 `no-op`;marker 冲突仍失败。该判定由 core 完成,不由 Skill 扫描评论或拼标题。
@@ -1,60 +0,0 @@
1
- # Label / Milestone Platform Commands
2
-
3
- Read this file before initializing labels, initializing milestones, or adjusting milestones during release work.
4
-
5
- ## Authentication and Repository Info
6
-
7
- ```bash
8
- gh auth token
9
- gh repo view --json nameWithOwner --jq '.nameWithOwner'
10
- ```
11
-
12
- ## Label Operations
13
-
14
- List existing labels:
15
-
16
- ```bash
17
- gh label list --limit 200 --json name --jq '.[].name'
18
- ```
19
-
20
- Create or update a label:
21
-
22
- ```bash
23
- gh label create "{name}" --color "{color}" --description "{description}" --force
24
- ```
25
-
26
- ## Milestone Operations
27
-
28
- List milestones:
29
-
30
- ```bash
31
- gh api "repos/$repo/milestones?state=all" --paginate
32
- ```
33
-
34
- Create a milestone:
35
-
36
- ```bash
37
- gh api "repos/$repo/milestones" -f title="{title}" -f description="{description}" -f state="{state}"
38
- ```
39
-
40
- Update a milestone:
41
-
42
- ```bash
43
- gh api "repos/$repo/milestones/{number}" -X PATCH -f state="{state}" -f description="{description}"
44
- ```
45
-
46
- ## Error Prompt Templates
47
-
48
- Use these normalized prompts when the GitHub setup scripts fail:
49
-
50
- | Condition | Prompt |
51
- |---|---|
52
- | CLI missing | GitHub CLI (`gh`) is not installed |
53
- | Authentication failed | `GitHub CLI is not authenticated` |
54
- | API rate limit | `GitHub API rate limit reached, please retry later` |
55
-
56
- ## Constraints
57
-
58
- - use label names as the idempotency key
59
- - use milestone titles as the idempotency key, then milestone numbers when patching state
60
- - stop or skip according to the calling skill when commands fail
@@ -1,60 +0,0 @@
1
- # Label / Milestone 平台命令
2
-
3
- 在初始化 label、初始化 milestone,或发布流程需要调整 milestone 前先读取本文件。
4
-
5
- ## 认证与仓库信息
6
-
7
- ```bash
8
- gh auth token
9
- gh repo view --json nameWithOwner --jq '.nameWithOwner'
10
- ```
11
-
12
- ## Label 操作
13
-
14
- 列出现有 label:
15
-
16
- ```bash
17
- gh label list --limit 200 --json name --jq '.[].name'
18
- ```
19
-
20
- 创建或更新 label:
21
-
22
- ```bash
23
- gh label create "{name}" --color "{color}" --description "{description}" --force
24
- ```
25
-
26
- ## Milestone 操作
27
-
28
- 列出 milestone:
29
-
30
- ```bash
31
- gh api "repos/$repo/milestones?state=all" --paginate
32
- ```
33
-
34
- 创建 milestone:
35
-
36
- ```bash
37
- gh api "repos/$repo/milestones" -f title="{title}" -f description="{description}" -f state="{state}"
38
- ```
39
-
40
- 更新 milestone:
41
-
42
- ```bash
43
- gh api "repos/$repo/milestones/{number}" -X PATCH -f state="{state}" -f description="{description}"
44
- ```
45
-
46
- ## 错误提示模板
47
-
48
- GitHub 初始化脚本失败时使用以下标准提示:
49
-
50
- | 条件 | 提示 |
51
- |---|---|
52
- | CLI 缺失 | GitHub CLI (`gh`) is not installed |
53
- | 认证失败 | `GitHub CLI is not authenticated` |
54
- | API 限流 | `GitHub API rate limit reached, please retry later` |
55
-
56
- ## 约束
57
-
58
- - label 以名称作为幂等键
59
- - milestone 以标题作为幂等键,必要时再结合编号更新状态
60
- - 失败时按调用方规则决定停止或跳过
@@ -1,15 +0,0 @@
1
- # Milestone Inference
2
-
3
- > `--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.
4
-
5
- Milestones narrow through declarative Issue intents:
6
-
7
- ```bash
8
- # create/import phase
9
- agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --milestone initial
10
-
11
- # code phase
12
- agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --milestone specific
13
- ```
14
-
15
- `initial` prefers a valid task milestone, otherwise the lowest open `X.Y.x`, then `General Backlog`. `specific` narrows a release line to the highest open patch version using main/release-line ancestry. Missing facts or triage permission preserve the remote value and return skipped/degraded. `create-pr` reuses the Issue milestone in the 09/10 PR adapter.
@@ -1,27 +0,0 @@
1
- # Milestone 推断规则
2
-
3
- > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」:标准 AI 短名(`claude`/`codex`/`antigravity`/`opencode`/`cursor`)、长名归一化(`claude-code`→`claude`、`antigravity-cli`→`antigravity`)或人工例外 `human`。
4
-
5
- Milestone 继续按生命周期逐步收窄,但候选读取、分支判断、权限降级和写入统一由 `platform-issue` 处理。
6
-
7
- ## 阶段 1:创建或导入
8
-
9
- ```bash
10
- agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --milestone initial
11
- ```
12
-
13
- 优先使用 task.md 中存在且有效的显式 milestone;否则从 open milestones 选择最低 `X.Y.x` 版本线,最后回退 `General Backlog`。`triage=false` 或外部事实不足时保持远端值并返回 skipped/degraded。
14
-
15
- ## 阶段 2:`code-task`
16
-
17
- ```bash
18
- agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --milestone specific
19
- ```
20
-
21
- 版本线收窄规则保持不变:主干模式在当前版本线取最高 patch;多版本分支模式依据 release-line/main 祖先关系选择版本线。无法可靠判断时保持原值。完成门禁仍拒绝 `X.Y.x`。
22
-
23
- ## 阶段 3:`create-pr`
24
-
25
- PR 只复用关联 Issue 的具体 milestone;该 PR 资源写入属于 09/10,不在 `platform-issue` 中实现。
26
-
27
- 调用方不得重新实现 milestone 列表、排序、分支祖先或 `gh issue edit` 逻辑。
@@ -1,18 +0,0 @@
1
- # GitHub PR Readiness Intents
2
-
3
- The GitHub adapter requires `gh >= 2.72.0`. Platform context checks this dependency before any GitHub API, PR, or checks operation. Projects that do not select GitHub neither probe nor depend on `gh`.
4
-
5
- ```bash
6
- agent-infra-internal platform-checks inspect {task-id}
7
-
8
- agent-infra-internal platform-checks watch {task-id} \
9
- --interval-seconds 30 --deadline-seconds 1800
10
-
11
- agent-infra-internal platform-checks resolve-run {task-id} \
12
- --check-name {check-name} [--details-url {details-url}]
13
-
14
- agent-infra-internal platform-checks logs {task-id} \
15
- --run {run-id} [--job {job-id}]
16
- ```
17
-
18
- The adapter normalizes REST `mergeable=false` to `conflicting`, null/missing to `unknown`, and true to `mergeable`; `mergeable=true` plus diagnostic `dirty` is contradictory and becomes `unknown`. Other diagnostics such as `blocked` do not override REST true. Core combines that fact with all checks for one `headSha`: only `ready` exits 0, `conflicting|checks-failed` exit 1, and pending/timeout/cancel/network blocking exit 2. Dependency and deterministic platform errors are preserved without degradation.
@@ -1,34 +0,0 @@
1
- # GitHub PR readiness 平台意图
2
-
3
- PR 全部 checks 的获取、轮询 deadline、失败 run/job 定位和日志获取统一由 typed internal intent 执行。SKILL/模型只负责失败分类、根因分析、最小修复和授权后的提交推送。
4
-
5
- GitHub adapter 要求 `gh >= 2.72.0`。平台上下文会在任何 GitHub API、PR 或 checks 操作前检查该依赖;未选择 GitHub 平台时不探测也不依赖 `gh`。
6
-
7
- ## 快照与监控
8
-
9
- ```bash
10
- agent-infra-internal platform-checks inspect {task-id}
11
-
12
- agent-infra-internal platform-checks watch {task-id} \
13
- --interval-seconds 30 --deadline-seconds 1800
14
- ```
15
-
16
- adapter 把 REST `mergeable=false` 规范化为 `conflicting`,null/缺失为 `unknown`,true 为 `mergeable`;true 与诊断 `dirty` 矛盾时降为 `unknown`。`blocked` 等其他诊断不覆盖 REST true。core 在同一 `headSha` 上与全部 checks 聚合:仅 `ready` 退出 0,`conflicting|checks-failed` 退出 1,pending/timeout/cancel/网络阻塞退出 2。依赖与确定性平台错误不降级。
17
-
18
- ## 定位失败 run/job
19
-
20
- ```bash
21
- agent-infra-internal platform-checks resolve-run {task-id} \
22
- --check-name {check-name} [--details-url {details-url}]
23
- ```
24
-
25
- core 优先验证详情链接;否则按 PR head SHA 与 exact check name 查询。零个或多个候选均 fail closed,不选择其他 run。
26
-
27
- ## 获取失败日志
28
-
29
- ```bash
30
- agent-infra-internal platform-checks logs {task-id} \
31
- --run {run-id} [--job {job-id}]
32
- ```
33
-
34
- 日志结果保真返回;缺失、权限、网络和资源不存在使用稳定错误码区分。平台 intent 不修改业务代码、不测试、不提交也不推送。
@@ -1,43 +0,0 @@
1
- # PR Summary Synchronization
2
-
3
- > `--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.
4
-
5
- The model writes the semantic reviewer summary. Typed core owns canonical artifact selection, marker/HEAD wrapping, paginated comment lookup, and reconciliation.
6
-
7
- ## Three-Layer Isolation
8
-
9
- - `sync-pr:{task-id}:summary` (`platform-pr summary-sync`) is an updatable reviewer summary; it is neither a process copy nor a formal Review.
10
- - The full `pr-review*` process copy lives in the Issue artifact comment (`platform-comment sync --kind artifact`) and is restored by `restore-task` under its Issue-only contract.
11
- - A formal PR Review (`platform-pr-review publish`) is the only formal conclusion carrier published to the PR, bound to the reviewed head SHA, and includes conclusion, findings, receipt, and the Issue artifact link.
12
-
13
- The three never cross: a regular PR comment does not carry the full process copy; an Issue artifact comment is not treated as a formal Review; a summary is not presented as a formal Review.
14
-
15
- ```bash
16
- agent-infra-internal platform-pr summary-context {task-id}
17
-
18
- agent-infra-internal platform-pr summary-sync {task-id} \
19
- --agent {standard-agent-token} --body-file {summary-body-file}
20
- ```
21
-
22
- Use only canonical inputs returned by the context command. Write the plain body without marker or SHA. The core owns `<!-- sync-pr:{task-id}:summary -->`, current `<!-- last-commit: ... -->`, create/update/no-op behavior, and duplicate-marker conflicts. Summary failure never rolls back a PR or commit.
23
-
24
- The canonical comment envelope produced by the core is:
25
-
26
- ```markdown
27
- <!-- sync-pr:{task-id}:summary -->
28
- <!-- last-commit: {git-head-sha} -->
29
- ## Review Summary
30
- {manual-validation-section}
31
- ### Key Technical Decisions
32
- ### Review History
33
- ### Test Results
34
- ### PR Code Changes
35
- ```
36
-
37
- Canonical inputs include `manual-validation.md`. The manual-validation section is one of `### ✅ Manual Validation Passed`, `### ⚠️ Manual Verification Required`, or `### ✅ No Manual Verification Needed`; `complete-manual-validation` refreshes the same summary in place. The PR code-change section uses authoritative base/head facts from `platform-pr inspect` and the complete `git diff --find-renames --numstat base...head`, reconciles runtime, test, skill/rule, template, documentation, and other categories, and explains renames, mechanical mirrors, and potentially unnecessary changes.
38
-
39
- ```bash
40
- agent-infra-internal task-warning {task-id} add --step {step} --severity WARNING \
41
- --code COMMENT_SYNC_FAILED --target pr-summary --message "{reason}" \
42
- --action "Restore comment permission or connectivity and rerun this step"
43
- ```
@@ -1,69 +0,0 @@
1
- # PR 摘要同步
2
-
3
- > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」:标准 AI 短名(`claude`/`codex`/`antigravity`/`opencode`/`cursor`)、长名归一化(`claude-code`→`claude`、`antigravity-cli`→`antigravity`)或人工例外 `human`。
4
-
5
- PR 摘要的语义聚合由模型完成;canonical 产物选择、marker、当前 HEAD、分页评论查找和 create/update/no-op 由 typed core 负责。
6
-
7
- ## 三层隔离
8
-
9
- - `sync-pr:{task-id}:summary`(`platform-pr summary-sync`)是可更新的 reviewer 摘要,不是过程原文,也不是正式 Review。
10
- - `pr-review*` 完整过程原文在 Issue artifact 评论(`platform-comment sync --kind artifact`),由 `restore-task` 按 Issue-only 契约恢复。
11
- - 正式 PR Review(`platform-pr-review publish`)是唯一发布到 PR 的正式结论载体,绑定被审 head SHA,含结论、finding、receipt 与 Issue artifact 链接。
12
-
13
- 三者不串用:PR 普通评论不承载完整过程原文;Issue artifact 评论不当作正式 Review;摘要不冒充正式 Review。
14
-
15
- ## 聚合输入
16
-
17
- ```bash
18
- agent-infra-internal platform-pr summary-context {task-id}
19
- ```
20
-
21
- 只使用返回的 canonical latest `plan*`、`review-plan*`、`code*`、`review-code*`、`manual-validation*`(包括 `manual-validation.md`)。模型据此生成 reviewer 摘要正文,至少包含:
22
-
23
- - 变更摘要与实现范围
24
- - 测试结果
25
- - 审查历程与当前结论
26
- - 人工校验三态:`### ⚠️ 需人工校验`、`### ✅ 人工验证已通过` 或 `### ✅ 无需人工校验`
27
- - `### PR 代码增减`:基于 `platform-pr inspect` 的权威 base/head 和完整 `git diff --find-renames --numstat base...head`,按运行时代码、测试、Skill/规则、模板、文档及其他分类核算,并说明 rename、机械镜像与疑似不必要变化
28
-
29
- 保留人工校验项时,每条写明校验内容、定位和只能人工完成的原因。
30
-
31
- core 最终包装出的 canonical 评论结构为:
32
-
33
- ```markdown
34
- <!-- sync-pr:{task-id}:summary -->
35
- <!-- last-commit: {git-head-sha} -->
36
- ## 审查摘要
37
- {manual-validation-section}
38
- ### 关键技术决策
39
- ### 审查历程
40
- ### 测试结果
41
- ### PR 代码增减
42
- ```
43
-
44
- ## 发布
45
-
46
- 把聚合后的纯正文写入 `{summary-body-file}`,不要自行添加 marker 或 commit SHA:
47
-
48
- ```bash
49
- agent-infra-internal platform-pr summary-sync {task-id} \
50
- --agent {standard-agent-token} --body-file {summary-body-file}
51
- ```
52
-
53
- core 会包装唯一 `<!-- sync-pr:{task-id}:summary -->` 和当前 `<!-- last-commit: ... -->`,分页查找 PR 普通评论:不存在则创建、正文变化则原地更新、无差异则 no-op、重复 marker 则稳定失败。正文通过文件输入,调用方不得拼 shell/heredoc。
54
-
55
- ## 结果回传
56
-
57
- - `applied`:`summary created` 或 `summary updated`
58
- - `no-op`:`summary skipped (no diff)`
59
- - `failed|blocked`:`summary failed: {error.code}: {error.message}`
60
-
61
- `create-pr` 中摘要失败不回滚已创建 PR;`commit` 中只记 warning,不回滚 commit;`complete-manual-validation` 在 canonical artifact 落盘后调用同一 intent 原地刷新。
62
-
63
- 关联任务的摘要失败由调用方登记结构化告警:
64
-
65
- ```bash
66
- agent-infra-internal task-warning {task-id} add --step {step} --severity WARNING \
67
- --code COMMENT_SYNC_FAILED --target pr-summary --message "{reason}" \
68
- --action "修复评论权限或平台连接后重跑当前步骤"
69
- ```