glance: design

@avarok/glance@0.1.0Updated 1 min readView as markdown

glance is an accessibility-rule engine whose rules run in Rust compiled to wasm32-unknown-unknown, over a snapshot of the page read in one pass. Its public interface follows axe-core 4.14.1; docs/COMPAT.md lists what is implemented and every difference. It is written clean-room: the specification in spec/ was produced from public documentation, W3C standards and black-box behaviour, and the implementation was written from that specification.

Behaviour differences: COMPAT.md.

Chapters

  1. The interface glance matches
  2. Architecture: collector, core, API layer, builds.
  3. Where the speed comes from: mechanism, predicted numbers, risks.
  4. Proof plan: ACT test cases, the differential suite, the reference's fixtures run from CI, Rust tests, negative controls.
  5. Phased plan
  6. Where the reference spends its time: the black-box profile behind the decision to start.
  7. Benchmark method
  8. Module contracts: layout, snapshot, Host, facts, rules, results, rules.json.
  9. Live in-browser comparison: the site's demo plan.

Decisions in one place

  • Reference: axe-core 4.14.1. MVP: the 70 rules tagged wcag2a, wcag2aa, wcag21a, wcag21aa or wcag22aa.
  • One in-page walk builds the snapshot; everything else is read lazily through the Host trait and memoised, so no fact is fetched twice.
  • The core is pure Rust (no_std + alloc); the browser is behind one trait.
  • Colour contrast composes backgrounds from the snapshot and hit-tests only overlapping runs.
  • rules.json is the single source for rule metadata and messages.
  • Unimplemented rules are absent, never reported as passing.