@fitlab-ai/agent-infra 0.11.14 → 0.12.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 (271) hide show
  1. package/bin/cli.ts +1 -1
  2. package/dist/bin/cli.js +1 -1
  3. package/dist/bin/internal-cli.js +6 -1
  4. package/dist/lib/agent-clients/adapters/codex-lifecycle/recovery.js +6 -6
  5. package/dist/lib/agent-clients/adapters/codex-lifecycle/store.js +8 -18
  6. package/dist/lib/agent-clients/adapters/codex-orchestration.js +1 -1
  7. package/dist/lib/decide.js +2 -7
  8. package/dist/lib/internal/cli-route-inventory.js +3 -0
  9. package/dist/lib/internal/manual-validation.js +8 -16
  10. package/dist/lib/internal/platform-comment.js +3 -2
  11. package/dist/lib/internal/task-activity.js +1 -12
  12. package/dist/lib/internal/task-event.js +1 -12
  13. package/dist/lib/internal/task-finalization.js +2 -2
  14. package/dist/lib/internal/task-ledger.js +1 -12
  15. package/dist/lib/internal/task-operation-registry.js +2 -1
  16. package/dist/lib/internal/task-qualification.js +6 -15
  17. package/dist/lib/internal/task-review.js +3 -16
  18. package/dist/lib/internal/task-short-id.js +2 -1
  19. package/dist/lib/internal/task-verify.js +1 -11
  20. package/dist/lib/internal/task-warning.js +1 -12
  21. package/dist/lib/internal/task-workspace.js +43 -0
  22. package/dist/lib/merge.js +4 -3
  23. package/dist/lib/platform/pr-change-report.js +10 -3
  24. package/dist/lib/platform/pr-summary.js +6 -15
  25. package/dist/lib/platform/pull-requests.js +3 -15
  26. package/dist/lib/pr-review/evidence-grading.js +3 -2
  27. package/dist/lib/process-data/index.js +18 -6
  28. package/dist/lib/process-data/sources.js +6 -0
  29. package/dist/lib/run/index.js +3 -2
  30. package/dist/lib/sandbox/commands/create.js +5 -1
  31. package/dist/lib/sandbox/commands/enter.js +1 -1
  32. package/dist/lib/sandbox/commands/list-running.js +2 -1
  33. package/dist/lib/sandbox/control/client.js +8 -13
  34. package/dist/lib/sandbox/control/completed-reentry.js +2 -1
  35. package/dist/lib/sandbox/control/lifecycle.js +2 -21
  36. package/dist/lib/sandbox/control/task-view.js +4 -2
  37. package/dist/lib/sandbox/mounts.js +4 -4
  38. package/dist/lib/sandbox/recovery.js +26 -16
  39. package/dist/lib/sandbox/removal.js +3 -10
  40. package/dist/lib/sandbox/task-resolver.js +9 -6
  41. package/dist/lib/sandbox/workspace-identity.js +36 -20
  42. package/dist/lib/sandbox/workspace-view.js +29 -22
  43. package/dist/lib/task/activity-intent.js +2 -12
  44. package/dist/lib/task/artifact-lifecycle.js +17 -11
  45. package/dist/lib/task/artifact-operations.js +41 -49
  46. package/dist/lib/task/capabilities.js +2 -2
  47. package/dist/lib/task/commands/ls.js +4 -3
  48. package/dist/lib/task/commands/status.js +1 -1
  49. package/dist/lib/task/commit-operation.js +6 -6
  50. package/dist/lib/task/control-authority.js +32 -32
  51. package/dist/lib/task/create-service.js +2 -4
  52. package/dist/lib/task/create.js +12 -65
  53. package/dist/lib/task/delegation-receipts.js +1 -1
  54. package/dist/lib/task/delivery.js +2 -8
  55. package/dist/lib/task/events.js +5 -31
  56. package/dist/lib/task/finalization.js +17 -22
  57. package/dist/lib/task/lifecycle.js +38 -49
  58. package/dist/lib/task/local-artifact-finalization.js +1 -2
  59. package/dist/lib/task/orchestration.js +24 -57
  60. package/dist/lib/task/platform-operation-recovery.js +1 -2
  61. package/dist/lib/task/resolve-ref.js +17 -12
  62. package/dist/lib/task/review-finalization.js +2 -35
  63. package/dist/lib/task/review-identity.js +3 -1
  64. package/dist/lib/task/short-id.js +12 -10
  65. package/dist/lib/task/verification-engine.js +19 -58
  66. package/dist/lib/task/workspace-root.js +59 -0
  67. package/dist/lib/task/workspace-snapshot.js +4 -3
  68. package/dist/lifecycle-build-manifest.json +3 -3
  69. package/lib/agent-clients/adapters/codex-lifecycle/recovery.ts +6 -6
  70. package/lib/agent-clients/adapters/codex-lifecycle/store.ts +8 -34
  71. package/lib/agent-clients/adapters/codex-orchestration.ts +1 -1
  72. package/lib/decide.ts +2 -7
  73. package/lib/internal/cli-route-inventory.ts +2 -0
  74. package/lib/internal/manual-validation.ts +8 -19
  75. package/lib/internal/platform-comment.ts +3 -2
  76. package/lib/internal/task-activity.ts +1 -10
  77. package/lib/internal/task-event.ts +1 -10
  78. package/lib/internal/task-finalization.ts +2 -2
  79. package/lib/internal/task-ledger.ts +1 -10
  80. package/lib/internal/task-operation-registry.ts +2 -1
  81. package/lib/internal/task-qualification.ts +5 -11
  82. package/lib/internal/task-review.ts +3 -14
  83. package/lib/internal/task-short-id.ts +2 -1
  84. package/lib/internal/task-verify.ts +1 -9
  85. package/lib/internal/task-warning.ts +1 -10
  86. package/lib/internal/task-workspace.ts +39 -0
  87. package/lib/merge.ts +4 -3
  88. package/lib/platform/pr-change-report.ts +9 -3
  89. package/lib/platform/pr-summary.ts +7 -16
  90. package/lib/platform/pull-requests.ts +3 -24
  91. package/lib/pr-review/evidence-grading.ts +3 -2
  92. package/lib/process-data/index.ts +17 -5
  93. package/lib/process-data/sources.ts +6 -0
  94. package/lib/run/index.ts +3 -2
  95. package/lib/sandbox/commands/create.ts +5 -1
  96. package/lib/sandbox/commands/enter.ts +1 -1
  97. package/lib/sandbox/commands/list-running.ts +2 -1
  98. package/lib/sandbox/control/client.ts +7 -12
  99. package/lib/sandbox/control/completed-reentry.ts +2 -1
  100. package/lib/sandbox/control/lifecycle.ts +4 -21
  101. package/lib/sandbox/control/task-view.ts +4 -2
  102. package/lib/sandbox/mounts.ts +4 -4
  103. package/lib/sandbox/recovery.ts +26 -18
  104. package/lib/sandbox/removal.ts +3 -26
  105. package/lib/sandbox/task-resolver.ts +9 -6
  106. package/lib/sandbox/workspace-identity.ts +42 -18
  107. package/lib/sandbox/workspace-view.ts +28 -20
  108. package/lib/task/activity-intent.ts +3 -17
  109. package/lib/task/artifact-lifecycle.ts +39 -11
  110. package/lib/task/artifact-operations.ts +28 -35
  111. package/lib/task/capabilities.ts +2 -2
  112. package/lib/task/commands/ls.ts +4 -3
  113. package/lib/task/commands/status.ts +1 -1
  114. package/lib/task/commit-operation.ts +5 -6
  115. package/lib/task/control-authority.ts +29 -35
  116. package/lib/task/create-service.ts +2 -4
  117. package/lib/task/create.ts +10 -51
  118. package/lib/task/delegation-receipts.ts +1 -1
  119. package/lib/task/delivery.ts +2 -10
  120. package/lib/task/events.ts +5 -32
  121. package/lib/task/finalization.ts +16 -24
  122. package/lib/task/lifecycle.ts +40 -51
  123. package/lib/task/local-artifact-finalization.ts +1 -4
  124. package/lib/task/orchestration.ts +31 -80
  125. package/lib/task/platform-operation-recovery.ts +1 -2
  126. package/lib/task/resolve-ref.ts +18 -12
  127. package/lib/task/review-finalization.ts +2 -52
  128. package/lib/task/review-identity.ts +3 -1
  129. package/lib/task/short-id.ts +15 -10
  130. package/lib/task/verification-engine.ts +20 -62
  131. package/lib/task/workspace-root.ts +78 -0
  132. package/lib/task/workspace-snapshot.ts +4 -3
  133. package/package.json +1 -1
  134. package/templates/.agents/QUICKSTART.en.md +19 -8
  135. package/templates/.agents/QUICKSTART.zh-CN.md +19 -8
  136. package/templates/.agents/README.en.md +10 -15
  137. package/templates/.agents/README.zh-CN.md +9 -13
  138. package/templates/.agents/rules/issue-sync.en.md +1 -1
  139. package/templates/.agents/rules/issue-sync.zh-CN.md +1 -1
  140. package/templates/.agents/rules/lifecycle-orchestration.en.md +1 -1
  141. package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +1 -1
  142. package/templates/.agents/rules/next-step-output.en.md +2 -2
  143. package/templates/.agents/rules/next-step-output.zh-CN.md +2 -2
  144. package/templates/.agents/rules/pr-sync.en.md +1 -1
  145. package/templates/.agents/rules/pr-sync.zh-CN.md +1 -1
  146. package/templates/.agents/rules/release-commands.en.md +3 -0
  147. package/templates/.agents/rules/release-commands.zh-CN.md +3 -0
  148. package/templates/.agents/rules/task-management.en.md +0 -2
  149. package/templates/.agents/rules/task-management.zh-CN.md +0 -2
  150. package/templates/.agents/rules/task-short-id.en.md +2 -2
  151. package/templates/.agents/rules/task-short-id.zh-CN.md +2 -2
  152. package/templates/.agents/scripts/task-short-id.js +2 -8
  153. package/templates/.agents/skills/analyze-task/SKILL.en.md +6 -6
  154. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +6 -6
  155. package/templates/.agents/skills/analyze-task/config/verify.en.json +0 -1
  156. package/templates/.agents/skills/analyze-task/config/verify.zh-CN.json +0 -1
  157. package/templates/.agents/skills/archive-tasks/SKILL.en.md +5 -5
  158. package/templates/.agents/skills/archive-tasks/SKILL.zh-CN.md +5 -5
  159. package/templates/.agents/skills/archive-tasks/scripts/archive-tasks.sh +10 -2
  160. package/templates/.agents/skills/block-task/SKILL.en.md +4 -4
  161. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +5 -5
  162. package/templates/.agents/skills/block-task/config/verify.json +0 -1
  163. package/templates/.agents/skills/cancel-task/SKILL.en.md +6 -6
  164. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +6 -6
  165. package/templates/.agents/skills/cancel-task/config/verify.json +0 -1
  166. package/templates/.agents/skills/code-task/SKILL.en.md +1 -1
  167. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +3 -3
  168. package/templates/.agents/skills/code-task/config/verify.en.json +0 -1
  169. package/templates/.agents/skills/code-task/config/verify.zh-CN.json +0 -1
  170. package/templates/.agents/skills/code-task/reference/output-template.en.md +1 -1
  171. package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +1 -1
  172. package/templates/.agents/skills/commit/SKILL.en.md +1 -1
  173. package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
  174. package/templates/.agents/skills/commit/config/verify.json +0 -1
  175. package/templates/.agents/skills/commit/reference/commit-orchestration.en.md +2 -2
  176. package/templates/.agents/skills/commit/reference/commit-orchestration.zh-CN.md +2 -2
  177. package/templates/.agents/skills/commit/reference/pr-summary-sync.en.md +1 -1
  178. package/templates/.agents/skills/commit/reference/pr-summary-sync.zh-CN.md +1 -1
  179. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +2 -2
  180. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +2 -2
  181. package/templates/.agents/skills/complete-manual-validation/config/verify.en.json +0 -1
  182. package/templates/.agents/skills/complete-manual-validation/config/verify.zh-CN.json +0 -1
  183. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +1 -1
  184. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +1 -1
  185. package/templates/.agents/skills/complete-task/SKILL.en.md +17 -9
  186. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +18 -10
  187. package/templates/.agents/skills/complete-task/config/verify.en.json +0 -1
  188. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +0 -1
  189. package/templates/.agents/skills/create-pr/SKILL.en.md +3 -3
  190. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +3 -3
  191. package/templates/.agents/skills/create-pr/config/verify.json +0 -1
  192. package/templates/.agents/skills/create-pr/reference/change-report.en.md +13 -3
  193. package/templates/.agents/skills/create-pr/reference/change-report.zh-CN.md +13 -3
  194. package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +1 -1
  195. package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +1 -1
  196. package/templates/.agents/skills/create-release-note/SKILL.en.md +2 -2
  197. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +2 -2
  198. package/templates/.agents/skills/create-task/SKILL.en.md +4 -4
  199. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +4 -4
  200. package/templates/.agents/skills/create-task/config/verify.json +0 -1
  201. package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
  202. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  203. package/templates/.agents/skills/import-codescan/config/verify.json +0 -1
  204. package/templates/.agents/skills/import-dependabot/SKILL.en.md +3 -3
  205. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +3 -3
  206. package/templates/.agents/skills/import-dependabot/config/verify.json +0 -1
  207. package/templates/.agents/skills/import-issue/SKILL.en.md +5 -5
  208. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -5
  209. package/templates/.agents/skills/import-issue/config/verify.json +0 -1
  210. package/templates/.agents/skills/plan-task/SKILL.en.md +5 -5
  211. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +5 -5
  212. package/templates/.agents/skills/plan-task/config/verify.en.json +0 -1
  213. package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +0 -1
  214. package/templates/.agents/skills/restore-task/SKILL.en.md +2 -2
  215. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +3 -3
  216. package/templates/.agents/skills/restore-task/config/verify.json +0 -1
  217. package/templates/.agents/skills/review-analysis/SKILL.en.md +1 -1
  218. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +2 -2
  219. package/templates/.agents/skills/review-analysis/config/verify.en.json +0 -1
  220. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +0 -1
  221. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +5 -5
  222. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +5 -5
  223. package/templates/.agents/skills/review-code/SKILL.en.md +2 -2
  224. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +2 -2
  225. package/templates/.agents/skills/review-code/reference/output-templates.en.md +4 -4
  226. package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +4 -4
  227. package/templates/.agents/skills/review-plan/SKILL.en.md +1 -1
  228. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +2 -2
  229. package/templates/.agents/skills/review-plan/config/verify.en.json +0 -1
  230. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +0 -1
  231. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +5 -5
  232. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +5 -5
  233. package/templates/.agents/skills/review-pr/SKILL.en.md +2 -2
  234. package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +2 -2
  235. package/templates/.agents/skills/review-pr/config/verify.en.json +0 -1
  236. package/templates/.agents/skills/review-pr/config/verify.zh-CN.json +0 -1
  237. package/templates/.agents/skills/review-pr/reference/output-guidance.en.md +1 -1
  238. package/templates/.agents/skills/review-pr/reference/output-guidance.zh-CN.md +1 -1
  239. package/templates/.agents/skills/run-manual-validation/SKILL.en.md +5 -5
  240. package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +5 -5
  241. package/templates/.agents/skills/run-manual-validation/config/verify.en.json +0 -1
  242. package/templates/.agents/skills/run-manual-validation/config/verify.zh-CN.json +0 -1
  243. package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.en.md +13 -2
  244. package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.zh-CN.md +13 -2
  245. package/templates/.agents/skills/run-manual-validation/reference/report-template.en.md +2 -0
  246. package/templates/.agents/skills/run-manual-validation/reference/report-template.zh-CN.md +2 -0
  247. package/templates/.agents/skills/run-task/SKILL.en.md +1 -1
  248. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +1 -1
  249. package/templates/.agents/skills/test/SKILL.en.md +0 -3
  250. package/templates/.agents/skills/test/SKILL.zh-CN.md +0 -3
  251. package/templates/.agents/skills/test-integration/SKILL.en.md +0 -3
  252. package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +0 -3
  253. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +13 -6
  254. package/templates/.agents/skills/upgrade-dependency/SKILL.en.md +0 -3
  255. package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +0 -3
  256. package/templates/.agents/skills/watch-pr/SKILL.en.md +21 -4
  257. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +22 -5
  258. package/templates/.agents/skills/watch-pr/config/verify.json +0 -1
  259. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +14 -0
  260. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +15 -1
  261. package/templates/.agents/templates/handoff.en.md +1 -1
  262. package/templates/.agents/templates/handoff.zh-CN.md +1 -1
  263. package/templates/.agents/workflows/bug-fix.en.yaml +1 -1
  264. package/templates/.agents/workflows/feature-development.en.yaml +1 -1
  265. package/templates/.agents/workflows/refactoring.en.yaml +1 -1
  266. package/dist/lib/runtime/agent-runtime.js +0 -33
  267. package/dist/lib/task/runtime-paths.js +0 -10
  268. package/dist/lib/task/task-execution-lock.js +0 -250
  269. package/lib/runtime/agent-runtime.ts +0 -41
  270. package/lib/task/runtime-paths.ts +0 -12
  271. package/lib/task/task-execution-lock.ts +0 -320
@@ -24,7 +24,7 @@ When the finalizer fails, or the model stops because of a safety gate, lack of p
24
24
 
25
25
  ```text
26
26
  Task {task-id} review results were generated, but lifecycle advancement stopped.
27
- - Review artifact: .agents/workspace/active/{task-id}/{review-artifact}
27
+ - Review artifact: <task-workspace>/active/{task-id}/{review-artifact}
28
28
  - Last valid summary/findings: {last-readable-review-result}
29
29
  - Local repair attempts: {repairAttempts}
30
30
  - Last diagnostic: {last-structured-diagnostic}
@@ -43,7 +43,7 @@ Populate `{next-step-commands}` for this scenario by running `agent-infra-intern
43
43
  ```text
44
44
  Task {task-id} technical plan review completed. Verdict: approved.
45
45
  - Blockers: 0 | Major issues: 0 | Minor issues: 0 | Human-decision: {h}
46
- [- Review report: .agents/workspace/active/{task-id}/{review-artifact}]
46
+ [- Review report: <task-workspace>/active/{task-id}/{review-artifact}]
47
47
 
48
48
  Next step - write code:
49
49
  {next-step-commands}
@@ -59,7 +59,7 @@ Populate `{next-step-commands}` for this scenario by running `agent-infra-intern
59
59
  ```text
60
60
  Task {task-id} technical plan review completed. Verdict: changes requested.
61
61
  - Blockers: 0 | Major issues: {n} | Minor issues: {n} | Human-decision: {h}
62
- - Review report: .agents/workspace/active/{task-id}/{review-artifact}
62
+ - Review report: <task-workspace>/active/{task-id}/{review-artifact}
63
63
 
64
64
  Next step - revise technical plan:
65
65
  {next-step-commands}
@@ -75,7 +75,7 @@ Populate `{next-step-commands}` for this scenario by running `agent-infra-intern
75
75
  ```text
76
76
  Task {task-id} technical plan review completed. Verdict: changes requested.
77
77
  - Blockers: {n} | Major issues: {n} | Minor issues: {n} | Human-decision: {h}
78
- - Review report: .agents/workspace/active/{task-id}/{review-artifact}
78
+ - Review report: <task-workspace>/active/{task-id}/{review-artifact}
79
79
 
80
80
  Next step - revise technical plan:
81
81
  {next-step-commands}
@@ -91,7 +91,7 @@ Populate `{next-step-commands}` for this scenario by running `agent-infra-intern
91
91
  ```text
92
92
  Task {task-id} technical plan review completed. Verdict: rejected, redesign required.
93
93
  - Blockers: {n} | Major issues: {n} | Minor issues: {n} | Human-decision: {h}
94
- - Review report: .agents/workspace/active/{task-id}/{review-artifact}
94
+ - Review report: <task-workspace>/active/{task-id}/{review-artifact}
95
95
 
96
96
  Next step - redesign:
97
97
  {next-step-commands}
@@ -24,7 +24,7 @@
24
24
 
25
25
  ```text
26
26
  任务 {task-id} 审查结果已生成,但生命周期未推进。
27
- - 审查产物:.agents/workspace/active/{task-id}/{review-artifact}
27
+ - 审查产物:<task-workspace>/active/{task-id}/{review-artifact}
28
28
  - 最后有效 summary/findings:{last-readable-review-result}
29
29
  - 本地修复次数:{repairAttempts}
30
30
  - 最后诊断:{last-structured-diagnostic}
@@ -43,7 +43,7 @@
43
43
  ```text
44
44
  任务 {task-id} 技术方案审查完成。结论:通过。
45
45
  - 阻塞项:0 | 主要问题:0 | 次要问题:0 | 人工裁决:{h}
46
- [- 审查报告:.agents/workspace/active/{task-id}/{review-artifact}]
46
+ [- 审查报告:<task-workspace>/active/{task-id}/{review-artifact}]
47
47
 
48
48
  下一步 - 编写代码:
49
49
  {next-step-commands}
@@ -59,7 +59,7 @@
59
59
  ```text
60
60
  任务 {task-id} 技术方案审查完成。结论:需要修改。
61
61
  - 阻塞项:0 | 主要问题:{n} | 次要问题:{n} | 人工裁决:{h}
62
- - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
62
+ - 审查报告:<task-workspace>/active/{task-id}/{review-artifact}
63
63
 
64
64
  下一步 - 修订技术方案:
65
65
  {next-step-commands}
@@ -75,7 +75,7 @@
75
75
  ```text
76
76
  任务 {task-id} 技术方案审查完成。结论:需要修改。
77
77
  - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n} | 人工裁决:{h}
78
- - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
78
+ - 审查报告:<task-workspace>/active/{task-id}/{review-artifact}
79
79
 
80
80
  下一步 - 修订技术方案:
81
81
  {next-step-commands}
@@ -91,7 +91,7 @@
91
91
  ```text
92
92
  任务 {task-id} 技术方案审查完成。结论:拒绝,需要重新设计。
93
93
  - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n} | 人工裁决:{h}
94
- - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
94
+ - 审查报告:<task-workspace>/active/{task-id}/{review-artifact}
95
95
 
96
96
  下一步 - 重新设计:
97
97
  {next-step-commands}
@@ -26,7 +26,7 @@ Before generating the PR review report, read `.agents/rules/evidence-reporting.m
26
26
  - Review depth is driven by evidence completeness and change risk, never by the submitter's identity
27
27
  - After executing this skill you **must** immediately update task.md (via the `task-activity` typed intent)
28
28
  - Never run `git add` or `git commit` automatically
29
- - The one-shot path (no task/Issue) uses `.agents/workspace/reviews/{pr-number}/` with `recoverable: false` and carries no recovery promise
29
+ - The one-shot path (no task/Issue) uses `<task-workspace>/reviews/{pr-number}/` with `recoverable: false` and carries no recovery promise
30
30
 
31
31
  ## Common Rationalizations and Rebuttals
32
32
 
@@ -62,7 +62,7 @@ agent-infra-internal pr-review-grade resolve-host --pr {pr-number} [--cwd <path>
62
62
 
63
63
  - **Unique host**: bind `{task-id}`, call `task-activity pr-review-inspect` to obtain the canonical round, prepared/open state, and latest successful review identity, then start this round using the recovery rules below (go to step 2).
64
64
  - **Ambiguous hosts**: `resolve-host` returns `ambiguous` and `decide` refuses to classify (fail closed). Stop and ask a human to pin the unique host; do not enter evidence classification.
65
- - **No host**: block by default and require linking an Issue/task first (show linking guidance); never auto-create/import an Issue. Only when the user explicitly chooses a "one-shot review" do process files land in `.agents/workspace/reviews/{pr-number}/` (`recoverable: false`).
65
+ - **No host**: block by default and require linking an Issue/task first (show linking guidance); never auto-create/import an Issue. Only when the user explicitly chooses a "one-shot review" do process files land in `<task-workspace>/reviews/{pr-number}/` (`recoverable: false`).
66
66
 
67
67
  After the task-anchored path resolves the host and remote head, run:
68
68
 
@@ -26,7 +26,7 @@ description: >
26
26
  - 审查深度由证据完整度和变更风险决定,不由提交者身份决定
27
27
  - 执行本技能后,你**必须**立即更新 task.md(经 `task-activity` typed intent)
28
28
  - 绝不自动执行 `git add` 或 `git commit`
29
- - 一次性检视路径(无任务/Issue)走 `.agents/workspace/reviews/{pr-number}/`,标记 `recoverable: false`,不承担可恢复承诺
29
+ - 一次性检视路径(无任务/Issue)走 `<task-workspace>/reviews/{pr-number}/`,标记 `recoverable: false`,不承担可恢复承诺
30
30
 
31
31
  ## 常见违规借口与反驳
32
32
 
@@ -62,7 +62,7 @@ agent-infra-internal pr-review-grade resolve-host --pr {pr-number} [--cwd <path>
62
62
 
63
63
  - **唯一宿主**:绑定 `{task-id}`,调用 `task-activity pr-review-inspect` 取得 canonical round、prepared/open 状态和最近成功审查身份,再按下述恢复规则开始本轮(进入步骤 2)。
64
64
  - **多宿主歧义**:`resolve-host` 返回 `ambiguous`,`decide` 会拒绝分类(fail closed)。立即停止并提示人工指定唯一宿主;不进入证据分类。
65
- - **无宿主**:默认阻塞,要求先建立 Issue/task 关联(给出关联指引),不自动创建/导入 Issue。仅当用户显式选择「仅一次性检视」时,过程文件写入 `.agents/workspace/reviews/{pr-number}/`(`recoverable: false`)。
65
+ - **无宿主**:默认阻塞,要求先建立 Issue/task 关联(给出关联指引),不自动创建/导入 Issue。仅当用户显式选择「仅一次性检视」时,过程文件写入 `<task-workspace>/reviews/{pr-number}/`(`recoverable: false`)。
66
66
 
67
67
  任务锚定路径在宿主与远端 head 确定后执行:
68
68
 
@@ -23,7 +23,6 @@
23
23
  ]
24
24
  },
25
25
  "activity-log": {
26
- "expected_action_pattern": "Review PR \\(Round \\d+\\)"
27
26
  },
28
27
  "platform-sync": {
29
28
  "when": "platform_issue_identity_exists"
@@ -23,7 +23,6 @@
23
23
  ]
24
24
  },
25
25
  "activity-log": {
26
- "expected_action_pattern": "Review PR \\(Round \\d+\\)"
27
26
  },
28
27
  "platform-sync": {
29
28
  "when": "platform_issue_identity_exists"
@@ -8,7 +8,7 @@ Read this file and `.agents/rules/next-step-output.md` before presenting the fin
8
8
  |------|---------|---------|
9
9
  | A Local review complete | the local review round closed and verification passed; formal publication succeeded or has a durable pending record | conclusion, mode, reviewed head SHA, actual publication status, Review URL or recovery action, receipt, next step |
10
10
  | B Blocked, requires linking | `resolve-host` returned none or ambiguous | linking guidance (create/link an Issue and task); do not auto-create an Issue; or explicitly choose the one-shot review |
11
- | C One-shot review | the user explicitly chose a "one-shot review" | non-recoverable notice, artifact directory `.agents/workspace/reviews/{pr-number}/`, Review URL or publication failure |
11
+ | C One-shot review | the user explicitly chose a "one-shot review" | non-recoverable notice, artifact directory `<task-workspace>/reviews/{pr-number}/`, Review URL or publication failure |
12
12
 
13
13
  ## Presentation Requirements
14
14
 
@@ -8,7 +8,7 @@
8
8
  |------|----------|----------|
9
9
  | A 本地审查完成 | 本地审查轮次闭合且校验通过;正式 Review 已发布或有持久化待恢复记录 | 结论、模式、被审 head SHA、实际发布状态、Review URL 或恢复动作、receipt、下一步 |
10
10
  | B 阻塞要求关联 | `resolve-host` 返回 none 或 ambiguous | 关联指引(创建/关联 Issue 与 task),不自动创建 Issue;或显式选择一次性检视 |
11
- | C 一次性检视 | 用户显式选择「仅一次性检视」 | 不可恢复提示、产物目录 `.agents/workspace/reviews/{pr-number}/`、Review URL 或发布失败 |
11
+ | C 一次性检视 | 用户显式选择「仅一次性检视」 | 不可恢复提示、产物目录 `<task-workspace>/reviews/{pr-number}/`、Review URL 或发布失败 |
12
12
 
13
13
  ## 呈现要求
14
14
 
@@ -27,7 +27,7 @@ Before generating a validation report, read `.agents/rules/evidence-reporting.md
27
27
  - Never manipulate temporary worktrees, leases, or containers directly; only call `agent-infra-internal task-validate`.
28
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.
29
29
  - Before generating validation artifact Markdown referenced by the task comment, read `.agents/rules/sync-content-generation.md` and follow its generator-side constraints. Keep the validation artifact local instead of publishing it as an Issue artifact comment.
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.
30
+ - The branch-only fallback creates one unique `tmp-` directory under the system temporary directory and is marked `recoverable: false`: no task.md write-back, lifecycle events, Issue sync, or `task-verify`; keep the report and evidence together, provide the retrieval path in the result, and carry the artifact back to the host that owns the task workspace for registration.
31
31
 
32
32
  ## Step 0: State Check (pre-execution hard gate)
33
33
 
@@ -44,7 +44,7 @@ Branch-only has no `{task-id}`: skip this step and record `not-applicable (branc
44
44
  1. Read `reference/discovery-and-execution.md` and parse the input mode. Stop before started without an artifact for invalid or partial input.
45
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.
46
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`.
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.
47
+ 4. Choose the output directory once for this run using `reference/discovery-and-execution.md`, then allocate a unique `{evidence-file}` for each target and execution scope. Pass each path as one quoted argument to the existing `--evidence-file`; 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. If no item is executable, run no fabricated command but still produce coverage-gap evidence.
48
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.
49
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 only `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`; do not publish the validation artifact as an Issue comment.
50
50
  7. Run `agent-infra-internal task-verify {task-id} validation-run.completed --artifact {artifact} --format text`; fix failures and rerun it, then present the summary per `.agents/rules/validation-output.md` with necessary diagnostics.
@@ -57,10 +57,10 @@ With `--branch <ref>`, only the following differ from the steps above; every oth
57
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
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
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.
60
+ - **Step 4 runs unchanged**: write evidence files in this run's system temporary 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 `validation-run.md` in the same temporary directory using `reference/report-template.md`. See `reference/discovery-and-execution.md` for directory creation and evidence filenames.
62
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`.
63
+ - **Step 8 adds a notice**: state that the artifact is unrecoverable and unregistered, provide the temporary directory retrieval path, and explain that it must be carried back to the host owning the task workspace before a maintainer runs `complete-manual-validation`.
64
64
 
65
65
  ## Completion Checklist
66
66
 
@@ -27,7 +27,7 @@ description: >
27
27
  - 禁止直接操作临时 worktree、lease 或 container;只调用 `agent-infra-internal task-validate`。
28
28
  - 产物不得记录 token、环境变量、完整 argv、绝对用户路径或原始 transcript;每个验证目标必须由核心写入同一 current-only evidence envelope。
29
29
  - 生成会由 task 评论引用的验证 artifact Markdown 前,先读取 `.agents/rules/sync-content-generation.md` 并遵循其中的生成端约束;验证 artifact 保留在本地,不发布为 Issue artifact 评论。
30
- - branch-only 降级路径走 `.agents/workspace/validations/{branch-slug}/`,标记 `recoverable: false`:不写 task.md、不发 lifecycle 事件、不同步 Issue、不跑 `task-verify`;产物须带回宿主机,由维护者登记。
30
+ - branch-only 降级路径在系统临时目录下创建一次 `tmp-` 开头的独立目录,标记 `recoverable: false`:不写 task.md、不发 lifecycle 事件、不同步 Issue、不跑 `task-verify`;报告与 evidence 同目录,结果提供取回路径,产物须带回宿主机由维护者登记。
31
31
 
32
32
  ## 第 0 步:状态核对(执行前硬约束)
33
33
 
@@ -44,7 +44,7 @@ branch-only 无 `{task-id}`,跳过本步,并在产物 `## 状态核对` 记
44
44
  1. 读取 `reference/discovery-and-execution.md`,解析输入模式;非法或半截输入在 started 前停止,不写产物。
45
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 前停止;合法显式模式始终以用户命令作为有效工作继续。
46
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`。
47
- 4. 为每个验证目标分配 `{evidence-file}`,分别调用 `agent-infra-internal task-validate {task-ref} --scope snapshot --format json --evidence-file {evidence-file} -- {command...}`;只有证据表明必须原位时才对该项进行第二次显式 inplace 调用并写入对应 evidence 文件。零项可执行时不运行伪造命令,但仍继续产出覆盖缺口证据。
47
+ 4. 按 `reference/discovery-and-execution.md` 为本轮选择一次产物目录,并为每个验证目标和执行 scope 分配唯一 `{evidence-file}`;将路径作为一个引用参数传给现有 `--evidence-file`。分别调用 `agent-infra-internal task-validate {task-ref} --scope snapshot --format json --evidence-file {evidence-file} -- {command...}`;只有证据表明必须原位时才对该项进行第二次显式 inplace 调用。零项可执行时不运行伪造命令,但仍继续产出覆盖缺口证据。
48
48
  5. 读取 `reference/report-template.md`,创建 `validation-run.md|validation-run-r{N}.md`;记录输入模式、发现清单、逐项结果、CLI JSON allowlist 与去敏摘要。
49
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}`;验证 artifact 不发布为 Issue 评论。
50
50
  7. 运行 `agent-infra-internal task-verify {task-id} validation-run.completed --artifact {artifact} --format text`;未通过则修复后重跑,并按 `.agents/rules/validation-output.md` 展示摘要和必要诊断。
@@ -57,10 +57,10 @@ branch-only 无 `{task-id}`,跳过本步,并在产物 `## 状态核对` 记
57
57
  - **仅接受显式模式**:`task-artifact` 和 `platform-pr inspect` 都要求 task ref,branch-only 无法自动发现。缺少 `--` 后的用户命令时,在写入任何产物前停止。
58
58
  - **跳过第 0 步与第 2 步的发现**:把两个来源记为 `unavailable`,并在产物 `## 发现清单` 用 `explicit` 来源登记本轮项。
59
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._-]`,其余(含 `/`)一律换成 `-`,结果必须是单层目录名;若结果为空或仅由 `.` 组成,判为非法输入并在写入任何产物前停止。
60
+ - **第 4 步照常执行**:将 evidence 文件写入本轮系统临时目录,调用 `agent-infra-internal task-validate {branch-ref} --scope snapshot --format json --evidence-file {evidence-file} -- {command...}`。
61
+ - **第 5 步改写产物位置**:报告写入同一临时目录,命名为 `validation-run.md`,沿用 `reference/report-template.md`。目录创建和 evidence 命名规则见 `reference/discovery-and-execution.md`。
62
62
  - **跳过第 6、7 步**:不发 `validation-run.completed`,不做 `platform-comment sync`,不跑 `task-verify`。
63
- - **第 8 步追加提示**:明确告知产物不可恢复、未登记账本,需带回持有任务工作区的宿主机后再由维护者执行 `complete-manual-validation`。
63
+ - **第 8 步追加提示**:明确告知产物不可恢复、未登记账本,输出临时目录的取回路径,并说明需带回持有任务工作区的宿主机后再由维护者执行 `complete-manual-validation`。
64
64
 
65
65
  ## 完成检查清单
66
66
 
@@ -34,7 +34,6 @@
34
34
  ]
35
35
  },
36
36
  "activity-log": {
37
- "expected_action_pattern": "Run Manual Validation \\(Round \\d+\\)"
38
37
  },
39
38
  "review-ledger": {
40
39
  "stage_scope": [
@@ -34,7 +34,6 @@
34
34
  ]
35
35
  },
36
36
  "activity-log": {
37
- "expected_action_pattern": "Run Manual Validation \\(Round \\d+\\)"
38
37
  },
39
38
  "review-ledger": {
40
39
  "stage_scope": [
@@ -56,15 +56,26 @@ Assign exactly one classification per item:
56
56
 
57
57
  Only `executable` items may run. Commands must not expose credentials, environment variables, full argv, absolute user paths, or raw transcripts. Leave a coverage gap when safety cannot be established.
58
58
 
59
+ ## Artifact Directory and Evidence Paths
60
+
61
+ Choose `{evidence-dir}` once per run. Write the report and every evidence JSON generated in that run to this directory:
62
+
63
+ - `task-bound`: use the `TaskDir` returned in the structured result of `task-context resolve`; never construct it from the task ID.
64
+ - `branch-only`: only after the user explicitly passes a valid `--branch` with valid explicit-mode input, create the directory once with Node built-ins: `fs.mkdtempSync(path.join(os.tmpdir(), "tmp-"))`. Use the existing Node runtime's `node:fs`, `node:os`, and `node:path`; do not add a script, helper, or storage layer. A task-resolution failure must not enter this branch.
65
+
66
+ Keep the report name returned by the core: `validation-run.md|validation-run-r{N}.md`. For task-bound evidence, remove `.md` from that report name to get `{artifact-stem}`, then name each file `{artifact-stem}-{MV-N}-{snapshot|inplace}.json`; different report rounds, targets, and scopes therefore do not overwrite each other. Branch-only writes `validation-run.md` in its new directory and uses `validation-run-{MV-N}-{snapshot|inplace}.json`. Generate paths with Node `path.join(evidence-dir, filename)` and pass the full path as one argument, correctly quoted for the current shell, to `--evidence-file`. Do not split paths containing spaces. Do not create a file for a scope that was not run.
67
+
68
+ Put evidence relative filenames in the report, never absolute user paths. The branch-only completion result separately gives `{evidence-dir}` as the retrieval path; the report and all JSON files are in that directory.
69
+
59
70
  ## Per-item Execution
60
71
 
61
72
  1. Invoke each executable item separately:
62
73
 
63
74
  ```bash
64
- agent-infra-internal task-validate {task-ref|branch-ref} --scope snapshot --format json -- {command...}
75
+ agent-infra-internal task-validate {task-ref|branch-ref} --scope snapshot --format json --evidence-file "{evidence-file}" -- {command...}
65
76
  ```
66
77
 
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.
78
+ 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`, use its separate scope evidence path, and record the reason.
68
79
  3. One item failure does not stop independent remaining items. Record exit status, cleanup, and the sanitized JSON allowlist separately.
69
80
  4. When the list is non-empty but no item is `executable`, still create and complete a validation-run artifact after started; do not run placeholder or fabricated commands.
70
81
  5. Always stop before started for invalid input. In automatic mode, also stop before started without an artifact when both sources are reliably empty or the sole possible source is unreadable with no local items; those source-based stop conditions do not apply to valid explicit mode.
@@ -56,15 +56,26 @@ branch-only 没有 task ref,两个发现来源都不可读,一律记为 `una
56
56
 
57
57
  只有 `executable` 可以运行。命令不得输出凭据、环境变量、完整 argv、绝对用户路径或原始 transcript;不能证明安全就保留覆盖缺口。
58
58
 
59
+ ## 产物目录与 evidence 路径
60
+
61
+ 每轮只选择一次 `{evidence-dir}`,报告和该轮生成的所有 evidence JSON 都写入该目录:
62
+
63
+ - `task-bound`:直接使用 `task-context resolve` 结构化结果返回的 `TaskDir`。不得按 task ID 拼路径。
64
+ - `branch-only`:仅在用户显式传入合法 `--branch` 且输入是合法显式模式后,使用 Node 内置 API 创建一次目录:`fs.mkdtempSync(path.join(os.tmpdir(), "tmp-"))`。调用现有 Node 运行环境的 `node:fs`、`node:os`、`node:path`;不创建脚本、helper 或额外存储层。不得在 task resolution 失败时走此分支。
65
+
66
+ 报告沿用核心返回的 `validation-run.md|validation-run-r{N}.md` 名称;task-bound evidence 取该报告名去掉 `.md` 后作为 `{artifact-stem}`,文件名为 `{artifact-stem}-{MV-N}-{snapshot|inplace}.json`,因此不同报告轮次、目标及同一目标的 snapshot/inplace 调用不会覆盖。branch-only 在新目录中写 `validation-run.md`,并使用 `validation-run-{MV-N}-{snapshot|inplace}.json`。通过 Node `path.join(evidence-dir, filename)` 生成路径;将整条路径作为一个被当前 shell 正确引用的 `--evidence-file` 参数传入,不拆分含空格的路径。未执行的 scope 不生成文件。
67
+
68
+ 报告只写 evidence 相对文件名,不写绝对用户路径。branch-only 的完成结果另行提供 `{evidence-dir}` 取回路径;报告自身与全部 JSON 均在该目录中。
69
+
59
70
  ## 逐项执行
60
71
 
61
72
  1. 每个可执行项分别调用:
62
73
 
63
74
  ```bash
64
- agent-infra-internal task-validate {task-ref|branch-ref} --scope snapshot --format json -- {command...}
75
+ agent-infra-internal task-validate {task-ref|branch-ref} --scope snapshot --format json --evidence-file "{evidence-file}" -- {command...}
65
76
  ```
66
77
 
67
- 2. 仅当项目要求或首次证据证明依赖未提交内容、原挂载或原位权限时,再为该项显式调用一次 `--scope inplace`,并记录升级理由。
78
+ 2. 仅当项目要求或首次证据证明依赖未提交内容、原挂载或原位权限时,再为该项显式调用一次 `--scope inplace`,用该 scope 独立的 evidence 路径并记录升级理由。
68
79
  3. 单项失败不阻止其余独立项;分别记录退出状态、cleanup 和去敏 JSON allowlist。
69
80
  4. 清单非空但没有 `executable` 项时,仍在 started 后生成 validation-run 产物并完成 lifecycle,不运行占位或伪造命令。
70
81
  5. 输入非法时始终在 started 前停止。自动模式下,两来源可靠地确认无项,或唯一可能来源不可读且本地无项时,也在 started 前停止且不写产物;合法显式模式不适用这两个来源停止条件。
@@ -4,6 +4,7 @@
4
4
 
5
5
  - Mode: `{explicit|automatic}`
6
6
  - Context: `{task-bound|branch-only}` (branch-only also records `recoverable: false`)
7
+ - Report and evidence: same artifact directory; record evidence filenames only, never absolute paths
7
8
  - Input decision: {sanitized-input-decision}
8
9
  - PR source status: `{success|no-op|failed|blocked}` / `{stable-code-or-none}`
9
10
 
@@ -50,6 +51,7 @@ agent-infra-internal task-snapshot {task-id} --format text
50
51
  - Source: `{source}`
51
52
  - Classification: `{classification}`
52
53
  - Scope: `{snapshot|inplace|not-run}`
54
+ - Evidence file: `{evidence-filename|not-created}` (filename only)
53
55
  - Command name: `{basename-only|not-run}`
54
56
  - Exit status: `{exit-status|not-run}`
55
57
  - Runtime upgrade: {none-or-reason}
@@ -4,6 +4,7 @@
4
4
 
5
5
  - 模式:`{explicit|automatic}`
6
6
  - 上下文:`{task-bound|branch-only}`(branch-only 另记 `recoverable: false`)
7
+ - 报告与 evidence:同一产物目录;仅记录 evidence 文件名,不记录绝对路径
7
8
  - 输入判定:{sanitized-input-decision}
8
9
  - PR 来源状态:`{success|no-op|failed|blocked}` / `{stable-code-or-none}`
9
10
 
@@ -50,6 +51,7 @@ agent-infra-internal task-snapshot {task-id} --format text
50
51
  - 来源:`{source}`
51
52
  - 分类:`{classification}`
52
53
  - Scope:`{snapshot|inplace|not-run}`
54
+ - Evidence 文件:`{evidence-filename|not-created}`(仅相对文件名)
53
55
  - 命令名称:`{basename-only|not-run}`
54
56
  - 退出状态:`{exit-status|not-run}`
55
57
  - 运行时升级:{none-or-reason}
@@ -19,7 +19,7 @@ The orchestrator delegates only and never executes a stage skill itself. First r
19
19
  4. 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.
20
20
  5. Run `route`. On `completed`, run `agent-infra-internal task-verify {task-id} run-task.completed --format text`, present its summary per `.agents/rules/validation-output.md` while retaining necessary diagnostics, and stop. Only a `running` result with non-null `next` supplies action, role, round, artifact, requested model, and requested effort.
21
21
  6. Call `prepare --client {client} --requested-model {requestedModel} --requested-reasoning-effort {requestedReasoningEffort}` with route's exact policy. The client adapter runs host preflight. Report actual task, policy, or host failures.
22
- 7. After prepare, forward the optional `adapterContext` unchanged to `agent-infra-internal agent-client launch-carrier --client {client} --adapter-context {adapterContext} --stage {stage} --round {round} --role {role} --format json`. The shared skill must not parse, rewrite, or validate this opaque value. The controlled entry point calls the current Agent Client adapter's `createLaunchCarrier` and returns a carrier for native spawn. Stop dispatch with the structured error if carrier support is unavailable or conversion fails. Then run `task-orchestration <task-ref> dispatch` with route's exact model/effort, passing the short task ref, skill, `--orchestrated`, stage/round/artifact/role, and the returned carrier unchanged to native spawn. The child calls `await-activation --stage ... --round ... --artifact ... --role ...` to associate its actual identity before executing. Code-task creates the local checkpoint; do not delegate a separate commit stage or push. Retain existing write locks without introducing a new lock protocol around native spawn.
22
+ 7. After prepare, forward the optional `adapterContext` unchanged to `agent-infra-internal agent-client launch-carrier --client {client} --adapter-context {adapterContext} --stage {stage} --round {round} --role {role} --format json`. The shared skill must not parse, rewrite, or validate this opaque value. The controlled entry point calls the current Agent Client adapter's `createLaunchCarrier` and returns a carrier for native spawn. Stop dispatch with the structured error if carrier support is unavailable or conversion fails. Then run `task-orchestration <task-ref> dispatch` with route's exact model/effort, passing the short task ref, skill, `--orchestrated`, stage/round/artifact/role, and the returned carrier unchanged to native spawn. The child calls `await-activation --stage ... --round ... --artifact ... --role ...` to associate its actual identity before executing. Code-task creates the local checkpoint; do not delegate a separate commit stage or push. Execute task stages sequentially; state updates retain atomic writes and identity/state validation.
23
23
  8. Record actual start and terminal results through the current host's native lifecycle events and result interfaces. A timed-out wait does not imply success. Pause on actual identity, transport, or terminal failures. After the stage and child finish, call `advance`; repeat step 3 only while running.
24
24
  9. Create a fresh child each round and never reuse a reviewer. Record actual model/effort and host fallback reasons. Validate current identity, artifacts, ledger, and execution results. User rulings override derived historical plan requirements. Do not introduce child discovery, orphan recovery, or a dedicated recovery protocol.
25
25
  10. On pause or completion, run the matching typed verification and report the structured endpoint.
@@ -19,7 +19,7 @@ description: >
19
19
  4. 调用 `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,按结构化结果停止。
20
20
  5. 调用 `route` 并读取结构化结果。若返回 `completed`,立即运行 `agent-infra-internal task-verify {task-id} run-task.completed --format text` 并停止;按 `.agents/rules/validation-output.md` 展示摘要并保留必要诊断。仅当返回 `running` 且 `next` 非空时读取唯一 action、role、round、artifact、`requestedModel` 和 `requestedReasoningEffort`,不得自行推断。
21
21
  6. 调用 `prepare --client {client} --requested-model {requestedModel} --requested-reasoning-effort {requestedReasoningEffort}`,使用 route 返回的精确策略。客户端适配器执行宿主 preflight;任务身份、策略或宿主检查失败时记录实际诊断。
22
- 7. prepare 成功后,原样转发返回的可选 `adapterContext`,调用 `agent-infra-internal agent-client launch-carrier --client {client} --adapter-context {adapterContext} --stage {stage} --round {round} --role {role} --format json`。共享技能不解析、重写或验证该不透明值;受控入口调用当前 Agent Client adapter 的 `createLaunchCarrier`,并返回可直接交给 native spawn 的 carrier。缺少 carrier 能力或转换失败时按结构化错误停止派发。随后执行 `task-orchestration <task-ref> dispatch`,显式指定 route 返回的 model/effort;传递短任务引用、skill 名、`--orchestrated` 与 stage/round/artifact/role,并把返回的 carrier 原样交给 native spawn。child 调用 `await-activation --stage ... --round ... --artifact ... --role ...`,确认当前阶段与实际 child 关联后执行。代码阶段通过 code-task 创建本地 checkpoint;禁止单独委派 commit 阶段或推送。保留已有写锁,不把实际 spawn 纳入新建锁协议。
22
+ 7. prepare 成功后,原样转发返回的可选 `adapterContext`,调用 `agent-infra-internal agent-client launch-carrier --client {client} --adapter-context {adapterContext} --stage {stage} --round {round} --role {role} --format json`。共享技能不解析、重写或验证该不透明值;受控入口调用当前 Agent Client adapter 的 `createLaunchCarrier`,并返回可直接交给 native spawn 的 carrier。缺少 carrier 能力或转换失败时按结构化错误停止派发。随后执行 `task-orchestration <task-ref> dispatch`,显式指定 route 返回的 model/effort;传递短任务引用、skill 名、`--orchestrated` 与 stage/round/artifact/role,并把返回的 carrier 原样交给 native spawn。child 调用 `await-activation --stage ... --round ... --artifact ... --role ...`,确认当前阶段与实际 child 关联后执行。代码阶段通过 code-task 创建本地 checkpoint;禁止单独委派 commit 阶段或推送。任务阶段按序执行,状态更新保留原子写入与身份、状态校验。
23
23
  8. 通过当前宿主的原生生命周期事件和结果接口记录实际启动及终态。timed-out wait 不推断成功;身份、传输或异常终态失败如实暂停。阶段结果和 child 完成后调用 `advance`;只有 `running` 才重复步骤 3。
24
24
  9. 每轮创建新 child;禁止 follow-up 复用 reviewer。如实记录 actual model/effort 及宿主降级理由。检查当前身份、产物、账本与实际执行结果;用户裁决优先于历史方案派生要求。不得新增 child discovery、孤立 child 恢复或专用恢复协议。
25
25
  10. 完成或暂停后运行对应 typed verification,并把结构化 run 摘要、暂停原因、commit 终点或 clean completion evidence 告知用户。
@@ -120,6 +120,3 @@ Populate `{next-step-commands}` for this scenario by running `agent-infra-intern
120
120
  Next step - commit changes:
121
121
  {next-step-commands}
122
122
  ```
123
-
124
-
125
- For an in-scope, diagnosable failure, inspect the error evidence, identify the cause, fix it, and retry with the same verifier; do not stop or ask merely because an ordinary attempt failed. Preserve a blocked state for user data/template conflicts, design choices beyond approved scope, required human validation/authorization, or unsafe recovery, and continue independent work.
@@ -118,6 +118,3 @@ description: >
118
118
  下一步 - 提交代码:
119
119
  {next-step-commands}
120
120
  ```
121
-
122
-
123
- 遇到任务范围内且可诊断的失败,先读取错误证据、定位根因、修复并按同一验证器重试;不要仅因一次普通失败就停止或提问。若涉及用户数据/模板冲突、超出批准范围的设计选择、必要人工验证/授权或无法安全恢复,则保留阻塞事实并继续独立工作。
@@ -67,6 +67,3 @@ Next step - commit changes:
67
67
  2. **Environment**: Integration tests may require external services (databases, APIs, etc.)
68
68
  3. **Timeouts**: Integration tests typically take longer; be patient
69
69
  4. **Cleanup**: Ensure test environment is cleaned up after tests complete
70
-
71
-
72
- For an in-scope, diagnosable failure, inspect the error evidence, identify the cause, fix it, and retry with the same verifier; do not stop or ask merely because an ordinary attempt failed. Preserve a blocked state for user data/template conflicts, design choices beyond approved scope, required human validation/authorization, or unsafe recovery, and continue independent work.
@@ -67,6 +67,3 @@ description: >
67
67
  2. **环境**:集成测试可能需要外部服务(数据库、API 等)
68
68
  3. **超时**:集成测试通常耗时较长;请耐心等待
69
69
  4. **清理**:确保测试完成后清理测试环境
70
-
71
-
72
- 遇到任务范围内且可诊断的失败,先读取错误证据、定位根因、修复并按同一验证器重试;不要仅因一次普通失败就停止或提问。若涉及用户数据/模板冲突、超出批准范围的设计选择、必要人工验证/授权或无法安全恢复,则保留阻塞事实并继续独立工作。
@@ -994,19 +994,26 @@ function entryVariantRels(entry, allSet, platform) {
994
994
  return rels;
995
995
  }
996
996
 
997
- function ensureRuntimeWorkspace(projectRoot) {
997
+ function ensureRuntimeWorkspace(projectRoot, project) {
998
+ if (typeof project !== 'string' || !project || project === '.' || project === '..' || /[\\/\u0000-\u001f\u007f]/u.test(project)) {
999
+ throw new Error('Runtime task workspace requires a valid project key in .agents/.airc.json');
1000
+ }
1001
+ const home = process.env.HOME || process.env.USERPROFILE || os.homedir();
1002
+ if (!path.isAbsolute(home)) throw new Error('Runtime task workspace requires an absolute HOME');
1003
+ const workspaceRoot = path.join(home, '.agent-infra', 'task-workspaces', project);
998
1004
  const directories = [
999
- path.join(projectRoot, '.agents'),
1000
- path.join(projectRoot, '.agents', 'workspace'),
1005
+ path.join(home, '.agent-infra'),
1006
+ path.join(home, '.agent-infra', 'task-workspaces'),
1007
+ workspaceRoot,
1001
1008
  ...['active', 'blocked', 'completed', 'archive'].map((state) =>
1002
- path.join(projectRoot, '.agents', 'workspace', state)
1009
+ path.join(workspaceRoot, state)
1003
1010
  )
1004
1011
  ];
1005
1012
  for (const directory of directories) {
1006
1013
  if (fs.existsSync(directory)) {
1007
1014
  const stat = fs.lstatSync(directory);
1008
1015
  if (!stat.isDirectory() || stat.isSymbolicLink()) {
1009
- throw new Error(`Runtime workspace path must be a real directory: ${directory}`);
1016
+ throw new Error(`Runtime task workspace path must be a real directory: ${directory}`);
1010
1017
  }
1011
1018
  continue;
1012
1019
  }
@@ -1024,7 +1031,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
1024
1031
 
1025
1032
  const originalConfigText = fs.readFileSync(cfgPath, 'utf8');
1026
1033
  const cfg = JSON.parse(originalConfigText);
1027
- ensureRuntimeWorkspace(projectRoot);
1034
+ ensureRuntimeWorkspace(projectRoot, cfg.project);
1028
1035
  const configPathRel = norm(path.relative(projectRoot, cfgPath));
1029
1036
  let templateRoot = templateRootOverride;
1030
1037
  if (!templateRoot) {
@@ -85,6 +85,3 @@ Next step - commit changes:
85
85
  - Package not found: Prompt "Package {name} not found in dependency files"
86
86
  - Build failure: Output errors and suggest checking for breaking changes
87
87
  - Test failure: Diagnose and fix recoverable in-scope issues, then rerun the same verifier; report migration-guide risks when relevant
88
-
89
-
90
- For an in-scope, diagnosable failure, inspect the error evidence, identify the cause, fix it, and retry with the same verifier; do not stop or ask merely because an ordinary attempt failed. Preserve a blocked state for user data/template conflicts, design choices beyond approved scope, required human validation/authorization, or unsafe recovery, and continue independent work.
@@ -85,6 +85,3 @@ description: >
85
85
  - 包未找到:提示 "Package {name} not found in dependency files"
86
86
  - 构建失败:输出错误并建议检查破坏性变更
87
87
  - 测试失败:先诊断并修复任务范围内可恢复的问题,再按同一验证器复测;必要时记录迁移指南相关风险
88
-
89
-
90
- 遇到任务范围内且可诊断的失败,先读取错误证据、定位根因、修复并按同一验证器重试;不要仅因一次普通失败就停止或提问。若涉及用户数据/模板冲突、超出批准范围的设计选择、必要人工验证/授权或无法安全恢复,则保留阻塞事实并继续独立工作。
@@ -40,7 +40,7 @@ After prerequisites pass and before this round's first artifact action, append a
40
40
  Resolve the target PR number `{pr#}` and an optional `{task-id}` via these deterministic branches:
41
41
 
42
42
  - Scenario A (argument omitted): reverse-lookup the active task from the current branch, then read its verified `pr_delivery_fact.identity.number`.
43
- - Scenario B (omitted task ref or `--task/-t`, **task-anchored primary path**): resolve the full `{task-id}` via "Task Context Resolution" and read `.agents/workspace/active/{task-id}/task.md` for verified `pr_delivery_fact.identity.number` as `{pr#}`; if the fact is unbound, follow "Error Handling" to prompt running `create-pr` first, then stop.
43
+ - Scenario B (omitted task ref or `--task/-t`, **task-anchored primary path**): resolve the full `{task-id}` via "Task Context Resolution" and read `<task-workspace>/active/{task-id}/task.md` for verified `pr_delivery_fact.identity.number` as `{pr#}`; if the fact is unbound, follow "Error Handling" to prompt running `create-pr` first, then stop.
44
44
  - Scenario C (`--pr <number>` or a PR URL): use that PR number directly as `{pr#}`; then determine `{task-id}` via "Reverse-lookup task".
45
45
  - Reverse-lookup task (scenarios A / C): use task context/query capabilities to find the unique active task bound to `{pr#}`. If none exists, stop and request binding first; the typed checks intent does not create a second taskless state machine.
46
46
 
@@ -48,7 +48,22 @@ Resolve the target PR number `{pr#}` and an optional `{task-id}` via these deter
48
48
 
49
49
  Before running this step, read `reference/monitor-and-heal.md` and `.agents/rules/pr-checks-commands.md`.
50
50
 
51
- Initialize `repairCommits=[]` and `rebaseAttempts=0`. Before readiness in every round, run `platform-pr summary-context`, rebuild the task-bound `pr-change-report.json` for the authoritative PR head using the shared PR change-report contract, and refresh the single summary with a body containing one `<!-- canonical-pr-change-report -->` placeholder via `summary-sync --change-report-file ... --result no_op --strict`. `--strict` preserves report or summary refresh failures as `failed/blocked` instead of treating warnings as success. A report or summary refresh failure must not enter the ready/complete exit; use step 4. After the refresh, run `agent-infra-internal platform-checks watch {task-id} --interval-seconds 30 --deadline-seconds 1800`, then route only by `readiness.state`: `ready` to step 7, `conflicting|checks-failed` to step 3, and `pending|timed-out|cancelled` to step 4.
51
+ Initialize `repairCommits=[]` and `rebaseAttempts=0`. Before overwriting the current report in each round, validate and retain its prior identity and head using the core reader; a missing or invalid report means there is no prior head:
52
+
53
+ ```bash
54
+ node --experimental-strip-types --input-type=module -e '
55
+ import { readPrChangeReport } from "./lib/platform/pr-change-report.ts";
56
+ const report = readPrChangeReport(`<task-workspace>/active/${process.argv[1]}/pr-change-report.json`);
57
+ const previous = report.ok
58
+ ? { repository: report.value.identity.repository, resource: report.value.identity.resource, head: report.value.identity.head.sha }
59
+ : { status: "unavailable" };
60
+ process.stdout.write(`${JSON.stringify(previous)}\n`);
61
+ ' {task-id}
62
+ ```
63
+
64
+ Then run `platform-pr summary-context` and compare the retained repository/resource identity with the authoritative snapshot; discard a mismatch and mark the increment unconfirmed. Rebuild the task-bound `pr-change-report.json` for the authoritative PR head using the shared PR change-report contract, and refresh the single summary with a body containing one `<!-- canonical-pr-change-report -->` placeholder via `summary-sync --change-report-file ... --result no_op --strict`. Complete-PR statistics keep the current base/head/merge-base/patch and existing totals. Only when the prior report is valid, the PR identity matches, and the heads differ, describe the separate head-to-head tree diff using `git diff --find-renames --numstat {previous-head} {current-head}`, `--name-status`, and `--summary`. Do not substitute a merge-base diff for this range or add increment totals to the full PR. If no valid prior head exists, state that it is unconfirmed; do not infer from complete-PR statistics or fill in zeroes. Matching heads mean there was no new head transition.
65
+
66
+ `--strict` preserves report or summary refresh failures as `failed/blocked` instead of treating warnings as success. A report or summary refresh failure must not enter the ready/complete exit; use step 4. After a successful refresh, consume `nextAction` from the structured `summary-sync` result: `review-code` exits readiness/self-heal and follows the code-review branch in step 7; only `watch-pr` continues to `agent-infra-internal platform-checks watch {task-id} --interval-seconds 30 --deadline-seconds 1800`. Missing or invalid `nextAction` follows the refresh-failure exit; do not infer `watch-pr`. Route readiness only by `readiness.state`: `ready` to step 7, `conflicting|checks-failed` to step 3, and `pending|timed-out|cancelled` to step 4.
52
67
 
53
68
  ### 3. Self-Heal Loop
54
69
 
@@ -70,14 +85,14 @@ Get the current time:
70
85
  date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
71
86
  ```
72
87
 
73
- Update `.agents/workspace/active/{task-id}/task.md`:
88
+ Update `<task-workspace>/active/{task-id}/task.md`:
74
89
  - `assigned_to`: {current agent}
75
90
  - `updated_at`: {current time}
76
91
  - `agent_infra_version`: per `.agents/rules/version-stamp.md`
77
92
  - **Do not change** `pr_delivery_fact` or `current_step`
78
93
  - **Append** to `## Activity Log` (do not overwrite prior entries; `{N}` = number of existing Watch PR entries for this task + 1):
79
94
  ```
80
- - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Watch PR (Round {N})** by {agent} — {success: PR ready, repair commits: {k} [{SHA summary}] / blocked: blocked: {summary}}
95
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Watch PR (Round {N})** by {agent} — {success: PR ready, repair commits: {k} [{SHA summary}] / review required: nextAction=review-code / blocked: {summary}}
81
96
  ```
82
97
 
83
98
  ### 6. Verification Gate
@@ -126,6 +141,8 @@ Populate `{next-step-commands}` for this scenario by running `agent-infra-intern
126
141
  {next-step-commands}
127
142
  ```
128
143
 
144
+ - `summary-sync.nextAction == review-code`: state that the report requires code review; this does not mean PR readiness passed. Generate the sole next step with `agent-infra-internal agent-client next-steps --skill review-code --task-ref {task-ref}` and end the round. Do not continue readiness/self-heal or edit code automatically.
145
+
129
146
  - "Blocked": output only the step 4 blocker explanation; do not recommend a next-step command.
130
147
 
131
148
  ## Completion Checklist