@qwen-code/arena-agent 0.0.10-dev.6 → 0.0.10-dev.8
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/.env.example +20 -9
- package/CHANGELOG.md +188 -0
- package/README.md +21 -19
- package/dist/agent.d.ts +8 -0
- package/dist/agent.js +32 -12
- package/dist/agent.js.map +1 -1
- package/dist/cli.js +87 -20
- package/dist/cli.js.map +1 -1
- package/dist/code-cli.js +0 -0
- package/dist/code-tools.d.ts +5 -0
- package/dist/code-tools.js +254 -64
- package/dist/code-tools.js.map +1 -1
- package/dist/compaction.d.ts +5 -0
- package/dist/compaction.js +57 -6
- package/dist/compaction.js.map +1 -1
- package/dist/config.d.ts +0 -2
- package/dist/config.js +1 -3
- package/dist/config.js.map +1 -1
- package/dist/file-edit.d.ts +2 -0
- package/dist/file-edit.js +9 -4
- package/dist/file-edit.js.map +1 -1
- package/dist/history.js +17 -0
- package/dist/history.js.map +1 -1
- package/dist/midturn-checkpoint-hook.d.ts +16 -0
- package/dist/midturn-checkpoint-hook.js +30 -0
- package/dist/midturn-checkpoint-hook.js.map +1 -0
- package/dist/provider.d.ts +0 -1
- package/dist/provider.js +13 -42
- package/dist/provider.js.map +1 -1
- package/dist/replay-responses.d.ts +17 -0
- package/dist/replay-responses.js +100 -0
- package/dist/replay-responses.js.map +1 -0
- package/dist/routify-web-fetch.js +18 -4
- package/dist/routify-web-fetch.js.map +1 -1
- package/dist/snapshot-client.d.ts +10 -0
- package/dist/snapshot-client.js +39 -0
- package/dist/snapshot-client.js.map +1 -0
- package/dist/tools.d.ts +2 -0
- package/dist/tools.js +134 -23
- package/dist/tools.js.map +1 -1
- package/dist/tui.js +1 -1
- package/dist/tui.js.map +1 -1
- package/dist/web-fetch-output.d.ts +9 -0
- package/dist/web-fetch-output.js +38 -0
- package/dist/web-fetch-output.js.map +1 -0
- package/docs/BINARY_DISTRIBUTION.md +25 -16
- package/docs/MODES_AND_RELEASES.md +28 -5
- package/package.json +5 -1
- package/scripts/README.md +62 -0
- package/scripts/check-changelog.mjs +66 -0
- package/dist/web/app.d.ts +0 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# 轨迹复刻脚本
|
|
2
|
+
|
|
3
|
+
本目录保存 DataWorks SQL Arena 轨迹数据的复刻与环境准备脚本。数据集位于
|
|
4
|
+
`tasks/`,运行产物位于 `tasks/reproductions/`。
|
|
5
|
+
|
|
6
|
+
## 通用脚本
|
|
7
|
+
|
|
8
|
+
`reproduce_case.mjs` 运行单个 case,`reproduce_all.mjs`
|
|
9
|
+
批量运行数据集中标记为可复刻的 case。
|
|
10
|
+
|
|
11
|
+
每个 case 可以通过可选的 `prepare.json` 声明运行前环境准备。没有配置时
|
|
12
|
+
prepare phase 是 no-op;存在配置时,单任务和批量入口都会在调用模型前自动
|
|
13
|
+
执行并校验。当前支持固定 Git commit、从原始 history 恢复附件和文件断言。
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# 单个 case;默认数据集可省略 --dataset
|
|
17
|
+
node scripts/reproduce_case.mjs --case 010
|
|
18
|
+
|
|
19
|
+
# 指定其他数据集
|
|
20
|
+
node scripts/reproduce_case.mjs \
|
|
21
|
+
--dataset /path/to/dataset \
|
|
22
|
+
--case 010
|
|
23
|
+
|
|
24
|
+
# 以 5 个并发运行全部可复刻 case
|
|
25
|
+
node scripts/reproduce_all.mjs \
|
|
26
|
+
--dataset /path/to/dataset \
|
|
27
|
+
--concurrency 5
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
单独验证某个 prepare 配置,不调用模型:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
node scripts/prepare_workspace.mjs \
|
|
34
|
+
--case-dir /path/to/dataset/cases/case-xxx \
|
|
35
|
+
--workspace /path/to/empty/workspace
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
脚本读取项目根目录 `.env` 中的 `ARENA_API_MODEL`、`OPENAI_BASE_URL` 和
|
|
39
|
+
`OPENAI_API_KEY`。固定生成参数由数据集自身的 `reproduction.config.json`
|
|
40
|
+
提供。
|
|
41
|
+
|
|
42
|
+
批量入口具有以下行为:
|
|
43
|
+
|
|
44
|
+
- 每个失败 case 自动重试一次。
|
|
45
|
+
- 第一次失败后删除该次失败目录。
|
|
46
|
+
- 成功或最终失败后,只保留该 case 最新的最终运行目录。
|
|
47
|
+
- prepare 失败时不会调用模型,错误会写入该次 `result.json`。
|
|
48
|
+
- 单次运行默认 60 分钟超时,可通过 `--timeout-minutes` 或
|
|
49
|
+
`ARENA_REPRO_TIMEOUT_MINUTES` 调整。
|
|
50
|
+
- `--case` 的退出码只反映本次指定 case,不受历史失败记录影响。
|
|
51
|
+
- `--clean` 仅在数据集清单和可复刻性审计验证通过后清理
|
|
52
|
+
`reproductions/`。
|
|
53
|
+
|
|
54
|
+
完整清理后重新运行:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
node scripts/reproduce_all.mjs \
|
|
58
|
+
--dataset /path/to/dataset \
|
|
59
|
+
--concurrency 5 \
|
|
60
|
+
--timeout-minutes 60 \
|
|
61
|
+
--clean
|
|
62
|
+
```
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
6
|
+
|
|
7
|
+
export function checkChangelog(directory = root) {
|
|
8
|
+
const { version } = JSON.parse(
|
|
9
|
+
readFileSync(path.join(directory, "package.json"), "utf8"),
|
|
10
|
+
);
|
|
11
|
+
const fail = (message) => {
|
|
12
|
+
throw new Error(`CHANGELOG.md: ${message}. Update the changelog before releasing ${version}.`);
|
|
13
|
+
};
|
|
14
|
+
let changelog;
|
|
15
|
+
try {
|
|
16
|
+
changelog = readFileSync(path.join(directory, "CHANGELOG.md"), "utf8");
|
|
17
|
+
} catch (error) {
|
|
18
|
+
if (error.code === "ENOENT") fail("file is missing");
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
// Examples and comments are not release notes.
|
|
22
|
+
const content = changelog
|
|
23
|
+
.replace(/<!--[^]*?-->/g, "")
|
|
24
|
+
.replace(/^(`{3,}|~{3,})[^\n]*\n[^]*?^\1[^\S\r\n]*$/gm, "");
|
|
25
|
+
const sections = [...content.matchAll(/^##[ \t]+(.+?)[ \t]*\r?$/gm)];
|
|
26
|
+
if (sections[0]?.[1] !== "[Unreleased]") {
|
|
27
|
+
fail("the first section must be ## [Unreleased]");
|
|
28
|
+
}
|
|
29
|
+
if (sections.filter((section) => section[1] === "[Unreleased]").length !== 1) {
|
|
30
|
+
fail("Unreleased must appear exactly once");
|
|
31
|
+
}
|
|
32
|
+
const currentSections = sections.filter((section) =>
|
|
33
|
+
section[1].startsWith(`[${version}]`),
|
|
34
|
+
);
|
|
35
|
+
if (currentSections.length !== 1 || currentSections[0] !== sections[1]) {
|
|
36
|
+
fail(`the newest release section must be a single ## [${version}] - YYYY-MM-DD`);
|
|
37
|
+
}
|
|
38
|
+
const current = currentSections[0];
|
|
39
|
+
const date = current[1].slice(`[${version}] - `.length);
|
|
40
|
+
if (
|
|
41
|
+
current[1] !== `[${version}] - ${date}` ||
|
|
42
|
+
!/^\d{4}-\d{2}-\d{2}$/.test(date) ||
|
|
43
|
+
!Number.isFinite(Date.parse(`${date}T00:00:00Z`)) ||
|
|
44
|
+
new Date(`${date}T00:00:00Z`).toISOString().slice(0, 10) !== date
|
|
45
|
+
) {
|
|
46
|
+
fail(`release ${version} needs a valid date in YYYY-MM-DD format`);
|
|
47
|
+
}
|
|
48
|
+
const body = content.slice(current.index + current[0].length, sections[2]?.index);
|
|
49
|
+
const entries = [...body.matchAll(/^[-*][ \t]+(.+?)\r?$/gm)];
|
|
50
|
+
if (!entries.some((entry) =>
|
|
51
|
+
/[\p{L}\p{N}]/u.test(entry[1]) &&
|
|
52
|
+
!/^(?:TODO|TBD|待补充|待填写|暂无)(?:[\s::.!!。…-]|$)/i.test(entry[1]),
|
|
53
|
+
)) {
|
|
54
|
+
fail(`release ${version} needs at least one non-placeholder change entry`);
|
|
55
|
+
}
|
|
56
|
+
return version;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
60
|
+
try {
|
|
61
|
+
console.log(`Changelog ready for ${checkChangelog()}`);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
console.error(error.message);
|
|
64
|
+
process.exitCode = 1;
|
|
65
|
+
}
|
|
66
|
+
}
|
package/dist/web/app.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|