@fitlab-ai/agent-infra 0.11.3 → 0.11.5

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 (172) hide show
  1. package/README.md +17 -8
  2. package/README.zh-CN.md +17 -8
  3. package/dist/bin/internal-cli.js +1 -6
  4. package/dist/lib/decide.js +4 -41
  5. package/dist/lib/git/branch-worktree.js +45 -0
  6. package/dist/lib/internal/cli-route-inventory.js +1 -4
  7. package/dist/lib/internal/task-activity.js +7 -40
  8. package/dist/lib/internal/task-artifact.js +1 -1
  9. package/dist/lib/internal/task-event.js +4 -37
  10. package/dist/lib/internal/task-finalization.js +48 -1
  11. package/dist/lib/internal/task-ledger.js +14 -44
  12. package/dist/lib/internal/task-lifecycle.js +1 -1
  13. package/dist/lib/internal/task-operation-registry.js +2 -4
  14. package/dist/lib/internal/task-review.js +5 -37
  15. package/dist/lib/internal/task-verify.js +3 -47
  16. package/dist/lib/internal/task-warning.js +4 -40
  17. package/dist/lib/platform/completion-backfill.js +63 -17
  18. package/dist/lib/platform/pr-summary.js +4 -23
  19. package/dist/lib/platform/verification-sync.js +12 -49
  20. package/dist/lib/sandbox/control/client.js +4 -1
  21. package/dist/lib/sandbox/control/executor.js +12 -4
  22. package/dist/lib/sandbox/control/protocol.js +2 -1
  23. package/dist/lib/sandbox/control/server.js +26 -143
  24. package/dist/lib/sandbox/removal.js +15 -8
  25. package/dist/lib/sandbox/task-cleanup.js +13 -20
  26. package/dist/lib/task/activity-intent.js +1 -2
  27. package/dist/lib/task/artifact-command.js +11 -4
  28. package/dist/lib/task/artifact-lifecycle.js +217 -85
  29. package/dist/lib/task/artifact-operations.js +37 -28
  30. package/dist/lib/task/artifact-receipts.js +4 -1
  31. package/dist/lib/task/artifact-schema.js +8 -7
  32. package/dist/lib/task/artifact-selection.js +25 -0
  33. package/dist/lib/task/capabilities.js +158 -39
  34. package/dist/lib/task/commands/status.js +9 -2
  35. package/dist/lib/task/control-authority.js +12 -168
  36. package/dist/lib/task/decision-intents.js +14 -4
  37. package/dist/lib/task/delivery.js +1 -43
  38. package/dist/lib/task/events.js +68 -73
  39. package/dist/lib/task/finalization-handoff.js +92 -0
  40. package/dist/lib/task/finalization.js +423 -154
  41. package/dist/lib/task/intermediate-cleanup.js +9 -148
  42. package/dist/lib/task/ledger-intents.js +159 -20
  43. package/dist/lib/task/lifecycle-path.js +75 -0
  44. package/dist/lib/task/lifecycle.js +60 -11
  45. package/dist/lib/task/local-artifact-finalization.js +13 -47
  46. package/dist/lib/task/orchestration.js +17 -7
  47. package/dist/lib/task/review-command.js +1 -2
  48. package/dist/lib/task/review-finalization.js +4 -18
  49. package/dist/lib/task/rework-intent.js +70 -4
  50. package/dist/lib/task/snapshot.js +6 -6
  51. package/dist/lib/task/verification-engine.js +25 -30
  52. package/dist/lib/task/verification.js +2 -13
  53. package/dist/lib/task/workflow-warning-intents.js +23 -10
  54. package/dist/lib/task/workspace-snapshot.js +7 -2
  55. package/dist/lib/task/write.js +1 -2
  56. package/dist/lifecycle-build-manifest.json +3 -3
  57. package/lib/decide.ts +5 -35
  58. package/lib/git/branch-worktree.ts +41 -0
  59. package/lib/internal/cli-route-inventory.ts +1 -3
  60. package/lib/internal/task-activity.ts +6 -34
  61. package/lib/internal/task-artifact.ts +1 -1
  62. package/lib/internal/task-event.ts +4 -37
  63. package/lib/internal/task-finalization.ts +47 -1
  64. package/lib/internal/task-ledger.ts +15 -41
  65. package/lib/internal/task-lifecycle.ts +2 -2
  66. package/lib/internal/task-operation-registry.ts +2 -4
  67. package/lib/internal/task-review.ts +5 -31
  68. package/lib/internal/task-verify.ts +3 -39
  69. package/lib/internal/task-warning.ts +3 -32
  70. package/lib/platform/completion-backfill.ts +78 -16
  71. package/lib/platform/pr-summary.ts +4 -25
  72. package/lib/platform/verification-sync.ts +13 -53
  73. package/lib/sandbox/control/client.ts +5 -1
  74. package/lib/sandbox/control/executor.ts +13 -4
  75. package/lib/sandbox/control/protocol.ts +3 -2
  76. package/lib/sandbox/control/server.ts +21 -146
  77. package/lib/sandbox/removal.ts +23 -7
  78. package/lib/sandbox/task-cleanup.ts +12 -20
  79. package/lib/task/activity-intent.ts +1 -2
  80. package/lib/task/artifact-command.ts +14 -4
  81. package/lib/task/artifact-lifecycle.ts +236 -85
  82. package/lib/task/artifact-operations.ts +59 -28
  83. package/lib/task/artifact-receipts.ts +4 -1
  84. package/lib/task/artifact-schema.ts +10 -7
  85. package/lib/task/artifact-selection.ts +53 -0
  86. package/lib/task/capabilities.ts +154 -40
  87. package/lib/task/commands/status.ts +11 -2
  88. package/lib/task/control-authority.ts +17 -189
  89. package/lib/task/decision-intents.ts +11 -4
  90. package/lib/task/delivery.ts +1 -40
  91. package/lib/task/events.ts +73 -74
  92. package/lib/task/finalization-handoff.ts +104 -0
  93. package/lib/task/finalization.ts +388 -122
  94. package/lib/task/intermediate-cleanup.ts +9 -125
  95. package/lib/task/ledger-intents.ts +157 -20
  96. package/lib/task/lifecycle-path.ts +98 -0
  97. package/lib/task/lifecycle.ts +58 -13
  98. package/lib/task/local-artifact-finalization.ts +14 -56
  99. package/lib/task/orchestration.ts +26 -8
  100. package/lib/task/review-command.ts +2 -5
  101. package/lib/task/review-finalization.ts +4 -20
  102. package/lib/task/rework-intent.ts +75 -5
  103. package/lib/task/snapshot.ts +6 -6
  104. package/lib/task/verification-engine.ts +29 -30
  105. package/lib/task/verification.ts +3 -16
  106. package/lib/task/workflow-warning-intents.ts +20 -10
  107. package/lib/task/workspace-snapshot.ts +3 -2
  108. package/lib/task/write.ts +1 -4
  109. package/package.json +1 -1
  110. package/templates/.agents/rules/review-handshake.en.md +4 -4
  111. package/templates/.agents/rules/review-handshake.zh-CN.md +4 -4
  112. package/templates/.agents/skills/analyze-task/SKILL.en.md +21 -5
  113. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +21 -5
  114. package/templates/.agents/skills/code-task/SKILL.en.md +14 -8
  115. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +18 -13
  116. package/templates/.agents/skills/code-task/reference/code-rules.en.md +2 -2
  117. package/templates/.agents/skills/code-task/reference/code-rules.zh-CN.md +2 -2
  118. package/templates/.agents/skills/code-task/reference/dual-mode.en.md +4 -4
  119. package/templates/.agents/skills/code-task/reference/dual-mode.zh-CN.md +4 -4
  120. package/templates/.agents/skills/code-task/reference/report-template.en.md +7 -7
  121. package/templates/.agents/skills/code-task/reference/report-template.zh-CN.md +7 -7
  122. package/templates/.agents/skills/complete-manual-validation/config/verify.en.json +2 -2
  123. package/templates/.agents/skills/complete-manual-validation/config/verify.zh-CN.json +2 -2
  124. package/templates/.agents/skills/complete-manual-validation/reference/report-template.en.md +1 -3
  125. package/templates/.agents/skills/complete-manual-validation/reference/report-template.zh-CN.md +1 -3
  126. package/templates/.agents/skills/complete-task/SKILL.en.md +2 -2
  127. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +2 -2
  128. package/templates/.agents/skills/complete-task/config/verify.en.json +2 -2
  129. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +2 -2
  130. package/templates/.agents/skills/plan-task/SKILL.en.md +13 -10
  131. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +13 -10
  132. package/templates/.agents/skills/review-analysis/SKILL.en.md +5 -1
  133. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +5 -1
  134. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +3 -3
  135. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +3 -3
  136. package/templates/.agents/skills/review-code/SKILL.en.md +5 -1
  137. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +5 -1
  138. package/templates/.agents/skills/review-code/reference/report-template.en.md +3 -3
  139. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +3 -3
  140. package/templates/.agents/skills/review-plan/SKILL.en.md +5 -1
  141. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +5 -1
  142. package/templates/.agents/skills/review-plan/reference/report-template.en.md +3 -3
  143. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +3 -3
  144. package/templates/.agents/skills/review-pr/config/verify.en.json +3 -1
  145. package/templates/.agents/skills/review-pr/config/verify.zh-CN.json +3 -1
  146. package/templates/.agents/skills/review-pr/reference/report-template.en.md +3 -3
  147. package/templates/.agents/skills/review-pr/reference/report-template.zh-CN.md +3 -3
  148. package/templates/.agents/skills/run-manual-validation/config/verify.en.json +2 -2
  149. package/templates/.agents/skills/run-manual-validation/config/verify.zh-CN.json +2 -2
  150. package/templates/.agents/skills/run-manual-validation/reference/report-template.en.md +2 -2
  151. package/templates/.agents/skills/run-manual-validation/reference/report-template.zh-CN.md +2 -2
  152. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +18 -2
  153. package/templates/.agents/templates/task.en.md +2 -2
  154. package/templates/.agents/templates/task.zh-CN.md +2 -2
  155. package/templates/.agents/workflows/bug-fix.en.yaml +11 -6
  156. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +11 -6
  157. package/templates/.agents/workflows/feature-development.en.yaml +11 -6
  158. package/templates/.agents/workflows/feature-development.zh-CN.yaml +11 -6
  159. package/templates/.agents/workflows/refactoring.en.yaml +11 -6
  160. package/templates/.agents/workflows/refactoring.zh-CN.yaml +11 -6
  161. package/dist/lib/internal/task-override.js +0 -138
  162. package/dist/lib/sandbox/control/finalization-response.js +0 -33
  163. package/dist/lib/task/artifact-recovery.js +0 -476
  164. package/dist/lib/task/artifact-repair-intent.js +0 -181
  165. package/dist/lib/task/guard-override.js +0 -31
  166. package/dist/lib/task/human-override.js +0 -1259
  167. package/lib/internal/task-override.ts +0 -144
  168. package/lib/sandbox/control/finalization-response.ts +0 -35
  169. package/lib/task/artifact-recovery.ts +0 -572
  170. package/lib/task/artifact-repair-intent.ts +0 -227
  171. package/lib/task/guard-override.ts +0 -50
  172. package/lib/task/human-override.ts +0 -1522
@@ -147,16 +147,16 @@
147
147
 
148
148
  ## 状态核对
149
149
 
150
- > 记录状态核对命令、审查范围、关键结果和未覆盖部分;每条命令以 `$ ` 开头。
150
+ > 记录状态核对命令、审查范围、关键结果和未覆盖部分。
151
151
  > 按 `.agents/rules/evidence-reporting.md` 同时记录审查范围、关键结果和未覆盖部分;正常成功不粘贴完整 stdout。
152
152
 
153
153
  ## 证据原文
154
154
 
155
- > 遵循 `.agents/rules/evidence-reporting.md`:每条断言配对 `$ ` 命令和相称结果摘要;Blocker、失败、阻塞或争议必须保留可复现命令、准确位置和决定性摘录;无法复现的判断须降级或移入「自我质疑」。
155
+ > 遵循 `.agents/rules/evidence-reporting.md`:每条断言配对可执行命令和相称结果摘要;Blocker、失败、阻塞或争议必须保留可复现命令、准确位置和决定性摘录;无法复现的判断须降级或移入「自我质疑」。
156
156
 
157
157
  - 断言:{verified claim}
158
158
  ```text
159
- $ {command}
159
+ {command}
160
160
  {result summary or decisive excerpt}
161
161
  ```
162
162
 
@@ -15,6 +15,10 @@ Review the latest code round and produce `review-code.md` or `review-code-r{N}.m
15
15
 
16
16
  ## Boundary / Critical Rules
17
17
 
18
+ ### Path and rework
19
+
20
+ This stage consumes only the canonical path fact parsed by core from the latest valid analysis artifact; a stage omitted by that path must not create an artifact. When another Changes Requested verdict follows one completed revision-review cycle in the same stage, classify the rework before the next executor artifact and bind it to the finding, source SHA, and stable task-fact digest. A round or filename change is not new evidence.
21
+
18
22
  ### Persisted Report Evidence
19
23
 
20
24
  Before generating the review report, read `.agents/rules/evidence-reporting.md`. Normal inspection records the command, scope, structured result, actual conclusion, and uncovered parts; findings, blocking conditions, or disputes retain reproducible locations and decisive excerpts, while identity fields remain exact.
@@ -67,7 +71,7 @@ Require:
67
71
 
68
72
  ### 2. Resolve the Artifact Context
69
73
 
70
- Run `agent-infra-internal task-artifact {task-id} inspect --family review-code`. Continue only for `ready`; take the latest `{code-artifact}` from `inputs` and `{review-round}` / `{review-artifact}` from `next.round` / `next.name`. Do not scan rounds or construct names in the skill. Then run the started event and verify the returned identity.
74
+ Run `agent-infra-internal task-artifact {task-id} inspect --family review-code`. Continue only for `ready`. When `selection.disposition` is `reuse`, reuse `selection.artifact`, do not run started/init or write a new artifact, and continue directly to completion verification and next-step guidance. Otherwise take the latest `{code-artifact}` from `inputs` and `{review-round}` / `{review-artifact}` from `next.round` / `next.name`. Do not scan rounds or construct names in the skill. Then run the started event and verify the returned identity.
71
75
 
72
76
  ### 3. Read Implementation and Refinement Context
73
77
 
@@ -15,6 +15,10 @@ description: >
15
15
 
16
16
  ## 行为边界 / 关键规则
17
17
 
18
+ ### 路径与返工
19
+
20
+ 本阶段只消费核心从最新有效分析产物解析出的规范路径事实;未被所选路径包含的阶段不得创建产物。同阶段完成一次修订—复审后再次收到 Changes Requested 时,必须在下一执行产物前提交绑定 finding、来源 SHA 和稳定任务事实摘要的返工分类;轮次或文件名变化不是新证据。
21
+
18
22
  ### 持久化报告证据
19
23
 
20
24
  生成审查报告时,先读取 `.agents/rules/evidence-reporting.md`。正常检视记录命令、范围、结构化结果、实际结论和未覆盖部分;finding、阻塞或争议保留可复现位置与决定性摘录,身份字段必须精确保留。
@@ -66,7 +70,7 @@ agent-infra-internal task-snapshot {task-id} --format text
66
70
 
67
71
  ### 2. 解析审查上下文
68
72
 
69
- 运行 `agent-infra-internal task-artifact {task-id} inspect --family review-code`。仅当结果为 `ready` 时继续;从 `inputs` 取得最新 `{code-artifact}`,从 `next.round` / `next.name` 取得 `{review-round}` / `{review-artifact}`。不得自行扫描轮次或拼装文件名。随后执行 started 事件并复核返回身份。
73
+ 运行 `agent-infra-internal task-artifact {task-id} inspect --family review-code`。仅当结果为 `ready` 时继续。若 `selection.disposition` 为 `reuse`,复用 `selection.artifact`,不得执行 started、init 或写入新产物,并直接进入完成校验与下一步提示。其他状态从 `inputs` 取得最新 `{code-artifact}`,从 `next.round` / `next.name` 取得 `{review-round}` / `{review-artifact}`;不得自行扫描轮次或拼装文件名。随后执行 started 事件并复核返回身份。
70
74
 
71
75
  ### 3. 阅读实现与修复上下文
72
76
 
@@ -153,16 +153,16 @@ Use this template when writing `review-code.md` or `review-code-r{N}.md`.
153
153
 
154
154
  ## State Check
155
155
 
156
- > Record the state-check command, review scope, key result, and uncovered parts; each command starts with `$ `.
156
+ > Record the state-check command, review scope, key result, and uncovered parts.
157
157
  > Follow `.agents/rules/evidence-reporting.md`: record review scope, key result, and uncovered parts; do not paste complete successful stdout.
158
158
 
159
159
  ## Raw Evidence
160
160
 
161
- > Follow `.agents/rules/evidence-reporting.md`: pair each claim with a `$ ` command and proportionate result summary; Blockers, failures, blocking conditions, or disputes require reproducible evidence, exact location, and a decisive excerpt; a judgment that cannot be reproduced must be downgraded or moved to Self-Doubt.
161
+ > Follow `.agents/rules/evidence-reporting.md`: pair each claim with an executable command and proportionate result summary; Blockers, failures, blocking conditions, or disputes require reproducible evidence, exact location, and a decisive excerpt; a judgment that cannot be reproduced must be downgraded or moved to Self-Doubt.
162
162
 
163
163
  - Claim: {verified claim}
164
164
  ```text
165
- $ {command}
165
+ {command}
166
166
  {result summary or decisive excerpt}
167
167
  ```
168
168
 
@@ -153,16 +153,16 @@
153
153
 
154
154
  ## 状态核对
155
155
 
156
- > 记录状态核对命令、审查范围、关键结果和未覆盖部分;每条命令以 `$ ` 开头。
156
+ > 记录状态核对命令、审查范围、关键结果和未覆盖部分。
157
157
  > 按 `.agents/rules/evidence-reporting.md` 同时记录审查范围、关键结果和未覆盖部分;正常成功不粘贴完整 stdout。
158
158
 
159
159
  ## 证据原文
160
160
 
161
- > 遵循 `.agents/rules/evidence-reporting.md`:每条断言配对 `$ ` 命令和相称结果摘要;Blocker、失败、阻塞或争议必须保留可复现证据、准确位置和决定性摘录;无法复现的判断须降级或移入「自我质疑」。
161
+ > 遵循 `.agents/rules/evidence-reporting.md`:每条断言配对可执行命令和相称结果摘要;Blocker、失败、阻塞或争议必须保留可复现证据、准确位置和决定性摘录;无法复现的判断须降级或移入「自我质疑」。
162
162
 
163
163
  - 断言:{verified claim}
164
164
  ```text
165
- $ {command}
165
+ {command}
166
166
  {result summary or decisive excerpt}
167
167
  ```
168
168
 
@@ -15,6 +15,10 @@ Review the latest plan artifact and produce `review-plan.md` or `review-plan-r{N
15
15
 
16
16
  ## Boundary / Critical Rules
17
17
 
18
+ ### Path and rework
19
+
20
+ This stage consumes only the canonical path fact parsed by core from the latest valid analysis artifact; a stage omitted by that path must not create an artifact. When another Changes Requested verdict follows one completed revision-review cycle in the same stage, classify the rework before the next executor artifact and bind it to the finding, source SHA, and stable task-fact digest. A round or filename change is not new evidence.
21
+
18
22
  ### Persisted Report Evidence
19
23
 
20
24
  Before generating the review report, read `.agents/rules/evidence-reporting.md`. Normal inspection records the command, scope, structured result, actual conclusion, and uncovered parts; findings, blocking conditions, or disputes retain reproducible locations and decisive excerpts, while identity fields remain exact.
@@ -54,7 +58,7 @@ Require `task.md` and at least one plan artifact: `plan.md` or `plan-r{N}.md`.
54
58
 
55
59
  ### 2. Resolve the Artifact Context
56
60
 
57
- Run `agent-infra-internal task-artifact {task-id} inspect --family review-plan`. Continue only for `ready`; take `{plan-artifact}` from `inputs` and `{review-round}` / `{review-artifact}` from `next.round` / `next.name`. Do not scan rounds or construct names in the skill. Then run the started event and verify the returned identity.
61
+ Run `agent-infra-internal task-artifact {task-id} inspect --family review-plan`. Continue only for `ready`. When `selection.disposition` is `reuse`, reuse `selection.artifact`, do not run started/init or write a new artifact, and continue directly to completion verification and next-step guidance. Otherwise take `{plan-artifact}` from `inputs` and `{review-round}` / `{review-artifact}` from `next.round` / `next.name`. Do not scan rounds or construct names in the skill. Then run the started event and verify the returned identity.
58
62
 
59
63
  ### 3. Read Plan Context
60
64
 
@@ -15,6 +15,10 @@ description: >
15
15
 
16
16
  ## 行为边界 / 关键规则
17
17
 
18
+ ### 路径与返工
19
+
20
+ 本阶段只消费核心从最新有效分析产物解析出的规范路径事实;未被所选路径包含的阶段不得创建产物。同阶段完成一次修订—复审后再次收到 Changes Requested 时,必须在下一执行产物前提交绑定 finding、来源 SHA 和稳定任务事实摘要的返工分类;轮次或文件名变化不是新证据。
21
+
18
22
  ### 持久化报告证据
19
23
 
20
24
  生成审查报告时,先读取 `.agents/rules/evidence-reporting.md`。正常检视记录命令、范围、结构化结果、实际结论和未覆盖部分;finding、阻塞或争议保留可复现位置与决定性摘录,身份字段必须精确保留。
@@ -57,7 +61,7 @@ agent-infra-internal task-snapshot {task-id} --format text
57
61
 
58
62
  ### 2. 解析审查上下文
59
63
 
60
- 运行 `agent-infra-internal task-artifact {task-id} inspect --family review-plan`。仅当结果为 `ready` 时继续;从 `inputs` 取得 `{plan-artifact}`,从 `next.round` / `next.name` 取得 `{review-round}` / `{review-artifact}`。不得自行扫描轮次或拼装文件名。随后执行 started 事件并复核返回身份。
64
+ 运行 `agent-infra-internal task-artifact {task-id} inspect --family review-plan`。仅当结果为 `ready` 时继续。若 `selection.disposition` 为 `reuse`,复用 `selection.artifact`,不得执行 started、init 或写入新产物,并直接进入完成校验与下一步提示。其他状态从 `inputs` 取得 `{plan-artifact}`,从 `next.round` / `next.name` 取得 `{review-round}` / `{review-artifact}`;不得自行扫描轮次或拼装文件名。随后执行 started 事件并复核返回身份。
61
65
 
62
66
  ### 3. 阅读方案上下文
63
67
 
@@ -157,16 +157,16 @@ Use this template when writing `review-plan.md` or `review-plan-r{N}.md`.
157
157
 
158
158
  ## State Check
159
159
 
160
- > Record the state-check command, review scope, key result, and uncovered parts; each command starts with `$ `.
160
+ > Record the state-check command, review scope, key result, and uncovered parts.
161
161
  > Follow `.agents/rules/evidence-reporting.md`: record review scope, key result, and uncovered parts; do not paste complete successful stdout.
162
162
 
163
163
  ## Raw Evidence
164
164
 
165
- > Follow `.agents/rules/evidence-reporting.md`: pair each claim with a `$ ` command and proportionate result summary; Blockers, failures, blocking conditions, or disputes require a reproducible command, exact location, and decisive excerpt; a judgment that cannot be reproduced must be downgraded or moved to Self-Doubt.
165
+ > Follow `.agents/rules/evidence-reporting.md`: pair each claim with an executable command and proportionate result summary; Blockers, failures, blocking conditions, or disputes require a reproducible command, exact location, and decisive excerpt; a judgment that cannot be reproduced must be downgraded or moved to Self-Doubt.
166
166
 
167
167
  - Claim: {verified claim}
168
168
  ```text
169
- $ {command}
169
+ {command}
170
170
  {result summary or decisive excerpt}
171
171
  ```
172
172
 
@@ -157,16 +157,16 @@
157
157
 
158
158
  ## 状态核对
159
159
 
160
- > 记录状态核对命令、审查范围、关键结果和未覆盖部分;每条命令以 `$ ` 开头。
160
+ > 记录状态核对命令、审查范围、关键结果和未覆盖部分。
161
161
  > 按 `.agents/rules/evidence-reporting.md` 同时记录审查范围、关键结果和未覆盖部分;正常成功不粘贴完整 stdout。
162
162
 
163
163
  ## 证据原文
164
164
 
165
- > 遵循 `.agents/rules/evidence-reporting.md`:每条断言配对 `$ ` 命令和相称结果摘要;Blocker、失败、阻塞或争议必须保留可复现命令、准确位置和决定性摘录;无法复现的判断须降级或移入「自我质疑」。
165
+ > 遵循 `.agents/rules/evidence-reporting.md`:每条断言配对可执行命令和相称结果摘要;Blocker、失败、阻塞或争议必须保留可复现命令、准确位置和决定性摘录;无法复现的判断须降级或移入「自我质疑」。
166
166
 
167
167
  - 断言:{verified claim}
168
168
  ```text
169
- $ {command}
169
+ {command}
170
170
  {result summary or decisive excerpt}
171
171
  ```
172
172
 
@@ -12,8 +12,10 @@
12
12
  "State Check",
13
13
  "Evidence"
14
14
  ],
15
+ "state_check_patterns": [
16
+ "agent-infra-internal[ \\t]+task-snapshot\\b"
17
+ ],
15
18
  "required_patterns": [
16
- "^\\$ ",
17
19
  "^- \\*\\*Reviewed Head SHA\\*\\*[::]\\s*[0-9a-f]{40}\\s*$",
18
20
  "^- \\*\\*Review Mode\\*\\*[::]\\s*(?:verify|audit|reconstruct)\\s*$",
19
21
  "^- \\*\\*Evidence Scenario\\*\\*[::]\\s*S[123]\\s*$",
@@ -12,8 +12,10 @@
12
12
  "状态核对",
13
13
  "证据原文"
14
14
  ],
15
+ "state_check_patterns": [
16
+ "agent-infra-internal[ \\t]+task-snapshot\\b"
17
+ ],
15
18
  "required_patterns": [
16
- "^\\$ ",
17
19
  "^- \\*\\*被审 head SHA\\*\\*[::]\\s*[0-9a-f]{40}\\s*$",
18
20
  "^- \\*\\*审查模式\\*\\*[::]\\s*(?:verify|audit|reconstruct)\\s*$",
19
21
  "^- \\*\\*证据场景\\*\\*[::]\\s*S[123]\\s*$",
@@ -11,7 +11,7 @@ Use the following structure when creating `pr-review.md` or `pr-review-r{N}.md`.
11
11
 
12
12
  ## State Check
13
13
 
14
- > Record the state-check command, PR/head, review scope, key result, and uncovered parts; each command starts with `$ `.
14
+ > Record the state-check command, PR/head, review scope, key result, and uncovered parts.
15
15
  > Follow `.agents/rules/evidence-reporting.md`: record PR, head, review scope, key result, and uncovered parts; do not paste complete successful stdout.
16
16
 
17
17
  ## Identity
@@ -77,10 +77,10 @@ Land the following in order before the line-level findings, without impersonatin
77
77
 
78
78
  ## Evidence
79
79
 
80
- > Follow `.agents/rules/evidence-reporting.md`: pair every assertion with a `$ ` command and proportionate result summary; formal Review, failures, blocking conditions, or disputes retain exact identity and decisive excerpts.
80
+ > Follow `.agents/rules/evidence-reporting.md`: pair every assertion with an executable command and proportionate result summary; formal Review, failures, blocking conditions, or disputes retain exact identity and decisive excerpts.
81
81
 
82
82
  - Assertion: {verified claim}
83
83
  ```text
84
- $ {command}
84
+ {command}
85
85
  {result summary or decisive excerpt}
86
86
  ```
@@ -11,7 +11,7 @@
11
11
 
12
12
  ## 状态核对
13
13
 
14
- > 记录状态核对命令、PR/head、审查范围、关键结果和未覆盖部分;每条命令以 `$ ` 开头。
14
+ > 记录状态核对命令、PR/head、审查范围、关键结果和未覆盖部分。
15
15
  > 按 `.agents/rules/evidence-reporting.md` 同时记录 PR、head、审查范围、关键结果和未覆盖部分;正常成功不粘贴完整 stdout。
16
16
 
17
17
  ## 身份信息
@@ -77,10 +77,10 @@
77
77
 
78
78
  ## 证据原文
79
79
 
80
- > 遵循 `.agents/rules/evidence-reporting.md`:每条断言配对 `$ ` 命令和相称结果摘要;正式 Review、失败、阻塞或争议保留准确身份和决定性摘录。
80
+ > 遵循 `.agents/rules/evidence-reporting.md`:每条断言配对可执行命令和相称结果摘要;正式 Review、失败、阻塞或争议保留准确身份和决定性摘录。
81
81
 
82
82
  - 断言:{verified claim}
83
83
  ```text
84
- $ {command}
84
+ {command}
85
85
  {result summary or decisive excerpt}
86
86
  ```
@@ -29,8 +29,8 @@
29
29
  "Remaining Coverage",
30
30
  "Raw Evidence"
31
31
  ],
32
- "required_patterns": [
33
- "^\\$ "
32
+ "state_check_patterns": [
33
+ "agent-infra-internal[ \\t]+task-snapshot\\b"
34
34
  ]
35
35
  },
36
36
  "activity-log": {
@@ -29,8 +29,8 @@
29
29
  "尚未覆盖",
30
30
  "证据原文"
31
31
  ],
32
- "required_patterns": [
33
- "^\\$ "
32
+ "state_check_patterns": [
33
+ "agent-infra-internal[ \\t]+task-snapshot\\b"
34
34
  ]
35
35
  },
36
36
  "activity-log": {
@@ -10,7 +10,7 @@
10
10
  ## State Check
11
11
 
12
12
  ```text
13
- $ agent-infra-internal task-snapshot {task-id} --format text
13
+ agent-infra-internal task-snapshot {task-id} --format text
14
14
  {command-summary-and-key-result}
15
15
  ```
16
16
  > Follow `.agents/rules/evidence-reporting.md`: record command name, target scope, exit status, sanitized result, and coverage gap; do not paste complete argv or sensitive transcripts.
@@ -67,7 +67,7 @@ $ agent-infra-internal task-snapshot {task-id} --format text
67
67
  ## Raw Evidence
68
68
 
69
69
  ```text
70
- $ agent-infra-internal task-validate {task-ref} --scope {scope} --format json -- {redacted-command}
70
+ agent-infra-internal task-validate {task-ref} --scope {scope} --format json -- {redacted-command}
71
71
  {sanitized-result}
72
72
  ```
73
73
  > Keep only the allowed public command and sanitized structured result; complete successful stdout is not default report content.
@@ -10,7 +10,7 @@
10
10
  ## 状态核对
11
11
 
12
12
  ```text
13
- $ agent-infra-internal task-snapshot {task-id} --format text
13
+ agent-infra-internal task-snapshot {task-id} --format text
14
14
  {command-summary-and-key-result}
15
15
  ```
16
16
  > 按 `.agents/rules/evidence-reporting.md` 记录命令名称、目标范围、退出状态、sanitized result 和覆盖缺口;不得粘贴完整 argv 或敏感 transcript。
@@ -67,7 +67,7 @@ $ agent-infra-internal task-snapshot {task-id} --format text
67
67
  ## 证据原文
68
68
 
69
69
  ```text
70
- $ agent-infra-internal task-validate {task-ref} --scope {scope} --format json -- {redacted-command}
70
+ agent-infra-internal task-validate {task-ref} --scope {scope} --format json -- {redacted-command}
71
71
  {sanitized-result}
72
72
  ```
73
73
  > 仅保留允许公开的命令与脱敏结构化结果;完整成功 stdout 不属于默认报告内容。
@@ -363,6 +363,13 @@ function assetMatches(entry, target) {
363
363
  : normalizedTarget === normalizedEntry;
364
364
  }
365
365
 
366
+ function isOwnedByDisabledAgentClient(target, enabledSet) {
367
+ return AGENT_CLIENT_MANIFEST.some((adapter) =>
368
+ !enabledSet.has(adapter.id)
369
+ && adapter.ownedPathPrefixes.some((prefix) => assetMatches(prefix, target))
370
+ );
371
+ }
372
+
366
373
  function adapterAssets(adapters, category) {
367
374
  return adapters.flatMap((adapter) => adapter[category]);
368
375
  }
@@ -1914,6 +1921,15 @@ function syncTemplates(projectRoot, templateRootOverride) {
1914
1921
  }
1915
1922
 
1916
1923
  const mergedMap = new Map();
1924
+ const addMergedTarget = (target, source) => {
1925
+ if (
1926
+ isOwnedByDisabledAgentClient(target, enabledTUIs)
1927
+ && !isCustomProtected(target, protectedCustomSkills, customCommandTargets)
1928
+ ) {
1929
+ return;
1930
+ }
1931
+ if (!mergedMap.has(target)) mergedMap.set(target, source);
1932
+ };
1917
1933
  for (const entry of merged) {
1918
1934
  if (isPathOwnedByOtherPlatform(entry, platformType)) {
1919
1935
  report.managed.skippedPlatform.push(entry);
@@ -1925,13 +1941,13 @@ function syncTemplates(projectRoot, templateRootOverride) {
1925
1941
  return globMatch(entry, t);
1926
1942
  });
1927
1943
  for (const [t, s] of platformSelect(langSelect(hits, lang, allSet, project), platformType, project)) {
1928
- if (!mergedMap.has(t)) mergedMap.set(t, s);
1944
+ addMergedTarget(t, s);
1929
1945
  }
1930
1946
  } else {
1931
1947
  const rels = entryVariantRels(entry, allSet, platformType);
1932
1948
  const selected = platformSelect(langSelect(rels, lang, allSet, project), platformType, project);
1933
1949
  for (const [t, s] of selected) {
1934
- if (!mergedMap.has(t)) mergedMap.set(t, s);
1950
+ addMergedTarget(t, s);
1935
1951
  }
1936
1952
  }
1937
1953
  }
@@ -106,8 +106,8 @@ delivery_remote_head: # Most recent successfully delivered task branch
106
106
 
107
107
  ## Rework Intent
108
108
 
109
- | intent_id | finding_id | source_artifact | source_sha256 | target | status | declared_at | consumed_at |
110
- |-----------|------------|----------------|---------------|--------|--------|-------------|-------------|
109
+ | intent_id | finding_id | source_artifact | source_sha256 | target | classification | evidence_digest | task_fact_digest | status | declared_at | consumed_at |
110
+ |-----------|------------|----------------|---------------|--------|----------------|-----------------|------------------|--------|-------------|-------------|
111
111
 
112
112
  ## Artifact Invalidation
113
113
 
@@ -106,8 +106,8 @@ delivery_remote_head: # 最近一次成功交付到 remote 的任务分
106
106
 
107
107
  ## 返工意图
108
108
 
109
- | intent_id | finding_id | source_artifact | source_sha256 | target | status | declared_at | consumed_at |
110
- |-----------|------------|----------------|---------------|--------|--------|-------------|-------------|
109
+ | intent_id | finding_id | source_artifact | source_sha256 | target | classification | evidence_digest | task_fact_digest | status | declared_at | consumed_at |
110
+ |-----------|------------|----------------|---------------|--------|----------------|-----------------|------------------|--------|-------------|-------------|
111
111
 
112
112
  ## 产物失效记录
113
113
 
@@ -9,6 +9,11 @@
9
9
  name: bug-fix
10
10
  description: Workflow for diagnosing and fixing a defect.
11
11
 
12
+ lifecycle_paths:
13
+ streamlined: [analysis, code, code-review]
14
+ standard: [analysis, design, code, code-review]
15
+ full: [analysis, analysis-review, design, design-review, code, code-review]
16
+
12
17
  steps:
13
18
  - name: analysis
14
19
  description: Reproduce the defect, identify the root cause, and define the fix scope.
@@ -29,7 +34,7 @@ steps:
29
34
  outputs:
30
35
  - name: analysis
31
36
  pattern: "analysis.md | analysis-r{N}.md"
32
- rule: "Scan existing analysis artifacts; create analysis.md for round 1 and analysis-r{N}.md for later revisions (N = current highest round + 1)"
37
+ rule: "Let the task-artifact selector decide: reuse a completed artifact when inputs and substantive results match; create the next round only for new inputs, rework evidence, or result changes"
33
38
  outputs:
34
39
  - Root-cause analysis
35
40
  - Affected files list
@@ -56,7 +61,7 @@ steps:
56
61
  outputs:
57
62
  - name: review-analysis
58
63
  pattern: "review-analysis.md | review-analysis-r{N}.md"
59
- rule: "Scan existing requirement-analysis review artifacts; create review-analysis.md for round 1 and review-analysis-r{N}.md for later rounds (N = current highest round + 1)"
64
+ rule: "Let the task-artifact selector decide: reuse a completed artifact when inputs and substantive results match; create the next round only for new inputs, rework evidence, or result changes"
60
65
  outputs:
61
66
  - Requirement analysis review report
62
67
  - Findings to fix, if any
@@ -84,7 +89,7 @@ steps:
84
89
  outputs:
85
90
  - name: plan
86
91
  pattern: "plan.md | plan-r{N}.md"
87
- rule: "Scan existing plan artifacts; create plan.md for round 1 and plan-r{N}.md for later revisions (N = current highest round + 1)"
92
+ rule: "Let the task-artifact selector decide: reuse a completed artifact when inputs and substantive results match; create the next round only for new inputs, rework evidence, or result changes"
88
93
  outputs:
89
94
  - Fix plan
90
95
  - Regression test list
@@ -110,7 +115,7 @@ steps:
110
115
  outputs:
111
116
  - name: review-plan
112
117
  pattern: "review-plan.md | review-plan-r{N}.md"
113
- rule: "Scan existing plan review artifacts; create review-plan.md for round 1 and review-plan-r{N}.md for later rounds (N = current highest round + 1)"
118
+ rule: "Let the task-artifact selector decide: reuse a completed artifact when inputs and substantive results match; create the next round only for new inputs, rework evidence, or result changes"
114
119
  outputs:
115
120
  - Plan review report
116
121
  - Findings to fix, if any
@@ -146,7 +151,7 @@ steps:
146
151
  outputs:
147
152
  - name: code
148
153
  pattern: "code.md | code-r{N}.md"
149
- rule: "Scan existing code artifacts; create code.md for round 1 and code-r{N}.md for later fixes or reimplementation (N = current highest round + 1)"
154
+ rule: "Let the task-artifact selector decide: reuse a completed artifact when inputs and substantive results match; create the next round only for new inputs, rework evidence, or result changes"
150
155
  outputs:
151
156
  - Bug-fix branch with implementation or fixes
152
157
  - Regression test files
@@ -173,7 +178,7 @@ steps:
173
178
  outputs:
174
179
  - name: review-code
175
180
  pattern: "review-code.md | review-code-r{N}.md"
176
- rule: "Scan existing code review artifacts; create review-code.md for round 1 and review-code-r{N}.md for later rounds (N = current highest round + 1)"
181
+ rule: "Let the task-artifact selector decide: reuse a completed artifact when inputs and substantive results match; create the next round only for new inputs, rework evidence, or result changes"
177
182
  outputs:
178
183
  - Code review report
179
184
  - Findings list, if any
@@ -8,6 +8,11 @@
8
8
  name: bug-fix
9
9
  description: 诊断和修复缺陷的工作流。
10
10
 
11
+ lifecycle_paths:
12
+ streamlined: [analysis, code, code-review]
13
+ standard: [analysis, design, code, code-review]
14
+ full: [analysis, analysis-review, design, design-review, code, code-review]
15
+
11
16
  steps:
12
17
  - name: analysis
13
18
  description: 复现缺陷,识别根本原因,确定修复范围。
@@ -28,7 +33,7 @@ steps:
28
33
  outputs:
29
34
  - name: analysis
30
35
  pattern: "analysis.md | analysis-r{N}.md"
31
- rule: "扫描现有分析产物;首轮创建 analysis.md,后续修订创建 analysis-r{N}.md(N = 当前最高轮次 + 1)"
36
+ rule: "由 task-artifact 选择器决定:输入与实质结果未变化时复用已完成产物;仅在新输入、新返工证据或结果变化时创建下一轮"
32
37
  outputs:
33
38
  - 根因分析
34
39
  - 受影响文件列表
@@ -55,7 +60,7 @@ steps:
55
60
  outputs:
56
61
  - name: review-analysis
57
62
  pattern: "review-analysis.md | review-analysis-r{N}.md"
58
- rule: "扫描现有需求分析审查产物;首轮创建 review-analysis.md,后续轮次创建 review-analysis-r{N}.md(N = 当前最高轮次 + 1)"
63
+ rule: "由 task-artifact 选择器决定:输入与实质结果未变化时复用已完成产物;仅在新输入、新返工证据或结果变化时创建下一轮"
59
64
  outputs:
60
65
  - 需求分析审查报告
61
66
  - 待修正问题列表(如有)
@@ -83,7 +88,7 @@ steps:
83
88
  outputs:
84
89
  - name: plan
85
90
  pattern: "plan.md | plan-r{N}.md"
86
- rule: "扫描现有方案产物;首轮创建 plan.md,后续修订创建 plan-r{N}.md(N = 当前最高轮次 + 1)"
91
+ rule: "由 task-artifact 选择器决定:输入与实质结果未变化时复用已完成产物;仅在新输入、新返工证据或结果变化时创建下一轮"
87
92
  outputs:
88
93
  - 任务文件中记录的修复方案
89
94
  - 待添加的测试用例列表
@@ -109,7 +114,7 @@ steps:
109
114
  outputs:
110
115
  - name: review-plan
111
116
  pattern: "review-plan.md | review-plan-r{N}.md"
112
- rule: "扫描现有方案审查产物;首轮创建 review-plan.md,后续轮次创建 review-plan-r{N}.md(N = 当前最高轮次 + 1)"
117
+ rule: "由 task-artifact 选择器决定:输入与实质结果未变化时复用已完成产物;仅在新输入、新返工证据或结果变化时创建下一轮"
113
118
  outputs:
114
119
  - 技术方案审查报告
115
120
  - 待修正问题列表(如有)
@@ -145,7 +150,7 @@ steps:
145
150
  outputs:
146
151
  - name: code
147
152
  pattern: "code.md | code-r{N}.md"
148
- rule: "扫描现有实现产物;首轮创建 code.md,后续修复或重实现创建 code-r{N}.md(N = 当前最高轮次 + 1)"
153
+ rule: "由 task-artifact 选择器决定:输入与实质结果未变化时复用已完成产物;仅在新输入、新返工证据或结果变化时创建下一轮"
149
154
  outputs:
150
155
  - 包含实现或修复的缺陷修复分支
151
156
  - 回归测试文件
@@ -172,7 +177,7 @@ steps:
172
177
  outputs:
173
178
  - name: review-code
174
179
  pattern: "review-code.md | review-code-r{N}.md"
175
- rule: "扫描现有代码审查产物;首轮创建 review-code.md,后续轮次创建 review-code-r{N}.md(N = 当前最高轮次 + 1)"
180
+ rule: "由 task-artifact 选择器决定:输入与实质结果未变化时复用已完成产物;仅在新输入、新返工证据或结果变化时创建下一轮"
176
181
  outputs:
177
182
  - 代码审查报告
178
183
  - 问题列表(如有)
@@ -9,6 +9,11 @@
9
9
  name: feature-development
10
10
  description: End-to-end workflow for developing a new feature.
11
11
 
12
+ lifecycle_paths:
13
+ streamlined: [analysis, code, code-review]
14
+ standard: [analysis, design, code, code-review]
15
+ full: [analysis, analysis-review, design, design-review, code, code-review]
16
+
12
17
  steps:
13
18
  - name: analysis
14
19
  description: Analyze feature requirements, explore the codebase, and identify affected areas.
@@ -27,7 +32,7 @@ steps:
27
32
  outputs:
28
33
  - name: analysis
29
34
  pattern: "analysis.md | analysis-r{N}.md"
30
- rule: "Scan existing analysis artifacts; create analysis.md for round 1 and analysis-r{N}.md for later revisions (N = current highest round + 1)"
35
+ rule: "Let the task-artifact selector decide: reuse a completed artifact when inputs and substantive results match; create the next round only for new inputs, rework evidence, or result changes"
31
36
  outputs:
32
37
  - Requirement analysis report
33
38
  - Affected files list
@@ -54,7 +59,7 @@ steps:
54
59
  outputs:
55
60
  - name: review-analysis
56
61
  pattern: "review-analysis.md | review-analysis-r{N}.md"
57
- rule: "Scan existing requirement-analysis review artifacts; create review-analysis.md for round 1 and review-analysis-r{N}.md for later rounds (N = current highest round + 1)"
62
+ rule: "Let the task-artifact selector decide: reuse a completed artifact when inputs and substantive results match; create the next round only for new inputs, rework evidence, or result changes"
58
63
  outputs:
59
64
  - Requirement analysis review report
60
65
  - Findings to fix, if any
@@ -83,7 +88,7 @@ steps:
83
88
  outputs:
84
89
  - name: plan
85
90
  pattern: "plan.md | plan-r{N}.md"
86
- rule: "Scan existing plan artifacts; create plan.md for round 1 and plan-r{N}.md for later revisions (N = current highest round + 1)"
91
+ rule: "Let the task-artifact selector decide: reuse a completed artifact when inputs and substantive results match; create the next round only for new inputs, rework evidence, or result changes"
87
92
  outputs:
88
93
  - Technical plan
89
94
  - Interface definitions
@@ -110,7 +115,7 @@ steps:
110
115
  outputs:
111
116
  - name: review-plan
112
117
  pattern: "review-plan.md | review-plan-r{N}.md"
113
- rule: "Scan existing plan review artifacts; create review-plan.md for round 1 and review-plan-r{N}.md for later rounds (N = current highest round + 1)"
118
+ rule: "Let the task-artifact selector decide: reuse a completed artifact when inputs and substantive results match; create the next round only for new inputs, rework evidence, or result changes"
114
119
  outputs:
115
120
  - Plan review report
116
121
  - Findings to fix, if any
@@ -146,7 +151,7 @@ steps:
146
151
  outputs:
147
152
  - name: code
148
153
  pattern: "code.md | code-r{N}.md"
149
- rule: "Scan existing code artifacts; create code.md for round 1 and code-r{N}.md for later fixes or reimplementation (N = current highest round + 1)"
154
+ rule: "Let the task-artifact selector decide: reuse a completed artifact when inputs and substantive results match; create the next round only for new inputs, rework evidence, or result changes"
150
155
  outputs:
151
156
  - Feature branch with implementation or fixes
152
157
  - Test files
@@ -173,7 +178,7 @@ steps:
173
178
  outputs:
174
179
  - name: review-code
175
180
  pattern: "review-code.md | review-code-r{N}.md"
176
- rule: "Scan existing code review artifacts; create review-code.md for round 1 and review-code-r{N}.md for later rounds (N = current highest round + 1)"
181
+ rule: "Let the task-artifact selector decide: reuse a completed artifact when inputs and substantive results match; create the next round only for new inputs, rework evidence, or result changes"
177
182
  outputs:
178
183
  - Code review report
179
184
  - Findings to fix