high priority medium complexity infrastructure pending devops specialist Tier 6

Acceptance Criteria

CI pipeline contains a dedicated 'Accessibility Lint' step that runs dart analyze with the project's analysis_options.yaml
A test fixture file containing a hardcoded Color(0xFFFF0000) literal causes the CI step to exit with a non-zero code
A test fixture file containing a Text widget with fontStyle: FontStyle.italic causes the CI step to exit with a non-zero code
A test fixture file containing a Text widget with fontWeight: FontWeight.w300 (below w400) causes the CI step to exit with a non-zero code
A test fixture file using only design token references and meeting all accessibility rules passes dart analyze with zero warnings or errors
The CI step output clearly identifies the file, line number, and rule name for each violation
The dart analyze step runs on every pull request and on pushes to main/develop branches
CI step completes in under 60 seconds on a standard runner
The lint validation step is documented in the CI configuration with an inline comment explaining its accessibility purpose

Technical Requirements

frameworks
Flutter
Dart analyzer
performance requirements
dart analyze must complete within 60 seconds on CI runner
CI step must not cache stale analysis results between runs
security requirements
CI runner must not have write access to the main branch — lint failures must block merges via branch protection rules

Execution Context

Execution Tier
Tier 6

Tier 6 - 158 tasks

Can start after Tier 5 completes

Implementation Notes

Place lint fixture files under test/lint_fixtures/ and exclude them from the main lib/ tree so they never ship to production. In the CI YAML, use a matrix or sequential steps to run dart analyze --fatal-infos --fatal-warnings separately on each fixture, asserting the expected exit code. For violation fixtures, the step should expect exit code 1 (use `dart analyze || true` piped through an exit code assertion pattern, or a shell script wrapper). For the passing fixture, assert exit code 0.

Use a dedicated accessibility_lint_rules.yaml included by analysis_options.yaml via the include: directive — this keeps accessibility rules versioned separately. Document the CI step with a comment block: '# Accessibility lint: enforces WCAG 2.2 AA at build time. Required for NHF/Blindeforbundet/HLF user base.' If the CI system is GitHub Actions, use the dart-lang/setup-dart action to ensure consistent SDK version.

Testing Requirements

Validation is done via intentional violation fixtures. Maintain a ci_lint_fixtures/ directory with: (1) violation_hardcoded_color.dart — contains a hardcoded Color literal; (2) violation_italic_font.dart — contains fontStyle: FontStyle.italic; (3) violation_thin_font.dart — contains FontWeight.w100/w200/w300; (4) clean_passing.dart — uses only token references, meets all rules. In CI, run dart analyze on each fixture and assert exit codes. This acts as a smoke test for the lint configuration itself.

Do not include fixture files in production build paths (exclude from lib/).

Component
Flutter Accessibility Lint Configuration
infrastructure low
Epic Risks (3)
high impact medium prob technical

The WCAG 2.2 relative luminance formula requires gamma-corrected sRGB calculations. Floating-point rounding differences between Dart and reference implementations could produce off-by-one classifications for near-threshold color pairs, resulting in pairs that just pass or just fail in CI but behave differently at runtime.

Mitigation & Contingency

Mitigation: Implement the algorithm directly from the WCAG 2.2 specification using the exact linearisation constants. Validate the Dart implementation against the W3C reference test vectors and against a known-good JavaScript implementation for at least 50 color pairs spanning the compliance boundaries.

Contingency: If discrepancies are found, add a configurable tolerance margin (e.g., ±0.005 on the ratio) and flag near-threshold pairs as warnings rather than hard failures, escalating to the design team for manual review.

medium impact high prob scope

The token manifest is a static data file. If developers add new color tokens to the design-token-provider without updating the manifest, the manifest becomes stale and the CI validator produces false negatives — passing builds that contain unvalidated color pairs.

Mitigation & Contingency

Mitigation: Add a CI step that cross-references every token constant exported by the design-token-provider against the manifest at build time, failing if any token is present in the provider but absent from the manifest. Document this requirement clearly in the contributing guide.

Contingency: If drift is detected post-merge, run a full manifest regeneration script and treat the resulting manifest diff as a blocking pull request with mandatory accessibility review.

medium impact medium prob dependency

The flutter_accessibility_lints package (or custom lint rules) may produce false positives on patterns the team deliberately uses — for example, decorative icon widgets that intentionally omit semantic labels. Excessive false positives will lead developers to add blanket ignore comments, undermining the entire lint strategy.

Mitigation & Contingency

Mitigation: Audit the full lint rule set against the existing codebase before enabling rules. Create a documented list of approved ignore-comment patterns with mandatory justification comments. Restrict ignore patterns to decorative-only contexts.

Contingency: If false positive rates exceed 10% of lint output, disable the highest-noise individual rules and replace them with targeted custom lint rules scoped to the specific patterns the team controls.