@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
@@ -4,6 +4,6 @@ Run only when `{task-id}` is valid and task.md has a `bound/verified` `pr_delive
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
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.
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)`.
@@ -4,6 +4,6 @@
4
4
 
5
5
  1. 调用 `agent-infra-internal platform-pr summary-context {task-id}` 获取 canonical 聚合输入和报告状态;sidecar stale/missing 时先按 `change-report` 流程重建当前 head 报告。
6
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 身份未变化。
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": [
@@ -19,7 +19,7 @@ agent-infra-internal manual-validation transaction {task-id} --prepare \
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
 
@@ -19,7 +19,7 @@ agent-infra-internal manual-validation transaction {task-id} --prepare \
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
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: complete-task
3
3
  description: >
4
- Mark a task as completed and archive it.
5
- Use when a task's work is done and verified and you want to close and archive it.
4
+ Mark a task as completed.
5
+ Use when a task's work is done and verified and you need to finalize the task.
6
6
  Only invoke this skill automatically when the conversation includes a resolvable task reference.
7
7
  ---
8
8
 
@@ -50,7 +50,7 @@ On the normal path, complete business updates, platform sync, and the pre-comple
50
50
 
51
51
  ### 1. Verify Task Exists
52
52
 
53
- Check that the task exists in `.agents/workspace/active/{task-id}/`.
53
+ Check that the task exists in `<task-workspace>/active/{task-id}/`.
54
54
 
55
55
  Note: `{task-id}` format is `TASK-{yyyyMMdd-HHmmss}`, e.g. `TASK-20260306-143022`
56
56
 
@@ -102,7 +102,7 @@ Run /create-pr --task {task-ref} first, then complete; --skip-pr is not accepted
102
102
  ```
103
103
 
104
104
  Before lifecycle, verify only the hard gates:
105
- - [ ] Task identity, active state, concurrency locks, and local atomic lifecycle operations are available
105
+ - [ ] Task identity, active-state validation, and local atomic lifecycle operations are available
106
106
  - [ ] Required-PR delivery is satisfied when `prFlow=required`
107
107
  - [ ] 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
108
 
@@ -144,6 +144,14 @@ When a valid `platform_issue_identity` exists, execute in this exact order:
144
144
  1. Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --requirements --fields`.
145
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.
146
146
 
147
+ 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
+
149
+ Use the active skill's language by default: the Chinese skill produces a Chinese summary, and the English skill produces an English summary. Keep the same field structure in both languages.
150
+
151
+ Before staging, check the body: remove candidate or pending-closeout placeholders; omit the local short id, unrelated window/model/receipt operation details, and the full TASK-ID already shown by the outer comment. Do not remove or rewrite platform-managed comment markers or recovery metadata. Keep paths when they help explain product behavior. The summary does not predict the Complete Task finalization result or claim that the task is completed or archived. The task target state is `completed`; do not append Archive Tasks by default. The formal task comment and receipt carry the lifecycle terminal status and warnings.
152
+
153
+ Use `stage-summary` to stage the body while the task is active. Do not assume the command remains available after the task reaches completed. If the finalization result shows that a published delivery fact needs correction, first confirm that an existing supported comment-sync entry point accepts the current task state. If none does, report that limitation in the final response; do not add an entry point or change the call sequence.
154
+
147
155
  When the ledger contains a valid `PRC-N` post-review exemption, the summary body must mirror the ruling reason, commit scope, human identity, and time from task.md, and state that this is a human override rather than an automatic verification success. If a matching workflow warning exists, also mirror its original failure code/message. If no warning exists yet, state only that the ruling is recorded and final gate verification is pending; do not claim that the exemption has passed. The same `--kind summary` intent remains the sole owner of the summary marker.
148
156
 
149
157
  Do not sync the task comment here; it requires the terminal task.md written by lifecycle. Do not set a `status:` label; platform automation clears status labels after the Issue closes.
@@ -166,11 +174,11 @@ agent-infra-internal task-verify {task-id} complete-task.preflight --format text
166
174
 
167
175
  Present the verification summary per `.agents/rules/validation-output.md`, retaining necessary failure, blocked, and soft-warning diagnostics.
168
176
 
169
- 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.
177
+ 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.
170
178
 
171
179
  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.
172
180
 
173
- `--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.
181
+ `--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.
174
182
 
175
183
  ### 6. Run the Host Finalization Entry Point
176
184
 
@@ -201,7 +209,7 @@ Task {task-id} completed; task directory moved to completed/.
201
209
  Task info:
202
210
  - Title: {title}
203
211
  - Completed at: {timestamp}
204
- - Target path: .agents/workspace/completed/{task-id}/
212
+ - Target path: <task-workspace>/completed/{task-id}/
205
213
 
206
214
  Deliverables:
207
215
  - {List of key outputs: files modified, tests added, etc.}
@@ -219,7 +227,7 @@ ai sandbox rm {task-id} # or use the task's retained short id
219
227
 
220
228
  - [ ] Verified all workflow steps are complete
221
229
  - [ ] Updated task.md with completed status and timestamp
222
- - [ ] Moved task directory to `.agents/workspace/completed/`
230
+ - [ ] Moved task directory to `<task-workspace>/completed/`
223
231
  - [ ] Verified move succeeded
224
232
  - [ ] Informed user of completion
225
233
 
@@ -234,7 +242,7 @@ ai sandbox rm {task-id} # or use the task's retained short id
234
242
 
235
243
  2. **Rollback**: If a task was incorrectly moved:
236
244
  ```bash
237
- mv .agents/workspace/completed/{task-id} .agents/workspace/active/{task-id}
245
+ mv <task-workspace>/completed/{task-id} <task-workspace>/active/{task-id}
238
246
  ```
239
247
  Then update task.md status back to `active`.
240
248
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: complete-task
3
3
  description: >
4
- 标记任务完成并归档。
5
- 当任务工作已完成并验证、需要收尾归档时使用。
4
+ 标记任务完成。
5
+ 当任务工作已完成并验证、需要提交任务收尾时使用。
6
6
  仅当对话包含可解析的任务引用时才可自动调用本技能。
7
7
  ---
8
8
 
@@ -49,7 +49,7 @@ agent-infra-internal task-snapshot {task-id} --format text
49
49
  ## 执行步骤
50
50
  ### 1. 验证任务存在
51
51
 
52
- 检查任务是否存在于 `.agents/workspace/active/{task-id}/`。
52
+ 检查任务是否存在于 `<task-workspace>/active/{task-id}/`。
53
53
 
54
54
  注意:`{task-id}` 格式为 `TASK-{yyyyMMdd-HHmmss}`,例如 `TASK-20260306-143022`
55
55
 
@@ -101,7 +101,7 @@ agent-infra-internal platform-pr resolve-external {task-id} --agent {standard-ag
101
101
  ```
102
102
 
103
103
  生命周期前只验证硬门禁:
104
- - [ ] task 身份、active 状态、并发锁和本地原子生命周期操作可用
104
+ - [ ] task 身份、active 状态校验和本地原子生命周期操作可用
105
105
  - [ ] `prFlow=required` 时已满足 required-PR delivery
106
106
  - [ ] 其余业务证据(工作流、审查、提交、测试、分歧账本、人工校验和平台同步)已记录或可在生命周期后校验;人工验证只能由 committed transaction、receipt、当前 artifact 摘要和带 identity 的通过日志满足
107
107
 
@@ -125,7 +125,7 @@ Please satisfy the hard prerequisite first, then retry complete-task.
125
125
 
126
126
  ### 3. 完成业务内容更新
127
127
 
128
- 在 `.agents/workspace/active/{task-id}/task.md` 中只更新生命周期核心不负责的业务内容:
128
+ 在 `<task-workspace>/active/{task-id}/task.md` 中只更新生命周期核心不负责的业务内容:
129
129
  - 新增或更新 `## 状态核对` 段,记录第 0 步审计命令、任务/产物范围、关键结果和未覆盖部分;正常成功不复制完整目录清单或 `task.md` 尾部,失败、阻塞、身份不一致或争议时附决定性原文行,放在 `## 活动日志` 之前
130
130
  - 标记所有工作流步骤为已完成
131
131
  - 逐项验证并勾选 `## 完成检查清单` 中的所有条目(将 `- [ ]` 改为 `- [x]`)
@@ -143,6 +143,14 @@ Please satisfy the hard prerequisite first, then retry complete-task.
143
143
  1. 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --requirements --fields`。
144
144
  2. 把业务摘要写入临时文件,并调用 `agent-infra-internal platform-comment stage-summary {task-id} --body-file {path}`。该命令把正文和 SHA-256 写入 task 目录的 durable staging record;本步骤不得直接发布 summary 评论。
145
145
 
146
+ 摘要正文只记录当前任务证据能够支持的交付结果、关联 PR 与实际合入事实、验证命令及其范围/结果/未覆盖部分,以及已知待办;需要说明验证范围时可注明对应提交。没有证据支持的事实不推断,未完成事项写入待办。这是 Issue 收尾摘要,不是 PR 留言。
147
+
148
+ 摘要默认使用当前技能的语言:中文技能生成中文摘要,英文技能生成英文摘要。中英文摘要保持相同字段结构。
149
+
150
+ 在暂存前核对正文:删除候选和待收尾占位;不写本地短号、无关窗口/模型/receipt 操作流水或外层已有的完整 TASK-ID。不要删除或改写平台维护的评论 marker 和恢复 metadata;与产品行为有关的路径可按需保留。摘要不预测 Complete Task 的 finalization 终态,也不声称任务已完成或已归档。任务目标状态止于 `completed`,不默认追加 Archive Tasks;生命周期终态及 warning 由正式 task 评论和 receipt 承担。
151
+
152
+ `stage-summary` 用于任务仍处于 active 时暂存摘要。任务进入 completed 后,不要假定该命令仍可用。若 finalization 结果表明已发布的交付事实需要更正,先确认现有受支持的评论同步入口允许在当前状态执行;不支持时,在最终汇报中如实说明限制,不新增入口或改变调用时序。
153
+
146
154
  若账本含合法的 `PRC-N` post-review 豁免,摘要正文必须镜像 task.md 中的裁决理由、提交范围、人工身份与时间,并明确这是人工覆盖而非自动校验成功。已有匹配 workflow warning 时,同时镜像其原始 failure code/message;尚无 warning 时只写“裁决已记录、最终门禁待验证”,不得提前宣称豁免已通过。summary marker 仍由同一 `--kind summary` intent 唯一维护。
147
155
 
148
156
  不要在本步骤同步 task 评论;它依赖 lifecycle 写入后的完整终态 task.md。不要设置 `status:` label,平台自动化应在 Issue 关闭后清理状态标签。
@@ -165,11 +173,11 @@ agent-infra-internal task-verify {task-id} complete-task.preflight --format text
165
173
 
166
174
  按 `.agents/rules/validation-output.md` 展示当次校验摘要;失败、阻塞和软警告保留必要诊断。
167
175
 
168
- 该事件只执行 required-PR delivery hard preflight;身份、并发和本地原子性仍由宿主 finalization 强制执行。外围 review/manual/platform 检查在 lifecycle 后由 `complete-task.completed` 处理,并投影为 warning/pending steps。硬门禁退出码非 0(fail/blocked)时,任务继续留在 active,记录稳定 code/target 后停止。
176
+ 该事件只执行 required-PR delivery hard preflight;身份校验和本地原子性仍由宿主 finalization 强制执行。外围 review/manual/platform 检查在 lifecycle 后由 `complete-task.completed` 处理,并投影为 warning/pending steps。硬门禁退出码非 0(fail/blocked)时,任务继续留在 active,记录稳定 code/target 后停止。
169
177
 
170
178
  若需要在摘要中镜像 `post-review-commit` 的 human-decided exemption,在步骤 4 尽力同步原始 failure code/message、PRC id/evidence 和裁决信息;同步失败只记录 `SUMMARY_SYNC_FAILED` warning,仍继续生命周期。最终是否完成由生命周期后的 terminal verification 决定。
171
179
 
172
- `--force` 不能解除身份、并发、本地原子性或 required-PR hard gate;这些能力失败时必须停止。其余审查、人工校验和平台证据由 terminal verification 记录为 warning/pending,并通过后续重试恢复。
180
+ `--force` 不能解除身份校验、本地原子性或 required-PR hard gate;这些能力失败时必须停止。其余审查、人工校验和平台证据由 terminal verification 记录为 warning/pending,并通过后续重试恢复。
173
181
 
174
182
  ### 6. 执行宿主 finalization 入口
175
183
 
@@ -200,7 +208,7 @@ complete 保留短号映射。它只会在受管 sandbox 清理确认容器已
200
208
  任务信息:
201
209
  - 标题:{title}
202
210
  - 完成时间:{timestamp}
203
- - 目标路径:.agents/workspace/completed/{task-id}/
211
+ - 目标路径:<task-workspace>/completed/{task-id}/
204
212
 
205
213
  交付物:
206
214
  - {关键产出列表:修改的文件、添加的测试等}
@@ -218,7 +226,7 @@ ai sandbox rm {task-id} # 或使用本任务仍保留的短号
218
226
 
219
227
  - [ ] 验证了所有工作流步骤已完成
220
228
  - [ ] 更新了 task.md 的完成状态和时间戳
221
- - [ ] 将任务目录移动到 `.agents/workspace/completed/`
229
+ - [ ] 将任务目录移动到 `<task-workspace>/completed/`
222
230
  - [ ] 验证了转移成功
223
231
  - [ ] 告知了用户完成情况
224
232
 
@@ -233,7 +241,7 @@ ai sandbox rm {task-id} # 或使用本任务仍保留的短号
233
241
 
234
242
  2. **回滚**:如果任务被错误转移:
235
243
  ```bash
236
- mv .agents/workspace/completed/{task-id} .agents/workspace/active/{task-id}
244
+ mv <task-workspace>/completed/{task-id} <task-workspace>/active/{task-id}
237
245
  ```
238
246
  然后将 task.md 中的状态改回 `active`。
239
247
 
@@ -18,7 +18,6 @@
18
18
  "require_completed_at": true
19
19
  },
20
20
  "activity-log": {
21
- "expected_action_pattern": "(Complete Task|Completed)"
22
21
  },
23
22
  "completion-checklist": {
24
23
  "require_all_checked": true
@@ -18,7 +18,6 @@
18
18
  "require_completed_at": true
19
19
  },
20
20
  "activity-log": {
21
- "expected_action_pattern": "(Complete Task|Completed)"
22
21
  },
23
22
  "completion-checklist": {
24
23
  "require_all_checked": true
@@ -47,7 +47,7 @@ No Pull Request is required; run instead:
47
47
 
48
48
  Parse the task scope first: an optional `--task <ref>` or `-t <ref>` selects `{task-id}`; a positional task ref is not interpreted. The remaining positional argument, when present, is `{target-branch}`.
49
49
 
50
- If `{task-id}` is provided, read `.agents/workspace/active/{task-id}/task.md` to load task metadata such as `platform_issue_identity` and `type`.
50
+ If `{task-id}` is provided, read `<task-workspace>/active/{task-id}/task.md` to load task metadata such as `platform_issue_identity` and `type`.
51
51
  If `{task-id}` is omitted, try to resolve it from the current session context; if it still cannot be determined, skip task-association logic in later steps.
52
52
 
53
53
  ### 2. Determine the Target Branch
@@ -68,7 +68,7 @@ Run `agent-infra-internal task-delivery {task-id} deliver --agent {standard-agen
68
68
 
69
69
  ### 5. Create or Recover the PR
70
70
 
71
- Read `.agents/rules/issue-pr-commands.md`, write the title and body to temporary files, then invoke its `platform-pr create` intent. Under the task lock, core uses remote branch and exact head/base/PR identity facts: one existing PR is reused and bound, zero creates, and multiple matches fail deterministically. Review artifacts and task sync records are not create-pr prerequisites, and replays must not create duplicate PRs.
71
+ Read `.agents/rules/issue-pr-commands.md`, write the title and body to temporary files, then invoke its `platform-pr create` intent. Core uses remote branch and exact head/base/PR identity facts: one existing PR is reused and bound, zero creates, and multiple matches fail deterministically. Review artifacts and task sync records are not create-pr prerequisites, and replays must not create duplicate PRs.
72
72
 
73
73
  If `{task-id}` is available and the related task provides `platform_issue_identity`, keep `Closes #{issue-number}` or the provider-equivalent closing keyword in the PR body when supported.
74
74
 
@@ -86,7 +86,7 @@ The core renderer owns the report section. It is part of the reviewer summary be
86
86
 
87
87
  Read the latest context artifacts when they exist: `plan.md` / `plan-r{N}.md`, `review-plan.md` / `review-plan-r{N}.md`, `code.md` / `code-r{N}.md`, and `review-code.md` / `review-code-r{N}.md`.
88
88
 
89
- Aggregate a reviewer-facing summary from those artifacts with exactly one `<!-- canonical-pr-change-report -->` placeholder, and maintain a single idempotent summary comment via the hidden marker. Pass `--change-report-file .agents/workspace/active/{task-id}/pr-change-report.json` and the same `--result {primary-result}` to `summary-sync`; a sync substep must not infer whether the PR was created or reused.
89
+ Aggregate a reviewer-facing summary from those artifacts with exactly one `<!-- canonical-pr-change-report -->` placeholder, and maintain a single idempotent summary comment via the hidden marker. Pass `--change-report-file <task-workspace>/active/{task-id}/pr-change-report.json` and the same `--result {primary-result}` to `summary-sync`; a sync substep must not infer whether the PR was created or reused.
90
90
 
91
91
  > Canonical context, aggregation, and the `summary-sync` call live in `reference/comment-publish.md`, which points to `.agents/rules/pr-sync.md`. Read that reference before publishing.
92
92
 
@@ -47,7 +47,7 @@ description: >
47
47
 
48
48
  先解析 task scope:可选的 `--task <ref>` 或 `-t <ref>` 绑定 `{task-id}`;位置 task ref 不再解释。剩余的可选位置参数绑定为 `{target-branch}`。
49
49
 
50
- 如果提供了 `{task-id}`,读取 `.agents/workspace/active/{task-id}/task.md` 获取任务信息(例如 `platform_issue_identity`、`type` 等)。
50
+ 如果提供了 `{task-id}`,读取 `<task-workspace>/active/{task-id}/task.md` 获取任务信息(例如 `platform_issue_identity`、`type` 等)。
51
51
  如果未提供,可从当前 session 上下文获取;仍无法确定 `{task-id}` 时,后续步骤中的任务关联逻辑跳过。
52
52
 
53
53
  ### 2. 确定目标分支
@@ -68,7 +68,7 @@ description: >
68
68
 
69
69
  ### 5. 创建或恢复 PR
70
70
 
71
- 执行前先读取 `.agents/rules/issue-pr-commands.md`,把标题和正文写入临时文件,并调用其中的 `platform-pr create` intent。core 在任务锁内按 remote branch、head/base 和 PR 身份事实执行:唯一既有 PR 会复用并绑定,零个才创建,多个稳定失败;review 或 task sync 记录不作为创建 PR 的前置门禁,重放不得产生重复 PR。
71
+ 执行前先读取 `.agents/rules/issue-pr-commands.md`,把标题和正文写入临时文件,并调用其中的 `platform-pr create` intent。core 按 remote branch、head/base 和 PR 身份事实执行:唯一既有 PR 会复用并绑定,零个才创建,多个稳定失败;review 或 task sync 记录不作为创建 PR 的前置门禁,重放不得产生重复 PR。
72
72
 
73
73
  如果获取到 `{task-id}` 且对应任务提供了 `platform_issue_identity`,在 provider 支持 numeric closing reference 时必须在 PR 正文中保留 `Closes #{issue-number}` 或 provider 等价关闭关键字。
74
74
 
@@ -86,7 +86,7 @@ description: >
86
86
 
87
87
  读取最新的上下文产物:`plan.md` / `plan-r{N}.md`、`review-plan.md` / `review-plan-r{N}.md`、`code.md` / `code-r{N}.md`、`review-code.md` / `review-code-r{N}.md`(存在时)。
88
88
 
89
- 基于这些产物聚合 reviewer 摘要,正文只放一次 `<!-- canonical-pr-change-report -->` 占位符,再使用隐藏标记维护唯一且幂等的摘要评论。调用 `summary-sync` 时传入 `--change-report-file .agents/workspace/active/{task-id}/pr-change-report.json`,并继续传递同一个 `--result {primary-result}`;不得根据同步子步骤猜测 PR 是创建还是复用。
89
+ 基于这些产物聚合 reviewer 摘要,正文只放一次 `<!-- canonical-pr-change-report -->` 占位符,再使用隐藏标记维护唯一且幂等的摘要评论。调用 `summary-sync` 时传入 `--change-report-file <task-workspace>/active/{task-id}/pr-change-report.json`,并继续传递同一个 `--result {primary-result}`;不得根据同步子步骤猜测 PR 是创建还是复用。
90
90
 
91
91
  > canonical context、摘要聚合和 `summary-sync` 调用见 `reference/comment-publish.md`(其引用 `.agents/rules/pr-sync.md`)。发布摘要前先读取该 reference。
92
92
 
@@ -15,7 +15,6 @@
15
15
  ]
16
16
  },
17
17
  "activity-log": {
18
- "expected_action_pattern": "(Create PR|PR Created)"
19
18
  },
20
19
  "platform-sync": {
21
20
  "when": "platform_issue_identity_exists"
@@ -4,7 +4,7 @@
4
4
  {"source":"platform-pr-inspect","diff":"three-dot-find-renames","metrics":["numstat-lines","git-blob-bytes"],"publish":["pr-summary","user-response"]}
5
5
  -->
6
6
 
7
- After a PR is created or uniquely reused, use the authoritative `base.sha` and `head.sha` returned by `platform-pr inspect` to measure the complete PR diff. Do not substitute the last commit or current worktree state. The task-intent digest covers only the semantic section from `# Task`/`# 任务` through `## Context`/`## 上下文`, so lifecycle logs, receipts, and version metadata do not stale a sidecar for the same head.
7
+ After a PR is created or uniquely reused, use the authoritative `base.sha` and `head.sha` returned by `platform-pr inspect` to measure the complete PR diff. Do not substitute the last commit or current worktree state. The complete PR keeps the existing three-dot, merge-base, patch, and sidecar identity. The task-intent digest covers only the semantic section from `# Task`/`# 任务` through `## Context`/`## 上下文`, so lifecycle logs, receipts, and version metadata do not stale a sidecar for the same head.
8
8
 
9
9
  ## Evidence Commands
10
10
 
@@ -24,7 +24,15 @@ agent-infra-internal platform-pr change-report {task-id} \
24
24
 
25
25
  The core validates the task-intent digest, PR identity, complete patch SHA, totals, and the ordered checks `target-alignment`, `change-composition`, `compatibility-policy`, `legacy-path-cleanup`, `redundancy`, and `scope-discipline`. A `needs-review` check routes to `review-code`; `formalReview` remains `false`.
26
26
 
27
- When generating the candidate, each check's `rationale` must state its actual finding: `target-alignment` explains the goal relationship, `change-composition` summarizes where new code concentrates responsibilities, `compatibility-policy` states the compatibility result, `legacy-path-cleanup` states how legacy paths were handled, `redundancy` states the redundancy result, and `scope-discipline` states the scope judgment. Do not reuse generic phrases such as "within scope" across checks; each check must provide at least one directly relevant path, line range, and concise `detail`, using the deployed skill's language. Chinese skill deployments must use Chinese. These high-level rationales and evidence are rendered in the canonical summary.
27
+ When generating the candidate, use the six existing `rationale` fields and `Evidence[]` as readable analysis for each logical change group; do not add group fields. For each group, explain its goal and acceptance-criteria alignment, added and removed behavior, necessity, redundancy or duplicate implementation, scope, related tests, and whether the tests are sufficient. Cite paths, line ranges, and concise evidence for the conclusions. Each check must still state its actual finding: `target-alignment` explains the goal relationship, `change-composition` summarizes responsibilities and behavior changes, `compatibility-policy` states the compatibility result, `legacy-path-cleanup` states how legacy paths were handled, `redundancy` states the redundancy result, and `scope-discipline` states the scope judgment. Do not reuse generic boilerplate; mark unsupported conclusions as unconfirmed. Use the deployed skill's language. Chinese skill deployments must use Chinese. The canonical renderer displays every item in each `Evidence[]`.
28
+
29
+ Explain applicable production-code, test, and documentation changes for each group. Keep source line changes, execution/call-count changes, and workflow unification distinct. Diff line counts support text changes only; they do not prove fewer executions or a unified workflow. Execution behavior and test adequacy need their own direct evidence. State gaps where evidence is missing. Green CI does not prove necessity or absence of redundancy.
30
+
31
+ ## Complete PR and Per-Round Increment
32
+
33
+ Complete-PR statistics always use the current authoritative snapshot's `base.sha...head.sha` and the existing three-dot mechanical report. The report may separately describe the increment from the last valid canonical sidecar's `identity.head.sha` to the current snapshot's `head.sha`. Before rebuilding the report, validate the prior sidecar with the existing `readPrChangeReport`; use its head only when repository/resource identity matches the current PR. Compare the two trees for the increment with `git diff --find-renames --numstat {previous-head} {current-head}`, `--name-status`, and `--summary`. Do not substitute a merge-base diff for these endpoints or add increment totals to complete-PR totals.
34
+
35
+ If there is no prior sidecar, it is invalid, or its PR identity differs, state that the previous head is unconfirmed. Do not infer per-round numbers from the complete PR or fabricate zeroes. If both SHAs are identical, state that the head did not change and omit extra statistics. After a rebase, compare the old and new head trees directly; this describes tree changes, not commit counts or execution counts. A missing/invalid prior sidecar does not block the complete-PR report.
28
36
 
29
37
  The script calculates both `numstat` line counts and exact Git blob byte sizes between the merge base and head. Bytes provide a stable unit, cover binary files, and reveal same-line compaction; submodules are not blobs and contribute zero bytes. Added files have zero old bytes, deleted files have zero new bytes, pure renames have zero net bytes, and copies count only the new destination content.
30
38
 
@@ -41,6 +49,8 @@ Using the repository's actual structure, assign every file to exactly one closes
41
49
  - Documentation
42
50
  - Configuration, dependencies, and other files
43
51
 
52
+ The canonical summary's fixed categories separate `docs/` and Markdown/MDX/reStructuredText documents from other files. More specific runtime-code, test, template, and `.agents/` categories take precedence; remaining paths go to Other.
53
+
44
54
  The table must contain component, file count, added lines, deleted lines, net lines, old bytes, new bytes, and net bytes, followed by a total row. Byte columns describe the blob content size of files involved in this change, not disk usage for the entire repository or worktree. Use exact integers; optional KiB/MiB values may aid readability but must not replace byte counts.
45
55
 
46
56
  Category line and byte totals must each reconcile exactly with the script's `totals`. Then, for text files only, list the largest files by line change and absolute net-byte change, distinguishing source, tests, and template mirrors. Keep binary files in the category totals only; do not rank or interpret their content. Show renames as path changes without inferring a "pure rename" label.
@@ -55,4 +65,4 @@ Briefly explain:
55
65
  - whether any change cannot be traced directly to the PR goal and may be unnecessary; if none, state the evidence; every check must cite file and line evidence;
56
66
  - when a test fixture is much larger than production changes, what risk it covers instead of judging it only by size.
57
67
 
58
- Do not write the `### PR Code Changes` section in the caller. Put exactly one `<!-- canonical-pr-change-report -->` placeholder in the plain body and let `summary-sync --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json --result {primary-result}` replace it through the core renderer. Do not create a second PR comment for this report.
68
+ Do not write the `### PR Code Changes` section in the caller. Put exactly one `<!-- canonical-pr-change-report -->` placeholder in the plain body and let `summary-sync --change-report-file <task-workspace>/active/{task-id}/pr-change-report.json --result {primary-result}` replace it through the core renderer. Do not create a second PR comment for this report.
@@ -4,7 +4,7 @@
4
4
  {"source":"platform-pr-inspect","diff":"three-dot-find-renames","metrics":["numstat-lines","git-blob-bytes"],"publish":["pr-summary","user-response"]}
5
5
  -->
6
6
 
7
- PR 创建或复用成功后,使用 `platform-pr inspect` 返回的权威 `base.sha` 与 `head.sha` 统计完整 PR 差异,不以最后一个 commit 或工作树状态代替。任务意图 digest 只覆盖 `# 任务`/`# Task` 到 `## 上下文`/`## Context` 的语义区间,因此生命周期日志、收据和版本元数据不会使同一 head 的 sidecar 失效。
7
+ PR 创建或复用成功后,使用 `platform-pr inspect` 返回的权威 `base.sha` 与 `head.sha` 统计完整 PR 差异,不以最后一个 commit 或工作树状态代替。完整 PR 继续使用下文现有 three-dot、merge-base、patch 与 sidecar 身份。任务意图 digest 只覆盖 `# 任务`/`# Task` 到 `## 上下文`/`## Context` 的语义区间,因此生命周期日志、收据和版本元数据不会使同一 head 的 sidecar 失效。
8
8
 
9
9
  ## 证据命令
10
10
 
@@ -24,7 +24,15 @@ agent-infra-internal platform-pr change-report {task-id} \
24
24
 
25
25
  core 校验任务意图 digest、PR identity、完整 patch SHA、统计合计和固定顺序的 `target-alignment`、`change-composition`、`compatibility-policy`、`legacy-path-cleanup`、`redundancy`、`scope-discipline`。任一项为 `needs-review` 时路由到 `review-code`,`formalReview` 仍为 `false`。
26
26
 
27
- 生成 candidate 时,六项 `rationale` 必须分别写出实际检查结论:`target-alignment` 说明目标对应关系,`change-composition` 概括新增代码集中承担的职责,`compatibility-policy` 说明兼容策略,`legacy-path-cleanup` 说明旧路径处理,`redundancy` 说明冗余检查结果,`scope-discipline` 说明范围判断。不得六项复用“符合范围”等泛化套话;每项至少提供一条直接支持结论的路径、行号和简短 `detail`,并遵循当前已部署技能的语言。中文技能必须使用中文。这些高层理由和证据会直接展示在 canonical 摘要中。
27
+ 生成 candidate 时,按逻辑变化组用六项 `rationale` 和 `Evidence[]` 给出可读分析,不新增组级字段。每组说明其目标/验收对应、行为增加与减少、必要性、冗余或重复实现、范围、对应测试及测试是否充分;列出支撑结论的路径、行号和简短证据。六项检查各自仍须写实际结论:`target-alignment` 说明目标对应关系,`change-composition` 概括职责和行为变化,`compatibility-policy` 说明兼容策略,`legacy-path-cleanup` 说明旧路径处理,`redundancy` 说明重复/冗余结果,`scope-discipline` 说明范围判断。不得复用泛化套话;证据不足的维度明确标记未确认,不推断结论。证据详情遵循当前已部署技能的语言,中文技能必须使用中文。canonical renderer 会完整展示每项 `Evidence[]`。
28
+
29
+ 每组解释覆盖生产代码、测试和文档中适用的变化,并区分源码行数变化、执行/调用次数变化和流程统一。diff 行数仅支持代码文本增减;不能据此推断执行次数减少或流程统一。执行次数、流程行为和测试充分性须有各自直接证据;没有证据时明确说明缺口。CI 全绿不能代替必要性或冗余判断。
30
+
31
+ ## 完整 PR 与本轮增量
32
+
33
+ 完整 PR 统计始终使用当前权威 snapshot 的 `base.sha...head.sha` 和现有 three-dot mechanical report。报告可另外描述最近一次有效 canonical sidecar 的 `identity.head.sha` 到当前 snapshot `head.sha` 的本轮增量。重建报告前,使用现有 `readPrChangeReport` 校验先前 sidecar;仅当其 repository/resource identity 与当前 PR 一致时,才把旧 head 作为增量起点。用 `git diff --find-renames --numstat {previous-head} {current-head}`、`--name-status` 和 `--summary` 的两个端点比较本轮树差异,不使用 merge-base 代替这个范围,不把增量 totals 加到完整 PR totals。
34
+
35
+ 第一次没有旧 sidecar、旧报告无效或 PR identity 不符时,写明“上一 head 不可确认”,不得由完整 PR 统计推算本轮数字,也不得填造零值。两个 SHA 相同则说明 head 未变化,不额外生成统计。rebase 后仍按旧 head 与新 head 两个树端点比较;结果描述树差异,不代表提交数或执行次数变化。旧 sidecar 缺失/无效不阻断完整 PR 报告生成。
28
36
 
29
37
  脚本在 merge base 与 head 之间同时计算 `numstat` 行数和 Git blob 的精确字节数。字节比字符具有稳定口径,也能覆盖二进制文件和同行内缩减;子模块不是 blob,按 0 字节贡献核算。新增文件的旧字节数为 0,删除文件的新字节数为 0,纯 rename 的净字节数为 0,copy 只计新增目标内容。
30
38
 
@@ -41,6 +49,8 @@ core 校验任务意图 digest、PR identity、完整 patch SHA、统计合计
41
49
  - 文档
42
50
  - 配置、依赖与其他
43
51
 
52
+ canonical 汇总中的固定分类把 `docs/`、Markdown/MDX/reStructuredText 文档与其他文件分别统计;更具体的运行时代码、测试、模板及 `.agents/` 分类优先。其余文件进入“其他”。
53
+
44
54
  输出表格必须包含“部分、文件数、新增行、删除行、净增行、旧字节、新字节、净字节”,并有合计行。字节列表示本次变更涉及文件的 blob 内容体积,不表示整个仓库或工作树的磁盘占用。使用精确整数;可附加 KiB/MiB 便于阅读,但不能替代字节数。
45
55
 
46
56
  各类别的行数和字节数之和必须分别与脚本的 `totals` 一致。随后仅针对文本文件,分别列出行数变化和绝对净字节变化最大的文件,并区分源码、测试和模板镜像;二进制文件只保留在分类合计中,不参与代表性文件排序或内容判断。rename 只按路径变化展示,不推断“纯 rename”。
@@ -55,4 +65,4 @@ core 校验任务意图 digest、PR identity、完整 patch SHA、统计合计
55
65
  - 是否存在与 PR 目标无法直接对应、疑似不必要的变化;若没有,明确说明判断依据;每项结论必须给出文件和行号证据;
56
66
  - 若某个测试 fixture 明显大于生产改动,解释它覆盖的风险,而不是仅以行数评价。
57
67
 
58
- 调用方不要自行写入 `### PR 代码增减`。把恰好包含一次 `<!-- canonical-pr-change-report -->` 的普通摘要正文交给 `summary-sync --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json --result {primary-result}`,由 core renderer 替换并发布。报告不另建第二条 PR 评论。
68
+ 调用方不要自行写入 `### PR 代码增减`。把恰好包含一次 `<!-- canonical-pr-change-report -->` 的普通摘要正文交给 `summary-sync --change-report-file <task-workspace>/active/{task-id}/pr-change-report.json --result {primary-result}`,由 core renderer 替换并发布。报告不另建第二条 PR 评论。
@@ -7,7 +7,7 @@ Write the plain summary body, containing exactly one `<!-- canonical-pr-change-r
7
7
  ```bash
8
8
  agent-infra-internal platform-pr summary-sync {task-id} \
9
9
  --agent {standard-agent-token} --body-file {summary-body-file} \
10
- --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json \
10
+ --change-report-file <task-workspace>/active/{task-id}/pr-change-report.json \
11
11
  --result {primary-result}
12
12
  ```
13
13
 
@@ -7,7 +7,7 @@
7
7
  ```bash
8
8
  agent-infra-internal platform-pr summary-sync {task-id} \
9
9
  --agent {standard-agent-token} --body-file {summary-body-file} \
10
- --change-report-file .agents/workspace/active/{task-id}/pr-change-report.json \
10
+ --change-report-file <task-workspace>/active/{task-id}/pr-change-report.json \
11
11
  --result {primary-result}
12
12
  ```
13
13
 
@@ -118,10 +118,10 @@ If no historical release notes exist, use the following default Markdown format:
118
118
  - Issue reporters from typed `closingIssues[].author`
119
119
  - **Contribution count**: `PR count + co-authored commit count` for the same identity, merged across both sources
120
120
  - **`@login` mapping**: follow the identity safety boundary in `.agents/rules/release-commands.md`
121
- - For `platform-user` or `platform-noreply` with a non-empty `login`, use the lowercased `login`
121
+ - For `platform-user` or `platform-noreply` with a non-empty `login`, follow the mention mapping in `.agents/rules/release-commands.md`
122
122
  - Exclude `unresolved` identities from the contributor list; never infer a login from a name, email address, domain, brand, or same-named platform account
123
123
  - Merge all Name variants carrying the same typed login before counting and sorting
124
- - Preserve bot identities as-is, for example `dependabot[bot]`
124
+ - Use plain-text `@login` mentions in Release notes, without Markdown links; map Dependabot typed logins to `@dependabot` according to the rule
125
125
  - Do not add unresolved identity emails, placeholder mentions, or identity-verification TODOs to publishable notes
126
126
  - **Sorting**: descending by contribution count, then lexicographically by login for ties
127
127
  - **Deduplication**: use the final mapped `@login` as the key
@@ -118,10 +118,10 @@ agent-infra-internal platform-release-notes context \
118
118
  - Issue reporters:来自步骤 3 typed context 的 `closingIssues[].author`
119
119
  - **贡献数定义**:`该人的 PR 数 + 该人作为 co-author 的 commit 数`(同一身份跨来源合并计数)
120
120
  - **`@login` 映射**:遵循 `.agents/rules/release-commands.md` 的身份安全边界
121
- - `resolution` 为 `platform-user` 或 `platform-noreply` 且 `login` 非空时,采用小写 `login`
121
+ - `resolution` 为 `platform-user` 或 `platform-noreply` 且 `login` 非空时,遵循 `.agents/rules/release-commands.md` 的 mention 映射
122
122
  - `resolution` 为 `unresolved` 时从贡献者列表中排除;不得从 Name、邮箱、域名、品牌或同名平台账号推断 login
123
123
  - 同一 typed login 的所有 Name 变体必须归并后再计数与排序
124
- - Bot 身份保留原样(如 `dependabot[bot]`)
124
+ - Release notes 的 `@login` 一律使用纯文本,不用 Markdown 链接包装;Dependabot typed login 按规则映射为 `@dependabot`
125
125
  - 不得在可发布 notes 中加入未解析身份的邮箱、占位 mention 或身份确认 TODO
126
126
  - **排序**:按贡献数降序;贡献数相同时按 login 字典序
127
127
  - **去重**:以最终映射后的 `@login` 为键
@@ -180,7 +180,7 @@ Task information:
180
180
  - Issue: #{issue-number} {issue_url}
181
181
 
182
182
  Output file:
183
- - Task file: .agents/workspace/active/{task-id}/task.md
183
+ - Task file: <task-workspace>/active/{task-id}/task.md
184
184
 
185
185
  Next step - run requirements analysis:
186
186
  {next-step-commands}
@@ -199,7 +199,7 @@ Task information:
199
199
  - Workflow: {workflow}
200
200
 
201
201
  Output file:
202
- - Task file: .agents/workspace/active/{task-id}/task.md
202
+ - Task file: <task-workspace>/active/{task-id}/task.md
203
203
 
204
204
  Next step - run requirements analysis:
205
205
  {next-step-commands}
@@ -223,7 +223,7 @@ Issue creation failed:
223
223
  - Local task.md was kept and not rolled back
224
224
 
225
225
  Output file:
226
- - Task file: .agents/workspace/active/{task-id}/task.md
226
+ - Task file: <task-workspace>/active/{task-id}/task.md
227
227
 
228
228
  Next step - run requirements analysis:
229
229
  {next-step-commands}
@@ -239,7 +239,7 @@ For later platform sync: after fixing auth / network / template issues, manually
239
239
  ## Completion Checklist
240
240
 
241
241
  - [ ] Wrote one candidate and invoked `agent-infra-internal task-create`
242
- - [ ] The host created `.agents/workspace/active/{task-id}/task.md`
242
+ - [ ] The host created `<task-workspace>/active/{task-id}/task.md`
243
243
  - [ ] Wrote and checked `## Task Input` source and state semantics according to `reference/context-capture.md`
244
244
  - [ ] The returned task id and short id passed completion verification
245
245
  - [ ] Tried cascading Issue creation through `.agents/rules/create-issue.md`; if it failed, kept task.md and recorded the reason
@@ -177,7 +177,7 @@ agent-infra-internal task-verify {task-id} create-task.completed --format text
177
177
  - Issue:#{issue-number} {issue_url}
178
178
 
179
179
  产出文件:
180
- - 任务文件:.agents/workspace/active/{task-id}/task.md
180
+ - 任务文件:<task-workspace>/active/{task-id}/task.md
181
181
 
182
182
  下一步 - 执行需求分析:
183
183
  {next-step-commands}
@@ -196,7 +196,7 @@ agent-infra-internal task-verify {task-id} create-task.completed --format text
196
196
  - 工作流:{workflow}
197
197
 
198
198
  产出文件:
199
- - 任务文件:.agents/workspace/active/{task-id}/task.md
199
+ - 任务文件:<task-workspace>/active/{task-id}/task.md
200
200
 
201
201
  下一步 - 执行需求分析:
202
202
  {next-step-commands}
@@ -220,7 +220,7 @@ Issue 创建失败:
220
220
  - 本地 task.md 已保留,未回滚
221
221
 
222
222
  产出文件:
223
- - 任务文件:.agents/workspace/active/{task-id}/task.md
223
+ - 任务文件:<task-workspace>/active/{task-id}/task.md
224
224
 
225
225
  下一步 - 执行需求分析:
226
226
  {next-step-commands}
@@ -236,7 +236,7 @@ Issue 创建失败:
236
236
  ## 完成检查清单
237
237
 
238
238
  - [ ] 只生成一次结构化 candidate 并调用 `agent-infra-internal task-create`
239
- - [ ] 宿主创建了任务文件 `.agents/workspace/active/{task-id}/task.md`
239
+ - [ ] 宿主创建了任务文件 `<task-workspace>/active/{task-id}/task.md`
240
240
  - [ ] 已按 `reference/context-capture.md` 写入并复核 `## 任务输入` 的来源与状态语义
241
241
  - [ ] 响应中的任务 ID 和短号已通过完成校验
242
242
  - [ ] 已按 `.agents/rules/create-issue.md` 尝试级联创建 Issue;失败时保留 task.md 并记录原因
@@ -18,7 +18,6 @@
18
18
  "expected_status": "active"
19
19
  },
20
20
  "activity-log": {
21
- "expected_action_pattern": "(Create Task|Task Created)"
22
21
  },
23
22
  "platform-sync": {
24
23
  "when": "platform_issue_identity_exists",
@@ -48,7 +48,7 @@ Extract key information:
48
48
 
49
49
  Check whether a task for this alert already exists. If not, create one:
50
50
 
51
- Directory: `.agents/workspace/active/TASK-{yyyyMMdd-HHmmss}/`
51
+ Directory: `<task-workspace>/active/TASK-{yyyyMMdd-HHmmss}/`
52
52
 
53
53
  Task metadata:
54
54
  ```yaml
@@ -48,7 +48,7 @@ description: >
48
48
 
49
49
  检查是否已存在该告警的任务。如果不存在,创建:
50
50
 
51
- 目录:`.agents/workspace/active/TASK-{yyyyMMdd-HHmmss}/`
51
+ 目录:`<task-workspace>/active/TASK-{yyyyMMdd-HHmmss}/`
52
52
 
53
53
  任务元数据:
54
54
  ```yaml