@quobix/vacuum 0.33.1 → 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.
- package/README.md +67 -12
- 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.
|
|
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>
|
|
@@ -137,9 +137,38 @@ like our _very kind_ sponsors, past and present:
|
|
|
137
137
|
Need help? Have a question? Want to share your work? [Join our discord](https://discord.gg/UAcUF78MQN) and
|
|
138
138
|
come say hi!
|
|
139
139
|
|
|
140
|
+
## Timeout behavior
|
|
141
|
+
|
|
142
|
+
Resolved rule lookups no longer retry against unresolved documents after a timeout or query error.
|
|
143
|
+
This applies to plain linting and dashboard commands, reports, and library callers as well as `--original` comparisons.
|
|
144
|
+
`lint` and `dashboard` return exit code 2 when a lookup or rule execution times out.
|
|
145
|
+
Without `--original`, `vacuum report` records these failures as execution errors; its findings can be incomplete.
|
|
146
|
+
Spectral and HTML output retain their existing formats and can omit findings from failed rules.
|
|
147
|
+
A comparison with `--original` stops with exit code 2 if either lint run fails and does not produce a comparison report.
|
|
148
|
+
Library callers must check `RuleSetExecutionResult.Errors`, including `RuleLookupError` and `RuleTimeoutError`.
|
|
149
|
+
|
|
150
|
+
For large documents, increase `--lookup-timeout` (milliseconds, default 500) if a JSONPath lookup needs more time,
|
|
151
|
+
or `--timeout` (seconds, default 5) if the complete rule needs more time. The rule budget must also allow the lookup to finish.
|
|
152
|
+
A timeout is an incomplete check, not evidence that the document is clean.
|
|
153
|
+
|
|
140
154
|
## Documentation
|
|
141
155
|
|
|
142
|
-
🔥 **New in** `v0.
|
|
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**
|
|
143
172
|
|
|
144
173
|
Arazzo 1.0 and 1.1 workflows are now a first-class document type in vacuum, alongside OpenAPI, AsyncAPI and JSON Schema.
|
|
145
174
|
Use `vacuum lint workflows.yaml` and vacuum will detect Arazzo automatically, with recommended rules for workflow structure,
|
|
@@ -254,17 +283,34 @@ vacuum apply-overlay internal.yaml public.overlay.yaml public.yaml \
|
|
|
254
283
|
--prune-unused
|
|
255
284
|
```
|
|
256
285
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
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
|
|
263
303
|
order, comments, and scalar styles are preserved. Pruning rejects schema
|
|
264
304
|
`$id` scopes that cannot be resolved safely. Link Objects targeting filtered
|
|
265
305
|
operations are retained and reported as warnings. Document output remains
|
|
266
306
|
pure on stdout; warnings are written to stderr. The warning summary uses the `apply-overlay produced` prefix to
|
|
267
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.
|
|
268
314
|
|
|
269
315
|
---
|
|
270
316
|
|
|
@@ -588,7 +634,7 @@ for scoped exceptions.
|
|
|
588
634
|
|
|
589
635
|
## Spectral migration
|
|
590
636
|
|
|
591
|
-
vacuum loads YAML and
|
|
637
|
+
vacuum loads YAML, JSON, and local JavaScript rulesets. Resolve each relative `extends` path from the
|
|
592
638
|
file that contains it, including on Windows. Keep sibling rulesets relative:
|
|
593
639
|
|
|
594
640
|
```yaml
|
|
@@ -600,8 +646,17 @@ extends:
|
|
|
600
646
|
|
|
601
647
|
Use `[vacuum:owasp, all]` for vacuum's built-in OWASP checks instead of importing
|
|
602
648
|
`@stoplight/spectral-owasp-ruleset/dist/ruleset.mjs`. The native rules use vacuum's
|
|
603
|
-
rule names and behavior; they do not execute the Spectral package.
|
|
604
|
-
|
|
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.
|
|
605
660
|
|
|
606
661
|
Arazzo 1.0 and 1.1 workflows use `vacuum lint workflows.yaml` and the normal
|
|
607
662
|
report commands. `spectral:arazzo` selects Vacuum's native recommended rules.
|
|
@@ -614,7 +669,7 @@ and migration differences.
|
|
|
614
669
|
vacuum lint api.yaml --ruleset rules/main.yaml --functions ./functions
|
|
615
670
|
```
|
|
616
671
|
|
|
617
|
-
|
|
672
|
+
JavaScript ruleset functions do not need this directory. Omitting the directory after `--functions` reports an
|
|
618
673
|
input error and exits with code 2. In the editor, vacuum checks recognized ruleset
|
|
619
674
|
buffers against its ruleset schema instead of reporting an unsupported API type.
|
|
620
675
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quobix/vacuum",
|
|
3
|
-
"version": "0.
|
|
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.
|
|
27
|
-
"tar": "^7.5.
|
|
26
|
+
"https-proxy-agent": "^9.1.0",
|
|
27
|
+
"tar": "^7.5.22"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@sourcemeta/jsonschema": "^
|
|
30
|
+
"@sourcemeta/jsonschema": "^17.2.1"
|
|
31
31
|
},
|
|
32
32
|
"bugs": {
|
|
33
33
|
"url": "https://github.com/daveshanley/vacuum/issues"
|