@fitlab-ai/agent-infra 0.7.4 → 0.7.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 (75) 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/index.js +21 -21
  6. package/dist/lib/task/index.js +13 -13
  7. package/dist/lib/update.js +1 -1
  8. package/lib/init.ts +1 -1
  9. package/lib/merge.ts +1 -1
  10. package/lib/sandbox/index.ts +21 -21
  11. package/lib/task/index.ts +13 -13
  12. package/lib/update.ts +1 -1
  13. package/package.json +1 -1
  14. package/templates/.agents/rules/README.en.md +7 -3
  15. package/templates/.agents/rules/README.zh-CN.md +7 -3
  16. package/templates/.agents/rules/cli-help-format.en.md +49 -0
  17. package/templates/.agents/rules/cli-help-format.zh-CN.md +49 -0
  18. package/templates/.agents/rules/no-mid-flow-questions.en.md +14 -2
  19. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +14 -2
  20. package/templates/.agents/rules/pr-sync.github.en.md +8 -6
  21. package/templates/.agents/rules/pr-sync.github.zh-CN.md +8 -6
  22. package/templates/.agents/rules/review-handshake.en.md +83 -0
  23. package/templates/.agents/rules/review-handshake.zh-CN.md +83 -0
  24. package/templates/.agents/scripts/lib/post-review-commit.js +56 -0
  25. package/templates/.agents/scripts/lib/review-artifacts.js +117 -0
  26. package/templates/.agents/scripts/review-diff-fingerprint.js +99 -0
  27. package/templates/.agents/scripts/validate-artifact.js +240 -0
  28. package/templates/.agents/skills/analyze-task/SKILL.en.md +52 -6
  29. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +52 -6
  30. package/templates/.agents/skills/code-task/config/verify.en.json +3 -0
  31. package/templates/.agents/skills/code-task/config/verify.zh-CN.json +3 -0
  32. package/templates/.agents/skills/code-task/reference/fix-mode.en.md +5 -3
  33. package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +5 -3
  34. package/templates/.agents/skills/code-task/reference/report-template.en.md +4 -4
  35. package/templates/.agents/skills/code-task/reference/report-template.zh-CN.md +4 -4
  36. package/templates/.agents/skills/code-task/scripts/detect-mode.js +2 -107
  37. package/templates/.agents/skills/commit/SKILL.en.md +6 -0
  38. package/templates/.agents/skills/commit/SKILL.zh-CN.md +6 -0
  39. package/templates/.agents/skills/commit/reference/task-status-update.en.md +8 -0
  40. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +8 -0
  41. package/templates/.agents/skills/complete-task/SKILL.en.md +10 -0
  42. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +10 -0
  43. package/templates/.agents/skills/complete-task/config/verify.en.json +2 -0
  44. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +2 -0
  45. package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +1 -1
  46. package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +1 -1
  47. package/templates/.agents/skills/plan-task/SKILL.en.md +1 -1
  48. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +1 -1
  49. package/templates/.agents/skills/plan-task/config/verify.en.json +3 -0
  50. package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +3 -0
  51. package/templates/.agents/skills/review-analysis/config/verify.en.json +2 -1
  52. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +2 -1
  53. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +5 -4
  54. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +5 -4
  55. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +4 -0
  56. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +4 -0
  57. package/templates/.agents/skills/review-code/SKILL.en.md +4 -1
  58. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +4 -1
  59. package/templates/.agents/skills/review-code/config/verify.en.json +5 -2
  60. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +5 -2
  61. package/templates/.agents/skills/review-code/reference/output-templates.en.md +5 -4
  62. package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +5 -4
  63. package/templates/.agents/skills/review-code/reference/report-template.en.md +6 -0
  64. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +6 -0
  65. package/templates/.agents/skills/review-plan/config/verify.en.json +2 -1
  66. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +2 -1
  67. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +5 -4
  68. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +5 -4
  69. package/templates/.agents/skills/review-plan/reference/report-template.en.md +4 -0
  70. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +4 -0
  71. package/templates/.agents/templates/task.en.md +7 -0
  72. package/templates/.agents/templates/task.zh-CN.md +7 -0
  73. package/templates/.github/workflows/metadata-sync.yml +1 -1
  74. package/templates/.github/workflows/pr-label.yml +1 -1
  75. package/templates/.github/workflows/status-label.yml +1 -1
@@ -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)及其原文;无法复现的判断须降级或移入「自我质疑」。
@@ -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)及其原文;无法复现的判断须降级或移入「自我质疑」。
@@ -53,6 +53,13 @@ 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
+
56
63
  ## Activity Log
57
64
 
58
65
  <!-- Append a new entry for each workflow step. Do NOT overwrite previous entries. -->
@@ -53,6 +53,13 @@ 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
+
56
63
  ## 活动日志
57
64
 
58
65
  <!-- 每个工作流步骤追加一条新记录,不要覆盖之前的记录。 -->
@@ -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