@hmharness/cli 0.21.2 → 0.21.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/dist/ablate-task.d.ts +1 -1
- package/dist/ablate-task.js +16 -3
- package/dist/main.js +6 -4
- package/package.json +12 -12
package/dist/ablate-task.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function runTaskAblation(write: (s: string) => void, home: () => string, runs: number): Promise<void>;
|
|
1
|
+
export declare function runTaskAblation(write: (s: string) => void, home: () => string, runs: number, difficulty?: 'easy' | 'mid'): Promise<void>;
|
package/dist/ablate-task.js
CHANGED
|
@@ -25,6 +25,17 @@ const TASKS = [
|
|
|
25
25
|
{ text: '用 run_command 执行 node -e "console.log(21*2)",只回复输出数字。', expect: '42', label: 'compute' },
|
|
26
26
|
{ text: '用 list_dir 列出 G:/hmharness/packages 下名为 kernel 的目录是否存在,只回复 是 或 否。', expect: '是', label: 'exists-check' },
|
|
27
27
|
];
|
|
28
|
+
/**
|
|
29
|
+
* MID-difficulty band (§26's measurable zone): multi-step extraction where
|
|
30
|
+
* bare-prompt runs sometimes slip — counting, sorted enumeration, version
|
|
31
|
+
* arithmetic. Expected values verified against the repo at authoring time.
|
|
32
|
+
*/
|
|
33
|
+
const MID_TASKS = [
|
|
34
|
+
{ text: '用 read_file 读取 G:/hmharness/packages/kernel/src/index.ts,统计包含 export 的行数,只回复该数字。', expect: '16', label: 'count-export' },
|
|
35
|
+
{ text: '读取 G:/hmharness/packages/cli/package.json,按字母序只列出全部 @hmharness 开头的依赖名,逗号分隔不要空格。', expect: '@hmharness/agent,@hmharness/cognitive,@hmharness/domain-harmony,@hmharness/domain-ops,@hmharness/environments,@hmharness/evaluation,@hmharness/evolution,@hmharness/kernel,@hmharness/observability,@hmharness/sandbox,@hmharness/web', label: 'sorted-deps' },
|
|
36
|
+
{ text: '读取 G:/hmharness/package.json 的 version 字段,计算 主版本+次版本+修订版 三个数字之和,只回复数字。', expect: '23', label: 'version-sum' },
|
|
37
|
+
{ text: '用 list_dir 查看 G:/hmharness/packages/cognitive/src/__tests__ 目录,统计其中 .test.ts 结尾的文件个数,只回复数字。', expect: '5', label: 'count-tests' },
|
|
38
|
+
];
|
|
28
39
|
function runOnce(task, bare, timeoutMs) {
|
|
29
40
|
return new Promise((resolve) => {
|
|
30
41
|
const child = spawn('npx', ['tsx', 'packages/cli/src/main.ts', '--yes', task], {
|
|
@@ -42,15 +53,16 @@ function runOnce(task, bare, timeoutMs) {
|
|
|
42
53
|
});
|
|
43
54
|
});
|
|
44
55
|
}
|
|
45
|
-
export async function runTaskAblation(write, home, runs) {
|
|
56
|
+
export async function runTaskAblation(write, home, runs, difficulty = 'easy') {
|
|
46
57
|
const homeDir = home();
|
|
47
|
-
|
|
58
|
+
const pool = difficulty === 'mid' ? MID_TASKS : TASKS;
|
|
59
|
+
write(`Terminal 域消融 · ${difficulty} 难度 · ${pool.length} 个可验证任务 × ${runs} 轮 × 双臂(§26 工作域测量)\n`);
|
|
48
60
|
let withOk = 0;
|
|
49
61
|
let bareOk = 0;
|
|
50
62
|
let total = 0;
|
|
51
63
|
const details = [];
|
|
52
64
|
for (let r = 1; r <= runs; r++) {
|
|
53
|
-
for (const t of
|
|
65
|
+
for (const t of pool) {
|
|
54
66
|
total += 1;
|
|
55
67
|
const a = await runOnce(t.text, false, 240_000);
|
|
56
68
|
const b = await runOnce(t.text, true, 240_000);
|
|
@@ -65,6 +77,7 @@ export async function runTaskAblation(write, home, runs) {
|
|
|
65
77
|
const record = {
|
|
66
78
|
at: new Date().toISOString(),
|
|
67
79
|
type: 'terminal-task',
|
|
80
|
+
difficulty,
|
|
68
81
|
runs,
|
|
69
82
|
withCognitive: { pass: withOk, total },
|
|
70
83
|
bare: { pass: bareOk, total },
|
package/dist/main.js
CHANGED
|
@@ -1220,16 +1220,18 @@ flags:
|
|
|
1220
1220
|
}
|
|
1221
1221
|
if (rest.includes('--task')) {
|
|
1222
1222
|
// §26 in the WORKING domain: verifiable terminal mini-tasks, same
|
|
1223
|
-
// model, digest on vs HMH_NO_COGNITIVE=1 — result-level harness delta
|
|
1223
|
+
// model, digest on vs HMH_NO_COGNITIVE=1 — result-level harness delta.
|
|
1224
|
+
// --difficulty=mid is the measurable band (bare runs sometimes slip).
|
|
1224
1225
|
const rounds = Number(rest.find((a) => a.startsWith('--runs='))?.slice(7) ?? 1);
|
|
1226
|
+
const difficulty = rest.includes('--difficulty=mid') ? 'mid' : 'easy';
|
|
1225
1227
|
const { runTaskAblation } = await import("./ablate-task.js");
|
|
1226
1228
|
const { homeDir: hd } = await import('@hmharness/kernel');
|
|
1227
|
-
await runTaskAblation((s) => stdout.write(s), hd, Number.isFinite(rounds) ? Math.min(Math.max(rounds, 1), 5) : 1);
|
|
1229
|
+
await runTaskAblation((s) => stdout.write(s), hd, Number.isFinite(rounds) ? Math.min(Math.max(rounds, 1), 5) : 1, difficulty);
|
|
1228
1230
|
return;
|
|
1229
1231
|
}
|
|
1230
1232
|
if (!rest.includes('--env=arc3')) {
|
|
1231
|
-
stdout.write('用法: hmh cognitive ablate --env=arc3 [--steps=N] | --task [--runs=N] | --stats\n');
|
|
1232
|
-
stdout.write(DIM(' --env=arc3: ARC 域(
|
|
1233
|
+
stdout.write('用法: hmh cognitive ablate --env=arc3 [--steps=N] | --task [--runs=N] [--difficulty=easy|mid] | --stats\n');
|
|
1234
|
+
stdout.write(DIM(' --env=arc3: ARC 域(上限); --task: terminal 域; --difficulty=mid: 中等难度区(结果层可测带); 结果落 cognitive/ablation.jsonl\n'));
|
|
1233
1235
|
return;
|
|
1234
1236
|
}
|
|
1235
1237
|
const steps = Number(rest.find((a) => a.startsWith('--steps='))?.slice(8) ?? 5);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hmharness/cli",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.3",
|
|
4
4
|
"description": "hmharness command line: one-shot tasks, an interactive REPL, a fullscreen TUI, the web frontend, and direct tool invocation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -43,17 +43,17 @@
|
|
|
43
43
|
"build": "tsc -p tsconfig.build.json"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@hmharness/agent": "0.21.
|
|
47
|
-
"@hmharness/cognitive": "0.21.
|
|
48
|
-
"@hmharness/domain-harmony": "0.21.
|
|
49
|
-
"@hmharness/domain-ops": "0.21.
|
|
50
|
-
"@hmharness/environments": "0.21.
|
|
51
|
-
"@hmharness/evaluation": "0.21.
|
|
52
|
-
"@hmharness/evolution": "0.21.
|
|
53
|
-
"@hmharness/kernel": "0.21.
|
|
54
|
-
"@hmharness/observability": "0.21.
|
|
55
|
-
"@hmharness/sandbox": "0.21.
|
|
56
|
-
"@hmharness/web": "0.21.
|
|
46
|
+
"@hmharness/agent": "0.21.3",
|
|
47
|
+
"@hmharness/cognitive": "0.21.3",
|
|
48
|
+
"@hmharness/domain-harmony": "0.21.3",
|
|
49
|
+
"@hmharness/domain-ops": "0.21.3",
|
|
50
|
+
"@hmharness/environments": "0.21.3",
|
|
51
|
+
"@hmharness/evaluation": "0.21.3",
|
|
52
|
+
"@hmharness/evolution": "0.21.3",
|
|
53
|
+
"@hmharness/kernel": "0.21.3",
|
|
54
|
+
"@hmharness/observability": "0.21.3",
|
|
55
|
+
"@hmharness/sandbox": "0.21.3",
|
|
56
|
+
"@hmharness/web": "0.21.3",
|
|
57
57
|
"qrcode": "^1.5.4"
|
|
58
58
|
}
|
|
59
59
|
}
|