@quobix/vacuum 0.33.2 → 0.35.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.
Files changed (2) hide show
  1. package/README.md +53 -12
  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
 
@@ -602,7 +634,7 @@ for scoped exceptions.
602
634
 
603
635
  ## Spectral migration
604
636
 
605
- vacuum loads YAML and JSON rulesets. Resolve each relative `extends` path from the
637
+ vacuum loads YAML, JSON, and local JavaScript rulesets. Resolve each relative `extends` path from the
606
638
  file that contains it, including on Windows. Keep sibling rulesets relative:
607
639
 
608
640
  ```yaml
@@ -614,8 +646,17 @@ extends:
614
646
 
615
647
  Use `[vacuum:owasp, all]` for vacuum's built-in OWASP checks instead of importing
616
648
  `@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.
649
+ rule names and behavior; they do not execute the Spectral package.
650
+
651
+ For JavaScript rulesets, export an object from a local `.js`, `.mjs`, or `.cjs` file:
652
+
653
+ ```shell
654
+ vacuum lint api.yaml -r rules.mjs
655
+ ```
656
+
657
+ Functions, static imports, Promises, and callable formats run in an isolated runtime
658
+ for each document. See [JavaScript rulesets](https://quobix.com/vacuum/rulesets/javascript/)
659
+ for supported imports, context, and migration limits.
619
660
 
620
661
  Arazzo 1.0 and 1.1 workflows use `vacuum lint workflows.yaml` and the normal
621
662
  report commands. `spectral:arazzo` selects Vacuum's native recommended rules.
@@ -628,7 +669,7 @@ and migration differences.
628
669
  vacuum lint api.yaml --ruleset rules/main.yaml --functions ./functions
629
670
  ```
630
671
 
631
- It does not enable JavaScript ruleset modules. Omitting the directory reports an
672
+ JavaScript ruleset functions do not need this directory. Omitting the directory after `--functions` reports an
632
673
  input error and exits with code 2. In the editor, vacuum checks recognized ruleset
633
674
  buffers against its ruleset schema instead of reporting an unsupported API type.
634
675
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quobix/vacuum",
3
- "version": "0.33.2",
3
+ "version": "0.35.0",
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"