high priority medium complexity infrastructure pending infrastructure specialist Tier 2

Acceptance Criteria

WCAGComplianceChecker.checkSemanticCompleteness() traverses the entire widget tree via AccessibilityAuditService and returns a typed list of WCAGViolation objects
Detects interactive widgets (GestureDetector, InkWell, IconButton, TextButton, ElevatedButton) that have no Semantics label and reports WCAG 4.1.2 (Name, Role, Value)
Detects Image and AssetImage widgets with no semanticLabel or with excludeFromSemantics=false and no label, reporting WCAG 1.1.1 (Non-text Content)
Detects TextField, TextFormField, and custom form fields with no associated label Semantics node and reports WCAG 1.3.1 (Info and Relationships)
Detects Icon-only buttons with no tooltip, semanticLabel, or enclosing Semantics node with a label and reports WCAG 4.1.2
Each WCAGViolation includes: widgetType, widgetKey (if present), tree path, WCAG criterion ID, WCAG criterion title, severity (critical/warning), and a human-readable remediation hint
Severity classification: missing label on interactive widget = critical; missing image description = critical; missing form label = critical; ambiguous or duplicate label = warning
checkSemanticCompleteness() returns an empty list (not null) when the widget tree has no violations
Module handles deeply nested widget trees (depth >= 50) without stack overflow by using iterative BFS traversal
All public APIs are documented with Dart doc comments

Technical Requirements

frameworks
Flutter
flutter_test
apis
Flutter SemanticsNode API
Flutter WidgetTester.pumpWidget
AccessibilityAuditService (internal)
data models
WCAGViolation
SemanticCompleteness report
performance requirements
Traversal of a 200-node widget tree must complete in under 200ms in debug mode
No heap allocations inside the hot traversal loop — reuse list buffers
security requirements
Module must not log or persist any user-entered field values encountered during traversal
No network calls — purely static analysis on the local widget tree

Execution Context

Execution Tier
Tier 2

Tier 2 - 518 tasks

Can start after Tier 1 completes

Implementation Notes

Use AccessibilityAuditService (task-013) for widget-tree traversal rather than reimplementing traversal. Model WCAGViolation as an immutable Dart class with copyWith and toJson. Use BFS (queue-based) rather than recursion to avoid stack overflows on deep trees. Map each violation type to the correct WCAG 2.2 AA criterion at construction time using a const lookup map — do not hardcode strings inline.

For detecting interactive widgets, check both the RenderObject semantic flags (hasTap, hasLongPress) and the widget runtimeType list; either is sufficient to flag a node as interactive. Keep the severity classification logic in a separate SemanticViolationClassifier class so it can be tested in isolation and updated as WCAG criteria evolve. Do not depend on GlobalKey or context — operate purely on the SemanticsNode tree provided by AccessibilityAuditService.

Testing Requirements

Unit tests (flutter_test): (1) Empty widget tree returns empty violations list. (2) Button with no label returns one critical violation with criterion 4.1.2. (3) Image with semanticLabel set returns no violation. (4) Image without semanticLabel returns one critical violation with criterion 1.1.1.

(5) TextField wrapped in Semantics with label returns no violation. (6) TextField without Semantics wrapper returns critical violation with criterion 1.3.1. (7) Tree depth >= 50 nodes does not throw StackOverflowError. (8) WCAGViolation objects are serializable to JSON without loss.

Integration tests: run checkSemanticCompleteness() against the ActivityWizard screen fixture and the BottomNavigation screen fixture and assert violation counts match known baselines. Target coverage: 90% of public API surface.

Component
WCAG 2.2 AA Compliance Checker
infrastructure medium
Epic Risks (3)
high impact high prob integration

Flutter does not natively enforce a focus trap within a bottom sheet or modal dialog in the semantic tree — VoiceOver and TalkBack can navigate outside the sheet to background content. Implementing a reliable focus trap requires overriding the semantic tree, which may conflict with the existing modal helper infrastructure in the app and require changes to shared components beyond this feature's scope.

Mitigation & Contingency

Mitigation: Prototype the focus trap on the first modal sheet implementation before building the remaining sheets. Evaluate Flutter's ExcludeSemantics and BlockSemantics widgets as the trap mechanism, and coordinate with the team owning the shared modal helpers to agree on a non-breaking integration point before writing production code.

Contingency: If a complete semantic focus trap cannot be implemented without breaking existing modal patterns, implement a partial solution using FocusScope with autofocus on the modal's first element and a prominent 'Return to main content' semantic action, documenting the deviation from WCAG 2.4.3 with a scheduled remediation item.

high impact medium prob technical

The activity wizard uses BLoC state management and the UI rebuilds the entire step widget subtree on transition. If the semantic tree is traversed by VoiceOver before the build cycle settles, focus may land on a stale or partially rendered step, causing the wrong step label or progress value to be announced. This is particularly problematic for blind users who cannot visually verify the announcement against the screen.

Mitigation & Contingency

Mitigation: Coordinate ActivityWizardStepSemantics with FocusManagementService (from the core services epic) to delay focus placement until the post-build callback confirms the new step's semantic tree is complete. Write integration tests using the AccessibilityTestHarness that assert the full announcement sequence across all five wizard steps.

Contingency: If post-build focus delay is insufficient due to async BLoC emission timing, add an explicit semantic notification barrier in the wizard cubit that emits a 'step ready' event only after the new widget tree has been marked as built, decoupling the announcement trigger from the raw state transition.

medium impact medium prob scope

Automated WCAG contrast ratio checking on widget tree snapshots may produce false positives for gradient backgrounds, dark-mode overrides, or design token overrides that are resolved at runtime but appear as unresolvable colours at static analysis time. Excessive false positives would erode team trust in the CI gate, leading to suppression rules that also mask real violations.

Mitigation & Contingency

Mitigation: Scope the WCAGComplianceChecker to check only solid-colour backgrounds in the first iteration, explicitly excluding gradients from contrast checks with documented rationale. Design the check output to distinguish 'undetermined' (gradient/unknown) from 'fail' (solid colour below threshold) so the team can take targeted action on genuine failures only.

Contingency: If false positive rates exceed 20% of reported violations during initial CI runs, switch the CI gate from a hard build failure to a warning annotation on the pull request, combined with a mandatory manual review step, until the checker's rule set has been tuned to match actual design token values.