@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
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: code-task
3
3
  description: >
4
- 根据技术方案编码任务并输出报告。
5
- 当技术方案已批准需要落地实现,或代码审查发现问题需要修复时使用。
4
+ 根据生命周期输入编码任务并输出报告。
5
+ 当分析或技术方案已按所选路径准备完成,或代码审查发现问题需要修复时使用。
6
6
  仅当对话包含可解析的任务引用时才可自动调用本技能。
7
7
  ---
8
8
 
@@ -11,16 +11,20 @@ description: >
11
11
 
12
12
  若入口业务操作数包含 `--orchestrated`,绑定 `{execution-flag}` = `--orchestrated` 并原样转发给 completed 事件;否则绑定为空。不得从 `orchestration.json`、环境变量或历史产物推断该标记。生命周期事件还必须携带显式触发信息:编排调用使用 `{trigger-initiator}=orchestrator`,否则使用 `model`;`{request-id}` 是本任务与本轮产物的稳定单行标识,`{reason-code}` 初次实现使用 `user-request`,修复或裁决使用 `review-finding`;started 与 completed 使用同一组值。
13
13
 
14
- 根据已批准的技术方案编码任务,并产出 `code.md` 或 `code-r{N}.md`。本技能支持初次实现、基于 `review-code` 反馈的修复,以及人工裁决驱动实现三种模式。
14
+ 根据所选生命周期路径的实现输入编码任务,并产出 `code.md` 或 `code-r{N}.md`。本技能支持初次实现、基于 `review-code` 反馈的修复,以及人工裁决驱动实现三种模式。
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`。成功测试记录命令、目标范围、状态/结构化结果、实际结果和未覆盖部分;失败、阻塞或争议保留复现入口、准确位置和决定性摘录,不默认粘贴完整成功 stdout。
21
25
 
22
26
  - 涉及候选资格或 `HD-N` 判断时,先读取 `.agents/rules/decision-qualification.md`,基于 task.md 规范化约束/候选完成资格审计,并在实现报告记录五张资格审计表;不得把来源不明或未确认约束自动升级为排除条件
23
- - 严格遵循最新方案产物:`plan.md` 或 `plan-r{N}.md`
27
+ - 严格遵循核心选择的最新生命周期输入:精简路径为 `analysis.md` / `analysis-r{N}.md`,标准或完整路径为 `plan.md` / `plan-r{N}.md`
24
28
  - 生成会同步到 Issue 的任务或生命周期 Markdown 前,先读取 `.agents/rules/sync-content-generation.md` 并遵循其中的生成端约束;同步端不解析或改写正文
25
29
  - 实现前读取 `.agents/rules/compatibility-policy.md`;只实现方案明确批准的兼容预算,不以“稳妥”为由保留旧分支、旧结果契约或迁移 shim
26
30
  - 修复模式逐条核实最新 `review-code` 的发现:成立则修复,判定为不成立/幻觉则在报告中反驳并记入 unresolved;不擅自扩大到审查未列出的问题;manual-validation 项不在修复范围
@@ -40,7 +44,7 @@ description: >
40
44
  |------|------|
41
45
  | 「代码太简单,不需要测试」 | 简单代码也会回归;没有"失败→通过"的用例就没有完成标志,先写验证业务行为的测试。 |
42
46
  | 「先写代码再补测试更高效」 | 后补测试常沦为对实现的镜像;目标驱动应先定义可验证用例再让它通过。 |
43
- | 「方案这里不合理,顺手改更好」 | 偏离 `{plan-artifact}` 必须在报告中记录原因;有异议先停下确认,不擅自改方向。 |
47
+ | 「输入这里不合理,顺手改更好」 | 偏离 `{lifecycle-input-artifact}` 必须在报告中记录原因;有异议按任务规则处理,不擅自改方向。 |
44
48
  | 「测试过了,顺便推送一下」 | 本技能只创建本地 checkpoint;远端推送是 `create-pr` 的唯一边界。 |
45
49
  | 「审查既然写了,照着改就行」 | 审查可能基于错误 `file:line` 或幻觉;动手前先 Read/Grep 核实,成立才修,不成立就反驳并记入 unresolved,不盲从。 |
46
50
  | 「保留旧入口更稳妥,反正只多一个分支」 | 未获批准的兼容是范围扩张和长期债务;没有对象、必要性、期限和退出条件就只实现当前契约。 |
@@ -72,9 +76,8 @@ agent-infra-internal task-snapshot {task-id} --format text
72
76
 
73
77
  先检查:
74
78
  - `.agents/workspace/active/{task-id}/task.md`
75
- - 至少一个技术方案产物:`plan.md` 或 `plan-r{N}.md`
76
79
 
77
- 如果缺少任一文件,立即停止并提示用户先完成前置步骤。
80
+ 如果缺少任务文件,立即停止。生命周期输入由步骤 4 的核心查询按已选路径验证;技能不得预先固定要求方案产物。
78
81
 
79
82
  ### 2. 确保任务分支
80
83
 
@@ -105,6 +108,8 @@ status=$?
105
108
  echo "$result"
106
109
  ```
107
110
 
111
+ 若 `selection.disposition` 为 `reuse`,复用 `selection.artifact`,不得执行 started、init、代码修改或写入新产物,并直接进入完成校验与下一步提示。其他状态继续按下表处理。
112
+
108
113
  按 `$status` 与 `result.mode` 分流;二者不一致时按 `$status` 为准并报告异常:
109
114
 
110
115
  | `$status` | `result.mode` | 行动 |
@@ -118,13 +123,13 @@ echo "$result"
118
123
 
119
124
  > 双模式判定规则见 `reference/dual-mode.md`。执行此步骤前先读取 `reference/dual-mode.md`。
120
125
 
121
- ### 5. 确定输入方案
126
+ ### 5. 确定生命周期输入
122
127
 
123
- 只使用步骤 4 的结构化结果:从 `inputs` 取得 `{plan-artifact}`,从 `next_round` / `next_artifact` 取得 `{code-round}` / `{code-artifact}`;修复模式从 `review_artifact` 取得 `{review-artifact}`;裁决模式从 `implementation_input`、`decision_id`、`decision_evidence` 取得统一输入身份。不得自行扫描轮次或拼装文件名。
128
+ 只使用步骤 4 的结构化结果:从 `inputs` 取得核心选择的 `{lifecycle-input-artifact}`(精简路径为 analysis,其他路径为 plan),从 `next_round` / `next_artifact` 取得 `{code-round}` / `{code-artifact}`;修复模式从 `review_artifact` 取得 `{review-artifact}`;裁决模式从 `implementation_input`、`decision_id`、`decision_evidence` 取得统一输入身份。不得自行扫描轮次或拼装文件名。
124
129
 
125
- ### 6. 阅读技术方案
130
+ ### 6. 阅读生命周期输入
126
131
 
127
- 仔细阅读 `{plan-artifact}`,提取:
132
+ 仔细阅读 `{lifecycle-input-artifact}`,提取:
128
133
  - 实施步骤
129
134
  - 需要创建或修改的文件
130
135
  - 测试策略
@@ -237,11 +242,11 @@ agent-infra-internal task-verify {task-id} code.completed --artifact {code-artif
237
242
  ## 注意事项
238
243
 
239
244
  - 首轮实现使用 `code.md`,后续轮次使用 `code-r{N}.md`
240
- - 如偏离 `{plan-artifact}`,必须在报告中记录原因
245
+ - 如偏离 `{lifecycle-input-artifact}`,必须在报告中记录原因
241
246
  - 新测试必须验证有意义的业务行为,而不是机械透传
242
247
 
243
248
  ## 错误处理
244
249
 
245
250
  - 任务未找到:`Task {task-id} not found`
246
- - 缺少方案:`Technical plan not found, please run the plan-task skill first`
251
+ - 缺少生命周期输入:透传步骤 4 返回的 `ARTIFACT_INPUT_MISSING`,按所选路径补充 analysis 或 plan
247
252
  - 本地修复后仍无法通过测试:说明外部阻塞并停止,且不要创建实现产物
@@ -14,7 +14,7 @@ Follow the `code` step in `.agents/workflows/feature-development.yaml`.
14
14
  - [ ] follow project coding standards
15
15
 
16
16
  **Implementation principles**:
17
- 1. **Follow the plan strictly**: do not deviate from the technical plan
17
+ 1. **Follow the input strictly**: do not deviate from the analysis or plan lifecycle input selected by core
18
18
  2. **Work step by step**: execute the planned sequence
19
19
  3. **Keep testing continuously**: run the **fast smoke subset** continuously as work progresses (see the `test` skill)
20
20
  4. **Keep it simple**: do not add unplanned features
@@ -46,7 +46,7 @@ Two-way failure handling:
46
46
 
47
47
  ## Notes
48
48
 
49
- 1. **Prerequisite**: the approved technical plan must exist (`plan.md` or `plan-r{N}.md`)
49
+ 1. **Prerequisite**: the analysis or plan lifecycle input selected by core must exist
50
50
  2. **No auto-commit**: do not run `git commit` or `git add`
51
51
  3. **Test quality**: new tests must validate meaningful business logic
52
52
  4. **Code quality**: follow project coding conventions
@@ -14,7 +14,7 @@
14
14
  - [ ] 遵守项目编码规范
15
15
 
16
16
  **实现原则**:
17
- 1. **严格遵循方案**:不要偏离技术方案
17
+ 1. **严格遵循输入**:不要偏离核心选择的 analysis 或 plan 生命周期输入
18
18
  2. **按步骤推进**:按计划顺序执行
19
19
  3. **持续测试**:实现过程中持续运行 **fast smoke 子集**(参见 `test` skill)
20
20
  4. **保持简单**:不要加入未计划的功能
@@ -46,7 +46,7 @@
46
46
 
47
47
  ## 注意事项
48
48
 
49
- 1. **前置条件**:必须存在已批准的技术方案(`plan.md` 或 `plan-r{N}.md`)
49
+ 1. **前置条件**:必须存在核心按所选路径返回的 analysis 或 plan 生命周期输入
50
50
  2. **禁止自动提交**:不要执行 `git commit` 或 `git add`
51
51
  3. **测试质量**:新增测试必须验证有意义的业务逻辑
52
52
  4. **代码质量**:遵循项目编码规范
@@ -8,9 +8,9 @@ This file documents the core artifact lifecycle's code-mode decision. The `task-
8
8
  agent-infra-internal task-artifact {task-id} inspect --family code
9
9
  ```
10
10
 
11
- The core scans `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` in the task directory.
11
+ The core reads the path decision from the latest analysis and selects the lifecycle input: analysis for streamlined, plan for standard or full. The full path also validates review-plan before scanning code and review-code artifacts.
12
12
 
13
- `code.started` persists the plan identity and SHA-256 for the round in task.md frontmatter. `code.completed` uses that start context and verifies the current latest plan; changed input fails closed. The implementation report's `Plan Input` field is reader-facing traceability, not lifecycle identity validation.
13
+ `code.started` persists the lifecycle input identity and SHA-256 for the round in task.md frontmatter. `code.completed` verifies the current latest input against that context; changed input fails closed. The implementation report field is reader-facing traceability only.
14
14
 
15
15
  ## Eight Branches
16
16
 
@@ -18,8 +18,8 @@ The core scans `plan.md` / `plan-r{N}.md`, `review-plan.md` / `review-plan-r{N}.
18
18
 
19
19
  | Condition | mode | exit | Behavior |
20
20
  |---|---|---:|---|
21
- | no code artifact, and the latest review-plan is exactly `Approved` and references the latest plan | `init` | 0 | initial implementation, output `code.md`; a missing matching approval or `Approved-with-issues` returns an error |
22
- | latest review-plan is exactly `Approved`, references the latest plan, and the latest code completion receipt does not bind the same plan digest | `init` | 0 | enter a new implementation round. `Approved-with-issues` remains parse-compatible for history but is not cross-stage approval; missing or invalid receipts fail closed |
21
+ | no code artifact and the selected lifecycle input is valid; full also requires an exactly `Approved` review-plan bound to the latest plan | `init` | 0 | initial implementation, output `code.md` |
22
+ | the latest analysis or plan lifecycle input is not bound by the latest code completion receipt | `init` | 0 | enter a new implementation round; missing or invalid receipts fail closed |
23
23
  | the latest review-code completion receipt does not bind the latest code identity/SHA | `error` | 2 | latest code is unreviewed; run `review-code`; code and review-code family rounds may advance independently |
24
24
  | latest review-code is Approved and a pending implementation input was decided after that review completed | `decision` | 0 | select the earliest `II-N` and enter decision-driven implementation; false/not-required and consumed inputs do not trigger |
25
25
  | latest review-code is Approved with 0/0/0 | `refused` | 1 | already approved; do not run `code-task` again |
@@ -8,9 +8,9 @@
8
8
  agent-infra-internal task-artifact {task-id} inspect --family code
9
9
  ```
10
10
 
11
- 核心扫描任务目录中的 `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`。
11
+ 核心读取最新 analysis 的路径裁定,并选择生命周期输入:精简路径使用 analysis,标准或完整路径使用 plan;完整路径还校验对应 review-plan。随后扫描 code 与 review-code 产物。
12
12
 
13
- `code.started` 会在 task.md frontmatter 中绑定本轮方案文件及其 SHA-256。`code.completed` 使用该开始上下文并校验当前最新 plan;内容变化失败关闭。实现报告的“方案输入”/“Plan Input”仅供读者追溯,不参与生命周期身份校验。
13
+ `code.started` 会在 task.md frontmatter 中绑定本轮生命周期输入及其 SHA-256。`code.completed` 使用该开始上下文并校验当前最新输入;内容变化失败关闭。实现报告的“生命周期输入”仅供读者追溯,不参与生命周期身份校验。
14
14
 
15
15
  ## 8 个分支
16
16
 
@@ -18,8 +18,8 @@ agent-infra-internal task-artifact {task-id} inspect --family code
18
18
 
19
19
  | 条件 | mode | exit | 行为 |
20
20
  |---|---|---:|---|
21
- | 无 code 产物,且最新 review-plan 精确为 `Approved` 并引用最新 plan | `init` | 0 | 初次实现,产物为 `code.md`;缺少匹配审批或为 `Approved-with-issues` 时返回 error |
22
- | 最新 review-plan 精确为 `Approved`,且其「审查输入」/「Review Input」字段引用最新 plan,而最新 code 的完成 receipt 未绑定相同 plan 摘要 | `init` | 0 | plan 内容在 code 输入之后获批;进入新一轮实现。`Approved-with-issues` 仅保留历史解析兼容,不构成跨阶段批准;缺失或无效 receipt 失败关闭 |
21
+ | 无 code 产物,且所选生命周期输入有效;完整路径的最新 review-plan 还必须精确为 `Approved` 并引用最新 plan | `init` | 0 | 初次实现,产物为 `code.md` |
22
+ | 最新 analysis 或 plan 生命周期输入未被最新 code 完成 receipt 绑定 | `init` | 0 | 输入在上轮 code 后发生有效变化,进入新一轮实现;缺失或无效 receipt 失败关闭 |
23
23
  | 最新 review-code 的完成收据未绑定最新 code identity/SHA | `error` | 2 | 最新代码未审查,先运行 `review-code`;code 与 review-code 的 family 轮次可独立增长 |
24
24
  | 最新 review-code 为 Approved 且存在审查完成后产生的 pending 实现输入 | `decision` | 0 | 选择最早 `II-N`,进入裁决驱动实现;false/not-required 与 consumed 输入不触发 |
25
25
  | 最新 review-code 为 Approved 且 0/0/0 | `refused` | 1 | 已通过,无需再次运行 `code-task` |
@@ -17,7 +17,7 @@ Use this structure when creating `code.md` or `code-r{N}.md`.
17
17
  ## Implementation Input
18
18
 
19
19
  - **Mode**: {init / fix / decision}
20
- - **Plan Input**: `{plan-artifact}`
20
+ - **Lifecycle Input**: `{lifecycle-input-artifact}`
21
21
  - **Review Input**: `{review-artifact or N/A}`
22
22
  - **Decision Input**: `{implementation-input or N/A}`
23
23
  - **Ledger ID**: `{decision-id or N/A}`
@@ -102,25 +102,25 @@ Use this structure when creating `code.md` or `code-r{N}.md`.
102
102
 
103
103
  ## State Check
104
104
 
105
- > Record the state-check command, task/artifact scope, key result, and uncovered parts; each command starts with `$ `.
105
+ > Record the state-check command, task/artifact scope, key result, and uncovered parts.
106
106
  > Follow `.agents/rules/evidence-reporting.md`: record task/artifact scope, key result, and uncovered parts; do not paste complete successful stdout.
107
107
 
108
- Record at least one actually executed `$ ` command and its result summary; prose-only status is insufficient. An implementation-stage report normally includes:
108
+ Record at least one actually executed command and its result summary; prose-only status is insufficient. An implementation-stage report normally includes:
109
109
 
110
110
  ```text
111
- $ agent-infra-internal task-snapshot {task-id} --format text
111
+ agent-infra-internal task-snapshot {task-id} --format text
112
112
  {task state, implementation-artifact scope, and uncovered-area summary}
113
- $ agent-infra-internal task-artifact {task-id} inspect --family code
113
+ agent-infra-internal task-artifact {task-id} inspect --family code
114
114
  {code artifact, upstream input, and next-step summary}
115
115
  ```
116
116
 
117
117
  ## Raw Evidence
118
118
 
119
- > Follow `.agents/rules/evidence-reporting.md`: pair each claim with a `$ ` command and proportionate result summary; include a decisive raw excerpt only for failures, blocking conditions, or disputes.
119
+ > Follow `.agents/rules/evidence-reporting.md`: pair each claim with an executable command and proportionate result summary; include a decisive raw excerpt only for failures, blocking conditions, or disputes.
120
120
 
121
121
  - Claim: {verified claim}
122
122
  ```text
123
- $ {command}
123
+ {command}
124
124
  {result summary or decisive excerpt}
125
125
  ```
126
126
 
@@ -17,7 +17,7 @@
17
17
  ## 实现输入
18
18
 
19
19
  - **模式**:{init / fix / decision}
20
- - **方案输入**:`{plan-artifact}`
20
+ - **生命周期输入**:`{lifecycle-input-artifact}`
21
21
  - **审查输入**:`{review-artifact 或 N/A}`
22
22
  - **裁决输入**:`{implementation-input 或 N/A}`
23
23
  - **账本 ID**:`{decision-id 或 N/A}`
@@ -102,25 +102,25 @@
102
102
 
103
103
  ## 状态核对
104
104
 
105
- > 记录状态核对命令、任务/产物范围、关键结果和未覆盖部分;每条命令以 `$ ` 开头。
105
+ > 记录状态核对命令、任务/产物范围、关键结果和未覆盖部分。
106
106
  > 按 `.agents/rules/evidence-reporting.md` 同时记录任务/产物范围、关键结果和未覆盖部分;正常成功不粘贴完整 stdout。
107
107
 
108
- 必须记录至少一条实际执行的 `$ ` 命令及其结果摘要,不能只写自然语言状态。实现阶段通常包括:
108
+ 必须记录至少一条实际执行的命令及其结果摘要,不能只写自然语言状态。实现阶段通常包括:
109
109
 
110
110
  ```text
111
- $ agent-infra-internal task-snapshot {task-id} --format text
111
+ agent-infra-internal task-snapshot {task-id} --format text
112
112
  {任务状态、实现产物范围和未覆盖项摘要}
113
- $ agent-infra-internal task-artifact {task-id} inspect --family code
113
+ agent-infra-internal task-artifact {task-id} inspect --family code
114
114
  {code artifact、上游输入和下一步摘要}
115
115
  ```
116
116
 
117
117
  ## 证据原文
118
118
 
119
- > 遵循 `.agents/rules/evidence-reporting.md`:每条断言配对 `$ ` 命令和相称结果摘要;仅为失败、阻塞或争议附决定性原文摘录。
119
+ > 遵循 `.agents/rules/evidence-reporting.md`:每条断言配对可执行命令和相称结果摘要;仅为失败、阻塞或争议附决定性原文摘录。
120
120
 
121
121
  - 断言:{verified claim}
122
122
  ```text
123
- $ {command}
123
+ {command}
124
124
  {result summary or decisive excerpt}
125
125
  ```
126
126
 
@@ -23,8 +23,8 @@
23
23
  "Validation Details",
24
24
  "PR Summary Sync"
25
25
  ],
26
- "required_patterns": [
27
- "^\\$ "
26
+ "state_check_patterns": [
27
+ "agent-infra-internal[ \\t]+task-snapshot\\b"
28
28
  ]
29
29
  },
30
30
  "activity-log": {
@@ -23,8 +23,8 @@
23
23
  "验证详情",
24
24
  "PR 摘要同步"
25
25
  ],
26
- "required_patterns": [
27
- "^\\$ "
26
+ "state_check_patterns": [
27
+ "agent-infra-internal[ \\t]+task-snapshot\\b"
28
28
  ]
29
29
  },
30
30
  "activity-log": {
@@ -12,9 +12,7 @@ Read this file before creating `manual-validation.md` / `manual-validation-r{N}.
12
12
  ## State Check
13
13
 
14
14
  ```text
15
- $ git status -s
16
- $ ls -la .agents/workspace/active/{task-id}/
17
- $ tail .agents/workspace/active/{task-id}/task.md
15
+ agent-infra-internal task-snapshot {task-id} --format text
18
16
  ```
19
17
  > Follow `.agents/rules/evidence-reporting.md`: record task scope, key result, and uncovered parts; do not paste the complete directory listing or task tail for normal success.
20
18
 
@@ -12,9 +12,7 @@
12
12
  ## 状态核对
13
13
 
14
14
  ```text
15
- $ git status -s
16
- $ ls -la .agents/workspace/active/{task-id}/
17
- $ tail .agents/workspace/active/{task-id}/task.md
15
+ agent-infra-internal task-snapshot {task-id} --format text
18
16
  ```
19
17
  > 按 `.agents/rules/evidence-reporting.md` 记录任务范围、关键结果和未覆盖部分;正常成功不粘贴完整目录清单或 task tail。
20
18
 
@@ -9,7 +9,7 @@ description: >
9
9
  # Complete Task
10
10
  > `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
11
11
 
12
- Host finalization uses receipt v3 with an immutable `receiptId`, monotonic `revision`, staged summary input, and canonical warnings. Lifecycle/identity/required-PR hard failures return `result: failed|blocked`; after lifecycle succeeds, comment, peripheral verification, and other sync failures return `result: completed_with_warnings` and six-field warnings, retrying only receipt-pending steps.
12
+ Host finalization uses receipt v4 with an immutable `receiptId`, monotonic `revision`, staged summary input, and canonical warnings. Lifecycle/identity/required-PR hard failures return `result: failed|blocked`; after lifecycle succeeds, it retries only receipt-pending peripheral steps or open backfill warnings. Per-check verification warnings transition by observed target: a later observation resolves the prior code while retaining its history, and unobserved targets remain unchanged.
13
13
 
14
14
 
15
15
  ## Boundary / Critical Rules
@@ -176,7 +176,7 @@ If a summary must mirror a human-decided `post-review-commit` exemption, make a
176
176
  agent-infra-internal task-finalization {task-id} complete --agent {standard-agent-token}
177
177
  ```
178
178
 
179
- Finalization runs allowed artifact backfill -> lifecycle -> terminal task comment -> core verification -> warning task-comment update -> summary seal in a fixed order. Every backfill must reach a successful terminal result before lifecycle starts. Summary seal always reads the durable staging record retained in the task directory; the platform entry point validates marker, owner, and digest, performs any required delete/recreate, and reads back final remote order. Re-entry repeats this idempotent operation instead of recovering local input from a remote comment. `result=completed` means the host safely completed the task from structured results and the receipt; if peripheral warnings or pending steps remain, return `result=completed_with_warnings`, warnings, and pending steps. Use `result=failed` or `result=blocked` only for hard or receipt/capability failures, then fix the cause and retry through the same entry point; do not claim completion or hand-repair partial state. A sandbox must not run `ls completed` or a local terminal verification against its historical mount to re-decide this result.
179
+ Finalization runs allowed artifact backfill -> lifecycle -> terminal task comment -> core verification -> warning task-comment update -> summary seal in a fixed order. Every backfill that actually runs must reach a successful terminal result before lifecycle starts; an ordinary replay with a complete receipt and no recovery fact does not rerun backfill, comments, verification, or summary. A completed recovery that may write a managed comment first persists a done summary as pending, then seals it only at the end. Summary seal always reads the durable staging record retained in the task directory; the platform entry point validates marker, owner, and digest, performs any required delete/recreate, and reads back final remote order. `result=completed` means the host safely completed the task from structured results and the receipt; if peripheral warnings or pending steps remain, return `result=completed_with_warnings`, warnings, and pending steps. Use `result=failed` or `result=blocked` only for hard or receipt/capability failures, then fix the cause and retry through the same entry point; do not claim completion or hand-repair partial state. A sandbox must not run `ls completed` or a local terminal verification against its historical mount to re-decide this result.
180
180
 
181
181
  ### 7. Handle Finalization Retries and Results
182
182
 
@@ -9,7 +9,7 @@ description: >
9
9
  # 完成任务
10
10
  > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
11
11
 
12
- 宿主 finalization 使用 receipt v3(不可变 `receiptId`、单调 `revision`、摘要暂存和 canonical warnings)。生命周期/身份/required PR 等硬失败返回 `result: failed|blocked`;生命周期完成后,评论、外围验证和其他同步失败返回 `result: completed_with_warnings` 及六字段 warning,并仅重试 receipt 中的 pending step。
12
+ 宿主 finalization 使用 receipt v4(不可变 `receiptId`、单调 `revision`、摘要暂存和 canonical warnings)。生命周期/身份/required PR 等硬失败返回 `result: failed|blocked`;生命周期完成后,只重试 receipt 指出的 pending 外围步骤或 open backfill warning。逐检查 verification warning 以 observed target 为单位转换:新观察替代旧 code 时保留旧行 resolved 历史,未观察的 target 不变。
13
13
 
14
14
 
15
15
  ## 行为边界 / 关键规则
@@ -175,7 +175,7 @@ agent-infra-internal task-verify {task-id} complete-task.preflight --format text
175
175
  agent-infra-internal task-finalization {task-id} complete --agent {standard-agent-token}
176
176
  ```
177
177
 
178
- finalization 按允许的 artifact backfill → lifecycle → task 评论 → core verification → warning task 评论更新 → summary seal 的固定顺序执行。每项 backfill 必须取得成功终态,否则不得进入 lifecycle。summary seal 始终读取任务目录中保留的 durable staging record;平台入口负责校验 marker、owner 和 digest,必要时删除并重建摘要,再复读最终远端顺序。重入直接重复该幂等操作,不从远端评论反向恢复本地正文。`result=completed` 即表示宿主已依据结构化结果和 receipt 安全完成;若还有外围 warning 或 pending step,返回 `result=completed_with_warnings`、warnings 和 pending steps。`result=failed` 或 `result=blocked` 仅用于硬失败或 receipt/capability 失败,修复原因后以同一入口重试,不得宣称完成或手工补写局部状态。沙箱不得从旧挂载执行 `ls completed` 或本地终态校验来重新裁决该结果。
178
+ finalization 按允许的 artifact backfill → lifecycle → task 评论 → core verification → warning task 评论更新 → summary seal 的固定顺序执行。每项实际运行的 backfill 必须取得成功终态,否则不得进入 lifecycle;完整 receipt 且无恢复事实的普通重入不执行 backfill、评论、验证或 summary。任何可能写入 managed comment 的 completed 恢复会先把 done summary 持久化为 pending,恢复末尾才重新 seal。summary seal 始终读取任务目录中保留的 durable staging record;平台入口负责校验 marker、owner 和 digest,必要时删除并重建摘要,再复读最终远端顺序。`result=completed` 即表示宿主已依据结构化结果和 receipt 安全完成;若还有外围 warning 或 pending step,返回 `result=completed_with_warnings`、warnings 和 pending steps。`result=failed` 或 `result=blocked` 仅用于硬失败或 receipt/capability 失败,修复原因后以同一入口重试,不得宣称完成或手工补写局部状态。沙箱不得从旧挂载执行 `ls completed` 或本地终态校验来重新裁决该结果。
179
179
 
180
180
  ### 7. 处理 finalization 重试与结果
181
181
 
@@ -38,8 +38,8 @@
38
38
  "required_sections": [
39
39
  "State Check"
40
40
  ],
41
- "required_patterns": [
42
- "^\\$ "
41
+ "state_check_patterns": [
42
+ "agent-infra-internal[ \\t]+task-snapshot\\b"
43
43
  ]
44
44
  }
45
45
  }
@@ -38,8 +38,8 @@
38
38
  "required_sections": [
39
39
  "状态核对"
40
40
  ],
41
- "required_patterns": [
42
- "^\\$ "
41
+ "state_check_patterns": [
42
+ "agent-infra-internal[ \\t]+task-snapshot\\b"
43
43
  ]
44
44
  }
45
45
  }
@@ -13,13 +13,17 @@ If the entry operands contain `--orchestrated`, bind `{execution-flag}` to `--or
13
13
 
14
14
  ## Boundary / Critical Rules
15
15
 
16
+ ### Path and rework
17
+
18
+ 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.
19
+
16
20
  ### Persisted Report Evidence
17
21
 
18
22
  Before generating the plan report, read `.agents/rules/evidence-reporting.md`. Record the command, target scope, status or structured result, actual result, and uncovered parts for state checks and verification; include decisive raw excerpts only for failures, blocking conditions, or disputes.
19
23
 
20
24
  - When evaluating candidate qualification or `HD-N`, read `.agents/rules/decision-qualification.md`, audit normalized task constraints/candidates, and record the five qualification-audit tables in the plan artifact; unknown or unconfirmed constraints must not automatically exclude a candidate
21
25
  - This skill only outputs a technical plan document (`plan.md` or `plan-r{N}.md`) and does not modify any business code
22
- - This is a **mandatory human review checkpoint**; do not automatically proceed to implementation
26
+ - The full path proceeds to plan review; the standard path may proceed directly to implementation
23
27
  - Before generating task or lifecycle Markdown that will be synchronized to an Issue, read `.agents/rules/sync-content-generation.md` and apply its producer-side constraints; the sync path does not parse or rewrite the body
24
28
  - When the plan touches compatibility, migration, old formats, or old entry points, read `.agents/rules/compatibility-policy.md` first. Do not design adapters, shims, dual writes, or parallel state machines without passing its admission gate
25
29
  - After executing this skill, you **must** immediately update task status in task.md
@@ -62,7 +66,7 @@ If any required file is missing, prompt the user to complete the prerequisite st
62
66
 
63
67
  ### 2. Resolve the Artifact Context
64
68
 
65
- Run `agent-infra-internal task-artifact {task-id} inspect --family plan`. Continue only for `ready`; take the latest `{analysis-artifact}` from `inputs` and `{plan-round}` / `{plan-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.
69
+ Run `agent-infra-internal task-artifact {task-id} inspect --family 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 the latest `{analysis-artifact}` from `inputs` and `{plan-round}` / `{plan-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.
66
70
 
67
71
  ### 3. Read Requirements Analysis
68
72
 
@@ -169,7 +173,9 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
169
173
  > Before rendering next steps, read `.agents/rules/next-step-output.md`, invoke the shared helper only for the selected scenario, and insert its stdout at `{next-step-commands}`.
170
174
 
171
175
  Output format:
172
- Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill review-plan --task-ref {task-ref}`.
176
+ Select one command from the canonical path to populate `{next-step-commands}`:
177
+ - Standard: `agent-infra-internal agent-client next-steps --skill code-task --task-ref {task-ref}`
178
+ - Full: `agent-infra-internal agent-client next-steps --skill review-plan --task-ref {task-ref}`
173
179
 
174
180
  ```
175
181
  Technical plan complete for task {task-id}.
@@ -184,10 +190,7 @@ Plan summary:
184
190
  Output file:
185
191
  - Technical plan: .agents/workspace/active/{task-id}/{plan-artifact}
186
192
 
187
- Important: human review checkpoint.
188
- Please review the technical plan before continuing to implementation.
189
-
190
- Next step - review the technical plan:
193
+ Next step - continue on the selected path:
191
194
  {next-step-commands}
192
195
  ```
193
196
 
@@ -201,18 +204,18 @@ Next step - review the technical plan:
201
204
  - [ ] Recorded `{plan-artifact}` as a completed artifact in task.md
202
205
  - [ ] Marked technical-design as complete in workflow progress
203
206
  - [ ] Appended an Activity Log entry to task.md
204
- - [ ] Informed the user that this is a human review checkpoint
207
+ - [ ] Selected code implementation or plan review from the canonical path
205
208
  - [ ] Rendered the selected next-step commands through the shared helper
206
209
 
207
210
  ## STOP
208
211
 
209
212
  After completing the checklist, **stop immediately**.
210
- This is a **mandatory human review checkpoint**; the user must review and approve the plan before implementation can continue.
213
+ The full path proceeds to plan review here; the standard path proceeds directly to code implementation.
211
214
 
212
215
  ## Notes
213
216
 
214
217
  1. **Prerequisite**: at least one round of requirements analysis must already be complete (`analysis.md` or `analysis-r{N}.md` exists)
215
- 2. **Human review**: this is a mandatory checkpoint; do not automatically proceed to implementation
218
+ 2. **Next stage**: standard proceeds to code implementation; full proceeds to plan review
216
219
  3. **Plan quality**: the plan should be detailed enough that another AI agent can implement it without extra context
217
220
  4. **Versioning rule**: the first plan uses `plan.md`; later revisions use `plan-r{N}.md`
218
221
 
@@ -13,6 +13,10 @@ description: >
13
13
 
14
14
  ## 行为边界 / 关键规则
15
15
 
16
+ ### 路径与返工
17
+
18
+ 本阶段只消费核心从最新有效分析产物解析出的规范路径事实;未被所选路径包含的阶段不得创建产物。同阶段完成一次修订—复审后再次收到 Changes Requested 时,必须在下一执行产物前提交绑定 finding、来源 SHA 和稳定任务事实摘要的返工分类;轮次或文件名变化不是新证据。
19
+
16
20
  ### 持久化报告证据
17
21
 
18
22
  生成方案报告时,先读取 `.agents/rules/evidence-reporting.md`。状态核对和验证记录命令、目标范围、状态/结构化结果、实际结果和未覆盖部分;失败、阻塞或争议才附决定性原文摘录。
@@ -20,7 +24,7 @@ description: >
20
24
  - 涉及候选资格或 `HD-N` 判断时,先读取 `.agents/rules/decision-qualification.md`,基于 task.md 规范化约束/候选完成资格审计,并在方案产物记录五张资格审计表;不得把来源不明或未确认约束自动升级为排除条件
21
25
  - 本技能仅产出技术方案文档(`plan.md` 或 `plan-r{N}.md`)—— 不修改任何业务代码
22
26
  - 生成会同步到 Issue 的任务或生命周期 Markdown 前,先读取 `.agents/rules/sync-content-generation.md` 并遵循其中的生成端约束;同步端不解析或改写正文
23
- - 这是一个**强制性的人工审查检查点** —— 不要自动进入实现阶段
27
+ - 完整路径进入方案审查;标准路径完成方案后可直接进入实现阶段
24
28
  - 方案涉及兼容、迁移、旧格式或旧入口时,先读取 `.agents/rules/compatibility-policy.md`;未通过准入门槛时不得设计 adapter、shim、双写或并行状态机
25
29
  - 执行本技能后,你**必须**立即更新 task.md 中的任务状态
26
30
 
@@ -65,7 +69,7 @@ agent-infra-internal task-event {task-id} plan.started --agent {standard-agent-t
65
69
 
66
70
  ### 2. 解析方案上下文
67
71
 
68
- 运行 `agent-infra-internal task-artifact {task-id} inspect --family plan`。仅当结果为 `ready` 时继续;从 `inputs` 取得最新 `{analysis-artifact}`,从 `next.round` / `next.name` 取得 `{plan-round}` / `{plan-artifact}`。不得自行扫描轮次或拼装文件名。随后执行 started 事件并复核返回身份。
72
+ 运行 `agent-infra-internal task-artifact {task-id} inspect --family plan`。仅当结果为 `ready` 时继续。若 `selection.disposition` 为 `reuse`,复用 `selection.artifact`,不得执行 started、init 或写入新产物,并直接进入完成校验与下一步提示。其他状态从 `inputs` 取得最新 `{analysis-artifact}`,从 `next.round` / `next.name` 取得 `{plan-round}` / `{plan-artifact}`;不得自行扫描轮次或拼装文件名。随后执行 started 事件并复核返回身份。
69
73
 
70
74
  ### 3. 阅读需求分析
71
75
 
@@ -165,7 +169,9 @@ agent-infra-internal task-verify {task-id} plan.completed --artifact {plan-artif
165
169
  > 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
166
170
 
167
171
  输出格式:
168
- 使用 `agent-infra-internal agent-client next-steps --skill review-plan --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
172
+ 按分析中的规范路径选择一条命令生成 `{next-step-commands}`:
173
+ - 标准路径:`agent-infra-internal agent-client next-steps --skill code-task --task-ref {task-ref}`
174
+ - 完整路径:`agent-infra-internal agent-client next-steps --skill review-plan --task-ref {task-ref}`
169
175
 
170
176
  ```
171
177
  任务 {task-id} 技术方案完成。
@@ -180,10 +186,7 @@ agent-infra-internal task-verify {task-id} plan.completed --artifact {plan-artif
180
186
  产出文件:
181
187
  - 技术方案:.agents/workspace/active/{task-id}/{plan-artifact}
182
188
 
183
- 重要:人工审查检查点。
184
- 请在继续实现之前审查技术方案。
185
-
186
- 下一步 - 审查技术方案:
189
+ 下一步 - 按所选路径继续:
187
190
  {next-step-commands}
188
191
  ```
189
192
 
@@ -197,18 +200,18 @@ agent-infra-internal task-verify {task-id} plan.completed --artifact {plan-artif
197
200
  - [ ] 在 task.md 中记录了 `{plan-artifact}` 为已完成产物
198
201
  - [ ] 在工作流进度中标记了 technical-design 为已完成
199
202
  - [ ] 追加了 Activity Log 条目到 task.md
200
- - [ ] 告知了用户这是人工审查检查点
203
+ - [ ] 已按所选路径选择代码实现或方案审查
201
204
  - [ ] 已通过统一 helper 渲染已选场景的下一步命令
202
205
 
203
206
  ## 停止
204
207
 
205
208
  完成检查清单后,**立即停止**。
206
- 这是一个**强制性的人工审查检查点** —— 用户必须审查并批准计划后才能继续实现。
209
+ 完整路径在此进入方案审查;标准路径直接进入代码实现。
207
210
 
208
211
  ## 注意事项
209
212
 
210
213
  1. **前置条件**:必须已完成至少一轮需求分析(`analysis.md` 或 `analysis-r{N}.md` 存在)
211
- 2. **人工审查**:这是强制性检查点 —— 不要自动进入实现阶段
214
+ 2. **后续阶段**:标准路径进入代码实现,完整路径进入方案审查
212
215
  3. **计划质量**:计划应足够具体,使另一个 AI 代理无需额外上下文即可实现
213
216
  4. **版本化规则**:首轮方案使用 `plan.md`;后续修订使用 `plan-r{N}.md`
214
217
 
@@ -15,6 +15,10 @@ Review the latest analysis artifact and produce `review-analysis.md` or `review-
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 analysis artifact: `analysis.md` or `analysis
54
58
 
55
59
  ### 2. Resolve Review Context
56
60
 
57
- Run `agent-infra-internal task-artifact {task-id} inspect --family review-analysis`. Continue only for `ready`; take `{analysis-artifact}` from `inputs` and `{review-round}` / `{review-artifact}` from `next.round` / `next.name`. Do not scan rounds or construct names in the skill.
61
+ Run `agent-infra-internal task-artifact {task-id} inspect --family review-analysis`. 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 `{analysis-artifact}` from `inputs` and `{review-round}` / `{review-artifact}` from `next.round` / `next.name`. Do not scan rounds or construct names in the skill.
58
62
 
59
63
  ### 3. Read Analysis 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-analysis`。仅当结果为 `ready` 时继续;从 `inputs` 取得 `{analysis-artifact}`,从 `next.round` / `next.name` 取得 `{review-round}` / `{review-artifact}`。不得自行扫描轮次或拼装文件名。随后执行 started 事件并复核返回身份。
64
+ 运行 `agent-infra-internal task-artifact {task-id} inspect --family review-analysis`。仅当结果为 `ready` 时继续。若 `selection.disposition` 为 `reuse`,复用 `selection.artifact`,不得执行 started、init 或写入新产物,并直接进入完成校验与下一步提示。其他状态从 `inputs` 取得 `{analysis-artifact}`,从 `next.round` / `next.name` 取得 `{review-round}` / `{review-artifact}`;不得自行扫描轮次或拼装文件名。随后执行 started 事件并复核返回身份。
61
65
 
62
66
  ### 3. 阅读分析上下文
63
67
 
@@ -147,16 +147,16 @@ Use this template when writing `review-analysis.md` or `review-analysis-r{N}.md`
147
147
 
148
148
  ## State Check
149
149
 
150
- > Record the state-check command, review scope, key result, and uncovered parts; each command starts with `$ `.
150
+ > Record the state-check command, review scope, key result, and uncovered parts.
151
151
  > Follow `.agents/rules/evidence-reporting.md`: record review scope, key result, and uncovered parts; do not paste complete successful stdout.
152
152
 
153
153
  ## Raw Evidence
154
154
 
155
- > 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.
155
+ > 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.
156
156
 
157
157
  - Claim: {verified claim}
158
158
  ```text
159
- $ {command}
159
+ {command}
160
160
  {result summary or decisive excerpt}
161
161
  ```
162
162