@fitlab-ai/agent-infra 0.11.0 → 0.11.2

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 (146) hide show
  1. package/dist/lib/internal/cli-route-inventory.js +1 -1
  2. package/dist/lib/internal/manual-validation.js +6 -2
  3. package/dist/lib/internal/platform-comment.js +59 -0
  4. package/dist/lib/internal/sandbox-control.js +4 -131
  5. package/dist/lib/internal/task-artifact.js +1 -1
  6. package/dist/lib/internal/task-operation-registry.js +1 -0
  7. package/dist/lib/internal/task-review.js +5 -5
  8. package/dist/lib/internal/task-validate.js +0 -6
  9. package/dist/lib/platform/comment-safety.js +7 -1
  10. package/dist/lib/platform/github-provider.js +13 -3
  11. package/dist/lib/platform/issue-comments.js +120 -13
  12. package/dist/lib/platform/issues.js +3 -4
  13. package/dist/lib/platform/provider-contract.d.ts +2 -0
  14. package/dist/lib/platform/provider-validation.js +7 -2
  15. package/dist/lib/platform/verification-sync.js +161 -156
  16. package/dist/lib/sandbox/control/executor.js +0 -38
  17. package/dist/lib/sandbox/control/finalization-response.js +10 -2
  18. package/dist/lib/sandbox/control/task-view.js +3 -1
  19. package/dist/lib/sandbox/control/workflow-executor.js +32 -41
  20. package/dist/lib/task/artifact-command.js +6 -6
  21. package/dist/lib/task/artifact-lifecycle.js +15 -52
  22. package/dist/lib/task/artifact-operations.js +27 -1
  23. package/dist/lib/task/capabilities.js +0 -2
  24. package/dist/lib/task/codex-orchestration.js +10 -208
  25. package/dist/lib/task/commit-operation.js +3 -18
  26. package/dist/lib/task/control-authority.js +1 -8
  27. package/dist/lib/task/delegation-receipts.js +14 -76
  28. package/dist/lib/task/events.js +147 -278
  29. package/dist/lib/task/finalization-state.js +2 -1
  30. package/dist/lib/task/finalization.js +273 -49
  31. package/dist/lib/task/gate-policy.js +94 -0
  32. package/dist/lib/task/lifecycle-execution.js +2 -11
  33. package/dist/lib/task/local-artifact-finalization.js +31 -245
  34. package/dist/lib/task/orchestration.js +8 -24
  35. package/dist/lib/task/review-artifacts.js +12 -6
  36. package/dist/lib/task/review-command.js +0 -1
  37. package/dist/lib/task/review-finalization.js +47 -218
  38. package/dist/lib/task/verification-engine.js +28 -17
  39. package/dist/lib/task/verification.js +25 -9
  40. package/dist/lib/task/workflow-command.js +4 -1
  41. package/dist/lib/task/workflow-dispatch.js +55 -3
  42. package/dist/lifecycle-build-manifest.json +3 -3
  43. package/lib/internal/cli-route-inventory.ts +1 -1
  44. package/lib/internal/manual-validation.ts +6 -2
  45. package/lib/internal/platform-comment.ts +38 -0
  46. package/lib/internal/sandbox-control.ts +3 -145
  47. package/lib/internal/task-artifact.ts +1 -1
  48. package/lib/internal/task-operation-registry.ts +1 -0
  49. package/lib/internal/task-review.ts +5 -5
  50. package/lib/internal/task-validate.ts +0 -5
  51. package/lib/platform/comment-safety.ts +8 -0
  52. package/lib/platform/github-provider.ts +11 -2
  53. package/lib/platform/issue-comments.ts +132 -13
  54. package/lib/platform/issues.ts +3 -4
  55. package/lib/platform/provider-contract.ts +2 -0
  56. package/lib/platform/provider-validation.ts +6 -2
  57. package/lib/platform/verification-sync.ts +178 -179
  58. package/lib/sandbox/control/executor.ts +0 -44
  59. package/lib/sandbox/control/finalization-response.ts +10 -2
  60. package/lib/sandbox/control/task-view.ts +3 -1
  61. package/lib/sandbox/control/workflow-executor.ts +31 -48
  62. package/lib/task/artifact-command.ts +6 -7
  63. package/lib/task/artifact-lifecycle.ts +12 -49
  64. package/lib/task/artifact-operations.ts +27 -1
  65. package/lib/task/capabilities.ts +0 -1
  66. package/lib/task/codex-orchestration.ts +8 -241
  67. package/lib/task/commit-operation.ts +3 -23
  68. package/lib/task/control-authority.ts +1 -8
  69. package/lib/task/delegation-receipts.ts +12 -79
  70. package/lib/task/events.ts +155 -287
  71. package/lib/task/finalization-state.ts +2 -1
  72. package/lib/task/finalization.ts +277 -57
  73. package/lib/task/gate-policy.ts +133 -0
  74. package/lib/task/lifecycle-execution.ts +10 -21
  75. package/lib/task/local-artifact-finalization.ts +29 -285
  76. package/lib/task/orchestration.ts +12 -41
  77. package/lib/task/review-artifacts.ts +8 -2
  78. package/lib/task/review-command.ts +0 -1
  79. package/lib/task/review-finalization.ts +46 -200
  80. package/lib/task/verification-engine.ts +24 -14
  81. package/lib/task/verification-types.ts +7 -0
  82. package/lib/task/verification.ts +25 -9
  83. package/lib/task/workflow-command.ts +4 -1
  84. package/lib/task/workflow-dispatch.ts +46 -3
  85. package/package.json +2 -2
  86. package/templates/.agents/rules/issue-sync.en.md +2 -0
  87. package/templates/.agents/rules/issue-sync.zh-CN.md +5 -8
  88. package/templates/.agents/rules/lifecycle-orchestration.en.md +7 -7
  89. package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +7 -7
  90. package/templates/.agents/rules/local-artifact-repair.en.md +14 -52
  91. package/templates/.agents/rules/local-artifact-repair.zh-CN.md +13 -52
  92. package/templates/.agents/skills/analyze-task/SKILL.en.md +3 -3
  93. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +3 -3
  94. package/templates/.agents/skills/analyze-task/config/verify.en.json +1 -10
  95. package/templates/.agents/skills/analyze-task/config/verify.zh-CN.json +1 -10
  96. package/templates/.agents/skills/block-task/config/verify.json +1 -3
  97. package/templates/.agents/skills/cancel-task/config/verify.json +1 -4
  98. package/templates/.agents/skills/code-task/SKILL.en.md +3 -3
  99. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +3 -3
  100. package/templates/.agents/skills/code-task/config/verify.en.json +1 -12
  101. package/templates/.agents/skills/code-task/config/verify.zh-CN.json +1 -12
  102. package/templates/.agents/skills/code-task/reference/dual-mode.en.md +1 -1
  103. package/templates/.agents/skills/code-task/reference/dual-mode.zh-CN.md +1 -1
  104. package/templates/.agents/skills/code-task/reference/report-template.en.md +11 -0
  105. package/templates/.agents/skills/code-task/reference/report-template.zh-CN.md +11 -0
  106. package/templates/.agents/skills/commit/config/verify.json +1 -5
  107. package/templates/.agents/skills/complete-manual-validation/config/verify.en.json +6 -6
  108. package/templates/.agents/skills/complete-manual-validation/config/verify.zh-CN.json +6 -6
  109. package/templates/.agents/skills/complete-task/SKILL.en.md +3 -3
  110. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +3 -3
  111. package/templates/.agents/skills/complete-task/config/verify.en.json +3 -14
  112. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +3 -14
  113. package/templates/.agents/skills/create-pr/config/verify.json +1 -10
  114. package/templates/.agents/skills/create-task/config/verify.json +1 -4
  115. package/templates/.agents/skills/import-issue/config/verify.json +1 -2
  116. package/templates/.agents/skills/plan-task/SKILL.en.md +3 -3
  117. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +3 -3
  118. package/templates/.agents/skills/plan-task/config/verify.en.json +1 -10
  119. package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +1 -10
  120. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +4 -4
  121. package/templates/.agents/skills/review-analysis/SKILL.en.md +2 -2
  122. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +2 -2
  123. package/templates/.agents/skills/review-analysis/config/verify.en.json +1 -10
  124. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +1 -10
  125. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +2 -0
  126. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +2 -0
  127. package/templates/.agents/skills/review-code/SKILL.en.md +3 -3
  128. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +3 -3
  129. package/templates/.agents/skills/review-code/config/verify.en.json +1 -10
  130. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -10
  131. package/templates/.agents/skills/review-code/reference/report-template.en.md +2 -0
  132. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +2 -0
  133. package/templates/.agents/skills/review-plan/SKILL.en.md +2 -2
  134. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +2 -2
  135. package/templates/.agents/skills/review-plan/config/verify.en.json +1 -10
  136. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +1 -10
  137. package/templates/.agents/skills/review-plan/reference/report-template.en.md +2 -0
  138. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +2 -0
  139. package/templates/.agents/skills/review-pr/config/verify.en.json +1 -8
  140. package/templates/.agents/skills/review-pr/config/verify.zh-CN.json +1 -8
  141. package/templates/.agents/skills/run-manual-validation/config/verify.en.json +38 -13
  142. package/templates/.agents/skills/run-manual-validation/config/verify.zh-CN.json +38 -13
  143. package/templates/.agents/skills/run-task/SKILL.en.md +6 -6
  144. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +6 -6
  145. package/templates/.agents/skills/run-task/reference/host-validation.en.md +2 -2
  146. package/templates/.agents/skills/run-task/reference/host-validation.zh-CN.md +2 -2
@@ -31,17 +31,17 @@
31
31
  "expected_action_pattern": "Complete Manual Validation"
32
32
  },
33
33
  "review-ledger": {
34
- "stage_scope": ["analysis", "plan", "code"]
34
+ "stage_scope": [
35
+ "analysis",
36
+ "plan",
37
+ "code"
38
+ ]
35
39
  },
36
40
  "platform-sync": {
37
41
  "when": "pr_fact_bound",
38
- "expected_pr_comment_marker_key": "prSummary",
39
42
  "expected_pr_comment_required_patterns": [
40
43
  "^### ✅ (?:人工验证已通过|Manual Validation Passed)$"
41
- ],
42
- "verify_task_comment_content": true,
43
- "verify_issue_type": true,
44
- "verify_issue_fields": false
44
+ ]
45
45
  }
46
46
  }
47
47
  }
@@ -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 v2 with an immutable `receiptId`, monotonic `revision`, 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 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.
13
13
 
14
14
 
15
15
  ## Boundary / Critical Rules
@@ -143,7 +143,7 @@ When a valid `platform_issue_identity` exists, execute in this exact order:
143
143
 
144
144
  1. Run `agent-infra-internal platform-comment backfill {task-id} --agent {standard-agent-token}` so core publishes only the completion canonical inventory in fixed order and resolves matching historical warnings only after full success.
145
145
  2. Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --requirements --fields`.
146
- 3. Write the business summary to a temporary file and run `agent-infra-internal platform-comment sync {task-id} --kind summary --body-file {path} --agent {standard-agent-token}`.
146
+ 3. 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.
147
147
 
148
148
  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.
149
149
 
@@ -177,7 +177,7 @@ If a summary must mirror a human-decided `post-review-commit` exemption, make a
177
177
  agent-infra-internal task-finalization {task-id} complete --agent {standard-agent-token}
178
178
  ```
179
179
 
180
- Finalization runs lifecycle -> the terminal task comment -> the `complete-task.completed` gate in a fixed order and records each step in the host receipt. `result=completed` means the host safely completed the task from structured results and the receipt; if peripheral warnings 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
+ Finalization runs lifecycle -> terminal task comment -> core verification -> warning task-comment update -> summary -> post-summary verification in a fixed order and records every step in the host receipt. It clears the staging record only after all steps finish with no open warning. `result=completed` means the host safely completed the task from structured results and the receipt; if peripheral warnings 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.
181
181
 
182
182
  ### 7. Handle Finalization Retries and Results
183
183
 
@@ -9,7 +9,7 @@ description: >
9
9
  # 完成任务
10
10
  > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
11
11
 
12
- 宿主 finalization 使用 receipt v2(不可变 `receiptId`、单调 `revision` 和 canonical warnings)。生命周期/身份/required PR 等硬失败返回 `result: failed|blocked`;生命周期完成后,评论、外围验证和其他同步失败返回 `result: completed_with_warnings` 及六字段 warning,并仅重试 receipt 中的 pending step。
12
+ 宿主 finalization 使用 receipt v3(不可变 `receiptId`、单调 `revision`、摘要暂存和 canonical warnings)。生命周期/身份/required PR 等硬失败返回 `result: failed|blocked`;生命周期完成后,评论、外围验证和其他同步失败返回 `result: completed_with_warnings` 及六字段 warning,并仅重试 receipt 中的 pending step。
13
13
 
14
14
 
15
15
  ## 行为边界 / 关键规则
@@ -142,7 +142,7 @@ Please satisfy the hard prerequisite first, then retry complete-task.
142
142
 
143
143
  1. 调用 `agent-infra-internal platform-comment backfill {task-id} --agent {standard-agent-token}`,由 core 仅按 completion canonical inventory 固定顺序补发产物并在全部成功后精确恢复目标历史告警。
144
144
  2. 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --requirements --fields`。
145
- 3. 把业务摘要写入临时文件,并调用 `agent-infra-internal platform-comment sync {task-id} --kind summary --body-file {path} --agent {standard-agent-token}`。
145
+ 3. 把业务摘要写入临时文件,并调用 `agent-infra-internal platform-comment stage-summary {task-id} --body-file {path}`。该命令把正文和 SHA-256 写入 task 目录的 durable staging record;本步骤不得直接发布 summary 评论。
146
146
 
147
147
  若账本含合法的 `PRC-N` post-review 豁免,摘要正文必须镜像 task.md 中的裁决理由、提交范围、人工身份与时间,并明确这是人工覆盖而非自动校验成功。已有匹配 workflow warning 时,同时镜像其原始 failure code/message;尚无 warning 时只写“裁决已记录、最终门禁待验证”,不得提前宣称豁免已通过。summary marker 仍由同一 `--kind summary` intent 唯一维护。
148
148
 
@@ -176,7 +176,7 @@ agent-infra-internal task-verify {task-id} complete-task.preflight --format text
176
176
  agent-infra-internal task-finalization {task-id} complete --agent {standard-agent-token}
177
177
  ```
178
178
 
179
- finalization 按 lifecycle → task 评论 → `complete-task.completed` 校验的固定顺序执行,并将每一步的状态写入宿主 receipt。`result=completed` 即表示宿主已依据结构化结果和 receipt 安全完成;若还有外围 warning,返回 `result=completed_with_warnings`、warnings 和 pending steps。`result=failed` 或 `result=blocked` 仅用于硬失败或 receipt/capability 失败,修复原因后以同一入口重试,不得宣称完成或手工补写局部状态。沙箱不得从旧挂载执行 `ls completed` 或本地终态校验来重新裁决该结果。
179
+ finalization 按 lifecycle → task 评论 → core verification → warning task 评论更新 → summary → post-summary verification 的固定顺序执行,并将每一步的状态写入宿主 receipt。summary 使用暂存正文;仅在所有步骤完成且无未解决 warning 后清理 staging record。`result=completed` 即表示宿主已依据结构化结果和 receipt 安全完成;若还有外围 warning,返回 `result=completed_with_warnings`、warnings 和 pending steps。`result=failed` 或 `result=blocked` 仅用于硬失败或 receipt/capability 失败,修复原因后以同一入口重试,不得宣称完成或手工补写局部状态。沙箱不得从旧挂载执行 `ls completed` 或本地终态校验来重新裁决该结果。
180
180
 
181
181
  ### 7. 处理 finalization 重试与结果
182
182
 
@@ -15,8 +15,7 @@
15
15
  "completed_at"
16
16
  ],
17
17
  "expected_status": "completed",
18
- "require_completed_at": true,
19
- "require_target_date": true
18
+ "require_completed_at": true
20
19
  },
21
20
  "activity-log": {
22
21
  "expected_action_pattern": "(Complete Task|Completed)"
@@ -28,21 +27,11 @@
28
27
  "manual-validation": {},
29
28
  "post-review-commit": {},
30
29
  "platform-sync-preflight": {
31
- "when": "platform_issue_identity_exists",
32
- "expected_comment_marker": "<!-- sync-issue:{task-id}:summary -->",
33
- "verify_task_comment_content": false,
34
- "sync_checked_requirements": true,
35
- "verify_issue_type": true,
36
- "verify_issue_fields": false,
37
- "verify_milestone": true,
38
- "verify_closed_issue_has_no_status_labels": false,
39
- "expected_comment_marker_key": "summary"
30
+ "when": "platform_issue_identity_exists"
40
31
  },
41
32
  "required-pr-delivery": {},
42
33
  "platform-sync": {
43
- "when": "platform_issue_identity_exists",
44
- "verify_task_comment_content": true,
45
- "verify_closed_issue_has_no_status_labels": true
34
+ "when": "platform_issue_identity_exists"
46
35
  },
47
36
  "artifact": {
48
37
  "file_pattern": "task.md",
@@ -15,8 +15,7 @@
15
15
  "completed_at"
16
16
  ],
17
17
  "expected_status": "completed",
18
- "require_completed_at": true,
19
- "require_target_date": true
18
+ "require_completed_at": true
20
19
  },
21
20
  "activity-log": {
22
21
  "expected_action_pattern": "(Complete Task|Completed)"
@@ -28,21 +27,11 @@
28
27
  "manual-validation": {},
29
28
  "post-review-commit": {},
30
29
  "platform-sync-preflight": {
31
- "when": "platform_issue_identity_exists",
32
- "expected_comment_marker": "<!-- sync-issue:{task-id}:summary -->",
33
- "verify_task_comment_content": false,
34
- "sync_checked_requirements": true,
35
- "verify_issue_type": true,
36
- "verify_issue_fields": false,
37
- "verify_milestone": true,
38
- "verify_closed_issue_has_no_status_labels": false,
39
- "expected_comment_marker_key": "summary"
30
+ "when": "platform_issue_identity_exists"
40
31
  },
41
32
  "required-pr-delivery": {},
42
33
  "platform-sync": {
43
- "when": "platform_issue_identity_exists",
44
- "verify_task_comment_content": true,
45
- "verify_closed_issue_has_no_status_labels": true
34
+ "when": "platform_issue_identity_exists"
46
35
  },
47
36
  "artifact": {
48
37
  "file_pattern": "task.md",
@@ -18,16 +18,7 @@
18
18
  "expected_action_pattern": "(Create PR|PR Created)"
19
19
  },
20
20
  "platform-sync": {
21
- "when": "platform_issue_identity_exists",
22
- "expected_pr_comment_marker": "<!-- sync-pr:{task-id}:summary -->",
23
- "verify_in_labels_match_pr": true,
24
- "verify_in_labels_computed": true,
25
- "verify_pr_type_label": true,
26
- "verify_pr_assignee": true,
27
- "verify_issue_fields": true,
28
- "verify_milestone": true,
29
- "verify_milestone_specific": true,
30
- "expected_pr_comment_marker_key": "prSummary"
21
+ "when": "platform_issue_identity_exists"
31
22
  }
32
23
  }
33
24
  }
@@ -22,10 +22,7 @@
22
22
  },
23
23
  "platform-sync": {
24
24
  "when": "platform_issue_identity_exists",
25
- "issue_must_exist": true,
26
- "verify_task_comment_content": true,
27
- "verify_milestone": true,
28
- "expected_status_label_key": "waitingForTriage"
25
+ "issue_must_exist": true
29
26
  }
30
27
  }
31
28
  }
@@ -22,8 +22,7 @@
22
22
  },
23
23
  "platform-sync": {
24
24
  "when": "platform_issue_identity_exists",
25
- "issue_must_exist": true,
26
- "verify_task_comment_content": true
25
+ "issue_must_exist": true
27
26
  }
28
27
  }
29
28
  }
@@ -114,7 +114,7 @@ Before writing this round's `{plan-artifact}`, create the controlled report skel
114
114
  agent-infra-internal task-artifact {task-id} init --family plan --artifact {plan-artifact} --locale en
115
115
  ```
116
116
 
117
- The skeleton contains identity metadata, stable section markers, and required headings only; real plan content is required before the completion gate can pass. If the finalizer returns one provably safe structural error, it returns a controlled recovery candidate; edit only its `candidatePath`, then rerun `task-artifact {task-id} finalize-local --family plan --artifact {plan-artifact} --recovery-id {recovery-id}` with the same `recoveryId`. Candidate-only is a protocol authorization boundary, not OS isolation; arbitrary same-UID host writers are outside the protocol's protection claim, and fingerprint/state checks fail closed on anomalies.
117
+ The skeleton contains identity metadata, stable section markers, and required headings only; real plan content is required before the completion gate can pass. On a structural error, correct the formal artifact directly and rerun `task-artifact {task-id} finalize-local --family plan --artifact {plan-artifact}`; current structure, qualification, and summary facts are the only gate.
118
118
 
119
119
  Create `.agents/workspace/active/{task-id}/{plan-artifact}`.
120
120
 
@@ -135,8 +135,8 @@ agent-infra-internal task-artifact {task-id} finalize-local --family plan --arti
135
135
  ```
136
136
 
137
137
  - On `status=passed`, save that result's `artifactSha256` and `semanticDigest`; the finalizer has recorded the matching one-shot local provenance intent.
138
- - On `status=failed` with recovery context, edit only the returned `candidatePath` once after the completion gates pass, then rerun the finalizer completely with the same `recoveryId`; the formal artifact must remain unchanged until commit.
139
- - The recovery candidate must match the recorded task, round, artifact, baseline, and request identity. On baseline conflict, unknown state, no progress, or repeated failure, stop without publishing a completed event.
138
+ - On `status=failed`, correct the formal artifact directly and rerun the finalizer completely; if the current diagnostic remains unresolved, continue to the next attempt.
139
+ - On an external formal-artifact change, an unsafe repair, repeated diagnostics or fingerprints, no progress, or the shared edit limit, stop without publishing a completed event.
140
140
 
141
141
  Use the digests from that same `status=passed` result in `agent-infra-internal task-event {task-id} plan.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {plan-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} {execution-flag}` so the core records the link, stage, agent, metadata, and Activity Log atomically.
142
142
  - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Plan Task (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
@@ -117,7 +117,7 @@ agent-infra-internal task-event {task-id} plan.started --agent {standard-agent-t
117
117
  agent-infra-internal task-artifact {task-id} init --family plan --artifact {plan-artifact}
118
118
  ```
119
119
 
120
- 骨架只包含身份元数据、稳定 section marker 和必需标题;必须填入真实方案内容后才能通过完成门禁。finalizer 返回可证明的单个结构错误时,会返回受控 recovery candidate;只能编辑返回的 `candidatePath`,然后使用同一个 `recoveryId` 重跑 `task-artifact {task-id} finalize-local --family plan --artifact {plan-artifact} --recovery-id {recovery-id}`。candidate-only 是协议授权边界,不是操作系统隔离;同 UID 的任意宿主写入者不在本协议的防护承诺内,异常由指纹/状态校验失败关闭。
120
+ 骨架只包含身份元数据、稳定 section marker 和必需标题;必须填入真实方案内容后才能通过完成门禁。finalizer 返回结构错误时,直接修正正式产物后重跑 `task-artifact {task-id} finalize-local --family plan --artifact {plan-artifact}`;当前结构、资格和摘要事实是唯一门禁。
121
121
 
122
122
  创建 `.agents/workspace/active/{task-id}/{plan-artifact}`。
123
123
 
@@ -134,8 +134,8 @@ agent-infra-internal task-artifact {task-id} init --family plan --artifact {plan
134
134
  agent-infra-internal task-artifact {task-id} finalize-local --family plan --artifact {plan-artifact}
135
135
  ```
136
136
  - `status=passed`:保存本次返回的 `artifactSha256` 和 `semanticDigest`;finalizer 已记录对应的一次性本地 provenance intent。
137
- - `status=failed` 且返回 recovery context:完成门禁通过后,只编辑返回的 `candidatePath` 一次,然后使用同一个 `recoveryId` 完整重跑 finalizer;formal artifact 在 commit 前必须保持不变。
138
- - recovery candidate 必须与记录的任务、轮次、产物、baseline 和 request identity 匹配;基线冲突、未知状态、无进展或重复失败:停止,不发布 completed 事件。
137
+ - `status=failed`:直接修正正式产物并完整重跑 finalizer;若仍失败且诊断未解决,继续下一轮。
138
+ - 当前正式产物发生外部变化、无法安全修复、诊断或指纹重复、无进展,或达到共享规则的编辑上限时停止,不发布 completed 事件。
139
139
  - 使用同一次 `status=passed` 返回的摘要执行 `agent-infra-internal task-event {task-id} plan.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {plan-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} {execution-flag}`,由核心登记链接、阶段、代理、时间、版本和 Activity Log。
140
140
 
141
141
  如果 task.md 中存在有效的 `platform_issue_identity`,执行以下同步操作(任一失败则跳过并继续):
@@ -28,16 +28,7 @@
28
28
  ]
29
29
  },
30
30
  "platform-sync": {
31
- "when": "platform_issue_identity_exists",
32
- "expected_status_label": "status: pending-design-work",
33
- "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
34
- "verify_comment_content": true,
35
- "verify_task_comment_content": true,
36
- "verify_issue_type": true,
37
- "verify_issue_fields": false,
38
- "verify_milestone": true,
39
- "expected_status_label_key": "pendingDesignWork",
40
- "expected_comment_marker_key": "artifact"
31
+ "when": "platform_issue_identity_exists"
41
32
  }
42
33
  }
43
34
  }
@@ -28,16 +28,7 @@
28
28
  ]
29
29
  },
30
30
  "platform-sync": {
31
- "when": "platform_issue_identity_exists",
32
- "expected_status_label": "status: pending-design-work",
33
- "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
34
- "verify_comment_content": true,
35
- "verify_task_comment_content": true,
36
- "verify_issue_type": true,
37
- "verify_issue_fields": false,
38
- "verify_milestone": true,
39
- "expected_status_label_key": "pendingDesignWork",
40
- "expected_comment_marker_key": "artifact"
31
+ "when": "platform_issue_identity_exists"
41
32
  }
42
33
  }
43
34
  }
@@ -44,14 +44,14 @@ description: >
44
44
 
45
45
  ### 3. 确定 task-id 与待恢复文件
46
46
 
47
- 按 `.agents/rules/issue-sync.md` 中定义的 task、artifact、分片 artifact 和 recovery 标记筛选评论。
47
+ 按 `.agents/rules/issue-sync.md` 中定义的 task、artifact 与分片 artifact 标记筛选评论。
48
48
 
49
49
  处理规则:
50
50
  - 用户提供了 `{task-id}` 时,仅匹配该任务
51
51
  - 未提供时,优先从 task 评论标记推断
52
52
  - 若找不到唯一 task-id,立即停止并告知用户
53
53
  - 忽略 `summary` 标记评论;它是 complete-task 的聚合产物,不对应本地任务文件
54
- - `task` 评论仅用于确定当前投影和 snapshot 身份;`recovery-action`、`recovery-prepare`、`recovery-commit` 由受控 recovery core 验证并重建完整 `task.md`
54
+ - `task`、artifact 和交付摘要评论顶部的折叠恢复元数据由受控 recovery core 验证并重建活动日志。
55
55
  - 将 `{file-stem}` 映射回文件名:
56
56
  - `task` -> `task.md`
57
57
  - `analysis` / `analysis-r{N}` -> 对应 `.md`
@@ -68,9 +68,9 @@ description: >
68
68
 
69
69
  对每个文件执行:
70
70
  - 收集单条评论或分片评论
71
- - 不直接把投影 task 评论反向拆成 `task.md`;完整 task 内容必须来自匹配当前投影的 recovery commit
71
+ - 从 task 评论恢复当前任务投影,再只从通过校验的 artifact 恢复元数据重建活动日志;不得根据缺失记录推测过程状态
72
72
  - 如分片标记中存在 part 和 total 序号,按 part 升序排序并校验分片完整
73
- - 从评论正文中提取文件内容,去掉隐藏标记、标题和页脚
73
+ - 从评论正文中提取文件内容,去掉隐藏标记、标题、恢复元数据和页脚
74
74
  - 拼接得到最终文件内容
75
75
 
76
76
  在写文件前检查:
@@ -75,7 +75,7 @@ Before writing this round's `{review-artifact}`, create the controlled review sk
75
75
  agent-infra-internal task-artifact {task-id} init --family review-analysis --artifact {review-artifact} --locale en
76
76
  ```
77
77
 
78
- The skeleton contains identity metadata, stable section markers, and required headings only; complete review content is required before summary finalization. If structural finalization returns one provably safe error, it returns a controlled recovery candidate; edit only its `candidatePath`, then rerun the original finalizer with the same `recoveryId`. Candidate-only is a protocol authorization boundary, not OS isolation; arbitrary same-UID host writers are outside the protocol's protection claim, and fingerprint/state checks fail closed on anomalies.
78
+ The skeleton contains identity metadata, stable section markers, and required headings only; complete review content is required before summary finalization. On a structural error, follow `.agents/rules/local-artifact-repair.md` to correct the formal review artifact directly and rerun the original finalizer; current artifact content is the only input.
79
79
 
80
80
  Create `.agents/workspace/active/{task-id}/{review-artifact}`.
81
81
 
@@ -83,7 +83,7 @@ Create `.agents/workspace/active/{task-id}/{review-artifact}`.
83
83
 
84
84
  ### 6. Update Task Status
85
85
 
86
- After the report, call `agent-infra-internal task-review {task-id} preflight --stage analysis --artifact {review-artifact} {execution-flag}` before any ledger write. On failure, follow `.agents/rules/local-artifact-repair.md`; on success, bind `{recovery-id}` from the response. Only after preflight passes, submit each new finding with `agent-infra-internal task-ledger {task-id} finding-upsert --stage analysis --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}` or prior-response dispositions with `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {evidence}`. Do not scan ids or edit ledger rows. After all ledger writes, call `agent-infra-internal task-review {task-id} finalize-summary --stage analysis --artifact {review-artifact} --recovery-id {recovery-id} {execution-flag}`; never treat an error type or `changed=false` as automatic authorization.
86
+ After the report, call `agent-infra-internal task-review {task-id} preflight --stage analysis --artifact {review-artifact} {execution-flag}` before any ledger write. On failure, correct the formal artifact directly and rerun it. Only after preflight passes, submit each new finding with `agent-infra-internal task-ledger {task-id} finding-upsert --stage analysis --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}` or prior-response dispositions with `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {evidence}`. Do not scan ids or edit ledger rows. After all ledger writes, call `agent-infra-internal task-review {task-id} finalize-summary --stage analysis --artifact {review-artifact} {execution-flag}`; never treat an error type or `changed=false` as automatic authorization.
87
87
 
88
88
  Bind and reuse this structured mapping from that one response:
89
89
 
@@ -78,7 +78,7 @@ agent-infra-internal task-snapshot {task-id} --format text
78
78
  agent-infra-internal task-artifact {task-id} init --family review-analysis --artifact {review-artifact}
79
79
  ```
80
80
 
81
- 骨架不生成审查结论、发现或计数;完成审查内容后才能进入 summary finalizer。结构 finalizer 返回可证明的单个错误时,会返回受控 recovery candidate;只能编辑返回的 `candidatePath`,然后使用同一个 `recoveryId` 重跑原 finalizer。candidate-only 是协议授权边界,不是操作系统隔离;同 UID 的任意宿主写入者不在本协议的防护承诺内,异常由指纹/状态校验失败关闭。
81
+ 骨架不生成审查结论、发现或计数;完成审查内容后才能进入 summary finalizer。结构错误时,遵循 `.agents/rules/local-artifact-repair.md` 直接修正正式审查产物并重跑原 finalizer;当前产物内容是唯一输入。
82
82
 
83
83
  创建 `.agents/workspace/active/{task-id}/{review-artifact}`。
84
84
 
@@ -86,7 +86,7 @@ agent-infra-internal task-artifact {task-id} init --family review-analysis --art
86
86
 
87
87
  ### 6. 更新任务状态
88
88
 
89
- 报告完成后,先调用 `agent-infra-internal task-review {task-id} preflight --stage analysis --artifact {review-artifact} {execution-flag}`,不得先写入账本。失败后是否继续编辑并重跑,必须遵循 `.agents/rules/local-artifact-repair.md`;通过时从返回值绑定 `{recovery-id}`。只有 preflight 通过后,才逐条调用 `agent-infra-internal task-ledger {task-id} finding-upsert --stage analysis --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}`,或复核上一轮响应时调用 `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {相称证据}`。不得扫描编号或手写账本行。全部账本写入完成后调用 `agent-infra-internal task-review {task-id} finalize-summary --stage analysis --artifact {review-artifact} --recovery-id {recovery-id} {execution-flag}`;不能把失败类型或 `changed=false` 当作自动授权。
89
+ 报告完成后,先调用 `agent-infra-internal task-review {task-id} preflight --stage analysis --artifact {review-artifact} {execution-flag}`,不得先写入账本。失败后直接修正正式产物并重跑;只有 preflight 通过后,才逐条调用 `agent-infra-internal task-ledger {task-id} finding-upsert --stage analysis --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}`,或复核上一轮响应时调用 `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {相称证据}`。不得扫描编号或手写账本行。全部账本写入完成后调用 `agent-infra-internal task-review {task-id} finalize-summary --stage analysis --artifact {review-artifact} {execution-flag}`;不能把失败类型或 `changed=false` 当作自动授权。
90
90
 
91
91
  从该次返回值绑定并复用以下结构化映射:
92
92
 
@@ -27,16 +27,7 @@
27
27
  "expected_action_pattern": "(Review Analysis|Analysis Review) \\(Round \\d+\\)"
28
28
  },
29
29
  "platform-sync": {
30
- "when": "platform_issue_identity_exists",
31
- "expected_status_label": "status: pending-design-work",
32
- "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
33
- "verify_comment_content": true,
34
- "verify_task_comment_content": true,
35
- "verify_issue_type": true,
36
- "verify_issue_fields": false,
37
- "verify_milestone": true,
38
- "expected_status_label_key": "pendingDesignWork",
39
- "expected_comment_marker_key": "artifact"
30
+ "when": "platform_issue_identity_exists"
40
31
  }
41
32
  }
42
33
  }
@@ -27,16 +27,7 @@
27
27
  "expected_action_pattern": "(Review Analysis|Analysis Review) \\(Round \\d+\\)"
28
28
  },
29
29
  "platform-sync": {
30
- "when": "platform_issue_identity_exists",
31
- "expected_status_label": "status: pending-design-work",
32
- "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
33
- "verify_comment_content": true,
34
- "verify_task_comment_content": true,
35
- "verify_issue_type": true,
36
- "verify_issue_fields": false,
37
- "verify_milestone": true,
38
- "expected_status_label_key": "pendingDesignWork",
39
- "expected_comment_marker_key": "artifact"
30
+ "when": "platform_issue_identity_exists"
40
31
  }
41
32
  }
42
33
  }
@@ -4,6 +4,8 @@
4
4
 
5
5
  Use this template when writing `review-analysis.md` or `review-analysis-r{N}.md`.
6
6
 
7
+ > The `Review Input` field provides reader-facing traceability. Lifecycle identity uses the input frozen by `review-analysis.started` and the completion receipt; it is not parsed from this report body.
8
+
7
9
  ## Output Template
8
10
 
9
11
  ```markdown
@@ -4,6 +4,8 @@
4
4
 
5
5
  编写 `review-analysis.md` 或 `review-analysis-r{N}.md` 时使用本模板。
6
6
 
7
+ > “审查输入”字段用于读者追溯。生命周期身份以 `review-analysis.started` 冻结的输入和完成 receipt 为准,不从本报告正文解析。
8
+
7
9
  ## 输出模板
8
10
 
9
11
  ```markdown
@@ -102,7 +102,7 @@ Before writing this round's `{review-artifact}`, create the controlled review sk
102
102
  agent-infra-internal task-artifact {task-id} init --family review-code --artifact {review-artifact} --locale en
103
103
  ```
104
104
 
105
- The skeleton does not generate a verdict, findings, or counts; complete review content is required before summary finalization. If structural finalization returns one provably safe error, it returns a controlled recovery candidate; edit only its `candidatePath`, then rerun the original finalizer with the same `recoveryId`. Candidate-only is a protocol authorization boundary, not OS isolation; arbitrary same-UID host writers are outside the protocol's protection claim, and fingerprint/state checks fail closed on anomalies.
105
+ The skeleton does not generate a verdict, findings, or counts; complete review content is required before summary finalization. On a structural error, follow `.agents/rules/local-artifact-repair.md` to correct the formal review artifact directly and rerun the original finalizer; current artifact content is the only input.
106
106
 
107
107
  Create `.agents/workspace/active/{task-id}/{review-artifact}`.
108
108
 
@@ -111,9 +111,9 @@ Create `.agents/workspace/active/{task-id}/{review-artifact}`.
111
111
  ### 6. Update Task Status
112
112
 
113
113
  Update task.md:
114
- - After the report, call `agent-infra-internal task-review {task-id} preflight --stage code --artifact {review-artifact} {execution-flag}` before any ledger write. On failure, follow `.agents/rules/local-artifact-repair.md`; on success, bind `{recovery-id}` from the response.
114
+ - After the report, call `agent-infra-internal task-review {task-id} preflight --stage code --artifact {review-artifact} {execution-flag}` before any ledger write. On failure, correct the formal artifact directly and rerun it.
115
115
  - Only after preflight passes, submit each new finding with `agent-infra-internal task-ledger {task-id} finding-upsert --stage code --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}`; submit prior-response dispositions with `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {evidence}`. When escalating to `needs-human-decision`, append `--needs-implementation true|false` using the judgment recorded in the detail block. Do not scan ids or edit ledger rows
116
- - After all ledger writes, call `agent-infra-internal task-review {task-id} finalize-summary --stage code --artifact {review-artifact} --recovery-id {recovery-id} {execution-flag}`; never treat an error type or `changed=false` as automatic authorization
116
+ - After all ledger writes, call `agent-infra-internal task-review {task-id} finalize-summary --stage code --artifact {review-artifact} {execution-flag}`; never treat an error type or `changed=false` as automatic authorization
117
117
 
118
118
  Bind and reuse this structured mapping from that one response:
119
119
 
@@ -101,7 +101,7 @@ agent-infra-internal task-snapshot {task-id} --format text
101
101
  agent-infra-internal task-artifact {task-id} init --family review-code --artifact {review-artifact}
102
102
  ```
103
103
 
104
- 骨架不生成审查结论、发现或计数;完成审查内容后才能进入 summary finalizer。结构 finalizer 返回可证明的单个错误时,会返回受控 recovery candidate;只能编辑返回的 `candidatePath`,然后使用同一个 `recoveryId` 重跑原 finalizer。candidate-only 是协议授权边界,不是操作系统隔离;同 UID 的任意宿主写入者不在本协议的防护承诺内,异常由指纹/状态校验失败关闭。
104
+ 骨架不生成审查结论、发现或计数;完成审查内容后才能进入 summary finalizer。结构错误时,遵循 `.agents/rules/local-artifact-repair.md` 直接修正正式审查产物并重跑原 finalizer;当前产物内容是唯一输入。
105
105
 
106
106
  创建 `.agents/workspace/active/{task-id}/{review-artifact}`。
107
107
 
@@ -109,9 +109,9 @@ agent-infra-internal task-artifact {task-id} init --family review-code --artifac
109
109
 
110
110
  ### 6. 更新任务状态
111
111
 
112
- - 报告完成后,先调用 `agent-infra-internal task-review {task-id} preflight --stage code --artifact {review-artifact} {execution-flag}`,不得先写入账本。失败后是否继续编辑并重跑,必须遵循 `.agents/rules/local-artifact-repair.md`;通过时从返回值绑定 `{recovery-id}`。
112
+ - 报告完成后,先调用 `agent-infra-internal task-review {task-id} preflight --stage code --artifact {review-artifact} {execution-flag}`,不得先写入账本。失败后直接修正正式产物并重跑。
113
113
  - 只有 preflight 通过后,新 finding 才逐条调用 `agent-infra-internal task-ledger {task-id} finding-upsert --stage code --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}`;复核上一轮响应时调用 `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {相称证据}`。升级为 `needs-human-decision` 时,按详情块中的判断追加 `--needs-implementation true|false`。不得扫描编号或手写账本行
114
- - 全部账本写入完成后调用 `agent-infra-internal task-review {task-id} finalize-summary --stage code --artifact {review-artifact} --recovery-id {recovery-id} {execution-flag}`;不能把失败类型或 `changed=false` 当作自动授权
114
+ - 全部账本写入完成后调用 `agent-infra-internal task-review {task-id} finalize-summary --stage code --artifact {review-artifact} {execution-flag}`;不能把失败类型或 `changed=false` 当作自动授权
115
115
 
116
116
  从该次返回值绑定并复用以下结构化映射:
117
117
 
@@ -28,16 +28,7 @@
28
28
  "expected_action_pattern": "(Review Code|Code Review) \\(Round \\d+\\)"
29
29
  },
30
30
  "platform-sync": {
31
- "when": "platform_issue_identity_exists",
32
- "expected_status_label": "status: in-progress",
33
- "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
34
- "verify_comment_content": true,
35
- "verify_task_comment_content": true,
36
- "verify_issue_type": true,
37
- "verify_issue_fields": false,
38
- "verify_milestone": true,
39
- "expected_status_label_key": "inProgress",
40
- "expected_comment_marker_key": "artifact"
31
+ "when": "platform_issue_identity_exists"
41
32
  }
42
33
  }
43
34
  }
@@ -28,16 +28,7 @@
28
28
  "expected_action_pattern": "(Review Code|Code Review) \\(Round \\d+\\)"
29
29
  },
30
30
  "platform-sync": {
31
- "when": "platform_issue_identity_exists",
32
- "expected_status_label": "status: in-progress",
33
- "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
34
- "verify_comment_content": true,
35
- "verify_task_comment_content": true,
36
- "verify_issue_type": true,
37
- "verify_issue_fields": false,
38
- "verify_milestone": true,
39
- "expected_status_label_key": "inProgress",
40
- "expected_comment_marker_key": "artifact"
31
+ "when": "platform_issue_identity_exists"
41
32
  }
42
33
  }
43
34
  }
@@ -4,6 +4,8 @@
4
4
 
5
5
  Use this template when writing `review-code.md` or `review-code-r{N}.md`.
6
6
 
7
+ > The `Review Input` field provides reader-facing traceability. Lifecycle identity uses the input frozen by `review-code.started` and the completion receipt; it is not parsed from this report body.
8
+
7
9
  ## Output Template
8
10
 
9
11
  ```markdown
@@ -4,6 +4,8 @@
4
4
 
5
5
  编写 `review-code.md` 或 `review-code-r{N}.md` 时使用本模板。
6
6
 
7
+ > “审查输入”字段用于读者追溯。生命周期身份以 `review-code.started` 冻结的输入和完成 receipt 为准,不从本报告正文解析。
8
+
7
9
  ## 输出模板
8
10
 
9
11
  ```markdown
@@ -75,7 +75,7 @@ Before writing this round's `{review-artifact}`, create the controlled review sk
75
75
  agent-infra-internal task-artifact {task-id} init --family review-plan --artifact {review-artifact} --locale en
76
76
  ```
77
77
 
78
- The skeleton contains identity metadata, stable section markers, and required headings only; complete review content is required before summary finalization. If structural finalization returns one provably safe error, it returns a controlled recovery candidate; edit only its `candidatePath`, then rerun the original finalizer with the same `recoveryId`. Candidate-only is a protocol authorization boundary, not OS isolation; arbitrary same-UID host writers are outside the protocol's protection claim, and fingerprint/state checks fail closed on anomalies.
78
+ The skeleton contains identity metadata, stable section markers, and required headings only; complete review content is required before summary finalization. On a structural error, follow `.agents/rules/local-artifact-repair.md` to correct the formal review artifact directly and rerun the original finalizer; current artifact content is the only input.
79
79
 
80
80
  Create `.agents/workspace/active/{task-id}/{review-artifact}`.
81
81
 
@@ -83,7 +83,7 @@ Create `.agents/workspace/active/{task-id}/{review-artifact}`.
83
83
 
84
84
  ### 6. Update Task Status
85
85
 
86
- After the report, call `agent-infra-internal task-review {task-id} preflight --stage plan --artifact {review-artifact} {execution-flag}` before any ledger write. On failure, follow `.agents/rules/local-artifact-repair.md`; on success, bind `{recovery-id}` from the response. Only after preflight passes, submit each new finding with `agent-infra-internal task-ledger {task-id} finding-upsert --stage plan --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}` or prior-response dispositions with `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {evidence}`. Do not scan ids or edit ledger rows. After all ledger writes, call `agent-infra-internal task-review {task-id} finalize-summary --stage plan --artifact {review-artifact} --recovery-id {recovery-id} {execution-flag}`; never treat an error type or `changed=false` as automatic authorization.
86
+ After the report, call `agent-infra-internal task-review {task-id} preflight --stage plan --artifact {review-artifact} {execution-flag}` before any ledger write. On failure, correct the formal artifact directly and rerun it. Only after preflight passes, submit each new finding with `agent-infra-internal task-ledger {task-id} finding-upsert --stage plan --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}` or prior-response dispositions with `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {evidence}`. Do not scan ids or edit ledger rows. After all ledger writes, call `agent-infra-internal task-review {task-id} finalize-summary --stage plan --artifact {review-artifact} {execution-flag}`; never treat an error type or `changed=false` as automatic authorization.
87
87
 
88
88
  Bind and reuse this structured mapping from that one response:
89
89
 
@@ -78,7 +78,7 @@ agent-infra-internal task-snapshot {task-id} --format text
78
78
  agent-infra-internal task-artifact {task-id} init --family review-plan --artifact {review-artifact}
79
79
  ```
80
80
 
81
- 骨架不生成审查结论、发现或计数;完成审查内容后才能进入 summary finalizer。结构 finalizer 返回可证明的单个错误时,会返回受控 recovery candidate;只能编辑返回的 `candidatePath`,然后使用同一个 `recoveryId` 重跑原 finalizer。candidate-only 是协议授权边界,不是操作系统隔离;同 UID 的任意宿主写入者不在本协议的防护承诺内,异常由指纹/状态校验失败关闭。
81
+ 骨架不生成审查结论、发现或计数;完成审查内容后才能进入 summary finalizer。结构错误时,遵循 `.agents/rules/local-artifact-repair.md` 直接修正正式审查产物并重跑原 finalizer;当前产物内容是唯一输入。
82
82
 
83
83
  创建 `.agents/workspace/active/{task-id}/{review-artifact}`。
84
84
 
@@ -86,7 +86,7 @@ agent-infra-internal task-artifact {task-id} init --family review-plan --artifac
86
86
 
87
87
  ### 6. 更新任务状态
88
88
 
89
- 报告完成后,先调用 `agent-infra-internal task-review {task-id} preflight --stage plan --artifact {review-artifact} {execution-flag}`,不得先写入账本。失败后是否继续编辑并重跑,必须遵循 `.agents/rules/local-artifact-repair.md`;通过时从返回值绑定 `{recovery-id}`。只有 preflight 通过后,才逐条调用 `agent-infra-internal task-ledger {task-id} finding-upsert --stage plan --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}`,或复核上一轮响应时调用 `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {相称证据}`。不得扫描编号或手写账本行。全部账本写入完成后调用 `agent-infra-internal task-review {task-id} finalize-summary --stage plan --artifact {review-artifact} --recovery-id {recovery-id} {execution-flag}`;不能把失败类型或 `changed=false` 当作自动授权。
89
+ 报告完成后,先调用 `agent-infra-internal task-review {task-id} preflight --stage plan --artifact {review-artifact} {execution-flag}`,不得先写入账本。失败后直接修正正式产物并重跑;只有 preflight 通过后,才逐条调用 `agent-infra-internal task-ledger {task-id} finding-upsert --stage plan --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}`,或复核上一轮响应时调用 `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {相称证据}`。不得扫描编号或手写账本行。全部账本写入完成后调用 `agent-infra-internal task-review {task-id} finalize-summary --stage plan --artifact {review-artifact} {execution-flag}`;不能把失败类型或 `changed=false` 当作自动授权。
90
90
 
91
91
  从该次返回值绑定并复用以下结构化映射:
92
92
 
@@ -27,16 +27,7 @@
27
27
  "expected_action_pattern": "(Review Plan|Plan Review) \\(Round \\d+\\)"
28
28
  },
29
29
  "platform-sync": {
30
- "when": "platform_issue_identity_exists",
31
- "expected_status_label": "status: pending-design-work",
32
- "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
33
- "verify_comment_content": true,
34
- "verify_task_comment_content": true,
35
- "verify_issue_type": true,
36
- "verify_issue_fields": false,
37
- "verify_milestone": true,
38
- "expected_status_label_key": "pendingDesignWork",
39
- "expected_comment_marker_key": "artifact"
30
+ "when": "platform_issue_identity_exists"
40
31
  }
41
32
  }
42
33
  }
@@ -27,16 +27,7 @@
27
27
  "expected_action_pattern": "(Review Plan|Plan Review) \\(Round \\d+\\)"
28
28
  },
29
29
  "platform-sync": {
30
- "when": "platform_issue_identity_exists",
31
- "expected_status_label": "status: pending-design-work",
32
- "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
33
- "verify_comment_content": true,
34
- "verify_task_comment_content": true,
35
- "verify_issue_type": true,
36
- "verify_issue_fields": false,
37
- "verify_milestone": true,
38
- "expected_status_label_key": "pendingDesignWork",
39
- "expected_comment_marker_key": "artifact"
30
+ "when": "platform_issue_identity_exists"
40
31
  }
41
32
  }
42
33
  }