@dzhechkov/harness-cli 0.4.5 → 0.5.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.
package/sbom.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "hashes": [
26
26
  {
27
27
  "alg": "SHA-256",
28
- "content": "2f053f11ea49780919d0557877302e70adb8f33949299b0b0637ece2809c1b67"
28
+ "content": "27e2ddfd256e5c89a1c51a2520b52cc4b947dd7295f5730bde0a2c735186fb8f"
29
29
  }
30
30
  ]
31
31
  },
@@ -35,7 +35,17 @@
35
35
  "hashes": [
36
36
  {
37
37
  "alg": "SHA-256",
38
- "content": "e539390d6899ede6cdd0acb76cae6c58e90d4fb3d4389c00dce8604a014aeea7"
38
+ "content": "d2eef62228d4f2b31f5c7fca703f0f6844cf517d41be9dee516f3489f5babfec"
39
+ }
40
+ ]
41
+ },
42
+ {
43
+ "type": "file",
44
+ "name": "coverage/coverage-summary.json",
45
+ "hashes": [
46
+ {
47
+ "alg": "SHA-256",
48
+ "content": "981eef381eb1e9a040a31eaa561ea078c6f6711d9908990e796d5213d6ffe89f"
39
49
  }
40
50
  ]
41
51
  },
@@ -45,7 +55,7 @@
45
55
  "hashes": [
46
56
  {
47
57
  "alg": "SHA-256",
48
- "content": "58be9f04d2fe63cca2efe3957b9933068e443a0e57f9838ff9ef800cc191e03f"
58
+ "content": "1d651fdfe05fc306c857bbbee44c395b63b39c1e0c53a8166eb7ca43c6cfa157"
49
59
  }
50
60
  ]
51
61
  },
@@ -55,7 +65,7 @@
55
65
  "hashes": [
56
66
  {
57
67
  "alg": "SHA-256",
58
- "content": "b1e41c8c19fa56ae9dec2267740eb4389bc785431478861a8843867f99c1b25b"
68
+ "content": "74105b3edb4c4a7d75393a7cb2dda06a0f545b1cce75e9a772a30b18b3609374"
59
69
  }
60
70
  ]
61
71
  },
@@ -65,7 +75,7 @@
65
75
  "hashes": [
66
76
  {
67
77
  "alg": "SHA-256",
68
- "content": "c4a6b64f875db72a2897df0e3b0c7cd279308dba2471ae29a57775dad7a7d8f8"
78
+ "content": "e215d5ebb9d87106c3bdfda29c8cb1af59bc9bdbd62c11b2b6a313a2bd3ecd7c"
69
79
  }
70
80
  ]
71
81
  },
@@ -75,7 +85,7 @@
75
85
  "hashes": [
76
86
  {
77
87
  "alg": "SHA-256",
78
- "content": "9661e4d167ea1c13c3f40de510f311024da3c44bcb452d3781fb89f46373eadc"
88
+ "content": "31849f2576f6e57a8a71f49cbb1a6e6c692f98dd8303217ec836933420d08dac"
79
89
  }
80
90
  ]
81
91
  },
@@ -85,7 +95,7 @@
85
95
  "hashes": [
86
96
  {
87
97
  "alg": "SHA-256",
88
- "content": "9afd7c4a02708d7d425214c5d3b76a2ad7bd5ea3ba6c725e4880a91d76062f34"
98
+ "content": "56db11f99b505b2ffbc314aa70b4bcd17ec741e14ca99a3662d0ca9f4afcc1cc"
89
99
  }
90
100
  ]
91
101
  },
@@ -95,7 +105,7 @@
95
105
  "hashes": [
96
106
  {
97
107
  "alg": "SHA-256",
98
- "content": "5bdc153e789ac180543e9b4955ea36666dc27b7238637b05875e048fc49ae30f"
108
+ "content": "19170be889713fffd051dfde1044074125f66bb4623e415c355f812a47721436"
99
109
  }
100
110
  ]
101
111
  },
@@ -105,7 +115,7 @@
105
115
  "hashes": [
106
116
  {
107
117
  "alg": "SHA-256",
108
- "content": "0183c01a98e232554a7460be48ee5fdf59dd3a7d09c719a31b08acc9c6b3528c"
118
+ "content": "c80fe1740887b68a3521ee6d22e09303785238c6e27dd0c80fb76289927e73a4"
109
119
  }
110
120
  ]
111
121
  },
@@ -115,7 +125,47 @@
115
125
  "hashes": [
116
126
  {
117
127
  "alg": "SHA-256",
118
- "content": "c5bd1b0b852dd21de328494d7a99db336afbde4397b7c687d416f1a6f3c297b2"
128
+ "content": "1ef2072181086e6b14c30005417f3edba91db5c3f2ae82201236ea493385d6a8"
129
+ }
130
+ ]
131
+ },
132
+ {
133
+ "type": "file",
134
+ "name": "dist/core-compat.d.ts",
135
+ "hashes": [
136
+ {
137
+ "alg": "SHA-256",
138
+ "content": "dedfc859e163f229af0445d6439172a4b66c150c0942bce3ae1bf0304dbb3290"
139
+ }
140
+ ]
141
+ },
142
+ {
143
+ "type": "file",
144
+ "name": "dist/core-compat.d.ts.map",
145
+ "hashes": [
146
+ {
147
+ "alg": "SHA-256",
148
+ "content": "bce1ded9ffac15080908af1a9571b67141c141374ec4ba90b987fd6fd8883aab"
149
+ }
150
+ ]
151
+ },
152
+ {
153
+ "type": "file",
154
+ "name": "dist/core-compat.js",
155
+ "hashes": [
156
+ {
157
+ "alg": "SHA-256",
158
+ "content": "57930e6918c2a5d90826c74924a62de9a1ffab53d8196ff8f98a59c89baf23be"
159
+ }
160
+ ]
161
+ },
162
+ {
163
+ "type": "file",
164
+ "name": "dist/core-compat.js.map",
165
+ "hashes": [
166
+ {
167
+ "alg": "SHA-256",
168
+ "content": "e95005978fdd733f78208d6d916f62f970123530241739c9da7d3a74154b7a13"
119
169
  }
120
170
  ]
121
171
  },
@@ -175,7 +225,7 @@
175
225
  "hashes": [
176
226
  {
177
227
  "alg": "SHA-256",
178
- "content": "00a53276d145112e3c2ae5ca2950ac74877ea4b069b2b81040d49c5903eb6482"
228
+ "content": "be73e142cc0dcd05cf774c73827572b1e55e503c8ab84f4a396fa785b271980b"
179
229
  }
180
230
  ]
181
231
  },
@@ -185,7 +235,7 @@
185
235
  "hashes": [
186
236
  {
187
237
  "alg": "SHA-256",
188
- "content": "f799d9771166fe95eb40463d1ebbeb0dd3acdd78fa9c692e086a6a673f54752a"
238
+ "content": "42a1f67e1f39c4cda2df0887c16fbb6f54eb108ba0cb18612bb83ee153092463"
189
239
  }
190
240
  ]
191
241
  },
@@ -195,7 +245,17 @@
195
245
  "hashes": [
196
246
  {
197
247
  "alg": "SHA-256",
198
- "content": "0a1097fc3a2294f934fc50f5871b287cfbc5ec85becdab914b7caeca42cb7d1a"
248
+ "content": "c875709ccafe3493342776b28c8aa7b34e1fb800e2fccedcb499e6490e6ad1c0"
249
+ }
250
+ ]
251
+ },
252
+ {
253
+ "type": "file",
254
+ "name": "src/core-compat.ts",
255
+ "hashes": [
256
+ {
257
+ "alg": "SHA-256",
258
+ "content": "3638272a91166a047c3edc14626c0011e91b2de862a197d1b8e424470e7a0575"
199
259
  }
200
260
  ]
201
261
  },
@@ -209,13 +269,73 @@
209
269
  }
210
270
  ]
211
271
  },
272
+ {
273
+ "type": "file",
274
+ "name": "test/agents-sync.test.ts",
275
+ "hashes": [
276
+ {
277
+ "alg": "SHA-256",
278
+ "content": "32606890dc57d58257e6b4a38246acb343eea88b6e4b2f643f061325a34d066a"
279
+ }
280
+ ]
281
+ },
212
282
  {
213
283
  "type": "file",
214
284
  "name": "test/cli.test.ts",
215
285
  "hashes": [
216
286
  {
217
287
  "alg": "SHA-256",
218
- "content": "c66bdd2fbbe2e0b622e3bc4e0e4521e865cc8088e581bd4b4862c1c550307900"
288
+ "content": "83d8c6a9d7e8d46b57bb2e5da47c0345e8a512bdcc2e7cc8c59e163ade41de10"
289
+ }
290
+ ]
291
+ },
292
+ {
293
+ "type": "file",
294
+ "name": "test/command-count.test.ts",
295
+ "hashes": [
296
+ {
297
+ "alg": "SHA-256",
298
+ "content": "9958e10a8adb80ee64baad0d91fb4c9a3b6e8801c6379f7ba5f8f5ab6c1f1716"
299
+ }
300
+ ]
301
+ },
302
+ {
303
+ "type": "file",
304
+ "name": "test/core-compat-guard.test.ts",
305
+ "hashes": [
306
+ {
307
+ "alg": "SHA-256",
308
+ "content": "98086d0b6bd7ce32cc844e0cbbc710c4dbf009389c1d020aed48ced2de8acd57"
309
+ }
310
+ ]
311
+ },
312
+ {
313
+ "type": "file",
314
+ "name": "test/core-compat.test.ts",
315
+ "hashes": [
316
+ {
317
+ "alg": "SHA-256",
318
+ "content": "c54d5aa80a2455a396b396ff9fc398c141c3be4ec9c830e0941f830658758866"
319
+ }
320
+ ]
321
+ },
322
+ {
323
+ "type": "file",
324
+ "name": "test/core-import-floor.test.ts",
325
+ "hashes": [
326
+ {
327
+ "alg": "SHA-256",
328
+ "content": "84e16e0f31608570f72575038ae246d9ff002671ade0e9f9fa6009dd862dfc03"
329
+ }
330
+ ]
331
+ },
332
+ {
333
+ "type": "file",
334
+ "name": "test/discrimination-check-cli.test.ts",
335
+ "hashes": [
336
+ {
337
+ "alg": "SHA-256",
338
+ "content": "cd7507c8ec1f621fea6f05596541235d09efbd215540b56b012cf465e06b6ba0"
219
339
  }
220
340
  ]
221
341
  },
@@ -229,6 +349,26 @@
229
349
  }
230
350
  ]
231
351
  },
352
+ {
353
+ "type": "file",
354
+ "name": "test/fixtures/discrimination-check/fake-runner.sh",
355
+ "hashes": [
356
+ {
357
+ "alg": "SHA-256",
358
+ "content": "126bbd1ba9c08ef9de826cfa21df3981720e4bc36cd993dff28e0de435cbebae"
359
+ }
360
+ ]
361
+ },
362
+ {
363
+ "type": "file",
364
+ "name": "test/fixtures/discrimination-check/fixture.py",
365
+ "hashes": [
366
+ {
367
+ "alg": "SHA-256",
368
+ "content": "bb413a8b6e9dc597eb298e7646fb84e23ccd3e117eb61201776ef3e9e27a0e0a"
369
+ }
370
+ ]
371
+ },
232
372
  {
233
373
  "type": "file",
234
374
  "name": "test/fixtures/install-layouts-helpers.ts",
@@ -459,6 +599,26 @@
459
599
  }
460
600
  ]
461
601
  },
602
+ {
603
+ "type": "file",
604
+ "name": "test/install-sync-partial.test.ts",
605
+ "hashes": [
606
+ {
607
+ "alg": "SHA-256",
608
+ "content": "35824489662dbe9315d78cd20ecf968d416fbe80685d74b6588c8521a08497ea"
609
+ }
610
+ ]
611
+ },
612
+ {
613
+ "type": "file",
614
+ "name": "test/list-partial.test.ts",
615
+ "hashes": [
616
+ {
617
+ "alg": "SHA-256",
618
+ "content": "fd98385a9b1021cf8341d154abcdf4506a84aaadddd465fcc7e057ba1927fe64"
619
+ }
620
+ ]
621
+ },
462
622
  {
463
623
  "type": "file",
464
624
  "name": "test/mutation-gate-cli.test.ts",
@@ -475,7 +635,17 @@
475
635
  "hashes": [
476
636
  {
477
637
  "alg": "SHA-256",
478
- "content": "fe8e5792626cf58678c1e2bcb809f63413655c2e171439157b74deb8b4fd80fb"
638
+ "content": "3e6f9bb105154121988da41568ff85573099235857ba25e76c4264c166b414ae"
639
+ }
640
+ ]
641
+ },
642
+ {
643
+ "type": "file",
644
+ "name": "test/skills-verify-static-advisories.test.ts",
645
+ "hashes": [
646
+ {
647
+ "alg": "SHA-256",
648
+ "content": "b1140c20ec04d1c8ae67f97a42dbcece1e8e63c98a5de2c087f0359d27c25f17"
479
649
  }
480
650
  ]
481
651
  },
@@ -489,6 +659,16 @@
489
659
  }
490
660
  ]
491
661
  },
662
+ {
663
+ "type": "file",
664
+ "name": "test/target-alias-cli.test.ts",
665
+ "hashes": [
666
+ {
667
+ "alg": "SHA-256",
668
+ "content": "96df42acb1cc5ada5ca97912d3b7da5b486067e851b9dd395855b1b540ce738c"
669
+ }
670
+ ]
671
+ },
492
672
  {
493
673
  "type": "file",
494
674
  "name": "test/trace-bundle-cli.test.ts",
@@ -499,6 +679,16 @@
499
679
  }
500
680
  ]
501
681
  },
682
+ {
683
+ "type": "file",
684
+ "name": "test/version-flag.test.ts",
685
+ "hashes": [
686
+ {
687
+ "alg": "SHA-256",
688
+ "content": "7acd80deb073fb2987c6d14a028a64c6d44324ac61a05410b7d4b6c87ff5acc6"
689
+ }
690
+ ]
691
+ },
502
692
  {
503
693
  "type": "file",
504
694
  "name": "test/workflow-init-lint-clean.test.ts",
package/src/bin.ts CHANGED
@@ -1,19 +1,50 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * `dz` executable entry point.
4
+ *
5
+ * Two phases, and the split is load-bearing (feature dz-cli-defects, D5):
6
+ *
7
+ * phase 1 — ZERO `@dzhechkov/harness-core` imports: probe the installed core version
8
+ * and refuse with a NAMED message if it is below `MIN_CORE`;
9
+ * phase 2 — `await import('./cli.js')`, which is where the ~100-name static graph is
10
+ * linked. A STATIC import here would link that graph before any guard could
11
+ * run, which is exactly how a cached lower core produced a bare
12
+ * `SyntaxError: … does not provide an export named 'GRADE_SUCCESS_FLOOR'`
13
+ * with nothing pointing at the cause.
4
14
  */
5
15
 
6
- import { runCli } from './cli.js';
16
+ import { checkCoreCompat, describeMissingExportError, resolveInstalledCoreVersion, MIN_CORE } from './core-compat.js';
7
17
 
8
- const code = await runCli(process.argv.slice(2));
18
+ const foundCore = resolveInstalledCoreVersion(import.meta.url);
19
+ const compat = checkCoreCompat({ found: foundCore, min: MIN_CORE });
9
20
 
10
- // `process.exit()` here TRUNCATED large output on a pipe, silently and at exactly the
11
- // pipe buffer size. On a pipe (not a TTY, not a file) Node's stdout is ASYNCHRONOUS, so
12
- // `process.exit` discards whatever has not flushed yet: `dz recall --all --json > file`
13
- // wrote 122826 bytes while `dz recall --all --json | jq` got exactly 65536 and a parse
14
- // error. That is data loss in the documented sharing path, and silent — the exit code
15
- // was 0 and the JSON simply stopped mid-string.
16
- //
17
- // So: set the code and let the process end when the event loop drains, which is what
18
- // flushes stdout. `process.exitCode` preserves the status without the race.
19
- process.exitCode = code;
21
+ if (!compat.ok) {
22
+ // stderr, and no stack: the user needs one actionable line, not a trace.
23
+ console.error(compat.message);
24
+ process.exitCode = 1;
25
+ } else {
26
+ let code: number;
27
+ try {
28
+ const { runCli } = await import('./cli.js');
29
+ code = await runCli(process.argv.slice(2));
30
+ } catch (error) {
31
+ // The version probe fails OPEN, so a missing-binding link error can still reach us.
32
+ // Translate exactly that class into the named form; re-throw everything else
33
+ // unchanged so real bugs still surface.
34
+ const named = describeMissingExportError(error, foundCore);
35
+ if (named === null) throw error;
36
+ console.error(named);
37
+ code = 1;
38
+ }
39
+
40
+ // `process.exit()` here TRUNCATED large output on a pipe, silently and at exactly the
41
+ // pipe buffer size. On a pipe (not a TTY, not a file) Node's stdout is ASYNCHRONOUS, so
42
+ // `process.exit` discards whatever has not flushed yet: `dz recall --all --json > file`
43
+ // wrote 122826 bytes while `dz recall --all --json | jq` got exactly 65536 and a parse
44
+ // error. That is data loss in the documented sharing path, and silent — the exit code
45
+ // was 0 and the JSON simply stopped mid-string.
46
+ //
47
+ // So: set the code and let the process end when the event loop drains, which is what
48
+ // flushes stdout. `process.exitCode` preserves the status without the race.
49
+ process.exitCode = code;
50
+ }