feat(vuln): add npm-audit known-vuln gate (config-driven)#7
Merged
Conversation
… evidence) Promotes bd-site's bespoke vuln gate into the kit as a reusable, config-driven gate (the axe-gate #6 pattern): pure parse/evaluate core (unit-tested over synthetic npm-audit payloads) + a config-driven CLI + the ck-vuln-gate bin. Runs `npm audit` over a project's lockfile and FAILS CLOSED when the known critical/high count exceeds a threshold (default 0). Production-scoped by default ($VULN_OMIT_DEV, since a static site ships no runtime deps); $VULN_THRESHOLD, $VULN_ROOT, $VULN_REPORT configurable. The report's `vulns: {knownCriticalOrHighVulns}` envelope is exactly what lone's conformance() consumes for `security.no-critical-vulns`. Tests: pure parse/threshold logic + a best-effort real `npm audit` e2e (tolerated skip when offline). node test/run.mjs → 14 passed, 0 failed. NOTE: the e2e surfaced 1 high advisory in the kit's OWN production deps — a real supply-chain finding for the kit, tracked separately. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bdelanghe
added a commit
that referenced
this pull request
Jun 29, 2026
… the vuln gate) (#8) The kit's own vuln gate (#7) flagged 1 high advisory in production deps: undici's unbounded-decompression-chain (pulled transitively via jsonld@8). The fix is jsonld@9 (semver-major). Verified the SHACL gate — the kit's only jsonld consumer — still conforms (test/run.mjs: 14 passed, 0 failed), and the vuln gate over the kit now reports 0 known critical/high in production deps. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 29, 2026
bdelanghe
added a commit
that referenced
this pull request
Jun 29, 2026
…mance evidence) (#10) Third and final gate-promotion (epic prx-em8h). Promotes bd-site's bespoke baseline gate into the kit, same pattern as vuln (#7), vnu (#9), axe (#6). Maps the SHIPPED CSS to web-features Baseline data via stylelint-plugin-use-baseline (headless, no browser) and FAILS CLOSED when the site-wide status is below target. HONEST: reports the MEASURED status (widely/newly/limited = the worst feature used); a feature guarded behind an @supports query is a tested fallback and doesn't count. Config-driven ($BASELINE_CSS/$BASELINE_TARGET/$BASELINE_REPORT); no site coupling. Emits the `baseline: {status, fallbackTested}` envelope lone's conformance() consumes for compatibility.baseline. Unlike vnu/axe, the engine (stylelint) is pure npm, so the fixture e2e is DETERMINISTIC and runs in CI (no skip). Tests: pure classify/threshold logic + e2e over good (widely) / bad (:has + ::selection → limited) fixtures. node test/run.mjs → 16/0. With this, all three bd-site gates are reusable in the kit; bd-site can now consume them vendored (prx-v5ry), and the kit is ready to publish (prx-47qm). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
First of the gate-promotions (epic prx-em8h) — make the conformance re-proving gates reusable across bounded-systems + external consumers. Promotes bd-site's bespoke vuln gate into the kit as a config-driven gate, matching the axe-gate (#6) pattern.
What
gates/vuln-gate.mjs(+ck-vuln-gatebin): runsnpm auditover a project's lockfile and fails closed when known critical/high exceeds a threshold.parseAudit,evaluateVulns) — unit-tested over synthetic npm-audit payloads, no network.$VULN_ROOT,$VULN_OMIT_DEV(production-scope default — a static site ships no runtime deps),$VULN_THRESHOLD,$VULN_REPORT. Nothing site-specific hard-coded (drops bd-site'sdata/conformance-evidence.jsoncoupling).vulns: { knownCriticalOrHighVulns }envelope lone'sconformance()consumes forsecurity.no-critical-vulns.Verification
node test/run.mjs→ 14 passed, 0 failed. Tests: pure parse/threshold logic + a best-effort realnpm audite2e (tolerated skip offline).Heads-up
The e2e surfaced 1 high advisory in the kit's own production deps — a real supply-chain finding for the kit itself, separate from this gate. Worth a follow-up
npm audit fix/ dep bump.Next in the epic (prx-em8h)
vnu→htmlValidator and baseline gates (same pattern), then bd-site consumes them vendored, then publish the kit to npm + JSR.
🤖 Generated with Claude Code