@dzhechkov/harness-cli 0.4.1 โ†’ 0.4.2

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": "4e4049b871ded58ff38fc36b60387a2324610db81dedcb623fb9cce6e77b057b"
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": "a260f0e8d698ac142b38e33ef4d4ed0a21ccee96b179514bcb01bf81c5dce00f"
41
41
  },
42
42
  {
43
43
  "path": "dist/cli.js",
44
- "sha256": "7afd2be99a3b9581b6fd8bfae58df6c608db346f741263c219d2140a5e8300ce"
44
+ "sha256": "b8a9c6d50cea7eda1065d76adb83e7c853ed9d82db72e7b24f952598e9dbd9d9"
45
45
  },
46
46
  {
47
47
  "path": "dist/cli.js.map",
48
- "sha256": "481e6ddd256869585b3450ebe901057398a30bb8292e6f93f80a18d5c89ad0c0"
48
+ "sha256": "4af214e9233bd8f37ab92b95b90fcf05bd46752ecdc0d9491484ee8a7e55c539"
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": "fa591b644f5abda81022a2cfe37996d739a2290ac46e09dcb958faa4e12be9f6"
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": "c9847974744f5bfd383866eb1832e97cb856e73d6f65cad19abfb91f22998cae"
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,11 @@
189
189
  },
190
190
  {
191
191
  "path": "test/mutation-registry.json",
192
- "sha256": "36276fa51f9e5301ddb317687d0dbc839641b86f47f203e5d392bab31f4f178e"
192
+ "sha256": "3dd056f9d05712e45173b0911fc5900f0f52f8deba506d57c0e2b8281eb36a74"
193
+ },
194
+ {
195
+ "path": "test/statusline-panel.test.ts",
196
+ "sha256": "b09b42c4ece1a83e5d3f3765629b0756a8f30a7122f3fc30363f93f092a44c0d"
193
197
  },
194
198
  {
195
199
  "path": "test/workflow-init-lint-clean.test.ts",
@@ -213,5 +217,5 @@
213
217
  }
214
218
  ]
215
219
  },
216
- "signature": "YV90oAIqb+16MFtctEUA4hH5x/O8BbGdAGh+eQ4HWJSxDwiRG3NxBDbDXFlUBvWKxwT/ttmcgKgaEE1ZHeIyDg=="
220
+ "signature": "nT7OzOloD2DCFR2ZYd4uWJ6isGyyfLiYk7v8hUKp4f0OTP0fTpsVvbDYJF9VvxASNVqwOGaQ7F6WQVu3NrkmBQ=="
217
221
  }
package/README.md CHANGED
@@ -1303,6 +1303,38 @@ distills new learnings. It's **opt-in** and **non-clobbering**: `--install` merg
1303
1303
  existing `statusLine` config rather than overwriting it, and nothing changes until you run it.
1304
1304
  Modeled on the Agentic QE statusline pattern (e.g. AQE's `๐ŸŽ“ 12 patterns`).
1305
1305
 
1306
+ #### Live run segment โ€” `dz statusline --fa-record`
1307
+
1308
+ A long-running pipeline can PREPEND its own segment to that line, so the bar shows what is in
1309
+ flight rather than only the standing pattern count. The `/feature-adr` pipeline records its
1310
+ Pattern-memory state at each step; a generated `loop-designer` loop records its current step on
1311
+ every trace flush:
1312
+
1313
+ ```bash
1314
+ # the /feature-adr pipeline โ€” reports the learning loop it is actually running
1315
+ dz statusline --fa-record --slug add-user-auth --step "Step 8 QE" --recalled 7 --stored 2 --mode full
1316
+
1317
+ # a generated loop โ€” same file, different producer, so it says so
1318
+ dz statusline --fa-record --slug my-loop --step build --kind loop
1319
+ ```
1320
+
1321
+ ```
1322
+ ๐Ÿ“ feature-adr Step 8 QE ยท ๐ŸŽ“ 224 pool ยท โ†‘7 used ยท +2 new ยท โ†ป0 reinforced ยท ๐ŸŽ“ dz: 224 patterns ยท ๐Ÿง  3 sources
1323
+ ๐Ÿ” loop build ยท ๐ŸŽ“ dz: 224 patterns ยท ๐Ÿง  3 sources
1324
+ ```
1325
+
1326
+ `--kind <feature-adr|loop>` names the PRODUCER and defaults to `feature-adr`; an unrecognised value
1327
+ exits 1 rather than silently weakening panel arbitration. It is load-bearing in two places:
1328
+
1329
+ - **the label**: a loop renders `๐Ÿ” loop <step>` and shows **no** learning counters, because a loop
1330
+ never populates them โ€” a `โ†‘0 used` there would be a false statement about the Pattern-memory loop
1331
+ rather than a measurement of it;
1332
+ - **the arbitration**: each producer writes its own per-slug slot under
1333
+ `.dz/feature-adr/learning-state/`, and a fresh `feature-adr` state outranks any `loop` state, so a
1334
+ loop running alongside a live pipeline can no longer blank that pipeline's counters. Slots are
1335
+ discovered newest-first, nothing older than 30 minutes is surfaced, and the write path prunes at
1336
+ 24 h. Use `--project <dir>` to pin the panel to a specific project root.
1337
+
1306
1338
  ### Usage estimate (`dz usage`)
1307
1339
 
1308
1340
  `dz usage` prints a READONLY, never-throw ESTIMATE of Claude SESSION and WEEKLY token usage,
@@ -3190,7 +3222,7 @@ npx @dzhechkov/p-replicator init
3190
3222
 
3191
3223
  ## Status
3192
3224
 
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).
3225
+ `v0.4.2` โ€” published on npm. Also available as [Claude Plugin](#claude-plugin). Part of [DZ Harness Hub](https://github.com/djd1m/dz-harness-hub).
3194
3226
 
3195
3227
  ## Claude Plugin
3196
3228
 
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,EACX,IAAI,EAAE;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,KACvD;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AA2xQ9E,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,GAAE,KAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAoK5E"}
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,EACX,IAAI,EAAE;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,KACvD;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAyyQ9E,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,GAAE,KAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAoK5E"}
package/dist/cli.js CHANGED
@@ -90,7 +90,7 @@ Usage:
90
90
  dz brain expand <kuId> [--source <slug>] [--json] (full-content lookup for a citation kuId; --json emits the full KU object)
91
91
  dz brain init [--project <dir>] [--k <N>] (wire the grounding hook into .claude/settings.json โ€” opt-in)
92
92
  dz statusline [--json] [--install] [--project <dir>] (live self-learning panel for Claude Code's status bar; reads the CC JSON payload from STDIN)
93
- dz statusline --fa-record --slug <s> --step "<label>" [--recalled <n>] [--stored <n>] [--mode <m>] (feature-adr: record live per-run learning state โ†’ ๐Ÿ“ panel segment)
93
+ dz statusline --fa-record --slug <s> --step "<label>" [--kind <feature-adr|loop>] [--recalled <n>] [--stored <n>] [--mode <m>] (feature-adr: record live per-run learning state โ†’ ๐Ÿ“ panel segment)
94
94
  dz usage [--json] [--project <dir>] | dz usage --calibrate --session <pct> --weekly <pct> [--model fable=<pct>] [--project <dir>] (ESTIMATE Claude usage from fixed reset windows; optional per-model weekly binding; exit 0 ALWAYS; pct=null when limits unconfigured)
95
95
  dz usage --by-stage [--run <runId> | --slug <slug>] [--epsilon <0..1>] [--write <file.jsonl>] [--json] (per-stage cost ledger for ONE feature-adr run + the reconciliation invariant: accounted + unaccounted = run total; verdict BALANCED | DEFECT | INSUFFICIENT_DATA; local transcript ESTIMATES โ€” catches ATTRIBUTION errors, not pricing errors)
96
96
  dz claim-check [paths...] [--json] [--fail-on high|medium|none] [--project <dir>] (enforce the Integrity Rule: flag untagged/overstated accuracy claims; default scan = root README.md + every discovered package's README.md + features/*/08_qe_report.md + docs/**/*.md (historical feature artifacts are NOT scanned โ€” pass paths explicitly); exit 1 only at/above --fail-on, default high)
@@ -1212,11 +1212,13 @@ function cmdStatuslineInstall(options, cwd, write) {
1212
1212
  /**
1213
1213
  * `dz statusline --fa-record` โ€” the entry point the `/feature-adr` pipeline calls at Steps 0/8/9 to
1214
1214
  * record its LIVE learning state (Pattern memory loop: pool / recalled / stored). Unlike the render
1215
- * path this WRITES `.dz/feature-adr/learning-state.json` (via harness-core's best-effort
1216
- * `writeFeatureAdrState`, which itself computes `pool` from the learned-pattern count).
1215
+ * path this WRITES a per-slug `.dz/feature-adr/learning-state/*.json` slot (via harness-core's
1216
+ * best-effort `writeFeatureAdrState`, which itself computes `pool` from the learned-pattern count).
1217
1217
  *
1218
1218
  * GUARD (feature-adr flag discipline): `--slug` and `--step` are required; a missing one exits 1
1219
1219
  * with a copy-paste example. `--recalled`/`--stored` default to 0 and reject non-numeric input.
1220
+ * `--kind <feature-adr|loop>` identifies the producer, defaults to `feature-adr`, and rejects any
1221
+ * other value rather than silently weakening panel arbitration.
1220
1222
  */
1221
1223
  function cmdStatuslineFaRecord(options, cwd, write) {
1222
1224
  const slug = (options.get('slug') ?? '').trim();
@@ -1248,10 +1250,16 @@ function cmdStatuslineFaRecord(options, cwd, write) {
1248
1250
  const reinforced = parseCount('reinforced');
1249
1251
  if (reinforced === undefined)
1250
1252
  return 1;
1253
+ const kindRaw = options.get('kind') ?? 'feature-adr';
1254
+ if (kindRaw !== 'feature-adr' && kindRaw !== 'loop') {
1255
+ write(`dz statusline --fa-record: --kind must be feature-adr or loop (got "${kindRaw}")`);
1256
+ write(' Example: dz statusline --fa-record --slug add-user-auth --step "Step 0" --kind feature-adr --recalled 5 --stored 2');
1257
+ return 1;
1258
+ }
1251
1259
  const mode = options.get('mode');
1252
1260
  const projectRoot = resolve(cwd, options.get('project') ?? '.');
1253
1261
  const state = writeFeatureAdrState(projectRoot, {
1254
- slug, step, recalled, stored,
1262
+ kind: kindRaw, slug, step, recalled, stored,
1255
1263
  ...(reinforced > 0 ? { reinforced } : {}),
1256
1264
  ...(mode !== undefined && mode.trim() !== '' ? { mode: mode.trim() } : {}),
1257
1265
  });
@@ -1294,7 +1302,13 @@ function cmdStatusline(options, flags, cwd, write, readStdin) {
1294
1302
  // Live /feature-adr run in flight โ†’ PREPEND the pipeline learning segment to the base dz line.
1295
1303
  const fa = data.featureAdr;
1296
1304
  if (fa !== undefined) {
1297
- line = `๐Ÿ“ feature-adr ${fa.step} ยท ๐ŸŽ“ ${fa.pool} pool ยท โ†‘${fa.recalled} used ยท +${fa.stored} new ยท โ†ป${fa.reinforced ?? 0} reinforced ยท ${line}`;
1305
+ // The producer marker reached data and arbitration in a previous round but not this label, so the bar asserted a pipeline that was not running.
1306
+ if (fa.kind === 'loop') {
1307
+ line = `๐Ÿ” loop ${fa.step} ยท ${line}`;
1308
+ }
1309
+ else {
1310
+ line = `๐Ÿ“ feature-adr ${fa.step} ยท ๐ŸŽ“ ${fa.pool} pool ยท โ†‘${fa.recalled} used ยท +${fa.stored} new ยท โ†ป${fa.reinforced ?? 0} reinforced ยท ${line}`;
1311
+ }
1298
1312
  }
1299
1313
  write(line);
1300
1314
  return 0;