@fitlab-ai/agent-infra 0.6.2 → 0.6.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 +13 -3
- package/README.zh-CN.md +10 -3
- package/bin/cli.ts +6 -1
- package/dist/bin/cli.js +6 -1
- package/dist/lib/sandbox/clipboard/bridge.js +216 -0
- package/dist/lib/sandbox/clipboard/darwin.js +73 -0
- package/dist/lib/sandbox/clipboard/index.js +9 -0
- package/dist/lib/sandbox/clipboard/keys.js +58 -0
- package/dist/lib/sandbox/clipboard/node-pty.js +13 -0
- package/dist/lib/sandbox/clipboard/paths.js +59 -0
- package/dist/lib/sandbox/commands/create.js +11 -2
- package/dist/lib/sandbox/commands/enter.js +8 -2
- package/dist/lib/sandbox/commands/ls.js +19 -4
- package/dist/lib/sandbox/commands/prune.js +176 -0
- package/dist/lib/sandbox/commands/rm.js +27 -33
- package/dist/lib/sandbox/config.js +1 -0
- package/dist/lib/sandbox/constants.js +6 -0
- package/dist/lib/sandbox/index.js +7 -1
- package/dist/lib/sandbox/managed-fs.js +25 -0
- package/dist/lib/sandbox/tools.js +1 -1
- package/dist/lib/version.js +9 -2
- package/lib/sandbox/clipboard/bridge.ts +285 -0
- package/lib/sandbox/clipboard/darwin.ts +90 -0
- package/lib/sandbox/clipboard/index.ts +13 -0
- package/lib/sandbox/clipboard/keys.ts +78 -0
- package/lib/sandbox/clipboard/node-pty.d.ts +19 -0
- package/lib/sandbox/clipboard/node-pty.ts +34 -0
- package/lib/sandbox/clipboard/paths.ts +71 -0
- package/lib/sandbox/commands/create.ts +15 -2
- package/lib/sandbox/commands/enter.ts +8 -2
- package/lib/sandbox/commands/ls.ts +28 -4
- package/lib/sandbox/commands/prune.ts +211 -0
- package/lib/sandbox/commands/rm.ts +30 -32
- package/lib/sandbox/config.ts +2 -0
- package/lib/sandbox/constants.ts +9 -0
- package/lib/sandbox/index.ts +7 -1
- package/lib/sandbox/managed-fs.ts +27 -0
- package/lib/sandbox/tools.ts +1 -1
- package/lib/version.ts +11 -4
- package/package.json +5 -1
- package/templates/.agents/README.en.md +19 -0
- package/templates/.agents/README.zh-CN.md +19 -0
- package/templates/.agents/skills/analyze-task/SKILL.en.md +26 -0
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +26 -0
- package/templates/.agents/skills/analyze-task/config/verify.en.json +51 -0
- package/templates/.agents/skills/analyze-task/config/{verify.json → verify.zh-CN.json} +6 -2
- package/templates/.agents/skills/complete-task/SKILL.en.md +15 -0
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +15 -0
- package/templates/.agents/skills/complete-task/config/{verify.json → verify.en.json} +10 -0
- package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +48 -0
- package/templates/.agents/skills/implement-task/SKILL.en.md +14 -0
- package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +14 -0
- package/templates/.agents/skills/implement-task/config/verify.en.json +51 -0
- package/templates/.agents/skills/implement-task/config/{verify.json → verify.zh-CN.json} +7 -2
- package/templates/.agents/skills/implement-task/reference/report-template.en.md +15 -0
- package/templates/.agents/skills/implement-task/reference/report-template.zh-CN.md +15 -0
- package/templates/.agents/skills/plan-task/SKILL.en.md +22 -0
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +22 -0
- package/templates/.agents/skills/plan-task/config/verify.en.json +52 -0
- package/templates/.agents/skills/plan-task/config/{verify.json → verify.zh-CN.json} +6 -2
- package/templates/.agents/skills/post-release/SKILL.en.md +1 -0
- package/templates/.agents/skills/post-release/SKILL.zh-CN.md +1 -0
- package/templates/.agents/skills/refine-task/SKILL.en.md +14 -0
- package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +14 -0
- package/templates/.agents/skills/refine-task/config/verify.en.json +47 -0
- package/templates/.agents/skills/refine-task/config/{verify.json → verify.zh-CN.json} +7 -2
- package/templates/.agents/skills/refine-task/reference/report-template.en.md +15 -0
- package/templates/.agents/skills/refine-task/reference/report-template.zh-CN.md +15 -0
- package/templates/.agents/skills/review-task/SKILL.en.md +14 -0
- package/templates/.agents/skills/review-task/SKILL.zh-CN.md +14 -0
- package/templates/.agents/skills/review-task/config/verify.en.json +50 -0
- package/templates/.agents/skills/review-task/config/{verify.json → verify.zh-CN.json} +5 -2
- package/templates/.agents/skills/review-task/reference/report-template.en.md +15 -0
- package/templates/.agents/skills/review-task/reference/report-template.zh-CN.md +15 -0
- package/dist/package.json +0 -5
|
@@ -24,6 +24,20 @@ description: "处理代码审查反馈并修复问题"
|
|
|
24
24
|
| 「顺手把旁边也优化了」 | 范围严格限定在审查项内,范围外改动属于越界。 |
|
|
25
25
|
| 「env-blocked 项清掉报告好看」 | env-blocked 不在修复范围,必须如实保留并标注,禁止 no-op 改动充数。 |
|
|
26
26
|
|
|
27
|
+
## 第 0 步:状态核对(执行前硬约束)
|
|
28
|
+
|
|
29
|
+
在加载 workflow / skill / rules 指令之后、做任何任务状态判断或用户可见结论之前,必须先执行状态核对。指令类文件读取不算对外动作或结论。
|
|
30
|
+
|
|
31
|
+
运行以下命令,并把原文粘贴到回复正文和本轮产物的 `## 状态核对` 段:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
git status -s
|
|
35
|
+
ls -la .agents/workspace/active/{task-id}/
|
|
36
|
+
tail .agents/workspace/active/{task-id}/task.md
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
状态核对完成前,禁止任何关于外部状态的断言(例如“代码没变”“测试已通过”“没有其他引用”),包括思考阶段。本门禁只提供结构下限;逐条证据配对和真实性仍需按报告模板与审查要求核对。
|
|
40
|
+
|
|
27
41
|
## 执行步骤
|
|
28
42
|
|
|
29
43
|
### 1. 验证前置条件
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill": "refine-task",
|
|
3
|
+
"checks": {
|
|
4
|
+
"task-meta": {
|
|
5
|
+
"required_fields": [
|
|
6
|
+
"id",
|
|
7
|
+
"type",
|
|
8
|
+
"workflow",
|
|
9
|
+
"status",
|
|
10
|
+
"created_at",
|
|
11
|
+
"updated_at",
|
|
12
|
+
"agent_infra_version",
|
|
13
|
+
"current_step",
|
|
14
|
+
"assigned_to"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"artifact": {
|
|
18
|
+
"file_pattern": "refinement.md|refinement-r{N}.md",
|
|
19
|
+
"required_sections": [
|
|
20
|
+
"Review Feedback Handling",
|
|
21
|
+
"Test Results After Refinement",
|
|
22
|
+
"State Check",
|
|
23
|
+
"Evidence"
|
|
24
|
+
],
|
|
25
|
+
"freshness_minutes": 30,
|
|
26
|
+
"required_patterns": [
|
|
27
|
+
"^\\$ "
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"activity-log": {
|
|
31
|
+
"expected_action_pattern": "Refinement \\(Round \\d+, for .+\\)",
|
|
32
|
+
"freshness_minutes": 30
|
|
33
|
+
},
|
|
34
|
+
"platform-sync": {
|
|
35
|
+
"when": "issue_number_exists",
|
|
36
|
+
"expected_status_label": "status: in-progress",
|
|
37
|
+
"expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
|
|
38
|
+
"verify_comment_content": true,
|
|
39
|
+
"verify_task_comment_content": true,
|
|
40
|
+
"verify_issue_type": true,
|
|
41
|
+
"verify_issue_fields": false,
|
|
42
|
+
"verify_milestone": true,
|
|
43
|
+
"expected_status_label_key": "inProgress",
|
|
44
|
+
"expected_comment_marker_key": "artifact"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -18,9 +18,14 @@
|
|
|
18
18
|
"file_pattern": "refinement.md|refinement-r{N}.md",
|
|
19
19
|
"required_sections": [
|
|
20
20
|
"审查反馈处理",
|
|
21
|
-
"修复后的测试结果"
|
|
21
|
+
"修复后的测试结果",
|
|
22
|
+
"状态核对",
|
|
23
|
+
"证据原文"
|
|
22
24
|
],
|
|
23
|
-
"freshness_minutes": 30
|
|
25
|
+
"freshness_minutes": 30,
|
|
26
|
+
"required_patterns": [
|
|
27
|
+
"^\\$ "
|
|
28
|
+
]
|
|
24
29
|
},
|
|
25
30
|
"activity-log": {
|
|
26
31
|
"expected_action_pattern": "Refinement \\(Round \\d+, for .+\\)",
|
|
@@ -12,6 +12,10 @@ Use this structure when writing `refinement.md` or `refinement-r{N}.md`.
|
|
|
12
12
|
- **Review Input**: `{review-artifact}`
|
|
13
13
|
- **Implementation Context**: `{implementation-artifact}`
|
|
14
14
|
|
|
15
|
+
## State Check
|
|
16
|
+
|
|
17
|
+
> Paste the raw state-check command output; each command starts with `$ `.
|
|
18
|
+
|
|
15
19
|
### Review Feedback Handling
|
|
16
20
|
|
|
17
21
|
#### Blocker Fixes
|
|
@@ -43,6 +47,17 @@ Use this structure when writing `refinement.md` or `refinement-r{N}.md`.
|
|
|
43
47
|
#### Unresolved Issues
|
|
44
48
|
- {issue}: {reason}
|
|
45
49
|
|
|
50
|
+
|
|
51
|
+
## Evidence
|
|
52
|
+
|
|
53
|
+
> 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.
|
|
54
|
+
|
|
55
|
+
- Claim: {verified claim}
|
|
56
|
+
```text
|
|
57
|
+
$ {command}
|
|
58
|
+
{raw output}
|
|
59
|
+
```
|
|
60
|
+
|
|
46
61
|
### Test Results After Refinement
|
|
47
62
|
- All tests passing: {yes/no}
|
|
48
63
|
- Test output: {summary}
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
- **审查输入**: `{review-artifact}`
|
|
13
13
|
- **实现上下文**: `{implementation-artifact}`
|
|
14
14
|
|
|
15
|
+
## 状态核对
|
|
16
|
+
|
|
17
|
+
> 粘贴状态核对命令原文;每条命令以 `$ ` 开头。
|
|
18
|
+
|
|
15
19
|
### 审查反馈处理
|
|
16
20
|
|
|
17
21
|
#### 阻塞项修复
|
|
@@ -43,6 +47,17 @@
|
|
|
43
47
|
#### 未解决问题
|
|
44
48
|
- {issue}: {reason}
|
|
45
49
|
|
|
50
|
+
|
|
51
|
+
## 证据原文
|
|
52
|
+
|
|
53
|
+
> 每条“我验证了 X”断言都要配对对应 tool output 原文;gate 仅校验本段存在和至少一行 `$ `。
|
|
54
|
+
|
|
55
|
+
- 断言:{verified claim}
|
|
56
|
+
```text
|
|
57
|
+
$ {command}
|
|
58
|
+
{raw output}
|
|
59
|
+
```
|
|
60
|
+
|
|
46
61
|
### 修复后的测试结果
|
|
47
62
|
- 所有测试通过: {yes/no}
|
|
48
63
|
- 测试输出: {summary}
|
|
@@ -22,6 +22,20 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
|
|
|
22
22
|
| "It looks mostly fine, so approve it." | The verdict must be backed by blocker/major/minor counts, and every finding must cite file:line; do not approve from impression. |
|
|
23
23
|
| "The test change looks reasonable, so I can skim it." | Before reviewing test changes, check `.agents/rules/testing-discipline.md` item by item (see the step 4 gate). |
|
|
24
24
|
|
|
25
|
+
## Step 0: State Check (pre-execution hard gate)
|
|
26
|
+
|
|
27
|
+
After loading workflow / skill / rules instructions, and before any task-state judgment or user-visible conclusion, run the state check first. Reading instruction files does not count as an external-state action or conclusion.
|
|
28
|
+
|
|
29
|
+
Run these commands and paste the raw output into both the user-facing reply and this round's `## State Check` section:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git status -s
|
|
33
|
+
ls -la .agents/workspace/active/{task-id}/
|
|
34
|
+
tail .agents/workspace/active/{task-id}/task.md
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Before the state check is complete, do not make external-state assertions such as "the code is unchanged", "tests passed", or "there are no other references", including in reasoning. This gate is only a structural floor; evidence pairing and authenticity still require the report template and review discipline.
|
|
38
|
+
|
|
25
39
|
## Steps
|
|
26
40
|
|
|
27
41
|
### 1. Verify Prerequisites
|
|
@@ -22,6 +22,20 @@ description: "审查任务实现并输出代码审查报告"
|
|
|
22
22
|
| 「大体没问题,给个 Approved」 | 结论必须由 blocker/major/minor 计数支撑,每个问题引用文件:行号,不能凭印象放行。 |
|
|
23
23
|
| 「测试改动看着合理,跳过细看」 | 审查测试变更前必须逐条核对 `.agents/rules/testing-discipline.md`(见步骤 4 门禁)。 |
|
|
24
24
|
|
|
25
|
+
## 第 0 步:状态核对(执行前硬约束)
|
|
26
|
+
|
|
27
|
+
在加载 workflow / skill / rules 指令之后、做任何任务状态判断或用户可见结论之前,必须先执行状态核对。指令类文件读取不算对外动作或结论。
|
|
28
|
+
|
|
29
|
+
运行以下命令,并把原文粘贴到回复正文和本轮产物的 `## 状态核对` 段:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git status -s
|
|
33
|
+
ls -la .agents/workspace/active/{task-id}/
|
|
34
|
+
tail .agents/workspace/active/{task-id}/task.md
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
状态核对完成前,禁止任何关于外部状态的断言(例如“代码没变”“测试已通过”“没有其他引用”),包括思考阶段。本门禁只提供结构下限;逐条证据配对和真实性仍需按报告模板与审查要求核对。
|
|
38
|
+
|
|
25
39
|
## 执行步骤
|
|
26
40
|
|
|
27
41
|
### 1. 验证前置条件
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill": "review-task",
|
|
3
|
+
"checks": {
|
|
4
|
+
"task-meta": {
|
|
5
|
+
"required_fields": [
|
|
6
|
+
"id",
|
|
7
|
+
"type",
|
|
8
|
+
"workflow",
|
|
9
|
+
"status",
|
|
10
|
+
"created_at",
|
|
11
|
+
"updated_at",
|
|
12
|
+
"agent_infra_version",
|
|
13
|
+
"current_step",
|
|
14
|
+
"assigned_to"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"artifact": {
|
|
18
|
+
"file_pattern": "review.md|review-r{N}.md",
|
|
19
|
+
"required_sections": [
|
|
20
|
+
"Review Summary",
|
|
21
|
+
"Findings",
|
|
22
|
+
"Environment-Blocked Findings",
|
|
23
|
+
"Conclusion and Recommendation",
|
|
24
|
+
"State Check",
|
|
25
|
+
"Evidence"
|
|
26
|
+
],
|
|
27
|
+
"required_patterns": [
|
|
28
|
+
"^### Approval Decision$",
|
|
29
|
+
"^\\$ "
|
|
30
|
+
],
|
|
31
|
+
"freshness_minutes": 30
|
|
32
|
+
},
|
|
33
|
+
"activity-log": {
|
|
34
|
+
"expected_action_pattern": "Code Review \\(Round \\d+\\)",
|
|
35
|
+
"freshness_minutes": 30
|
|
36
|
+
},
|
|
37
|
+
"platform-sync": {
|
|
38
|
+
"when": "issue_number_exists",
|
|
39
|
+
"expected_status_label": "status: in-progress",
|
|
40
|
+
"expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
|
|
41
|
+
"verify_comment_content": true,
|
|
42
|
+
"verify_task_comment_content": true,
|
|
43
|
+
"verify_issue_type": true,
|
|
44
|
+
"verify_issue_fields": false,
|
|
45
|
+
"verify_milestone": true,
|
|
46
|
+
"expected_status_label_key": "inProgress",
|
|
47
|
+
"expected_comment_marker_key": "artifact"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -13,6 +13,10 @@ Use this template when writing `review.md` or `review-r{N}.md`.
|
|
|
13
13
|
- `{implementation-artifact}`
|
|
14
14
|
- `{refinement-artifact}` (if present)
|
|
15
15
|
|
|
16
|
+
## State Check
|
|
17
|
+
|
|
18
|
+
> Paste the raw state-check command output; each command starts with `$ `.
|
|
19
|
+
|
|
16
20
|
## Review Summary
|
|
17
21
|
|
|
18
22
|
- **Reviewer**: {reviewer-name}
|
|
@@ -55,6 +59,17 @@ Use this template when writing `review.md` or `review-r{N}.md`.
|
|
|
55
59
|
|
|
56
60
|
> If this round has no env-blocked findings, keep the section heading and write "None".
|
|
57
61
|
|
|
62
|
+
|
|
63
|
+
## Evidence
|
|
64
|
+
|
|
65
|
+
> 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.
|
|
66
|
+
|
|
67
|
+
- Claim: {verified claim}
|
|
68
|
+
```text
|
|
69
|
+
$ {command}
|
|
70
|
+
{raw output}
|
|
71
|
+
```
|
|
72
|
+
|
|
58
73
|
## Highlights
|
|
59
74
|
|
|
60
75
|
- {what went well}
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
- `{implementation-artifact}`
|
|
14
14
|
- `{refinement-artifact}`(如存在)
|
|
15
15
|
|
|
16
|
+
## 状态核对
|
|
17
|
+
|
|
18
|
+
> 粘贴状态核对命令原文;每条命令以 `$ ` 开头。
|
|
19
|
+
|
|
16
20
|
## 审查摘要
|
|
17
21
|
|
|
18
22
|
- **审查者**:{reviewer-name}
|
|
@@ -55,6 +59,17 @@
|
|
|
55
59
|
|
|
56
60
|
> 如本轮无 env-blocked 项,保留段落标题并写「(无)」。
|
|
57
61
|
|
|
62
|
+
|
|
63
|
+
## 证据原文
|
|
64
|
+
|
|
65
|
+
> 每条“我验证了 X”断言都要配对对应 tool output 原文;gate 仅校验本段存在和至少一行 `$ `。
|
|
66
|
+
|
|
67
|
+
- 断言:{verified claim}
|
|
68
|
+
```text
|
|
69
|
+
$ {command}
|
|
70
|
+
{raw output}
|
|
71
|
+
```
|
|
72
|
+
|
|
58
73
|
## 亮点
|
|
59
74
|
|
|
60
75
|
- {what went well}
|