@fitlab-ai/agent-infra 0.11.15 → 0.12.1

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 (265) 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 +19 -33
  10. package/dist/lib/internal/platform-comment.js +59 -9
  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-ledger.js +1 -12
  14. package/dist/lib/internal/task-operation-registry.js +2 -1
  15. package/dist/lib/internal/task-qualification.js +6 -15
  16. package/dist/lib/internal/task-review.js +3 -16
  17. package/dist/lib/internal/task-short-id.js +2 -1
  18. package/dist/lib/internal/task-verify.js +1 -11
  19. package/dist/lib/internal/task-warning.js +1 -12
  20. package/dist/lib/internal/task-workspace.js +43 -0
  21. package/dist/lib/merge.js +4 -3
  22. package/dist/lib/platform/issue-comments.js +373 -267
  23. package/dist/lib/platform/issue-summary-content.js +112 -0
  24. package/dist/lib/platform/pr-change-report.js +175 -26
  25. package/dist/lib/platform/pr-summary-content.js +54 -0
  26. package/dist/lib/platform/pr-summary.js +321 -296
  27. package/dist/lib/platform/pull-requests.js +3 -15
  28. package/dist/lib/platform/summary-content-pipeline.js +18 -0
  29. package/dist/lib/pr-review/evidence-grading.js +3 -2
  30. package/dist/lib/process-data/index.js +5 -4
  31. package/dist/lib/process-data/sources.js +6 -0
  32. package/dist/lib/run/index.js +3 -2
  33. package/dist/lib/sandbox/commands/create.js +5 -1
  34. package/dist/lib/sandbox/commands/enter.js +1 -1
  35. package/dist/lib/sandbox/commands/list-running.js +2 -1
  36. package/dist/lib/sandbox/control/client.js +8 -13
  37. package/dist/lib/sandbox/control/completed-reentry.js +2 -1
  38. package/dist/lib/sandbox/control/task-view.js +4 -2
  39. package/dist/lib/sandbox/mounts.js +4 -4
  40. package/dist/lib/sandbox/recovery.js +26 -16
  41. package/dist/lib/sandbox/removal.js +62 -12
  42. package/dist/lib/sandbox/task-resolver.js +9 -6
  43. package/dist/lib/sandbox/workspace-identity.js +6 -5
  44. package/dist/lib/sandbox/workspace-view.js +29 -22
  45. package/dist/lib/task/activity-intent.js +2 -12
  46. package/dist/lib/task/artifact-lifecycle.js +17 -11
  47. package/dist/lib/task/artifact-operations.js +41 -49
  48. package/dist/lib/task/capabilities.js +2 -2
  49. package/dist/lib/task/commands/ls.js +4 -3
  50. package/dist/lib/task/commands/status.js +1 -1
  51. package/dist/lib/task/commit-operation.js +6 -6
  52. package/dist/lib/task/control-authority.js +32 -32
  53. package/dist/lib/task/create-service.js +2 -4
  54. package/dist/lib/task/create.js +12 -65
  55. package/dist/lib/task/delegation-receipts.js +1 -1
  56. package/dist/lib/task/delivery.js +2 -8
  57. package/dist/lib/task/events.js +5 -31
  58. package/dist/lib/task/finalization.js +33 -29
  59. package/dist/lib/task/lifecycle.js +9 -48
  60. package/dist/lib/task/local-artifact-finalization.js +1 -2
  61. package/dist/lib/task/orchestration.js +24 -57
  62. package/dist/lib/task/platform-operation-recovery.js +87 -88
  63. package/dist/lib/task/resolve-ref.js +17 -12
  64. package/dist/lib/task/review-finalization.js +2 -35
  65. package/dist/lib/task/review-identity.js +3 -1
  66. package/dist/lib/task/short-id.js +10 -8
  67. package/dist/lib/task/verification-engine.js +19 -58
  68. package/dist/lib/task/workspace-root.js +59 -0
  69. package/dist/lib/task/workspace-snapshot.js +4 -3
  70. package/dist/lifecycle-build-manifest.json +3 -3
  71. package/lib/agent-clients/adapters/codex-lifecycle/recovery.ts +6 -6
  72. package/lib/agent-clients/adapters/codex-lifecycle/store.ts +8 -34
  73. package/lib/agent-clients/adapters/codex-orchestration.ts +1 -1
  74. package/lib/decide.ts +2 -7
  75. package/lib/internal/cli-route-inventory.ts +2 -0
  76. package/lib/internal/manual-validation.ts +20 -37
  77. package/lib/internal/platform-comment.ts +49 -6
  78. package/lib/internal/task-activity.ts +1 -10
  79. package/lib/internal/task-event.ts +1 -10
  80. package/lib/internal/task-ledger.ts +1 -10
  81. package/lib/internal/task-operation-registry.ts +2 -1
  82. package/lib/internal/task-qualification.ts +5 -11
  83. package/lib/internal/task-review.ts +3 -14
  84. package/lib/internal/task-short-id.ts +2 -1
  85. package/lib/internal/task-verify.ts +1 -9
  86. package/lib/internal/task-warning.ts +1 -10
  87. package/lib/internal/task-workspace.ts +39 -0
  88. package/lib/merge.ts +4 -3
  89. package/lib/platform/issue-comments.ts +478 -280
  90. package/lib/platform/issue-summary-content.ts +132 -0
  91. package/lib/platform/pr-change-report.ts +165 -20
  92. package/lib/platform/pr-summary-content.ts +60 -0
  93. package/lib/platform/pr-summary.ts +367 -269
  94. package/lib/platform/pull-requests.ts +3 -24
  95. package/lib/platform/summary-content-pipeline.ts +23 -0
  96. package/lib/pr-review/evidence-grading.ts +3 -2
  97. package/lib/process-data/index.ts +4 -3
  98. package/lib/process-data/sources.ts +6 -0
  99. package/lib/run/index.ts +3 -2
  100. package/lib/sandbox/commands/create.ts +5 -1
  101. package/lib/sandbox/commands/enter.ts +1 -1
  102. package/lib/sandbox/commands/list-running.ts +2 -1
  103. package/lib/sandbox/control/client.ts +7 -12
  104. package/lib/sandbox/control/completed-reentry.ts +2 -1
  105. package/lib/sandbox/control/task-view.ts +4 -2
  106. package/lib/sandbox/mounts.ts +4 -4
  107. package/lib/sandbox/recovery.ts +26 -18
  108. package/lib/sandbox/removal.ts +60 -27
  109. package/lib/sandbox/task-resolver.ts +9 -6
  110. package/lib/sandbox/workspace-identity.ts +6 -5
  111. package/lib/sandbox/workspace-view.ts +28 -20
  112. package/lib/task/activity-intent.ts +3 -17
  113. package/lib/task/artifact-lifecycle.ts +39 -11
  114. package/lib/task/artifact-operations.ts +28 -35
  115. package/lib/task/capabilities.ts +2 -2
  116. package/lib/task/commands/ls.ts +4 -3
  117. package/lib/task/commands/status.ts +1 -1
  118. package/lib/task/commit-operation.ts +5 -6
  119. package/lib/task/control-authority.ts +29 -35
  120. package/lib/task/create-service.ts +2 -4
  121. package/lib/task/create.ts +10 -51
  122. package/lib/task/delegation-receipts.ts +1 -1
  123. package/lib/task/delivery.ts +2 -10
  124. package/lib/task/events.ts +5 -32
  125. package/lib/task/finalization.ts +27 -30
  126. package/lib/task/lifecycle.ts +9 -50
  127. package/lib/task/local-artifact-finalization.ts +1 -4
  128. package/lib/task/orchestration.ts +31 -80
  129. package/lib/task/platform-operation-recovery.ts +70 -82
  130. package/lib/task/resolve-ref.ts +18 -12
  131. package/lib/task/review-finalization.ts +2 -52
  132. package/lib/task/review-identity.ts +3 -1
  133. package/lib/task/short-id.ts +10 -8
  134. package/lib/task/verification-engine.ts +20 -62
  135. package/lib/task/workspace-root.ts +78 -0
  136. package/lib/task/workspace-snapshot.ts +4 -3
  137. package/package.json +1 -1
  138. package/templates/.agents/QUICKSTART.en.md +19 -8
  139. package/templates/.agents/QUICKSTART.zh-CN.md +19 -8
  140. package/templates/.agents/README.en.md +10 -15
  141. package/templates/.agents/README.zh-CN.md +9 -13
  142. package/templates/.agents/rules/issue-sync.en.md +1 -1
  143. package/templates/.agents/rules/issue-sync.zh-CN.md +1 -1
  144. package/templates/.agents/rules/lifecycle-orchestration.en.md +1 -1
  145. package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +1 -1
  146. package/templates/.agents/rules/next-step-output.en.md +2 -2
  147. package/templates/.agents/rules/next-step-output.zh-CN.md +2 -2
  148. package/templates/.agents/rules/pr-sync.en.md +5 -3
  149. package/templates/.agents/rules/pr-sync.zh-CN.md +7 -10
  150. package/templates/.agents/rules/release-commands.en.md +3 -0
  151. package/templates/.agents/rules/release-commands.zh-CN.md +3 -0
  152. package/templates/.agents/rules/task-management.en.md +0 -2
  153. package/templates/.agents/rules/task-management.zh-CN.md +0 -2
  154. package/templates/.agents/rules/task-short-id.en.md +2 -2
  155. package/templates/.agents/rules/task-short-id.zh-CN.md +2 -2
  156. package/templates/.agents/scripts/task-short-id.js +2 -8
  157. package/templates/.agents/skills/analyze-task/SKILL.en.md +6 -6
  158. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +6 -6
  159. package/templates/.agents/skills/analyze-task/config/verify.en.json +0 -1
  160. package/templates/.agents/skills/analyze-task/config/verify.zh-CN.json +0 -1
  161. package/templates/.agents/skills/archive-tasks/SKILL.en.md +5 -5
  162. package/templates/.agents/skills/archive-tasks/SKILL.zh-CN.md +5 -5
  163. package/templates/.agents/skills/archive-tasks/scripts/archive-tasks.sh +10 -2
  164. package/templates/.agents/skills/block-task/SKILL.en.md +4 -4
  165. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +5 -5
  166. package/templates/.agents/skills/block-task/config/verify.json +0 -1
  167. package/templates/.agents/skills/cancel-task/SKILL.en.md +7 -7
  168. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +7 -7
  169. package/templates/.agents/skills/cancel-task/config/verify.json +0 -1
  170. package/templates/.agents/skills/code-task/SKILL.en.md +1 -1
  171. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +3 -3
  172. package/templates/.agents/skills/code-task/config/verify.en.json +0 -1
  173. package/templates/.agents/skills/code-task/config/verify.zh-CN.json +0 -1
  174. package/templates/.agents/skills/code-task/reference/output-template.en.md +1 -1
  175. package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +1 -1
  176. package/templates/.agents/skills/commit/SKILL.en.md +1 -1
  177. package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
  178. package/templates/.agents/skills/commit/config/verify.json +0 -1
  179. package/templates/.agents/skills/commit/reference/commit-orchestration.en.md +2 -2
  180. package/templates/.agents/skills/commit/reference/commit-orchestration.zh-CN.md +2 -2
  181. package/templates/.agents/skills/commit/reference/pr-summary-sync.en.md +2 -2
  182. package/templates/.agents/skills/commit/reference/pr-summary-sync.zh-CN.md +2 -2
  183. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +2 -2
  184. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +2 -2
  185. package/templates/.agents/skills/complete-manual-validation/config/verify.en.json +0 -1
  186. package/templates/.agents/skills/complete-manual-validation/config/verify.zh-CN.json +0 -1
  187. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +3 -3
  188. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +3 -3
  189. package/templates/.agents/skills/complete-task/SKILL.en.md +15 -30
  190. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +17 -32
  191. package/templates/.agents/skills/complete-task/config/verify.en.json +0 -1
  192. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +0 -1
  193. package/templates/.agents/skills/create-pr/SKILL.en.md +3 -3
  194. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +3 -3
  195. package/templates/.agents/skills/create-pr/config/verify.json +0 -1
  196. package/templates/.agents/skills/create-pr/reference/change-report.en.md +10 -3
  197. package/templates/.agents/skills/create-pr/reference/change-report.zh-CN.md +10 -3
  198. package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +3 -3
  199. package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +3 -3
  200. package/templates/.agents/skills/create-release-note/SKILL.en.md +2 -2
  201. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +2 -2
  202. package/templates/.agents/skills/create-task/SKILL.en.md +4 -22
  203. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +4 -22
  204. package/templates/.agents/skills/create-task/config/verify.json +0 -1
  205. package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
  206. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  207. package/templates/.agents/skills/import-codescan/config/verify.json +0 -1
  208. package/templates/.agents/skills/import-dependabot/SKILL.en.md +3 -3
  209. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +3 -3
  210. package/templates/.agents/skills/import-dependabot/config/verify.json +0 -1
  211. package/templates/.agents/skills/import-issue/SKILL.en.md +5 -5
  212. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -5
  213. package/templates/.agents/skills/import-issue/config/verify.json +0 -1
  214. package/templates/.agents/skills/plan-task/SKILL.en.md +5 -5
  215. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +5 -5
  216. package/templates/.agents/skills/plan-task/config/verify.en.json +0 -1
  217. package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +0 -1
  218. package/templates/.agents/skills/restore-task/SKILL.en.md +2 -2
  219. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +3 -3
  220. package/templates/.agents/skills/restore-task/config/verify.json +0 -1
  221. package/templates/.agents/skills/review-analysis/SKILL.en.md +1 -1
  222. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +2 -2
  223. package/templates/.agents/skills/review-analysis/config/verify.en.json +0 -1
  224. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +0 -1
  225. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +5 -5
  226. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +5 -5
  227. package/templates/.agents/skills/review-code/SKILL.en.md +2 -2
  228. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +2 -2
  229. package/templates/.agents/skills/review-code/reference/output-templates.en.md +4 -4
  230. package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +4 -4
  231. package/templates/.agents/skills/review-plan/SKILL.en.md +1 -1
  232. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +2 -2
  233. package/templates/.agents/skills/review-plan/config/verify.en.json +0 -1
  234. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +0 -1
  235. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +5 -5
  236. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +5 -5
  237. package/templates/.agents/skills/review-pr/SKILL.en.md +2 -2
  238. package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +2 -2
  239. package/templates/.agents/skills/review-pr/config/verify.en.json +0 -1
  240. package/templates/.agents/skills/review-pr/config/verify.zh-CN.json +0 -1
  241. package/templates/.agents/skills/review-pr/reference/output-guidance.en.md +1 -1
  242. package/templates/.agents/skills/review-pr/reference/output-guidance.zh-CN.md +1 -1
  243. package/templates/.agents/skills/run-manual-validation/config/verify.en.json +0 -1
  244. package/templates/.agents/skills/run-manual-validation/config/verify.zh-CN.json +0 -1
  245. package/templates/.agents/skills/run-task/SKILL.en.md +1 -1
  246. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +1 -1
  247. package/templates/.agents/skills/test/SKILL.en.md +0 -3
  248. package/templates/.agents/skills/test/SKILL.zh-CN.md +0 -3
  249. package/templates/.agents/skills/test-integration/SKILL.en.md +0 -3
  250. package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +0 -3
  251. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +13 -6
  252. package/templates/.agents/skills/upgrade-dependency/SKILL.en.md +0 -3
  253. package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +0 -3
  254. package/templates/.agents/skills/watch-pr/SKILL.en.md +4 -4
  255. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +4 -4
  256. package/templates/.agents/skills/watch-pr/config/verify.json +0 -1
  257. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +3 -3
  258. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +3 -3
  259. package/templates/.agents/templates/handoff.en.md +1 -1
  260. package/templates/.agents/templates/handoff.zh-CN.md +1 -1
  261. package/templates/.agents/workflows/bug-fix.en.yaml +1 -1
  262. package/templates/.agents/workflows/feature-development.en.yaml +1 -1
  263. package/templates/.agents/workflows/refactoring.en.yaml +1 -1
  264. package/dist/lib/task/task-execution-lock.js +0 -250
  265. package/lib/task/task-execution-lock.ts +0 -320
@@ -7,16 +7,16 @@ description: >
7
7
 
8
8
  # 归档已完成任务
9
9
 
10
- 将 `.agents/workspace/completed/` 中的已完成任务归档到 `.agents/workspace/archive/YYYY/MM/DD/TASK-xxx/local/`,并重建三级归档索引。TASK 本地材料位于 `local/`,含按路径排序的 `contents.sha256`;TASK 根目录不存放普通文件。
11
- - 根 manifest:`.agents/workspace/archive/manifest.md`
12
- - 年 manifest:`.agents/workspace/archive/YYYY/manifest.md`
13
- - 月 manifest:`.agents/workspace/archive/YYYY/MM/manifest.md`
10
+ 将 `<task-workspace>/completed/` 中的已完成任务归档到 `<task-workspace>/archive/YYYY/MM/DD/TASK-xxx/local/`,并重建三级归档索引。TASK 本地材料位于 `local/`,含按路径排序的 `contents.sha256`;TASK 根目录不存放普通文件。
11
+ - 根 manifest:`<task-workspace>/archive/manifest.md`
12
+ - 年 manifest:`<task-workspace>/archive/YYYY/manifest.md`
13
+ - 月 manifest:`<task-workspace>/archive/YYYY/MM/manifest.md`
14
14
 
15
15
  ## 执行流程
16
16
 
17
17
  ### 1. 验证环境
18
18
 
19
- 确认 `.agents/workspace/completed/` 存在,并根据用户输入选择以下四种调用方式之一:
19
+ 确认 `<task-workspace>/completed/` 存在,并根据用户输入选择以下四种调用方式之一:
20
20
  - 无参数:归档全部已完成任务
21
21
  - `--days N`:保留最近 `N` 天,仅归档更早的任务
22
22
  - `--before YYYY-MM-DD`:仅归档指定日期之前的任务
@@ -4,7 +4,15 @@ set -e
4
4
 
5
5
  SCRIPT_DIR=$(CDPATH= cd "$(dirname "$0")" && pwd)
6
6
  REPO_ROOT=$(CDPATH= cd "$SCRIPT_DIR/../../../.." && pwd)
7
- WORKSPACE_ROOT="$REPO_ROOT/.agents/workspace"
7
+ if [ -f "$REPO_ROOT/bin/internal-cli.sh" ]; then
8
+ WORKSPACE_RESULT=$(CDPATH= cd "$REPO_ROOT" && sh "$REPO_ROOT/bin/internal-cli.sh" task-workspace resolve --boundary host)
9
+ elif command -v agent-infra-internal >/dev/null 2>&1; then
10
+ WORKSPACE_RESULT=$(CDPATH= cd "$REPO_ROOT" && agent-infra-internal task-workspace resolve --boundary host)
11
+ else
12
+ printf 'archive-tasks: agent-infra-internal task-workspace resolver is unavailable\n' >&2
13
+ exit 1
14
+ fi
15
+ WORKSPACE_ROOT=$(printf '%s' "$WORKSPACE_RESULT" | node -e 'let input="";process.stdin.setEncoding("utf8");process.stdin.on("data",chunk=>input+=chunk);process.stdin.on("end",()=>{const result=JSON.parse(input);if(result.status!=="resolved"||typeof result.root!=="string")process.exit(1);process.stdout.write(result.root);});')
8
16
  COMPLETED_DIR="$WORKSPACE_ROOT/completed"
9
17
  ARCHIVE_DIR="$WORKSPACE_ROOT/archive"
10
18
  MANIFEST_PATH="$ARCHIVE_DIR/manifest.md"
@@ -586,4 +594,4 @@ echo
586
594
  echo "Summary:"
587
595
  printf -- '- Archived: %s\n' "$archived_count"
588
596
  printf -- '- Skipped: %s\n' "$skipped_count"
589
- printf -- '- Manifest: %s\n' ".agents/workspace/archive/manifest.md"
597
+ printf -- '- Manifest: %s\n' "$ARCHIVE_DIR/manifest.md"
@@ -38,7 +38,7 @@ After prerequisites pass, Step 3 declares one lifecycle intent that atomically w
38
38
 
39
39
  ### 1. Verify Task Exists
40
40
 
41
- Check that the task exists in `.agents/workspace/active/{task-id}/`.
41
+ Check that the task exists in `<task-workspace>/active/{task-id}/`.
42
42
 
43
43
  Note: `{task-id}` format is `TASK-{yyyyMMdd-HHmmss}`, e.g. `TASK-20260306-143022`
44
44
 
@@ -68,7 +68,7 @@ Confirm `targetState=blocked`, the target path, and the committed short-id effec
68
68
  ### 5. Preserve Recovery Identity
69
69
 
70
70
  ```bash
71
- ls .agents/workspace/blocked/{task-id}/task.md
71
+ ls <task-workspace>/blocked/{task-id}/task.md
72
72
  ```
73
73
 
74
74
  ### 6. Sync to Issue (Optional)
@@ -111,7 +111,7 @@ Task {task-id} marked as blocked.
111
111
 
112
112
  Blocking reason: {summary}
113
113
  Required to unblock: {what's needed}
114
- Archived to: .agents/workspace/blocked/{task-id}/
114
+ Archived to: <task-workspace>/blocked/{task-id}/
115
115
 
116
116
  Optional: clean up this task's sandbox
117
117
  (The task is blocked and moved to blocked/; task-bound sandboxes are protected from automatic `ai sandbox rm --unbound` cleanup. If cleanup is necessary, manually verify the container, control manifest, and worktree identity first.)
@@ -129,7 +129,7 @@ Next step - check task status after unblocking:
129
129
 
130
130
  - [ ] Analyzed and documented the blocking reason
131
131
  - [ ] Updated task.md with blocked status and blocking information
132
- - [ ] Moved task directory to `.agents/workspace/blocked/`
132
+ - [ ] Moved task directory to `<task-workspace>/blocked/`
133
133
  - [ ] Verified move succeeded
134
134
  - [ ] Informed user how to unblock
135
135
 
@@ -37,7 +37,7 @@ description: >
37
37
  ## 执行步骤
38
38
  ### 1. 验证任务存在
39
39
 
40
- 检查任务是否存在于 `.agents/workspace/active/{task-id}/`。
40
+ 检查任务是否存在于 `<task-workspace>/active/{task-id}/`。
41
41
 
42
42
  注意:`{task-id}` 格式为 `TASK-{yyyyMMdd-HHmmss}`,例如 `TASK-20260306-143022`
43
43
 
@@ -62,10 +62,10 @@ agent-infra-internal task-lifecycle {task-id} block --agent {standard-agent-toke
62
62
 
63
63
  ### 4. 验证本地终态
64
64
 
65
- 确认结构化结果的 `targetState=blocked`、目标路径为 `.agents/workspace/blocked/{task-id}`、短号效果已提交,并检查:
65
+ 确认结构化结果的 `targetState=blocked`、目标路径为 `<task-workspace>/blocked/{task-id}`、短号效果已提交,并检查:
66
66
 
67
67
  ```bash
68
- ls .agents/workspace/blocked/{task-id}/task.md
68
+ ls <task-workspace>/blocked/{task-id}/task.md
69
69
  ```
70
70
 
71
71
  ### 5. 保留恢复身份
@@ -110,7 +110,7 @@ agent-infra-internal task-verify {task-id} block-task.completed --format text
110
110
 
111
111
  阻塞原因:{摘要}
112
112
  解除阻塞所需:{需要什么}
113
- 归档路径:.agents/workspace/blocked/{task-id}/
113
+ 归档路径:<task-workspace>/blocked/{task-id}/
114
114
 
115
115
  可选:清理本任务的沙箱
116
116
  (任务已阻塞并移到 blocked/,task-bound 沙箱受保护,不会被 `ai sandbox rm --unbound` 自动删除;如确需清理,请先人工核对容器、控制清单和工作树身份。)
@@ -128,7 +128,7 @@ agent-infra-internal task-verify {task-id} block-task.completed --format text
128
128
 
129
129
  - [ ] 分析并记录了阻塞原因
130
130
  - [ ] 更新了 task.md 的阻塞状态和阻塞信息
131
- - [ ] 将任务目录移动到 `.agents/workspace/blocked/`
131
+ - [ ] 将任务目录移动到 `<task-workspace>/blocked/`
132
132
  - [ ] 验证了移动成功
133
133
  - [ ] 告知了用户如何解除阻塞
134
134
 
@@ -18,7 +18,6 @@
18
18
  "require_blocked_at": true
19
19
  },
20
20
  "activity-log": {
21
- "expected_action_pattern": "(Block Task|Blocked)"
22
21
  },
23
22
  "platform-sync": {
24
23
  "when": "platform_issue_identity_exists"
@@ -33,9 +33,9 @@ After prerequisites pass, Step 3 declares one lifecycle intent that atomically c
33
33
  ### 1. Verify Task Exists
34
34
 
35
35
  Check these directories in order:
36
- - `.agents/workspace/active/{task-id}/`
37
- - `.agents/workspace/blocked/{task-id}/`
38
- - `.agents/workspace/completed/{task-id}/`
36
+ - `<task-workspace>/active/{task-id}/`
37
+ - `<task-workspace>/blocked/{task-id}/`
38
+ - `<task-workspace>/completed/{task-id}/`
39
39
 
40
40
  Handling rules:
41
41
  - If found in `active/` or `blocked/`: continue
@@ -69,7 +69,7 @@ Confirm `targetState=completed`, terminal fields, and the short-id effect from t
69
69
  ### 5. Verify the Move
70
70
 
71
71
  ```bash
72
- ls .agents/workspace/completed/{task-id}/task.md
72
+ ls <task-workspace>/completed/{task-id}/task.md
73
73
  ```
74
74
 
75
75
  Confirm the task directory was moved successfully.
@@ -83,7 +83,7 @@ If a valid `platform_issue_identity` exists, require `applied` / `no-op` without
83
83
  - Write the cancellation body to a temporary file and run `agent-infra-internal platform-comment sync {task-id} --kind cancel --body-file {path} --agent {standard-agent-token}`
84
84
  - Run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
85
85
 
86
- The cancellation comment must include at least:
86
+ The cancellation comment JSON fields are `taskId`, `title`, `outcome:"cancelled"`, `reason`, `cancelledAt`, and `lastCompletedArtifact`, sourced from task identity, task.md, the recorded cancellation reason/time, and the current artifact registry (`null` when no completed artifact exists). It must include at least:
87
87
  - the cancellation reason
88
88
  - the selected `status:` label
89
89
 
@@ -120,7 +120,7 @@ Task {task-id} cancelled; task directory moved to completed/.
120
120
 
121
121
  Cancellation reason: {reason}
122
122
  Status label: {status-label or skipped}
123
- Target path: .agents/workspace/completed/{task-id}/
123
+ Target path: <task-workspace>/completed/{task-id}/
124
124
 
125
125
  Optional: clean up this task's sandbox
126
126
  (The task is completed and archived; the sandbox container and per-branch config directory are not reclaimed automatically. Run this if you no longer need them:)
@@ -136,7 +136,7 @@ Next step - inspect the moved task:
136
136
  ## Completion Checklist
137
137
 
138
138
  - [ ] Recorded the cancellation reason and updated task.md
139
- - [ ] Moved the task directory into `.agents/workspace/completed/`
139
+ - [ ] Moved the task directory into `<task-workspace>/completed/`
140
140
  - [ ] Completed Issue sync when an Issue exists
141
141
  - [ ] Ran and passed the verification gate
142
142
  - [ ] Showed the full next-step command set to the user
@@ -32,9 +32,9 @@ description: >
32
32
  ### 1. 验证任务存在
33
33
 
34
34
  依次检查以下目录:
35
- - `.agents/workspace/active/{task-id}/`
36
- - `.agents/workspace/blocked/{task-id}/`
37
- - `.agents/workspace/completed/{task-id}/`
35
+ - `<task-workspace>/active/{task-id}/`
36
+ - `<task-workspace>/blocked/{task-id}/`
37
+ - `<task-workspace>/completed/{task-id}/`
38
38
 
39
39
  处理规则:
40
40
  - 如果在 `active/` 或 `blocked/` 中找到:继续
@@ -68,7 +68,7 @@ agent-infra-internal task-lifecycle {task-id} cancel --agent {standard-agent-tok
68
68
  ### 5. 验证转移
69
69
 
70
70
  ```bash
71
- ls .agents/workspace/completed/{task-id}/task.md
71
+ ls <task-workspace>/completed/{task-id}/task.md
72
72
  ```
73
73
 
74
74
  确认任务目录已成功移动。
@@ -82,7 +82,7 @@ ls .agents/workspace/completed/{task-id}/task.md
82
82
  - 将取消正文写入临时文件,调用 `agent-infra-internal platform-comment sync {task-id} --kind cancel --body-file {path} --agent {standard-agent-token}`
83
83
  - 调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
84
84
 
85
- 取消评论至少包含:
85
+ 取消评论 JSON 字段为 `taskId`、`title`、`outcome:"cancelled"`、`reason`、`cancelledAt`、`lastCompletedArtifact`,值来自任务身份、task.md、已记录取消原因与时间和当前 artifact registry;无已完成产物时用 `null`。取消评论至少包含:
86
86
  - 取消原因
87
87
  - 选定的 `status:` label
88
88
 
@@ -117,7 +117,7 @@ agent-infra-internal task-verify {task-id} cancel-task.completed --format text
117
117
 
118
118
  取消原因:{reason}
119
119
  状态标签:{status-label 或 skipped}
120
- 目标路径:.agents/workspace/completed/{task-id}/
120
+ 目标路径:<task-workspace>/completed/{task-id}/
121
121
 
122
122
  可选:清理本任务的沙箱
123
123
  (任务已完成并归档,沙箱容器和 per-branch 配置目录不会自动回收。如果不再需要可执行:)
@@ -133,7 +133,7 @@ ai sandbox rm {task-id}
133
133
  ## 完成检查清单
134
134
 
135
135
  - [ ] 已记录取消原因并更新 task.md
136
- - [ ] 已将任务目录移动到 `.agents/workspace/completed/`
136
+ - [ ] 已将任务目录移动到 `<task-workspace>/completed/`
137
137
  - [ ] 已在存在 Issue 时完成 Issue 同步
138
138
  - [ ] 已运行 gate 校验并通过
139
139
  - [ ] 已通过统一 helper 渲染已选场景的下一步命令
@@ -19,7 +19,6 @@
19
19
  "require_cancelled_at": true
20
20
  },
21
21
  "activity-log": {
22
- "expected_action_pattern": "(Cancel Task|Cancelled)"
23
22
  },
24
23
  "platform-sync": {
25
24
  "when": "platform_issue_identity_exists"
@@ -126,7 +126,7 @@ agent-infra-internal task-artifact {task-id} init --family code --artifact {code
126
126
 
127
127
  The skeleton contains identity metadata, stable section markers, and required headings only; real implementation and verification content is required before the completion gate can pass. On a preflight or finalization structural error, follow `.agents/rules/local-artifact-repair.md` to correct the formal artifact directly and rerun the same entry point; current structure, qualification, and summary facts are the only gate.
128
128
 
129
- Create `.agents/workspace/active/{task-id}/{code-artifact}`.
129
+ Create `<task-workspace>/active/{task-id}/{code-artifact}`.
130
130
 
131
131
  > Read `reference/report-template.md` before writing the report.
132
132
 
@@ -75,7 +75,7 @@ agent-infra-internal task-snapshot {task-id} --format text
75
75
  ### 1. 验证前置条件
76
76
 
77
77
  先检查:
78
- - `.agents/workspace/active/{task-id}/task.md`
78
+ - `<task-workspace>/active/{task-id}/task.md`
79
79
 
80
80
  如果缺少任务文件,立即停止。生命周期输入由步骤 4 的核心查询按已选路径验证;技能不得预先固定要求方案产物。
81
81
 
@@ -165,7 +165,7 @@ agent-infra-internal task-artifact {task-id} init --family code --artifact {code
165
165
 
166
166
  骨架只包含身份元数据、稳定 section marker 和必需标题;必须填入真实实现与验证内容后才能通过完成门禁。preflight 或 finalizer 返回结构错误时,按 `.agents/rules/local-artifact-repair.md` 直接修正正式产物并重跑原入口;当前结构、资格和摘要事实是唯一门禁。
167
167
 
168
- 创建 `.agents/workspace/active/{task-id}/{code-artifact}`。
168
+ 创建 `<task-workspace>/active/{task-id}/{code-artifact}`。
169
169
 
170
170
  > 报告结构、必填章节和完整模板见 `reference/report-template.md`。写报告前先读取 `reference/report-template.md`。
171
171
 
@@ -207,7 +207,7 @@ echo "$finalizer"
207
207
 
208
208
  ### 11. 更新任务状态
209
209
 
210
- 更新 `.agents/workspace/active/{task-id}/task.md`:
210
+ 更新 `<task-workspace>/active/{task-id}/task.md`:
211
211
  - 审查 `## 需求` 段落,仅把本轮已由代码实现且有测试通过支撑的条目从 `- [ ]` 勾为 `- [x]`
212
212
  - 产物链接、阶段与完成日志由 completed 事件统一登记
213
213
  - 完成业务内容更新后声明完成事件:
@@ -21,7 +21,6 @@
21
21
  },
22
22
  "implementation-input": {},
23
23
  "activity-log": {
24
- "expected_action_pattern": "(Code Task|Code) \\(Round \\d+(?:(?:, fix for review-code(?:-r\\d+)?\\.md)|(?:, decision II-[1-9]\\d*))?\\)"
25
24
  },
26
25
  "review-ledger": {
27
26
  "stage_scope": [
@@ -21,7 +21,6 @@
21
21
  },
22
22
  "implementation-input": {},
23
23
  "activity-log": {
24
- "expected_action_pattern": "(Code Task|Code) \\(Round \\d+(?:(?:, fix for review-code(?:-r\\d+)?\\.md)|(?:, decision II-[1-9]\\d*))?\\)"
25
24
  },
26
25
  "review-ledger": {
27
26
  "stage_scope": [
@@ -13,7 +13,7 @@ Summary:
13
13
  - All tests passed: {yes/no}
14
14
 
15
15
  Output files:
16
- - Code report: .agents/workspace/active/{task-id}/{code-artifact}
16
+ - Code report: <task-workspace>/active/{task-id}/{code-artifact}
17
17
 
18
18
  Next step - code review:
19
19
  {next-step-commands}
@@ -13,7 +13,7 @@
13
13
  - 所有测试通过:{是/否}
14
14
 
15
15
  产出文件:
16
- - 实现报告:.agents/workspace/active/{task-id}/{code-artifact}
16
+ - 实现报告:<task-workspace>/active/{task-id}/{code-artifact}
17
17
 
18
18
  下一步 - 代码审查:
19
19
  {next-step-commands}
@@ -71,7 +71,7 @@ Example:
71
71
  }
72
72
  ```
73
73
 
74
- Taskless direct mode omits `taskRef`; direct task-bound commits use push delivery. The core owns repository/worktree mutation locking, task locking when bound, path and sensitive-file checks, staged scope, HEAD/tree, branch/ref, commit, push, protected-branch policy, warnings, and idempotency.
74
+ Taskless direct mode omits `taskRef`; direct task-bound commits use push delivery. Both modes execute serially at the caller boundary; the core still owns path and sensitive-file checks, staged scope, HEAD/tree, branch/ref, commit, push, protected-branch policy, warnings, and idempotency.
75
75
 
76
76
  - Create at most one local commit for explicit changes.
77
77
  - If there are no changes but HEAD is ahead and delivery is requested, perform push-only and do not create an empty commit.
@@ -71,7 +71,7 @@ agent-infra-internal git-workflow commit --input {commit-operation.json}
71
71
  }
72
72
  ```
73
73
 
74
- taskless direct 省略 `taskRef`;direct task-bound commit 使用 push delivery。core 统一负责 repository/worktree mutation lock、task lock(仅 task-bound)、路径和敏感文件、staged scope、HEAD/tree、branch/ref、commit、push、保护分支、warning 和幂等校验。
74
+ taskless direct 省略 `taskRef`;direct task-bound commit 使用 push delivery。两种模式都按调用方串行执行;core 仍负责路径和敏感文件、staged scope、HEAD/tree、branch/ref、commit、push、保护分支、warning 和幂等校验。
75
75
 
76
76
  - 有明确修改时最多创建一个本地 commit。
77
77
  - 无修改但需要交付本地领先的 HEAD 时只执行 push-only,不创建空 commit。
@@ -15,7 +15,6 @@
15
15
  ]
16
16
  },
17
17
  "activity-log": {
18
- "expected_action_pattern": "Commit"
19
18
  },
20
19
  "platform-sync": {
21
20
  "when": "pr_fact_bound"
@@ -4,12 +4,12 @@ Commit, push, result mapping, and task finalization use one `commit-operation.ex
4
4
 
5
5
  ## Entry modes
6
6
 
7
- - `mode=direct`: explicit user invocation is the authorization. Task-bound direct may read task facts but does not require a delegation receipt; taskless direct is allowed only for `TASK_CONTEXT_NOT_FOUND` and skips task facts, review, task lock, checkpoint, and task.md finalization.
7
+ - `mode=direct`: explicit user invocation is the authorization. Task-bound direct may read task facts but does not require a delegation receipt; taskless direct is allowed only for `TASK_CONTEXT_NOT_FOUND` and skips task facts, review, checkpoint, and task.md finalization.
8
8
  - `mode=orchestrated` is removed: standalone commit is no longer a lifecycle delegation stage. This mode returns `ORCHESTRATED_COMMIT_REMOVED` without writing Git; the code stage closes through a local checkpoint.
9
9
 
10
10
  ## Shared order
11
11
 
12
- 1. Acquire the repository/worktree mutation lock; task-bound execution also acquires the task lock.
12
+ 1. Direct commits execute serially at the caller boundary.
13
13
  2. Validate the repository, current branch, explicit paths, sensitive paths, staged scope, expected HEAD/tree, remote, and full heads ref.
14
14
  3. Validate direct-mode authorization.
15
15
  4. Create at most one local commit; with no changes, allow push-only and never create an empty commit.
@@ -4,12 +4,12 @@ commit、push、结果映射和任务收尾使用同一个 `commit-operation.exe
4
4
 
5
5
  ## 入口模式
6
6
 
7
- - `mode=direct`:用户显式调用授权。task-bound direct 可读取 task facts,但不要求 delegation receipt;taskless direct 只在 `TASK_CONTEXT_NOT_FOUND` 时允许,并跳过 task facts、review、task lock、checkpoint 和 task.md 收尾。
7
+ - `mode=direct`:用户显式调用授权。task-bound direct 可读取 task facts,但不要求 delegation receipt;taskless direct 只在 `TASK_CONTEXT_NOT_FOUND` 时允许,并跳过 task facts、review、checkpoint 和 task.md 收尾。
8
8
  - `mode=orchestrated` 已移除:独立 commit 不再是生命周期 delegation stage;调用该模式返回 `ORCHESTRATED_COMMIT_REMOVED`,不写 Git。生命周期 code 阶段完成后由 local checkpoint 直接收口。
9
9
 
10
10
  ## 共享执行顺序
11
11
 
12
- 1. 获取 repository/worktree mutation lock;task-bound 额外获取 task lock。
12
+ 1. direct commit 按调用方串行执行。
13
13
  2. 验证 repository、当前 branch、明确 paths、敏感路径、staged scope、expected HEAD/tree、remote 和 full heads ref。
14
14
  3. 完成 direct 模式授权校验。
15
15
  4. 最多创建一个本地 commit;无修改时只允许 push-only,不创建空 commit。
@@ -3,7 +3,7 @@
3
3
  Run only when `{task-id}` is valid and task.md has a `bound/verified` `pr_delivery_fact`.
4
4
 
5
5
  1. Run `agent-infra-internal platform-pr summary-context {task-id}` to obtain canonical inputs and report status; rebuild a stale/missing sidecar through the `change-report` flow for the current head.
6
- 2. Generate the plain summary body per `.agents/rules/pr-sync.md`, with exactly one `<!-- canonical-pr-change-report -->` placeholder, and write it to a temporary file.
7
- 3. Run `agent-infra-internal platform-pr summary-sync {task-id} --agent {standard-agent-token} --body-file {summary-body-file} --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json --result no_op`. The commit path only synchronizes an existing PR summary and neither creates nor reuses a PR, so `no_op` explicitly represents the unchanged PR identity.
6
+ 2. Generate the complete PR summary JSON payload per `.agents/rules/pr-sync.md` and write it to a temporary file.
7
+ 3. Run `agent-infra-internal platform-pr summary-sync {task-id} --agent {standard-agent-token} --body-file {summary-body-file} --change-report-file <task-workspace>/active/{task-id}/pr-change-report.json --result no_op`. The commit path only synchronizes an existing PR summary and neither creates nor reuses a PR, so `no_op` explicitly represents the unchanged PR identity.
8
8
 
9
9
  Failure records a warning but never blocks or rolls back the completed commit. `no-op` maps to `summary skipped (no diff)`.
@@ -3,7 +3,7 @@
3
3
  仅当 `{task-id}` 有效且 `task.md` 存在 `bound/verified` 的 `pr_delivery_fact` 时执行;否则跳过。
4
4
 
5
5
  1. 调用 `agent-infra-internal platform-pr summary-context {task-id}` 获取 canonical 聚合输入和报告状态;sidecar stale/missing 时先按 `change-report` 流程重建当前 head 报告。
6
- 2. 按 `.agents/rules/pr-sync.md` 生成只含一次 `<!-- canonical-pr-change-report -->` 的纯摘要正文并写入临时文件。
7
- 3. 调用 `agent-infra-internal platform-pr summary-sync {task-id} --agent {standard-agent-token} --body-file {summary-body-file} --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json --result no_op`。commit 路径只同步已有 PR 摘要,不创建或复用 PR,因此固定使用 `no_op` 表示 PR 身份未变化。
6
+ 2. 按 `.agents/rules/pr-sync.md` 生成完整 PR 摘要 JSON payload 并写入临时文件;字段和零值状态由内容合同规定。
7
+ 3. 调用 `agent-infra-internal platform-pr summary-sync {task-id} --agent {standard-agent-token} --body-file {summary-body-file} --change-report-file <task-workspace>/active/{task-id}/pr-change-report.json --result no_op`。commit 路径只同步已有 PR 摘要,不创建或复用 PR,因此固定使用 `no_op` 表示 PR 身份未变化。
8
8
 
9
9
  同步失败只记录 warning,不阻塞或回滚已经完成的 commit。`no-op` 回传 `summary skipped (no diff)`。
@@ -59,7 +59,7 @@ complete-manual-validation [--task <ref> | -t <ref>] [{pr-ref}] {verification-su
59
59
  ### 2. Verify Prerequisites
60
60
 
61
61
  Check:
62
- - `.agents/workspace/active/{task-id}/task.md`
62
+ - `<task-workspace>/active/{task-id}/task.md`
63
63
  - a valid PR: prefer explicit `{pr-ref}`, otherwise read verified `pr_delivery_fact.identity.number` from task.md frontmatter
64
64
 
65
65
  Stop if the task is missing, the validation summary is missing, or no valid PR can be resolved.
@@ -96,7 +96,7 @@ Follow `reference/summary-update.md` to validate the PR binding, obtain canonica
96
96
  ```bash
97
97
  agent-infra-internal manual-validation transaction {task-id} \
98
98
  --artifact {manual-validation-artifact} \
99
- --summary-file {summary-body-file} --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json \
99
+ --summary-file {summary-body-file} --change-report-file <task-workspace>/active/{task-id}/pr-change-report.json \
100
100
  --agent {standard-agent-token} --result no_op
101
101
  ```
102
102
 
@@ -59,7 +59,7 @@ complete-manual-validation [--task <ref> | -t <ref>] [{pr-ref}] {verification-su
59
59
  ### 2. 验证前置条件
60
60
 
61
61
  检查:
62
- - `.agents/workspace/active/{task-id}/task.md`
62
+ - `<task-workspace>/active/{task-id}/task.md`
63
63
  - 有效 PR:优先使用显式 `{pr-ref}`,否则读取 task.md frontmatter 的 verified `pr_delivery_fact.identity.number`
64
64
 
65
65
  如果任务不存在、验证说明缺失,或无法解析有效 PR,立即停止。
@@ -96,7 +96,7 @@ prepare 必须先幂等登记 `manual-validation.started`,再写入 prepared t
96
96
  ```bash
97
97
  agent-infra-internal manual-validation transaction {task-id} \
98
98
  --artifact {manual-validation-artifact} \
99
- --summary-file {summary-body-file} --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json \
99
+ --summary-file {summary-body-file} --change-report-file <task-workspace>/active/{task-id}/pr-change-report.json \
100
100
  --agent {standard-agent-token} --result no_op
101
101
  ```
102
102
 
@@ -28,7 +28,6 @@
28
28
  ]
29
29
  },
30
30
  "activity-log": {
31
- "expected_action_pattern": "Complete Manual Validation"
32
31
  },
33
32
  "review-ledger": {
34
33
  "stage_scope": [
@@ -28,7 +28,6 @@
28
28
  ]
29
29
  },
30
30
  "activity-log": {
31
- "expected_action_pattern": "Complete Manual Validation"
32
31
  },
33
32
  "review-ledger": {
34
33
  "stage_scope": [
@@ -4,7 +4,7 @@ Run only for a valid `{task-id}` whose task.md binds a verified `pr_delivery_fac
4
4
 
5
5
  Follow `.agents/rules/pr-sync.md` for the shared summary structure and failure semantics.
6
6
 
7
- 1. Run `agent-infra-internal platform-pr summary-context {task-id}` to obtain the canonical summary body; the maintainer's PR validation comment and validation summary are the human-validation authority.
7
+ 1. Run `agent-infra-internal platform-pr summary-context {task-id}` to obtain canonical summary facts. `--summary-file` uses the complete PR summary JSON payload; the maintainer's PR validation comment and validation summary are the human-validation authority.
8
8
  2. Before creating the canonical `manual-validation*` artifact, call the transaction coordinator in prepare mode to record `started` before writing the prepared transaction:
9
9
 
10
10
  ```bash
@@ -13,13 +13,13 @@ agent-infra-internal manual-validation transaction {task-id} --prepare \
13
13
  --summary-file {summary-body-file} --agent {standard-agent-token}
14
14
  ```
15
15
 
16
- 3. After prepare succeeds, write the canonical `manual-validation*` artifact, write the pending plain body with exactly one `<!-- canonical-pr-change-report -->` placeholder to a temporary file, and run the transaction coordinator:
16
+ 3. After prepare succeeds, write the canonical `manual-validation*` artifact, set the JSON payload's `manualValidation.state` to `pending` with a non-empty explanation, and run the transaction coordinator:
17
17
 
18
18
  ```bash
19
19
  agent-infra-internal manual-validation transaction {task-id} \
20
20
  --artifact {manual-validation-artifact} \
21
21
  --summary-file {summary-body-file} \
22
- --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json \
22
+ --change-report-file <task-workspace>/active/{task-id}/pr-change-report.json \
23
23
  --agent {standard-agent-token} --result no_op
24
24
  ```
25
25
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  摘要结构与失败语义统一遵循 `.agents/rules/pr-sync.md`。
6
6
 
7
- 1. 调用 `agent-infra-internal platform-pr summary-context {task-id}`,取得 canonical 摘要正文;维护者提供的 PR 人工验证留言和验证说明作为完成人工校验依据。
7
+ 1. 调用 `agent-infra-internal platform-pr summary-context {task-id}`,取得 canonical 摘要事实;`--summary-file` 使用完整 PR 摘要 JSON payload,维护者提供的 PR 人工验证留言和验证说明作为完成人工校验依据。
8
8
  2. 在创建 canonical `manual-validation*` artifact 前,调用 transaction coordinator 的 prepare 模式,先登记 started,再写 prepared transaction:
9
9
 
10
10
  ```bash
@@ -13,13 +13,13 @@ agent-infra-internal manual-validation transaction {task-id} --prepare \
13
13
  --summary-file {summary-body-file} --agent {standard-agent-token}
14
14
  ```
15
15
 
16
- 3. prepare 成功后写入 canonical `manual-validation*` artifact,并把只含一次 `<!-- canonical-pr-change-report -->` 的 pending 正文写入临时文件,调用 transaction coordinator:
16
+ 3. prepare 成功后写入 canonical `manual-validation*` artifact,并将 JSON payload 中 `manualValidation` 设置为 `pending`、提供非空说明后写入临时文件,调用 transaction coordinator:
17
17
 
18
18
  ```bash
19
19
  agent-infra-internal manual-validation transaction {task-id} \
20
20
  --artifact {manual-validation-artifact} \
21
21
  --summary-file {summary-body-file} \
22
- --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json \
22
+ --change-report-file <task-workspace>/active/{task-id}/pr-change-report.json \
23
23
  --agent {standard-agent-token} --result no_op
24
24
  ```
25
25
 
@@ -18,8 +18,7 @@ Host finalization uses receipt v4 with an immutable `receiptId`, monotonic `revi
18
18
 
19
19
  Before generating a completion report or synchronized content, read `.agents/rules/evidence-reporting.md`. Successful checks record the command, scope, status or structured result, actual result, and uncovered parts; failures, blocking conditions, or disputes retain a reproducible entry point, exact location, and decisive excerpt.
20
20
 
21
- - This command updates task metadata AND physically moves the task directory
22
- - Do not move a task that has incomplete workflow steps unless forced
21
+ - Host finalization updates task metadata and atomically moves the task directory
23
22
  - The entry point accepts optional `--external-pr <N>` only to select among ambiguous external-delivery candidates; it never bypasses identity or platform gates
24
23
 
25
24
  Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
@@ -50,7 +49,7 @@ On the normal path, complete business updates, platform sync, and the pre-comple
50
49
 
51
50
  ### 1. Verify Task Exists
52
51
 
53
- Check that the task exists in `.agents/workspace/active/{task-id}/`.
52
+ Check that the task exists in `<task-workspace>/active/{task-id}/`.
54
53
 
55
54
  Note: `{task-id}` format is `TASK-{yyyyMMdd-HHmmss}`, e.g. `TASK-20260306-143022`
56
55
 
@@ -102,7 +101,7 @@ Run /create-pr --task {task-ref} first, then complete; --skip-pr is not accepted
102
101
  ```
103
102
 
104
103
  Before lifecycle, verify only the hard gates:
105
- - [ ] Task identity, active state, concurrency locks, and local atomic lifecycle operations are available
104
+ - [ ] Task identity, active-state validation, and local atomic lifecycle operations are available
106
105
  - [ ] Required-PR delivery is satisfied when `prFlow=required`
107
106
  - [ ] Other business evidence (workflow, review, commit, tests, disagreement ledger, manual validation, and platform sync) is recorded or can be checked after lifecycle; manual validation requires a committed transaction, receipt, current artifact digest, and an identity-bearing completion log
108
107
 
@@ -142,7 +141,7 @@ Check whether task.md has a valid `platform_issue_identity`. If it does not, ski
142
141
  When a valid `platform_issue_identity` exists, execute in this exact order:
143
142
 
144
143
  1. Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --requirements --fields`.
145
- 2. Write the business summary to a temporary file and run `agent-infra-internal platform-comment stage-summary {task-id} --body-file {path}`. This stores the body and SHA-256 in the task's durable staging record; it must not publish the summary comment directly.
144
+ 2. Write the completion summary as JSON fields `taskId`, `title`, `summary`, `artifacts`, and `verification:{state,detail}`, then run `agent-infra-internal platform-comment stage-summary {task-id} --body-file {path}`. Use the current artifact registry (`[]` when empty). If final verification has not run, use `state:"not-run"` with a non-empty explanation. The command persists the normalized payload; do not publish the summary comment in this step.
146
145
 
147
146
  The summary body records only delivery results, the associated PR and actual merge facts, verification commands with their scope/results/uncovered areas, and known todo items supported by current task evidence. Include the related commit when it helps explain verification scope. Do not infer unsupported facts; list unfinished work as a todo. This is an Issue closeout summary, not a PR comment.
148
147
 
@@ -174,11 +173,11 @@ agent-infra-internal task-verify {task-id} complete-task.preflight --format text
174
173
 
175
174
  Present the verification summary per `.agents/rules/validation-output.md`, retaining necessary failure, blocked, and soft-warning diagnostics.
176
175
 
177
- This event runs only the required-PR delivery hard preflight; host finalization still enforces identity, concurrency, and local atomicity before lifecycle. Peripheral review/manual/platform checks run through `complete-task.completed` after lifecycle and are projected as warning/pending steps. On a hard-gate non-zero exit (fail/blocked), keep the task active, record the stable code/target, and stop.
176
+ This event runs only the required-PR delivery hard preflight; host finalization still enforces identity validation and local atomicity before lifecycle. Peripheral review/manual/platform checks run through `complete-task.completed` after lifecycle and are projected as warning/pending steps. On a hard-gate non-zero exit (fail/blocked), keep the task active, record the stable code/target, and stop.
178
177
 
179
178
  If a summary must mirror a human-decided `post-review-commit` exemption, make a best-effort sync in Step 4 with the original failure code/message, PRC id/evidence, and ruling details. A sync failure records `SUMMARY_SYNC_FAILED` and still allows lifecycle; terminal verification decides the final state.
180
179
 
181
- `--force` cannot lift identity, concurrency, local atomicity, or required-PR hard gates; failures there must stop. Other review, manual-validation, and platform evidence is recorded by terminal verification as warning/pending and can be repaired by retrying.
180
+ `--force` cannot lift identity validation, local atomicity, or required-PR hard gates; failures there must stop. Other review, manual-validation, and platform evidence is recorded by terminal verification as warning/pending and can be repaired by retrying.
182
181
 
183
182
  ### 6. Run the Host Finalization Entry Point
184
183
 
@@ -209,7 +208,7 @@ Task {task-id} completed; task directory moved to completed/.
209
208
  Task info:
210
209
  - Title: {title}
211
210
  - Completed at: {timestamp}
212
- - Target path: .agents/workspace/completed/{task-id}/
211
+ - Target path: <task-workspace>/completed/{task-id}/
213
212
 
214
213
  Deliverables:
215
214
  - {List of key outputs: files modified, tests added, etc.}
@@ -225,32 +224,18 @@ ai sandbox rm {task-id} # or use the task's retained short id
225
224
 
226
225
  ## Completion Checklist
227
226
 
228
- - [ ] Verified all workflow steps are complete
229
- - [ ] Updated task.md with completed status and timestamp
230
- - [ ] Moved task directory to `.agents/workspace/completed/`
231
- - [ ] Verified move succeeded
232
- - [ ] Informed user of completion
227
+ - [ ] Hard prerequisites are satisfied and the pre-completion gate passes
228
+ - [ ] Host finalization returns `result=completed` or `result=completed_with_warnings`
229
+ - [ ] Completion verification passes
230
+ - [ ] The structured completion result and applicable warnings are reported to the user
233
231
 
234
232
  ## Notes
235
233
 
236
- 1. **Premature completion**: Do not move a task that has incomplete steps. Examples of incomplete situations:
237
- - Code is written but not committed
238
- - Code is committed but not reviewed
239
- - Review found blockers that haven't been fixed
240
- - PR is created but not merged
241
- - Manual validation items are incomplete
242
-
243
- 2. **Rollback**: If a task was incorrectly moved:
244
- ```bash
245
- mv .agents/workspace/completed/{task-id} .agents/workspace/active/{task-id}
246
- ```
247
- Then update task.md status back to `active`.
248
-
249
- 3. **Multiple contributors**: If multiple AI agents worked on the task, ensure all contributions are committed before completing.
234
+ - When multiple AI agents contributed, ensure all contributions are included in the local checkpoint.
250
235
 
251
236
  ## Error Handling
252
237
 
253
238
  - Task not found: Prompt "Task {task-id} not found in active directory"
254
- - Already completed: Prompt "Task {task-id} is already in completed directory"
255
- - Task is blocked: Prompt "Task {task-id} is blocked. Unblock it first by moving to active/"
256
- - Move failed: Prompt error and suggest manual move
239
+ - Already completed: Enter `finalization-retry` only when a matching Complete Task Activity Log exists; otherwise report incomplete terminal identity and stop
240
+ - Task is blocked: Satisfy the recorded unblock condition, then reactivate it through `task-lifecycle activate` before retrying
241
+ - Finalization failed or blocked: Preserve source data and the receipt, then recover through the same finalization entry point using its structured error; do not manually rewrite terminal state or move the task directory