@dzhechkov/harness-cli 0.4.1 → 0.4.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/.dz-manifest.json CHANGED
@@ -9,7 +9,7 @@
9
9
  },
10
10
  {
11
11
  "path": "README.md",
12
- "sha256": "357bb891e287a2af120a66914085b3b7dec24092aa99f46a8767c096741d713f"
12
+ "sha256": "532051106b153c0d9bb7ad2abbeb71d418f88f1bc88e60a35e29cf42162af243"
13
13
  },
14
14
  {
15
15
  "path": "coverage/coverage-final.json",
@@ -37,15 +37,15 @@
37
37
  },
38
38
  {
39
39
  "path": "dist/cli.d.ts.map",
40
- "sha256": "a8cff82f9f31b06b6a5f1934747631fcc551945ee3b7ac2c620b7c25076303cc"
40
+ "sha256": "5bdc153e789ac180543e9b4955ea36666dc27b7238637b05875e048fc49ae30f"
41
41
  },
42
42
  {
43
43
  "path": "dist/cli.js",
44
- "sha256": "7afd2be99a3b9581b6fd8bfae58df6c608db346f741263c219d2140a5e8300ce"
44
+ "sha256": "0183c01a98e232554a7460be48ee5fdf59dd3a7d09c719a31b08acc9c6b3528c"
45
45
  },
46
46
  {
47
47
  "path": "dist/cli.js.map",
48
- "sha256": "481e6ddd256869585b3450ebe901057398a30bb8292e6f93f80a18d5c89ad0c0"
48
+ "sha256": "c5bd1b0b852dd21de328494d7a99db336afbde4397b7c687d416f1a6f3c297b2"
49
49
  },
50
50
  {
51
51
  "path": "dist/index.d.ts",
@@ -69,7 +69,7 @@
69
69
  },
70
70
  {
71
71
  "path": "package.json",
72
- "sha256": "5a2d203ef20d2b6179595627b4fa1856fd7e17a31b19690324f589487874f9e0"
72
+ "sha256": "4a164e5ac53ceec178463c1bdab9f80c1755311d5e4202c1f6234ca22c473b37"
73
73
  },
74
74
  {
75
75
  "path": "src/bin.ts",
@@ -77,7 +77,7 @@
77
77
  },
78
78
  {
79
79
  "path": "src/cli.ts",
80
- "sha256": "1aba996c4e5dd717a496074baa83778e8f2e04927689fc2cfc315033b8982b38"
80
+ "sha256": "0a1097fc3a2294f934fc50f5871b287cfbc5ec85becdab914b7caeca42cb7d1a"
81
81
  },
82
82
  {
83
83
  "path": "src/index.ts",
@@ -85,7 +85,7 @@
85
85
  },
86
86
  {
87
87
  "path": "test/cli.test.ts",
88
- "sha256": "e63d24934506b3d6c6ec7f67072273ed9c9dabb86e8a24a7838819217ca6035d"
88
+ "sha256": "c66bdd2fbbe2e0b622e3bc4e0e4521e865cc8088e581bd4b4862c1c550307900"
89
89
  },
90
90
  {
91
91
  "path": "test/epoch-replay-cli.test.ts",
@@ -189,7 +189,15 @@
189
189
  },
190
190
  {
191
191
  "path": "test/mutation-registry.json",
192
- "sha256": "36276fa51f9e5301ddb317687d0dbc839641b86f47f203e5d392bab31f4f178e"
192
+ "sha256": "fe8e5792626cf58678c1e2bcb809f63413655c2e171439157b74deb8b4fd80fb"
193
+ },
194
+ {
195
+ "path": "test/statusline-panel.test.ts",
196
+ "sha256": "b09b42c4ece1a83e5d3f3765629b0756a8f30a7122f3fc30363f93f092a44c0d"
197
+ },
198
+ {
199
+ "path": "test/trace-bundle-cli.test.ts",
200
+ "sha256": "fdaad63359ca7ce351e505e613b547bbc653e0847403edfae88d22a8a524b7a0"
193
201
  },
194
202
  {
195
203
  "path": "test/workflow-init-lint-clean.test.ts",
@@ -213,5 +221,5 @@
213
221
  }
214
222
  ]
215
223
  },
216
- "signature": "YV90oAIqb+16MFtctEUA4hH5x/O8BbGdAGh+eQ4HWJSxDwiRG3NxBDbDXFlUBvWKxwT/ttmcgKgaEE1ZHeIyDg=="
224
+ "signature": "wIo2tChkUqPT1qEHFeLlgbuzL29rRhhpVer4yaDmeuq7CsvdMeYN2QcttC496DwlepKeZ1EE3h2sSoY5w16qAA=="
217
225
  }
package/README.md CHANGED
@@ -1141,6 +1141,57 @@ 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
+ ### Move a run's telemetry to another machine (`workflow-trace export` / `import`)
1145
+
1146
+ A run leaves traces on the machine that produced it. `export` puts one run's telemetry into a single
1147
+ movable file; `import` reconstructs that run under a root you name.
1148
+
1149
+ ```bash
1150
+ dz workflow-trace export --slug my-feature --o my-feature.bundle.json
1151
+ dz workflow-trace import my-feature.bundle.json --into /other/project
1152
+ ```
1153
+
1154
+ **What a bundle carries** — the raw event lines (`trace.jsonl`, `.fa-state/checkpoints.jsonl`), the
1155
+ ledger rows selected for that run, optionally the training pairs, and `runMeta`: WHO ran each stage,
1156
+ read from the harness's own workflow records. **Events, never aggregates.** The one derived value —
1157
+ `attribution`, "which model ran which stage" — travels ALONGSIDE the records it was folded from,
1158
+ marked `derived`, naming its rule and the record ids, so a consumer that disagrees can recompute it.
1159
+ The rule is stated rather than implied: last-writer-wins by timestamp is a CHOICE — a run whose
1160
+ phases used different models has no single honest answer, and the map reports who ran it *last*.
1161
+
1162
+ **The ledger selector** matches a row by `runId`, or by `slug` when the row has no `runId` — because
1163
+ only `loop-run` rows carry a `runId`, so a `runId`-only filter would select nothing for a feature-adr
1164
+ run. The bundle reports rows scanned vs matched, so an empty slice is visibly empty rather than
1165
+ indistinguishable from an absent ledger.
1166
+
1167
+ **Consent does not travel inside the bundle.** Training pairs may contain target-repo code, so
1168
+ including them needs `--include-pairs --yes` at export AND `--with-pairs` at import; a pairs-bearing
1169
+ bundle imported without the flag writes no pair content.
1170
+
1171
+ **Import is fail-closed.** It reconstructs the run's native layout under `--into`, and REFUSES to
1172
+ write into a run directory that already has content unless it is the bundle's own run and `--force`
1173
+ is given; an identity mismatch refuses even under `--force`. A refused import writes nothing — not
1174
+ one file.
1175
+
1176
+ **Degradation is loud and typed**, and exactly one reason asks for action:
1177
+
1178
+ | reason | meaning | action |
1179
+ |---|---|---|
1180
+ | `records-absent` / `no-match` | no harness records, or none for this run | none |
1181
+ | `predates-model-routing` | a genuine older run, from before per-stage model routing | none — this is history |
1182
+ | `unreadable` | a record could not be parsed | look at that record |
1183
+ | `layout-unrecognised` | records exist and parse, but the fields we read are gone | **the harness record layout CHANGED — update the reader** |
1184
+
1185
+ By default a degraded export still succeeds and prints one named line per degraded member; `--strict`
1186
+ makes it exit non-zero so automation fails closed. The split exists because the actionable reason
1187
+ used to fire on normal data — three of thirty-two runs in a real store were simply older than
1188
+ per-stage routing — and an alarm that sounds on normal operation stops being an alarm.
1189
+
1190
+ **Honest scope:** `runMeta` is read from a store this project does not own, so its shape can change
1191
+ without notice. That is precisely what `layout-unrecognised` exists to announce, and why the reader
1192
+ refuses rather than half-parsing: a partially-read record would report a model-blind run as
1193
+ model-known.
1194
+
1144
1195
  **The v1 plan surface is deliberately NARROW and fully enacted** — `dz workflow validate` REJECTS
1145
1196
  (named diagnostics, never a silent no-op) anything the generated loop would not perform: retry
1146
1197
  timing (`initialDelayMs`/`backoffMultiplier`/`maxDelayMs`/`jitter` — v1 retries are immediate;
@@ -1245,6 +1296,8 @@ dz scout [--topics <list>] [--since <date>] [--deep] [--output <file
1245
1296
  dz workflow init --name <n> [--pattern pipeline|barrier|fanout|gate] [--o <plan.json>] | validate <plan.json> [--json] | render <plan.json> --o <script.js> [--check] [--force] | blobs [--check] # loop-plan/1 authoring (the ADR-005 templates are retired)
1246
1297
  dz workflow-lint <script.js> [--plan <plan.json>] [--require-plan|--legacy] [--json] # 17-rule deterministic gate; exit 0/1/3 — inconclusive is never a pass
1247
1298
  dz workflow-trace <runDir|--slug <s>|--run <id>> [--invariants <plan.json>] [--html <out.html>] [--json] # timeline + SEQ invariant runner over the loop's own trace.jsonl
1299
+ dz workflow-trace export <run> --o <file> [--include-pairs --yes] [--strict] # one run's telemetry as ONE movable file
1300
+ dz workflow-trace import <bundle> --into <root> [--force] [--with-pairs] # reconstruct that run; fail-closed against clobbering
1248
1301
  dz plugin [--version <ver>]
1249
1302
  dz downloads
1250
1303
  dz migrate [--project <dir>]
@@ -1303,7 +1356,46 @@ distills new learnings. It's **opt-in** and **non-clobbering**: `--install` merg
1303
1356
  existing `statusLine` config rather than overwriting it, and nothing changes until you run it.
1304
1357
  Modeled on the Agentic QE statusline pattern (e.g. AQE's `🎓 12 patterns`).
1305
1358
 
1359
+ #### Live run segment — `dz statusline --fa-record`
1360
+
1361
+ A long-running pipeline can PREPEND its own segment to that line, so the bar shows what is in
1362
+ flight rather than only the standing pattern count. The `/feature-adr` pipeline records its
1363
+ Pattern-memory state at each step; a generated `loop-designer` loop records its current step on
1364
+ every trace flush:
1365
+
1366
+ ```bash
1367
+ # the /feature-adr pipeline — reports the learning loop it is actually running
1368
+ dz statusline --fa-record --slug add-user-auth --step "Step 8 QE" --recalled 7 --stored 2 --mode full
1369
+
1370
+ # a generated loop — same file, different producer, so it says so
1371
+ dz statusline --fa-record --slug my-loop --step build --kind loop
1372
+ ```
1373
+
1374
+ ```
1375
+ 📐 feature-adr Step 8 QE · 🎓 224 pool · ↑7 used · +2 new · ↻0 reinforced · 🎓 dz: 224 patterns · 🧠 3 sources
1376
+ 🔁 loop build · 🎓 dz: 224 patterns · 🧠 3 sources
1377
+ ```
1378
+
1379
+ `--kind <feature-adr|loop>` names the PRODUCER and defaults to `feature-adr`; an unrecognised value
1380
+ exits 1 rather than silently weakening panel arbitration. It is load-bearing in two places:
1381
+
1382
+ - **the label**: a loop renders `🔁 loop <step>` and shows **no** learning counters, because a loop
1383
+ never populates them — a `↑0 used` there would be a false statement about the Pattern-memory loop
1384
+ rather than a measurement of it;
1385
+ - **the arbitration**: each producer writes its own per-slug slot under
1386
+ `.dz/feature-adr/learning-state/`, and a fresh `feature-adr` state outranks any `loop` state, so a
1387
+ loop running alongside a live pipeline can no longer blank that pipeline's counters. Slots are
1388
+ discovered newest-first, nothing older than 30 minutes is surfaced, and the write path prunes at
1389
+ 24 h. Use `--project <dir>` to pin the panel to a specific project root.
1390
+
1306
1391
  ### Usage estimate (`dz usage`)
1392
+ > **Pin the weekly reset to an ABSOLUTE instant.** `weeklyResetAnchor: "Wed 08:59"` is
1393
+ > server-timezone-relative — measured: the same moment lands a week apart under UTC vs `+03:00`, so
1394
+ > after a real account reset the counter can keep showing the OLD week for hours while printing the
1395
+ > "correct" clock time. Add your offset: `"Wed 08:59 +03:00"` in `.dz/config.json` — the boundary
1396
+ > then never moves with the machine's timezone, and `dz usage` prints the full anchor
1397
+ > (`resets Wed 08:59 +03:00`). Without an offset it warns on every run.
1398
+
1307
1399
 
1308
1400
  `dz usage` prints a READONLY, never-throw ESTIMATE of Claude SESSION and WEEKLY token usage,
1309
1401
  aggregated from your local `~/.claude/projects/**/*.jsonl` transcripts. Weekly counts start at the
@@ -1681,6 +1773,27 @@ dz backlog ship 268d3cb1 --reason "shipped in harness-core 0.3.151"
1681
1773
  # → dz backlog ship: 268d3cb1… new → shipped add a compounding metric …
1682
1774
  # (shipping an already-shipped idea is a SAID no-op, exit 0 — safe in cleanup batches)
1683
1775
  dz backlog drop 9286f5eb --reason "superseded by 268d3cb1" # retire without shipping (→ dropped)
1776
+ dz backlog edit 9286f5eb --text "corrected wording" # rewrite ONE idea's text; every other field
1777
+
1778
+ # feed the learned auto-cost routing from REAL run telemetry, then read its advice
1779
+ dz routing recommend # per-stage args.models suggestion, printed WITH its basis:
1780
+ # n runs, the time window, the grade-floor rule (success ⇔ QE grade ≥ B,
1781
+ # attributed run-level — an inference, and it says so), and every skipped
1782
+ # record with WHY. qe is FORCED to the cross-family of the code pick —
1783
+ # a same-family qe recommendation is unrepresentable, not filtered.
1784
+ dz routing recommend --apply # feed the samples into .dz/routing-outcomes.json (the store the
1785
+ # `auto-cost` plan spec reads) — idempotent by runId: a second apply
1786
+ # feeds 0 and names the skipped runs. Insufficient data is SAID
1787
+ # (cold-start pick + escalation chain), never dressed as a bar-met pick.
1788
+ # (status, effort, goal, uses…) is preserved byte-for-byte,
1789
+ # the previous text lands in .dz/backlog/edits.jsonl, and the
1790
+ # dedup vector is re-embedded in the same bounded form.
1791
+ # If the re-embed FAILS the edit still lands, exits 1, and the
1792
+ # record is MARKED embedStale — dedup then refuses to trust its
1793
+ # similarity (exact-text identity still applies) until
1794
+ # `dz vector reindex` repairs it. The guard sits where the harm
1795
+ # would be (the future duplicate verdict), not in a warning
1796
+ # nobody re-reads. --append adds instead of replacing; --dry-run previews.
1684
1797
  dz backlog reopen 268d3cb1 # changed your mind → back to the pool (new)
1685
1798
  # reopen on an already-new idea is REFUSED (exit 1) — that is almost always the wrong id.
1686
1799
  # Terminal→terminal never happens silently: ship on a dropped idea (or drop on shipped) is refused;
@@ -3190,7 +3303,7 @@ npx @dzhechkov/p-replicator init
3190
3303
 
3191
3304
  ## Status
3192
3305
 
3193
- `v0.4.1` — published on npm. Also available as [Claude Plugin](#claude-plugin). Part of [DZ Harness Hub](https://github.com/djd1m/dz-harness-hub).
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).
3194
3307
 
3195
3308
  ## Claude Plugin
3196
3309
 
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkbH,2EAA2E;AAC3E,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACjE;AAED,yFAAyF;AACzF,MAAM,MAAM,iBAAiB,GAAG,CAC9B,GAAG,EAAE,MAAM,E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