Skip to content

feat(baseline): add web-features Baseline gate (config-driven)#10

Merged
bdelanghe merged 1 commit into
mainfrom
conformance/baseline-gate
Jun 29, 2026
Merged

feat(baseline): add web-features Baseline gate (config-driven)#10
bdelanghe merged 1 commit into
mainfrom
conformance/baseline-gate

Conversation

@bdelanghe

Copy link
Copy Markdown
Contributor

Third and final gate-promotion (epic prx-em8h). Same pattern as vuln (#7), vnu (#9), axe (#6).

What

gates/baseline-gate.mjs (+ ck-baseline-gate bin): 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 behind an @supports query is a tested fallback and doesn't count against it.
  • Pure core (classify, meetsTarget, evaluateBaseline) unit-tested; config-driven ($BASELINE_CSS, $BASELINE_TARGET, $BASELINE_REPORT), no site coupling.
  • Emits baseline: {status, fallbackTested} for compatibility.baseline.

Verification

node test/run.mjs16 passed, 0 failed. Unlike vnu/axe, the engine (stylelint) is pure npm, so the fixture e2e is deterministic and runs in CI (good=widely, bad=:has()+::selection→limited; no skip).

Epic status (prx-em8h)

All three bd-site gates now reusable in the kit (vuln/vnu/baseline). Next: bd-site consumes them vendored (prx-v5ry), then publish the kit to npm + JSR (prx-47qm).

🤖 Generated with Claude Code

…mance evidence)

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>
@bdelanghe bdelanghe merged commit b714246 into main Jun 29, 2026
1 check passed
@bdelanghe bdelanghe deleted the conformance/baseline-gate branch June 29, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant