@quobix/vacuum 0.33.2 → 0.35.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.
Files changed (2) hide show
  1. package/README.md +81 -13
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -87,7 +87,7 @@ To do that, replace `dshanley/vacuum` with `ghcr.io/daveshanley/vacuum` in the a
87
87
 
88
88
  ## Run with Go
89
89
 
90
- If you have Go 1.26 or newer installed, you can use `go run` to build and run it:
90
+ If you have Go 1.27.3 or newer installed, you can use `go run` to build and run it:
91
91
 
92
92
  ```
93
93
  go run github.com/daveshanley/vacuum@latest lint <your-openapi-spec.yaml>
@@ -153,7 +153,22 @@ A timeout is an incomplete check, not evidence that the document is clean.
153
153
 
154
154
  ## Documentation
155
155
 
156
- 🔥 **New in** `v0.33` 🔥: **Arazzo workflow linting and a new `or` function**
156
+ 🔥 **New in** `v0.34` 🔥: **Agent testing in vacuum**
157
+
158
+ A new `test` command gives agents a way to test rules, check changes and verify repairs using vacuum's existing engine.
159
+ Define a YAML or JSON suite, run `vacuum test suite.yaml`, and get structured results with evidence of what each rule actually did.
160
+
161
+ Check expected findings, selector matches and function calls. Test before-and-after changes, verify autofix output,
162
+ and check that running a fix again makes no further change. A clean result is only useful if the rule actually ran.
163
+
164
+ - [Get started with agent testing](https://quobix.com/vacuum/agent-testing/)
165
+ - [Read the `test` command reference](https://quobix.com/vacuum/commands/test/)
166
+ - [Read more about execution evidence](https://quobix.com/vacuum/testing/evidence/)
167
+ - [Use the test harness from Go](https://quobix.com/vacuum/api/test-harness/)
168
+
169
+ ---
170
+
171
+ `v0.33`: **Arazzo workflow linting and a new `or` function**
157
172
 
158
173
  Arazzo 1.0 and 1.1 workflows are now a first-class document type in vacuum, alongside OpenAPI, AsyncAPI and JSON Schema.
159
174
  Use `vacuum lint workflows.yaml` and vacuum will detect Arazzo automatically, with recommended rules for workflow structure,
@@ -268,17 +283,34 @@ vacuum apply-overlay internal.yaml public.overlay.yaml public.yaml \
268
283
  --prune-unused
269
284
  ```
270
285
 
271
- Inclusive tags are exact and case-sensitive; `any` keeps operations with at
272
- least one included tag and `all` requires every included tag. Untagged
273
- operations are removed. Filtering runs after Overlay actions and before
274
- reachability-based component pruning. These opt-in transforms require a
275
- bundled, self-contained OpenAPI document. Top-level Tag Objects are retained.
276
- YAML aliases and merge keys are expanded when filtering. Retained mapping
286
+ The overlay file is optional when a filter or `--prune-unused` is active:
287
+
288
+ ```bash
289
+ vacuum apply-overlay internal.yaml public.json --exclude-tag internal --prune-unused
290
+ vacuum apply-overlay internal.yaml selected.yaml --include-operation-id listPets
291
+ ```
292
+
293
+ Tags and operation IDs are exact and case-sensitive. All four filter flags
294
+ (`--include-tag`, `--exclude-tag`, `--include-operation-id`, and
295
+ `--exclude-operation-id`) can be repeated. `--tag-match any` matches at least
296
+ one tag; `all` requires every tag in each include/exclude list. Each active
297
+ inclusion filter must match, and exclusions take precedence. Operations with
298
+ no tags or IDs survive exclusion-only filtering. Filtering runs after Overlay
299
+ actions and before pruning. `--prune-unused` removes unreachable components
300
+ and unused tag definitions, retaining parents of used OpenAPI 3.2 tags.
301
+ These opt-in transforms require a bundled, self-contained OpenAPI document.
302
+ YAML merge keys are expanded. Aliases are expanded when filtering or when a removed tag owns an anchor. Retained mapping
277
303
  order, comments, and scalar styles are preserved. Pruning rejects schema
278
304
  `$id` scopes that cannot be resolved safely. Link Objects targeting filtered
279
305
  operations are retained and reported as warnings. Document output remains
280
306
  pure on stdout; warnings are written to stderr. The warning summary uses the `apply-overlay produced` prefix to
281
307
  cover both Overlay actions and publication transforms.
308
+ A `.json`, `.yaml`, or `.yml` output extension selects the output format.
309
+ Otherwise the input format is retained, including on stdout.
310
+ An inferred output path containing an Overlay document is rejected to prevent accidental overwrites.
311
+ Tag pruning retains `x-tagGroups` entries and `x-traitTag: true` narrative tags.
312
+ Library callers opt into tag pruning with `Options.PruneUnusedTags`;
313
+ `Options.PruneUnused` and `PruneUnusedComponents` continue to prune components only.
282
314
 
283
315
  ---
284
316
 
@@ -536,9 +568,26 @@ recognizes a compressed report file and will deal with it automatically when rea
536
568
 
537
569
  > When using compression, the file name will be `vacuum-report-MM-DD-YY-HH_MM_SS.json.gz`. vacuum uses gzip internally.
538
570
 
571
+ ## Selecting property names in custom rules
572
+
573
+ Use quoted bracket notation for JSONPath property names with special characters, for example `['$ref']` and `['application/json']`. vacuum does not support JSONPath-Plus backtick escapes.
574
+
575
+ To inspect a `$ref` property itself, set `resolved: false`. With `resolved: true`, rules inspect the referenced schema after resolution.
576
+
577
+ ```yaml
578
+ rules:
579
+ no-request-body-refs:
580
+ description: Request body schemas must be inline.
581
+ given: "$.paths.*.*.requestBody.content['application/json'].schema['$ref']"
582
+ resolved: false
583
+ severity: warn
584
+ then:
585
+ function: falsy
586
+ ```
587
+
539
588
  ## Ignoring specific linting errors
540
589
 
541
- You can ignore specific linting errors by providing an `--ignore-file` argument to commands that run or replay lint results, including `lint`, `report`, `spectral-report`, `html-report`, `dashboard`, and `docs`.
590
+ You can ignore specific linting errors by providing an `--ignore-file` argument to commands that run or replay lint results, including `lint`, `report`, `spectral-report`, `html-report`, `dashboard`, `docs`, `schema`, and `language-server`.
542
591
 
543
592
  ```
544
593
  ./vacuum lint --ignore-file <path-to-ignore-file.yaml> -d <your-openapi-spec.yaml>
@@ -548,6 +597,16 @@ You can ignore specific linting errors by providing an `--ignore-file` argument
548
597
  ./vacuum report --ignore-file <path-to-ignore-file.yaml> -c <your-openapi-spec.yaml> <report-prefix>
549
598
  ```
550
599
 
600
+ Repeat `--ignore-file` to combine waivers from multiple files. Paths for the same rule are appended; an unreadable or invalid file stops the command.
601
+
602
+ ```sh
603
+ ./vacuum lint --ignore-file pets-ignore.yaml --ignore-file stores-ignore.yaml api.yaml
604
+ ```
605
+
606
+ In `vacuum.conf.yaml`, `ignore-file` accepts either one path or a YAML list of paths. A scalar value, including `VACUUM_IGNORE_FILE`, is always one path; commas are part of the filename.
607
+
608
+ Language-server editor settings accept `ignoreFiles: ["one.yaml", "two.yaml"]`; the legacy `ignoreFile` string still works. An empty `ignoreFiles` list clears waivers. Explicit CLI ignore files override disk config; editor initialization and workspace settings can override the CLI defaults.
609
+
551
610
  The ignore-file should point to a `.yaml` file that contains exact result paths or JSONPath expressions to be ignored by vacuum. The structure of the YAML file is as follows:
552
611
 
553
612
  ```
@@ -602,7 +661,7 @@ for scoped exceptions.
602
661
 
603
662
  ## Spectral migration
604
663
 
605
- vacuum loads YAML and JSON rulesets. Resolve each relative `extends` path from the
664
+ vacuum loads YAML, JSON, and local JavaScript rulesets. Resolve each relative `extends` path from the
606
665
  file that contains it, including on Windows. Keep sibling rulesets relative:
607
666
 
608
667
  ```yaml
@@ -614,8 +673,17 @@ extends:
614
673
 
615
674
  Use `[vacuum:owasp, all]` for vacuum's built-in OWASP checks instead of importing
616
675
  `@stoplight/spectral-owasp-ruleset/dist/ruleset.mjs`. The native rules use vacuum's
617
- rule names and behavior; they do not execute the Spectral package. JavaScript
618
- ruleset modules (`.js`, `.mjs`, `.cjs`) are not supported.
676
+ rule names and behavior; they do not execute the Spectral package.
677
+
678
+ For JavaScript rulesets, export an object from a local `.js`, `.mjs`, or `.cjs` file:
679
+
680
+ ```shell
681
+ vacuum lint api.yaml -r rules.mjs
682
+ ```
683
+
684
+ Functions, static imports, Promises, and callable formats run in an isolated runtime
685
+ for each document. See [JavaScript rulesets](https://quobix.com/vacuum/rulesets/javascript/)
686
+ for supported imports, context, and migration limits.
619
687
 
620
688
  Arazzo 1.0 and 1.1 workflows use `vacuum lint workflows.yaml` and the normal
621
689
  report commands. `spectral:arazzo` selects Vacuum's native recommended rules.
@@ -628,7 +696,7 @@ and migration differences.
628
696
  vacuum lint api.yaml --ruleset rules/main.yaml --functions ./functions
629
697
  ```
630
698
 
631
- It does not enable JavaScript ruleset modules. Omitting the directory reports an
699
+ JavaScript ruleset functions do not need this directory. Omitting the directory after `--functions` reports an
632
700
  input error and exits with code 2. In the editor, vacuum checks recognized ruleset
633
701
  buffers against its ruleset schema instead of reporting an unsupported API type.
634
702
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quobix/vacuum",
3
- "version": "0.33.2",
3
+ "version": "0.35.1",
4
4
  "description": "The world's fastest, most scalable and complete OpenAPI parser",
5
5
  "type": "module",
6
6
  "author": "Dave Shanley",
@@ -23,11 +23,11 @@
23
23
  "npm-install"
24
24
  ],
25
25
  "dependencies": {
26
- "https-proxy-agent": "^9.0.0",
27
- "tar": "^7.5.21"
26
+ "https-proxy-agent": "^9.1.0",
27
+ "tar": "^7.5.22"
28
28
  },
29
29
  "devDependencies": {
30
- "@sourcemeta/jsonschema": "^15.6.3"
30
+ "@sourcemeta/jsonschema": "^17.2.1"
31
31
  },
32
32
  "bugs": {
33
33
  "url": "https://github.com/daveshanley/vacuum/issues"