@fitlab-ai/agent-infra 0.9.13 → 0.9.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (428) hide show
  1. package/README.md +10 -0
  2. package/README.zh-CN.md +10 -0
  3. package/bin/cli.ts +26 -9
  4. package/bin/internal-cli.sh +45 -0
  5. package/dist/bin/cli.js +173 -157
  6. package/dist/bin/internal-cli.js +126 -42
  7. package/dist/lib/agent-client.js +5 -0
  8. package/dist/lib/agent-clients/adapters/codex-lifecycle/capability-store.js +165 -27
  9. package/dist/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.js +3 -2
  10. package/dist/lib/defaults.json +103 -103
  11. package/dist/lib/fs/durable-write.js +37 -0
  12. package/dist/lib/fs/file-lock.js +111 -0
  13. package/dist/lib/host-control/audit.js +19 -0
  14. package/dist/lib/host-control/client.js +142 -0
  15. package/dist/lib/host-control/command.js +49 -0
  16. package/dist/lib/host-control/path.js +160 -0
  17. package/dist/lib/host-control/secure-fs.js +140 -0
  18. package/dist/lib/host-control/server.js +159 -0
  19. package/dist/lib/host-control/service.js +112 -0
  20. package/dist/lib/init.js +11 -2
  21. package/dist/lib/internal/agent-client.js +5 -2
  22. package/dist/lib/internal/cli-route-inventory.js +154 -0
  23. package/dist/lib/internal/codex-lifecycle.js +15 -12
  24. package/dist/lib/internal/codex-sandbox-controller.js +8 -2
  25. package/dist/lib/internal/demo-promotion.js +322 -0
  26. package/dist/lib/internal/demo-transcript.js +454 -0
  27. package/dist/lib/internal/git-workflow.js +10 -6
  28. package/dist/lib/internal/host-control.js +28 -0
  29. package/dist/lib/internal/manual-validation.js +322 -0
  30. package/dist/lib/internal/platform-checks.js +16 -4
  31. package/dist/lib/internal/platform-comment.js +16 -4
  32. package/dist/lib/internal/platform-context.js +4 -1
  33. package/dist/lib/internal/platform-issue.js +12 -4
  34. package/dist/lib/internal/platform-metadata.js +88 -0
  35. package/dist/lib/internal/platform-pr-review.js +16 -3
  36. package/dist/lib/internal/platform-pr.js +42 -14
  37. package/dist/lib/internal/platform-release-notes.js +6 -3
  38. package/dist/lib/internal/platform-security.js +93 -0
  39. package/dist/lib/internal/pr-review-grade.js +14 -3
  40. package/dist/lib/internal/release-workflow.js +82 -89
  41. package/dist/lib/internal/sandbox-control.js +171 -7
  42. package/dist/lib/internal/task-activity.js +13 -4
  43. package/dist/lib/internal/task-artifact.js +19 -107
  44. package/dist/lib/internal/task-context.js +4 -1
  45. package/dist/lib/internal/task-create.js +48 -14
  46. package/dist/lib/internal/task-delivery.js +4 -1
  47. package/dist/lib/internal/task-event.js +38 -35
  48. package/dist/lib/internal/task-finalization.js +4 -1
  49. package/dist/lib/internal/task-invalidation.js +4 -1
  50. package/dist/lib/internal/task-ledger.js +12 -1
  51. package/dist/lib/internal/task-lifecycle.js +4 -1
  52. package/dist/lib/internal/task-operation-registry.js +519 -0
  53. package/dist/lib/internal/task-orchestration.js +12 -0
  54. package/dist/lib/internal/task-override.js +10 -3
  55. package/dist/lib/internal/task-qualification.js +90 -0
  56. package/dist/lib/internal/task-review.js +10 -52
  57. package/dist/lib/internal/task-short-id.js +11 -1
  58. package/dist/lib/internal/task-snapshot.js +4 -1
  59. package/dist/lib/internal/task-validate.js +37 -12
  60. package/dist/lib/internal/task-verify.js +5 -1
  61. package/dist/lib/internal/task-warning.js +8 -1
  62. package/dist/lib/owned-path.js +33 -0
  63. package/dist/lib/platform/check-status.js +11 -0
  64. package/dist/lib/platform/comment-safety.js +229 -0
  65. package/dist/lib/platform/completion-backfill.js +1 -1
  66. package/dist/lib/platform/github-data.js +241 -0
  67. package/dist/lib/platform/github-provider.js +248 -26
  68. package/dist/lib/platform/issue-comments.js +146 -34
  69. package/dist/lib/platform/issues.js +1 -179
  70. package/dist/lib/platform/pr-change-report.js +6 -12
  71. package/dist/lib/platform/pr-checks.js +12 -65
  72. package/dist/lib/platform/pr-summary.js +83 -10
  73. package/dist/lib/platform/provider-contract.d.ts +67 -1
  74. package/dist/lib/platform/provider-contract.js +6 -2
  75. package/dist/lib/platform/provider-validation.js +76 -3
  76. package/dist/lib/platform/pull-requests.js +117 -275
  77. package/dist/lib/platform/repository-metadata.js +377 -0
  78. package/dist/lib/platform/security-alerts.js +155 -0
  79. package/dist/lib/platform/snapshots.js +2 -0
  80. package/dist/lib/platform/verification-sync.js +154 -162
  81. package/dist/lib/process-data/index.js +7 -0
  82. package/dist/lib/release/workflow.js +1 -1
  83. package/dist/lib/run/index.js +5 -0
  84. package/dist/lib/sandbox/commands/control-status.js +22 -0
  85. package/dist/lib/sandbox/commands/create.js +39 -8
  86. package/dist/lib/sandbox/commands/ls.js +5 -0
  87. package/dist/lib/sandbox/commands/rm.js +3 -807
  88. package/dist/lib/sandbox/commands/show.js +16 -0
  89. package/dist/lib/sandbox/control/audit.js +203 -0
  90. package/dist/lib/sandbox/control/client.js +125 -12
  91. package/dist/lib/sandbox/control/completed-reentry.js +85 -0
  92. package/dist/lib/sandbox/control/container-identity.js +28 -31
  93. package/dist/lib/sandbox/control/executor.js +233 -34
  94. package/dist/lib/sandbox/control/finalization-response.js +27 -0
  95. package/dist/lib/sandbox/control/identity-sentinel.js +107 -0
  96. package/dist/lib/sandbox/control/lifecycle.js +656 -128
  97. package/dist/lib/sandbox/control/native-file-lock.js +85 -0
  98. package/dist/lib/sandbox/control/protocol.js +55 -4
  99. package/dist/lib/sandbox/control/server.js +720 -79
  100. package/dist/lib/sandbox/control/state.js +63 -3
  101. package/dist/lib/sandbox/control/task-view.js +183 -0
  102. package/dist/lib/sandbox/control/task-workflow.js +74 -0
  103. package/dist/lib/sandbox/control/workflow-executor.js +99 -0
  104. package/dist/lib/sandbox/engines/authority.js +289 -0
  105. package/dist/lib/sandbox/engines/docker-exact-discovery.js +97 -0
  106. package/dist/lib/sandbox/index.js +7 -2
  107. package/dist/lib/sandbox/recovery.js +49 -5
  108. package/dist/lib/sandbox/removal.js +1717 -0
  109. package/dist/lib/sandbox/task-cleanup.js +217 -0
  110. package/dist/lib/sandbox/workspace-view.js +15 -15
  111. package/dist/lib/sandbox/worktree-safety.js +4 -1
  112. package/dist/lib/server/index.js +8 -0
  113. package/dist/lib/task/activity-intent.js +2 -1
  114. package/dist/lib/task/activity-log.js +30 -24
  115. package/dist/lib/task/artifact-command.js +101 -0
  116. package/dist/lib/task/artifact-lifecycle.js +71 -40
  117. package/dist/lib/task/artifact-name.js +36 -0
  118. package/dist/lib/task/artifact-operations.js +474 -0
  119. package/dist/lib/task/artifact-receipts.js +3 -15
  120. package/dist/lib/task/artifact-repair-intent.js +130 -0
  121. package/dist/lib/task/artifact-schema.js +127 -0
  122. package/dist/lib/task/capabilities.js +83 -19
  123. package/dist/lib/task/codex-orchestration.js +71 -25
  124. package/dist/lib/task/commit-identity.js +28 -0
  125. package/dist/lib/task/commit-operation.js +2 -16
  126. package/dist/lib/task/control-authority.js +375 -5
  127. package/dist/lib/task/control-recovery.js +128 -0
  128. package/dist/lib/task/create-service.js +103 -4
  129. package/dist/lib/task/create.js +80 -2
  130. package/dist/lib/task/decision-details.js +2 -46
  131. package/dist/lib/task/events.js +306 -76
  132. package/dist/lib/task/finalization-state.js +9 -0
  133. package/dist/lib/task/human-override.js +3 -6
  134. package/dist/lib/task/implementation-inputs.js +3 -3
  135. package/dist/lib/task/index.js +11 -3
  136. package/dist/lib/task/intermediate-cleanup.js +383 -0
  137. package/dist/lib/task/invalidation.js +18 -65
  138. package/dist/lib/task/ledger-intents.js +7 -22
  139. package/dist/lib/task/ledger.js +1 -3
  140. package/dist/lib/task/lifecycle.js +19 -1
  141. package/dist/lib/task/local-artifact-finalization.js +190 -290
  142. package/dist/lib/task/manual-validation-completion.js +26 -0
  143. package/dist/lib/task/manual-validation-evidence.js +130 -0
  144. package/dist/lib/task/manual-validation-receipt.js +101 -0
  145. package/dist/lib/task/manual-validation-shared.js +40 -0
  146. package/dist/lib/task/manual-validation-transaction.js +243 -0
  147. package/dist/lib/task/markdown.js +47 -0
  148. package/dist/lib/task/orchestration.js +206 -69
  149. package/dist/lib/task/qualification-audit.js +476 -0
  150. package/dist/lib/task/qualification-confirmation.js +109 -0
  151. package/dist/lib/task/qualification-intents.js +148 -0
  152. package/dist/lib/task/review-artifacts.js +23 -40
  153. package/dist/lib/task/review-command.js +25 -0
  154. package/dist/lib/task/review-finalization.js +146 -97
  155. package/dist/lib/task/review-fingerprint.js +2 -2
  156. package/dist/lib/task/sections.js +34 -54
  157. package/dist/lib/task/verification-config.js +11 -0
  158. package/dist/lib/task/verification-engine.js +170 -327
  159. package/dist/lib/task/verification.js +1 -1
  160. package/dist/lib/task/workflow-command.js +17 -0
  161. package/dist/lib/task/workflow-warning-intents.js +0 -16
  162. package/dist/lib/task/workflow-warnings.js +28 -2
  163. package/dist/lib/update.js +2 -0
  164. package/dist/lifecycle-build-manifest.json +3 -3
  165. package/lib/agent-client.ts +9 -0
  166. package/lib/agent-clients/adapters/codex-lifecycle/capability-store.ts +223 -33
  167. package/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.ts +3 -2
  168. package/lib/fs/durable-write.ts +29 -0
  169. package/lib/fs/file-lock.ts +113 -0
  170. package/lib/host-control/audit.ts +22 -0
  171. package/lib/host-control/client.ts +172 -0
  172. package/lib/host-control/command.ts +60 -0
  173. package/lib/host-control/path.ts +167 -0
  174. package/lib/host-control/secure-fs.ts +135 -0
  175. package/lib/host-control/server.ts +180 -0
  176. package/lib/host-control/service.ts +133 -0
  177. package/lib/init.ts +15 -2
  178. package/lib/internal/agent-client.ts +4 -2
  179. package/lib/internal/cli-route-inventory.ts +142 -0
  180. package/lib/internal/codex-lifecycle.ts +14 -12
  181. package/lib/internal/codex-sandbox-controller.ts +7 -2
  182. package/lib/internal/demo-promotion.ts +354 -0
  183. package/lib/internal/demo-transcript.ts +419 -0
  184. package/lib/internal/git-workflow.ts +9 -6
  185. package/lib/internal/host-control.ts +28 -0
  186. package/lib/internal/manual-validation.ts +306 -0
  187. package/lib/internal/platform-checks.ts +12 -4
  188. package/lib/internal/platform-comment.ts +12 -4
  189. package/lib/internal/platform-context.ts +3 -1
  190. package/lib/internal/platform-issue.ts +11 -4
  191. package/lib/internal/platform-metadata.ts +70 -0
  192. package/lib/internal/platform-pr-review.ts +14 -3
  193. package/lib/internal/platform-pr.ts +38 -14
  194. package/lib/internal/platform-release-notes.ts +5 -3
  195. package/lib/internal/platform-security.ts +83 -0
  196. package/lib/internal/pr-review-grade.ts +10 -3
  197. package/lib/internal/release-workflow.ts +91 -87
  198. package/lib/internal/sandbox-control.ts +181 -6
  199. package/lib/internal/task-activity.ts +12 -4
  200. package/lib/internal/task-artifact.ts +15 -79
  201. package/lib/internal/task-context.ts +3 -1
  202. package/lib/internal/task-create.ts +76 -15
  203. package/lib/internal/task-delivery.ts +3 -1
  204. package/lib/internal/task-event.ts +21 -10
  205. package/lib/internal/task-finalization.ts +3 -1
  206. package/lib/internal/task-invalidation.ts +3 -1
  207. package/lib/internal/task-ledger.ts +11 -1
  208. package/lib/internal/task-lifecycle.ts +3 -1
  209. package/lib/internal/task-operation-registry.ts +590 -0
  210. package/lib/internal/task-orchestration.ts +12 -0
  211. package/lib/internal/task-override.ts +9 -3
  212. package/lib/internal/task-qualification.ts +61 -0
  213. package/lib/internal/task-review.ts +7 -50
  214. package/lib/internal/task-short-id.ts +10 -1
  215. package/lib/internal/task-snapshot.ts +3 -1
  216. package/lib/internal/task-validate.ts +32 -12
  217. package/lib/internal/task-verify.ts +4 -1
  218. package/lib/internal/task-warning.ts +7 -1
  219. package/lib/owned-path.ts +26 -0
  220. package/lib/platform/check-status.ts +9 -0
  221. package/lib/platform/comment-safety.ts +255 -0
  222. package/lib/platform/completion-backfill.ts +1 -1
  223. package/lib/platform/github-data.ts +322 -0
  224. package/lib/platform/github-provider.ts +244 -27
  225. package/lib/platform/issue-comments.ts +159 -35
  226. package/lib/platform/issues.ts +4 -245
  227. package/lib/platform/pr-change-report.ts +6 -12
  228. package/lib/platform/pr-checks.ts +13 -77
  229. package/lib/platform/pr-summary.ts +88 -11
  230. package/lib/platform/provider-contract.ts +78 -3
  231. package/lib/platform/provider-validation.ts +85 -3
  232. package/lib/platform/pull-requests.ts +129 -348
  233. package/lib/platform/repository-metadata.ts +453 -0
  234. package/lib/platform/security-alerts.ts +191 -0
  235. package/lib/platform/snapshots.ts +53 -0
  236. package/lib/platform/verification-sync.ts +171 -177
  237. package/lib/process-data/index.ts +7 -0
  238. package/lib/release/workflow.ts +3 -3
  239. package/lib/run/index.ts +5 -0
  240. package/lib/sandbox/commands/control-status.ts +26 -0
  241. package/lib/sandbox/commands/create.ts +53 -12
  242. package/lib/sandbox/commands/ls.ts +7 -0
  243. package/lib/sandbox/commands/rm.ts +3 -996
  244. package/lib/sandbox/commands/show.ts +16 -0
  245. package/lib/sandbox/control/audit.ts +253 -0
  246. package/lib/sandbox/control/client.ts +150 -13
  247. package/lib/sandbox/control/completed-reentry.ts +98 -0
  248. package/lib/sandbox/control/container-identity.ts +27 -43
  249. package/lib/sandbox/control/executor.ts +262 -37
  250. package/lib/sandbox/control/finalization-response.ts +29 -0
  251. package/lib/sandbox/control/identity-sentinel.ts +137 -0
  252. package/lib/sandbox/control/lifecycle.ts +672 -18
  253. package/lib/sandbox/control/native-file-lock.ts +108 -0
  254. package/lib/sandbox/control/protocol.ts +80 -8
  255. package/lib/sandbox/control/server.ts +779 -82
  256. package/lib/sandbox/control/state.ts +84 -3
  257. package/lib/sandbox/control/task-view.ts +240 -0
  258. package/lib/sandbox/control/task-workflow.ts +95 -0
  259. package/lib/sandbox/control/workflow-executor.ts +102 -0
  260. package/lib/sandbox/engines/authority.ts +365 -0
  261. package/lib/sandbox/engines/docker-exact-discovery.ts +132 -0
  262. package/lib/sandbox/index.ts +9 -2
  263. package/lib/sandbox/recovery.ts +49 -6
  264. package/lib/sandbox/removal.ts +2144 -0
  265. package/lib/sandbox/task-cleanup.ts +209 -0
  266. package/lib/sandbox/workspace-view.ts +26 -18
  267. package/lib/sandbox/worktree-safety.ts +4 -1
  268. package/lib/server/index.ts +10 -0
  269. package/lib/task/activity-intent.ts +2 -2
  270. package/lib/task/activity-log.ts +27 -19
  271. package/lib/task/artifact-command.ts +104 -0
  272. package/lib/task/artifact-lifecycle.ts +66 -39
  273. package/lib/task/artifact-name.ts +55 -0
  274. package/lib/task/artifact-operations.ts +580 -0
  275. package/lib/task/artifact-receipts.ts +3 -14
  276. package/lib/task/artifact-repair-intent.ts +152 -0
  277. package/lib/task/artifact-schema.ts +163 -0
  278. package/lib/task/capabilities.ts +82 -22
  279. package/lib/task/codex-orchestration.ts +85 -24
  280. package/lib/task/commit-identity.ts +31 -0
  281. package/lib/task/commit-operation.ts +2 -16
  282. package/lib/task/control-authority.ts +513 -6
  283. package/lib/task/control-recovery.ts +174 -0
  284. package/lib/task/create-service.ts +131 -6
  285. package/lib/task/create.ts +83 -1
  286. package/lib/task/decision-details.ts +3 -71
  287. package/lib/task/events.ts +292 -75
  288. package/lib/task/finalization-state.ts +11 -0
  289. package/lib/task/human-override.ts +3 -8
  290. package/lib/task/implementation-inputs.ts +3 -3
  291. package/lib/task/index.ts +16 -3
  292. package/lib/task/intermediate-cleanup.ts +455 -0
  293. package/lib/task/invalidation.ts +18 -62
  294. package/lib/task/ledger-intents.ts +7 -24
  295. package/lib/task/ledger.ts +1 -3
  296. package/lib/task/lifecycle.ts +17 -1
  297. package/lib/task/local-artifact-finalization.ts +223 -388
  298. package/lib/task/manual-validation-completion.ts +40 -0
  299. package/lib/task/manual-validation-evidence.ts +209 -0
  300. package/lib/task/manual-validation-receipt.ts +152 -0
  301. package/lib/task/manual-validation-shared.ts +50 -0
  302. package/lib/task/manual-validation-transaction.ts +304 -0
  303. package/lib/task/markdown.ts +70 -0
  304. package/lib/task/orchestration.ts +191 -68
  305. package/lib/task/qualification-audit.ts +588 -0
  306. package/lib/task/qualification-confirmation.ts +117 -0
  307. package/lib/task/qualification-intents.ts +150 -0
  308. package/lib/task/review-artifacts.ts +21 -41
  309. package/lib/task/review-command.ts +23 -0
  310. package/lib/task/review-finalization.ts +154 -153
  311. package/lib/task/review-fingerprint.ts +2 -2
  312. package/lib/task/sections.ts +33 -52
  313. package/lib/task/verification-config.ts +12 -0
  314. package/lib/task/verification-engine.ts +165 -370
  315. package/lib/task/verification-types.ts +17 -0
  316. package/lib/task/verification.ts +1 -1
  317. package/lib/task/workflow-command.ts +18 -0
  318. package/lib/task/workflow-warning-intents.ts +0 -13
  319. package/lib/task/workflow-warnings.ts +21 -2
  320. package/lib/update.ts +6 -0
  321. package/package.json +7 -2
  322. package/templates/.agents/hooks/lifecycle-delegation.js +6 -6
  323. package/templates/.agents/rules/README.en.md +2 -0
  324. package/templates/.agents/rules/README.zh-CN.md +2 -0
  325. package/templates/.agents/rules/decision-qualification.en.md +22 -0
  326. package/templates/.agents/rules/decision-qualification.zh-CN.md +22 -0
  327. package/templates/.agents/rules/evidence-reporting.en.md +28 -0
  328. package/templates/.agents/rules/evidence-reporting.zh-CN.md +28 -0
  329. package/templates/.agents/rules/label-milestone-setup.en.md +7 -7
  330. package/templates/.agents/rules/label-milestone-setup.zh-CN.md +7 -7
  331. package/templates/.agents/rules/local-artifact-repair.en.md +5 -1
  332. package/templates/.agents/rules/local-artifact-repair.zh-CN.md +5 -1
  333. package/templates/.agents/rules/security-alerts.en.md +8 -8
  334. package/templates/.agents/rules/security-alerts.zh-CN.md +8 -8
  335. package/templates/.agents/rules/testing-discipline.en.md +2 -0
  336. package/templates/.agents/rules/testing-discipline.zh-CN.md +2 -0
  337. package/templates/.agents/scripts/package.json +3 -0
  338. package/templates/.agents/skills/analyze-task/SKILL.en.md +15 -2
  339. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +19 -2
  340. package/templates/.agents/skills/analyze-task/config/verify.en.json +1 -12
  341. package/templates/.agents/skills/analyze-task/config/verify.zh-CN.json +1 -12
  342. package/templates/.agents/skills/close-codescan/SKILL.en.md +2 -2
  343. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +2 -2
  344. package/templates/.agents/skills/close-dependabot/SKILL.en.md +2 -2
  345. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +2 -2
  346. package/templates/.agents/skills/code-task/SKILL.en.md +14 -1
  347. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +14 -1
  348. package/templates/.agents/skills/code-task/config/verify.en.json +5 -14
  349. package/templates/.agents/skills/code-task/config/verify.zh-CN.json +5 -14
  350. package/templates/.agents/skills/code-task/reference/code-rules.en.md +5 -4
  351. package/templates/.agents/skills/code-task/reference/code-rules.zh-CN.md +5 -4
  352. package/templates/.agents/skills/code-task/reference/dual-mode.en.md +1 -1
  353. package/templates/.agents/skills/code-task/reference/dual-mode.zh-CN.md +1 -1
  354. package/templates/.agents/skills/code-task/reference/fix-mode.en.md +3 -1
  355. package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +3 -1
  356. package/templates/.agents/skills/code-task/reference/report-template.en.md +42 -15
  357. package/templates/.agents/skills/code-task/reference/report-template.zh-CN.md +39 -12
  358. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +37 -21
  359. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +37 -21
  360. package/templates/.agents/skills/complete-manual-validation/config/verify.en.json +1 -1
  361. package/templates/.agents/skills/complete-manual-validation/config/verify.zh-CN.json +1 -1
  362. package/templates/.agents/skills/complete-manual-validation/reference/report-template.en.md +4 -0
  363. package/templates/.agents/skills/complete-manual-validation/reference/report-template.zh-CN.md +4 -0
  364. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +16 -7
  365. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +16 -7
  366. package/templates/.agents/skills/complete-task/SKILL.en.md +10 -23
  367. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +10 -23
  368. package/templates/.agents/skills/create-task/SKILL.en.md +8 -0
  369. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +7 -0
  370. package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
  371. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  372. package/templates/.agents/skills/import-dependabot/SKILL.en.md +1 -1
  373. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +1 -1
  374. package/templates/.agents/skills/init-labels/SKILL.en.md +8 -8
  375. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +8 -8
  376. package/templates/.agents/skills/init-milestones/SKILL.en.md +9 -11
  377. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +9 -11
  378. package/templates/.agents/skills/plan-task/SKILL.en.md +14 -1
  379. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +16 -1
  380. package/templates/.agents/skills/plan-task/config/verify.en.json +4 -14
  381. package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +4 -14
  382. package/templates/.agents/skills/release/SKILL.en.md +7 -3
  383. package/templates/.agents/skills/release/SKILL.zh-CN.md +7 -3
  384. package/templates/.agents/skills/review-analysis/SKILL.en.md +14 -1
  385. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +14 -1
  386. package/templates/.agents/skills/review-analysis/config/verify.en.json +1 -18
  387. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +1 -18
  388. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +50 -23
  389. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +45 -18
  390. package/templates/.agents/skills/review-code/SKILL.en.md +14 -1
  391. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +14 -1
  392. package/templates/.agents/skills/review-code/config/verify.en.json +1 -23
  393. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -23
  394. package/templates/.agents/skills/review-code/reference/report-template.en.md +49 -22
  395. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +45 -18
  396. package/templates/.agents/skills/review-plan/SKILL.en.md +14 -1
  397. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +14 -1
  398. package/templates/.agents/skills/review-plan/config/verify.en.json +1 -18
  399. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +1 -18
  400. package/templates/.agents/skills/review-plan/reference/report-template.en.md +49 -22
  401. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +45 -18
  402. package/templates/.agents/skills/review-pr/SKILL.en.md +5 -1
  403. package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +5 -1
  404. package/templates/.agents/skills/review-pr/reference/report-template.en.md +4 -3
  405. package/templates/.agents/skills/review-pr/reference/report-template.zh-CN.md +4 -3
  406. package/templates/.agents/skills/run-manual-validation/SKILL.en.md +25 -4
  407. package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +25 -4
  408. package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.en.md +4 -1
  409. package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.zh-CN.md +4 -1
  410. package/templates/.agents/skills/run-manual-validation/reference/report-template.en.md +5 -1
  411. package/templates/.agents/skills/run-manual-validation/reference/report-template.zh-CN.md +5 -1
  412. package/templates/.agents/skills/run-task/SKILL.en.md +1 -1
  413. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +1 -1
  414. package/templates/.agents/skills/test/SKILL.en.md +29 -7
  415. package/templates/.agents/skills/test/SKILL.zh-CN.md +29 -7
  416. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +14 -0
  417. package/templates/.agents/templates/task.en.md +6 -0
  418. package/templates/.agents/templates/task.zh-CN.md +6 -0
  419. package/templates/.claude/commands/run-manual-validation.en.md +1 -1
  420. package/templates/.claude/commands/run-manual-validation.zh-CN.md +1 -1
  421. package/dist/lib/platform/adapters.js +0 -56
  422. package/lib/platform/adapters.ts +0 -197
  423. package/templates/.agents/scripts/security-alerts.github.sh +0 -151
  424. package/templates/.agents/scripts/security-alerts.sh +0 -31
  425. package/templates/.agents/skills/init-labels/scripts/init-labels.github.sh +0 -146
  426. package/templates/.agents/skills/init-labels/scripts/init-labels.sh +0 -32
  427. package/templates/.agents/skills/init-milestones/scripts/init-milestones.github.sh +0 -294
  428. package/templates/.agents/skills/init-milestones/scripts/init-milestones.sh +0 -6
@@ -1,5 +1,7 @@
1
1
  # Review Report Template
2
2
 
3
+ > Before writing this report, use `task-artifact init --family review-plan` to create the skeleton and preserve every `artifact-section` marker; the skeleton contains no review conclusion.
4
+
3
5
  Use this template when writing `review-plan.md` or `review-plan-r{N}.md`.
4
6
 
5
7
  ## Output Template
@@ -12,11 +14,31 @@ Use this template when writing `review-plan.md` or `review-plan-r{N}.md`.
12
14
  - **Review Input**:
13
15
  - `{plan-artifact}` (the highest-round technical-plan artifact actually reviewed, e.g. `plan-r2.md`; leave blank if it cannot be reliably determined)
14
16
 
15
- ## State Check
17
+ ## Review Summary
16
18
 
17
- > Paste the raw state-check command output; each command starts with `$ `.
19
+ ## Qualification Audit Review
18
20
 
19
- ## Review Summary
21
+ > Use `.agents/rules/decision-qualification.md` to review the five tables: constraint dependencies, candidate qualification, classification results, upstream relations, and dependency snapshot.
22
+
23
+ ### Constraint Dependencies
24
+ | constraint_id | constraint_digest | role | evidence |
25
+ | --- | --- | --- | --- |
26
+
27
+ ### Candidate Qualification
28
+ | candidate_id | status | impact | constraint_ids | evidence |
29
+ | --- | --- | --- | --- | --- |
30
+
31
+ ### Classification Results
32
+ | decision_id | classification | evidence |
33
+ | --- | --- | --- |
34
+
35
+ ### Upstream Relations
36
+ | upstream_family | upstream_artifact | upstream_round | upstream_sha256 | relation |
37
+ | --- | --- | --- | --- | --- |
38
+
39
+ ### Dependency Snapshot
40
+ | task_input_digest | non_constraint_input_digest | upstream_artifact_digest |
41
+ | --- | --- | --- |
20
42
 
21
43
  - **Reviewer**: {reviewer-name}
22
44
  - **Review Time**: {timestamp}
@@ -24,7 +46,7 @@ Use this template when writing `review-plan.md` or `review-plan-r{N}.md`.
24
46
  - **Overall Verdict**: {Approved / Changes Requested / Rejected}
25
47
  - **Findings (AI-actionable)**: {unresolved-blockers} blockers, {unresolved-major} majors, {unresolved-minor} minors / **Manual validation**: 0
26
48
 
27
- ## Review Coverage Declaration
49
+ ## Inspection Coverage
28
50
 
29
51
  | pass_id | scope | evidence | result | gaps_or_assumptions |
30
52
  |---------|-------|----------|--------|---------------------|
@@ -102,7 +124,7 @@ Use this template when writing `review-plan.md` or `review-plan-r{N}.md`.
102
124
  **File**: `{file-path}:{line-number}`
103
125
  **Suggestion**: {improvement suggestion}
104
126
 
105
- ## Non-blocking Advisories
127
+ ## Non-blocking Suggestions
106
128
 
107
129
  > Record only future optimizations that do not affect the current artifact's completeness, correctness, or acceptance. Advisories do not enter the disagreement ledger, finding counts, or verdict.
108
130
 
@@ -121,27 +143,42 @@ Use this template when writing `review-plan.md` or `review-plan-r{N}.md`.
121
143
  > If this round has no Manual validation items, keep the section heading and write "None".
122
144
 
123
145
 
124
- ## Review Disagreement Ledger Writeback
146
+ ## Conclusion and Recommendation
125
147
 
126
- > Record the structured intents to submit: use `task-ledger finding-upsert` for new findings and `finding-review` for prior responses. The core allocates `PL-N` and validates transitions; do not edit task.md table rows.
127
- > Every finding escalated to `needs-human-decision` must include a self-contained detail block per `.agents/rules/human-decision-context.md`, with evidence pointing to that stable anchor.
148
+ ### Approval Decision
149
+ - [ ] Approved
150
+ - [ ] Changes Requested
151
+ - [ ] Rejected
152
+
153
+ ### Next Steps
154
+ {recommended next step}
155
+
156
+ ## State Check
128
157
 
129
- ## Evidence
158
+ > Record the state-check command, review scope, key result, and uncovered parts; each command starts with `$ `.
159
+ > Follow `.agents/rules/evidence-reporting.md`: record review scope, key result, and uncovered parts; do not paste complete successful stdout.
130
160
 
131
- > Pair each "I verified X" claim with the corresponding raw tool output; the gate only checks that this section exists and at least one `$ ` line is present. Every Blocker must be backed by a reproducible command (rg/grep/sed/nl) and its raw output; a judgment that cannot be reproduced must be downgraded or moved to Self-Doubt.
161
+ ## Raw Evidence
162
+
163
+ > Follow `.agents/rules/evidence-reporting.md`: pair each claim with a `$ ` command and proportionate result summary; Blockers, failures, blocking conditions, or disputes require a reproducible command, exact location, and decisive excerpt; a judgment that cannot be reproduced must be downgraded or moved to Self-Doubt.
132
164
 
133
165
  - Claim: {verified claim}
134
166
  ```text
135
167
  $ {command}
136
- {raw output}
168
+ {result summary or decisive excerpt}
137
169
  ```
138
170
 
139
- ## Self-Doubt
171
+ ## Self-critique
140
172
 
141
173
  > Explicitly declare conclusions, inferences, and assumptions in this review that were **not directly verified**; downstream can rebut them on this basis. Write "None" if there are none.
142
174
 
143
175
  - {an unverified conclusion or inference; note why it was not verified and the impact if it is overturned}
144
176
 
177
+ ## Review Disagreement Ledger Write-back
178
+
179
+ > Record the structured intents to submit: use `task-ledger finding-upsert` for new findings and `finding-review` for prior responses. The core allocates `PL-N` and validates transitions; do not edit task.md table rows.
180
+ > Every finding escalated to `needs-human-decision` must include a self-contained detail block per `.agents/rules/human-decision-context.md`, with evidence pointing to that stable anchor.
181
+
145
182
  ## Highlights
146
183
 
147
184
  - {what went well}
@@ -150,14 +187,4 @@ $ {command}
150
187
 
151
188
  - [ ] Implementation matches the technical plan
152
189
  - [ ] No unintended scope expansion
153
-
154
- ## Conclusion and Recommendation
155
-
156
- ### Approval Decision
157
- - [ ] Approved
158
- - [ ] Changes Requested
159
- - [ ] Rejected
160
-
161
- ### Next Steps
162
- {recommended next step}
163
190
  ```
@@ -1,5 +1,7 @@
1
1
  # 审查报告模板
2
2
 
3
+ > 写入本报告前,先用 `task-artifact init --family review-plan` 创建骨架,并保留每个 `artifact-section` marker;骨架不包含审查结论。
4
+
3
5
  编写 `review-plan.md` 或 `review-plan-r{N}.md` 时使用本模板。
4
6
 
5
7
  ## 输出模板
@@ -12,11 +14,31 @@
12
14
  - **审查输入**:
13
15
  - `{plan-artifact}`(本轮实际检视的最高轮技术方案产物,如 `plan-r2.md`;无法可靠取得则留空)
14
16
 
15
- ## 状态核对
17
+ ## 审查摘要
16
18
 
17
- > 粘贴状态核对命令原文;每条命令以 `$ ` 开头。
19
+ ## 资格审计复核
18
20
 
19
- ## 审查摘要
21
+ > 按 `.agents/rules/decision-qualification.md` 复核:约束依赖、候选资格、分类结果、上游关系和依赖快照五张表。
22
+
23
+ ### 约束依赖
24
+ | constraint_id | constraint_digest | role | evidence |
25
+ | --- | --- | --- | --- |
26
+
27
+ ### 候选资格
28
+ | candidate_id | status | impact | constraint_ids | evidence |
29
+ | --- | --- | --- | --- | --- |
30
+
31
+ ### 分类结果
32
+ | decision_id | classification | evidence |
33
+ | --- | --- | --- |
34
+
35
+ ### 上游关系
36
+ | upstream_family | upstream_artifact | upstream_round | upstream_sha256 | relation |
37
+ | --- | --- | --- | --- | --- |
38
+
39
+ ### 依赖快照
40
+ | task_input_digest | non_constraint_input_digest | upstream_artifact_digest |
41
+ | --- | --- | --- |
20
42
 
21
43
  - **审查者**:{reviewer-name}
22
44
  - **审查时间**:{timestamp}
@@ -121,19 +143,29 @@
121
143
  > 如本轮无人工校验项,保留段落标题并写「(无)」。
122
144
 
123
145
 
124
- ## 审查分歧账本回写
146
+ ## 结论与建议
125
147
 
126
- > 本段记录将提交的结构化意图:新 finding 用 `task-ledger finding-upsert`,上一轮响应复核用 `finding-review`;由核心分配 `PL-N` 并校验状态机,禁止手写 task.md 表格。
127
- > 凡升级为 `needs-human-decision` 的 finding,必须按 `.agents/rules/human-decision-context.md` 在本报告中提供自足详情块,并让 evidence 指向该稳定锚点。
148
+ ### 审查决定
149
+ - [ ] 通过
150
+ - [ ] 需要修改
151
+ - [ ] 拒绝
152
+
153
+ ### 下一步
154
+ {recommended next step}
155
+
156
+ ## 状态核对
157
+
158
+ > 记录状态核对命令、审查范围、关键结果和未覆盖部分;每条命令以 `$ ` 开头。
159
+ > 按 `.agents/rules/evidence-reporting.md` 同时记录审查范围、关键结果和未覆盖部分;正常成功不粘贴完整 stdout。
128
160
 
129
161
  ## 证据原文
130
162
 
131
- > 每条“我验证了 X”断言都要配对对应 tool output 原文;gate 仅校验本段存在和至少一行 `$ `。每条 Blocker 必须配可复现命令(rg/grep/sed/nl)及其原文;无法复现的判断须降级或移入「自我质疑」。
163
+ > 遵循 `.agents/rules/evidence-reporting.md`:每条断言配对 `$ ` 命令和相称结果摘要;Blocker、失败、阻塞或争议必须保留可复现命令、准确位置和决定性摘录;无法复现的判断须降级或移入「自我质疑」。
132
164
 
133
165
  - 断言:{verified claim}
134
166
  ```text
135
167
  $ {command}
136
- {raw output}
168
+ {result summary or decisive excerpt}
137
169
  ```
138
170
 
139
171
  ## 自我质疑
@@ -142,6 +174,11 @@ $ {command}
142
174
 
143
175
  - {未直接验证的结论或推断;说明为何未验证、若被推翻的影响}
144
176
 
177
+ ## 审查分歧账本回写
178
+
179
+ > 本段记录将提交的结构化意图:新 finding 用 `task-ledger finding-upsert`,上一轮响应复核用 `finding-review`;由核心分配 `PL-N` 并校验状态机,禁止手写 task.md 表格。
180
+ > 凡升级为 `needs-human-decision` 的 finding,必须按 `.agents/rules/human-decision-context.md` 在本报告中提供自足详情块,并让 evidence 指向该稳定锚点。
181
+
145
182
  ## 亮点
146
183
 
147
184
  - {what went well}
@@ -150,14 +187,4 @@ $ {command}
150
187
 
151
188
  - [ ] 实现与技术方案一致
152
189
  - [ ] 没有意外的范围扩张
153
-
154
- ## 结论与建议
155
-
156
- ### 审查决定
157
- - [ ] 通过
158
- - [ ] 需要修改
159
- - [ ] 拒绝
160
-
161
- ### 下一步
162
- {recommended next step}
163
190
  ```
@@ -12,6 +12,10 @@ Based on the target PR's lifecycle-evidence completeness and change risk, select
12
12
 
13
13
  ## Boundary / Critical Rules
14
14
 
15
+ ### Persisted Report Evidence
16
+
17
+ Before generating the PR review report, read `.agents/rules/evidence-reporting.md`. Normal review records the command, scope, structured result, actual conclusion, and uncovered parts; formal Review, findings, blocking conditions, or disputes retain exact identity fields and decisive evidence.
18
+
15
19
  - Strictly follow the fixed evidence-grading decision flow: host resolution → evidence classification → freshness/alignment → risk grading → mode selection
16
20
  - `pr-review*` is an independent artifact family: it does not join the analysis/plan/code stage chain and never changes `current_step`
17
21
  - Only a formal PR Review (head SHA, conclusion, findings, receipt, Issue artifact link) is published on the PR; no second full process copy goes to a regular PR comment
@@ -41,7 +45,7 @@ Before making any task-state judgment or user-visible conclusion, run the state
41
45
  agent-infra-internal task-snapshot {task-id} --format text
42
46
  ```
43
47
 
44
- The task-anchored path records the current task directory and existing `pr-review*` rounds before starting; the one-shot path (no task) records the PR number and target directory. Paste the state-check output into the `## State Check` section of this round's `pr-review-rN.md`.
48
+ The task-anchored path records the current task directory and existing `pr-review*` rounds before starting; the one-shot path (no task) records the PR number and target directory. Record the command, PR/head, review scope, key result, and uncovered parts in this round's `## State Check` section; do not paste complete directory listings or task tails on normal success, and retain decisive raw lines for identity mismatches, failures, blocking conditions, or disputes.
45
49
 
46
50
  ## Steps
47
51
 
@@ -12,6 +12,10 @@ description: >
12
12
 
13
13
  ## 行为边界 / 关键规则
14
14
 
15
+ ### 持久化报告证据
16
+
17
+ 生成 PR 审查报告时,先读取 `.agents/rules/evidence-reporting.md`。正常审查记录命令、范围、结构化结果、实际结论和未覆盖部分;正式 Review、finding、阻塞或争议的身份字段和决定性证据必须精确保留。
18
+
15
19
  - 严格遵循方案中固化的证据分级主决策流:宿主解析 → 证据分类 → 新鲜度/对齐 → 风险分级 → 模式选择
16
20
  - `pr-review*` 是独立 artifact family:不接入 analysis/plan/code 阶段依赖链,不修改 `current_step`
17
21
  - PR 上只发布正式 PR Review(head SHA、结论、finding、receipt、Issue artifact 链接),不发第二份完整过程原文到 PR 普通评论
@@ -41,7 +45,7 @@ description: >
41
45
  agent-infra-internal task-snapshot {task-id} --format text
42
46
  ```
43
47
 
44
- 任务锚定路径在开始前记录当前任务目录与既有 `pr-review*` 轮次;一次性路径(无任务)记录 PR 编号与目标目录。状态核对输出粘贴到本轮产物 `pr-review-rN.md` 的 `## 状态核对` 段。
48
+ 任务锚定路径在开始前记录当前任务目录与既有 `pr-review*` 轮次;一次性路径(无任务)记录 PR 编号与目标目录。将命令、PR/head、审查范围、关键结果和未覆盖部分写入本轮产物 `pr-review-rN.md` 的 `## 状态核对` 段;正常成功不粘贴完整目录清单或 `task.md` 尾部,身份不一致、失败、阻塞或争议时保留决定性原文行。
45
49
 
46
50
  ## 执行步骤
47
51
 
@@ -11,7 +11,8 @@ Use the following structure when creating `pr-review.md` or `pr-review-r{N}.md`.
11
11
 
12
12
  ## State Check
13
13
 
14
- > Paste the state-check command output verbatim; each command starts with `$ `.
14
+ > Record the state-check command, PR/head, review scope, key result, and uncovered parts; each command starts with `$ `.
15
+ > Follow `.agents/rules/evidence-reporting.md`: record PR, head, review scope, key result, and uncovered parts; do not paste complete successful stdout.
15
16
 
16
17
  ## Identity
17
18
 
@@ -76,10 +77,10 @@ Land the following in order before the line-level findings, without impersonatin
76
77
 
77
78
  ## Evidence
78
79
 
79
- > Every "I verified X" assertion must pair with the corresponding tool output verbatim; the gate only checks this section exists and has at least one `$ ` line.
80
+ > Follow `.agents/rules/evidence-reporting.md`: pair every assertion with a `$ ` command and proportionate result summary; formal Review, failures, blocking conditions, or disputes retain exact identity and decisive excerpts.
80
81
 
81
82
  - Assertion: {verified claim}
82
83
  ```text
83
84
  $ {command}
84
- {raw output}
85
+ {result summary or decisive excerpt}
85
86
  ```
@@ -11,7 +11,8 @@
11
11
 
12
12
  ## 状态核对
13
13
 
14
- > 粘贴状态核对命令原文;每条命令以 `$ ` 开头。
14
+ > 记录状态核对命令、PR/head、审查范围、关键结果和未覆盖部分;每条命令以 `$ ` 开头。
15
+ > 按 `.agents/rules/evidence-reporting.md` 同时记录 PR、head、审查范围、关键结果和未覆盖部分;正常成功不粘贴完整 stdout。
15
16
 
16
17
  ## 身份信息
17
18
 
@@ -76,10 +77,10 @@
76
77
 
77
78
  ## 证据原文
78
79
 
79
- > 每条「我验证了 X」断言都要配对对应 tool output 原文;gate 仅校验本段存在和至少一行 `$ `。
80
+ > 遵循 `.agents/rules/evidence-reporting.md`:每条断言配对 `$ ` 命令和相称结果摘要;正式 Review、失败、阻塞或争议保留准确身份和决定性摘录。
80
81
 
81
82
  - 断言:{verified claim}
82
83
  ```text
83
84
  $ {command}
84
- {raw output}
85
+ {result summary or decisive excerpt}
85
86
  ```
@@ -14,36 +14,57 @@ Lifecycle events require explicit trigger data: use `{trigger-initiator}=orchest
14
14
 
15
15
  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. Parse `--scope`, `--timeout`, and `--format` before `--`, preserve the user command after `--` verbatim, then call `agent-infra-internal task-context resolve {task-scope}`. Pass through resolution failures without scanning tasks locally. The internal `task-validate` protocol continues to use a positional task ref.
16
16
 
17
+ For cross-environment validation (the task workspace lives on another host), pass `--branch <ref>` explicitly to enter the branch-only fallback: skip `task-context resolve` and use that branch ref directly as the positional argument of `task-validate`, which returns branch-only evidence with `taskId: null`. Without `--branch`, a resolution failure is still passed through; never degrade silently. `--task` and `--branch` are mutually exclusive.
18
+
17
19
  ## Boundary
18
20
 
21
+ ### Persisted Report Evidence
22
+
23
+ Before generating a validation report, read `.agents/rules/evidence-reporting.md`. Record only the command name, target scope, exit status, sanitized result, and coverage gap; never record complete argv, environment variables, tokens, absolute paths, or a raw sensitive transcript.
24
+
19
25
  - Select the validation mode, call the sole mechanical entry point, and record evidence; do not mark PR manual validation complete.
20
26
  - `complete-manual-validation` remains the maintainer's final registration after coverage is judged sufficient.
21
27
  - Never manipulate temporary worktrees, leases, or containers directly; only call `agent-infra-internal task-validate`.
22
- - Never record tokens, environment variables, full argv, absolute user paths, or raw transcripts in the artifact.
28
+ - Never record tokens, environment variables, full argv, absolute user paths, or raw transcripts in the artifact; the core must write one current-only evidence envelope for each validation target.
23
29
  - Before generating a validation artifact Markdown file 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.
30
+ - The branch-only fallback writes to `.agents/workspace/validations/{branch-slug}/` and is marked `recoverable: false`: no task.md write-back, no lifecycle events, no Issue sync, no `task-verify`; the artifact must be carried back to the host that owns the task workspace for registration.
24
31
 
25
32
  ## Step 0: State Check (pre-execution hard gate)
26
33
 
27
- Resolve the task reference, then run this command and copy its original output into the artifact:
34
+ Resolve the task reference, then run this command and record the task/artifact scope, key result, and uncovered parts in the artifact; do not paste complete directory listings or task tails on normal success. Retain decisive raw lines only for failures, blocking conditions, identity mismatches, or disputes:
28
35
 
29
36
  ```bash
30
37
  agent-infra-internal task-snapshot {task-id} --format text
31
38
  ```
32
39
 
40
+ Branch-only has no `{task-id}`: skip this step and record `not-applicable (branch-only)` in the artifact's `## State Check` section.
41
+
33
42
  ## Steps
34
43
 
35
44
  1. Read `reference/discovery-and-execution.md` and parse the input mode. Stop before started without an artifact for invalid or partial input.
36
45
  2. Run `agent-infra-internal task-artifact {task-id} inspect --family validation-run` and read the latest review-code manual-validation items. Then run `agent-infra-internal platform-pr inspect {task-id}` and use the reference status matrix to discover, merge, and number items. Only automatic mode stops before started when reliable sources are empty or the sole possible source is unreadable; valid explicit mode always continues with the user command as effective work.
37
46
  3. Take the round and artifact name from the core result. After confirming valid explicit work or a non-empty discovered list, run `agent-infra-internal task-event {task-id} validation-run.started --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code}` and classify each item as `executable|unavailable|unknown|unsafe|unresolved`.
38
- 4. Invoke every executable item separately with `agent-infra-internal task-validate {task-ref} --scope snapshot --format json -- {command...}`. Only make a second explicit inplace invocation for that item when evidence proves it is required. If no item is executable, run no fabricated command but still produce coverage-gap evidence.
47
+ 4. Allocate an `{evidence-file}` for each validation target and invoke every executable item separately with `agent-infra-internal task-validate {task-ref} --scope snapshot --format json --evidence-file {evidence-file} -- {command...}`. Only make a second explicit inplace invocation for that item when evidence proves it is required, using its evidence file. If no item is executable, run no fabricated command but still produce coverage-gap evidence.
39
48
  5. Read `reference/report-template.md`, create `validation-run.md|validation-run-r{N}.md`, and record the input mode, discovered list, per-item results, CLI JSON allowlist, and sanitized summaries.
40
49
  6. Run `agent-infra-internal task-event {task-id} validation-run.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {artifact}`. When an Issue exists, run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}` and then `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {artifact} --agent {standard-agent-token}`.
41
50
  7. Run `agent-infra-internal task-verify {task-id} validation-run.completed --artifact {artifact} --format text`; fix failures and rerun it.
42
51
  8. Report the evidence path, coverage gaps, and verification result; explicitly leave the decision to run `complete-manual-validation` to the maintainer. Read `.agents/rules/next-step-output.md` and end with `Completed at`.
43
52
 
53
+ ## Scenario B: Branch-Only Fallback
54
+
55
+ With `--branch <ref>`, only the following differ from the steps above; every other constraint (classification, per-item execution, sanitization, never changing PR manual validation state) still applies.
56
+
57
+ - **Explicit mode only**: `task-artifact` and `platform-pr inspect` both require a task ref, so branch-only cannot discover items. Stop before writing any artifact when the user command after `--` is missing.
58
+ - **Skip Step 0 and the Step 2 discovery**: record both sources as `unavailable` and list this round's items under the `explicit` source in the artifact's `## Discovered Items` section.
59
+ - **Step 3 skips only the event call**: emit no `validation-run.started`, but still classify every item as `executable|unavailable|unknown|unsafe|unresolved`.
60
+ - **Step 4 runs unchanged**: write evidence files in the same branch-only validation directory and invoke `agent-infra-internal task-validate {branch-ref} --scope snapshot --format json --evidence-file {evidence-file} -- {command...}`.
61
+ - **Step 5 relocates the artifact**: write `.agents/workspace/validations/{branch-slug}/validation-run.md|validation-run-r{N}.md` using the same `reference/report-template.md`. Derive `{branch-slug}` from the `--branch` ref character by character: keep `[A-Za-z0-9._-]` and replace everything else (including `/`) with `-`, so the result is a single path segment; if the result is empty or consists only of `.`, treat it as invalid input and stop before writing any artifact.
62
+ - **Skip Steps 6 and 7**: emit no `validation-run.completed`, run no `platform-comment sync`, and run no `task-verify`.
63
+ - **Step 8 adds a notice**: state that the artifact is unrecoverable and unregistered, and must be carried back to the host owning the task workspace before a maintainer runs `complete-manual-validation`.
64
+
44
65
  ## Completion Checklist
45
66
 
46
67
  - [ ] Used `agent-infra-internal task-validate` for every executable item, or recorded that none were executable
47
68
  - [ ] Recorded sanitized validation-run evidence
48
69
  - [ ] Did not change PR manual validation completion state
49
- - [ ] Updated task.md and passed completion verification
70
+ - [ ] Updated task.md and passed completion verification (branch-only instead: recorded `recoverable: false` and left the task ledger untouched)
@@ -14,36 +14,57 @@ description: >
14
14
 
15
15
  入口可省略 task ref;显式 task scope 仅接受 `--task <ref>` 或 `-t <ref>`,不再解释位置 task ref。先解析 `--scope`、`--timeout`、`--format`,在 `--` 后原样保留用户命令,再调用 `agent-infra-internal task-context resolve {task-scope}`。解析失败时透传非零退出码,不自行扫描任务。内部 `task-validate` 协议仍使用位置 task ref。
16
16
 
17
+ 跨环境校验(任务工作区在另一台宿主)显式传 `--branch <ref>` 进入 branch-only 降级路径:不调用 `task-context resolve`,直接以该分支 ref 作为 `task-validate` 的位置参数,核心据此返回 `taskId: null` 的 branch-only 证据。未传 `--branch` 时解析失败仍透传非零退出码,不得静默降级。`--task` 与 `--branch` 互斥。
18
+
17
19
  ## 行为边界
18
20
 
21
+ ### 持久化报告证据
22
+
23
+ 生成验证报告时,先读取 `.agents/rules/evidence-reporting.md`。只记录命令名称、目标范围、退出状态、sanitized result 和覆盖缺口;不得记录完整 argv、环境变量、token、绝对路径或原始敏感 transcript。
24
+
19
25
  - 本技能负责选择校验模式、调用唯一机械入口并记录证据;不把 PR 人工校验标为完成。
20
26
  - `complete-manual-validation` 仍是维护者确认覆盖充分后的最终登记入口。
21
27
  - 禁止直接操作临时 worktree、lease 或 container;只调用 `agent-infra-internal task-validate`。
22
- - 产物不得记录 token、环境变量、完整 argv、绝对用户路径或原始 transcript。
28
+ - 产物不得记录 token、环境变量、完整 argv、绝对用户路径或原始 transcript;每个验证目标必须由核心写入同一 current-only evidence envelope。
23
29
  - 生成会同步到 Issue 的验证 artifact Markdown 前,先读取 `.agents/rules/sync-content-generation.md` 并遵循其中的生成端约束;Issue 同步保持透明,不解析或改写正文。
30
+ - branch-only 降级路径走 `.agents/workspace/validations/{branch-slug}/`,标记 `recoverable: false`:不写 task.md、不发 lifecycle 事件、不同步 Issue、不跑 `task-verify`;产物须带回宿主机,由维护者登记。
24
31
 
25
32
  ## 第 0 步:状态核对(执行前硬约束)
26
33
 
27
- 解析任务引用后运行,并把原文写入产物:
34
+ 解析任务引用后运行,并在产物中记录任务/产物范围、关键结果和未覆盖部分;正常成功不粘贴完整目录清单或 `task.md` 尾部,失败、阻塞、身份不一致或争议时附决定性原文行:
28
35
 
29
36
  ```bash
30
37
  agent-infra-internal task-snapshot {task-id} --format text
31
38
  ```
32
39
 
40
+ branch-only 无 `{task-id}`,跳过本步,并在产物 `## 状态核对` 记录 `not-applicable (branch-only)`。
41
+
33
42
  ## 执行步骤
34
43
 
35
44
  1. 读取 `reference/discovery-and-execution.md`,解析输入模式;非法或半截输入在 started 前停止,不写产物。
36
45
  2. 运行 `agent-infra-internal task-artifact {task-id} inspect --family validation-run`,读取最新 review-code 人工校验项;再运行 `agent-infra-internal platform-pr inspect {task-id}`,按 reference 的状态矩阵发现、归并并编号。仅在自动模式下,可靠来源无项或唯一可能来源不可读时才在 started 前停止;合法显式模式始终以用户命令作为有效工作继续。
37
46
  3. 从核心结果取得轮次和产物名;确认存在有效显式工作或非空发现清单后,运行 `agent-infra-internal task-event {task-id} validation-run.started --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code}`,并逐项分类为 `executable|unavailable|unknown|unsafe|unresolved`。
38
- 4. 每个可执行项分别调用 `agent-infra-internal task-validate {task-ref} --scope snapshot --format json -- {command...}`;只有证据表明必须原位时才对该项进行第二次显式 inplace 调用。零项可执行时不运行伪造命令,但仍继续产出覆盖缺口证据。
47
+ 4. 为每个验证目标分配 `{evidence-file}`,分别调用 `agent-infra-internal task-validate {task-ref} --scope snapshot --format json --evidence-file {evidence-file} -- {command...}`;只有证据表明必须原位时才对该项进行第二次显式 inplace 调用并写入对应 evidence 文件。零项可执行时不运行伪造命令,但仍继续产出覆盖缺口证据。
39
48
  5. 读取 `reference/report-template.md`,创建 `validation-run.md|validation-run-r{N}.md`;记录输入模式、发现清单、逐项结果、CLI JSON allowlist 与去敏摘要。
40
49
  6. 运行 `agent-infra-internal task-event {task-id} validation-run.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {artifact}`。存在 Issue 时依次运行 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}` 和 `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {artifact} --agent {standard-agent-token}`。
41
50
  7. 运行 `agent-infra-internal task-verify {task-id} validation-run.completed --artifact {artifact} --format text`;未通过则修复后重跑。
42
51
  8. 告知用户证据路径、覆盖缺口和验证结果;明确仍需维护者判断是否执行 `complete-manual-validation`。读取 `.agents/rules/next-step-output.md`,最后一行输出 `Completed at`。
43
52
 
53
+ ## 场景 B:branch-only 降级
54
+
55
+ 传入 `--branch <ref>` 时,相对上述步骤只有以下差异;其余约束(分类、逐项执行、去敏、不改 PR 人工验证完成状态)不变。
56
+
57
+ - **仅接受显式模式**:`task-artifact` 和 `platform-pr inspect` 都要求 task ref,branch-only 无法自动发现。缺少 `--` 后的用户命令时,在写入任何产物前停止。
58
+ - **跳过第 0 步与第 2 步的发现**:把两个来源记为 `unavailable`,并在产物 `## 发现清单` 用 `explicit` 来源登记本轮项。
59
+ - **第 3 步只跳过事件调用**:不发 `validation-run.started`,但逐项分类为 `executable|unavailable|unknown|unsafe|unresolved` 照常执行。
60
+ - **第 4 步照常执行**:将 evidence 文件写入同一 branch-only validation 目录,调用 `agent-infra-internal task-validate {branch-ref} --scope snapshot --format json --evidence-file {evidence-file} -- {command...}`。
61
+ - **第 5 步改写产物位置**:写入 `.agents/workspace/validations/{branch-slug}/validation-run.md|validation-run-r{N}.md`,沿用同一份 `reference/report-template.md`。`{branch-slug}` 由 `--branch` 的 ref 逐字符转换:保留 `[A-Za-z0-9._-]`,其余(含 `/`)一律换成 `-`,结果必须是单层目录名;若结果为空或仅由 `.` 组成,判为非法输入并在写入任何产物前停止。
62
+ - **跳过第 6、7 步**:不发 `validation-run.completed`,不做 `platform-comment sync`,不跑 `task-verify`。
63
+ - **第 8 步追加提示**:明确告知产物不可恢复、未登记账本,需带回持有任务工作区的宿主机后再由维护者执行 `complete-manual-validation`。
64
+
44
65
  ## 完成检查清单
45
66
 
46
67
  - [ ] 每个可执行项均已使用 `agent-infra-internal task-validate`,或已记录零项可执行
47
68
  - [ ] 已记录去敏 validation-run 证据
48
69
  - [ ] 未修改 PR 人工验证完成状态
49
- - [ ] 已更新 task.md 并通过完成校验
70
+ - [ ] 已更新 task.md 并通过完成校验(branch-only 改为:已记录 `recoverable: false` 且未触碰任务账本)
@@ -10,9 +10,12 @@ Read this file before parsing input, discovering manual-validation items, or con
10
10
  | A literal `--` is present but the target or command is empty | Invalid input; stop before `validation-run.started` |
11
11
  | No `--` and only a task ref | Automatic mode |
12
12
  | No `--` and additional positional arguments | Invalid or partial input; do not ignore arguments or guess a command |
13
+ | `--branch <ref>` is passed | Branch-only fallback; must also be explicit mode, so a missing command after `--` is invalid input |
13
14
 
14
15
  Explicit mode still reads available sources to map coverage, but it must not synthesize another command for the same target. Only automatic mode constructs actions for discovered items.
15
16
 
17
+ Branch-only has no task ref, so both discovery sources are unreadable and are recorded as `unavailable`; this round's items are listed under the `explicit` source and must not trigger the automatic-mode source stop conditions.
18
+
16
19
  ## Work Gate Matrix
17
20
 
18
21
  | mode | source state | gate |
@@ -58,7 +61,7 @@ Only `executable` items may run. Commands must not expose credentials, environme
58
61
  1. Invoke each executable item separately:
59
62
 
60
63
  ```bash
61
- agent-infra-internal task-validate {task-ref} --scope snapshot --format json -- {command...}
64
+ agent-infra-internal task-validate {task-ref|branch-ref} --scope snapshot --format json -- {command...}
62
65
  ```
63
66
 
64
67
  2. Only when the item or first-run evidence proves a dependency on uncommitted content, original mounts, or in-place permissions, explicitly invoke that item a second time with `--scope inplace` and record the reason.
@@ -10,9 +10,12 @@
10
10
  | 存在 literal `--`,但目标或命令为空 | 非法输入;在 `validation-run.started` 前停止 |
11
11
  | 不存在 `--`,且只有 task ref | 自动模式 |
12
12
  | 不存在 `--`,但还有位置参数 | 非法/半截输入;不得忽略参数或猜测命令 |
13
+ | 传入 `--branch <ref>` | branch-only 降级;必须同时是显式模式,缺少 `--` 后命令即非法输入 |
13
14
 
14
15
  显式模式也要读取可用来源以映射覆盖范围,但不得为同一目标另行合成命令。自动模式才为发现项构造动作。
15
16
 
17
+ branch-only 没有 task ref,两个发现来源都不可读,一律记为 `unavailable`;本轮项以 `explicit` 来源登记,不得据此触发自动模式的来源停止条件。
18
+
16
19
  ## 工作门禁矩阵
17
20
 
18
21
  | mode | source state | gate |
@@ -58,7 +61,7 @@
58
61
  1. 每个可执行项分别调用:
59
62
 
60
63
  ```bash
61
- agent-infra-internal task-validate {task-ref} --scope snapshot --format json -- {command...}
64
+ agent-infra-internal task-validate {task-ref|branch-ref} --scope snapshot --format json -- {command...}
62
65
  ```
63
66
 
64
67
  2. 仅当项目要求或首次证据证明依赖未提交内容、原挂载或原位权限时,再为该项显式调用一次 `--scope inplace`,并记录升级理由。
@@ -3,6 +3,7 @@
3
3
  ## Input Mode
4
4
 
5
5
  - Mode: `{explicit|automatic}`
6
+ - Context: `{task-bound|branch-only}` (branch-only also records `recoverable: false`)
6
7
  - Input decision: {sanitized-input-decision}
7
8
  - PR source status: `{success|no-op|failed|blocked}` / `{stable-code-or-none}`
8
9
 
@@ -10,8 +11,10 @@
10
11
 
11
12
  ```text
12
13
  $ agent-infra-internal task-snapshot {task-id} --format text
13
- {raw-output}
14
+ {command-summary-and-key-result}
14
15
  ```
16
+ > Follow `.agents/rules/evidence-reporting.md`: record command name, target scope, exit status, sanitized result, and coverage gap; do not paste complete argv or sensitive transcripts.
17
+ > Branch-only has no `{task-id}`: record `not-applicable (branch-only)` in this section.
15
18
 
16
19
  ## Validation Target
17
20
 
@@ -67,3 +70,4 @@ $ agent-infra-internal task-snapshot {task-id} --format text
67
70
  $ agent-infra-internal task-validate {task-ref} --scope {scope} --format json -- {redacted-command}
68
71
  {sanitized-result}
69
72
  ```
73
+ > Keep only the allowed public command and sanitized structured result; complete successful stdout is not default report content.
@@ -3,6 +3,7 @@
3
3
  ## 输入模式
4
4
 
5
5
  - 模式:`{explicit|automatic}`
6
+ - 上下文:`{task-bound|branch-only}`(branch-only 另记 `recoverable: false`)
6
7
  - 输入判定:{sanitized-input-decision}
7
8
  - PR 来源状态:`{success|no-op|failed|blocked}` / `{stable-code-or-none}`
8
9
 
@@ -10,8 +11,10 @@
10
11
 
11
12
  ```text
12
13
  $ agent-infra-internal task-snapshot {task-id} --format text
13
- {raw-output}
14
+ {command-summary-and-key-result}
14
15
  ```
16
+ > 按 `.agents/rules/evidence-reporting.md` 记录命令名称、目标范围、退出状态、sanitized result 和覆盖缺口;不得粘贴完整 argv 或敏感 transcript。
17
+ > branch-only 无 `{task-id}`,本段记 `not-applicable (branch-only)`。
15
18
 
16
19
  ## 验证目标
17
20
 
@@ -67,3 +70,4 @@ $ agent-infra-internal task-snapshot {task-id} --format text
67
70
  $ agent-infra-internal task-validate {task-ref} --scope {scope} --format json -- {redacted-command}
68
71
  {sanitized-result}
69
72
  ```
73
+ > 仅保留允许公开的命令与脱敏结构化结果;完整成功 stdout 不属于默认报告内容。
@@ -17,7 +17,7 @@ The orchestrator delegates only and never executes a stage skill itself. First r
17
17
  2. Before `begin-or-resume`, Codex selects a host. Without `AGENT_INFRA_CONTROL_TOKEN`, use direct-host. With task-bound control authority but no `AGENT_INFRA_CODEX_CONTROLLER_CONTEXT`, only run `codex-sandbox-controller run` with the complete policy and wait; the outer loop must not create a run, baseline, or receipt. With a context, run `verify-context` first. Stop on protocol, task/controller/process, lease, or source/profile discovery failures. Package/build/contract or hook/profile content drift is delivered as a structured warning and tells the user to rebuild the sandbox.
18
18
  3. Run `task-orchestration {task-id} begin-or-resume --client {client}` with the complete explicit policy. With no explicit policy, core reads that client's configured policy; existing runs use persisted policy. Disk state outside the complete current structure fails closed without rewriting; finish or clear active runs before upgrading. Stop on paused/completed results.
19
19
  4. Run `route`. On `completed`, run `agent-infra-internal task-verify {task-id} run-task.completed --format text` and stop. Only a `running` result with non-null `next` supplies action, role, round, artifact, requested model, and requested effort.
20
- 5. Codex runs `codex-lifecycle capability-arm --task-id {task-id}` once. The current loop's real PostToolUse must attest that ordinary tool response. Pass its marker token, the exact routed model, and the exact routed reasoning effort to `prepare --client {client} --requested-model {requestedModel} --requested-reasoning-effort {requestedReasoningEffort} --capability-token {token}`. Core first validates the exact routed model/effort, capability provenance, and controller binding, then captures a read-only snapshot, builds an in-memory prepared receipt, atomically consumes the token, and saves the prepared state with the capability session, turn, and tool-use origin. Activation then verifies that spawn belongs to the same session and turn and uses a distinct tool-use. Other clients use the same prepare without a token. Failure creates no baseline, receipt, or child.
20
+ 5. Codex runs `codex-lifecycle capability-arm --task-id {task-id}` once. The current loop's real PostToolUse must attest that ordinary tool response. Pass its `capabilityRef` marker, the exact routed model, and the exact routed reasoning effort to `prepare --client {client} --requested-model {requestedModel} --requested-reasoning-effort {requestedReasoningEffort} --capability-ref {capabilityRef}`. Core accepts only the phase attestation issued by the current controller issuer: `orchestration.prepare` reserves the capability, then `artifact-finalize-local` and `task-event.completed` validate and consume their own phases; the underlying capability is terminally consumed only after the completed commit is confirmed. Without current controller proof, direct-host returns `LOCAL_EXECUTION_AUTHORITY_UNAVAILABLE` and creates no recovery intent, baseline, receipt, or child. Activation then verifies that spawn belongs to the same session and turn and uses a distinct tool-use. Other clients use the same prepare without authority. Failure creates no baseline, receipt, or child.
21
21
  6. After prepare, run `task-orchestration <task-ref> dispatch` immediately before calling the fresh native child, then use route's exact model/effort and only the short task ref, skill, `--orchestrated`, and stage identity. The trusted hook-spawn first-observation time must fall between dispatch and the deadline. Its first provenance-sensitive command must be `await-activation --stage ... --round ... --artifact ... --role ...`; before `running`, it must not snapshot, emit stage-started, or write business files. The code stage may create a local checkpoint only through code-task's durable intent core; it must not delegate a separate commit stage or push. Only explicit `recover-prepared` may clear an expired orphan when the task fingerprint is exact and no matching unconsumed active lifecycle evidence remains.
22
22
  7. Codex uses SubagentStart/Stop and App Server actual evidence to activate, consume, and seal one receipt; trusted parent fallback must produce the same complete provenance. Timed-out waits do nothing. Advance only a sealed receipt and repeat step 4 only while running.
23
23
  8. Create a fresh child each round and never follow up with an old reviewer. Each requested/actual mismatch needs its own host fallback reason. Protocol, capability, receipt hook/evidence binding, source, controller, identity, ledger, or fingerprint failure pauses and fails closed; cross-root package/build/contract or hook/profile content drift is delivered as a warning instead of blocking natural evolution.
@@ -17,7 +17,7 @@ description: >
17
17
  2. Codex 在 `begin-or-resume` 前选择宿主:没有 `AGENT_INFRA_CONTROL_TOKEN` 时使用 direct-host;有 task-bound control authority 但没有 `AGENT_INFRA_CODEX_CONTROLLER_CONTEXT` 时,只调用 `agent-infra-internal codex-sandbox-controller run`(转发完整显式策略)并等待其终态,外层不得创建 run、baseline 或 receipt;已有 context 时先调用 `verify-context`。protocol、task/controller/process、lease 或 source/profile discovery 校验失败即停止;package/build/contract 或 hook/profile 内容漂移只输出结构化 warning,并提示用户重建 sandbox。
18
18
  3. 调用 `agent-infra-internal task-orchestration {task-id} begin-or-resume --client {client}` 并转发完整显式策略。完全没有显式策略时由核心读取当前 client 的 `agentClients[].orchestration`;existing run 使用持久化策略。磁盘状态不符合当前完整结构时核心失败关闭且不改写;升级前必须完成或清空 active run。仅当核心返回 `ORCHESTRATION_MODEL_POLICY_REQUIRED` 时,先用 `agent-client model-selection` 展示 complete/partial/interactive-only 来源,再一次收集完整策略;未回答则不创建 run。若为 paused/completed,按结构化结果停止。
19
19
  4. 调用 `route` 并读取结构化结果。若返回 `completed`,立即运行 `agent-infra-internal task-verify {task-id} run-task.completed --format text` 并停止;仅当返回 `running` 且 `next` 非空时读取唯一 action、role、round、artifact、`requestedModel` 和 `requestedReasoningEffort`,不得自行推断。
20
- 5. Codex 先调用一次 `agent-infra-internal codex-lifecycle capability-arm --task-id {task-id}`。该普通工具调用必须由当前 loop 的真实 PostToolUse 回写 attestation;把 route 返回的精确 model、effort 和 marker 中 token 一并传给 `prepare --client {client} --requested-model {requestedModel} --requested-reasoning-effort {requestedReasoningEffort} --capability-token {token}`。核心先校验精确的 model/effort、capability provenance 与 controller binding,再只读捕获快照、构造内存中的 prepared receipt,最后原子消费 token 并保存 prepared 状态,同时持久化 capability 的 session、turn、tool-use 来源。activation 再校验 spawn 与该来源属于同一 session/turn,且 spawn 使用独立的 tool-use。其他客户端直接调用同一 prepare(无 token)。任一失败不得创建 baseline、receipt 或 child。
20
+ 5. Codex 先调用一次 `agent-infra-internal codex-lifecycle capability-arm --task-id {task-id}`。该普通工具调用必须由当前 loop 的真实 PostToolUse 回写 attestation;把 route 返回的精确 model、effort 和 marker 中的 `capabilityRef` 一并传给 `prepare --client {client} --requested-model {requestedModel} --requested-reasoning-effort {requestedReasoningEffort} --capability-ref {capabilityRef}`。核心只接受当前 controller issuer 根据 typed lifecycle authority request 签发的 phase attestation:`orchestration.prepare` 只 reserve capability,随后由 `artifact-finalize-local` 和 `task-event.completed` 各自独立校验并消费 phase;底层 capability 仅在 completed commit 已确认后 terminal consume。没有 current controller proof 时 direct-host 返回 `LOCAL_EXECUTION_AUTHORITY_UNAVAILABLE`,不得创建 recovery intent、baseline、receipt 或 child。activation 再校验 spawn 与该来源属于同一 session/turn,且 spawn 使用独立的 tool-use。其他客户端直接调用同一 prepare(无 authority)。任一失败不得创建 baseline、receipt 或 child。
21
21
  6. prepare 成功后,在调用 fresh 原生子 Agent 的紧邻前一步执行 `task-orchestration <task-ref> dispatch`,再显式覆盖 route 返回的 model/effort;只传短任务引用、skill 名、`--orchestrated` 与 stage/round/artifact/role。可信 hook-spawn 首次观察时间必须位于 dispatch 与 deadline 之间。child 的第一条 provenance-sensitive 命令必须是 `await-activation --stage ... --round ... --artifact ... --role ...`;返回 running 前禁止 snapshot、阶段 started 或业务写入;代码阶段的本地 checkpoint 只能通过 code-task 的持久化 intent 核心完成,禁止单独委派 commit 阶段或推送。超时由核心暂停;崩溃遗留 prepared receipt 只能在 exact workspace fingerprint、无匹配的未消费 active lifecycle evidence 且 deadline 已过时显式 `recover-prepared`。
22
22
  7. Codex 用 SubagentStart/Stop 与 App Server actual evidence 激活、消费并封存唯一 receipt;受信 parent fallback 仍必须形成相同的完整 provenance。timed-out wait 无动作;只有 empty turns 或协议 `inProgress` 可等待,malformed、身份/传输错误或异常 terminal 均暂停。子 Agent 返回后只对 sealed receipt 调用 `advance`;只有 `running` 才重复步骤 4。
23
23
  8. 每轮创建新 child;禁止 follow-up 复用 reviewer。actual model/effort 与 requested 不同时必须有各自的宿主降级理由。protocol、capability、receipt 内 hook/evidence binding、source、controller、身份、账本或 fingerprint 异常都调用 `pause` 并失败关闭;跨根 package/build/contract 或 hook/profile 内容漂移按 warning 交付,不把自然演进差异当成硬失败。