code wiki / (root) / nx_a11y_check.nx

nx_a11y_check.nx

buildroot/runtime/nx_a11y_check.nx

11626 B329 linesdepth 3pulls 4 transitivereach 1 importersview sourcekind librarytopic a11y
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_runtime.nx nx_types.nx nx_tier.nx nx_a11y_check.nx nx_a11y_check_test.nx

imports: nx_syscalls.nxnx_runtime.nxnx_types.nxnx_tier.nx

imported by: nx_a11y_check_test.nx

structs

92struct A11yCritReport
98struct A11yCard

consts

70const NX_A11Y_VERDICT_UNMEASURED: nx_int = 0
71const NX_A11Y_VERDICT_WIN: nx_int = 1
72const NX_A11Y_VERDICT_LOSE: nx_int = 2
73const NX_A11Y_VERDICT_TIE: nx_int = 3
77const NX_WCAG_1_1_1_TEXT_ALT: nx_int = 0
78const NX_WCAG_1_4_4_RESIZE: nx_int = 1
79const NX_WCAG_2_4_4_LINK_PURPOSE: nx_int = 2
80const NX_WCAG_CRIT_N: nx_int = 3

functions

82func nx_wcag_criterion_is_valid(c: nx_int) -> nx_int
called by 1: main
110func _a_byte_at(src: *u8, i: nx_int) -> nx_int
116func _a_lower(c: nx_int) -> nx_int
called by 1: _a_eq_ci
123func _a_eq_ci(src: *u8, src_len: nx_int, off: nx_int, needle: *u8, needle_len: nx_int) -> nx_int
135func _a_is_digit(c: nx_int) -> nx_int
called by 1: _skip_ws_and_digits
146func _count_img_without_alt(src: *u8, src_len: nx_int) -> nx_int
called by 1: nx_a11y_scan calls 2: _a_eq_ci_a_byte_at
177func _skip_ws_and_digits(src: *u8, src_len: nx_int, off: nx_int) -> nx_int
197func _count_px_font(src: *u8, src_len: nx_int) -> nx_int
250func _verdict_from_count(n: nx_int) -> nx_int
called by 1: nx_a11y_scan
257func nx_a11y_scan(src: *u8, src_len: nx_int, card: *A11yCard) -> nx_int
297func nx_a11y_scan_file(path: *u8, card: *A11yCard) -> nx_int
312func nx_a11y_named_improvement(c: nx_int) -> *u8
called by 1: main
325func nx_a11y_card_alloc() -> *A11yCard
called by 1: main calls 1: sys_mmap