@hmharness/cli 0.9.0 → 0.11.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.
Files changed (2) hide show
  1. package/dist/main.js +62 -0
  2. package/package.json +3 -3
package/dist/main.js CHANGED
@@ -349,6 +349,8 @@ usage:
349
349
  trajectory -> versioned, redacted, split dataset (V2 M10)
350
350
  hmh route shadow-router stats: agreement rate + outcome split (V2 M10)
351
351
  hmh readiness the RL gate: six conditions measured from real evidence (V2 M11)
352
+ hmh pipeline "<task>" role pipeline: plan→code→test→review→judge (+repair loop,
353
+ VERDICT gate) - V3 first slice (ADR-0006)
352
354
  hmh web start|stop|status web UI as a silent background daemon (no window,
353
355
  survives closing everything; log ~/.hmharness/web.log)
354
356
  hmh web [--port=7788] web UI in the foreground (debugging)
@@ -768,6 +770,66 @@ flags:
768
770
  await startServer({ port: Number.isFinite(port) ? port : 7788, host: '127.0.0.1' });
769
771
  return; // startServer keeps the process alive
770
772
  }
773
+ if (cmd === 'pipeline') {
774
+ // V3 first slice (ADR-0006): plan -> code -> test -> review -> judge with
775
+ // a bounded repair loop; the judge's VERDICT line is the only stage gate.
776
+ const task = rest.join(' ').trim();
777
+ if (!task) {
778
+ stdout.write('usage: hmh pipeline "<task>" [--repairs=N] [--turns=N] [--device=<hdc> --hap=<path> --bundle=<id> --ability=<name> --target=<t> --expect-log=<marker>]\n');
779
+ return;
780
+ }
781
+ await initHome();
782
+ const home = homeDir();
783
+ const cfg2 = await loadConfig();
784
+ const { reg: preg, clients: preClients } = await buildRegistry({ announce: false });
785
+ const A = await import('@hmharness/agent');
786
+ stdout.write(DIM(`pipeline: plan → code → test → review → judge (route ${cfg2.provider.model})\n`));
787
+ try {
788
+ const r = await A.runPipeline({
789
+ task,
790
+ provider: resolveProvider(cfg2, 'chat'),
791
+ registry: preg,
792
+ ctx: { cwd: process.cwd(), home },
793
+ model: cfg2.provider.model,
794
+ home,
795
+ locale: cfg2.locale,
796
+ maxRepairs: Number((rest.find((a) => a.startsWith('--repairs=')) ?? '').slice(10)) || 2,
797
+ maxTurnsPerStage: Number((rest.find((a) => a.startsWith('--turns=')) ?? '').slice(8)) || 6,
798
+ // V3 device gate (ADR-0007): --device=<hdc> enables the on-device
799
+ // install/launch/log-marker pass; hap/bundle/ability come from flags
800
+ ...(() => {
801
+ const dev = rest.find((a) => a.startsWith('--device='));
802
+ if (!dev)
803
+ return {};
804
+ const flag = (name) => (rest.find((a) => a.startsWith(`--${name}=`)) ?? '').split('=').slice(1).join('=');
805
+ return {
806
+ deviceGate: {
807
+ hdc: dev.slice(9),
808
+ ...(flag('target') ? { target: flag('target') } : {}),
809
+ hap: flag('hap'),
810
+ bundle: flag('bundle'),
811
+ ability: flag('ability') || 'EntryAbility',
812
+ expectLog: flag('expect-log') || 'onCreate',
813
+ },
814
+ };
815
+ })(),
816
+ });
817
+ for (const s of r.stages) {
818
+ const mark = s.verdict === 'PASS' ? GREEN('PASS') : s.verdict === 'FAIL' ? RED('FAIL') : DIM('····');
819
+ stdout.write(` ${mark} ${YELLOW(s.stage.padEnd(9))} #${s.attempt} ${DIM(`${s.turns}t ${s.toolUses}tools`)}\n`);
820
+ }
821
+ const verdict = r.finalVerdict === 'PASS' ? GREEN('VERDICT: PASS') : RED(`VERDICT: ${r.finalVerdict}`);
822
+ stdout.write(`${verdict} ${DIM(`· status ${r.status} · repairs ${r.repairsUsed} · report ${home}\\pipelines\\${r.pipelineId}`)}\n`);
823
+ }
824
+ catch (err) {
825
+ stdout.write(RED(String(err)) + '\n');
826
+ }
827
+ finally {
828
+ for (const c of preClients)
829
+ c.close();
830
+ }
831
+ return;
832
+ }
771
833
  if (cmd === 'dataset') {
772
834
  // V2 M10: trajectory -> versioned dataset (filter/dedupe/reward/split)
773
835
  await initHome();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmharness/cli",
3
- "version": "0.9.0",
3
+ "version": "0.11.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",
@@ -46,9 +46,9 @@
46
46
  "@hmharness/kernel": "0.9.0",
47
47
  "@hmharness/observability": "0.7.0",
48
48
  "@hmharness/evolution": "0.9.0",
49
- "@hmharness/domain-harmony": "0.8.0",
49
+ "@hmharness/domain-harmony": "0.11.0",
50
50
  "@hmharness/domain-ops": "0.8.0",
51
- "@hmharness/agent": "0.9.0",
51
+ "@hmharness/agent": "0.11.0",
52
52
  "@hmharness/evaluation": "0.8.0",
53
53
  "@hmharness/web": "0.8.2"
54
54
  }