@fitlab-ai/agent-infra 0.8.1 → 0.8.3
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.
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/bin/cli.ts +3 -3
- package/dist/bin/cli.js +4 -4
- package/dist/lib/cp.js +1 -1
- package/dist/lib/decide.js +2 -2
- package/dist/lib/defaults.json +2 -0
- package/dist/lib/init.js +7 -7
- package/dist/lib/merge.js +1 -1
- package/dist/lib/prompt.js +1 -1
- package/dist/lib/run/index.js +7 -7
- package/dist/lib/run/prompt.js +1 -1
- package/dist/lib/sandbox/capture.js +5 -5
- package/dist/lib/sandbox/clipboard/bridge.js +48 -13
- package/dist/lib/sandbox/clipboard/index.js +5 -6
- package/dist/lib/sandbox/clipboard/linux.js +91 -0
- package/dist/lib/sandbox/clipboard/paths.js +1 -1
- package/dist/lib/sandbox/clipboard/win32.js +144 -0
- package/dist/lib/sandbox/commands/create.js +101 -66
- package/dist/lib/sandbox/commands/enter.js +9 -9
- package/dist/lib/sandbox/commands/list-running.js +2 -2
- package/dist/lib/sandbox/commands/ls.js +7 -7
- package/dist/lib/sandbox/commands/prune.js +8 -8
- package/dist/lib/sandbox/commands/rebuild.js +38 -50
- package/dist/lib/sandbox/commands/refresh.js +2 -2
- package/dist/lib/sandbox/commands/rm.js +11 -11
- package/dist/lib/sandbox/commands/show.js +4 -4
- package/dist/lib/sandbox/commands/start.js +4 -4
- package/dist/lib/sandbox/commands/vm.js +4 -4
- package/dist/lib/sandbox/config.js +11 -5
- package/dist/lib/sandbox/constants.js +4 -1
- package/dist/lib/sandbox/credentials.js +1 -1
- package/dist/lib/sandbox/dotfiles.js +1 -1
- package/dist/lib/sandbox/engine.js +3 -3
- package/dist/lib/sandbox/engines/index.js +5 -5
- package/dist/lib/sandbox/engines/wsl2-paths.js +1 -1
- package/dist/lib/sandbox/image-build.js +80 -0
- package/dist/lib/sandbox/image-prune.js +2 -2
- package/dist/lib/sandbox/index.js +10 -10
- package/dist/lib/sandbox/managed-fs.js +1 -1
- package/dist/lib/sandbox/readme-scaffold.js +1 -1
- package/dist/lib/sandbox/runtimes/node20.dockerfile +1 -1
- package/dist/lib/sandbox/runtimes/node22.dockerfile +1 -1
- package/dist/lib/sandbox/tools.js +11 -2
- package/dist/lib/server/adapters/feishu/index.js +12 -3
- package/dist/lib/server/adapters/feishu/renderer.js +88 -0
- package/dist/lib/server/adapters/feishu/transport.js +9 -2
- package/dist/lib/server/daemon.js +64 -43
- package/dist/lib/server/display.js +83 -0
- package/dist/lib/server/index.js +2 -2
- package/dist/lib/server/process-control.js +2 -2
- package/dist/lib/server/protocol.js +22 -6
- package/dist/lib/server/streamer.js +5 -4
- package/dist/lib/task/commands/cat.js +2 -2
- package/dist/lib/task/commands/decisions.js +4 -4
- package/dist/lib/task/commands/files.js +3 -3
- package/dist/lib/task/commands/grep.js +3 -3
- package/dist/lib/task/commands/issue-body.js +4 -4
- package/dist/lib/task/commands/log.js +5 -5
- package/dist/lib/task/commands/ls.js +3 -3
- package/dist/lib/task/commands/show.js +1 -1
- package/dist/lib/task/commands/status.js +71 -25
- package/dist/lib/task/index.js +9 -9
- package/dist/lib/task/resolve-ref.js +1 -1
- package/dist/lib/task/workflow-warnings.js +94 -0
- package/dist/lib/update.js +35 -4
- package/lib/defaults.json +2 -0
- package/lib/sandbox/clipboard/bridge.ts +50 -8
- package/lib/sandbox/clipboard/index.ts +5 -6
- package/lib/sandbox/clipboard/linux.ts +124 -0
- package/lib/sandbox/clipboard/win32.ts +173 -0
- package/lib/sandbox/commands/create.ts +123 -65
- package/lib/sandbox/commands/rebuild.ts +42 -54
- package/lib/sandbox/config.ts +14 -2
- package/lib/sandbox/constants.ts +4 -0
- package/lib/sandbox/image-build.ts +134 -0
- package/lib/sandbox/runtimes/node20.dockerfile +1 -1
- package/lib/sandbox/runtimes/node22.dockerfile +1 -1
- package/lib/sandbox/tools.ts +9 -0
- package/lib/server/adapters/_contract.ts +3 -0
- package/lib/server/adapters/feishu/index.ts +12 -2
- package/lib/server/adapters/feishu/renderer.ts +99 -0
- package/lib/server/adapters/feishu/transport.ts +19 -3
- package/lib/server/daemon.ts +74 -38
- package/lib/server/display.ts +136 -0
- package/lib/server/protocol.ts +20 -4
- package/lib/server/streamer.ts +5 -4
- package/lib/task/commands/log.ts +3 -3
- package/lib/task/commands/status.ts +102 -21
- package/lib/task/workflow-warnings.ts +121 -0
- package/lib/update.ts +34 -0
- package/package.json +3 -3
- package/templates/.agents/README.en.md +3 -3
- package/templates/.agents/README.zh-CN.md +3 -3
- package/templates/.agents/rules/create-issue.github.en.md +3 -3
- package/templates/.agents/rules/create-issue.github.zh-CN.md +3 -3
- package/templates/.agents/rules/issue-pr-commands.github.en.md +7 -2
- package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +7 -2
- package/templates/.agents/rules/issue-sync.github.en.md +13 -0
- package/templates/.agents/rules/issue-sync.github.zh-CN.md +13 -0
- package/templates/.agents/rules/next-step-output.en.md +15 -1
- package/templates/.agents/rules/next-step-output.zh-CN.md +15 -1
- package/templates/.agents/rules/pr-sync.github.en.md +17 -2
- package/templates/.agents/rules/pr-sync.github.zh-CN.md +17 -2
- package/templates/.agents/rules/task-management.en.md +1 -1
- package/templates/.agents/rules/task-management.zh-CN.md +1 -1
- package/templates/.agents/scripts/platform-adapters/platform-sync.github.js +57 -0
- package/templates/.agents/scripts/validate-artifact.js +120 -0
- package/templates/.agents/scripts/workflow-warnings.js +290 -0
- package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +118 -0
- package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +118 -0
- package/templates/.agents/skills/complete-manual-validation/config/verify.en.json +49 -0
- package/templates/.agents/skills/complete-manual-validation/config/verify.zh-CN.json +49 -0
- package/templates/.agents/skills/complete-manual-validation/reference/report-template.en.md +48 -0
- package/templates/.agents/skills/complete-manual-validation/reference/report-template.zh-CN.md +48 -0
- package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +60 -0
- package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +87 -0
- package/templates/.agents/skills/create-pr/SKILL.en.md +2 -0
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +2 -0
- package/templates/.agents/skills/create-task/SKILL.en.md +4 -1
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +4 -1
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +33 -1
- package/templates/.agents/templates/task.en.md +7 -0
- package/templates/.agents/templates/task.zh-CN.md +7 -0
- package/templates/.claude/commands/complete-manual-validation.en.md +9 -0
- package/templates/.claude/commands/complete-manual-validation.zh-CN.md +9 -0
- package/templates/.gemini/commands/_project_/complete-manual-validation.en.toml +8 -0
- package/templates/.gemini/commands/_project_/complete-manual-validation.zh-CN.toml +8 -0
- package/templates/.github/workflows/metadata-sync.yml +5 -0
- package/templates/.opencode/commands/complete-manual-validation.en.md +11 -0
- package/templates/.opencode/commands/complete-manual-validation.zh-CN.md +11 -0
package/templates/.agents/skills/complete-manual-validation/reference/report-template.zh-CN.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# 人工验证完成报告模板
|
|
2
|
+
|
|
3
|
+
创建 `manual-validation.md` / `manual-validation-r{N}.md` 前先读取本文件。
|
|
4
|
+
|
|
5
|
+
````markdown
|
|
6
|
+
# 人工验证完成报告
|
|
7
|
+
|
|
8
|
+
- **验证轮次**:Round {N}
|
|
9
|
+
- **产物文件**:`manual-validation.md`
|
|
10
|
+
|
|
11
|
+
## 状态核对
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
$ git status -s
|
|
15
|
+
$ ls -la .agents/workspace/active/{task-id}/
|
|
16
|
+
$ tail .agents/workspace/active/{task-id}/task.md
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 验证结论
|
|
20
|
+
|
|
21
|
+
- 结论:通过
|
|
22
|
+
- 验证时间:{YYYY-MM-DD HH:mm:ss±HH:MM}
|
|
23
|
+
- 执行者:{agent}
|
|
24
|
+
|
|
25
|
+
## 验证范围
|
|
26
|
+
|
|
27
|
+
- PR:#{pr-number}
|
|
28
|
+
- 摘要评论:{comment-id 或 URL}
|
|
29
|
+
- 待人工校验项:
|
|
30
|
+
- {item-1}
|
|
31
|
+
|
|
32
|
+
## 验证详情
|
|
33
|
+
|
|
34
|
+
{verification-summary}
|
|
35
|
+
|
|
36
|
+
## PR 摘要同步
|
|
37
|
+
|
|
38
|
+
- 结果:{summary-result}
|
|
39
|
+
- 摘要评论:{comment-id 或 URL}
|
|
40
|
+
- 更新状态:`### ✅ 人工验证已通过`
|
|
41
|
+
````
|
|
42
|
+
|
|
43
|
+
## 填写规则
|
|
44
|
+
|
|
45
|
+
- `验证详情` 保留用户提供的人工验证说明,不改写成未经确认的结论。
|
|
46
|
+
- `验证范围` 来自 PR 摘要评论中的 `### ⚠️ 需人工校验` 段。
|
|
47
|
+
- `PR 摘要同步` 必须记录成功、跳过或失败结果。
|
|
48
|
+
- 只有在摘要评论已成功更新或无 diff 跳过时,才写入通过产物。
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# PR Summary Manual Validation Update
|
|
2
|
+
|
|
3
|
+
Read this file before `complete-manual-validation` updates the PR summary comment.
|
|
4
|
+
|
|
5
|
+
## Responsibility Boundary
|
|
6
|
+
|
|
7
|
+
This file only describes PR summary comment updates. The manual-validation artifact schema lives in `reference/report-template.md`.
|
|
8
|
+
|
|
9
|
+
## PR Number Resolution
|
|
10
|
+
|
|
11
|
+
1. Resolve `{task-ref}` to the task directory and read `task.md`.
|
|
12
|
+
2. Prefer `task.md` frontmatter `pr_number`.
|
|
13
|
+
3. If `pr_number` is empty, parse `{pr-ref}` from user input: `#123`, `123`, or a full PR URL.
|
|
14
|
+
4. If `task.md` already has `pr_number` and the user also passed `{pr-ref}`, they must match.
|
|
15
|
+
5. If they differ, fail with `summary failed: pr_number mismatch`. Do not write an artifact or PATCH a comment.
|
|
16
|
+
6. If both are missing, fail with `summary failed: missing pr_number`. Do not write an artifact or PATCH a comment.
|
|
17
|
+
|
|
18
|
+
## Required Reads
|
|
19
|
+
|
|
20
|
+
Before remote operations, read:
|
|
21
|
+
- `.agents/rules/issue-sync.md` to resolve upstream repository and permissions.
|
|
22
|
+
- `.agents/rules/pr-sync.md` to reuse the PR summary hidden marker, Issues comments API, and shell safety rules.
|
|
23
|
+
|
|
24
|
+
## Comment Lookup
|
|
25
|
+
|
|
26
|
+
Fetch ordinary PR comments with the current platform's Issues comments API. Follow the concrete command pattern in `.agents/rules/pr-sync.md`.
|
|
27
|
+
|
|
28
|
+
Find the `<!-- sync-pr:{task-id}:summary -->` summary comment. If it is missing, fail with `summary failed: missing sync-pr summary`.
|
|
29
|
+
|
|
30
|
+
On failure, do not create an ordinary validation comment, do not create a partial summary comment, and do not write a `manual-validation*` artifact.
|
|
31
|
+
|
|
32
|
+
## Manual Validation Scope Extraction
|
|
33
|
+
|
|
34
|
+
- If a `### ⚠️ Manual Verification Required` section exists, take that section until the next `### ` heading.
|
|
35
|
+
- If the current summary already says `### ✅ Manual Validation Passed`, allow a new validation artifact round and update the details.
|
|
36
|
+
- If the current summary says `### ✅ No Manual Verification Needed`, stop and report that this PR does not need manual validation; do not mark it as passed.
|
|
37
|
+
|
|
38
|
+
## Three-Branch Rendering
|
|
39
|
+
|
|
40
|
+
The updated `{manual-validation-section}` is:
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
### ✅ Manual Validation Passed
|
|
44
|
+
|
|
45
|
+
- Validation time: {time}
|
|
46
|
+
- Validation notes: {verification-summary}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Later `pr-sync` aggregation renders in this priority order:
|
|
50
|
+
1. latest `manual-validation.md` / `manual-validation-r{N}.md` has a passed verdict -> `### ✅ Manual Validation Passed`
|
|
51
|
+
2. no passed artifact and retained manual-validation items exist -> `### ⚠️ Manual Verification Required`
|
|
52
|
+
3. no passed artifact and no retained manual-validation items -> `### ✅ No Manual Verification Needed`
|
|
53
|
+
|
|
54
|
+
## PATCH Rules
|
|
55
|
+
|
|
56
|
+
Update existing comments with Issues comments PATCH and follow the heredoc safety rules in `.agents/rules/pr-sync.md`.
|
|
57
|
+
|
|
58
|
+
## Result Reporting
|
|
59
|
+
|
|
60
|
+
Return `summary updated`, `summary skipped (no diff)`, or `summary failed: <reason>`.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# PR 摘要人工验证更新
|
|
2
|
+
|
|
3
|
+
在 `complete-manual-validation` 更新 PR 摘要评论前先读取本文件。
|
|
4
|
+
|
|
5
|
+
## 职责边界
|
|
6
|
+
|
|
7
|
+
本文件只描述 PR 摘要评论更新流程。人工验证产物结构见 `reference/report-template.md`。
|
|
8
|
+
|
|
9
|
+
## PR 号解析
|
|
10
|
+
|
|
11
|
+
1. 从 `{task-ref}` 定位任务目录并读取 `task.md`。
|
|
12
|
+
2. 优先读取 `task.md` frontmatter 的 `pr_number`。
|
|
13
|
+
3. 如果 `pr_number` 为空,再从用户输入的 `{pr-ref}` 解析:
|
|
14
|
+
- `#123`
|
|
15
|
+
- `123`
|
|
16
|
+
- `{platform-host}/{owner}/{repo}/pull/123`
|
|
17
|
+
4. 如果 `task.md` 已有 `pr_number`,且用户也传入 `{pr-ref}`,两者必须一致。
|
|
18
|
+
5. 两者不一致时失败:`summary failed: pr_number mismatch`。不写 artifact,不 PATCH 评论。
|
|
19
|
+
6. 两者都缺失时失败:`summary failed: missing pr_number`。不写 artifact,不 PATCH 评论。
|
|
20
|
+
|
|
21
|
+
## 前置读取
|
|
22
|
+
|
|
23
|
+
执行远端操作前先读取:
|
|
24
|
+
- `.agents/rules/issue-sync.md`,完成 upstream 仓库检测和权限检测。
|
|
25
|
+
- `.agents/rules/pr-sync.md`,复用 PR 摘要隐藏标记、Issues comments API 和 Shell 安全规则。
|
|
26
|
+
|
|
27
|
+
## 评论查找
|
|
28
|
+
|
|
29
|
+
使用当前平台的 Issues comments API 查询 PR 上的普通评论,具体命令遵循 `.agents/rules/pr-sync.md`。
|
|
30
|
+
|
|
31
|
+
查找以以下标记开头或包含该标记的评论:
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<!-- sync-pr:{task-id}:summary -->
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
找不到时失败:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
summary failed: missing sync-pr summary
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
失败时不创建普通验证留言,不创建部分摘要评论,不写 `manual-validation*` artifact。
|
|
44
|
+
|
|
45
|
+
## 待人工校验范围提取
|
|
46
|
+
|
|
47
|
+
从当前摘要评论中提取人工校验范围:
|
|
48
|
+
- 如果存在 `### ⚠️ 需人工校验` 段,取该段到下一个 `### ` heading 之前的内容。
|
|
49
|
+
- 如果当前摘要已是 `### ✅ 人工验证已通过`,允许再次写入新一轮验证产物并更新详情。
|
|
50
|
+
- 如果当前摘要是 `### ✅ 无需人工校验`,停止并提示当前 PR 无需人工校验;不误标为人工验证已通过。
|
|
51
|
+
|
|
52
|
+
## 三分支渲染
|
|
53
|
+
|
|
54
|
+
更新后的 `{manual-validation-section}` 为:
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
### ✅ 人工验证已通过
|
|
58
|
+
|
|
59
|
+
- 验证时间:{time}
|
|
60
|
+
- 验证说明:{verification-summary}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
后续 `pr-sync` 聚合时按以下优先级渲染:
|
|
64
|
+
1. 最新 `manual-validation.md` / `manual-validation-r{N}.md` 结论为通过 -> `### ✅ 人工验证已通过`
|
|
65
|
+
2. 没有通过产物且仍有保留人工校验项 -> `### ⚠️ 需人工校验`
|
|
66
|
+
3. 没有通过产物且无保留人工校验项 -> `### ✅ 无需人工校验`
|
|
67
|
+
|
|
68
|
+
## PATCH 规则
|
|
69
|
+
|
|
70
|
+
更新已有评论时必须使用 Issues comments PATCH,具体命令遵循 `.agents/rules/pr-sync.md`。
|
|
71
|
+
|
|
72
|
+
Shell 安全规则:
|
|
73
|
+
- 先读取本地和远端正文,再构造完整正文。
|
|
74
|
+
- heredoc 使用单引号 `<<'EOF'`。
|
|
75
|
+
- 不在 heredoc 内执行变量展开或命令替换。
|
|
76
|
+
- 构造含 `<!-- -->` 的正文时不用 `echo`。
|
|
77
|
+
|
|
78
|
+
## 结果回传
|
|
79
|
+
|
|
80
|
+
返回以下结果之一:
|
|
81
|
+
- `summary updated`
|
|
82
|
+
- `summary skipped (no diff)`
|
|
83
|
+
- `summary failed: missing pr_number`
|
|
84
|
+
- `summary failed: pr_number mismatch`
|
|
85
|
+
- `summary failed: missing sync-pr summary`
|
|
86
|
+
- `summary failed: no manual validation required`
|
|
87
|
+
- `summary failed: <reason>`
|
|
@@ -165,3 +165,5 @@ Next step (alternative) - Skip monitoring and archive the task directly:
|
|
|
165
165
|
- Push rejected: suggest `git pull --rebase`
|
|
166
166
|
- Existing PR found: show the current PR URL and stop
|
|
167
167
|
- Inaccessible Issue metadata: skip inheritance and continue
|
|
168
|
+
- PR creation failed with an associated `{task-id}`: run `node .agents/scripts/workflow-warnings.js add .agents/workspace/active/{task-id} --step create-pr --severity ACTION_REQUIRED --code PR_CREATE_FAILED --target pr --message "{reason}" --action "Fix push, permission, or platform issues and rerun create-pr"` and do not write `pr_number`
|
|
169
|
+
- PR summary comment failed with an associated `{task-id}`: record a `COMMENT_SYNC_FAILED` warning per `.agents/rules/pr-sync.md`, without rolling back an already-created PR
|
|
@@ -165,3 +165,5 @@ node .agents/scripts/validate-artifact.js gate create-pr .agents/workspace/activ
|
|
|
165
165
|
- 推送被拒绝:建议执行 `git pull --rebase`
|
|
166
166
|
- 已存在 PR:直接输出当前 PR URL 并结束
|
|
167
167
|
- 无法访问 Issue 元数据:跳过继承并继续
|
|
168
|
+
- PR 创建失败且已关联 `{task-id}`:调用 `node .agents/scripts/workflow-warnings.js add .agents/workspace/active/{task-id} --step create-pr --severity ACTION_REQUIRED --code PR_CREATE_FAILED --target pr --message "{reason}" --action "修复推送、权限或平台问题后重跑 create-pr"`,不写 `pr_number`
|
|
169
|
+
- PR 摘要评论失败且已关联 `{task-id}`:按 `.agents/rules/pr-sync.md` 记录 `COMMENT_SYNC_FAILED` 告警,不回滚已创建 PR
|
|
@@ -135,7 +135,7 @@ The rule's content is determined by the configured code platform:
|
|
|
135
135
|
|
|
136
136
|
Handle the result:
|
|
137
137
|
- Rule successfully created the Issue: `issue_number` has been written back to task.md per the rule; continue by reading `.agents/rules/issue-sync.md`, completing upstream repository and permission detection, then sync the task comment and set `status: waiting-for-triage` by rule
|
|
138
|
-
- Rule failed (auth / network / template parse / etc.): do not roll back task.md; do NOT append an extra Activity Log entry;
|
|
138
|
+
- Rule failed (auth / network / template parse / etc.): do not roll back task.md; do NOT append an extra Activity Log entry; first run `node .agents/scripts/workflow-warnings.js add .agents/workspace/active/{task-id} --step create-task --severity ACTION_REQUIRED --code ISSUE_CREATE_FAILED --target issue --message "{error_code}: {error_message}" --action "Fix auth/network/template issues and manually retry Issue creation, or create/find an Issue and write issue_number"` to record a generic warning; then follow "Scenario C: Issue creation failed" output to surface `error_code` and `error_message`
|
|
139
139
|
- Rule was a no-op (custom or empty platform): do not create comments, do not block the workflow, and do not write an Activity Log entry
|
|
140
140
|
- task.md already has `issue_number`: the rule's prerequisite check skips creation; `create-task` proceeds directly to step 5
|
|
141
141
|
|
|
@@ -231,6 +231,9 @@ Next step - run requirements analysis:
|
|
|
231
231
|
- Codex CLI: $analyze-task {task-ref}
|
|
232
232
|
|
|
233
233
|
For later platform sync: after fixing auth / network / template issues, manually run the Issue creation flow in `.agents/rules/create-issue.md` for this task; or manually create/find an Issue and write `issue_number` into task.md so later skills can take over cascade sync.
|
|
234
|
+
|
|
235
|
+
[ACTION REQUIRED] Workflow warnings are open:
|
|
236
|
+
- WW-N ISSUE_CREATE_FAILED (issue): Fix auth/network/template issues and manually retry Issue creation, or create/find an Issue and write issue_number
|
|
234
237
|
```
|
|
235
238
|
|
|
236
239
|
|
|
@@ -134,7 +134,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
134
134
|
|
|
135
135
|
处理结果:
|
|
136
136
|
- 规则成功创建 Issue:`issue_number` 已按规则回写到 task.md;继续读取 `.agents/rules/issue-sync.md`,完成 upstream 仓库检测和权限检测,然后同步 task 评论并按规则设置 `status: waiting-for-triage`
|
|
137
|
-
- 规则失败(认证 / 网络 / 模板解析等):不回滚 task.md;不追加额外 Activity Log
|
|
137
|
+
- 规则失败(认证 / 网络 / 模板解析等):不回滚 task.md;不追加额外 Activity Log;先调用 `node .agents/scripts/workflow-warnings.js add .agents/workspace/active/{task-id} --step create-task --severity ACTION_REQUIRED --code ISSUE_CREATE_FAILED --target issue --message "{error_code}: {error_message}" --action "修复认证/网络/模板问题后手动重试 Issue 创建,或手动创建/找到 Issue 后写入 issue_number"` 记录通用告警;再按"场景 C:Issue 创建失败"输出向用户透出 `error_code` 与 `error_message`
|
|
138
138
|
- 规则为 no-op(自定义或空平台):不创建评论,不阻塞后续工作流,不写 Activity Log
|
|
139
139
|
- task.md 已存在 `issue_number`:规则中的前置检查会跳过;`create-task` 直接进入步骤 5
|
|
140
140
|
|
|
@@ -230,6 +230,9 @@ Issue 创建失败:
|
|
|
230
230
|
- Codex CLI:$analyze-task {task-ref}
|
|
231
231
|
|
|
232
232
|
后续如需平台同步:修复认证/网络/模板问题后,可按 `.agents/rules/create-issue.md` 对当前任务手动执行一次 Issue 创建;或手动创建/查找 Issue,并把 `issue_number` 写入 task.md,后续技能会接管级联同步。
|
|
233
|
+
|
|
234
|
+
[ACTION REQUIRED] Workflow warnings are open:
|
|
235
|
+
- WW-N ISSUE_CREATE_FAILED (issue): 修复认证/网络/模板问题后手动重试 Issue 创建,或手动创建/找到 Issue 后写入 issue_number
|
|
233
236
|
```
|
|
234
237
|
|
|
235
238
|
|
|
@@ -29,11 +29,13 @@ const DEFAULTS = {
|
|
|
29
29
|
"node22"
|
|
30
30
|
],
|
|
31
31
|
"tools": [
|
|
32
|
+
"agent-infra",
|
|
32
33
|
"claude-code",
|
|
33
34
|
"codex",
|
|
34
35
|
"gemini-cli",
|
|
35
36
|
"opencode"
|
|
36
37
|
],
|
|
38
|
+
"refreshIntervalDays": 7,
|
|
37
39
|
"dockerfile": null,
|
|
38
40
|
"vm": {
|
|
39
41
|
"cpu": null,
|
|
@@ -86,6 +88,9 @@ const DEFAULTS = {
|
|
|
86
88
|
};
|
|
87
89
|
|
|
88
90
|
const PACKAGE_NAME = '@fitlab-ai/agent-infra';
|
|
91
|
+
const AGENT_INFRA_SANDBOX_TOOL = 'agent-infra';
|
|
92
|
+
const LEGACY_DEFAULT_SANDBOX_TOOLS = ['claude-code', 'codex', 'gemini-cli', 'opencode'];
|
|
93
|
+
const DEFAULT_SANDBOX_TOOLS = [AGENT_INFRA_SANDBOX_TOOL, ...LEGACY_DEFAULT_SANDBOX_TOOLS];
|
|
89
94
|
// Add a new identifier here only after shipping matching .{platform}. template variants.
|
|
90
95
|
const KNOWN_PLATFORMS = new Set(['github']);
|
|
91
96
|
const KNOWN_LANGUAGES = new Set(['en', 'zh-CN']);
|
|
@@ -123,6 +128,26 @@ function isPathOwnedByDisabledTUI(rel, enabledSet) {
|
|
|
123
128
|
return false;
|
|
124
129
|
}
|
|
125
130
|
|
|
131
|
+
function isLegacyDefaultSandboxTools(value) {
|
|
132
|
+
if (!Array.isArray(value) || value.length !== LEGACY_DEFAULT_SANDBOX_TOOLS.length) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
const tools = new Set(value);
|
|
136
|
+
return LEGACY_DEFAULT_SANDBOX_TOOLS.every(tool => tools.has(tool));
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function migrateSandboxTools(cfg) {
|
|
140
|
+
const tools = cfg.sandbox?.tools;
|
|
141
|
+
if (!isLegacyDefaultSandboxTools(tools)) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
cfg.sandbox = {
|
|
145
|
+
...cfg.sandbox,
|
|
146
|
+
tools: [...DEFAULT_SANDBOX_TOOLS]
|
|
147
|
+
};
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
|
|
126
151
|
function norm(p) { return p.replace(/\\/g, '/'); }
|
|
127
152
|
|
|
128
153
|
function normDir(p) {
|
|
@@ -236,6 +261,12 @@ function listTemplateSkillNames(templateRoot) {
|
|
|
236
261
|
return new Set(
|
|
237
262
|
fs.readdirSync(templateSkillsDir, { withFileTypes: true })
|
|
238
263
|
.filter((entry) => entry.isDirectory())
|
|
264
|
+
.filter((entry) => {
|
|
265
|
+
const skillDir = path.join(templateSkillsDir, entry.name);
|
|
266
|
+
return ['SKILL.md', 'SKILL.en.md', 'SKILL.zh-CN.md'].some((file) =>
|
|
267
|
+
fs.existsSync(path.join(skillDir, file))
|
|
268
|
+
);
|
|
269
|
+
})
|
|
239
270
|
.map((entry) => entry.name)
|
|
240
271
|
);
|
|
241
272
|
}
|
|
@@ -1296,6 +1327,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1296
1327
|
) > 0;
|
|
1297
1328
|
|
|
1298
1329
|
const prevVersion = cfg.templateVersion;
|
|
1330
|
+
const sandboxToolsMigrated = migrateSandboxTools(cfg);
|
|
1299
1331
|
|
|
1300
1332
|
cfg.files.managed = managed;
|
|
1301
1333
|
cfg.files.merged = merged;
|
|
@@ -1303,7 +1335,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1303
1335
|
cfg.templateVersion = version;
|
|
1304
1336
|
delete cfg.templateSource;
|
|
1305
1337
|
|
|
1306
|
-
report.configUpdated = hasChanges || prevVersion !== version || hadTemplateSource;
|
|
1338
|
+
report.configUpdated = hasChanges || prevVersion !== version || hadTemplateSource || sandboxToolsMigrated;
|
|
1307
1339
|
|
|
1308
1340
|
fs.writeFileSync(cfgPath, JSON.stringify(cfg, null, 2) + '\n', 'utf8');
|
|
1309
1341
|
|
|
@@ -64,6 +64,13 @@ pr_status: pending # PR status: pending (default) | created (PR crea
|
|
|
64
64
|
|
|
65
65
|
<!-- Humans record rulings for needs-human-decision decisions here and flip matching HD- rows in the Review Disagreement Ledger to human-decided. -->
|
|
66
66
|
|
|
67
|
+
## Workflow Warnings
|
|
68
|
+
|
|
69
|
+
<!-- Workflow degradation, platform sync failures, permission gaps, and related events. Keep the header when empty. -->
|
|
70
|
+
|
|
71
|
+
| id | time | step | severity | code | status | target | message | action | resolved_at | resolution |
|
|
72
|
+
|----|------|------|----------|------|--------|--------|---------|--------|-------------|------------|
|
|
73
|
+
|
|
67
74
|
## Activity Log
|
|
68
75
|
|
|
69
76
|
<!-- Append a new entry for each workflow step. Do NOT overwrite previous entries. -->
|
|
@@ -64,6 +64,13 @@ pr_status: pending # PR 状态:pending(默认)| created(已
|
|
|
64
64
|
|
|
65
65
|
<!-- 人类在此记录对 needs-human-decision 决策的裁定,并把 ## 审查分歧账本 对应 HD- 行翻为 human-decided。 -->
|
|
66
66
|
|
|
67
|
+
## 工作流告警
|
|
68
|
+
|
|
69
|
+
<!-- 工作流降级、平台同步失败、权限不足等需要后续注意的事件写入此段。无告警时保留表头即可。 -->
|
|
70
|
+
|
|
71
|
+
| id | time | step | severity | code | status | target | message | action | resolved_at | resolution |
|
|
72
|
+
|----|------|------|----------|------|--------|--------|---------|--------|-------------|------------|
|
|
73
|
+
|
|
67
74
|
## 活动日志
|
|
68
75
|
|
|
69
76
|
<!-- 每个工作流步骤追加一条新记录,不要覆盖之前的记录。 -->
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Mark PR manual validation as completed and update the summary comment"
|
|
3
|
+
usage: "/complete-manual-validation <task-id> [pr-ref] <verification-summary>"
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Read and execute the complete-manual-validation skill from `.agents/skills/complete-manual-validation/SKILL.md`.
|
|
8
|
+
|
|
9
|
+
Follow all steps defined in the skill exactly.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "标记 PR 人工验证已完成并更新摘要评论"
|
|
3
|
+
usage: "/complete-manual-validation <task-id> [pr-ref] <verification-summary>"
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
读取并执行 `.agents/skills/complete-manual-validation/SKILL.md` 中的 complete-manual-validation 技能。
|
|
8
|
+
|
|
9
|
+
严格按照技能中定义的所有步骤执行。
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
description = "Mark PR manual validation as completed and update the summary comment"
|
|
2
|
+
prompt = """
|
|
3
|
+
Complete manual validation: {{args}}
|
|
4
|
+
|
|
5
|
+
Read and execute the complete-manual-validation skill from `.agents/skills/complete-manual-validation/SKILL.md`.
|
|
6
|
+
|
|
7
|
+
Follow all steps defined in the skill exactly.
|
|
8
|
+
"""
|
|
@@ -87,6 +87,11 @@ jobs:
|
|
|
87
87
|
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
|
88
88
|
TYPE: ${{ steps.metadata.outputs.type }}
|
|
89
89
|
run: |
|
|
90
|
+
OWNER_TYPE=$(gh api "repos/$GITHUB_REPOSITORY" --jq '.owner.type // empty' 2>/dev/null || true)
|
|
91
|
+
if [ "$OWNER_TYPE" != "Organization" ]; then
|
|
92
|
+
exit 0
|
|
93
|
+
fi
|
|
94
|
+
|
|
90
95
|
case "$TYPE" in
|
|
91
96
|
bug|bugfix) ISSUE_TYPE="Bug" ;;
|
|
92
97
|
feature|enhancement) ISSUE_TYPE="Feature" ;;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Mark PR manual validation as completed and update the summary comment"
|
|
3
|
+
agent: general
|
|
4
|
+
subtask: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Complete manual validation: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
Read and execute the complete-manual-validation skill from `.agents/skills/complete-manual-validation/SKILL.md`.
|
|
10
|
+
|
|
11
|
+
Follow all steps defined in the skill exactly.
|