Skip to content

feat(atomic-a11y): add a11y reporter, tests, scripts and reports#7116

Closed
y-lakhdar wants to merge 10 commits intofeat/a11y-package-scaffoldfrom
feat/a11y-reporter-and-scripts
Closed

feat(atomic-a11y): add a11y reporter, tests, scripts and reports#7116
y-lakhdar wants to merge 10 commits intofeat/a11y-package-scaffoldfrom
feat/a11y-reporter-and-scripts

Conversation

@y-lakhdar
Copy link
Contributor

@y-lakhdar y-lakhdar commented Feb 13, 2026

Summary

Extracts the accessibility reporter, unit tests, scripts, and configuration from the atomic package into the new @coveo/atomic-a11y package. This is part of the a11y cleanup initiative to separate tooling from the main atomic package.

Note: Generated report files (openacr.yaml, a11y-report.json, manual audit baselines, VPAT) are excluded from this PR to keep it reviewable. These will be added separately once the baseline is established.

What's Included

📝 Reporter Core (src/reporter/)

  • vitest-a11y-reporter.ts (983 lines) - Custom Vitest reporter that runs axe-core checks during test execution
  • merge-shards.ts (349 lines) - Merges a11y test results from parallel test shards into a single report
  • json-to-openacr.ts (1,456 lines) - Converts a11y reports to OpenACR format with full manual audit pipeline integration

🧪 Unit Tests (src/__tests__/)

  • vitest-a11y-reporter.spec.ts (178 lines) - Tests for reporter core functions
  • merge-shards.spec.ts (251 lines) - Tests for shard merging logic
  • json-to-openacr.spec.ts (332 lines) - Tests for OpenACR conversion and manual audit pipeline

🛠️ Scripts (scripts/)

  • ai-wcag-audit.mjs (1,201 lines) - AI-powered WCAG audit tool for manual review assistance
  • generate-a11y-issues.mjs (504 lines) - Generates GitHub issues from a11y violations for tracking
  • manual-audit-delta.mjs (486 lines) - Tracks changes in manual audit baselines between runs
  • vpat-from-openacr.handlebars (38 lines) - Handlebars template for generating VPAT documents from OpenACR

⚙️ Configuration

  • a11y-overrides.json (92 lines) - 17 conformance overrides for known issues/exceptions
  • reports/deltas/ - Placeholder directory for baseline delta tracking

Key Features

1. Manual Audit Pipeline

The reporter includes full manual audit integration (commits 2f9fafd, 23eeaa9):

  • Three-pillar conformance resolution: override > manual > automated
  • Dynamic status evaluation based on manual audit presence
  • Automated remarks generation summarizing manual audit results

2. Path Refactoring

  • readPackageMetadata() now accepts optional packageJsonPath parameter for cross-package usage
  • Enables the reporter to work with any package in the monorepo

3. Public API

Exports:

  • VitestA11yReporter - Main reporter class
  • mergeA11yShardReports - Shard merging utility
  • All relevant TypeScript types

How to Review

This PR contains ~6K lines of actual code and tests - no generated data files.

Focus areas:

  1. Reporter logic in src/reporter/ - especially the manual audit pipeline in json-to-openacr.ts
  2. Test coverage in src/__tests__/ - verify all core functions are tested
  3. Scripts in scripts/ - automation tooling for a11y workflows
  4. Configuration - a11y-overrides.json structure and usage

Testing

pnpm build --filter=@coveo/atomic-a11y  # Builds the package
pnpm test --filter=@coveo/atomic-a11y   # Runs unit tests (100% coverage expected)

Dependencies


Files changed: 16 | Additions: ~6K lines of source code, tests, and scripts

y-lakhdar and others added 4 commits February 13, 2026 13:07
- Remove role='toolbar' and aria-label from results per page container
- The label is already provided by the internal FieldsetGroup

Cherry-picked from 2ee9eb3 (accessibility-epic2)
Scaffolds the new @coveo/atomic-a11y package for accessibility tooling extraction. Includes package.json with axe-core and vitest dependencies, TypeScript configuration, and workspace registration.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@y-lakhdar y-lakhdar force-pushed the feat/a11y-reporter-and-scripts branch from 347ae6f to dca717d Compare February 13, 2026 23:09
@y-lakhdar y-lakhdar added the a11y Accessibility issues label Feb 13, 2026
@y-lakhdar y-lakhdar force-pushed the feat/a11y-package-scaffold branch from b650973 to 7bd623e Compare February 13, 2026 23:17
…AG data modules

- Create src/shared/types.ts with unified CriterionLevel superset
- Create src/shared/guards.ts with deduplicated isRecord/isA11yReport
- Create src/shared/constants.ts with all shared constants
- Create src/shared/file-utils.ts with file I/O utilities
- Create src/data/wcag-criteria.ts with 56 WCAG criteria definitions
- Create src/data/axe-rule-mappings.ts with axe-to-WCAG mappings
- Create src/data/criterion-metadata.ts with criterion metadata
- Update vitest-a11y-reporter.ts to use shared modules (~200 lines removed)
- Update json-to-openacr.ts to use shared modules (~371 lines removed)
- Update merge-shards.ts to use shared modules (16 lines removed)

Total extraction: 776 lines into 7 new focused modules
Zero code duplication for guards/types/constants achieved
…t scripts to TypeScript

Tasks 2, 3, 5 completed:

**Task 2: Decompose vitest-a11y-reporter.ts**
- Created src/reporter/reporter-utils.ts (337 lines)
- Created src/reporter/axe-integration.ts (58 lines)
- Modified vitest-a11y-reporter.ts to import from new modules

**Task 3: Decompose json-to-openacr.ts**
- Created src/openacr/types.ts (195 lines)
- Created src/openacr/overrides.ts (79 lines)
- Created src/openacr/manual-audit.ts (208 lines)
- Created src/openacr/conformance.ts (135 lines)
- Created src/openacr/report-builder.ts (289 lines)
- Created src/openacr/yaml-serializer.ts (103 lines)
- Reduced json-to-openacr.ts to 137 lines ✓ Under 200 target

**Task 5: Convert scripts to TypeScript**
- Converted 3 scripts from .mjs to .ts
- All scripts use shared imports

TypeScript compiles successfully
Task 6 completed:
- All 38 tests passing
- Build succeeds with zero errors
- TypeScript compiles cleanly
Task 7 completed - Final verification:
✅ All 38 tests passing
✅ Build succeeds
✅ TypeScript compiles with zero errors
✅ Public API unchanged
✅ Zero code duplication

Final structure:
- 18 new focused modules created
- json-to-openacr.ts: 137 lines (from 1465)
- vitest-a11y-reporter.ts: 395 lines (from 994)
- All scripts converted to TypeScript
- Barrel exports verified working
All 8 tasks completed:
✅ Task 1: Extract Shared Foundation Modules
✅ Task 2: Decompose vitest-a11y-reporter.ts
✅ Task 3: Decompose json-to-openacr.ts
✅ Task 4: Update merge-shards.ts Imports
✅ Task 5: Convert Scripts to TypeScript
✅ Task 6: Update Tests
✅ Task 7: Update Barrel Exports and Final Verification
✅ Final Checklist: All items verified

Session: ses_3a5c90f3bffeVksG4VODDvZ4pY
Status: COMPLETE
@y-lakhdar
Copy link
Contributor Author

Closing in favor of a smaller PR chain for easier review:

  1. feat(atomic-a11y): add shared types, guards, constants and WCAG data modules #7122 — Shared foundation + WCAG data modules
  2. feat(atomic-a11y): add vitest a11y reporter #7123 — Vitest A11y Reporter + merge-shards
  3. feat(atomic-a11y): add OpenACR converter modules #7124 — OpenACR converter modules
  4. chore(atomic-a11y): add a11y scripts, overrides, and report templates #7125 — Scripts, overrides, and report templates

Same code, same functionality, just split into logical increments.

@y-lakhdar y-lakhdar closed this Feb 16, 2026
@y-lakhdar y-lakhdar removed the a11y Accessibility issues label Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant