@fitlab-ai/agent-infra 0.7.4 → 0.7.6

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 (119) hide show
  1. package/bin/cli.ts +13 -11
  2. package/dist/bin/cli.js +13 -11
  3. package/dist/lib/init.js +1 -1
  4. package/dist/lib/merge.js +1 -1
  5. package/dist/lib/sandbox/commands/create.js +26 -4
  6. package/dist/lib/sandbox/index.js +21 -21
  7. package/dist/lib/sandbox/tools.js +20 -1
  8. package/dist/lib/task/commands/log.js +56 -6
  9. package/dist/lib/task/index.js +13 -13
  10. package/dist/lib/update.js +1 -1
  11. package/lib/init.ts +1 -1
  12. package/lib/merge.ts +1 -1
  13. package/lib/sandbox/commands/create.ts +33 -4
  14. package/lib/sandbox/index.ts +21 -21
  15. package/lib/sandbox/tools.ts +28 -1
  16. package/lib/task/commands/log.ts +59 -6
  17. package/lib/task/index.ts +13 -13
  18. package/lib/update.ts +1 -1
  19. package/package.json +1 -1
  20. package/templates/.agents/rules/README.en.md +7 -3
  21. package/templates/.agents/rules/README.zh-CN.md +7 -3
  22. package/templates/.agents/rules/cli-help-format.en.md +49 -0
  23. package/templates/.agents/rules/cli-help-format.zh-CN.md +49 -0
  24. package/templates/.agents/rules/no-mid-flow-questions.en.md +25 -2
  25. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +25 -2
  26. package/templates/.agents/rules/pr-sync.github.en.md +8 -6
  27. package/templates/.agents/rules/pr-sync.github.zh-CN.md +8 -6
  28. package/templates/.agents/rules/review-handshake.en.md +97 -0
  29. package/templates/.agents/rules/review-handshake.zh-CN.md +97 -0
  30. package/templates/.agents/rules/task-management.en.md +25 -0
  31. package/templates/.agents/rules/task-management.zh-CN.md +29 -0
  32. package/templates/.agents/scripts/lib/post-review-commit.js +56 -0
  33. package/templates/.agents/scripts/lib/review-artifacts.js +117 -0
  34. package/templates/.agents/scripts/review-diff-fingerprint.js +99 -0
  35. package/templates/.agents/scripts/validate-artifact.js +251 -2
  36. package/templates/.agents/skills/analyze-task/SKILL.en.md +63 -6
  37. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +63 -6
  38. package/templates/.agents/skills/block-task/SKILL.en.md +10 -0
  39. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +10 -0
  40. package/templates/.agents/skills/cancel-task/SKILL.en.md +10 -0
  41. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +11 -1
  42. package/templates/.agents/skills/close-codescan/SKILL.en.md +10 -0
  43. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +10 -0
  44. package/templates/.agents/skills/close-dependabot/SKILL.en.md +10 -0
  45. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +10 -0
  46. package/templates/.agents/skills/code-task/SKILL.en.md +11 -0
  47. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +11 -0
  48. package/templates/.agents/skills/code-task/config/verify.en.json +3 -0
  49. package/templates/.agents/skills/code-task/config/verify.zh-CN.json +3 -0
  50. package/templates/.agents/skills/code-task/reference/fix-mode.en.md +5 -3
  51. package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +5 -3
  52. package/templates/.agents/skills/code-task/reference/report-template.en.md +4 -4
  53. package/templates/.agents/skills/code-task/reference/report-template.zh-CN.md +4 -4
  54. package/templates/.agents/skills/code-task/scripts/detect-mode.js +2 -107
  55. package/templates/.agents/skills/commit/SKILL.en.md +16 -0
  56. package/templates/.agents/skills/commit/SKILL.zh-CN.md +16 -0
  57. package/templates/.agents/skills/commit/reference/task-status-update.en.md +8 -0
  58. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +8 -0
  59. package/templates/.agents/skills/complete-task/SKILL.en.md +20 -0
  60. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +20 -0
  61. package/templates/.agents/skills/complete-task/config/verify.en.json +2 -0
  62. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +2 -0
  63. package/templates/.agents/skills/create-pr/SKILL.en.md +20 -1
  64. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +20 -1
  65. package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +1 -1
  66. package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +1 -1
  67. package/templates/.agents/skills/create-release-note/SKILL.en.md +16 -1
  68. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +16 -1
  69. package/templates/.agents/skills/create-task/SKILL.en.md +11 -0
  70. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +14 -3
  71. package/templates/.agents/skills/import-codescan/SKILL.en.md +11 -0
  72. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +11 -0
  73. package/templates/.agents/skills/import-dependabot/SKILL.en.md +11 -0
  74. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +11 -0
  75. package/templates/.agents/skills/import-issue/SKILL.en.md +16 -0
  76. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +16 -0
  77. package/templates/.agents/skills/plan-task/SKILL.en.md +13 -1
  78. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +13 -1
  79. package/templates/.agents/skills/plan-task/config/verify.en.json +3 -0
  80. package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +3 -0
  81. package/templates/.agents/skills/restore-task/SKILL.en.md +10 -0
  82. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +10 -0
  83. package/templates/.agents/skills/review-analysis/SKILL.en.md +10 -0
  84. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +10 -0
  85. package/templates/.agents/skills/review-analysis/config/verify.en.json +2 -1
  86. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +2 -1
  87. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +5 -4
  88. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +5 -4
  89. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +4 -0
  90. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +4 -0
  91. package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +1 -0
  92. package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +1 -0
  93. package/templates/.agents/skills/review-code/SKILL.en.md +14 -1
  94. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +14 -1
  95. package/templates/.agents/skills/review-code/config/verify.en.json +5 -2
  96. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +5 -2
  97. package/templates/.agents/skills/review-code/reference/output-templates.en.md +5 -4
  98. package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +5 -4
  99. package/templates/.agents/skills/review-code/reference/report-template.en.md +6 -0
  100. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +6 -0
  101. package/templates/.agents/skills/review-code/reference/review-criteria.en.md +1 -0
  102. package/templates/.agents/skills/review-code/reference/review-criteria.zh-CN.md +1 -0
  103. package/templates/.agents/skills/review-plan/SKILL.en.md +10 -0
  104. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +10 -0
  105. package/templates/.agents/skills/review-plan/config/verify.en.json +2 -1
  106. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +2 -1
  107. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +5 -4
  108. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +5 -4
  109. package/templates/.agents/skills/review-plan/reference/report-template.en.md +4 -0
  110. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +4 -0
  111. package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +1 -0
  112. package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +1 -0
  113. package/templates/.agents/skills/watch-pr/SKILL.en.md +10 -0
  114. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +10 -0
  115. package/templates/.agents/templates/task.en.md +12 -0
  116. package/templates/.agents/templates/task.zh-CN.md +12 -0
  117. package/templates/.github/workflows/metadata-sync.yml +1 -1
  118. package/templates/.github/workflows/pr-label.yml +1 -1
  119. package/templates/.github/workflows/status-label.yml +1 -1
@@ -24,12 +24,15 @@
24
24
  "结论与建议",
25
25
  "状态核对",
26
26
  "证据原文",
27
- "自我质疑"
27
+ "自我质疑",
28
+ "审查分歧账本回写"
28
29
  ],
29
30
  "required_patterns": [
30
31
  "^### 审查决定$",
31
32
  "^\\$ ",
32
- "^- \\*\\*总体结论\\*\\*[::]\\s*(?:通过|需要修改|拒绝|Approved|Changes Requested|Rejected)\\s*$"
33
+ "^- \\*\\*总体结论\\*\\*[::]\\s*(?:通过|需要修改|拒绝|Approved|Changes Requested|Rejected)\\s*$",
34
+ "^- \\*\\*审查基线提交\\*\\*[::]\\s*\\S",
35
+ "^- \\*\\*审查差异指纹\\*\\*[::]\\s*sha256:[0-9a-f]{64}\\s*$"
33
36
  ],
34
37
  "freshness_minutes": 30
35
38
  },
@@ -18,12 +18,13 @@ Prohibitions:
18
18
  - if `Blocker > 0`, never output an approval template
19
19
  - never count env-blocked findings as blockers / major issues / minor issues, and never use them to trigger Branch B/C/D
20
20
  - always include every TUI command format in the selected branch
21
+ - the count line always shows 5 numbers: the first three (Blockers / Major / Minor) must be 0 to proceed; the last two are "pending human" items and need not be zero — `Manual-verify` (`{e}`) = this round's env-blocked count, `Human-decision` (`{h}`) = the number of rows in task.md `## 审查分歧账本` with `stage=code` and `status=needs-human-decision`; neither participates in branch selection
21
22
 
22
23
  ### Branch A: Approved with No Findings
23
24
 
24
25
  ```text
25
26
  Task {task-id} review completed. Verdict: approved.
26
- - Blockers: 0 | Major: 0 | Minor: 0[ | env-blocked: {n} (outside AI repair scope)]
27
+ - Blockers: 0 | Major: 0 | Minor: 0 | Manual-verify: {e} | Human-decision: {h}
27
28
  [- Review report: .agents/workspace/active/{task-id}/{review-artifact}]
28
29
 
29
30
  Next step - commit the code:
@@ -39,7 +40,7 @@ Reminder: env-blocked findings must be carried in the PR description as a "manua
39
40
 
40
41
  ```text
41
42
  Task {task-id} review completed. Verdict: approved.
42
- - Blockers: 0 | Major: {n} | Minor: {n}[ | env-blocked: {n} (outside AI repair scope)]
43
+ - Blockers: 0 | Major: {n} | Minor: {n} | Manual-verify: {e} | Human-decision: {h}
43
44
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
44
45
 
45
46
  Next step - fix before commit (recommended):
@@ -60,7 +61,7 @@ Reminder: env-blocked findings must be carried in the PR description as a "manua
60
61
 
61
62
  ```text
62
63
  Task {task-id} review completed. Verdict: changes requested.
63
- - Blockers: {n} | Major: {n} | Minor: {n}[ | env-blocked: {n} (outside AI repair scope)]
64
+ - Blockers: {n} | Major: {n} | Minor: {n} | Manual-verify: {e} | Human-decision: {h}
64
65
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
65
66
 
66
67
  Next step - fix the findings:
@@ -76,7 +77,7 @@ Reminder: env-blocked findings must be carried in the PR description as a "manua
76
77
 
77
78
  ```text
78
79
  Task {task-id} review completed. Verdict: rejected, re-design the technical plan.
79
- - Blockers: {n} | Major: {n} | Minor: {n}[ | env-blocked: {n} (outside AI repair scope)]
80
+ - Blockers: {n} | Major: {n} | Minor: {n} | Manual-verify: {e} | Human-decision: {h}
80
81
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
81
82
 
82
83
  Next step - re-design the technical plan:
@@ -18,12 +18,13 @@
18
18
  - 只要 `Blocker > 0`,就绝对不能输出通过模板
19
19
  - env-blocked 项绝对不能被计入 blocker / major / minor 计数,也不能用作触发场景 B/C/D 的依据
20
20
  - 所选场景中必须包含所有 TUI 命令格式
21
+ - 计数行固定显示 5 个数字:前三项(阻塞 / 主要 / 次要)必须为 0 才进下一步;后两项是「待人处理」项、不要求归零——`人工校验点`(`{e}`)= 本轮 env-blocked 计数,`人工裁决`(`{h}`)= task.md `## 审查分歧账本` 中 `stage=code` 且 `status=needs-human-decision` 的行数;二者均不参与场景判断
21
22
 
22
23
  ### 场景 A:通过且无问题
23
24
 
24
25
  ```text
25
26
  任务 {task-id} 代码审查完成。结论:通过。
26
- - 阻塞项:0 | 主要问题:0 | 次要问题:0[ | 环境性遗留:{n}(不在 AI 修复范围)]
27
+ - 阻塞项:0 | 主要问题:0 | 次要问题:0 | 人工校验点:{e} | 人工裁决:{h}
27
28
  [- 审查报告:.agents/workspace/active/{task-id}/{review-artifact}]
28
29
 
29
30
  下一步 - 提交代码:
@@ -39,7 +40,7 @@
39
40
 
40
41
  ```text
41
42
  任务 {task-id} 代码审查完成。结论:通过。
42
- - 阻塞项:0 | 主要问题:{n} | 次要问题:{n}[ | 环境性遗留:{n}(不在 AI 修复范围)]
43
+ - 阻塞项:0 | 主要问题:{n} | 次要问题:{n} | 人工校验点:{e} | 人工裁决:{h}
43
44
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
44
45
 
45
46
  下一步 - 修复问题后提交(推荐):
@@ -60,7 +61,7 @@
60
61
 
61
62
  ```text
62
63
  任务 {task-id} 代码审查完成。结论:需要修改。
63
- - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n}[ | 环境性遗留:{n}(不在 AI 修复范围)]
64
+ - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n} | 人工校验点:{e} | 人工裁决:{h}
64
65
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
65
66
 
66
67
  下一步 - 修复问题:
@@ -76,7 +77,7 @@
76
77
 
77
78
  ```text
78
79
  任务 {task-id} 代码审查完成。结论:拒绝,需要重新设计方案。
79
- - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n}[ | 环境性遗留:{n}(不在 AI 修复范围)]
80
+ - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n} | 人工校验点:{e} | 人工裁决:{h}
80
81
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
81
82
 
82
83
  下一步 - 重新设计技术方案:
@@ -21,6 +21,8 @@ Use this template when writing `review-code.md` or `review-code-r{N}.md`.
21
21
  - **Reviewer**: {reviewer-name}
22
22
  - **Review Time**: {timestamp}
23
23
  - **Scope**: {file-count and major modules}
24
+ - **Review Baseline Commit**: {raw git rev-parse HEAD} (baseline for the complete-task post-review commit gate; see `.agents/rules/review-handshake.md`)
25
+ - **Reviewed Diff Fingerprint**: {raw node .agents/scripts/review-diff-fingerprint.js worktree HEAD}
24
26
  - **Overall Verdict**: {Approved / Changes Requested / Rejected} (pick exactly one; combined phrases will fail the verify gate)
25
27
  - **Findings (AI-actionable)**: 0 blockers, 0 majors, 0 minors / **env-blocked**: 0
26
28
 
@@ -59,6 +61,10 @@ Use this template when writing `review-code.md` or `review-code-r{N}.md`.
59
61
  > If this round has no env-blocked findings, keep the section heading and write "None".
60
62
 
61
63
 
64
+ ## Review Disagreement Ledger Writeback
65
+
66
+ > Upsert each finding this round into the task.md disagreement ledger: append an `open` row for new findings (id prefix `CD-`, stage=code); per the hand-back duty set the executor's prior-round responses to `confirmed` / back to `open` / `needs-human-decision`. State machine and evidence rules: `.agents/rules/review-handshake.md`.
67
+
62
68
  ## Evidence
63
69
 
64
70
  > Pair each "I verified X" claim with the corresponding raw tool output; the gate only checks that this section exists and at least one `$ ` line is present. Every Blocker must be backed by a reproducible command (rg/grep/sed/nl) and its raw output; a judgment that cannot be reproduced must be downgraded or moved to Self-Doubt.
@@ -22,6 +22,8 @@
22
22
  - **审查者**:{reviewer-name}
23
23
  - **审查时间**:{timestamp}
24
24
  - **审查范围**:{file-count and major modules}
25
+ - **审查基线提交**:{git rev-parse HEAD 原文}(complete-task 的 post-review commit 门禁基线;详见 `.agents/rules/review-handshake.md`)
26
+ - **审查差异指纹**:{node .agents/scripts/review-diff-fingerprint.js worktree HEAD 原文}
25
27
  - **总体结论**:{通过 / 需要修改 / 拒绝}(恰取一个;禁止写组合短语,否则 verify gate 失败)
26
28
  - **发现(AI 可处理)**:0 阻塞项,0 主要,0 次要 / **env-blocked**:0
27
29
 
@@ -60,6 +62,10 @@
60
62
  > 如本轮无 env-blocked 项,保留段落标题并写「(无)」。
61
63
 
62
64
 
65
+ ## 审查分歧账本回写
66
+
67
+ > 把本轮每条 finding upsert 到 task.md `## 审查分歧账本`:新 finding 追加 `open` 行(id 前缀 `CD-`,stage=code),对执行方上一轮响应按回交义务改 `confirmed` / 置回 `open` / `needs-human-decision`。状态机与证据规则见 `.agents/rules/review-handshake.md`。
68
+
63
69
  ## 证据原文
64
70
 
65
71
  > 每条“我验证了 X”断言都要配对对应 tool output 原文;gate 仅校验本段存在和至少一行 `$ `。每条 Blocker 必须配可复现命令(rg/grep/sed/nl)及其原文;无法复现的判断须降级或移入「自我质疑」。
@@ -14,6 +14,7 @@ Follow the `code-review` step in `.agents/workflows/feature-development.yaml`.
14
14
  - [ ] Performance and security risks
15
15
  - [ ] Comments and documentation
16
16
  - [ ] Consistency with the approved technical plan
17
+ - [ ] The reviewer checked whether the executor missed any key design decision that should be upgraded to `[needs-human-decision]`
17
18
  - [ ] Every blocker is backed by reproducible grep/sed/nl evidence; conclusions not directly verified are declared under Self-Doubt
18
19
 
19
20
  **Common anti-examples**:
@@ -14,6 +14,7 @@
14
14
  - [ ] 性能与安全风险
15
15
  - [ ] 代码注释和文档
16
16
  - [ ] 与已批准技术方案的一致性
17
+ - [ ] 已复核执行方是否漏标应升级为 `[needs-human-decision]` 的关键设计决策
17
18
  - [ ] 每条 blocker 都配可复现的 grep/sed/nl 证据,未直接验证的结论已在「自我质疑」声明
18
19
 
19
20
  **常见反例**:
@@ -30,6 +30,16 @@ tail .agents/workspace/active/{task-id}/task.md
30
30
 
31
31
  > If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
32
32
 
33
+ ## Step Start: Write the started Marker
34
+
35
+ After prerequisites pass and before this round's first artifact action, append a started marker to task.md `## Activity Log` (same base action as this round's done entry plus a ` [started]` suffix, note `started`):
36
+
37
+ ```
38
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Plan (Round {N}) [started]** by {agent} — started
39
+ ```
40
+
41
+ `ai task log` pairs it with the done entry written when the review completes onto one row (in progress → done). Format and pairing rules: see the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
42
+
33
43
  ## Steps
34
44
 
35
45
  ### 1. Verify Prerequisites
@@ -32,6 +32,16 @@ tail .agents/workspace/active/{task-id}/task.md
32
32
 
33
33
  > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
34
34
 
35
+ ## 步骤开始:写入 started 标记
36
+
37
+ 确认前置条件后、本轮第一个产出动作之前,向 task.md `## 活动日志` 追加一条 started 标记(与本轮 done 条目同基名 + ` [started]` 后缀,note 用 `started`):
38
+
39
+ ```
40
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Plan (Round {N}) [started]** by {agent} — started
41
+ ```
42
+
43
+ `ai task log` 会把它与审查完成时写入的 done 条目配对成一行(进行中 → 已完成)。格式与配对规则见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。
44
+
35
45
  ## 执行步骤
36
46
  ### 1. 验证前置条件
37
47
 
@@ -24,7 +24,8 @@
24
24
  "Conclusion and Recommendations",
25
25
  "State Check",
26
26
  "Evidence",
27
- "Self-Doubt"
27
+ "Self-Doubt",
28
+ "Review Disagreement Ledger Writeback"
28
29
  ],
29
30
  "required_patterns": [
30
31
  "^### Approval Decision$",
@@ -24,7 +24,8 @@
24
24
  "结论与建议",
25
25
  "状态核对",
26
26
  "证据原文",
27
- "自我质疑"
27
+ "自我质疑",
28
+ "审查分歧账本回写"
28
29
  ],
29
30
  "required_patterns": [
30
31
  "^### 审查决定$",
@@ -16,12 +16,13 @@ Rules:
16
16
  - If `Blocker > 0`, never use an approved template
17
17
  - Never count env-blocked items as blocker / major / minor or use them to trigger Scenario B/C/D
18
18
  - The selected scenario must include all TUI command formats
19
+ - The count line always shows 4 numbers: the first three (Blockers / Major / Minor) must be 0 to proceed; the fourth, `Human-decision` (`{h}`), is the number of rows in task.md `## 审查分歧账本` with `stage=plan` and `status=needs-human-decision` — a "pending human ruling" item that need not be zero and does not participate in scenario selection
19
20
 
20
21
  ### Scenario A: Approved with no findings
21
22
 
22
23
  ```text
23
24
  Task {task-id} technical plan review completed. Verdict: approved.
24
- - Blockers: 0 | Major issues: 0 | Minor issues: 0[ | Environment-blocked: {n} (outside AI fix scope)]
25
+ - Blockers: 0 | Major issues: 0 | Minor issues: 0 | Human-decision: {h}
25
26
  [- Review report: .agents/workspace/active/{task-id}/{review-artifact}]
26
27
 
27
28
  Next step - write code:
@@ -37,7 +38,7 @@ Reminder: env-blocked items belong in the PR description manual verification che
37
38
 
38
39
  ```text
39
40
  Task {task-id} technical plan review completed. Verdict: approved.
40
- - Blockers: 0 | Major issues: {n} | Minor issues: {n}[ | Environment-blocked: {n} (outside AI fix scope)]
41
+ - Blockers: 0 | Major issues: {n} | Minor issues: {n} | Human-decision: {h}
41
42
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
42
43
 
43
44
  Next step - revise plan before coding (recommended):
@@ -58,7 +59,7 @@ Reminder: env-blocked items belong in the PR description manual verification che
58
59
 
59
60
  ```text
60
61
  Task {task-id} technical plan review completed. Verdict: changes requested.
61
- - Blockers: {n} | Major issues: {n} | Minor issues: {n}[ | Environment-blocked: {n} (outside AI fix scope)]
62
+ - Blockers: {n} | Major issues: {n} | Minor issues: {n} | Human-decision: {h}
62
63
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
63
64
 
64
65
  Next step - revise technical plan:
@@ -74,7 +75,7 @@ Reminder: env-blocked items belong in the PR description manual verification che
74
75
 
75
76
  ```text
76
77
  Task {task-id} technical plan review completed. Verdict: rejected, redesign required.
77
- - Blockers: {n} | Major issues: {n} | Minor issues: {n}[ | Environment-blocked: {n} (outside AI fix scope)]
78
+ - Blockers: {n} | Major issues: {n} | Minor issues: {n} | Human-decision: {h}
78
79
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
79
80
 
80
81
  Next step - redesign:
@@ -16,12 +16,13 @@
16
16
  - 只要 `Blocker > 0`,就绝对不能输出通过模板
17
17
  - env-blocked 项绝对不能被计入 blocker / major / minor 计数,也不能用作触发场景 B/C/D 的依据
18
18
  - 所选场景中必须包含所有 TUI 命令格式
19
+ - 计数行固定显示 4 个数字:前三项(阻塞 / 主要 / 次要)必须为 0 才进下一步;第四项 `人工裁决`(`{h}`)= task.md `## 审查分歧账本` 中 `stage=plan` 且 `status=needs-human-decision` 的行数,是「待人裁」项、不要求归零,也不参与场景判断
19
20
 
20
21
  ### 场景 A:通过且无问题
21
22
 
22
23
  ```text
23
24
  任务 {task-id} 技术方案审查完成。结论:通过。
24
- - 阻塞项:0 | 主要问题:0 | 次要问题:0[ | 环境性遗留:{n}(不在 AI 修复范围)]
25
+ - 阻塞项:0 | 主要问题:0 | 次要问题:0 | 人工裁决:{h}
25
26
  [- 审查报告:.agents/workspace/active/{task-id}/{review-artifact}]
26
27
 
27
28
  下一步 - 编写代码:
@@ -37,7 +38,7 @@
37
38
 
38
39
  ```text
39
40
  任务 {task-id} 技术方案审查完成。结论:通过。
40
- - 阻塞项:0 | 主要问题:{n} | 次要问题:{n}[ | 环境性遗留:{n}(不在 AI 修复范围)]
41
+ - 阻塞项:0 | 主要问题:{n} | 次要问题:{n} | 人工裁决:{h}
41
42
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
42
43
 
43
44
  下一步 - 修订方案后编码(推荐):
@@ -58,7 +59,7 @@
58
59
 
59
60
  ```text
60
61
  任务 {task-id} 技术方案审查完成。结论:需要修改。
61
- - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n}[ | 环境性遗留:{n}(不在 AI 修复范围)]
62
+ - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n} | 人工裁决:{h}
62
63
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
63
64
 
64
65
  下一步 - 修订技术方案:
@@ -74,7 +75,7 @@
74
75
 
75
76
  ```text
76
77
  任务 {task-id} 技术方案审查完成。结论:拒绝,需要重新设计。
77
- - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n}[ | 环境性遗留:{n}(不在 AI 修复范围)]
78
+ - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n} | 人工裁决:{h}
78
79
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
79
80
 
80
81
  下一步 - 重新设计:
@@ -59,6 +59,10 @@ Use this template when writing `review-plan.md` or `review-plan-r{N}.md`.
59
59
  > If this round has no env-blocked findings, keep the section heading and write "None".
60
60
 
61
61
 
62
+ ## Review Disagreement Ledger Writeback
63
+
64
+ > Upsert each finding this round into the task.md disagreement ledger: append an `open` row for new findings (id prefix `PL-`, stage=plan); per the hand-back duty set the executor's prior-round responses to `confirmed` / back to `open` / `needs-human-decision`. State machine and evidence rules: `.agents/rules/review-handshake.md`.
65
+
62
66
  ## Evidence
63
67
 
64
68
  > Pair each "I verified X" claim with the corresponding raw tool output; the gate only checks that this section exists and at least one `$ ` line is present. Every Blocker must be backed by a reproducible command (rg/grep/sed/nl) and its raw output; a judgment that cannot be reproduced must be downgraded or moved to Self-Doubt.
@@ -60,6 +60,10 @@
60
60
  > 如本轮无 env-blocked 项,保留段落标题并写「(无)」。
61
61
 
62
62
 
63
+ ## 审查分歧账本回写
64
+
65
+ > 把本轮每条 finding upsert 到 task.md `## 审查分歧账本`:新 finding 追加 `open` 行(id 前缀 `PL-`,stage=plan),对执行方上一轮响应按回交义务改 `confirmed` / 置回 `open` / `needs-human-decision`。状态机与证据规则见 `.agents/rules/review-handshake.md`。
66
+
63
67
  ## 证据原文
64
68
 
65
69
  > 每条“我验证了 X”断言都要配对对应 tool output 原文;gate 仅校验本段存在和至少一行 `$ `。每条 Blocker 必须配可复现命令(rg/grep/sed/nl)及其原文;无法复现的判断须降级或移入「自我质疑」。
@@ -13,6 +13,7 @@ Follow the `design-review` step in `.agents/workflows/feature-development.yaml`.
13
13
  - [ ] Test strategy covers critical paths, regression risks, and edge cases
14
14
  - [ ] Risks, migration, rollback, or compatibility handling are sufficient
15
15
  - [ ] The plan avoids over-design and unrelated scope expansion
16
+ - [ ] The reviewer checked whether the executor missed any key design decision that should be upgraded to `[needs-human-decision]`
16
17
  - [ ] Every blocker is backed by reproducible grep/sed/nl evidence; conclusions not directly verified are declared under Self-Doubt
17
18
 
18
19
  **Common anti-examples**:
@@ -13,6 +13,7 @@
13
13
  - [ ] 测试策略是否覆盖关键路径、回归风险和边界情况
14
14
  - [ ] 风险、迁移、回滚或兼容性处理是否充分
15
15
  - [ ] 方案是否避免过度设计和无关扩张
16
+ - [ ] 已复核执行方是否漏标应升级为 `[needs-human-decision]` 的关键设计决策
16
17
  - [ ] 每条 blocker 都配可复现的 grep/sed/nl 证据,未直接验证的结论已在「自我质疑」声明
17
18
 
18
19
  **常见反例**:
@@ -21,6 +21,16 @@ Version stamp rule: before creating or updating `task.md` frontmatter, read `.ag
21
21
 
22
22
  > If the `{task-id}` argument matches `^[#]?[0-9]+$` (a bare number or `#`-prefixed), first read the "SKILL argument parsing" section of `.agents/rules/task-short-id.md` to resolve it; subsequent commands treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form.
23
23
 
24
+ ## Step Start: Write the started Marker
25
+
26
+ After prerequisites pass and before this round's first artifact action, append a started marker to task.md `## Activity Log` (same base action as this round's done entry plus a ` [started]` suffix, note `started`):
27
+
28
+ ```
29
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Watch PR (Round {N}) [started]** by {agent} — started
30
+ ```
31
+
32
+ `ai task log` pairs it with the done entry written on completion onto one row (in progress → done). See the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
33
+
24
34
  ## Steps
25
35
 
26
36
  ### 1. Resolve Arguments
@@ -21,6 +21,16 @@ description: "监控 PR 的 required checks 并在失败时自愈"
21
21
 
22
22
  > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
23
23
 
24
+ ## 步骤开始:写入 started 标记
25
+
26
+ 确认前置条件后、本轮第一个产出动作之前,向 task.md `## 活动日志` 追加一条 started 标记(与本轮 done 条目同基名 + ` [started]` 后缀,note 用 `started`):
27
+
28
+ ```
29
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Watch PR (Round {N}) [started]** by {agent} — started
30
+ ```
31
+
32
+ `ai task log` 会把它与完成时写入的 done 条目配对成一行(进行中 → 已完成)。约定见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。
33
+
24
34
  ## 执行步骤
25
35
 
26
36
  ### 1. 解析入参
@@ -53,10 +53,22 @@ pr_status: pending # PR status: pending (default) | created (PR crea
53
53
 
54
54
  <!-- Populated by review-* -->
55
55
 
56
+ ## Review Disagreement Ledger
57
+
58
+ <!-- One row per review finding; state machine / evidence rules in .agents/rules/review-handshake.md. The phase-advance and complete-task gates read this section. Keep the header when there are no disagreements. -->
59
+
60
+ | id | stage | round | severity | status | evidence |
61
+ |----|-------|-------|----------|--------|----------|
62
+
63
+ ## Human Rulings
64
+
65
+ <!-- Humans record rulings for needs-human-decision decisions here and flip matching HD- rows in the Review Disagreement Ledger to human-decided. -->
66
+
56
67
  ## Activity Log
57
68
 
58
69
  <!-- Append a new entry for each workflow step. Do NOT overwrite previous entries. -->
59
70
  <!-- Format: - {YYYY-MM-DD HH:mm:ss±HH:MM} — **{step}** by {agent} — {brief summary} -->
71
+ <!-- Some workflow skills also write a started marker when the step begins (action suffixed with ` [started]`) and a done entry on completion; ai task log pairs them onto one row by base action. Convention: see .agents/rules/task-management.md. -->
60
72
 
61
73
  ## Completion Checklist
62
74
 
@@ -53,10 +53,22 @@ pr_status: pending # PR 状态:pending(默认)| created(已
53
53
 
54
54
  <!-- 由 review-* 填写 -->
55
55
 
56
+ ## 审查分歧账本
57
+
58
+ <!-- 每条 review finding 一行;状态机/证据规则见 .agents/rules/review-handshake.md。阶段推进与 complete-task gate 读取本段。无分歧时保留表头即可。 -->
59
+
60
+ | id | stage | round | severity | status | evidence |
61
+ |----|-------|-------|----------|--------|----------|
62
+
63
+ ## 人工裁决
64
+
65
+ <!-- 人类在此记录对 needs-human-decision 决策的裁定,并把 ## 审查分歧账本 对应 HD- 行翻为 human-decided。 -->
66
+
56
67
  ## 活动日志
57
68
 
58
69
  <!-- 每个工作流步骤追加一条新记录,不要覆盖之前的记录。 -->
59
70
  <!-- 格式:- {YYYY-MM-DD HH:mm:ss±HH:MM} — **{步骤}** by {执行者} — {简要说明} -->
71
+ <!-- 部分工作流 SKILL 在步骤开始时额外写一条 started 标记(action 末尾加 ` [started]`),完成时再写 done;ai task log 会按基名把两者配对成一行。约定见 .agents/rules/task-management.md。 -->
60
72
 
61
73
  ## 完成检查清单
62
74
 
@@ -56,7 +56,7 @@ jobs:
56
56
 
57
57
  - name: Checkout shared scripts
58
58
  if: steps.metadata.outputs.is_task_comment == 'true' && steps.metadata.outputs.type != ''
59
- uses: actions/checkout@v6
59
+ uses: actions/checkout@v7
60
60
  with:
61
61
  sparse-checkout: .github/scripts
62
62
  sparse-checkout-cone-mode: false
@@ -18,7 +18,7 @@ jobs:
18
18
  runs-on: ubuntu-latest
19
19
  steps:
20
20
  - name: Checkout base branch
21
- uses: actions/checkout@v6
21
+ uses: actions/checkout@v7
22
22
 
23
23
  - name: Sync in-labels
24
24
  env:
@@ -19,7 +19,7 @@ jobs:
19
19
  (github.event_name == 'issues' && github.event.action == 'closed' && github.event.issue.state_reason == 'completed') ||
20
20
  (github.event_name == 'issues' && github.event.action == 'reopened') ||
21
21
  (github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true)
22
- uses: actions/checkout@v6
22
+ uses: actions/checkout@v7
23
23
  with:
24
24
  sparse-checkout: .github/scripts
25
25
  sparse-checkout-cone-mode: false