chore(atomic-a11y): add shared foundation, and delta audit validation#7187
chore(atomic-a11y): add shared foundation, and delta audit validation#7187y-lakhdar wants to merge 11 commits intofeat/a11y-openacrfrom
Conversation
The type was imported from accessibility-tree.ts which doesn't exist in this branch. Define it directly in types.ts where it's used by PlaywrightAccessibility.snapshot().
Remove SURFACE_PREFIXES, ALL_AI_CRITERIA, STATIC_NA_CRITERIA from constants.ts, AuditStatus from types.ts, and delete audit/types.ts — these symbols are only consumed by downstream PRs (browser-llm, audit-orchestrator) and will be re-introduced in the appropriate branches.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7832c84726
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const content = await readFile(filePath, 'utf8'); | ||
| const parsed = JSON.parse(content) as unknown; | ||
|
|
||
| if (!isRecord(parsed)) { |
There was a problem hiding this comment.
Parse baseline JSON arrays instead of rejecting them
loadBaselines() reads manual-audit-*.json files as BaselineEntry[], but readJsonFile throws unless the parsed value is a non-array record (isRecord explicitly rejects arrays). Since baseline audit files are array-shaped, merge/status will fail as soon as a real baseline file exists, which breaks the new delta workflow in normal usage.
Useful? React with 👍 / 👎.
| } | ||
| } | ||
|
|
||
| if (isRecord(results.wcag22Criteria)) { |
There was a problem hiding this comment.
Reject non-object wcag22Criteria values during validation
Validation only iterates wcag22Criteria when it is a record, but it never errors when the field is present with the wrong type (for example [] or a string). Those invalid deltas are treated as valid and then merged, which can silently drop criterion updates or write malformed criterion keys for newly added components, undermining the intended “well-formed delta” QA gate.
Useful? React with 👍 / 👎.
Context
This is PR facilitate the validation and merge of manual audit (done by human and or AI).
It introduces the delta workflow that validates and merges automated manual-audit input into baseline files.
a11y/reports/manual-audit-{category}.json) .a11y/reports/deltas/, then merge into baselines.What it validates
Delta JSON files (human-authored and AI-authored manual audit entries) |
When it runs
Before merge. This is a QA gate for human and AI input
Purpose
Is this manual audit input well-formed?
What this PR does
Manual audit delta workflow (
manual-audit-delta.ts):validate <delta-file>— Schema-validate a delta JSON filemerge [--dry-run]— Fold all deltas into baseline audit filesstatus— Report pending deltas and audit coverageTry it
PR Chain (5a of 7)
feat/a11y-package-scaffoldfeat/a11y-shared-foundationfeat/a11y-reporterfeat/a11y-openacrfeat/a11y-delta-workflowfeat/a11y-browser-llmfeat/a11y-audit-orchestratorfeat/a11y-reporter-wiringfeat/a11y-ci-integrationReplaces #7125 (split into 5a/5b/5c)
KIT-5471