@hmharness/cli 0.8.4 → 0.9.0
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/main.js +81 -0
- package/package.json +4 -4
package/dist/main.js
CHANGED
|
@@ -28,6 +28,7 @@ import { listSkills, listDrafts, promoteSkill, runBench, runEvolution, rollbackS
|
|
|
28
28
|
import { harmonyTools } from '@hmharness/domain-harmony';
|
|
29
29
|
import { baseTools, buildRegistry, buildSystemPrompt, runAgentTask, strings } from '@hmharness/agent';
|
|
30
30
|
const DIM = (s) => `\x1b[2m${s}\x1b[0m`;
|
|
31
|
+
const BOLD = (s) => `\x1b[1m${s}\x1b[0m`;
|
|
31
32
|
const CYAN = (s) => `\x1b[36m${s}\x1b[0m`;
|
|
32
33
|
const YELLOW = (s) => `\x1b[33m${s}\x1b[0m`;
|
|
33
34
|
const GREEN = (s) => `\x1b[32m${s}\x1b[0m`;
|
|
@@ -344,6 +345,10 @@ usage:
|
|
|
344
345
|
hmh experiment [list|show <id>|run <id> [--cases=N]|promote <id> [--human]|
|
|
345
346
|
rollback <target>] evolution candidates: control/treatment
|
|
346
347
|
bench arms + statistical promotion gate (V2 M9)
|
|
348
|
+
hmh dataset [list|build [ver]|show <ver> [--train|--eval]]
|
|
349
|
+
trajectory -> versioned, redacted, split dataset (V2 M10)
|
|
350
|
+
hmh route shadow-router stats: agreement rate + outcome split (V2 M10)
|
|
351
|
+
hmh readiness the RL gate: six conditions measured from real evidence (V2 M11)
|
|
347
352
|
hmh web start|stop|status web UI as a silent background daemon (no window,
|
|
348
353
|
survives closing everything; log ~/.hmharness/web.log)
|
|
349
354
|
hmh web [--port=7788] web UI in the foreground (debugging)
|
|
@@ -763,6 +768,82 @@ flags:
|
|
|
763
768
|
await startServer({ port: Number.isFinite(port) ? port : 7788, host: '127.0.0.1' });
|
|
764
769
|
return; // startServer keeps the process alive
|
|
765
770
|
}
|
|
771
|
+
if (cmd === 'dataset') {
|
|
772
|
+
// V2 M10: trajectory -> versioned dataset (filter/dedupe/reward/split)
|
|
773
|
+
await initHome();
|
|
774
|
+
const home = homeDir();
|
|
775
|
+
const E = await import('@hmharness/evolution');
|
|
776
|
+
const sub = rest[0] ?? 'list';
|
|
777
|
+
if (sub === 'build') {
|
|
778
|
+
const version = rest[1] && !rest[1].startsWith('--') ? rest[1] : undefined;
|
|
779
|
+
stdout.write(DIM('building dataset from runs/ …\n'));
|
|
780
|
+
const r = await E.buildDataset(home, { version });
|
|
781
|
+
const c = r.manifest.counts;
|
|
782
|
+
stdout.write(GREEN('✓') + ` ${r.manifest.version}: scanned ${c.scanned} → kept ${c.kept} (dropped ${c.dropped}, dupes ${c.duplicates})\n`);
|
|
783
|
+
stdout.write(` train ${c.train} / eval ${c.eval} (seed ${r.manifest.splitSeed}) · filter ${r.manifest.filterFingerprint}\n`);
|
|
784
|
+
stdout.write(` dir: ${r.dir}\n`);
|
|
785
|
+
return;
|
|
786
|
+
}
|
|
787
|
+
if (sub === 'list') {
|
|
788
|
+
const all = await E.listDatasets(home);
|
|
789
|
+
if (all.length === 0) {
|
|
790
|
+
stdout.write('no dataset versions (hmh dataset build)\n');
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
for (const m of all)
|
|
794
|
+
stdout.write(`${CYAN(m.version)} ${DIM(m.createdAt)} · kept ${m.counts.kept} (train ${m.counts.train}/eval ${m.counts.eval}) · filter ${m.filterFingerprint}\n`);
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
if (sub === 'show') {
|
|
798
|
+
const version = rest[1] ?? '';
|
|
799
|
+
const split = rest.includes('--eval') ? 'eval' : rest.includes('--train') ? 'train' : undefined;
|
|
800
|
+
const samples = await E.loadDataset(home, version, split);
|
|
801
|
+
if (samples.length === 0) {
|
|
802
|
+
stdout.write('no such dataset version or empty split\n');
|
|
803
|
+
return;
|
|
804
|
+
}
|
|
805
|
+
for (const s of samples.slice(0, 30)) {
|
|
806
|
+
stdout.write(`${s.reward.toFixed(1)} ${s.outcome.padEnd(12)} ${YELLOW(`t${s.turns}`)} ${DIM(s.runId.slice(0, 22))} ${s.task.slice(0, 56).replace(/\s+/g, ' ')}\n`);
|
|
807
|
+
}
|
|
808
|
+
if (samples.length > 30)
|
|
809
|
+
stdout.write(DIM(`… ${samples.length - 30} more\n`));
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
stdout.write('usage: hmh dataset [list|build [version]|show <version> [--train|--eval]]\n');
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
if (cmd === 'route') {
|
|
816
|
+
// V2 M10 shadow router stats: how often the adaptive suggestion disagrees
|
|
817
|
+
// with the live route, and whether disagreement correlates with outcomes
|
|
818
|
+
await initHome();
|
|
819
|
+
const home = homeDir();
|
|
820
|
+
const { routingStats } = await import('@hmharness/kernel');
|
|
821
|
+
const s = await routingStats(home);
|
|
822
|
+
stdout.write(`routing outcomes: ${s.total} · shadow agreed ${s.agreed} (disagreement ${(s.disagreementRate * 100).toFixed(0)}%)\n`);
|
|
823
|
+
for (const [reason, n] of Object.entries(s.byReason))
|
|
824
|
+
stdout.write(` ${DIM(reason)}: ${n}\n`);
|
|
825
|
+
if (s.successAgree !== null)
|
|
826
|
+
stdout.write(`success when agreed: ${(s.successAgree * 100).toFixed(0)}%${s.successDisagree !== null ? ` · when disagreed: ${(s.successDisagree * 100).toFixed(0)}%` : ''}\n`);
|
|
827
|
+
else
|
|
828
|
+
stdout.write(DIM('agreement/success split needs >=8 labeled rows per side\n'));
|
|
829
|
+
return;
|
|
830
|
+
}
|
|
831
|
+
if (cmd === 'readiness') {
|
|
832
|
+
// V2 M11: the RL gate. All six conditions measured from real evidence;
|
|
833
|
+
// closed gate names the optimization to do instead. No bypass exists.
|
|
834
|
+
await initHome();
|
|
835
|
+
const home = homeDir();
|
|
836
|
+
const { rlReadiness } = await import('@hmharness/evolution');
|
|
837
|
+
const r = await rlReadiness(home);
|
|
838
|
+
stdout.write(BOLD(r.verdict === 'rl-eligible' ? GREEN('RL-ELIGIBLE') : YELLOW('OPTIMIZE-FIRST')) + '\n');
|
|
839
|
+
for (const c of r.conditions) {
|
|
840
|
+
const mark = c.met ? GREEN('✓') : RED('✗');
|
|
841
|
+
stdout.write(` ${mark} ${c.id.padEnd(28)} ${String(c.current).slice(0, 40)} (need: ${String(c.threshold).slice(0, 44)})\n`);
|
|
842
|
+
}
|
|
843
|
+
if (r.recommendedLever)
|
|
844
|
+
stdout.write(DIM(`\nrecommended lever: ${r.recommendedLever} (skill/prompt/router optimization first - blueprint M11)\n`));
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
766
847
|
if (cmd === 'project') {
|
|
767
848
|
// V2 M8 project runtime (ADR-0002): checkpoints are plumbing snapshots -
|
|
768
849
|
// the user's index/refs/worktree are never touched; restore materializes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hmharness/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
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,12 +43,12 @@
|
|
|
43
43
|
"build": "tsc -p tsconfig.build.json"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@hmharness/kernel": "0.
|
|
46
|
+
"@hmharness/kernel": "0.9.0",
|
|
47
47
|
"@hmharness/observability": "0.7.0",
|
|
48
|
-
"@hmharness/evolution": "0.
|
|
48
|
+
"@hmharness/evolution": "0.9.0",
|
|
49
49
|
"@hmharness/domain-harmony": "0.8.0",
|
|
50
50
|
"@hmharness/domain-ops": "0.8.0",
|
|
51
|
-
"@hmharness/agent": "0.
|
|
51
|
+
"@hmharness/agent": "0.9.0",
|
|
52
52
|
"@hmharness/evaluation": "0.8.0",
|
|
53
53
|
"@hmharness/web": "0.8.2"
|
|
54
54
|
}
|