Infrastructure medium complexity cli
2
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

A Dart CLI script (or custom lint rule set) integrated into the CI pipeline that runs the contrast ratio validator and touch-target checks against the token manifest on every pull request. Fails the build if any token pair violates WCAG 2.2 AA thresholds, preventing non-compliant tokens from being merged.

Feature: Visual Design Accessibility

ci-accessibility-lint-runner

Summaries

The CI Accessibility Lint Runner is an automated quality gate that prevents accessibility defects from ever reaching users by blocking non-compliant code at the point of developer contribution. Without this component, accessibility violations discovered in production require expensive hotfix cycles, carry legal risk under ADA and WCAG regulations, and can result in negative press or app store policy violations. By failing the build automatically on any contrast, touch target, or font weight violation, the team eliminates the entire class of 'accidentally shipped accessibility regression' — a category of defect that is disproportionately costly to remediate post-release. This enforcement also reinforces organizational accountability, ensuring that every pull request is measurably compliant before review, which reduces the review burden on senior engineers and accelerates delivery.

The CI Accessibility Lint Runner is a medium-complexity CLI component that integrates into the existing pull request pipeline and has dependencies on both the contrast-ratio-validator and the accessibility-token-manifest. It must be set up early in the project so that accessibility gates are active from the first feature pull request — retroactively enforcing accessibility on an existing codebase is significantly more expensive. The component requires CI pipeline configuration work (adding a validation step, configuring exit code handling, and setting up violation report artifacts) in addition to the Dart implementation itself. A key delivery risk is false positives: if the manifest contains tokens that are borderline compliant or if the validator thresholds differ slightly from the runtime enforcer, developers may see CI failures that do not reproduce locally, causing friction and lost time.

Mitigation requires aligning thresholds between the lint runner and the runtime enforcer from day one. Structured violation reports should be wired into the CI dashboard early to give the team visibility without requiring log inspection.

CI Accessibility Lint Runner is a CLI-context Dart script that orchestrates full token manifest validation on every pull request. The entry point is `runValidation(String manifestPath) → ValidationResult`, which loads the manifest via `loadTokenManifest(String path) → AccessibilityManifest`, delegates contrast ratio checks to the contrast-ratio-validator dependency for each `TokenPair`, and checks all sizing entries for the 44pt minimum touch-target constraint. Font weight validation rejects any body-role type scale entry with weight below w400 or with `fontStyle: italic`. `reportViolations(List)` formats structured output consumable by CI dashboards, supporting multiple output formats via `formatReport(ValidationResult, OutputFormat)` (e.g., JSON for machine consumption, plain text for human review).

`exitWithStatus(ValidationResult) → Never` maps any non-empty violation list to a non-zero exit code, blocking the merge. The runner is intentionally stateless and has no Flutter dependency — it runs in a pure Dart environment, keeping CI setup lightweight. Threshold values must be kept in sync with the runtime token-accessibility-enforcer to avoid divergent behavior between CI and production.

Responsibilities

  • Execute contrast ratio validation against all token pairs in the manifest
  • Check all sizing tokens for minimum 44pt touch-target compliance
  • Verify no italic or sub-w400 font weight is declared for body roles
  • Emit structured violation reports consumable by CI dashboards
  • Exit with non-zero code on any violation to block merges

Interfaces

runValidation(String manifestPath) → ValidationResult
reportViolations(List<AccessibilityViolation> violations) → void
exitWithStatus(ValidationResult result) → Never
loadTokenManifest(String path) → AccessibilityManifest
formatReport(ValidationResult result, OutputFormat format) → String

Relationships

Dependencies (2)

Components this component depends on

API Contract

View full contract →
REST /api/v1/lint-runs 5 endpoints
GET /api/v1/lint-runs
GET /api/v1/lint-runs/:id
POST /api/v1/lint-runs
PUT /api/v1/lint-runs/:id
DELETE /api/v1/lint-runs/:id