WCAG/ADA accessibility compliance checker implementing foundation-web-analysis::Analyzer -- image alt text, heading hierarchy, ARIA landmarks, form labels, link text, page language, and table/media caption checks against a fetched page's DOM
| Tier | infrastructure |
| Role | unclassified (baselined) |
| Path | crates/infrastructure/web-ada-compliance |
| Edition | 2021 |
| Targets | infrastructure_web_ada_compliance |
| Public items | 26 across 2 modules |
| Tests | 45 |
What it is for
# infrastructure-web-ada-compliance
WCAG/ADA accessibility compliance checker implementing foundation_web_analysis::Analyzer. Statically inspects a fetched page's DOM for image alt text, heading hierarchy, ARIA landmarks/labels, form-field labeling, link text quality, page-language declaration, and table/media caption presence. Color contrast and keyboard navigation cannot be determined without a browser and are always flagged for manual review via ManualReviewItem.
Lifted from plumber/src/analyzers/ada_checker.rs and plumber/src/models/ada_compliance.rs (sprint 3.46, wave 2 — see CHANGELOG.md for provenance).
Capabilities
checker (other)
ADA/WCAG accessibility checker.
| Item |
|---|
pub const DEFAULT_MAX_BYTES: usize |
AdaChecker
ADA/WCAG accessibility checker.
| Item |
|---|
pub struct AdaChecker |
AdaChecker :: fn new() -> std::result::Result <Self, infrastructure_fetcher::SafeHttpError> |
AdaChecker :: fn with_max_bytes(mut self, max_bytes : usize) -> Self |
AdaChecker :: fn default() -> Self |
AdaChecker :: fn name(& self) -> & 'static str |
AdaChecker :: async fn analyze(& self, organization_id : Uuid, website_url : & str) -> Result <AnalysisResult> |
AdaChecker :: fn requires_link_graph(& self) -> bool |
AdaChecker :: fn cache_ttl_days(& self) -> u32 |
AdaCompliance
WCAG/ADA accessibility compliance data model.
| Item |
|---|
pub struct AdaCompliance |
AdaCompliance :: fn default() -> Self |
AdaCompliance :: fn new(organization_id : Uuid, url : & str) -> Self |
AdaCompliance :: fn alt_text_percentage(& self) -> f32 |
AdaCompliance :: fn form_label_percentage(& self) -> f32 |
AdaCompliance :: fn violations_by_impact(& self, impact : ViolationImpact) -> usize |
AdaCompliance :: fn max_impact(& self) -> Option <ViolationImpact> |
AdaCompliance :: fn passes_basic_checks(& self) -> bool |
AdaCompliance :: fn wcag_compliance_level(& self) -> WcagLevel |
AdaViolation
WCAG/ADA accessibility compliance data model.
| Item |
|---|
pub struct AdaViolation |
AdaWarning
WCAG/ADA accessibility compliance data model.
| Item |
|---|
pub struct AdaWarning |
AltTextQuality
WCAG/ADA accessibility compliance data model.
| Item |
|---|
pub enum AltTextQuality |
HeadingLevel
WCAG/ADA accessibility compliance data model.
| Item |
|---|
pub struct HeadingLevel |
ViolationImpact
WCAG/ADA accessibility compliance data model.
| Item |
|---|
pub enum ViolationImpact |
ViolationImpact :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result |
WcagLevel
WCAG/ADA accessibility compliance data model.
| Item |
|---|
pub enum WcagLevel |
WcagLevel :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result |
How to use it
No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.
Module structure
infrastructure_web_ada_compliance
checkermodels
flowchart TD n_infrastructure_web_ada_compliance["infrastructure_web_ada_compliance"] n_infrastructure_web_ada_compliance --> n_checker["checker"] n_infrastructure_web_ada_compliance --> n_models["models"]
Public surface
`checker`
| Item | What it is |
|---|---|
pub const DEFAULT_MAX_BYTES: usize | Response body byte cap for a fetched page (Gate 1.5.6 input limit). |
pub struct AdaChecker | Analyzer for ADA/WCAG accessibility compliance |
AdaChecker :: fn new() -> std::result::Result <Self, infrastructure_fetcher::SafeHttpError> | Build a checker with the default byte cap (DEFAULT_MAX_BYTES) and timeout (infrastructure_fetcher::safe_http::DEFAULT_TIMEOUT, 30s). |
AdaChecker :: fn with_max_bytes(mut self, max_bytes : usize) -> Self | Override the response body byte cap. |
AdaChecker :: fn default() -> Self | # Panics Panics if the underlying SafeHttpClient cannot be built (TLS backend init failure) -- matches the source's expect-on-construction posture (Client::builder()...expect("Failed to build HTTP client")). |
AdaChecker :: fn name(& self) -> & 'static str | — |
AdaChecker :: async fn analyze(& self, organization_id : Uuid, website_url : & str) -> Result <AnalysisResult> | — |
AdaChecker :: fn requires_link_graph(& self) -> bool | — |
AdaChecker :: fn cache_ttl_days(& self) -> u32 | — |
`models`
| Item | What it is |
|---|---|
pub struct AdaCompliance | ADA/WCAG accessibility compliance analysis for one page. |
pub struct HeadingLevel | — |
pub enum AltTextQuality | — |
pub struct AdaViolation | — |
pub enum ViolationImpact | — |
ViolationImpact :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result | — |
pub struct AdaWarning | — |
AdaCompliance :: fn default() -> Self | — |
AdaCompliance :: fn new(organization_id : Uuid, url : & str) -> Self | — |
AdaCompliance :: fn alt_text_percentage(& self) -> f32 | Percentage of images carrying a (non-empty) alt attribute |
AdaCompliance :: fn form_label_percentage(& self) -> f32 | Percentage of form fields carrying either a <label> or an aria-label/aria-labelledby |
AdaCompliance :: fn violations_by_impact(& self, impact : ViolationImpact) -> usize | — |
AdaCompliance :: fn max_impact(& self) -> Option <ViolationImpact> | — |
AdaCompliance :: fn passes_basic_checks(& self) -> bool | Coarse pass/fail gate independent of the WCAG-criteria-mapped scores: page language declared, exactly one h1, no skipped heading levels, 90%+ alt-text coverage, 100% form-label coverage, no empty links. |
AdaCompliance :: fn wcag_compliance_level(& self) -> WcagLevel | Coarse WCAG level estimate from violation severity -- NOT a substitute for a manual audit (contrast and keyboard-navigation criteria are flagged requires_*_review, never auto-decided). |
pub enum WcagLevel | — |
WcagLevel :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result | — |
Re-exports. Exported here, defined elsewhere.
| Export | Defined in |
|---|---|
{AdaChecker,DEFAULT_MAX_BYTES} | checker::{AdaChecker,DEFAULT_MAX_BYTES} |
{AdaCompliance,AdaViolation,AdaWarning,AltTextQuality,HeadingLevel,ViolationImpact,WcagLevel,} | models::{AdaCompliance,AdaViolation,AdaWarning,AltTextQuality,HeadingLevel,ViolationImpact,WcagLevel,} |
Boundary
Reaches into foundation.
Shares tier infrastructure with 82 other crates: infrastructure-acquire, infrastructure-adapters-google-calendar, infrastructure-adapters-google-gmail, infrastructure-adapters-google-places, infrastructure-adapters-google-trends, infrastructure-adapters-shodan, infrastructure-adapters-yelp, infrastructure-agent, … (82 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | infrastructure |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/infrastructure/web-ada-compliance |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_infrastructure["infrastructure"] --> n_foundation["foundation"]
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `foundation-web-analysis` | foundation | no | always |
| `infrastructure-fetcher` | infrastructure | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
async-trait | ^0.1 | — | no | always |
chrono | ^0.4 | serde | no | always |
scraper | ^0.20 | — | no | always |
serde | ^1 | derive | no | always |
serde_json | ^1 | — | no | always |
thiserror | ^2 | — | no | always |
url | ^2 | — | no | always |
uuid | ^1 | v4, v7, serde, js | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
tokio | ^1 | full, full, test-util | no | always |
tokio-test | ^0.4 | — | no | always |
Build. None.
Depended on by. Nothing in this workspace.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR SELF["infrastructure-web-ada-compliance"] SELF -->|runtime| n_foundation_web_analysis["foundation-web-analysis"] SELF -->|runtime| n_infrastructure_fetcher["infrastructure-fetcher"] classDef self fill:#1f883d,stroke:#1f883d,color:#fff; class SELF self;
Feature flags
No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.
Targets
| Kind | Name | Source |
|---|---|---|
| lib | infrastructure_web_ada_compliance | `src/lib.rs` |
Error model
No public error type was detected: no public item declares a type named *Error, and no public signature returns one.
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | yes |
| async runtime | none detected |
| database access | none detected |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | none detected |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.
Related capabilities
No workspace crate depends on this one.
Verification
| Kind | Count |
|---|---|
| Unit tests | 45 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
checker | 2 | 0 | 0 |
models | 7 | 0 | 0 |
What the tests establish, by name:
ambiguous_link_text_is_a_warning—src/checker.rsanalyze_always_flags_contrast_and_keyboard_for_manual_review—src/checker.rsaria_landmarks_and_main_nav_detected—src/checker.rscache_ttl_is_seven_days—src/checker.rsdecorative_image_missing_alt_is_not_a_violation—src/checker.rsdescriptive_alt_text_is_good_quality—src/checker.rsempty_alt_is_recorded_but_not_missing—src/checker.rsempty_link_with_no_text_or_aria_or_img_alt_is_a_violation—src/checker.rsfilename_style_alt_text_is_poor_quality—src/checker.rsform_field_with_aria_label_counts_as_aria_not_missing—src/checker.rsform_field_with_matching_label_is_labeled—src/checker.rsform_field_with_no_label_or_aria_is_missing_and_a_violation—src/checker.rshidden_and_submit_and_button_inputs_are_excluded_from_form_checks—src/checker.rsimage_missing_alt_is_a_critical_violation—src/checker.rslang_attribute_present_is_recorded—src/checker.rslink_with_only_an_alt_bearing_image_is_not_empty—src/checker.rsmissing_h1_is_a_moderate_violation—src/checker.rsmissing_lang_attribute_is_a_serious_violation—src/checker.rsmultiple_h1_is_a_warning_not_a_violation—src/checker.rsname_is_ada_checker—src/checker.rsrequires_link_graph_is_false—src/checker.rsscores_are_100_on_a_clean_page—src/checker.rsscores_drop_when_perceivable_violations_present—src/checker.rsskip_link_detected—src/checker.rsskipped_heading_level_is_flagged—src/checker.rstable_with_headers_and_caption_counted—src/checker.rsvideo_with_caption_track_is_counted_as_captioned—src/checker.rsvideo_without_captions_is_counted_but_not_captioned—src/checker.rswell_formed_heading_hierarchy_is_valid—src/checker.rsada_compliance_serialization_round_trips—src/models.rs- _… 15 more_
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 10 | 26 |
Public modules with a //! block | 2 | 2 |
pie showData
title Public items with rustdoc
"Documented" : 10
"No rustdoc detected" : 16
Metrics
| Metric | Value |
|---|---|
| Rust source files | 3 |
| Source lines | 1416 |
| Code lines | 1168 |
| Public API items | 26 |
| Public modules | 2 |
| Tests | 45 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 10 |
| Workspace reverse dependencies | 0 |
pie showData
title Public API by kind
"constant" : 1
"enum" : 3
"method" : 17
"struct" : 5
pie showData
title Rust source composition
"Code" : 1168
"Blank or comment" : 248
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.