blocksmith-audit
v0.1.0
Published
The Blocksmith accessibility gate — real axe-core over the rendered DOM + anti-gaming structural checks + a self-contained CSP, fail-closed. A CLI, a library, and the core of an MCP conscience.
Maintainers
Readme
@blocksmith/audit
The accessibility gate — real axe-core (WCAG 2 A/AA + best-practice) run over the rendered DOM in headless Chrome, plus anti-gaming structural checks and a required self-contained CSP, on every page. Fail-closed. It is what makes an AI-generated site provably accessible instead of "accessible-ish": a reproducible artifact of verification, not a claim.
Unlike a PR-time scanner, it is designed to gate generation: the generator cannot self-certify past it.
CLI
blocksmith-audit ./dist # exit 0 if it provably passes, 1 if not
blocksmith-audit ./dist --json # machine-readable report
blocksmith-audit ./dist --report acr # write an Accessibility Conformance Report (acr.md + acr.json)
blocksmith-audit ./dist --grader-resolved-contrast # treat gradient contrast axe can't compute as informationalLibrary
import { runAudit, conformanceReport, composeVerifiers, weightBudget } from "@blocksmith/audit";
const report = await runAudit("./dist"); // { ok, critical, serious, violations, structural, pages }
if (!report.ok) process.exit(1);
const acr = conformanceReport(report, { product: "My Site", date: "2026-07-26" });
// acr.markdown / acr.json — an honest, evidence-backed conformance report (never "compliant")
// Multi-objective: a11y is objective 1 of N.
const gate = gateWith([weightBudget(500_000)]); // real axe AND a page-weight budgetWhat it checks
- axe-core WCAG2 A/AA + best-practice over the rendered DOM (not the source).
- Anti-gaming structural invariants: a visible-content floor (not
innerText— defeats off-screen/transparent/1px filler), exactly one<h1>, a<main>landmark, decorative<canvas>aria-hidden, and text over verifiable (opaque) backgrounds. - Self-contained CSP:
default-src 'self'|'none'with no external origins. - Multi-page: every
.htmlis audited; all must pass.
Honest scope
The gate proves the machine-testable WCAG criteria (roughly the majority of real-world failures) plus the structural invariants. It does not replace human review of keyboard flow, focus order, screen-reader semantics beyond axe, reduced-motion adherence, or cognitive load. The conformance report says so explicitly.
Requirements
Node ≥ 23.6 (ships native TypeScript) and a Chrome/Chromium the audit can launch
(npx playwright install chrome).
