Skip to content

feat(html): add Nu HTML Checker (vnu) gate (config-driven)#9

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

feat(html): add Nu HTML Checker (vnu) gate (config-driven)#9
bdelanghe merged 1 commit into
mainfrom
conformance/html-validator-gate

Conversation

@bdelanghe

Copy link
Copy Markdown
Contributor

Second gate-promotion (epic prx-em8h). Promotes bd-site's bespoke vnu gate into the kit, same pattern as vuln (#7) and axe (#6).

What

gates/html-validator-gate.mjs (+ ck-html-validator-gate bin): runs vnu (the Nu Html Checker, a self-contained Java jar via vnu-jar — headless, no browser, no network) --errors-only over built pages and fails closed above the threshold.

  • Pure core (parseVnu, evaluateHtml) — unit-tested over synthetic vnu payloads, no Java.
  • Config-driven: $HTML_DIST, $HTML_PAGES, $HTML_THRESHOLD, $HTML_REPORT. No site coupling.
  • Emits htmlValidator: { errors } for lone's html.validator-clean.
  • Fixtures: fixtures/html/{good,bad}.html (bad = a <ul> inside <span>, which vnu errors on).

Verification

node test/run.mjs15 passed, 0 failed. Pure parse/threshold logic + a best-effort real-vnu e2e (bad=1 error, good=clean; tolerated skip when no JRE, like the axe e2e skips without a browser).

Next (prx-em8h)

baseline gate, then bd-site consumes the vendored gates, then publish the kit.

🤖 Generated with Claude Code

…e evidence)

Promotes bd-site's bespoke vnu gate into the kit (epic prx-em8h), matching the
axe-gate pattern: pure parse/evaluate core (unit-tested over synthetic vnu payloads,
no Java) + config-driven CLI + ck-html-validator-gate bin + good/bad fixtures.

Runs vnu (the Nu Html Checker, a self-contained Java jar via vnu-jar — headless, no
browser, no network) --errors-only over a project's built pages and FAILS CLOSED
above $HTML_THRESHOLD (default 0). $HTML_DIST/$HTML_PAGES/$HTML_REPORT configurable;
no site coupling (drops bd-site's data/conformance-evidence.json read). Emits the
`htmlValidator: {errors}` envelope lone's conformance() consumes for html.validator-clean.

Tests: pure parse/threshold logic + a best-effort real-vnu e2e over the fixtures
(bad=1 error, good=clean; tolerated skip when no JRE). node test/run.mjs → 15/0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bdelanghe bdelanghe merged commit fa35928 into main Jun 29, 2026
1 check passed
@bdelanghe bdelanghe deleted the conformance/html-validator-gate branch June 29, 2026 01:01
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>
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