@dzhechkov/harness-cli 0.3.241 → 0.3.242

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": "5b07e06ab04301ad1edfa9207b705266b57f3288f474f19ef7f22747237b6e67"
12
+ "sha256": "f10f682ab0a6a472d1bb52fb8c861d8b22669d579af8ddbbd392e2fb115cce67"
13
13
  },
14
14
  {
15
15
  "path": "coverage/coverage-final.json",
@@ -41,15 +41,15 @@
41
41
  },
42
42
  {
43
43
  "path": "dist/cli.d.ts.map",
44
- "sha256": "eb431a9aaed2c853b19a797cd49668bed9fe1e700880a8d18d9a1a4cfe243f55"
44
+ "sha256": "2efde3e98ca7843ac6260881eef51bfd3743e736425ed60fc73bdbebacdb54c6"
45
45
  },
46
46
  {
47
47
  "path": "dist/cli.js",
48
- "sha256": "9a46ece09ee1ac72ca3d7715ae86c1b5dc3747b18287c6f558a3c5d6569de7da"
48
+ "sha256": "88282ec4122a1e414dfb4c74e8583a49893b7ea0eba18d0cabe9ff50e72b0dec"
49
49
  },
50
50
  {
51
51
  "path": "dist/cli.js.map",
52
- "sha256": "02dcf19b1e616487f3840482e9af6f9028749b5a8c9d8da143126be5d7ee5779"
52
+ "sha256": "da8e7d578e7929880f0a87e240dac4a3a25afaf5c4da96442fbcb159f1eb0e07"
53
53
  },
54
54
  {
55
55
  "path": "dist/index.d.ts",
@@ -73,7 +73,7 @@
73
73
  },
74
74
  {
75
75
  "path": "package.json",
76
- "sha256": "dc78329bbed8510db61dc597124a455a1ce367f4ce1f0258a171ee6207ebb1e6"
76
+ "sha256": "7c10b138fb5cbb7c8ccba350863c100aea77a5fd2b2bd30fa08a3ea4260a0e4a"
77
77
  },
78
78
  {
79
79
  "path": "src/bin.ts",
@@ -81,7 +81,7 @@
81
81
  },
82
82
  {
83
83
  "path": "src/cli.ts",
84
- "sha256": "8477517b028f8258d5f11a2197167210de2db0acefa901f0f393579dc14bd409"
84
+ "sha256": "79d8ade45869b7a264d54da7fafda72a39953cab0d48f5ad504dd26657a54a1b"
85
85
  },
86
86
  {
87
87
  "path": "src/index.ts",
@@ -89,7 +89,7 @@
89
89
  },
90
90
  {
91
91
  "path": "test/cli.test.ts",
92
- "sha256": "3deb99917f3d8b4a5c9a3b0315bd65a3099ce2b508121cfa2bdeed19b7554d48"
92
+ "sha256": "a82b15dd9d166764479528e9f9ede45fc39d1b4068a96f19f158aa5a4c03369b"
93
93
  },
94
94
  {
95
95
  "path": "tsconfig.json",
@@ -101,5 +101,5 @@
101
101
  }
102
102
  ]
103
103
  },
104
- "signature": "cgLA1on1Innvb62VlQWouPeWuDW5Lo1E0W8Yq6p0N1rZ36HGvOxoLsYAYfFjYSikQ2QhM3NxE1CESshVuPh6Bw=="
104
+ "signature": "FZQ+o3JaRRSlZNY7rza0Neki2zXzDh2wKx2msyLIJhet1811uzEnhpQD5p7RYyfdNt8imOcGlI0eAax5PhxKBQ=="
105
105
  }
package/README.md CHANGED
@@ -434,6 +434,31 @@ dz parity — codex (capabilities: shell, skills, mcp)
434
434
  **When to use:** before promising a workflow to a teammate on Cursor/Codex/Hermes; when choosing
435
435
  a target for a project; as the requirements input for porting a feature to more targets.
436
436
 
437
+ ### Usage estimates you can act on — `dz usage`
438
+
439
+ `dz usage` estimates how much of your Claude session (5h block) and week you have spent, from local
440
+ transcripts. It drives feature-adr's pre-emptive "switch to Codex before the limit" routing.
441
+
442
+ Two things changed to make it mean something:
443
+
444
+ - **Cost-weighted, not a raw sum.** A flat token sum is 89–99.7% cache-read (MEASURED), which grows
445
+ with *conversation length*, not with work done — two sessions doing identical work differed by
446
+ orders of magnitude. Tokens are now **input-equivalents** (input 1x, cache-write 1.25x — 2x for a
447
+ 1-hour TTL write, cache-read 0.1x, output 5x).
448
+ - **Subagent transcripts count.** `<session>/subagents/*.jsonl` carry real, non-duplicated usage and
449
+ were silently excluded.
450
+
451
+ ```bash
452
+ dz usage # session ~13% (resets 10:24) · week ~15% (resets 08:59) · estimated
453
+ dz usage --json # machine-readable; pct is null when limits are unconfigured
454
+ dz usage --calibrate --session 42 --weekly 61 # teach it YOUR real numbers from claude.ai
455
+ ```
456
+
457
+ **`pct` is `null` until you configure limits — that is deliberate**, an unconfigured estimate is not
458
+ a guess dressed as a number. The authoritative calibration is `--calibrate` with the percentages
459
+ shown on claude.ai/settings/usage; absent that, limits set from your own observed peak mean "unusually
460
+ heavy **for you**", which is exactly what a pre-emptive routing switch needs.
461
+
437
462
  ### Do your skills actually register? — `dz skills-verify`
438
463
 
439
464
  Shipping a skill pack is not the same as a skill **registering**. A layout test that asserts
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;AAqRH,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;CAC5C;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;AAgvL9E,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,GAAE,KAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAoJ5E"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAqRH,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;CAC5C;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;AA2xL9E,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,GAAE,KAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAoJ5E"}
package/dist/cli.js CHANGED
@@ -4047,7 +4047,52 @@ function cmdClaimCheck(options, _optionLists, flags, cwd, write) {
4047
4047
  break;
4048
4048
  paths.push(p);
4049
4049
  }
4050
- const scanSet = paths.length > 0 ? paths.map((p) => resolve(root, p)) : defaultClaimScanSet(root);
4050
+ // A DIRECTORY argument used to hit EISDIR, be counted as "skipped", and still exit 0 — the gate
4051
+ // reported PASS having scanned nothing (MEASURED: `dz claim-check docs` said "1 skipped" and exited
4052
+ // 0 while `dz claim-check docs/*.md` found 7). Expand a directory into its markdown instead.
4053
+ const expandDir = (dir, depth = 0) => {
4054
+ if (depth > 6)
4055
+ return [];
4056
+ let entries;
4057
+ try {
4058
+ entries = readdirSync(dir);
4059
+ }
4060
+ catch {
4061
+ return [];
4062
+ }
4063
+ const out = [];
4064
+ for (const name of entries) {
4065
+ if (name.startsWith('.') || name === 'node_modules' || name === 'dist')
4066
+ continue;
4067
+ const full = join(dir, name);
4068
+ try {
4069
+ const st = statSync(full);
4070
+ if (st.isDirectory())
4071
+ out.push(...expandDir(full, depth + 1));
4072
+ else if (st.isFile() && name.toLowerCase().endsWith('.md'))
4073
+ out.push(full);
4074
+ }
4075
+ catch {
4076
+ /* unreadable entry — nothing to scan */
4077
+ }
4078
+ }
4079
+ return out;
4080
+ };
4081
+ const requested = paths.length > 0 ? paths.map((p) => resolve(root, p)) : defaultClaimScanSet(root);
4082
+ const scanSet = [];
4083
+ for (const p of requested) {
4084
+ let isDir = false;
4085
+ try {
4086
+ isDir = statSync(p).isDirectory();
4087
+ }
4088
+ catch {
4089
+ /* missing path stays in the set so it is reported as skipped, never silently dropped */
4090
+ }
4091
+ if (isDir)
4092
+ scanSet.push(...expandDir(p));
4093
+ else
4094
+ scanSet.push(p);
4095
+ }
4051
4096
  const findings = [];
4052
4097
  const scanned = [];
4053
4098
  for (const abs of scanSet) {
@@ -4088,6 +4133,13 @@ function cmdClaimCheck(options, _optionLists, flags, cwd, write) {
4088
4133
  write(`\n ${scanned.length} file(s) in scan set, ${skipped.length} skipped.`);
4089
4134
  for (const s of skipped)
4090
4135
  write(` skipped ${s.path} (${s.reason})`);
4136
+ // A gate that examined NOTHING must never report a pass. Previously an unreadable argument was
4137
+ // counted as "skipped" and the command still exited 0 — a clean bill of health over zero evidence.
4138
+ const readCount = scanned.filter((s) => s.status === 'scanned').length;
4139
+ if (readCount === 0 && scanned.length > 0) {
4140
+ write(' NOTHING was read — this is not a pass. Check the paths above.');
4141
+ return 1;
4142
+ }
4091
4143
  // Additive per-group rollup (ADR-001 C4): the widened default set can produce thousands of
4092
4144
  // findings; this summarizes WHERE they land (root README, packages/…, features/<slug>,
4093
4145
  // docs/<subdir>) WITHOUT hiding any — display-only, so `--json` shape and exit codes are