nx_a11y_check.nx
buildroot/runtime/nx_a11y_check.nx
about
nx_a11y_check.nx -- Layer-3 WCAG 2.2 AA accessibility grader.
Enforces the ADA-compliance cardinal
feedback-ada-compliance-equal-experiences (2026-05-15):
"the adc [ADA] is another thing we want compliance on so disabled
people have equal experiences"
Scans HTML source (either a standalone .html file or the HTML
payload string inside a NishiLang web file) for the most
frequently-violated WCAG 2.2 success criteria. This first cut
covers three high-impact criteria that are reliably detectable via
lexical scan:
1.1.1 Non-text Content -- every <img> must carry an alt= attr
1.4.4 Resize Text -- font-size must not use px
2.4.4 Link Purpose -- avoid vague link text ("click here",
"here", "read more", "more")
Future criteria (queued for IR + state-machine scan):
1.4.3 contrast (needs CSS resolution)
2.1.1 keyboard nav (needs JS + handler scan)
3.3.2 form labels (needs cross-element pairing)
4.1.2 name/role/value (needs ARIA-aware scan)
Verdict shape mirrors nx_license_check: per-criterion violation
count, per-criterion sealed verdict (WIN/LOSE/UNMEASURED), and an
overall WIN/LOSE that the polyangulated grader can consume as an
8th perspective.
license_tier: ORIGINAL
genealogy_id: international-research-sources/w3c/wcag22_aa
nx_safety_envelope: (schema: nishi-library/seeds/safety-critical-standards.toml)
intended_use: "Layer-3 WCAG 2.2 AA accessibility grader --
enforces ADA-compliance cardinal so disabled
users have equal experiences across substrate-
emitted HTML / web frontends."
sil_target: SIL2 (accessibility-as-safety: ADA non-
compliance can prevent disabled
dependencies 4 imports · 1 importers
imports: nx_syscalls.nxnx_runtime.nxnx_types.nxnx_tier.nx
imported by: nx_a11y_check_test.nx
structs
| 92 | struct A11yCritReport |
| 98 | struct A11yCard |
consts
| 70 | const NX_A11Y_VERDICT_UNMEASURED: nx_int = 0 |
| 71 | const NX_A11Y_VERDICT_WIN: nx_int = 1 |
| 72 | const NX_A11Y_VERDICT_LOSE: nx_int = 2 |
| 73 | const NX_A11Y_VERDICT_TIE: nx_int = 3 |
| 77 | const NX_WCAG_1_1_1_TEXT_ALT: nx_int = 0 |
| 78 | const NX_WCAG_1_4_4_RESIZE: nx_int = 1 |
| 79 | const NX_WCAG_2_4_4_LINK_PURPOSE: nx_int = 2 |
| 80 | const NX_WCAG_CRIT_N: nx_int = 3 |
functions
| 82 | func nx_wcag_criterion_is_valid(c: nx_int) -> nx_int called by 1: main |
| 110 | func _a_byte_at(src: *u8, i: nx_int) -> nx_int |
| 116 | func _a_lower(c: nx_int) -> nx_int called by 1: _a_eq_ci |
| 123 | func _a_eq_ci(src: *u8, src_len: nx_int, off: nx_int, needle: *u8, needle_len: nx_int) -> nx_int |
| 135 | func _a_is_digit(c: nx_int) -> nx_int called by 1: _skip_ws_and_digits |
| 146 | func _count_img_without_alt(src: *u8, src_len: nx_int) -> nx_int |
| 177 | func _skip_ws_and_digits(src: *u8, src_len: nx_int, off: nx_int) -> nx_int |
| 197 | func _count_px_font(src: *u8, src_len: nx_int) -> nx_int |
| 225 | func _count_vague_link(src: *u8, src_len: nx_int) -> nx_int |
| 250 | func _verdict_from_count(n: nx_int) -> nx_int called by 1: nx_a11y_scan |
| 257 | func nx_a11y_scan(src: *u8, src_len: nx_int, card: *A11yCard) -> nx_int |
| 297 | func nx_a11y_scan_file(path: *u8, card: *A11yCard) -> nx_int |
| 312 | func nx_a11y_named_improvement(c: nx_int) -> *u8 called by 1: main |
| 325 | func nx_a11y_card_alloc() -> *A11yCard |