@dzhechkov/harness-cli 0.4.3 → 0.4.4

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/.dz-manifest.json CHANGED
@@ -9,7 +9,7 @@
9
9
  },
10
10
  {
11
11
  "path": "README.md",
12
- "sha256": "532051106b153c0d9bb7ad2abbeb71d418f88f1bc88e60a35e29cf42162af243"
12
+ "sha256": "2f053f11ea49780919d0557877302e70adb8f33949299b0b0637ece2809c1b67"
13
13
  },
14
14
  {
15
15
  "path": "coverage/coverage-final.json",
@@ -69,7 +69,7 @@
69
69
  },
70
70
  {
71
71
  "path": "package.json",
72
- "sha256": "4a164e5ac53ceec178463c1bdab9f80c1755311d5e4202c1f6234ca22c473b37"
72
+ "sha256": "5bd26341b4a5885c116432bf621b7fdb4172b2604db47ad3c1c001deb4fe6ed4"
73
73
  },
74
74
  {
75
75
  "path": "src/bin.ts",
@@ -221,5 +221,5 @@
221
221
  }
222
222
  ]
223
223
  },
224
- "signature": "wIo2tChkUqPT1qEHFeLlgbuzL29rRhhpVer4yaDmeuq7CsvdMeYN2QcttC496DwlepKeZ1EE3h2sSoY5w16qAA=="
224
+ "signature": "dzYono+I+DXsxk1h8k2DAiNYKHmdzhwaUMDvvfFjCqzVFvYZecPnJQCLgT8i5NrpkaOQl2mbwU8bd3tyxQueDg=="
225
225
  }
package/README.md CHANGED
@@ -1141,6 +1141,108 @@ host run there is nothing to read, and it says so rather than inventing a timeli
1141
1141
  follows from the same boundary: on a non-Claude-Code target the authoring and lint verbs work
1142
1142
  unchanged, and only execution is absent.
1143
1143
 
1144
+ ### Build a loop for YOUR scenario — the end-to-end use case
1145
+
1146
+ You have a repeating multi-agent job of your own — say, **a weekly competitor digest: three
1147
+ competitors researched in parallel, one synthesis, and a quality gate that sends a weak digest back
1148
+ for a redo**. Here is the whole path, with real command output. Every command below was executed
1149
+ before being written down; the outputs are captures, not sketches.
1150
+
1151
+ **Install (once):**
1152
+
1153
+ ```bash
1154
+ npm i -g @dzhechkov/harness-cli # gives you the `dz` binary
1155
+ # or zero-install per call: npx @dzhechkov/harness-cli workflow init …
1156
+ ```
1157
+
1158
+ **The division of labour, honestly stated up front:** `dz` AUTHORS, GATES and READS loops — it never
1159
+ RUNS one. Execution belongs to a host with the `Workflow({scriptPath})` runtime, which today means
1160
+ **Claude Code**. So: author anywhere (Codex included), run under Claude Code.
1161
+
1162
+ #### Step 1 — scaffold the plan shape closest to your scenario
1163
+
1164
+ ```bash
1165
+ dz workflow init --name competitor-digest --pattern fanout --o digest.plan.json
1166
+ # → wrote digest.plan.json (pattern: fanout)
1167
+ # → Next: edit the TODO prompts, then `dz workflow validate` + `dz workflow render`.
1168
+ ```
1169
+
1170
+ Patterns: `pipeline` (A→B→C), `barrier` (all A, then B), `fanout` (N parallel lanes + a join),
1171
+ `gate` (a checked step with a redo route). The scaffold is a REAL plan with `TODO` prompts — not a
1172
+ template you fight.
1173
+
1174
+ #### Step 2 — make it yours (edit the JSON)
1175
+
1176
+ Fill the `TODO` prompts, name your lanes in `fanouts[].registry` (`["acme","globex","initech"]`),
1177
+ and add the quality gate with a redo route:
1178
+
1179
+ ```json
1180
+ "steps": [ …, { "stepId": "check", "kind": "gate", "phase": "Gate", "deps": ["synthesize"],
1181
+ "prompt": "…answer strictly GATE: PASS or GATE: FAIL as the last line",
1182
+ "budget": { "maxAgents": 2 } } ],
1183
+ "gates": [ { "stepId": "check", "kind": "quality", "failRoute": "synthesize", "maxRedos": 1 } ]
1184
+ ```
1185
+
1186
+ The plan surface is deliberately NARROW and fully enacted: anything the generated loop would not
1187
+ actually perform is REJECTED at validate time with a named `ENACT-*` diagnostic — never silently
1188
+ accepted and ignored.
1189
+
1190
+ #### Step 3 — validate, render, lint (the three gates before any run)
1191
+
1192
+ ```bash
1193
+ dz workflow validate digest.plan.json
1194
+ # → dz workflow validate: OK (digest sha256:6b6e92fc31b781fa…)
1195
+
1196
+ dz workflow render digest.plan.json --o digest.loop.js
1197
+ # → wrote digest.loop.plan.json then digest.loop.js (exec-fp sha256:a095d12e…, blobs: trace)
1198
+
1199
+ dz workflow-lint digest.loop.js --plan digest.loop.plan.json --require-plan
1200
+ # → dz workflow-lint: PASS (0 fail, 1 warn, 0 inconclusive over 17 rules)
1201
+ ```
1202
+
1203
+ `inconclusive` is never a pass, and the rendered script keeps your hand edits across re-renders
1204
+ (USER regions are preserved).
1205
+
1206
+ #### Step 4 — run it (Claude Code), read it back (anywhere)
1207
+
1208
+ In **Claude Code**, paste exactly this:
1209
+
1210
+ > Запусти мой цикл: `Workflow({ scriptPath: 'digest.loop.js', args: { items: ["acme","globex","initech"], traceDir: '<run dir>', runId: 'digest-2026-08-18' } })` — и когда закончит, покажи `dz workflow-trace` по этому прогону.
1211
+
1212
+ What a real run of THIS plan looks like (captured from an offline harness run of the rendered
1213
+ script): `lane:acme, lane:globex, lane:initech` in parallel → `synthesize` → `check` answers
1214
+ `GATE: FAIL` → the redo route re-runs `synthesize` → `check` answers `GATE: PASS` → `COMPLETED`.
1215
+ 13 agent calls, one ledger row, the trace flushed at every settle. Then:
1216
+
1217
+ ```bash
1218
+ dz workflow-trace <runDir> --html report.html # timeline + SEQ invariants over the loop's own trace
1219
+ ```
1220
+
1221
+ #### How to phrase the ASK — Claude Code vs Codex
1222
+
1223
+ **In Claude Code** (it has both `dz` and the `Workflow` runtime — one message does the whole thing):
1224
+
1225
+ > Собери мне цикл под сценарий: «<опиши свой — источники, что делает каждая полоса, как сводить,
1226
+ > какой критерий качества>». Используй `dz workflow init/validate/render/workflow-lint`, покажи мне
1227
+ > план НА СОГЛАСОВАНИЕ до рендера, потом запусти через `Workflow({scriptPath})` и дай ссылку на
1228
+ > `workflow-trace` отчёт.
1229
+
1230
+ The "покажи план до рендера" clause matters: the plan JSON is the one artifact worth your review —
1231
+ prompts, lanes, gate criteria, budgets — and it is small.
1232
+
1233
+ **In Codex** (or any shell-capable agent — AUTHORING only, honestly):
1234
+
1235
+ > In this repo, run `npx @dzhechkov/harness-cli workflow init --name <x> --pattern fanout --o x.plan.json`,
1236
+ > then edit the plan for this scenario: <describe>. Run `workflow validate` and fix every diagnostic
1237
+ > it names, then `workflow render` and `workflow-lint --require-plan`. Do NOT attempt to execute the
1238
+ > generated loop — it runs under Claude Code's `Workflow({scriptPath})` runtime; hand me the green
1239
+ > plan and the rendered script.
1240
+
1241
+ Codex is a fine plan AUTHOR — the validate/lint diagnostics are named and machine-checkable, so its
1242
+ edit loop converges. What it cannot do is run the result: the generated script calls the host's
1243
+ `agent()`/`parallel()` sandbox, which only the Claude Code Workflow runtime provides. A green lint
1244
+ from Codex + a run under Claude Code is a legitimate two-agent split.
1245
+
1144
1246
  ### Move a run's telemetry to another machine (`workflow-trace export` / `import`)
1145
1247
 
1146
1248
  A run leaves traces on the machine that produced it. `export` puts one run's telemetry into a single
@@ -3303,7 +3405,7 @@ npx @dzhechkov/p-replicator init
3303
3405
 
3304
3406
  ## Status
3305
3407
 
3306
- `v0.4.3` — published on npm. Also available as [Claude Plugin](#claude-plugin). Part of [DZ Harness Hub](https://github.com/djd1m/dz-harness-hub).
3408
+ `v0.4.4` — published on npm. Also available as [Claude Plugin](#claude-plugin). Part of [DZ Harness Hub](https://github.com/djd1m/dz-harness-hub).
3307
3409
 
3308
3410
  ## Claude Plugin
3309
3411
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dzhechkov/harness-cli",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "The dz CLI — install AI skills for Claude Code, Codex, OpenCode, Hermes, OpenClaude, GitHub Copilot. 35 commands, 13 presets, 6 platform targets.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/sbom.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "hashes": [
26
26
  {
27
27
  "alg": "SHA-256",
28
- "content": "532051106b153c0d9bb7ad2abbeb71d418f88f1bc88e60a35e29cf42162af243"
28
+ "content": "2f053f11ea49780919d0557877302e70adb8f33949299b0b0637ece2809c1b67"
29
29
  }
30
30
  ]
31
31
  },
@@ -175,7 +175,7 @@
175
175
  "hashes": [
176
176
  {
177
177
  "alg": "SHA-256",
178
- "content": "4a164e5ac53ceec178463c1bdab9f80c1755311d5e4202c1f6234ca22c473b37"
178
+ "content": "5bd26341b4a5885c116432bf621b7fdb4172b2604db47ad3c1c001deb4fe6ed4"
179
179
  }
180
180
  ]
181
181
  },