Repository navigation
feat(audit): stable, versioned JSON report contract (#385) - #386
Merged
Merged
Conversation
--format json now emits a versioned envelope { schemaVersion, tool, snapshot,
summary, findings[] } instead of the unversioned { scanned, findings }. The
provenance snapshot is part of the contract, and each finding carries
tier/fixKind/title/remediation/authority so consumers can filter without
re-deriving. The same JSON is embedded in the HTML report
(<script type="application/json" id="chant-audit-report">, <-escaped) so the
expanded report is human- and machine-readable.
Stability: additive changes keep the major; rename/remove bumps schemaVersion;
consumers check the major and ignore unknown fields; SARIF recommended for max
stability. Documented in docs/cli/audit.
Closes #385
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.
Part of #350. Closes #385. Answers the "tools parsing this could break" concern, especially around the report metadata.
What
--format json:{ schemaVersion: "1.0", tool, snapshot, summary, findings[] }(was the unversioned{ scanned, findings }).tier/fixKind/title/remediation/authorityso consumers filter without re-deriving from the catalog.<script type="application/json" id="chant-audit-report">,<-escaped) — expanded report is human- and machine-readable.Stability policy (documented)
Additive fields keep the major; renames/removals bump
schemaVersion; consumers check the major and ignore unknown fields. SARIF recommended for maximum stability. Sharedreport-model.tsbuilds both the JSON and the rendered reports, so they stay consistent.Pre-release, so changing the json shape now to establish the contract is intentional.
77 audit tests (envelope shape, embedded-and-escaped HTML data, snapshot in JSON); tsc, eslint, astro build green.