@dzhechkov/harness-cli 0.4.6 → 0.5.1

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": "6d4e868f0fef3d86f83c6316f4bb760fd9228ef1008d3bbb31916f6c8890b944"
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": "3893831e365016b5bd118f7f0ce2e8b106cfd0400689b9e190a5f80aa61b79f5"
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": "514bbdd5b14a1257693418c64bf2fb6c13d78beccd307f0f3a9c66461a42a62f"
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": "09277bf170699a591ca9d2c8f6ac3b2727ec41cff3a75e56058724bd1e4686e1"
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": "e2a46281a86931f342cf726ae0fd0aeb25eef7ce94edbd07abce68635f547e78"
129
+ }
130
+ ]
131
+ },
132
+ {
133
+ "type": "file",
134
+ "name": "dist/core-compat.d.ts",
135
+ "hashes": [
136
+ {
137
+ "alg": "SHA-256",
138
+ "content": "868dd0e0ec12ea9df5f4df148518f5c59226ecc1de04fa67d5455f4932a7819b"
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": "973e9bd7c0951e9f74bd3e8b38a0cc81076d6ea8393fa3e52a428b92ebc967c8"
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
  },
@@ -125,7 +175,7 @@
125
175
  "hashes": [
126
176
  {
127
177
  "alg": "SHA-256",
128
- "content": "aaac0134a074fd06e9b5e09daa952ef6353510e481885da51a6e4f2e92beba35"
178
+ "content": "a25d0a97a30fa5abc35473ed4ca1bc32bc5a8bcb8a45c57d7feeb03cb6058e02"
129
179
  }
130
180
  ]
131
181
  },
@@ -135,7 +185,7 @@
135
185
  "hashes": [
136
186
  {
137
187
  "alg": "SHA-256",
138
- "content": "459c3381a9fbcd3378b623f9fe103a8d3337e4025a2f546b6d40e4d9dd4e0f70"
188
+ "content": "7c554d109fb0aabcf9a2923b0d9ac84723652abdec81202b2cc0a726d38c84bd"
139
189
  }
140
190
  ]
141
191
  },
@@ -145,7 +195,7 @@
145
195
  "hashes": [
146
196
  {
147
197
  "alg": "SHA-256",
148
- "content": "15ff1e6b84537b91b73b6a7e2d1c45f1120b25af9d1139df8da8ad094e99cf0e"
198
+ "content": "5b7992e09b843a01c9bf7a05b5db4475ca9abbf893ead79f7bad73f0f92c4249"
149
199
  }
150
200
  ]
151
201
  },
@@ -155,7 +205,7 @@
155
205
  "hashes": [
156
206
  {
157
207
  "alg": "SHA-256",
158
- "content": "2f61a3be1af4ab9f7bbcbacb912ccbd89e3b73414f9fd24766598bfbdc1f8655"
208
+ "content": "54c8133a172c2ca81c3f5a32e701386812a621198758423fcc7f0bf3db8c1ff7"
159
209
  }
160
210
  ]
161
211
  },
@@ -175,7 +225,7 @@
175
225
  "hashes": [
176
226
  {
177
227
  "alg": "SHA-256",
178
- "content": "00a53276d145112e3c2ae5ca2950ac74877ea4b069b2b81040d49c5903eb6482"
228
+ "content": "503d43d8ab6e7fb04c28f96270eb00da9782e4ec0570772f2f701aef33037c25"
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": "747d3a279349208ce8f5c6121bbf8ea039ebafaa8251c520ba3092a7aa80013f"
249
+ }
250
+ ]
251
+ },
252
+ {
253
+ "type": "file",
254
+ "name": "src/core-compat.ts",
255
+ "hashes": [
256
+ {
257
+ "alg": "SHA-256",
258
+ "content": "53747612facd41ade5c291949b854d354e694b733e1f294cb3e521193760ae26"
199
259
  }
200
260
  ]
201
261
  },
@@ -205,7 +265,17 @@
205
265
  "hashes": [
206
266
  {
207
267
  "alg": "SHA-256",
208
- "content": "395b27b317e575b94a1049cdb284db185e0ec382fbae1e588c78ff2398b2563f"
268
+ "content": "76c2dc1598e72d11df59319cc64fb2aa39b8c3af4eb3077f66598f4f2a3323c0"
269
+ }
270
+ ]
271
+ },
272
+ {
273
+ "type": "file",
274
+ "name": "test/agents-sync.test.ts",
275
+ "hashes": [
276
+ {
277
+ "alg": "SHA-256",
278
+ "content": "32606890dc57d58257e6b4a38246acb343eea88b6e4b2f643f061325a34d066a"
209
279
  }
210
280
  ]
211
281
  },
@@ -215,7 +285,57 @@
215
285
  "hashes": [
216
286
  {
217
287
  "alg": "SHA-256",
218
- "content": "c66bdd2fbbe2e0b622e3bc4e0e4521e865cc8088e581bd4b4862c1c550307900"
288
+ "content": "d9adcce84b509e00213bda59a0948eca90d83bdd2fdbbc86aee5ce11d9176940"
289
+ }
290
+ ]
291
+ },
292
+ {
293
+ "type": "file",
294
+ "name": "test/command-count.test.ts",
295
+ "hashes": [
296
+ {
297
+ "alg": "SHA-256",
298
+ "content": "f744cfe02805f567312a196805ebc49486c3e2a8e3f64de1700be276481f0cc1"
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": "948ce5017d7b512f7f32c817f8d1f5cbc5ede7d7c3f2788456ec5d24b8983f14"
329
+ }
330
+ ]
331
+ },
332
+ {
333
+ "type": "file",
334
+ "name": "test/discrimination-check-cli.test.ts",
335
+ "hashes": [
336
+ {
337
+ "alg": "SHA-256",
338
+ "content": "d0ec5796bc526d45cdad9041ea7357afc065917b347cf5421ec7d2696106b08c"
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,57 @@
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/parallel-worktree-smoke.test.ts",
645
+ "hashes": [
646
+ {
647
+ "alg": "SHA-256",
648
+ "content": "0522b12ccdf3db79215c4c42162ef970f4cba0c0af96208426ca0323c367d0ee"
649
+ }
650
+ ]
651
+ },
652
+ {
653
+ "type": "file",
654
+ "name": "test/plan-completeness-gate.test.ts",
655
+ "hashes": [
656
+ {
657
+ "alg": "SHA-256",
658
+ "content": "be010af797aeae754a3dd3e9f6f25d6f01066d4bf2037a01322554453d943ee3"
659
+ }
660
+ ]
661
+ },
662
+ {
663
+ "type": "file",
664
+ "name": "test/qe-bridge-cli.test.ts",
665
+ "hashes": [
666
+ {
667
+ "alg": "SHA-256",
668
+ "content": "336ba7657c55f5b958a0ebed5617f3bc3b1956017b9389bbe7c38137889f8f1b"
669
+ }
670
+ ]
671
+ },
672
+ {
673
+ "type": "file",
674
+ "name": "test/qe-bridge-manifest-drift.test.ts",
675
+ "hashes": [
676
+ {
677
+ "alg": "SHA-256",
678
+ "content": "b7b4d9e0c1dcee32e972aab97273b04bdde9634433e7c22345793a677dfff300"
679
+ }
680
+ ]
681
+ },
682
+ {
683
+ "type": "file",
684
+ "name": "test/skills-verify-static-advisories.test.ts",
685
+ "hashes": [
686
+ {
687
+ "alg": "SHA-256",
688
+ "content": "b1140c20ec04d1c8ae67f97a42dbcece1e8e63c98a5de2c087f0359d27c25f17"
479
689
  }
480
690
  ]
481
691
  },
@@ -489,6 +699,16 @@
489
699
  }
490
700
  ]
491
701
  },
702
+ {
703
+ "type": "file",
704
+ "name": "test/target-alias-cli.test.ts",
705
+ "hashes": [
706
+ {
707
+ "alg": "SHA-256",
708
+ "content": "96df42acb1cc5ada5ca97912d3b7da5b486067e851b9dd395855b1b540ce738c"
709
+ }
710
+ ]
711
+ },
492
712
  {
493
713
  "type": "file",
494
714
  "name": "test/trace-bundle-cli.test.ts",
@@ -499,6 +719,16 @@
499
719
  }
500
720
  ]
501
721
  },
722
+ {
723
+ "type": "file",
724
+ "name": "test/version-flag.test.ts",
725
+ "hashes": [
726
+ {
727
+ "alg": "SHA-256",
728
+ "content": "7acd80deb073fb2987c6d14a028a64c6d44324ac61a05410b7d4b6c87ff5acc6"
729
+ }
730
+ ]
731
+ },
502
732
  {
503
733
  "type": "file",
504
734
  "name": "test/workflow-init-lint-clean.test.ts",
@@ -519,6 +749,36 @@
519
749
  }
520
750
  ]
521
751
  },
752
+ {
753
+ "type": "file",
754
+ "name": "test/workflow-run-cli.test.ts",
755
+ "hashes": [
756
+ {
757
+ "alg": "SHA-256",
758
+ "content": "ac0468d8e97795602e8b8298f278356a273309674483854cd136b99ddf6e39d4"
759
+ }
760
+ ]
761
+ },
762
+ {
763
+ "type": "file",
764
+ "name": "test/workflow-run-r2.test.ts",
765
+ "hashes": [
766
+ {
767
+ "alg": "SHA-256",
768
+ "content": "d7f308ac9538b7e9d7dc8dcd0ce7cf8127f26b5aea1f44e9d44ac1500ad733fb"
769
+ }
770
+ ]
771
+ },
772
+ {
773
+ "type": "file",
774
+ "name": "test/workflow-run-read-plane.test.ts",
775
+ "hashes": [
776
+ {
777
+ "alg": "SHA-256",
778
+ "content": "c56111e578500d690190f9fdb4ec44182a892c7a6c2c289896509c1229d7b06d"
779
+ }
780
+ ]
781
+ },
522
782
  {
523
783
  "type": "file",
524
784
  "name": "test/workflow-trace-cli-surface.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
+ }