@fitlab-ai/agent-infra 0.9.14 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/README.md +10 -0
  2. package/README.zh-CN.md +10 -0
  3. package/bin/internal-cli.sh +45 -0
  4. package/dist/bin/internal-cli.js +93 -30
  5. package/dist/lib/agent-clients/adapters/codex-lifecycle/capability-store.js +165 -27
  6. package/dist/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.js +9 -4
  7. package/dist/lib/agent-clients/adapters/codex-lifecycle/store.js +43 -3
  8. package/dist/lib/defaults.json +103 -103
  9. package/dist/lib/fs/durable-write.js +39 -0
  10. package/dist/lib/fs/file-lock.js +111 -0
  11. package/dist/lib/host-control/audit.js +19 -0
  12. package/dist/lib/host-control/client.js +142 -0
  13. package/dist/lib/host-control/command.js +49 -0
  14. package/dist/lib/host-control/path.js +160 -0
  15. package/dist/lib/host-control/secure-fs.js +140 -0
  16. package/dist/lib/host-control/server.js +159 -0
  17. package/dist/lib/host-control/service.js +112 -0
  18. package/dist/lib/init.js +11 -2
  19. package/dist/lib/internal/cli-route-inventory.js +4 -2
  20. package/dist/lib/internal/codex-lifecycle.js +6 -6
  21. package/dist/lib/internal/demo-promotion.js +322 -0
  22. package/dist/lib/internal/demo-transcript.js +454 -0
  23. package/dist/lib/internal/host-control.js +28 -0
  24. package/dist/lib/internal/manual-validation.js +331 -0
  25. package/dist/lib/internal/platform-pr.js +18 -4
  26. package/dist/lib/internal/release-workflow.js +63 -84
  27. package/dist/lib/internal/sandbox-control.js +149 -2
  28. package/dist/lib/internal/task-artifact.js +16 -263
  29. package/dist/lib/internal/task-create.js +6 -5
  30. package/dist/lib/internal/task-event.js +37 -37
  31. package/dist/lib/internal/task-lifecycle.js +2 -2
  32. package/dist/lib/internal/task-operation-registry.js +101 -4
  33. package/dist/lib/internal/task-review.js +11 -56
  34. package/dist/lib/internal/task-validate.js +30 -10
  35. package/dist/lib/owned-path.js +33 -0
  36. package/dist/lib/platform/check-status.js +11 -0
  37. package/dist/lib/platform/comment-safety.js +4 -1
  38. package/dist/lib/platform/completion-backfill.js +1 -1
  39. package/dist/lib/platform/github-data.js +241 -0
  40. package/dist/lib/platform/github-provider.js +15 -20
  41. package/dist/lib/platform/issue-comments.js +18 -12
  42. package/dist/lib/platform/issues.js +2 -180
  43. package/dist/lib/platform/pr-change-report.js +5 -4
  44. package/dist/lib/platform/pr-checks.js +12 -65
  45. package/dist/lib/platform/pr-summary.js +117 -33
  46. package/dist/lib/platform/pull-requests.js +5 -108
  47. package/dist/lib/platform/snapshots.js +2 -0
  48. package/dist/lib/platform/task-identities.js +2 -9
  49. package/dist/lib/platform/verification-sync.js +132 -143
  50. package/dist/lib/pr-review/evidence-grading.js +4 -8
  51. package/dist/lib/release/workflow.js +1 -1
  52. package/dist/lib/sandbox/commands/create.js +7 -2
  53. package/dist/lib/sandbox/commands/rm.js +19 -1511
  54. package/dist/lib/sandbox/control/audit.js +203 -0
  55. package/dist/lib/sandbox/control/client.js +93 -54
  56. package/dist/lib/sandbox/control/executor.js +129 -65
  57. package/dist/lib/sandbox/control/finalization-response.js +27 -0
  58. package/dist/lib/sandbox/control/identity-sentinel.js +107 -0
  59. package/dist/lib/sandbox/control/lifecycle.js +36 -2
  60. package/dist/lib/sandbox/control/native-file-lock.js +6 -98
  61. package/dist/lib/sandbox/control/protocol.js +55 -4
  62. package/dist/lib/sandbox/control/server.js +518 -127
  63. package/dist/lib/sandbox/control/state.js +64 -0
  64. package/dist/lib/sandbox/control/task-workflow.js +74 -0
  65. package/dist/lib/sandbox/control/workflow-executor.js +89 -0
  66. package/dist/lib/sandbox/index.js +1 -2
  67. package/dist/lib/sandbox/recovery.js +28 -4
  68. package/dist/lib/sandbox/removal.js +822 -0
  69. package/dist/lib/sandbox/task-cleanup.js +217 -0
  70. package/dist/lib/sandbox/workspace-identity.js +17 -1
  71. package/dist/lib/sandbox/workspace-view.js +13 -14
  72. package/dist/lib/task/activity-intent.js +2 -1
  73. package/dist/lib/task/activity-log.js +30 -24
  74. package/dist/lib/task/artifact-command.js +79 -0
  75. package/dist/lib/task/artifact-lifecycle.js +30 -28
  76. package/dist/lib/task/artifact-name.js +36 -0
  77. package/dist/lib/task/artifact-operations.js +29 -289
  78. package/dist/lib/task/artifact-receipts.js +3 -15
  79. package/dist/lib/task/artifact-recovery.js +430 -0
  80. package/dist/lib/task/artifact-repair-intent.js +134 -29
  81. package/dist/lib/task/artifact-schema.js +6 -14
  82. package/dist/lib/task/capabilities.js +12 -19
  83. package/dist/lib/task/codex-orchestration.js +71 -25
  84. package/dist/lib/task/commit-identity.js +28 -0
  85. package/dist/lib/task/commit-operation.js +33 -20
  86. package/dist/lib/task/control-authority.js +403 -6
  87. package/dist/lib/task/control-recovery.js +140 -0
  88. package/dist/lib/task/create-service.js +1 -8
  89. package/dist/lib/task/create.js +62 -9
  90. package/dist/lib/task/decision-details.js +2 -46
  91. package/dist/lib/task/delegation-receipts.js +64 -3
  92. package/dist/lib/task/events.js +275 -22
  93. package/dist/lib/task/finalization-state.js +9 -0
  94. package/dist/lib/task/human-override.js +8 -14
  95. package/dist/lib/task/implementation-inputs.js +3 -3
  96. package/dist/lib/task/intermediate-cleanup.js +441 -0
  97. package/dist/lib/task/invalidation.js +18 -65
  98. package/dist/lib/task/ledger-intents.js +7 -22
  99. package/dist/lib/task/ledger.js +1 -3
  100. package/dist/lib/task/lifecycle-recovery.js +549 -0
  101. package/dist/lib/task/lifecycle.js +31 -4
  102. package/dist/lib/task/local-artifact-finalization.js +197 -197
  103. package/dist/lib/task/manual-validation-completion.js +26 -0
  104. package/dist/lib/task/manual-validation-evidence.js +130 -0
  105. package/dist/lib/task/manual-validation-receipt.js +105 -0
  106. package/dist/lib/task/manual-validation-shared.js +40 -0
  107. package/dist/lib/task/manual-validation-transaction.js +243 -0
  108. package/dist/lib/task/markdown.js +47 -0
  109. package/dist/lib/task/orchestration.js +66 -19
  110. package/dist/lib/task/pr-delivery-fact.js +12 -56
  111. package/dist/lib/task/qualification-audit.js +20 -34
  112. package/dist/lib/task/recovery-warning.js +19 -0
  113. package/dist/lib/task/review-artifacts.js +2 -18
  114. package/dist/lib/task/review-command.js +26 -0
  115. package/dist/lib/task/review-finalization.js +175 -216
  116. package/dist/lib/task/review-fingerprint.js +2 -2
  117. package/dist/lib/task/sections.js +34 -56
  118. package/dist/lib/task/short-id.js +15 -7
  119. package/dist/lib/task/task-execution-lock.js +1 -1
  120. package/dist/lib/task/verification-engine.js +119 -337
  121. package/dist/lib/task/verification.js +1 -1
  122. package/dist/lib/task/workflow-command.js +16 -0
  123. package/dist/lib/task/workflow-warning-intents.js +0 -16
  124. package/dist/lib/task/workflow-warnings.js +28 -2
  125. package/dist/lib/update.js +2 -0
  126. package/dist/lib/version.js +1 -11
  127. package/dist/lifecycle-build-manifest.json +3 -3
  128. package/lib/agent-clients/adapters/codex-lifecycle/capability-store.ts +223 -33
  129. package/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.ts +10 -4
  130. package/lib/agent-clients/adapters/codex-lifecycle/store.ts +55 -3
  131. package/lib/fs/durable-write.ts +30 -0
  132. package/lib/fs/file-lock.ts +113 -0
  133. package/lib/host-control/audit.ts +22 -0
  134. package/lib/host-control/client.ts +172 -0
  135. package/lib/host-control/command.ts +60 -0
  136. package/lib/host-control/path.ts +167 -0
  137. package/lib/host-control/secure-fs.ts +135 -0
  138. package/lib/host-control/server.ts +180 -0
  139. package/lib/host-control/service.ts +133 -0
  140. package/lib/init.ts +15 -2
  141. package/lib/internal/cli-route-inventory.ts +4 -2
  142. package/lib/internal/codex-lifecycle.ts +6 -6
  143. package/lib/internal/demo-promotion.ts +354 -0
  144. package/lib/internal/demo-transcript.ts +419 -0
  145. package/lib/internal/host-control.ts +28 -0
  146. package/lib/internal/manual-validation.ts +315 -0
  147. package/lib/internal/platform-pr.ts +15 -4
  148. package/lib/internal/release-workflow.ts +74 -82
  149. package/lib/internal/sandbox-control.ts +162 -1
  150. package/lib/internal/task-artifact.ts +14 -217
  151. package/lib/internal/task-create.ts +5 -5
  152. package/lib/internal/task-event.ts +20 -11
  153. package/lib/internal/task-lifecycle.ts +4 -3
  154. package/lib/internal/task-operation-registry.ts +111 -4
  155. package/lib/internal/task-review.ts +9 -54
  156. package/lib/internal/task-validate.ts +26 -10
  157. package/lib/owned-path.ts +26 -0
  158. package/lib/platform/check-status.ts +9 -0
  159. package/lib/platform/comment-safety.ts +5 -0
  160. package/lib/platform/completion-backfill.ts +1 -1
  161. package/lib/platform/github-data.ts +322 -0
  162. package/lib/platform/github-provider.ts +15 -20
  163. package/lib/platform/issue-comments.ts +21 -14
  164. package/lib/platform/issues.ts +5 -246
  165. package/lib/platform/pr-change-report.ts +7 -5
  166. package/lib/platform/pr-checks.ts +13 -77
  167. package/lib/platform/pr-summary.ts +123 -35
  168. package/lib/platform/pull-requests.ts +6 -173
  169. package/lib/platform/snapshots.ts +53 -0
  170. package/lib/platform/task-identities.ts +3 -14
  171. package/lib/platform/verification-sync.ts +150 -156
  172. package/lib/pr-review/evidence-grading.ts +4 -9
  173. package/lib/release/workflow.ts +3 -3
  174. package/lib/sandbox/commands/create.ts +7 -6
  175. package/lib/sandbox/commands/rm.ts +21 -1895
  176. package/lib/sandbox/control/audit.ts +253 -0
  177. package/lib/sandbox/control/client.ts +109 -66
  178. package/lib/sandbox/control/executor.ts +134 -74
  179. package/lib/sandbox/control/finalization-response.ts +29 -0
  180. package/lib/sandbox/control/identity-sentinel.ts +137 -0
  181. package/lib/sandbox/control/lifecycle.ts +45 -3
  182. package/lib/sandbox/control/native-file-lock.ts +6 -107
  183. package/lib/sandbox/control/protocol.ts +80 -6
  184. package/lib/sandbox/control/server.ts +567 -132
  185. package/lib/sandbox/control/state.ts +86 -0
  186. package/lib/sandbox/control/task-workflow.ts +95 -0
  187. package/lib/sandbox/control/workflow-executor.ts +92 -0
  188. package/lib/sandbox/index.ts +1 -2
  189. package/lib/sandbox/recovery.ts +28 -5
  190. package/lib/sandbox/removal.ts +1142 -0
  191. package/lib/sandbox/task-cleanup.ts +209 -0
  192. package/lib/sandbox/workspace-identity.ts +19 -3
  193. package/lib/sandbox/workspace-view.ts +17 -15
  194. package/lib/task/activity-intent.ts +2 -2
  195. package/lib/task/activity-log.ts +27 -19
  196. package/lib/task/artifact-command.ts +85 -0
  197. package/lib/task/artifact-lifecycle.ts +31 -26
  198. package/lib/task/artifact-name.ts +55 -0
  199. package/lib/task/artifact-operations.ts +34 -310
  200. package/lib/task/artifact-receipts.ts +3 -14
  201. package/lib/task/artifact-recovery.ts +519 -0
  202. package/lib/task/artifact-repair-intent.ts +162 -33
  203. package/lib/task/artifact-schema.ts +5 -34
  204. package/lib/task/capabilities.ts +13 -22
  205. package/lib/task/codex-orchestration.ts +85 -24
  206. package/lib/task/commit-identity.ts +31 -0
  207. package/lib/task/commit-operation.ts +37 -20
  208. package/lib/task/control-authority.ts +540 -10
  209. package/lib/task/control-recovery.ts +186 -0
  210. package/lib/task/create-service.ts +1 -10
  211. package/lib/task/create.ts +63 -8
  212. package/lib/task/decision-details.ts +3 -71
  213. package/lib/task/delegation-receipts.ts +73 -2
  214. package/lib/task/events.ts +309 -24
  215. package/lib/task/finalization-state.ts +11 -0
  216. package/lib/task/human-override.ts +8 -16
  217. package/lib/task/implementation-inputs.ts +3 -3
  218. package/lib/task/intermediate-cleanup.ts +493 -0
  219. package/lib/task/invalidation.ts +18 -62
  220. package/lib/task/ledger-intents.ts +7 -24
  221. package/lib/task/ledger.ts +1 -3
  222. package/lib/task/lifecycle-recovery.ts +691 -0
  223. package/lib/task/lifecycle.ts +30 -5
  224. package/lib/task/local-artifact-finalization.ts +244 -234
  225. package/lib/task/manual-validation-completion.ts +40 -0
  226. package/lib/task/manual-validation-evidence.ts +209 -0
  227. package/lib/task/manual-validation-receipt.ts +156 -0
  228. package/lib/task/manual-validation-shared.ts +50 -0
  229. package/lib/task/manual-validation-transaction.ts +304 -0
  230. package/lib/task/markdown.ts +70 -0
  231. package/lib/task/orchestration.ts +84 -19
  232. package/lib/task/pr-delivery-fact.ts +15 -62
  233. package/lib/task/qualification-audit.ts +22 -33
  234. package/lib/task/recovery-warning.ts +21 -0
  235. package/lib/task/review-artifacts.ts +1 -20
  236. package/lib/task/review-command.ts +24 -0
  237. package/lib/task/review-finalization.ts +183 -292
  238. package/lib/task/review-fingerprint.ts +2 -2
  239. package/lib/task/sections.ts +33 -54
  240. package/lib/task/short-id.ts +27 -5
  241. package/lib/task/task-execution-lock.ts +1 -1
  242. package/lib/task/verification-engine.ts +113 -383
  243. package/lib/task/verification-types.ts +15 -0
  244. package/lib/task/verification.ts +1 -1
  245. package/lib/task/workflow-command.ts +17 -0
  246. package/lib/task/workflow-warning-intents.ts +0 -13
  247. package/lib/task/workflow-warnings.ts +21 -2
  248. package/lib/update.ts +6 -0
  249. package/lib/version.ts +1 -15
  250. package/package.json +6 -6
  251. package/templates/.agents/hooks/lifecycle-delegation.js +6 -6
  252. package/templates/.agents/rules/create-issue.en.md +1 -1
  253. package/templates/.agents/rules/create-issue.zh-CN.md +1 -1
  254. package/templates/.agents/rules/issue-sync.en.md +4 -2
  255. package/templates/.agents/rules/issue-sync.zh-CN.md +4 -3
  256. package/templates/.agents/rules/local-artifact-repair.en.md +46 -39
  257. package/templates/.agents/rules/local-artifact-repair.zh-CN.md +43 -36
  258. package/templates/.agents/rules/testing-discipline.en.md +2 -0
  259. package/templates/.agents/rules/testing-discipline.zh-CN.md +2 -0
  260. package/templates/.agents/scripts/package.json +3 -0
  261. package/templates/.agents/skills/analyze-task/SKILL.en.md +6 -6
  262. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +6 -6
  263. package/templates/.agents/skills/analyze-task/config/verify.en.json +1 -1
  264. package/templates/.agents/skills/analyze-task/config/verify.zh-CN.json +1 -1
  265. package/templates/.agents/skills/block-task/SKILL.en.md +2 -2
  266. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +2 -2
  267. package/templates/.agents/skills/block-task/config/verify.json +1 -1
  268. package/templates/.agents/skills/cancel-task/SKILL.en.md +3 -3
  269. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +3 -3
  270. package/templates/.agents/skills/cancel-task/config/verify.json +1 -1
  271. package/templates/.agents/skills/code-task/SKILL.en.md +7 -7
  272. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +7 -7
  273. package/templates/.agents/skills/code-task/config/verify.en.json +1 -1
  274. package/templates/.agents/skills/code-task/config/verify.zh-CN.json +1 -1
  275. package/templates/.agents/skills/commit/reference/issue-metadata-sync.en.md +1 -1
  276. package/templates/.agents/skills/commit/reference/issue-metadata-sync.zh-CN.md +1 -1
  277. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +33 -21
  278. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +33 -21
  279. package/templates/.agents/skills/complete-manual-validation/config/verify.en.json +1 -1
  280. package/templates/.agents/skills/complete-manual-validation/config/verify.zh-CN.json +1 -1
  281. package/templates/.agents/skills/complete-manual-validation/reference/report-template.en.md +2 -0
  282. package/templates/.agents/skills/complete-manual-validation/reference/report-template.zh-CN.md +2 -0
  283. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +16 -7
  284. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +16 -7
  285. package/templates/.agents/skills/complete-task/SKILL.en.md +3 -3
  286. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +3 -3
  287. package/templates/.agents/skills/complete-task/config/verify.en.json +2 -2
  288. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +2 -2
  289. package/templates/.agents/skills/complete-task/reference/external-delivery.en.md +1 -1
  290. package/templates/.agents/skills/complete-task/reference/external-delivery.zh-CN.md +1 -1
  291. package/templates/.agents/skills/create-pr/SKILL.en.md +2 -2
  292. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +2 -2
  293. package/templates/.agents/skills/create-pr/config/verify.json +1 -1
  294. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +2 -2
  295. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +2 -2
  296. package/templates/.agents/skills/create-task/SKILL.en.md +5 -5
  297. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +5 -5
  298. package/templates/.agents/skills/create-task/config/verify.json +1 -1
  299. package/templates/.agents/skills/import-issue/SKILL.en.md +8 -8
  300. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +8 -8
  301. package/templates/.agents/skills/import-issue/config/verify.json +2 -2
  302. package/templates/.agents/skills/plan-task/SKILL.en.md +4 -4
  303. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +4 -4
  304. package/templates/.agents/skills/plan-task/config/verify.en.json +1 -1
  305. package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +1 -1
  306. package/templates/.agents/skills/release/SKILL.en.md +7 -3
  307. package/templates/.agents/skills/release/SKILL.zh-CN.md +7 -3
  308. package/templates/.agents/skills/restore-task/SKILL.en.md +2 -2
  309. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +2 -2
  310. package/templates/.agents/skills/restore-task/config/verify.json +1 -1
  311. package/templates/.agents/skills/review-analysis/SKILL.en.md +2 -2
  312. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +2 -2
  313. package/templates/.agents/skills/review-analysis/config/verify.en.json +1 -1
  314. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +1 -1
  315. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +7 -7
  316. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +6 -6
  317. package/templates/.agents/skills/review-code/SKILL.en.md +2 -2
  318. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +2 -2
  319. package/templates/.agents/skills/review-code/config/verify.en.json +1 -1
  320. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -1
  321. package/templates/.agents/skills/review-code/reference/report-template.en.md +12 -12
  322. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +12 -12
  323. package/templates/.agents/skills/review-plan/SKILL.en.md +2 -2
  324. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +2 -2
  325. package/templates/.agents/skills/review-plan/config/verify.en.json +1 -1
  326. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +1 -1
  327. package/templates/.agents/skills/review-plan/reference/report-template.en.md +7 -7
  328. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +7 -7
  329. package/templates/.agents/skills/review-pr/config/verify.en.json +1 -1
  330. package/templates/.agents/skills/review-pr/config/verify.zh-CN.json +1 -1
  331. package/templates/.agents/skills/review-pr/reference/evidence-grading.en.md +3 -3
  332. package/templates/.agents/skills/review-pr/reference/evidence-grading.zh-CN.md +3 -3
  333. package/templates/.agents/skills/run-manual-validation/SKILL.en.md +20 -3
  334. package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +20 -3
  335. package/templates/.agents/skills/run-manual-validation/config/verify.en.json +1 -1
  336. package/templates/.agents/skills/run-manual-validation/config/verify.zh-CN.json +1 -1
  337. package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.en.md +4 -1
  338. package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.zh-CN.md +4 -1
  339. package/templates/.agents/skills/run-manual-validation/reference/report-template.en.md +2 -0
  340. package/templates/.agents/skills/run-manual-validation/reference/report-template.zh-CN.md +2 -0
  341. package/templates/.agents/skills/run-task/SKILL.en.md +1 -1
  342. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +1 -1
  343. package/templates/.agents/skills/test/SKILL.en.md +17 -6
  344. package/templates/.agents/skills/test/SKILL.zh-CN.md +17 -6
  345. package/templates/.agents/templates/task.en.md +1 -1
  346. package/templates/.agents/templates/task.zh-CN.md +1 -1
  347. package/templates/.claude/commands/import-issue.en.md +1 -1
  348. package/templates/.claude/commands/import-issue.zh-CN.md +1 -1
  349. package/templates/.claude/commands/restore-task.en.md +1 -1
  350. package/templates/.claude/commands/restore-task.zh-CN.md +1 -1
  351. package/templates/.claude/commands/run-manual-validation.en.md +1 -1
  352. package/templates/.claude/commands/run-manual-validation.zh-CN.md +1 -1
  353. package/dist/lib/platform/adapters.js +0 -56
  354. package/lib/platform/adapters.ts +0 -197
@@ -14,6 +14,8 @@ 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
 
19
21
  ### Persisted Report Evidence
@@ -23,8 +25,9 @@ Before generating a validation report, read `.agents/rules/evidence-reporting.md
23
25
  - Select the validation mode, call the sole mechanical entry point, and record evidence; do not mark PR manual validation complete.
24
26
  - `complete-manual-validation` remains the maintainer's final registration after coverage is judged sufficient.
25
27
  - Never manipulate temporary worktrees, leases, or containers directly; only call `agent-infra-internal task-validate`.
26
- - 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.
27
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.
28
31
 
29
32
  ## Step 0: State Check (pre-execution hard gate)
30
33
 
@@ -34,20 +37,34 @@ Resolve the task reference, then run this command and record the task/artifact s
34
37
  agent-infra-internal task-snapshot {task-id} --format text
35
38
  ```
36
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
+
37
42
  ## Steps
38
43
 
39
44
  1. Read `reference/discovery-and-execution.md` and parse the input mode. Stop before started without an artifact for invalid or partial input.
40
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.
41
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`.
42
- 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.
43
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.
44
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}`.
45
50
  7. Run `agent-infra-internal task-verify {task-id} validation-run.completed --artifact {artifact} --format text`; fix failures and rerun it.
46
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`.
47
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
+
48
65
  ## Completion Checklist
49
66
 
50
67
  - [ ] Used `agent-infra-internal task-validate` for every executable item, or recorded that none were executable
51
68
  - [ ] Recorded sanitized validation-run evidence
52
69
  - [ ] Did not change PR manual validation completion state
53
- - [ ] 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,6 +14,8 @@ 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
 
19
21
  ### 持久化报告证据
@@ -23,8 +25,9 @@ description: >
23
25
  - 本技能负责选择校验模式、调用唯一机械入口并记录证据;不把 PR 人工校验标为完成。
24
26
  - `complete-manual-validation` 仍是维护者确认覆盖充分后的最终登记入口。
25
27
  - 禁止直接操作临时 worktree、lease 或 container;只调用 `agent-infra-internal task-validate`。
26
- - 产物不得记录 token、环境变量、完整 argv、绝对用户路径或原始 transcript。
28
+ - 产物不得记录 token、环境变量、完整 argv、绝对用户路径或原始 transcript;每个验证目标必须由核心写入同一 current-only evidence envelope。
27
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`;产物须带回宿主机,由维护者登记。
28
31
 
29
32
  ## 第 0 步:状态核对(执行前硬约束)
30
33
 
@@ -34,20 +37,34 @@ description: >
34
37
  agent-infra-internal task-snapshot {task-id} --format text
35
38
  ```
36
39
 
40
+ branch-only 无 `{task-id}`,跳过本步,并在产物 `## 状态核对` 记录 `not-applicable (branch-only)`。
41
+
37
42
  ## 执行步骤
38
43
 
39
44
  1. 读取 `reference/discovery-and-execution.md`,解析输入模式;非法或半截输入在 started 前停止,不写产物。
40
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 前停止;合法显式模式始终以用户命令作为有效工作继续。
41
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`。
42
- 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 文件。零项可执行时不运行伪造命令,但仍继续产出覆盖缺口证据。
43
48
  5. 读取 `reference/report-template.md`,创建 `validation-run.md|validation-run-r{N}.md`;记录输入模式、发现清单、逐项结果、CLI JSON allowlist 与去敏摘要。
44
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}`。
45
50
  7. 运行 `agent-infra-internal task-verify {task-id} validation-run.completed --artifact {artifact} --format text`;未通过则修复后重跑。
46
51
  8. 告知用户证据路径、覆盖缺口和验证结果;明确仍需维护者判断是否执行 `complete-manual-validation`。读取 `.agents/rules/next-step-output.md`,最后一行输出 `Completed at`。
47
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
+
48
65
  ## 完成检查清单
49
66
 
50
67
  - [ ] 每个可执行项均已使用 `agent-infra-internal task-validate`,或已记录零项可执行
51
68
  - [ ] 已记录去敏 validation-run 证据
52
69
  - [ ] 未修改 PR 人工验证完成状态
53
- - [ ] 已更新 task.md 并通过完成校验
70
+ - [ ] 已更新 task.md 并通过完成校验(branch-only 改为:已记录 `recoverable: false` 且未触碰任务账本)
@@ -12,7 +12,7 @@
12
12
  "activity-log": { "expected_action_pattern": "Run Manual Validation \\(Round \\d+\\)" },
13
13
  "review-ledger": { "stage_scope": ["analysis", "plan", "code"] },
14
14
  "platform-sync": {
15
- "when": "issue_number_exists",
15
+ "when": "platform_issue_identity_exists",
16
16
  "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
17
17
  "verify_comment_content": true,
18
18
  "verify_task_comment_content": true,
@@ -12,7 +12,7 @@
12
12
  "activity-log": { "expected_action_pattern": "Run Manual Validation \\(Round \\d+\\)" },
13
13
  "review-ledger": { "stage_scope": ["analysis", "plan", "code"] },
14
14
  "platform-sync": {
15
- "when": "issue_number_exists",
15
+ "when": "platform_issue_identity_exists",
16
16
  "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
17
17
  "verify_comment_content": true,
18
18
  "verify_task_comment_content": true,
@@ -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
 
@@ -13,6 +14,7 @@ $ agent-infra-internal task-snapshot {task-id} --format text
13
14
  {command-summary-and-key-result}
14
15
  ```
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.
16
18
 
17
19
  ## Validation Target
18
20
 
@@ -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
 
@@ -13,6 +14,7 @@ $ agent-infra-internal task-snapshot {task-id} --format text
13
14
  {command-summary-and-key-result}
14
15
  ```
15
16
  > 按 `.agents/rules/evidence-reporting.md` 记录命令名称、目标范围、退出状态、sanitized result 和覆盖缺口;不得粘贴完整 argv 或敏感 transcript。
17
+ > branch-only 无 `{task-id}`,本段记 `not-applicable (branch-only)`。
16
18
 
17
19
  ## 验证目标
18
20
 
@@ -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 交付,不把自然演进差异当成硬失败。
@@ -23,11 +23,11 @@ Execute the project's full test workflow including compilation checks and unit t
23
23
 
24
24
  Confirm no compilation errors.
25
25
 
26
- ## 2. Run Unit Tests by Layer
26
+ ## 2. Run Tests by Layer
27
27
 
28
- This project uses three test layers as an optional optimization; if the test suite is small, all layers may map to the same full test command.
28
+ This project uses test layers as an optional optimization; if the test suite is small, all layers may map to the same full test command.
29
29
 
30
- ### fast smoke (target <5s)
30
+ ### fast smoke (reference target <10s)
31
31
 
32
32
  ```bash
33
33
  # TODO: Replace with this project's fast smoke subset command
@@ -38,7 +38,16 @@ This project uses three test layers as an optional optimization; if the test sui
38
38
 
39
39
  Use for code-task inner loops when the project provides a build-free fast path. It should cover the same tests as smoke while skipping redundant compilation or generation.
40
40
 
41
- ### smoke (target <5s)
41
+ ### platform-smoke (cross-platform boundary)
42
+
43
+ ```bash
44
+ # TODO: Replace with this project's cross-platform integration subset command
45
+ # npm run test:platform-smoke:fast (Node.js)
46
+ ```
47
+
48
+ Use for real CLI, git, shell, or subprocess tests moved out of the unit tier while preserving their original Windows/macOS execution boundary.
49
+
50
+ ### smoke (reference target <10s)
42
51
 
43
52
  ```bash
44
53
  # TODO: Replace with this project's smoke subset command
@@ -52,7 +61,7 @@ Use for:
52
61
  - save-and-run / frequent feedback when no fast path exists
53
62
  - project structure, configuration, and template contract checks
54
63
 
55
- ### core (target <15s)
64
+ ### core (reference target <95s)
56
65
 
57
66
  ```bash
58
67
  # TODO: Replace with this project's core subset command
@@ -66,7 +75,7 @@ Use for:
66
75
  - final verification before writing code.md / code-r{N}.md
67
76
  - local gate before pushing a PR
68
77
 
69
- ### full (complete test suite)
78
+ ### full (reference target <100s)
70
79
 
71
80
  ```bash
72
81
  # TODO: Replace with this project's full test command
@@ -83,6 +92,8 @@ Use for:
83
92
 
84
93
  If the project is not layered yet, smoke / core / full may all map to the same full test command; layering is a feedback-speed optimization, not a prerequisite for using the collaboration workflow.
85
94
 
95
+ Reference targets are feedback budgets, not merge gates. If coverage is collected, document whether it runs only on the main branch and whether it blocks acceptance.
96
+
86
97
  ## 3. Output Results
87
98
 
88
99
  Report test result summary:
@@ -21,11 +21,11 @@ description: >
21
21
 
22
22
  确认没有编译错误。
23
23
 
24
- ## 2. 运行单元测试(按层级选择)
24
+ ## 2. 运行测试(按层级选择)
25
25
 
26
- 三层测试是可选的反馈速度优化;如果测试套件较小,所有层级都可以映射到同一个完整测试命令。
26
+ 测试层级是可选的反馈速度优化;如果测试套件较小,所有层级都可以映射到同一个完整测试命令。
27
27
 
28
- ### fast smoke(目标 <5s)
28
+ ### fast smoke(参考目标 <10s)
29
29
 
30
30
  ```bash
31
31
  # TODO:替换为项目的 fast smoke 子集命令
@@ -36,7 +36,16 @@ description: >
36
36
 
37
37
  当项目提供不重复构建的快速路径时,用于 code-task 内循环。它应覆盖与 smoke 相同的测试,同时跳过重复的编译或生成步骤。
38
38
 
39
- ### smoke(目标 <5s)
39
+ ### platform-smoke(跨平台边界)
40
+
41
+ ```bash
42
+ # TODO:替换为项目的跨平台 integration 子集命令
43
+ # npm run test:platform-smoke:fast (Node.js)
44
+ ```
45
+
46
+ 用于承接从 unit 层迁出的真实 CLI、git、shell 或子进程测试,同时保留其原有 Windows/macOS 执行边界。
47
+
48
+ ### smoke(参考目标 <10s)
40
49
 
41
50
  ```bash
42
51
  # TODO:替换为项目的 smoke 子集命令
@@ -50,7 +59,7 @@ description: >
50
59
  - 项目没有 fast 路径时的保存即跑 / 频繁反馈
51
60
  - 仅断言项目结构、配置、模板契约
52
61
 
53
- ### core(目标 <15s)
62
+ ### core(参考目标 <95s)
54
63
 
55
64
  ```bash
56
65
  # TODO:替换为项目的 core 子集命令
@@ -64,7 +73,7 @@ description: >
64
73
  - 写 code.md / code-r{N}.md 报告前的最终验证
65
74
  - 推送 PR 前的本地把关
66
75
 
67
- ### full(完整测试套件)
76
+ ### full(参考目标 <100s)
68
77
 
69
78
  ```bash
70
79
  # TODO:替换为项目的完整测试命令
@@ -81,6 +90,8 @@ description: >
81
90
 
82
91
  如果项目尚未分层,smoke / core / full 可以全部使用完整测试命令;分层不是使用协作工作流的前置条件。
83
92
 
93
+ 参考目标是反馈预算,不是合并门禁。如果采集覆盖率,应说明是否仅在 main 分支运行,以及是否阻塞验收。
94
+
84
95
  ## 3. 输出结果
85
96
 
86
97
  报告测试结果摘要:
@@ -13,7 +13,7 @@ start_date: # Optional Issue field for Feature: YYYY-MM-DD
13
13
  target_date: # Optional Issue field for Feature: YYYY-MM-DD
14
14
  current_step: requirement-analysis # requirement-analysis | requirement-analysis-review | technical-design | technical-design-review | code | code-review | completed
15
15
  assigned_to: # claude | codex | antigravity | opencode | human
16
- pr_delivery_fact: '{"version":1,"state":"unbound","reason":"initial"}'
16
+ pr_delivery_fact: '{"version":2,"state":"unbound","reason":"initial"}'
17
17
  delivery_remote: origin # Git remote used to deliver the task branch
18
18
  delivery_base_ref: main # Target branch for the task PR
19
19
  checkpoint_commit: # Most recent local checkpoint commit
@@ -13,7 +13,7 @@ start_date: # Feature 可选 Issue 字段:YYYY-MM-DD
13
13
  target_date: # Feature 可选 Issue 字段:YYYY-MM-DD
14
14
  current_step: requirement-analysis # requirement-analysis | requirement-analysis-review | technical-design | technical-design-review | code | code-review | completed
15
15
  assigned_to: # claude | codex | antigravity | opencode | human
16
- pr_delivery_fact: '{"version":1,"state":"unbound","reason":"initial"}'
16
+ pr_delivery_fact: '{"version":2,"state":"unbound","reason":"initial"}'
17
17
  delivery_remote: origin # 任务分支交付使用的 Git remote
18
18
  delivery_base_ref: main # 任务 PR 的目标分支
19
19
  checkpoint_commit: # 最近一次本地 checkpoint commit
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Import an Issue and create a task"
3
- usage: "/import-issue <issue-number>"
3
+ usage: "/import-issue <issue-token>"
4
4
  ---
5
5
 
6
6
  Read and execute the import-issue skill from `.agents/skills/import-issue/SKILL.md`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "从 Issue 导入并创建任务"
3
- usage: "/import-issue <issue-number>"
3
+ usage: "/import-issue <issue-token>"
4
4
  ---
5
5
 
6
6
  读取并执行 `.agents/skills/import-issue/SKILL.md` 中的 import-issue 技能。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Restore local task files from Issue comments"
3
- usage: "/restore-task <issue-number> [task-id]"
3
+ usage: "/restore-task <issue-token> [task-id]"
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "从 Issue 评论还原本地任务文件"
3
- usage: "/restore-task <issue-number> [task-id]"
3
+ usage: "/restore-task <issue-token> [task-id]"
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Run host-side task validation and record sanitized evidence"
3
- usage: "/run-manual-validation [--task <ref> | -t <ref>] [--scope snapshot|inplace] [--timeout <ms>] [--format text|json] -- <command...>"
3
+ usage: "/run-manual-validation [--task <ref> | -t <ref> | --branch <ref>] [--scope snapshot|inplace] [--timeout <ms>] [--format text|json] -- <command...>"
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "运行宿主侧任务校验并记录去敏证据"
3
- usage: "/run-manual-validation [--task <ref> | -t <ref>] [--scope snapshot|inplace] [--timeout <ms>] [--format text|json] -- <command...>"
3
+ usage: "/run-manual-validation [--task <ref> | -t <ref> | --branch <ref>] [--scope snapshot|inplace] [--timeout <ms>] [--format text|json] -- <command...>"
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
@@ -1,56 +0,0 @@
1
- const adapters = new Map();
2
- function registerPlatformAdapter(adapter) {
3
- if (!adapter.type.trim())
4
- throw new Error('Platform adapter type is required');
5
- adapters.set(adapter.type, adapter);
6
- }
7
- function getPlatformAdapter(type) {
8
- return type ? adapters.get(type) ?? null : null;
9
- }
10
- function registerPlatformCapabilities(type, capabilities) {
11
- const adapter = adapters.get(type) ?? { type };
12
- adapters.set(type, { ...adapter, ...capabilities });
13
- }
14
- function hasPlatformCapability(type, capability) {
15
- const adapter = getPlatformAdapter(type);
16
- if (capability === 'change-request')
17
- return typeof adapter?.inspectChangeRequest === 'function';
18
- if (capability === 'issue-closing-change-requests')
19
- return typeof adapter?.inspectIssueClosingChangeRequests === 'function';
20
- if (capability === 'required-checks')
21
- return typeof adapter?.inspectRequiredChecks === 'function';
22
- return typeof adapter?.resolveChangeRequestGitEvidence === 'function';
23
- }
24
- function inspectPlatformIssueClosingChangeRequests(type, context) {
25
- const adapter = getPlatformAdapter(type);
26
- return adapter?.inspectIssueClosingChangeRequests?.(context) ??
27
- unsupported(type, 'issue closing change-request inspection');
28
- }
29
- function unsupported(type, capability) {
30
- return {
31
- ok: false,
32
- error: {
33
- code: 'PLATFORM_CAPABILITY_UNSUPPORTED',
34
- message: `Platform '${type || 'none'}' does not provide ${capability}`,
35
- retryable: false
36
- }
37
- };
38
- }
39
- function inspectPlatformChangeRequest(type, context) {
40
- const adapter = getPlatformAdapter(type);
41
- return adapter?.inspectChangeRequest?.(context) ?? unsupported(type, 'change-request inspection');
42
- }
43
- function inspectPlatformRequiredChecks(type, context) {
44
- const adapter = getPlatformAdapter(type);
45
- return adapter?.inspectRequiredChecks?.(context) ?? unsupported(type, 'required-checks inspection');
46
- }
47
- function resolvePlatformChangeRequestGitEvidence(type, context) {
48
- const adapter = getPlatformAdapter(type);
49
- return adapter?.resolveChangeRequestGitEvidence?.(context) ??
50
- unsupported(type, 'change-request Git evidence');
51
- }
52
- function listPlatformAdapters() {
53
- return [...adapters.keys()].sort();
54
- }
55
- export { getPlatformAdapter, hasPlatformCapability, inspectPlatformChangeRequest, inspectPlatformIssueClosingChangeRequests, inspectPlatformRequiredChecks, listPlatformAdapters, registerPlatformAdapter, registerPlatformCapabilities, resolvePlatformChangeRequestGitEvidence };
56
- //# sourceMappingURL=adapters.js.map