@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
@@ -7,7 +7,7 @@ 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`。
10
+ > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
11
11
 
12
12
  若入口业务操作数包含 `--orchestrated`,绑定 `{execution-flag}` = `--orchestrated` 并原样转发给 completed 事件;否则绑定为空。不得从 `orchestration.json`、环境变量或历史产物推断该标记。
13
13
 
@@ -16,10 +16,11 @@ description: >
16
16
  ## 行为边界 / 关键规则
17
17
 
18
18
  - 严格遵循最新方案产物:`plan.md` 或 `plan-r{N}.md`
19
+ - 生成会同步到 Issue 的任务或生命周期 Markdown 前,先读取 `.agents/rules/sync-content-generation.md` 并遵循其中的生成端约束;同步端不解析或改写正文
19
20
  - 实现前读取 `.agents/rules/compatibility-policy.md`;只实现方案明确批准的兼容预算,不以“稳妥”为由保留旧分支、旧结果契约或迁移 shim
20
21
  - 修复模式逐条核实最新 `review-code` 的发现:成立则修复,判定为不成立/幻觉则在报告中反驳并记入 unresolved;不擅自扩大到审查未列出的问题;manual-validation 项不在修复范围
21
22
  - 实现中遇到方案未覆盖的关键设计决策时,先调用 `agent-infra-internal task-ledger {task-id} decision-next-id` 取得 `HD-N`,按 `.agents/rules/human-decision-context.md` 写入实现报告的 `## 人工裁决待办` 详情块并判断是否需要实现,再调用 `decision-upsert --id {HD-N} --stage code --artifact {code-artifact} --needs-implementation {true|false}`;不得扫描编号、手写账本行、中途提问或擅自扩范围
22
- - 绝不自动执行 `git add` 或 `git commit`
23
+ - 不调用 `commit` 技能,也不推送远端;测试通过后直接调用共享 commit core 的 `delivery: { mode: 'local' }` 创建本地 checkpoint。checkpoint 使用 durable intent,只有 checkpoint 与 task 状态同步成功后才发送 `code.completed`
23
24
  - 每轮实现都创建新的实现产物,不覆盖旧文件
24
25
  - 执行本技能后,你**必须**立即更新 task.md
25
26
 
@@ -34,7 +35,7 @@ description: >
34
35
  | 「代码太简单,不需要测试」 | 简单代码也会回归;没有"失败→通过"的用例就没有完成标志,先写验证业务行为的测试。 |
35
36
  | 「先写代码再补测试更高效」 | 后补测试常沦为对实现的镜像;目标驱动应先定义可验证用例再让它通过。 |
36
37
  | 「方案这里不合理,顺手改更好」 | 偏离 `{plan-artifact}` 必须在报告中记录原因;有异议先停下确认,不擅自改方向。 |
37
- | 「测试过了,顺便提交一下」 | 本技能绝不执行 `git add`/`git commit`,提交是用户显式发起的独立步骤。 |
38
+ | 「测试过了,顺便推送一下」 | 本技能只创建本地 checkpoint;远端推送是 `create-pr` 的唯一边界。 |
38
39
  | 「审查既然写了,照着改就行」 | 审查可能基于错误 `file:line` 或幻觉;动手前先 Read/Grep 核实,成立才修,不成立就反驳并记入 unresolved,不盲从。 |
39
40
  | 「保留旧入口更稳妥,反正只多一个分支」 | 未获批准的兼容是范围扩张和长期债务;没有对象、必要性、期限和退出条件就只实现当前契约。 |
40
41
 
@@ -42,7 +43,7 @@ description: >
42
43
 
43
44
  在加载 workflow / skill / rules 指令之后、做任何任务状态判断或用户可见结论之前,必须先执行状态核对。指令类文件读取不算对外动作或结论。
44
45
 
45
- 运行以下命令,并把原文粘贴到回复正文和本轮产物的 `## 状态核对` 段:
46
+ 运行以下命令,并把原文粘贴到本轮产物的 `## 状态核对` 段:
46
47
 
47
48
  ```bash
48
49
  agent-infra-internal task-snapshot {task-id} --format text
@@ -52,7 +53,7 @@ agent-infra-internal task-snapshot {task-id} --format text
52
53
 
53
54
  ## 任务上下文解析
54
55
 
55
- > 入口允许省略 task ref,也接受旧位置 task ref 或 `--task <ref>` / `-t <ref>`。先从完整参数中分离 task scope 并原样保留其他业务操作数,再调用 `agent-infra-internal task-context resolve {task-scope}`;`{task-scope}` 为空、位置 ref 或 task flag 之一。只读取结构化结果的 `taskId`,后续把 `{task-id}` 绑定为该完整 `TASK-YYYYMMDD-HHMMSS`。解析失败时透传非零退出码,不自行扫描任务。
56
+ > 入口可省略 task ref;显式 task scope 仅接受 `--task <ref>` 或 `-t <ref>`,不再解释位置 task ref。保留其余业务操作数后调用 `agent-infra-internal task-context resolve {task-scope}`;`{task-scope}` 为空或 task flag 之一。只读取结构化结果的 `taskId`,后续把 `{task-id}` 绑定为完整 `TASK-YYYYMMDD-HHMMSS`。解析失败时透传非零退出码,不自行扫描任务。
56
57
 
57
58
  > 解析任务引用,并确认任务位于本技能支持的状态或目录且存在 `task.md`;无法定位时按未找到任务处理并停止。
58
59
 
@@ -141,6 +142,8 @@ echo "$result"
141
142
 
142
143
  如果测试失败,先尝试修复并重新运行测试。只有在确认存在外部阻塞、环境缺失或需求不明确且超出任务范围时,才可以停止。
143
144
 
145
+ 测试通过后,通过 `agent-infra-internal git-workflow commit --input {checkpoint-input}` 调用共享 commit core,输入 `delivery: { "mode": "local" }`、明确 paths、expected HEAD/tree、task ref、agent 和 code round。该调用只创建本地 checkpoint,不访问远端;core 会在 commit 前写入 durable intent,并在 task writer 成功后清理 intent。checkpoint 失败或 task 状态未闭合时,不得发送 `code.completed`。
146
+
144
147
  排查测试失败或行为不符合预期时,先读取 `.agents/rules/debugging-guide.md`,按其四阶段流程定位根因,禁止盲目改代码重试。
145
148
 
146
149
  ### 9. 编写实现报告
@@ -197,7 +200,7 @@ agent-infra-internal task-verify {task-id} code.completed --artifact {code-artif
197
200
 
198
201
  ## 停止
199
202
 
200
- 完成检查清单后立即停止。不要自动提交。
203
+ 完成检查清单后立即停止。不要在本技能中推送远端、创建 PR 或调用 `commit` 技能。
201
204
 
202
205
  ## 注意事项
203
206
 
@@ -7,21 +7,21 @@ description: >
7
7
 
8
8
  # Commit code
9
9
 
10
- Use the standard agent token from `.agents/rules/task-management.md`.
10
+ > See the collaborator token convention in `.agents/rules/task-management.md` for valid `--agent` values.
11
11
 
12
- Create a Git commit without overwriting local work, and update the associated task only when a task context exists.
12
+ Create a Git commit without overwriting local work, and update the associated task state when needed.
13
13
 
14
14
  The commit core returns one primary result: `committed`, `no_op`, `committed_with_warnings`, `failed`, or `blocked`, with structured `warnings`. A push failure or protected-branch policy never rolls back a local commit.
15
15
 
16
16
  ## Task context
17
17
 
18
- Resolve the optional task scope with `agent-infra-internal task-context resolve {task-scope}`.
18
+ The entry point may omit the task ref; explicit task scope accepts only `--task <ref>` or `-t <ref>`, and positional task refs are not interpreted. First call `agent-infra-internal task-context resolve {task-scope}`.
19
19
 
20
20
  - An explicit task-resolution failure stops the operation.
21
21
  - Without an explicit task scope, only `TASK_CONTEXT_NOT_FOUND` may enter taskless direct mode; detached HEAD, malformed candidates, and multiple matches fail closed.
22
- - If the literal `--orchestrated` is present in the business operands, use `mode=orchestrated`; otherwise use `mode=direct`. Never infer the mode from files or environment.
22
+ - If the literal `--orchestrated` is present in the business operands, fail with `ORCHESTRATED_COMMIT_REMOVED` because the standalone commit stage has been removed; otherwise use `mode=direct`. Never infer the mode from files or environment.
23
23
  - Taskless direct mode does not read, create, or complete task intent, receipt, checkpoint, or task.md records.
24
- - Task-bound direct mode does not require a delegation receipt; orchestrated mode must validate the matching activated commit receipt and capability in the core.
24
+ - Task-bound direct mode does not require a delegation receipt; `code-task` calls the shared core for local checkpoints, while standalone `commit` continues to use push delivery.
25
25
  - After resolution, use only the core-returned `taskId`; never infer task identity from the environment, branch, or filename.
26
26
 
27
27
  ## 1. Inspect local changes
@@ -33,7 +33,7 @@ git status --short
33
33
  git diff
34
34
  ```
35
35
 
36
- Respect existing user changes and stop on a conflict according to the no-mid-flow-questions rule.
36
+ Respect existing user changes. If the planned work conflicts with them, stop and record the blocking reason according to the no-mid-flow-questions rule.
37
37
 
38
38
  ## 2. Update copyright years
39
39
 
@@ -47,13 +47,31 @@ Review status, diff, and recent history. Use an imperative Conventional Commit m
47
47
 
48
48
  Read `reference/commit-orchestration.md` before this step.
49
49
 
50
- Write the message, explicit paths, expected HEAD/tree, task scope, agent, mode, and optional push policy to a temporary JSON file, then call:
50
+ Write the message, explicit paths, expected HEAD/tree, task scope, agent, mode, and required push policy to a temporary JSON file, then call:
51
51
 
52
52
  ```bash
53
53
  agent-infra-internal git-workflow commit --input {commit-operation.json}
54
54
  ```
55
55
 
56
- Taskless direct mode omits `taskRef`; orchestrated mode must pass `taskRef`, `agent`, and `mode: "orchestrated"`. The core owns repository/worktree mutation locking, task locking when bound, path and sensitive-file checks, staged scope, HEAD/tree, branch/ref, commit, push, protected-branch policy, warnings, and idempotency.
56
+ Example:
57
+
58
+ ```json
59
+ {
60
+ "taskRef": "TASK-YYYYMMDD-HHMMSS",
61
+ "agent": "codex",
62
+ "mode": "direct",
63
+ "paths": ["lib/example.ts", "tests/example.test.ts"],
64
+ "message": "fix(core): validate example input",
65
+ "expectedHead": "{HEAD}",
66
+ "expectedTree": "{TREE}",
67
+ "push": {
68
+ "remote": "origin",
69
+ "refs": ["refs/heads/{branch}"]
70
+ }
71
+ }
72
+ ```
73
+
74
+ Taskless direct mode omits `taskRef`; direct task-bound commits use push delivery. The core owns repository/worktree mutation locking, task locking when bound, path and sensitive-file checks, staged scope, HEAD/tree, branch/ref, commit, push, protected-branch policy, warnings, and idempotency.
57
75
 
58
76
  - Create at most one local commit for explicit changes.
59
77
  - If there are no changes but HEAD is ahead and delivery is requested, perform push-only and do not create an empty commit.
@@ -63,7 +81,9 @@ Taskless direct mode omits `taskRef`; orchestrated mode must pass `taskRef`, `ag
63
81
 
64
82
  ## 5. Finish task and platform synchronization
65
83
 
66
- Continue task synchronization only for task-bound operations. For an associated Issue or PR, follow the issue, PR-summary, and platform rules; the commit path passes `--result no_op` to summary-sync because it only synchronizes an existing PR identity. Synchronization failures are warnings and do not roll back the local commit.
84
+ Continue task synchronization from the core-returned task result for task-bound operations; taskless operations skip task verification and platform synchronization.
85
+
86
+ When the task has an associated Issue or PR, follow `reference/issue-metadata-sync.md`, `reference/pr-summary-sync.md`, and the platform rules. The commit path passes `--result no_op` to summary-sync because it only synchronizes an existing PR identity. Synchronization failures are warnings and do not roll back the local commit.
67
87
 
68
88
  After task-bound finalization, run:
69
89
 
@@ -76,7 +96,7 @@ Do not claim task finalization without fresh verification output.
76
96
 
77
97
  ## 6. Render the next step
78
98
 
79
- Read `.agents/rules/next-step-output.md` immediately before calling the single next-step helper. A failed push keeps the task active and reports diagnostics; a final commit routes to `create-pr` or `complete-task` according to `prFlow`.
99
+ Before rendering the next step, read `.agents/rules/next-step-output.md` and call the unified helper exactly once based on the latest task and PR state. A failed push keeps the task active and reports only diagnostics; a final commit routes to `create-pr` or `complete-task` according to `prFlow`.
80
100
 
81
101
  ## Notes
82
102
 
@@ -15,13 +15,13 @@ commit core 只返回一个主结果:`committed`、`no_op`、`committed_with_w
15
15
 
16
16
  ## 任务上下文
17
17
 
18
- 入口允许省略 task ref,也接受旧位置 task ref 或 `--task <ref>` / `-t <ref>`。先调用 `agent-infra-internal task-context resolve {task-scope}`。
18
+ 入口可省略 task ref;显式 task scope 仅接受 `--task <ref>` 或 `-t <ref>`,不再解释位置 task ref。先调用 `agent-infra-internal task-context resolve {task-scope}`。
19
19
 
20
20
  - 显式 task scope 解析失败时停止。
21
21
  - 未显式指定 task scope 时,只有 `TASK_CONTEXT_NOT_FOUND` 可进入 taskless direct;detached HEAD、损坏候选或多匹配必须 fail closed。
22
- - 入口业务操作数包含字面 `--orchestrated` 时使用 `mode=orchestrated`,否则使用 `mode=direct`;不得从 run 文件或环境推断模式。
22
+ - 入口业务操作数包含字面 `--orchestrated` 时直接失败并返回 `ORCHESTRATED_COMMIT_REMOVED`;普通入口使用 `mode=direct`,不得从 run 文件或环境推断模式。
23
23
  - taskless direct 不读取、创建或完成 task intent、receipt、checkpoint 或 task.md 收尾记录。
24
- - task-bound direct 不要求 delegation receipt;orchestrated 必须由 core 验证匹配的 activated commit receipt 和 capability。
24
+ - task-bound direct 不要求 delegation receipt;local checkpoint 由 `code-task` 直接调用共享 core,独立 `commit` 继续使用 push delivery。
25
25
  - 解析成功后只使用 core 返回的 `taskId`;不得从环境、分支或文件名猜测任务身份。
26
26
 
27
27
  ## 1. 检查本地修改
@@ -47,7 +47,7 @@ git diff
47
47
 
48
48
  执行本步骤前读取 `reference/commit-orchestration.md`。
49
49
 
50
- 将 message、明确 paths、expected HEAD/tree、task scope、agent、mode 和可选 push policy 写入临时 JSON,然后调用:
50
+ 将 message、明确 paths、expected HEAD/tree、task scope、agent、mode 和必填 push policy 写入临时 JSON,然后调用:
51
51
 
52
52
  ```bash
53
53
  agent-infra-internal git-workflow commit --input {commit-operation.json}
@@ -66,13 +66,12 @@ agent-infra-internal git-workflow commit --input {commit-operation.json}
66
66
  "expectedTree": "{TREE}",
67
67
  "push": {
68
68
  "remote": "origin",
69
- "refs": ["refs/heads/{branch}"],
70
- "automatic": true
69
+ "refs": ["refs/heads/{branch}"]
71
70
  }
72
71
  }
73
72
  ```
74
73
 
75
- taskless direct 省略 `taskRef`;orchestrated 必须显式传 `taskRef`、`agent` 和 `mode: "orchestrated"`。core 统一负责 repository/worktree mutation lock、task lock(仅 task-bound)、路径和敏感文件、staged scope、HEAD/tree、branch/ref、commit、push、保护分支、warning 和幂等校验。
74
+ taskless direct 省略 `taskRef`;direct task-bound commit 使用 push delivery。core 统一负责 repository/worktree mutation lock、task lock(仅 task-bound)、路径和敏感文件、staged scope、HEAD/tree、branch/ref、commit、push、保护分支、warning 和幂等校验。
76
75
 
77
76
  - 有明确修改时最多创建一个本地 commit。
78
77
  - 无修改但需要交付本地领先的 HEAD 时只执行 push-only,不创建空 commit。
@@ -18,7 +18,7 @@
18
18
  "expected_action_pattern": "Commit"
19
19
  },
20
20
  "platform-sync": {
21
- "when": "pr_number_exists",
21
+ "when": "pr_fact_bound",
22
22
  "expected_pr_comment_marker": "<!-- sync-pr:{task-id}:summary -->",
23
23
  "verify_in_labels_computed": true,
24
24
  "verify_pr_comment_last_commit_matches_head": true,
@@ -5,17 +5,17 @@ Commit, push, result mapping, and task finalization use one `commit-operation.ex
5
5
  ## Entry modes
6
6
 
7
7
  - `mode=direct`: explicit user invocation is the authorization. Task-bound direct may read task facts but does not require a delegation receipt; taskless direct is allowed only for `TASK_CONTEXT_NOT_FOUND` and skips task facts, review, task lock, checkpoint, and task.md finalization.
8
- - `mode=orchestrated`: an explicit task is required. Before the first Git write, the core validates the matching activated commit receipt, agent, stage, round, artifact, role, and unconsumed capability. Missing evidence returns `blocked` without writing Git.
8
+ - `mode=orchestrated` is removed: standalone commit is no longer a lifecycle delegation stage. This mode returns `ORCHESTRATED_COMMIT_REMOVED` without writing Git; the code stage closes through a local checkpoint.
9
9
 
10
10
  ## Shared order
11
11
 
12
12
  1. Acquire the repository/worktree mutation lock; task-bound execution also acquires the task lock.
13
13
  2. Validate the repository, current branch, explicit paths, sensitive paths, staged scope, expected HEAD/tree, remote, and full heads ref.
14
- 3. Validate the authorization for the selected mode.
14
+ 3. Validate direct-mode authorization.
15
15
  4. Create at most one local commit; with no changes, allow push-only and never create an empty commit.
16
16
  5. Return `COMMIT_AUTOPUSH_PROTECTED_BRANCH` on protected automatic push, or `COMMIT_PUSH_FAILED` on ordinary push failure, while retaining local facts.
17
17
  6. Return one primary result: `committed`, `no_op`, `committed_with_warnings`, `failed`, or `blocked`.
18
18
 
19
19
  ## Retry boundary
20
20
 
21
- Retries reread current HEAD, worktree, branch, and remote facts. A local commit that already exists is push-only and cannot produce a second commit. Taskless retries create no task record. Orchestration owns stage completion, sealing, and consumption of receipts; direct mode never fabricates them.
21
+ Retries reread current HEAD, worktree, branch, and remote facts. A local commit that already exists is push-only and cannot produce a second commit. Taskless retries create no task record. Orchestration owns stage completion, sealing, and consumption of receipts; direct commits never fabricate them.
@@ -5,17 +5,17 @@ commit、push、结果映射和任务收尾使用同一个 `commit-operation.exe
5
5
  ## 入口模式
6
6
 
7
7
  - `mode=direct`:用户显式调用授权。task-bound direct 可读取 task facts,但不要求 delegation receipt;taskless direct 只在 `TASK_CONTEXT_NOT_FOUND` 时允许,并跳过 task facts、review、task lock、checkpoint 和 task.md 收尾。
8
- - `mode=orchestrated`:必须绑定明确 task,且 core 在第一个 Git 写入前验证匹配的 activated commit receipt、agent、stage、round、artifact、role 和未消费 capability。缺少任一项都返回 `blocked`,不写 Git。
8
+ - `mode=orchestrated` 已移除:独立 commit 不再是生命周期 delegation stage;调用该模式返回 `ORCHESTRATED_COMMIT_REMOVED`,不写 Git。生命周期 code 阶段完成后由 local checkpoint 直接收口。
9
9
 
10
10
  ## 共享执行顺序
11
11
 
12
12
  1. 获取 repository/worktree mutation lock;task-bound 额外获取 task lock。
13
13
  2. 验证 repository、当前 branch、明确 paths、敏感路径、staged scope、expected HEAD/tree、remote 和 full heads ref。
14
- 3. 完成模式对应的授权校验。
14
+ 3. 完成 direct 模式授权校验。
15
15
  4. 最多创建一个本地 commit;无修改时只允许 push-only,不创建空 commit。
16
16
  5. `main` / `master` 自动 push 返回 `COMMIT_AUTOPUSH_PROTECTED_BRANCH` warning;普通 push 失败返回 `COMMIT_PUSH_FAILED` warning,并保留本地事实。
17
17
  6. 返回唯一主结果:`committed`、`no_op`、`committed_with_warnings`、`failed` 或 `blocked`。
18
18
 
19
19
  ## 重试边界
20
20
 
21
- 重跑重新读取当前 HEAD、worktree、branch 和 remote 事实。已有本地 commit 时只补 push,不创建第二个 commit;taskless 重跑不创建任何任务记录。orchestrated receipt 的 stage completion、seal 和 consume 由 orchestration core 负责,不由 direct 路径伪造。
21
+ 重跑重新读取当前 HEAD、worktree、branch 和 remote 事实。已有本地 commit 时只补 push,不创建第二个 commit;taskless 重跑不创建任何任务记录。生命周期 receipt 的 stage completion、seal 和 consume 由 orchestration core 负责;direct commit 不伪造生命周期 receipt。
@@ -1,6 +1,6 @@
1
1
  # Commit-stage PR Summary Synchronization
2
2
 
3
- Run only when `{task-id}` is valid and task.md has a valid `pr_number`.
3
+ Run only when `{task-id}` is valid and task.md has a `bound/verified` `pr_delivery_fact`.
4
4
 
5
5
  1. Run `agent-infra-internal platform-pr summary-context {task-id}`.
6
6
  2. Generate the plain summary body per `.agents/rules/pr-sync.md` and write it to a temporary file.
@@ -1,6 +1,6 @@
1
1
  # Commit 阶段 PR 摘要同步
2
2
 
3
- 仅当 `{task-id}` 有效且 `task.md` 存在有效 `pr_number` 时执行;否则跳过。
3
+ 仅当 `{task-id}` 有效且 `task.md` 存在 `bound/verified` 的 `pr_delivery_fact` 时执行;否则跳过。
4
4
 
5
5
  1. 调用 `agent-infra-internal platform-pr summary-context {task-id}` 获取 canonical 聚合输入。
6
6
  2. 按 `.agents/rules/pr-sync.md` 生成纯摘要正文并写入临时文件。
@@ -58,7 +58,7 @@ Prerequisites:
58
58
  - [ ] all code committed
59
59
  - [ ] all tests passed
60
60
  - [ ] code review approved
61
- - [ ] all workflow steps completed (for the `pr_tasks` list under each yaml `commit` step, decide whether to count them by the "PR path" rule: `prFlow=required` always counts; `prFlow=disabled` never counts; when absent, exclude only if `pr_status=skipped`, otherwise count)
61
+ - [ ] all workflow steps completed (for the `pr_tasks` list under each yaml `commit` step, decide whether to count them by the "PR path" rule: `prFlow=required` always counts; `prFlow=disabled` never counts; when absent, exclude only if `pr_delivery_fact.state=skipped`, otherwise count)
62
62
 
63
63
  Required next-step commands (rendered by `prFlow`):
64
64
 
@@ -115,4 +115,4 @@ Next step - code review:
115
115
  {next-step-commands}
116
116
  ```
117
117
 
118
- > Note: beyond the cases above, if `task.md` contains a valid `pr_number`, the commit skill must sync the PR summary via `reference/pr-summary-sync.md` before entering the verification gate.
118
+ > Note: beyond the cases above, if a verified bound `pr_delivery_fact` exists in `task.md`, the commit skill must sync the PR summary via `reference/pr-summary-sync.md` before entering the verification gate.
@@ -58,7 +58,7 @@ push 失败时保留任务 active 与本地 HEAD,只展示诊断和人工推
58
58
  - [ ] 所有代码都已提交
59
59
  - [ ] 所有测试通过
60
60
  - [ ] 代码审查已通过
61
- - [ ] 所有工作流步骤已完成(对 yaml `commit` 步骤的 `pr_tasks` 列表,按「走 PR 路径」判定是否计入:`prFlow=required` 始终计入;`prFlow=disabled` 不计入;缺省下仅当 `pr_status=skipped` 时不计入,否则计入)
61
+ - [ ] 所有工作流步骤已完成(对 yaml `commit` 步骤的 `pr_tasks` 列表,按「走 PR 路径」判定是否计入:`prFlow=required` 始终计入;`prFlow=disabled` 不计入;缺省下仅当 `pr_delivery_fact.state=skipped` 时不计入,否则计入)
62
62
 
63
63
  必带下一步命令(按 `prFlow` 渲染):
64
64
 
@@ -115,4 +115,4 @@ push 失败时保留任务 active 与本地 HEAD,只展示诊断和人工推
115
115
  {next-step-commands}
116
116
  ```
117
117
 
118
- > 注意:上述场景之外,只要 `task.md` 中存在有效 `pr_number`,commit 技能必须先按 `reference/pr-summary-sync.md` 同步 PR 摘要,再进入完成校验。
118
+ > 注意:上述场景之外,只要 `task.md` 中存在 verified `pr_delivery_fact`,commit 技能必须先按 `reference/pr-summary-sync.md` 同步 PR 摘要,再进入完成校验。
@@ -7,7 +7,7 @@ description: >
7
7
  ---
8
8
 
9
9
  # Complete Manual Validation
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.
10
+ > `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
11
11
 
12
12
 
13
13
  ## Boundary / Critical Rules
@@ -15,6 +15,7 @@ description: >
15
15
  - This skill closes the manual-validation status in an existing PR summary comment; it does not create a parallel ordinary validation comment.
16
16
  - It must write `manual-validation.md` or `manual-validation-r{N}.md` so later PR summary refreshes can reuse the validation result.
17
17
  - If the `sync-pr` summary comment is missing, fail instead of creating a partial fallback summary.
18
+ - Before generating manual-validation artifact Markdown that will be synced to an Issue, read `.agents/rules/sync-content-generation.md` and follow its generator-side constraints; Issue sync remains transparent and does not parse or rewrite the body.
18
19
  - After this skill runs, update `task.md` immediately.
19
20
 
20
21
  Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
@@ -23,7 +24,7 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
23
24
 
24
25
  After loading workflow / skill / rules instructions, and before any task-state judgment or user-visible conclusion, run the state check first. Reading instruction files does not count as an external-state action or conclusion.
25
26
 
26
- Run these commands and paste the raw output into both the user-facing reply and this round's `## State Check` section:
27
+ Run these commands and paste the raw output into this round's `## State Check` section:
27
28
 
28
29
  ```bash
29
30
  agent-infra-internal task-snapshot {task-id} --format text
@@ -31,7 +32,7 @@ agent-infra-internal task-snapshot {task-id} --format text
31
32
 
32
33
  ## Task Context Resolution
33
34
 
34
- > The entry point may omit the task ref and also accepts a legacy positional ref or `--task <ref>` / `-t <ref>`. Separate task scope from the full arguments while preserving every business operand, then call `agent-infra-internal task-context resolve {task-scope}` where `{task-scope}` is empty, one positional ref, or one task flag. Read only `taskId` from the structured result and bind `{task-id}` to that full `TASK-YYYYMMDD-HHMMSS` for downstream commands. Pass through resolution failures without scanning tasks locally.
35
+ > The entry point may omit the task ref; explicit task scope accepts only `--task <ref>` or `-t <ref>`, and positional task refs are not interpreted. Preserve every other business operand, then call `agent-infra-internal task-context resolve {task-scope}` where `{task-scope}` is empty or one task flag. Read only `taskId` from the structured result and bind `{task-id}` to the full `TASK-YYYYMMDD-HHMMSS` for downstream commands. Pass through resolution failures without scanning tasks locally.
35
36
 
36
37
  > Resolve the task reference, then confirm that the task is in a state or directory supported by this skill and that `task.md` exists; if it cannot be located, handle it as a missing task and stop.
37
38
 
@@ -46,10 +47,10 @@ After resolving the artifact context and before this round's first artifact acti
46
47
  Input:
47
48
 
48
49
  ```text
49
- complete-manual-validation {task-ref} [{pr-ref}] {verification-summary}
50
+ complete-manual-validation [--task <ref> | -t <ref>] [{pr-ref}] {verification-summary}
50
51
  ```
51
52
 
52
- - `{task-ref}` is required.
53
+ - The task scope may be omitted; explicit scope accepts only `--task <ref>` or `-t <ref>`.
53
54
  - `{pr-ref}` is optional and accepts `#NN`, `NN`, or a full PR URL.
54
55
  - `{verification-summary}` is required. If it is missing, stop and ask for a validation summary; do not write an artifact or update the PR.
55
56
 
@@ -57,7 +58,7 @@ complete-manual-validation {task-ref} [{pr-ref}] {verification-summary}
57
58
 
58
59
  Check:
59
60
  - `.agents/workspace/active/{task-id}/task.md`
60
- - a valid PR: prefer explicit `{pr-ref}`, otherwise read `pr_number` from task.md frontmatter
61
+ - a valid PR: prefer explicit `{pr-ref}`, otherwise read verified `pr_delivery_fact.identity.number` from task.md frontmatter
61
62
 
62
63
  Stop if the task is missing, the validation summary is missing, or no valid PR can be resolved.
63
64
 
@@ -7,7 +7,7 @@ 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`。
10
+ > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
11
11
 
12
12
 
13
13
  ## 行为边界 / 关键规则
@@ -15,6 +15,7 @@ description: >
15
15
  - 本技能用于收尾已有 PR 摘要评论中的人工校验状态,不创建并行的普通验证留言。
16
16
  - 必须写入 `manual-validation.md` 或 `manual-validation-r{N}.md`,让后续 PR 摘要刷新可复用人工验证结果。
17
17
  - 找不到 `sync-pr` 摘要评论时失败,不创建部分摘要兜底。
18
+ - 生成会同步到 Issue 的人工验证 artifact Markdown 前,先读取 `.agents/rules/sync-content-generation.md` 并遵循其中的生成端约束;Issue 同步保持透明,不解析或改写正文。
18
19
  - 执行本技能后必须立即更新 `task.md`。
19
20
 
20
21
  版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
@@ -23,7 +24,7 @@ description: >
23
24
 
24
25
  在加载 workflow / skill / rules 指令之后、做任何任务状态判断或用户可见结论之前,必须先执行状态核对。指令类文件读取不算对外动作或结论。
25
26
 
26
- 运行以下命令,并把原文粘贴到回复正文和本轮产物的 `## 状态核对` 段:
27
+ 运行以下命令,并把原文粘贴到本轮产物的 `## 状态核对` 段:
27
28
 
28
29
  ```bash
29
30
  agent-infra-internal task-snapshot {task-id} --format text
@@ -31,7 +32,7 @@ agent-infra-internal task-snapshot {task-id} --format text
31
32
 
32
33
  ## 任务上下文解析
33
34
 
34
- > 入口允许省略 task ref,也接受旧位置 task ref 或 `--task <ref>` / `-t <ref>`。先从完整参数中分离 task scope 并原样保留其他业务操作数,再调用 `agent-infra-internal task-context resolve {task-scope}`;`{task-scope}` 为空、位置 ref 或 task flag 之一。只读取结构化结果的 `taskId`,后续把 `{task-id}` 绑定为该完整 `TASK-YYYYMMDD-HHMMSS`。解析失败时透传非零退出码,不自行扫描任务。
35
+ > 入口可省略 task ref;显式 task scope 仅接受 `--task <ref>` 或 `-t <ref>`,不再解释位置 task ref。保留其余业务操作数后调用 `agent-infra-internal task-context resolve {task-scope}`;`{task-scope}` 为空或 task flag 之一。只读取结构化结果的 `taskId`,后续把 `{task-id}` 绑定为完整 `TASK-YYYYMMDD-HHMMSS`。解析失败时透传非零退出码,不自行扫描任务。
35
36
 
36
37
  > 解析任务引用,并确认任务位于本技能支持的状态或目录且存在 `task.md`;无法定位时按未找到任务处理并停止。
37
38
 
@@ -46,10 +47,10 @@ agent-infra-internal task-snapshot {task-id} --format text
46
47
  输入格式:
47
48
 
48
49
  ```text
49
- complete-manual-validation {task-ref} [{pr-ref}] {verification-summary}
50
+ complete-manual-validation [--task <ref> | -t <ref>] [{pr-ref}] {verification-summary}
50
51
  ```
51
52
 
52
- - `{task-ref}` 必填。
53
+ - task scope 可省略;显式 scope 只接受 `--task <ref>` 或 `-t <ref>`。
53
54
  - `{pr-ref}` 可选,支持 `#NN`、`NN` 或完整 PR URL。
54
55
  - `{verification-summary}` 必填。若缺失,立即停止并提示补充验证说明;不写产物、不更新 PR。
55
56
 
@@ -57,7 +58,7 @@ complete-manual-validation {task-ref} [{pr-ref}] {verification-summary}
57
58
 
58
59
  检查:
59
60
  - `.agents/workspace/active/{task-id}/task.md`
60
- - 有效 PR:优先使用显式 `{pr-ref}`,否则读取 task.md frontmatter 的 `pr_number`
61
+ - 有效 PR:优先使用显式 `{pr-ref}`,否则读取 task.md frontmatter 的 verified `pr_delivery_fact.identity.number`
61
62
 
62
63
  如果任务不存在、验证说明缺失,或无法解析有效 PR,立即停止。
63
64
 
@@ -34,7 +34,7 @@
34
34
  "stage_scope": ["analysis", "plan", "code"]
35
35
  },
36
36
  "platform-sync": {
37
- "when": "pr_number_exists",
37
+ "when": "pr_fact_bound",
38
38
  "expected_pr_comment_marker_key": "prSummary",
39
39
  "expected_pr_comment_required_patterns": [
40
40
  "^### ✅ Manual Validation Passed$"
@@ -34,7 +34,7 @@
34
34
  "stage_scope": ["analysis", "plan", "code"]
35
35
  },
36
36
  "platform-sync": {
37
- "when": "pr_number_exists",
37
+ "when": "pr_fact_bound",
38
38
  "expected_pr_comment_marker_key": "prSummary",
39
39
  "expected_pr_comment_required_patterns": [
40
40
  "^### ✅ 人工验证已通过$"
@@ -1,6 +1,6 @@
1
1
  # Manual-validation PR Summary Update
2
2
 
3
- Run only for a valid `{task-id}` whose task.md binds a `pr_number`; any user-supplied PR identity must match it.
3
+ Run only for a valid `{task-id}` whose task.md binds a verified `pr_delivery_fact`; any user-supplied PR identity must match it.
4
4
 
5
5
  Follow `.agents/rules/pr-sync.md` for the shared summary structure and failure semantics.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # PR 摘要人工验证更新
2
2
 
3
- 人工验证产物结构见 `reference/report-template.md`。本步骤只在有效 `{task-id}` 且 task.md 已绑定 `pr_number` 时执行;用户另传 PR 身份时必须与绑定值一致。
3
+ 人工验证产物结构见 `reference/report-template.md`。本步骤只在有效 `{task-id}` 且 task.md 已绑定 verified `pr_delivery_fact` 时执行;用户另传 PR 身份时必须与 fact identity 一致。
4
4
 
5
5
  摘要结构与失败语义统一遵循 `.agents/rules/pr-sync.md`。
6
6
 
@@ -7,7 +7,7 @@ description: >
7
7
  ---
8
8
 
9
9
  # Complete Task
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.
10
+ > `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
11
11
 
12
12
  Host finalization uses receipt v2 with an immutable `receiptId`, monotonic `revision`, and canonical warnings. Lifecycle/identity/required-PR hard failures return `result: failed|blocked`; after lifecycle succeeds, comment, peripheral verification, and other sync failures return `result: completed_with_warnings` and six-field warnings, retrying only receipt-pending steps.
13
13
 
@@ -24,7 +24,7 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
24
24
 
25
25
  After loading workflow / skill / rules instructions, and before any task-state judgment or user-visible conclusion, run the state check first. Reading instruction files does not count as an external-state action or conclusion.
26
26
 
27
- Run these commands and paste the raw output into both the user-facing reply and this round's `## State Check` section:
27
+ Run these commands and paste the raw output into this round's `## State Check` section:
28
28
 
29
29
  ```bash
30
30
  agent-infra-internal task-snapshot {task-id} --format text
@@ -34,7 +34,7 @@ Before the state check is complete, do not make external-state assertions such a
34
34
 
35
35
  ## Task Context Resolution
36
36
 
37
- > The entry point may omit the task ref and also accepts a legacy positional ref or `--task <ref>` / `-t <ref>`. Separate task scope from the full arguments while preserving every business operand, then call `agent-infra-internal task-context resolve {task-scope}` where `{task-scope}` is empty, one positional ref, or one task flag. Read only `taskId` from the structured result and bind `{task-id}` to that full `TASK-YYYYMMDD-HHMMSS` for downstream commands. Pass through resolution failures without scanning tasks locally.
37
+ > The entry point may omit the task ref; explicit task scope accepts only `--task <ref>` or `-t <ref>`, and positional task refs are not interpreted. Preserve every other business operand, then call `agent-infra-internal task-context resolve {task-scope}` where `{task-scope}` is empty or one task flag. Read only `taskId` from the structured result and bind `{task-id}` to the full `TASK-YYYYMMDD-HHMMSS` for downstream commands. Pass through resolution failures without scanning tasks locally.
38
38
 
39
39
  > Resolve the task reference, then confirm that the task is in a state or directory supported by this skill and that `task.md` exists; if it cannot be located, handle it as a missing task and stop.
40
40
 
@@ -66,27 +66,27 @@ agent-infra-internal platform-pr resolve-external {task-id} --agent {standard-ag
66
66
  ```
67
67
 
68
68
  - `mode=external`: only this invocation's typed `authorization` and `selected` fields authorize and identify external delivery; continue through the required-PR, local lifecycle, and terminal checks, while peripheral evidence failures become warnings after lifecycle.
69
- - `mode=normal`: use the existing local lifecycle prerequisites; historical `pr_number` / `pr_status` values do not authorize external delivery.
69
+ - `mode=normal`: use the existing local lifecycle prerequisites; historical legacy PR fields do not authorize external delivery.
70
70
  - `status=failed|blocked`: stop immediately and show the stable error; `--force` cannot bypass it.
71
71
 
72
- **Gate read (project-level PR flow policy)**: Before running this step, read `.agents/.airc.json`'s `prFlow` field (three states: field absent = recommend PR by default, skipping allowed; `"required"` = PR mandatory; `"disabled"` = no PR flow), and `pr_status` from `task.md` frontmatter (`pending` / `created` / `skipped`).
72
+ **Gate read (project-level PR flow policy)**: Before running this step, read `.agents/.airc.json`'s `prFlow` field (three states: field absent = recommend PR by default, skipping allowed; `"required"` = PR mandatory; `"disabled"` = no PR flow), and `pr_delivery_fact` from `task.md` frontmatter (`unbound` / `bound` / `skipped`).
73
73
 
74
- **PR dimension decision (evaluate the `prFlow` strong constraint FIRST, then `pr_status`)**:
74
+ **PR dimension decision (evaluate the `prFlow` strong constraint FIRST, then `pr_delivery_fact.state`)**:
75
75
 
76
- | `prFlow` | `pr_status` | Decision |
76
+ | `prFlow` | `pr_delivery_fact.state` | Decision |
77
77
  |---|---|---|
78
78
  | `disabled` | any | No PR path -> PR dimension satisfied, continue with the other prerequisites |
79
- | `required` | `created` | PR dimension satisfied, continue |
80
- | `required` | `pending` / `skipped` | **Stop**: under a mandatory PR flow you must run `/create-pr` first; `--skip-pr` is NOT accepted (including a pre-existing / manually-set `skipped`) |
81
- | absent | `created` / `skipped` | PR dimension satisfied, continue |
82
- | absent | `pending` | **Stop by default** and print the two-option guidance below; unless the user passes `--skip-pr` (writes `pr_status: skipped`, then continues) or `--force` |
79
+ | `required` | `bound` | PR dimension satisfied, continue |
80
+ | `required` | `unbound` / `skipped` | **Stop**: under a mandatory PR flow you must run `/create-pr` first; `--skip-pr` is NOT accepted (including a pre-existing / manually-set `skipped`) |
81
+ | absent | `bound` / `skipped` | PR dimension satisfied, continue |
82
+ | absent | `unbound` | **Stop by default** and print the two-option guidance below; unless the user passes `--skip-pr` (writes `pr_delivery_fact.state=skipped` through the current `platform-pr skip` writer, then continues) or `--force` |
83
83
 
84
- - `--skip-pr` handling: effective only when `prFlow` is not `required` -> set `pr_status` to `skipped` in `task.md`, then continue; when `prFlow=required`, ignore `--skip-pr` and stop per the table.
84
+ - `--skip-pr` handling: effective only when `prFlow` is not `required` -> write `pr_delivery_fact.state=skipped` through the current `platform-pr skip` writer, then continue; when `prFlow=required`, ignore `--skip-pr` and stop per the table.
85
85
  - Note: `--force` may override the other prerequisites below, but does **NOT** lift the `prFlow=required` PR constraint (the only exit from the strong constraint is creating a PR).
86
86
 
87
87
  Two-option guidance for absent + `pending`:
88
88
  ```
89
- Task {task-id} has no PR yet (pr_status: pending). Choose one:
89
+ Task {task-id} has no PR delivery decision yet (pr_delivery_fact: unbound). Choose one:
90
90
  - Go through the PR flow: /create-pr {task-ref}
91
91
  - Explicitly skip and complete: /complete-task {task-ref} --skip-pr
92
92
  ```
@@ -7,7 +7,7 @@ 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`。
10
+ > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
11
11
 
12
12
  宿主 finalization 使用 receipt v2(不可变 `receiptId`、单调 `revision` 和 canonical warnings)。生命周期/身份/required PR 等硬失败返回 `result: failed|blocked`;生命周期完成后,评论、外围验证和其他同步失败返回 `result: completed_with_warnings` 及六字段 warning,并仅重试 receipt 中的 pending step。
13
13
 
@@ -24,7 +24,7 @@ description: >
24
24
 
25
25
  在加载 workflow / skill / rules 指令之后、做任何任务状态判断或用户可见结论之前,必须先执行状态核对。指令类文件读取不算对外动作或结论。
26
26
 
27
- 运行以下命令,并把原文粘贴到回复正文和本轮产物的 `## 状态核对` 段:
27
+ 运行以下命令,并把原文粘贴到本轮产物的 `## 状态核对` 段:
28
28
 
29
29
  ```bash
30
30
  agent-infra-internal task-snapshot {task-id} --format text
@@ -34,7 +34,7 @@ agent-infra-internal task-snapshot {task-id} --format text
34
34
 
35
35
  ## 任务上下文解析
36
36
 
37
- > 入口允许省略 task ref,也接受旧位置 task ref 或 `--task <ref>` / `-t <ref>`。先从完整参数中分离 task scope 并原样保留其他业务操作数,再调用 `agent-infra-internal task-context resolve {task-scope}`;`{task-scope}` 为空、位置 ref 或 task flag 之一。只读取结构化结果的 `taskId`,后续把 `{task-id}` 绑定为该完整 `TASK-YYYYMMDD-HHMMSS`。解析失败时透传非零退出码,不自行扫描任务。
37
+ > 入口可省略 task ref;显式 task scope 仅接受 `--task <ref>` 或 `-t <ref>`,不再解释位置 task ref。保留其余业务操作数后调用 `agent-infra-internal task-context resolve {task-scope}`;`{task-scope}` 为空或 task flag 之一。只读取结构化结果的 `taskId`,后续把 `{task-id}` 绑定为完整 `TASK-YYYYMMDD-HHMMSS`。解析失败时透传非零退出码,不自行扫描任务。
38
38
 
39
39
  > 解析任务引用,并确认任务位于本技能支持的状态或目录且存在 `task.md`;无法定位时按未找到任务处理并停止。
40
40
 
@@ -65,27 +65,27 @@ agent-infra-internal platform-pr resolve-external {task-id} --agent {standard-ag
65
65
  ```
66
66
 
67
67
  - `mode=external`:只以本次 typed result 的 `authorization` 和 `selected` 作为外部交付授权与绑定身份,继续 required-PR、本地生命周期和终态校验;外围证据失败在 lifecycle 后记录为 warning。
68
- - `mode=normal`:走现有本地生命周期前置条件;历史 `pr_number` / `pr_status` 不构成外部授权。
68
+ - `mode=normal`:走现有本地生命周期前置条件;历史 PR 字段不构成外部授权。
69
69
  - `status=failed|blocked`:立即停止并展示稳定错误;`--force` 不得绕过。
70
70
 
71
- **门控读取(项目级 PR 流程策略)**:在执行本步骤前,读取 `.agents/.airc.json` 的 `prFlow` 字段(三态:字段缺省 = 默认推荐 PR、允许跳过;`"required"` = 强制 PR;`"disabled"` = 强制无 PR),以及 `task.md` frontmatter 的 `pr_status`(`pending` / `created` / `skipped`)。
71
+ **门控读取(项目级 PR 流程策略)**:在执行本步骤前,读取 `.agents/.airc.json` 的 `prFlow` 字段(三态:字段缺省 = 默认推荐 PR、允许跳过;`"required"` = 强制 PR;`"disabled"` = 强制无 PR),以及 `task.md` frontmatter 的 `pr_delivery_fact`(`unbound` / `bound` / `skipped`)。
72
72
 
73
- **PR 维度判定(先判 `prFlow` 强约束,后看 `pr_status`)**:
73
+ **PR 维度判定(先判 `prFlow` 强约束,后看 `pr_delivery_fact.state`)**:
74
74
 
75
- | `prFlow` | `pr_status` | 判定 |
75
+ | `prFlow` | `pr_delivery_fact.state` | 判定 |
76
76
  |---|---|---|
77
77
  | `disabled` | 任意 | 无 PR 路径 → PR 维度满足,继续其余前置条件 |
78
- | `required` | `created` | PR 维度满足,继续 |
79
- | `required` | `pending` / `skipped` | **停止**:强制 PR 下必须先 `/create-pr`;`--skip-pr` 不被接受(含既有/手动写入的 `skipped`) |
80
- | 缺省 | `created` / `skipped` | PR 维度满足,继续 |
81
- | 缺省 | `pending` | **默认停止**并输出下方二选一引导;除非用户提供 `--skip-pr`(写 `pr_status: skipped` 后继续)或 `--force` |
78
+ | `required` | `bound` | PR 维度满足,继续 |
79
+ | `required` | `unbound` / `skipped` | **停止**:强制 PR 下必须先 `/create-pr`;`--skip-pr` 不被接受(含既有/手动写入的 `skipped`) |
80
+ | 缺省 | `bound` / `skipped` | PR 维度满足,继续 |
81
+ | 缺省 | `unbound` | **默认停止**并输出下方二选一引导;除非用户提供 `--skip-pr`(通过当前 `platform-pr skip` 写入器写入 `pr_delivery_fact.state=skipped` 后继续)或 `--force` |
82
82
 
83
- - `--skip-pr` 处理:仅在 `prFlow` 非 `required` 时生效——把 `task.md` 的 `pr_status` 写为 `skipped` 后继续;`prFlow=required` 时忽略 `--skip-pr` 并按上表停止。
83
+ - `--skip-pr` 处理:仅在 `prFlow` 非 `required` 时生效——通过当前 `platform-pr skip` 写入器把 `task.md` 的 `pr_delivery_fact.state` 写为 `skipped` 后继续;`prFlow=required` 时忽略 `--skip-pr` 并按上表停止。
84
84
  - 注:`--force` 可越过下方其余前置条件,但**不解除 `prFlow=required` 的 PR 强约束**(强约束的唯一出口是创建 PR)。
85
85
 
86
86
  缺省 + `pending` 的二选一引导消息:
87
87
  ```
88
- 任务 {task-id} 尚未创建 PR(pr_status: pending)。请二选一:
88
+ 任务 {task-id} 尚未决定 PR 交付(pr_delivery_fact: unbound)。请二选一:
89
89
  - 走 PR 流程:/create-pr {task-ref}
90
90
  - 显式跳过并完成:/complete-task {task-ref} --skip-pr
91
91
  ```