@dzhechkov/harness-cli 0.7.3 → 0.7.5

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": "c58f8ba9168698b8b85767b8989c707a2f9cec3ebe28cc47061160f2f143e997"
28
+ "content": "bf6ac920e20f4e9978dbb7b1cca48790d97e44f245dc53088e189776b4a7616e"
29
29
  }
30
30
  ]
31
31
  },
@@ -69,6 +69,46 @@
69
69
  }
70
70
  ]
71
71
  },
72
+ {
73
+ "type": "file",
74
+ "name": "dist/boolean-flags.d.ts",
75
+ "hashes": [
76
+ {
77
+ "alg": "SHA-256",
78
+ "content": "014b309c8b7de90b6c0d87e4f4c6a15623fd9c261252282faa3567dd3b9d0d4d"
79
+ }
80
+ ]
81
+ },
82
+ {
83
+ "type": "file",
84
+ "name": "dist/boolean-flags.d.ts.map",
85
+ "hashes": [
86
+ {
87
+ "alg": "SHA-256",
88
+ "content": "a8309c4a78c90a1c9db9518a6d07c5fa800c4d39710941a379635a65012e208d"
89
+ }
90
+ ]
91
+ },
92
+ {
93
+ "type": "file",
94
+ "name": "dist/boolean-flags.js",
95
+ "hashes": [
96
+ {
97
+ "alg": "SHA-256",
98
+ "content": "8cf050f1bc0b69be1088e58cc5f88f034d2e847fba9ffc87f3cc01121d7d9d74"
99
+ }
100
+ ]
101
+ },
102
+ {
103
+ "type": "file",
104
+ "name": "dist/boolean-flags.js.map",
105
+ "hashes": [
106
+ {
107
+ "alg": "SHA-256",
108
+ "content": "442b8bbb2ec9f7701ddc2232fc8662956966097d6f46ee1fce49bd06c20db97f"
109
+ }
110
+ ]
111
+ },
72
112
  {
73
113
  "type": "file",
74
114
  "name": "dist/cli.d.ts",
@@ -85,7 +125,7 @@
85
125
  "hashes": [
86
126
  {
87
127
  "alg": "SHA-256",
88
- "content": "833c76f1fca3af7f1085862cb1239bb81a70e1261839fc34f8d2dc0d00752cc7"
128
+ "content": "6fc728a98d8a920a226a4ee2d8b045ee46e27246c7d7e8bdf15e6c7758f3efbc"
89
129
  }
90
130
  ]
91
131
  },
@@ -95,7 +135,7 @@
95
135
  "hashes": [
96
136
  {
97
137
  "alg": "SHA-256",
98
- "content": "130604723d58640d89186e5535201346eabba190a2f9542504235d28d323a761"
138
+ "content": "4bc5e7cb6563fd672fd7e2c38eac4ba55d54de46940c194b3d2cd5ea4519732a"
99
139
  }
100
140
  ]
101
141
  },
@@ -105,7 +145,7 @@
105
145
  "hashes": [
106
146
  {
107
147
  "alg": "SHA-256",
108
- "content": "a46fc71ca11f520e532956258cbce30e80736ce8315edbd2d2abab67c5affe6f"
148
+ "content": "560d103ce98af8095eb7ee86537aa80de7a914fffa693dc23fdf2440a4f76183"
109
149
  }
110
150
  ]
111
151
  },
@@ -189,6 +229,86 @@
189
229
  }
190
230
  ]
191
231
  },
232
+ {
233
+ "type": "file",
234
+ "name": "dist/install-spec.d.ts",
235
+ "hashes": [
236
+ {
237
+ "alg": "SHA-256",
238
+ "content": "f1a4d132eb06068e2c45ce7976f1b01482187c93021bbfaceb7f1dbe76c8c991"
239
+ }
240
+ ]
241
+ },
242
+ {
243
+ "type": "file",
244
+ "name": "dist/install-spec.d.ts.map",
245
+ "hashes": [
246
+ {
247
+ "alg": "SHA-256",
248
+ "content": "59a6d12466909c86aa06c272b237ca39473f106fd544725b1e6c707ca1c06a25"
249
+ }
250
+ ]
251
+ },
252
+ {
253
+ "type": "file",
254
+ "name": "dist/install-spec.js",
255
+ "hashes": [
256
+ {
257
+ "alg": "SHA-256",
258
+ "content": "354aae49a20a404eb9d0405ca6c7f6fa277e23b3e9f4988582f0c610486a2e6b"
259
+ }
260
+ ]
261
+ },
262
+ {
263
+ "type": "file",
264
+ "name": "dist/install-spec.js.map",
265
+ "hashes": [
266
+ {
267
+ "alg": "SHA-256",
268
+ "content": "3f8225df12c17826d5e8642f342a2fae21f4d1c32bb0969915570258a1ce6a76"
269
+ }
270
+ ]
271
+ },
272
+ {
273
+ "type": "file",
274
+ "name": "dist/known-flags.d.ts",
275
+ "hashes": [
276
+ {
277
+ "alg": "SHA-256",
278
+ "content": "40403ed4e24cdf95cb2757653485d7cb4650ef8496af96927ab503c2a189c598"
279
+ }
280
+ ]
281
+ },
282
+ {
283
+ "type": "file",
284
+ "name": "dist/known-flags.d.ts.map",
285
+ "hashes": [
286
+ {
287
+ "alg": "SHA-256",
288
+ "content": "23fa9b92489e2f39d99397a57f99a4c7566d41b75682d1bbde3f113c480acdcd"
289
+ }
290
+ ]
291
+ },
292
+ {
293
+ "type": "file",
294
+ "name": "dist/known-flags.js",
295
+ "hashes": [
296
+ {
297
+ "alg": "SHA-256",
298
+ "content": "f4ed9bddb45629484baf117a3b92eb4097932abda6e5a48227acbc7b5f23f561"
299
+ }
300
+ ]
301
+ },
302
+ {
303
+ "type": "file",
304
+ "name": "dist/known-flags.js.map",
305
+ "hashes": [
306
+ {
307
+ "alg": "SHA-256",
308
+ "content": "41bce9592c8192431f7f023271eaf3f548398e5c15441ea69a59e78633915cd9"
309
+ }
310
+ ]
311
+ },
192
312
  {
193
313
  "type": "file",
194
314
  "name": "keys/README.md",
@@ -215,7 +335,7 @@
215
335
  "hashes": [
216
336
  {
217
337
  "alg": "SHA-256",
218
- "content": "2aa110c79aca3b5874a166eed1d9bdecb2450cb389fbd28f689ede4e1e629532"
338
+ "content": "423120966d33fb4515177a7613f0ace5b392a576098987d0d9ca22aedea96716"
219
339
  }
220
340
  ]
221
341
  },
@@ -229,13 +349,23 @@
229
349
  }
230
350
  ]
231
351
  },
352
+ {
353
+ "type": "file",
354
+ "name": "src/boolean-flags.ts",
355
+ "hashes": [
356
+ {
357
+ "alg": "SHA-256",
358
+ "content": "c3ef929a729f53ca612ac67b1571d2e8da3681ac5060a1cd16e453e0bb1d4e00"
359
+ }
360
+ ]
361
+ },
232
362
  {
233
363
  "type": "file",
234
364
  "name": "src/cli.ts",
235
365
  "hashes": [
236
366
  {
237
367
  "alg": "SHA-256",
238
- "content": "43cc0a4fb533c65076b9e0e5da37b836cdbae1fc2d285131bd27b9bde9c38899"
368
+ "content": "cae511b9b892c43e874ee06b439306290cd2c0a9e6b75cd0cd931d47adaef3f5"
239
369
  }
240
370
  ]
241
371
  },
@@ -258,6 +388,26 @@
258
388
  "content": "d4258f3b183d03047aa07399ae96bdb2b3af83f0005127a24a39f8932982bf78"
259
389
  }
260
390
  ]
391
+ },
392
+ {
393
+ "type": "file",
394
+ "name": "src/install-spec.ts",
395
+ "hashes": [
396
+ {
397
+ "alg": "SHA-256",
398
+ "content": "4196fd89c6d2ab1f3ba107141c32635f2739dc38d978a9f4f41a8b0db0ddc5f9"
399
+ }
400
+ ]
401
+ },
402
+ {
403
+ "type": "file",
404
+ "name": "src/known-flags.ts",
405
+ "hashes": [
406
+ {
407
+ "alg": "SHA-256",
408
+ "content": "aed996e8a3741b595eba31ef694ec5b2999dc0a73933a4289325cf6b9944e254"
409
+ }
410
+ ]
261
411
  }
262
412
  ]
263
413
  }
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Boolean flags DECLARED AS DATA — feature boolean-flags-declared (backlog 247ddcfa).
3
+ *
4
+ * Before this file, `parseArgs` had no concept of a boolean flag: ANY `--flag` greedily consumed
5
+ * the next token unless it began with `--`. MEASURED 2026-08-22 on 0.7.0: `dz sync --dry-run .`
6
+ * turned the safety flag into the option `dry-run=.` — `flags.has('dry-run')` was FALSE and the
7
+ * run WROTE, its only trace a missing label. The same class swallowed positionals
8
+ * (`dz recall --no-semantic "torque"` ate the query) across ~72 commands.
9
+ *
10
+ * GENERATED from a census of `cli.ts` reads — `test/boolean-flags.test.ts` re-derives the census
11
+ * on every run and fails on ANY divergence, in BOTH directions: a name here that gains a valued
12
+ * read, or a new flags.has-only name missing from here, each forces a conscious decision.
13
+ *
14
+ * Two names are declared beyond the mechanical census, both documented:
15
+ * - `json` — its one valued read (cli.ts, the `--json <path>` recovery in the mcp-scan family) IS
16
+ * the hand-patch for this very defect; with the flag declared boolean the recovery goes
17
+ * harmlessly dead and `--json <path>` parses as flag + positional, which that code also accepts.
18
+ * - `force` — valued ONLY under `dz guard` (`--force <reason>`, the audited override); boolean in
19
+ * every other command. Encoded via {@link VALUED_FORCE_COMMANDS}.
20
+ */
21
+ export const BOOLEAN_CLI_FLAGS: ReadonlySet<string> = new Set([
22
+ 'affected',
23
+ 'all',
24
+ 'allow-same-family',
25
+ 'allow-same-family-qe',
26
+ 'any',
27
+ 'apply',
28
+ 'audit-dev',
29
+ 'auto',
30
+ 'books',
31
+ 'bto',
32
+ 'bump-only',
33
+ 'by-stage',
34
+ 'calibrate',
35
+ 'check',
36
+ 'confirm',
37
+ 'context-only',
38
+ 'deep',
39
+ 'diff',
40
+ 'done',
41
+ 'dry-run',
42
+ 'emit',
43
+ 'enrich',
44
+ 'fa-record',
45
+ 'fail-on-undergrant',
46
+ 'finalize',
47
+ 'force',
48
+ 'full',
49
+ 'gates',
50
+ 'guard',
51
+ 'guards',
52
+ 'harmonize',
53
+ 'help',
54
+ 'include-pairs',
55
+ 'init',
56
+ 'install',
57
+ 'install-driver',
58
+ 'install-hook',
59
+ 'json',
60
+ 'keep-scratch',
61
+ 'legacy',
62
+ 'lexical',
63
+ 'list',
64
+ 'live-content',
65
+ 'mock',
66
+ 'night',
67
+ 'no-dry-run',
68
+ 'no-evals',
69
+ 'no-hooks',
70
+ 'no-issue',
71
+ 'no-memory',
72
+ 'no-mirror',
73
+ 'no-provenance',
74
+ 'no-result',
75
+ 'no-semantic',
76
+ 'no-teach',
77
+ 'no-verify',
78
+ 'once',
79
+ 'override',
80
+ 'preview',
81
+ 'provenance',
82
+ 'prune-noise',
83
+ 'prune-quarantine',
84
+ 'publish',
85
+ 'reconcile',
86
+ 'record-provisional',
87
+ 'refresh-publishes',
88
+ 'remove',
89
+ 'require-plan',
90
+ 'require-signing',
91
+ 'rerank',
92
+ 'revise',
93
+ 'scope-check',
94
+ 'semantic',
95
+ 'send',
96
+ 'split',
97
+ 'stages-json',
98
+ 'static',
99
+ 'stats',
100
+ 'strict',
101
+ 'tag',
102
+ 'teach',
103
+ 'usage',
104
+ 'validate',
105
+ 'weak',
106
+ 'with-pairs',
107
+ 'with-references',
108
+ 'yes',
109
+ ]);
110
+
111
+ /** Commands where `--force` takes a VALUE (`--force <reason>`, logged) and must stay greedy. */
112
+ export const VALUED_FORCE_COMMANDS: readonly string[] = ['guard'];
113
+
114
+ /** Is `--<name>` a boolean flag for this command — i.e. it must never swallow the next token? */
115
+ export function isBooleanFlag(name: string, command: string): boolean {
116
+ if (name === 'force') return !VALUED_FORCE_COMMANDS.includes(command);
117
+ return BOOLEAN_CLI_FLAGS.has(name);
118
+ }