feat(tools): add --json output and expand invariant coverage in gauntlet.py#17
Merged
Merged
Conversation
…let.py
gauntlet.py verified a running bundle over raw CDP but only checked a
small set of surfaces and emitted human-readable text, so it could not be
consumed by CI or a dashboard. Keep the zero-deps, raw-CDP design and add:
- A --json flag that emits {surfaces, invariants, ok} on stdout and sets
the exit code accordingly. Without it the text report is unchanged.
- Seven new invariants, all already spoofed by the default persona the
bundle launcher injects:
- navigator.hardwareConcurrency present and plausible (1-128)
- navigator.deviceMemory present
- navigator.languages well-formed (a real list, length >= 2)
- Intl.DateTimeFormat().resolvedOptions().timeZone is an IANA zone
- canvas 2D noise present (a flat grey fill reads back perturbed)
- navigator.gpu adapter present (WebGPU, via the swiftshader adapter)
- navigator.plugins non-empty
The surface-collection expression becomes an async IIFE so it can await
navigator.gpu.requestAdapter(); ws_eval already awaits the promise.
Document --json in --help and the module header, and commit a reference
docs/gauntlet-sample.json showing a passing report.
Closes tiliondev#12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tools/gauntlet.pyverifies a running Fortress bundle over raw CDP, but it only checked a small set of surfaces and emitted human-readable text — so it couldn't serve as a CI gate or feed a dashboard. This PR keeps the zero-deps, raw-CDP design and adds machine-readable output plus broader coverage of surfaces the engine already spoofs.Changes
--jsonoutputA new
--jsonflag emits a single JSON object on stdout and sets the exit code fromok:{ "surfaces": { ... }, "invariants": { "name": true/false, ... }, "ok": true }Without
--json, the human-readable report is unchanged (same structure, just more lines). Documented in--helpand the module header.Seven new invariants
All are already spoofed by the default persona the bundle launcher injects (
packaging/tilion):hardwareConcurrency plausible1 <= n <= 128deviceMemory presentlanguages well-formedtimezone is an IANA zoneIntl…resolvedOptions().timeZonecontains/canvas 2D noise presentWebGPU adapter presentnavigator.gpu.requestAdapter()returns an adapterplugins non-emptynavigator.plugins.length > 0The surface-collection expression becomes an
asyncIIFE so it canawait navigator.gpu.requestAdapter();ws_evalalready awaits the returned promise.Reference sample
docs/gauntlet-sample.json— a passing report for reference (CI/dashboard consumers).Verification
Running end-to-end needs a compiled bundle via
--bundle(seedocs/BUILD_NATIVE.md), but the report-assembly logic and JSON shaping were validated against a representative default-persona payload:--helplists--json.{surfaces, invariants, ok}shape.docs/gauntlet-sample.jsonparses and has the documented shape.Closes #12