ultra11y 7.0.0 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +1 -1
  4. package/.opencode/plugins/ultra11y.js +1 -1
  5. package/README.md +111 -374
  6. package/dist/cypress-plugin.mjs +6 -3
  7. package/dist/jest.cjs +199 -0
  8. package/dist/jest.d.ts +24 -0
  9. package/dist/jest.mjs +167 -0
  10. package/dist/playwright.mjs +6 -3
  11. package/dist/unit-C7c8k68J.d.ts +51 -0
  12. package/dist/vitest.d.ts +25 -0
  13. package/dist/vitest.mjs +167 -0
  14. package/package.json +12 -1
  15. package/scripts/ultra11y.mjs +1016 -485
  16. package/skills/review-a11y/SKILL.md +1 -1
  17. package/skills/review-a11y/scripts/ultra11y.mjs +1016 -485
  18. package/skills/ultra11y/SKILL.md +1 -1
  19. package/skills/ultra11y/references/e2e.md +6 -0
  20. package/skills/ultra11y/references/full-audit.md +16 -0
  21. package/skills/ultra11y/references/rendered.md +46 -1
  22. package/skills/ultra11y/scripts/ultra11y.mjs +1016 -485
  23. package/src/adjudicate.ts +17 -2
  24. package/src/audit.ts +50 -3
  25. package/src/auditor.ts +4 -0
  26. package/src/capture.ts +88 -0
  27. package/src/cli.ts +78 -3
  28. package/src/discover.ts +16 -4
  29. package/src/fix.ts +4 -0
  30. package/src/glob.ts +62 -2
  31. package/src/graph/build.ts +7 -1
  32. package/src/integrations/core.ts +12 -2
  33. package/src/integrations/jest.ts +34 -0
  34. package/src/integrations/payload.ts +20 -2
  35. package/src/integrations/unit.ts +210 -0
  36. package/src/integrations/vitest.ts +35 -0
  37. package/src/output.ts +5 -1
  38. package/src/parse/html.ts +14 -0
  39. package/src/parse/snap.ts +460 -0
  40. package/src/parse/source.ts +8 -0
  41. package/src/report.ts +8 -0
  42. package/src/rules/cross-rule.ts +2 -2
  43. package/src/rules/rule.ts +16 -1
  44. package/src/site-data.ts +0 -2
  45. package/src/standards/pack-rules.ts +2 -2
  46. package/src/types.ts +10 -2
@@ -10,7 +10,7 @@
10
10
  "name": "ultra11y",
11
11
  "source": "./",
12
12
  "description": "RGAA 4.1.2 accessibility audits on a WCAG 2.2 AA core: automatic review before commit, push and pull request, plus dated, evidenced Markdown, HTML and per-page conformance reports in Claude Code.",
13
- "version": "7.0.0",
13
+ "version": "7.1.0",
14
14
  "author": { "name": "maxgfr" },
15
15
  "homepage": "https://github.com/SocialGouv/ultra11y",
16
16
  "repository": "https://github.com/SocialGouv/ultra11y",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ultra11y",
3
3
  "description": "RGAA 4.1.2 accessibility audits, the French State's standard, on a WCAG 2.2 AA core: automatic review before commit, push and pull request, plus dated, evidenced Markdown, HTML and per-page conformance reports. Never declares conforming what it has not verified.",
4
- "version": "7.0.0",
4
+ "version": "7.1.0",
5
5
  "author": { "name": "maxgfr" },
6
6
  "homepage": "https://github.com/SocialGouv/ultra11y",
7
7
  "repository": "https://github.com/SocialGouv/ultra11y",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ultra11y",
3
3
  "description": "RGAA 4.1.2 accessibility audits, the French State's standard, on a WCAG 2.2 AA core: automatic review before commit, push and pull request, plus dated, evidenced Markdown, HTML and per-page conformance reports. Never declares conforming what it has not verified.",
4
- "version": "7.0.0",
4
+ "version": "7.1.0",
5
5
  "author": { "name": "maxgfr", "url": "https://github.com/maxgfr" },
6
6
  "homepage": "https://github.com/SocialGouv/ultra11y",
7
7
  "repository": "https://github.com/SocialGouv/ultra11y",
@@ -44,7 +44,7 @@ import { fileURLToPath } from "node:url";
44
44
  // does not carry it, so a user's own ultra11y.js is never clobbered. Kept as text, not as
45
45
  // an export (see above).
46
46
  const ULTRA11Y_OPENCODE_PLUGIN = "ULTRA11Y_OPENCODE_PLUGIN";
47
- const ULTRA11Y_PLUGIN_VERSION = "7.0.0";
47
+ const ULTRA11Y_PLUGIN_VERSION = "7.1.0";
48
48
  const PLUGIN_ID = "ultra11y";
49
49
  const SKILL_NAMES = ["ultra11y", "review-a11y"];
50
50
 
package/README.md CHANGED
@@ -1,407 +1,144 @@
1
- # ultra11y — RGAA 4.1.2 accessibility audits, on a WCAG 2.2 AA core
1
+ # ultra11y — l’audit d’accessibilité RGAA 4.1.2
2
2
 
3
3
  [![CI](https://github.com/SocialGouv/ultra11y/actions/workflows/ci.yml/badge.svg)](https://github.com/SocialGouv/ultra11y/actions/workflows/ci.yml)
4
4
  [![npm](https://img.shields.io/npm/v/ultra11y?logo=npm)](https://www.npmjs.com/package/ultra11y)
5
- [![agent plugin](https://img.shields.io/badge/Claude_Code_·_Codex_·_OpenCode-plugin-6b46c1)](#add-to-your-coding-agent)
5
+ [![plugin](https://img.shields.io/badge/Claude_Code_·_Codex_·_OpenCode-plugin-6b46c1)](#installer)
6
6
  [![node](https://img.shields.io/node/v/ultra11y)](https://nodejs.org)
7
- [![license](https://img.shields.io/npm/l/ultra11y)](LICENSE)
7
+ [![licence](https://img.shields.io/npm/l/ultra11y)](LICENSE)
8
8
 
9
- **Documentation (in French): [socialgouv.github.io/ultra11y](https://socialgouv.github.io/ultra11y/)** — what the tool does, what it cannot check, criterion-by-criterion RGAA coverage and how it is tested, with every number generated from the code.
9
+ ultra11y audite un site selon le **RGAA 4.1.2**, le référentiel d’accessibilité de l’État.
10
+ C’est une *skill* pour votre agent de code (Claude Code, Codex, OpenCode) : vous demandez
11
+ un audit, l’agent le mène de bout en bout et vous remet un **rapport de conformité daté**.
12
+ **Il ne déclare jamais conforme ce qu’il n’a pas vérifié.**
10
13
 
11
- ### Add to your coding agent
14
+ Ce que vous obtenez :
12
15
 
13
- Two lines, and the accessibility review runs **by itself** before every commit, push and
14
- pull request — you never type the skill's name:
16
+ - le rapport RGAA daté, en Markdown et en HTML imprimable ;
17
+ - la grille des **106 critères**, page par page, avec le taux de conformité de chaque page
18
+ et le taux moyen de l’échantillon, les chiffres qu’attend une déclaration d’accessibilité ;
19
+ - un dossier par page, avec capture d’écran et chaque non-conformité illustrée ;
20
+ - sur demande, un backlog et des tickets GitHub, GitLab ou Jira.
15
21
 
16
- | | |
17
- |---|---|
18
- | **Claude Code** | `/plugin marketplace add SocialGouv/ultra11y` then `/plugin install ultra11y@ultra11y` |
19
- | **OpenAI Codex CLI** | `codex plugin marketplace add SocialGouv/ultra11y` then `codex plugin add ultra11y@ultra11y` |
20
- | **OpenCode** 1.x and 2.x | `npx ultra11y install --opencode` — or pin `"plugins": ["ultra11y@latest"]` in `opencode.json` (OpenCode 1: `"plugin"`) |
21
- | **Anything else** | `npx ultra11y install --agents-md` (no hook API: see the caveat below) |
22
-
23
- <sub>Prefer the skills only, without the automatic hook? `npx skills add SocialGouv/ultra11y`
24
- (`--agent codex`, `--agent opencode`, …). Already on npm and just want the gate?
25
- `npx ultra11y install --all`, and `npx ultra11y status` to check what is actually wired.
26
- Full details, thresholds and off-switches under [Install](#install).</sub>
27
-
28
- > Audit a site against **RGAA 4.1.2**, the French State's accessibility standard (*référentiel général d'amélioration de l'accessibilité*), on its **WCAG 2.2 AA** core: a dated conformance report, the 106-criterion grid, a backlog and tickets — or author/review accessible markup without regressions. It never declares conforming what it has not verified. A [skills.sh](https://skills.sh) agent skill: a deterministic, zero-dependency static engine **plus** the agent's judgment, with `check`/`verify` gates against hallucinated non-conformities. **The central deliverable is the auditor conformance block** — theme, criterion + official wording, test(s), WCAG mapping + level, finding, expected state, verification, `file:line` occurrences — rendered identically by the `report` (compliance doc), the `prd` backlog and the GitHub issues, in the active standard's vocabulary and **in your language** (`--lang auto` follows the conversation/repo). **RGAA ships first; WCAG is the worldwide core it maps onto, and other country standards are pluggable in-repo packs.**
29
-
30
- ultra11y is built around an honest **division of labour**. Automated tools only catch a fraction of accessibility problems, so the engine does the *mechanical* work — 102 machine-detectable static checks tied to the WCAG 2.2 success criteria — and is explicit about everything it can't decide statically. What it can't, the **AI agent adjudicates** (statically, from the evidence, gated by `verify`/`check`) — not a deferral to a human:
22
+ Documentation complète : **[socialgouv.github.io/ultra11y](https://socialgouv.github.io/ultra11y/)**.
31
23
 
32
- - **Automatable (engine):** missing `alt`/`lang`/`title`, unlabeled fields, empty links/buttons, icon-only controls, iframes without title, tables without headers, heading-level skips, empty/dangling headings & labels, duplicate ids, invalid/broken ARIA, positive `tabindex`, autoplay/timed-refresh/`blink`/`marquee` media…
33
- - **Agent judgment (gated):** alt-text relevance, link purpose in context, reading/tab order, caption accuracy — the agent rules on these via `verify --manual` → `--apply`, each verdict carrying a justification (or a groundable NC), never a silent "conforming".
34
- - **Needs rendering (scan tier):** computed contrast, visible focus, zoom/reflow, content on hover — decided by `scan` (axe-core in a real browser); until then they stay **residual risks**, never silently "conforming".
35
- - **Advisory vs non-conformity:** a good practice with no failing normative test (an `advisory` pack rule, a best-practice-only axe violation, an agent recommendation) renders as « Recommandation (non normative) » — it never flips a criterion to `NC` nor enters the conformance rate. An NC always cites a `normativeRef`.
36
- - **Stateful scan probes:** the scan drives the page with bounded, non-navigating interactions (fill inputs then re-measure overflow; a live-region probe for status messages 4.1.3) — `--no-interact` opts out; `--interact-clicks` re-enables button clicks on authenticated scans (destructive-named buttons are never clicked).
37
- - **Normative page sample (échantillon):** a country-standard audit runs over a declared `sample.pages` set — **`pages discover --crawl|--sitemap --write` builds it for you** (names read from each page's `<title>`, existing entries never overwritten), `sample check` lints its coverage against the standard's required page kinds, `scan --sample` scans it, and an un-scanned `--standard rgaa` report is flagged **partial**.
38
- - **Pack-only detection (declarative):** a standards pack can ship its own `rules` (a bounded, ReDoS-guarded matcher DSL — no code) and normativity/severity `overrides`, projecting onto its criteria without forking the engine.
24
+ ## Installer
39
25
 
40
- ## Measured against a corpus it did not write
41
-
42
- A self-authored fixture can only prove that a rule fires on the defect written for it. So the engine is also scored against the **[W3C ACT-Rules Community Group](https://act-rules.github.io) test corpus** — 1 134 `passed` / `failed` / `inapplicable` examples across 91 rules, authored independently of this project:
43
-
44
- | | |
26
+ | Agent | Installation |
45
27
  |---|---|
46
- | Rules scored | **44** (the ACT rules an equivalent engine check exists for) |
47
- | `failed` examples caught | **168 / 187** |
48
- | `passed` / `inapplicable` examples left alone | **401 / 401** — no unexplained false positive |
49
- | Deliberate divergences | 9, each argued on the record |
50
- | Declared gaps (statically decidable, not implemented) | 0 |
51
-
52
- Rules needing a rendered page (computed contrast, keyboard traps) or a human call (is this heading descriptive?) are **declared and routed**, not silently scored zero. The full per-rule matrix — including every gap and every divergence — is generated into [`skills/ultra11y/references/act.md`](skills/ultra11y/references/act.md) and re-checked on every build; the corpus itself is refreshed daily by a workflow, so the numbers cannot quietly go stale.
53
-
54
- ## Install
55
-
56
- **As a CLI** — on npm, zero runtime dependencies (Node ≥ 22.18):
57
-
58
- ```sh
59
- npx ultra11y --help # no install
60
- npm i -D ultra11y # or as a dev dependency
61
- ```
62
-
63
- **As a test-runner plugin** — audit a page inside your own E2E run, in the state your test
64
- built it:
65
-
66
- ```js
67
- import { checkA11y } from "ultra11y/playwright"; // or "ultra11y/cypress" (+ "/plugin")
68
- await checkA11y(page, { as: "accueil" });
69
- ```
70
-
71
- **As an agent skill** — the repository ships **two** (pick at the prompt, or pass the name):
72
- `ultra11y` for full audits, compliance reports, PRD backlogs and standards packs, and
73
- `review-a11y` for the fast loop that audits **exactly the code under change** (staged files,
74
- working diff, or branch vs merge-base) and reports like a code reviewer. Both bundle the same
75
- install-free engine.
76
-
77
- ```sh
78
- npx skills add SocialGouv/ultra11y # this agent
79
- npx skills add SocialGouv/ultra11y --agent codex # …or opencode, cursor, gemini, amp, zed…
80
- ```
81
-
82
- **As an agent plugin** — the same two skills, plus the hook that makes the review
83
- **automatic**. Installed this way, a pending `git commit`, `git push` or `gh pr create`
84
- that carries accessibility findings is stopped once and the agent is handed the findings,
85
- so `review-a11y` runs before the work goes out — you never type the skill's name.
86
-
87
- ```
88
- /plugin marketplace add SocialGouv/ultra11y # Claude Code
89
- codex plugin marketplace add SocialGouv/ultra11y # Codex CLI
90
- npx ultra11y install --opencode # OpenCode 1.x or 2.x (detected; --opencode-version 1|2)
91
- ```
92
-
93
- Codex's hook engine is a near-clone of Claude Code's — same events, same envelope, and it
94
- exports `${CLAUDE_PLUGIN_ROOT}` too — so both harnesses share one `hooks/hooks.json`.
95
- OpenCode has no permission-decision channel, so there the gate surfaces as a **failed shell
96
- call whose error message carries the findings**. One plugin file serves OpenCode 1 and
97
- OpenCode 2, whose plugin APIs differ: V2 reads its `setup(ctx)`, V1 its `server()`.
98
- Per-harness deltas, the Codex feature flag and the trust prompt: [`skills/ultra11y/references/harnesses.md`](skills/ultra11y/references/harnesses.md).
99
-
100
- Four things worth knowing, because they bound what "automatic" means here:
101
-
102
- - A hook **cannot force** a skill to be invoked. It blocks the command and hands over the
103
- reason and the findings; the agent is what invokes `review-a11y`. In practice a motivated
104
- `deny` is enough — it is not a guarantee.
105
- - **Hooks do not enable themselves.** Installing the plugin is what turns them on. On Codex
106
- they also need `[features] hooks = true`, which `install --codex` sets for you; run
107
- `npx ultra11y status` if you are not sure what is live.
108
- - **No harness has a git event** (no `PreCommit`, no `PRCreated`), which is why the hook
109
- listens on `PreToolUse` for the shell tool — `Bash` on Claude Code, `shell` on Codex —
110
- and recognises the commands that publish work.
111
- - On a harness with **no hook API at all** (Cursor, Amp, Zed, Gemini CLI…), nothing is
112
- automatic. `npx ultra11y install --agents-md` makes the engine discoverable and hands the
113
- agent the adjudication protocol; `init --hook` below is what actually enforces the gate.
114
-
115
- The gate never blocks twice for the same findings, so a retry always lands. It stays out of
116
- the way when git's own `no-verify` bypass is used, outside a repository, and whenever the
117
- engine cannot answer.
118
- Disable it per-repo with `"hook": { "failOn": "off" }` in `.ultra11yrc.json`, per-command
119
- with `SKIP_A11Y=1`, or per-session with `ULTRA11Y_HOOK=off`; raise or lower the bar with
120
- `ULTRA11Y_HOOK_FAIL_ON=blocking|major|minor` (default `blocking`).
121
-
122
- **In CI — run iterion's [`rgaa-audit` bot](https://github.com/SocialGouv/iterion/tree/main/bots/rgaa-audit).**
123
- ultra11y ships no CI integration of its own. The bot is the harness that turns the engine into an
124
- audit with no one at the keyboard: it installs the engine pinned (version and sha256), renders
125
- your page sample, has read-only agents adjudicate the judgment criteria, puts every claim on
126
- trial, gates with `check` and files one issue per non-conforming criterion. See
127
- [`references/ci.md`](skills/ultra11y/references/ci.md).
128
-
129
- Or clone and run the bundled engine straight from the repo:
28
+ | **Claude Code** | `/plugin marketplace add SocialGouv/ultra11y` puis `/plugin install ultra11y@ultra11y` |
29
+ | **Codex CLI** | `codex plugin marketplace add SocialGouv/ultra11y` puis `codex plugin add ultra11y@ultra11y` |
30
+ | **OpenCode** 1.x et 2.x | `npx ultra11y install --opencode` |
31
+ | **Autres agents** | `npx skills add SocialGouv/ultra11y` (les skills seules, sans hook) |
130
32
 
131
- ```sh
132
- node scripts/ultra11y.mjs --help
133
- ```
134
-
135
- ## Commands
136
-
137
- ```
138
- ultra11y audit <globs… | -> [--standard <pack>] [--out <dir>] [--include <glob>] [--exclude <glob>] [--ext <list>] [--jsx] [--graph] [--json] [--lang auto|en|fr] [--no-default-excludes]
139
- ultra11y audit [--changed | --since <ref> | --staged] [--max-files <n>] [--dedup exact|normalized|off] [--fail-on blocking|major|minor]
140
- ultra11y audit [--captures <dir>] [--no-captures] [--require-captures] # audit rendered-DOM captures alongside source
141
- ultra11y report --in <audit.json> [--out <dir>] [--standard <pack>] [--html] [--evidence] [--lang auto|en|fr]
142
- ultra11y prd --in <audit.json> [--out <dir>] [--split criterion] [--format audit|doc] [--standard <pack>] [--lang auto|en|fr]
143
- ultra11y tickets --in <audit.json> [--provider auto|github|gitlab|jira] [--grain criterion|page|page-criterion|single|file] [--transport auto|cli|rest] [--max-tickets <n>] [--dry-run] [--json]
144
- ultra11y render [<dir>] [--scaffold | --setup | --coverage | --storybook] [--captures <dir>] [--out <file>] [--json]
145
- ultra11y snapshot write [--root <dir>] [--fail-on blocking|major|minor] [--json] # payload on stdin → .ultra11y/pages/<id>/ + audit
146
- ultra11y snapshot list [--root <dir>] [--json]
147
- ultra11y pages --in <audit.json> [--standard <pack>] [--json] [--lang auto|en|fr] # the per-page criterion grid
148
- ultra11y pages --in <audit.json> --format report [--split page] [--out <dir>] # the per-page report, with screenshots
149
- ultra11y pages discover --sitemap <url> | --crawl <url> [--depth <n>] [--max <n>] [--write] # build the page sample
150
- ultra11y criteria [<sc>] [--list] [--standard <pack> [--theme <N>]] [--generate] [--json] [--lang auto|en|fr]
151
- ultra11y criteria --standard <pack> --glossary [<term>] | criteria [--standard <pack>] --plan # defined terms · the work plan
152
- ultra11y check --report <md> [--standard <pack>] [--quiet] [--json]
153
- ultra11y check --in <audit.json> --require-decided[=pages] [--allow-undecided <file>] [--require-rendered]
154
- ultra11y verify --report <md> [--standard <pack>] [--semantic] [--apply <verdicts.json>] [--max-verify <n>] [--json]
155
- ultra11y verify --report <md> [--conformities <ledger|adjudication.json> | --no-conformities] # also put the claimed CONFORMITIES on trial
156
- ultra11y verify --report <md> --in <audit.json> --manual | verify --apply <adjudication.json> --in <audit.json> [--ledger]
157
- ultra11y orchestrate --run <dir> [--phase adjudicate|verify-report] [--eco] [--manifest] # fan the judgment out to subagents
158
- ultra11y fix <globs… | -> [--write] [--iterate] [--changed | --since <ref> | --staged] [--safe] [--only <ids>] [--jsx] [--json]
159
- ultra11y init [--hook] [--fail-on blocking|major|minor]
160
- ultra11y pack check <pack.json> [--guidance <g.json>] | scaffold # gate an (AI-)authored standards pack
161
- ultra11y scan <url|file…> [--cwd <dir>] [--root <dir>] [--storage-state <file>] [--merge <audit.json>] [--out <dir>] [--json]
162
- ultra11y scan --sample | --sitemap <url> | --crawl <url> [--depth <n>] [--max <n>] [--merge <audit.json>] [--json]
163
-
164
- # global: --pack <paths> (load external standards pack(s) at runtime) · --override
165
- ```
166
-
167
- ## Standards packs (RGAA France first; add your country)
168
-
169
- WCAG 2.2 AA is the ENGINE's canonical key, because its rules are tied to success criteria and
170
- a pack criterion is defined as a projection of them. Each country standard ships as an in-repo
171
- **standards pack** — a small JSON carrying that mapping — and `--standard` re-keys everything
172
- a reader sees, starting with `audit` itself:
173
-
174
- ```sh
175
- node scripts/ultra11y.mjs audit src --standard rgaa # RGAA-titled summary by thématique, findings tagged [8.4]
176
- node scripts/ultra11y.mjs audit src --standard rgaa --out audits --json # a pack-keyed document: 106 criteria, 13 themes
177
- node scripts/ultra11y.mjs report --in audits/audit-latest.json --standard rgaa # → audits/rgaa-YYYY-MM-DD.md
178
- node scripts/ultra11y.mjs criteria --standard rgaa 8.3 # a pack criterion (+ its WCAG SCs)
179
- node scripts/ultra11y.mjs criteria --standard rgaa --plan # the work plan: what each evidence tier settles
180
- ```
181
-
182
- `.ultra11yrc.json { "standard": "rgaa" }` makes it the default for every command. Under a pack,
183
- no deliverable carries a WCAG cross-reference — report, PRD, tickets and per-page sheets name
184
- that standard's criteria and nothing else; the WCAG core travels inside the
185
- document's `core` field, where the pipeline reads it and no rendering does. The one place the
186
- mapping is still printed is `criteria --standard rgaa <id>`, which is a reference lookup and
187
- where a reader goes looking for it.
188
-
189
- **RGAA 4.1.2** (France) ships as the flagship pack. Section 508 (US), EN 301 549 (EU) and
190
- others are welcome — adding a country is a single PR (pack JSON + one registration line +
191
- a test). See [`CONTRIBUTING.md`](CONTRIBUTING.md) and `skills/ultra11y/references/standards.md`.
192
-
193
- ### What RGAA automation actually covers
33
+ Le plugin apporte deux skills, `ultra11y` (l’audit complet) et `review-a11y` (la revue d’un
34
+ changement), et un **hook** : avant `git commit`, `git push` ou `gh pr create`, il audite le
35
+ diff et, s’il trouve un défaut, bloque la commande une fois pour que l’agent lance la revue.
36
+ Sur Codex, `npx ultra11y install --codex` active les hooks ; `npx ultra11y status` dit ce qui
37
+ est branché. Le couper : `SKIP_A11Y=1`, `ULTRA11Y_HOOK=off` ou `"hook": { "failOn": "off" }`
38
+ dans `.ultra11yrc.json`. Détails : [`references/harnesses.md`](skills/ultra11y/references/harnesses.md).
194
39
 
195
- The engine's 102 rules are not 102 RGAA criteria: several rules can evidence the same official
196
- test, and a rule can detect a useful symptom without exhausting the criterion's alternatives,
197
- exceptions or relevance checks. The generated contract classifies all **258 official RGAA
198
- tests**:
40
+ **La bibliothèque pour vos tests de bout en bout** (Node ≥ 22.18) : `npm i -D ultra11y`.
199
41
 
200
- - **30 `static` tests across 22 criteria:** `1.1`, `1.9`, `2.1`, `5.7`, `5.8`, `6.1`, `6.2`, `7.1`,
201
- `8.2`, `8.3`, `8.4`, `8.5`, `8.10`, `9.3`, `10.1`, `10.12`, `11.1`, `11.2`, `11.5`,
202
- `11.6`, `11.8`, `11.9`.
203
- - **3 `rendered` tests across 3 criteria:** `1.1`, `8.1`, `10.7`.
204
- - Those two tiers cover **24 distinct criteria that can produce a deterministic `NC`**;
205
- `1.1` belongs to both.
206
- - **54 criteria receive a normative engine signal:** 24 have at least one decisive rule and
207
- 43 receive candidate evidence, with overlap. One additional criterion receives only an
208
- advisory signal. A candidate is forwarded to adjudication and never changes a verdict by
209
- itself.
210
- - Only **8.3 and 8.5** may earn `C` from a complete silent measurement. For the other
211
- mechanically detectable tests, silence can mean “no subject found” or “an alternative or
212
- exception still needs judging”, so it cannot prove conformity. 10.1 was on that list and
213
- left it: its rule tolerates `<u>`, tolerates `width`/`height` on nine tags where the
214
- glossary names five, and covers “presentation built out of spaces” with two heuristics —
215
- every one of them a deliberate under-report, which is the safe direction for a finding and
216
- the wrong one for a conformity.
217
- - The remaining **225 `judgment` tests across 92 criteria** all enter the AI worklist,
218
- including an apparently absent subject whose `NA` still needs confirmation. Overall,
219
- **104 of 106 criteria require adjudication to earn `C`**.
42
+ ## Utiliser
220
43
 
221
- The number can grow, but the useful target is **more observed, exact failures**, not a larger
222
- marketing count. The best next candidates are complete rendered probes for zoom/reflow and
223
- hover content (10.4, 10.11, 10.13), and contrast,
224
- link distinction or orientation checks (3.2, 3.3, 10.6, 13.9) that first rule out every
225
- official alternative and particular case. The ACT corpus's remaining misses are another
226
- implementation queue, although closing one does not necessarily cover a new RGAA criterion. A candidate is
227
- promoted only when a narrower rule demonstrably exhausts its cited official test; the two
228
- `C`-by-silence criteria stay unchanged until an equally complete proof exists.
44
+ **1. Demander un audit.** Dans l’agent : « audite ce site selon le RGAA ». La skill suit
45
+ [`references/full-audit.md`](skills/ultra11y/references/full-audit.md), le même parcours sur
46
+ tous les agents :
229
47
 
230
- The generated [106-criterion / 258-test matrix](skills/ultra11y/references/rgaa-automation.md)
231
- is the source of truth; CI rebuilds it from the vendored DINUM data and rejects drift.
48
+ 1. passage du moteur statique sur le code source ;
49
+ 2. capture des pages rendues dans un vrai navigateur (axe-core, sondes de focus, zoom, survol) ;
50
+ 3. arbitrage par l’agent des critères qui demandent un jugement, preuve à l’appui ;
51
+ 4. contre-vérification de chaque NC, C et NA : une NC réfutée est retirée, un C ou un NA
52
+ réfuté repart « à évaluer » ;
53
+ 5. registre des verdicts, publication des livrables, puis contrôle par `check`.
232
54
 
233
- **Downloadable PDF documents (RGAA 13.3).** The engine reads PDFs with its own zero-dependency
234
- reader (Node `zlib` only): `audit report.pdf` / `audit "public/**/*.pdf"`, and `scan` — or the
235
- Playwright fixture, through the test's own session — downloads the same-origin PDFs each captured
236
- page links to into `.ultra11y/documents/`: a `.pdf` path, a `download` link, a link or route
237
- naming PDF (`/api/declaration-pdf`), kept only when the response is a PDF; `scan --storage-state`
238
- sends the session's matching cookies (bounded, `--no-pdf` / `pdf: false` to opt out). Five document checks — `pdf-untagged`, `pdf-lang-missing`,
239
- `pdf-title-missing` (title + `DisplayDocTitle`), `pdf-no-text` (image-only scan) and the advisory
240
- `pdf-structure-shallow` — are listed per document in the report and reach RGAA 13.3 as
241
- **candidate** evidence: an accessible alternative version may exist, so they never decide a
242
- verdict, and passing them is never PDF/UA conformance (veraPDF/PAC establish that). An encrypted
243
- or malformed file is reported unreadable. See `skills/ultra11y/references/audit.md`.
55
+ **2. Capturer les pages depuis vos tests.** Le test audite la page dans l’état où il l’a
56
+ laissée (session connectée, formulaire rempli, modale ouverte). Chaque page est enregistrée
57
+ dans `.ultra11y/pages/<id>/` et sera réauditée hors ligne par l’audit complet.
244
58
 
245
- ### Scale, fixes, and repo automation
246
-
247
- - **Scale** — the engine streams file-by-file (bounded memory), audits **only markup**,
248
- and lets you focus: `--changed`/`--since` (git diff only), priority ordering
249
- (layouts/templates/shared components first), content de-duplication, and an explicit
250
- `--max-files` cap with logged truncation. See `references/scale.md`.
251
- - **Fixes** — `fix` puts the fixes in place (native-first, anti-hallucination): deterministic
252
- auto-codemods, fill-in `TODO` placeholders for the agent to complete, and judgment-only
253
- proposals. `--dry-run` is the default; `--write` applies but only after a re-audit proves
254
- no new non-conformity, and never on lossy JSX/TSX. See `references/fix.md`.
255
- - **During your E2E run** — `import { checkA11y } from "ultra11y/playwright"` (or
256
- `ultra11y/cypress` + `ultra11y/cypress/plugin`) audits a targeted page **inside the test run
257
- you already have**. Cypress feeds the pixel
258
- tier too, via `after:screenshot`. `checkA11y(page, { report: true })` emits the per-page
259
- report straight out of the run. The audit runs, so the page is checked in the state
260
- your test built (logged in, form filled, modal open) — state a separate `scan` run does not
261
- have. Each checked page is persisted as a **snapshot** (`.ultra11y/pages/<id>/`: the whole
262
- rendered document + computed styles + boxes), which is the durable half: the same page
263
- re-audits **offline, with no browser**, so CI and the per-page report work from it. Because
264
- a snapshot is a full document, the page-scoped rules finally run — RGAA **8.3** (`lang`),
265
- **8.5/8.6** (`title`) — and every finding carries both its page and the source file that
266
- rendered it. See `references/e2e.md` and `references/pages.md`.
267
- - **A country standard is adjudicated at its OWN granularity** — 97 of RGAA's 106 criteria
268
- carry at least one judgment test and can still need adjudication to earn C; decisive rules
269
- can nevertheless prove their bounded failures.
270
- `verify --manual
271
- --standard rgaa` now keys the worklist by **RGAA criteria**, each carrying its numbered tests
272
- in full, its technical note, its particular cases, its guidance and the glossary definitions
273
- its tests cite (119 entries that previously had no reader). A `normativeRef` must cite one of
274
- the item's **own** tests — the laxer check accepted a WCAG id that happened to collide with
275
- an unrelated RGAA test number. Verdicts fold into a separate `packAdjudication` layer so a
276
- pack decision never rewrites the WCAG core. See `references/judgment.md`.
277
- - **Rendered tier (offline)** — six rules read a snapshot's browser-only signals inside the
278
- ordinary `audit`: **no browser, no running server**. `rendered-contrast` measures
279
- contrast on the *computed* styles (the inline-literal rule could only see colours written in
280
- the markup); `rendered-contrast-pixel` measures it **on the screenshot** for text over a
281
- gradient or image, where `background-color` is transparent and every CSSOM-based checker —
282
- axe-core included — is blind; `rendered-nontext-contrast` decides whether a form control's
283
- boundary is perceivable (**RGAA 3.3**); and two more read the *stylesheet itself*, which is
284
- the only place they exist: a focus indicator removed with nothing put back (**10.7**, until
285
- now reachable only by a live browser probe) and an orientation lock (**13.9**).
286
- `rendered-link-colour-only` makes **RGAA 10.6** decidable at all.
287
- Each can say *"I don't know"*: an unresolvable backdrop, a varied region, a cross-origin
288
- stylesheet, a `box-shadow` that might be the boundary — all leave the criterion undecided
289
- rather than guessed, and without signals the rules do not fire, so no pre-existing verdict
290
- changes. `tests/rgaa-coverage.test.ts` pins a floor of **50 of 106** RGAA criteria mapped
291
- onto an engine rule, up from 43 before this tier; silently losing one fails CI.
292
- - **Every scanned page is a snapshot** — `scan` no longer keeps only findings: each page it
293
- visits is persisted to `.ultra11y/pages/<id>/` (`--no-snapshot` opts out). That is what turns
294
- a URL into a real per-page verdict — a page known only by its URL can never be conforming by
295
- silence, so a sitemap-driven audit used to produce an almost empty grid. With a snapshot the
296
- page-scoped rules run (**RGAA 8.3 / 8.5 / 8.6**), the DOM **JavaScript built at runtime** is
297
- audited like any other markup, and the page re-audits **offline, with no browser**. The
298
- collection happens on the *pristine* page — before axe injects its source and before any probe
299
- fills an input or resizes the viewport — otherwise the snapshot would record our own
300
- instrumentation instead of the site.
301
- - **Page by page** — RGAA is a per-page norm; the engine's verdict is scope-wide. `pages`
302
- bridges the two: one row per criterion, one column per page URL, embedded in `report` and
303
- rebuilt from a committed `audit.json` alone. The per-page status is not recomputed — a
304
- per-page *view* of the audit runs through the very same projection the report uses, so grid
305
- and report agree by construction. Two rules hold the line: a finding is attributed to a page
306
- only when something **says** so (else it is counted as unattributed, never spread across
307
- pages), and a criterion is conforming *by silence* only on a page whose real rendered DOM
308
- was audited. An adjudicated non-conformity counts only on the pages its findings are on; an adjudicated
309
- conformity stays a claim about the whole run, except on a page with none of the criterion's
310
- subject. Under a country standard, a page's rate is the RGAA page formula: conforming ÷
311
- (conforming + non-conforming), the criteria still to assess counted beside it and marking it
312
- provisional. And `pages --format report [--split page]` turns that into the **deliverable an
313
- auditor hands over**: one dossier per page — identity, **screenshot**, rate, *every* criterion
314
- of the standard with its status on that page, then each non-conformity as the ordinary auditor
315
- block. It re-decides nothing and invents no format, so a page sheet and the compliance report
316
- cannot disagree; `check` gates it against invented criteria like any other report.
317
- See `references/pages.md`.
318
- - **CI through iterion** — ultra11y ships no GitHub Action or GitLab template. CI audits run
319
- through iterion's [`rgaa-audit` bot](https://github.com/SocialGouv/iterion/tree/main/bots/rgaa-audit),
320
- which drives the engine CLI pinned, adjudicates and refutes with read-only agents, and files
321
- the issues. The CLI it calls — `audit`, `scan --sample`, `verify --manual`/`--apply`/`--report`,
322
- `check`, `report`, `pages`, `tickets` — is the engine's stable contract. See `references/ci.md`.
323
- - **Automation** — `init --hook` (default) wires a zero-dependency git pre-commit gate over the
324
- **strict staged snapshot**: it audits the exact index blobs, auto-applies the safe fixes and
325
- re-stages them, and blocks only on judgment issues. See `references/automation.md`.
326
-
327
- ### Optional dynamic tier (axe-core)
328
-
329
- `scan` runs **axe-core in a headless browser** to decide the *needs-rendering* criteria the static engine leaves as residual risks — chiefly **computed colour contrast (1.4.3)** plus a 320px **reflow** check (1.4.10) and a render cross-check of the structural rules. It uses a Playwright that resolves from your project (`--cwd`), then from ultra11y's own dependencies, and additionally probes focus visibility (2.4.7), 200% zoom (1.4.4), text spacing (1.4.12) and content-on-hover (1.4.13), plus **stateful** probes (fill inputs then re-measure overflow, and a live-region probe for status messages 4.1.3 — opt out with `--no-interact`, `--interact-clicks` for authed-scan button clicks), and takes `--storage-state` for authenticated pages. `--merge` folds the findings into a static `AuditResult`, upgrading `manual` criteria to `C`/`NC`. A country-standard audit scans its declared page sample with `scan --sample` (lint it first with `sample check`):
330
-
331
- ```sh
332
- node scripts/ultra11y.mjs audit "src/**/*.html" --out audits --json > /dev/null
333
- node scripts/ultra11y.mjs scan http://localhost:3000 --cwd . --merge audits/audit-latest.json --out audits
334
- node scripts/ultra11y.mjs report --in audits/audit-latest.json --out audits
335
- ```
336
-
337
- The scan needs a Chromium binary (`npx playwright install chromium`, or one already on the machine named with `--browser-path /usr/bin/chromium` / `ULTRA11Y_BROWSER_PATH` — launched as given, never replaced by a fallback) plus `@playwright/test` and `@axe-core/playwright` — which **come with the npm package**, since they are its own dependencies; the audited project's own copies take precedence when it has them. Running the engine as a **standalone skill bundle** is the exception: an installed skill has no `node_modules` beside it, so there the two packages must be in the audited project, reachable from `--cwd`. The engine bundle itself stays dependency-free either way. See `skills/ultra11y/references/dynamic.md`.
338
-
339
- Typical audit flow:
59
+ ```js
60
+ import { test } from "ultra11y/playwright";
340
61
 
341
- ```sh
342
- node scripts/ultra11y.mjs audit "src/**/*.html" --json > audit.json
343
- node scripts/ultra11y.mjs report --in audit.json --out audits # audits/wcag-YYYY-MM-DD.md
344
- node scripts/ultra11y.mjs check --report audits/wcag-YYYY-MM-DD.md # integrity gate
62
+ test("accueil", async ({ page, ultra11y }) => {
63
+ await page.goto("/");
64
+ await ultra11y({ as: "accueil" }); // ou checkA11y(page, { as: "accueil" })
65
+ });
345
66
  ```
346
67
 
347
- ### A report someone will actually open
68
+ Cypress : `ultra11y(on)` dans `setupNodeEvents` (import depuis `ultra11y/cypress/plugin`),
69
+ `import "ultra11y/cypress"` dans le fichier de support, puis `cy.ultra11y({ as: "accueil" })`.
70
+ `sweepSample()` parcourt l’échantillon déclaré dans `.ultra11yrc.json`. Options :
71
+ [`references/e2e.md`](skills/ultra11y/references/e2e.md).
348
72
 
349
- There are two deliberate publication profiles. In an interactive audit — on Claude Code, Codex
350
- or OpenCode alike, following `skills/ultra11y/references/full-audit.md` — the skill produces the
351
- detailed deliverable: adjudicated Markdown, a printable single-file HTML report,
352
- per-page HTML/Markdown dossiers, screenshots and annotated evidence. In CI, iterion's
353
- `rgaa-audit` bot publishes the dated report, the per-page grid, the coverage annex and the
354
- verdict ledger.
73
+ Tests unitaires : `audit` lit les instantanés `__snapshots__/*.snap` de Jest et Vitest tels quels,
74
+ et `checkA11y(container)` ou `expect(container).toBeAccessible()` (depuis `ultra11y/vitest` ou
75
+ `ultra11y/jest`) auditent un composant rendu par jsdom. Voir [`references/rendered.md`](skills/ultra11y/references/rendered.md).
355
76
 
356
- `--html` turns the audit into a page: `audits/index.html` as the entry point, plus — from
357
- `report` — a detachable single file that prints to PDF. Self-contained — no script, no
358
- external asset, nothing pointing outside the directory — and it passes this engine's own
359
- accessibility audit, which is the least a tool like this owes. `pages --html` writes the
360
- navigable sheets only: **one composite per artifact**, or every inlined crop travels twice.
77
+ **3. En CI : le bot [`rgaa-audit` d’iterion](https://github.com/SocialGouv/iterion/tree/main/bots/rgaa-audit).**
78
+ Il installe le moteur à une version épinglée, rend l’échantillon de pages, fait arbitrer et
79
+ contre-vérifier les critères par des agents en lecture seule, contrôle le résultat avec `check`
80
+ et ouvre un ticket par critère non conforme. Voir [`references/ci.md`](skills/ultra11y/references/ci.md).
361
81
 
362
- ```sh
363
- node scripts/ultra11y.mjs report --in audit.json --html --evidence --out audits
364
- node scripts/ultra11y.mjs pages --in audit.json --format report --split page \
365
- --evidence --html --out audits/pages
366
- ```
82
+ ## Commandes
367
83
 
368
- `--evidence` illustrates each non-conformity with an **annotated crop of the offending
369
- element**, cut from the page snapshot: `selectorHint` is lossy, and a rendered-tier finding on
370
- a client-rendered page is anchored at `dom.html:2` whatever it is really about. It illustrates
371
- the Markdown conformance report as much as the HTML — one set of files in `assets/`, referenced
372
- by every document that shows the defect — so `--html` is not required to get pictures.
84
+ Le moteur en ligne de commande sert surtout à l’agent et au bot. Ce qu’une personne peut
85
+ lancer elle-même, avec `npx ultra11y <commande>` (tout le reste : `npx ultra11y --help`) :
373
86
 
374
- It needs snapshots, and it says per page and per criterion what it could not draw and why — an
375
- occurrence with no picture must never read as an occurrence with no defect. It distinguishes
376
- an occurrence *folded* into another's picture from a distinct defect a limit *cut off*, because
377
- only the second is a gap.
378
-
379
- The skill (`skills/ultra11y/SKILL.md` + `references/`) teaches the agent when and how to run these, how to complete the manual criteria, and the native-first authoring doctrine.
380
-
381
- ## Development
87
+ | Commande | Rôle |
88
+ |---|---|
89
+ | `audit <chemins> --standard rgaa --out audits --json` | passe le moteur statique sur le code |
90
+ | `scan <url> --merge audits/audit-latest.json` | mesure une page dans un navigateur |
91
+ | `report --in audits/audit-latest.json --standard rgaa --html` | écrit le rapport daté |
92
+ | `pages --in audits/audit-latest.json --format report --split page` | un dossier par page |
93
+ | `check --report <rapport.md>` | contrôle l’intégrité d’un rapport |
94
+ | `tickets --in audits/audit-latest.json --dry-run` | prépare les tickets GitHub, GitLab ou Jira |
95
+ | `criteria --standard rgaa 8.3` | texte officiel d’un critère, ses tests, le glossaire |
96
+ | `install --all` · `status` | branche le hook dans les agents, dit ce qui est actif |
97
+
98
+ ## Pourquoi s’y fier
99
+
100
+ - **Le silence ne vaut pas conformité.** Un critère que personne n’a vérifié reste « à
101
+ évaluer ». Seuls 8.3 et 8.5 (langue et titre de la page) peuvent être déclarés conformes
102
+ sur une mesure complète sans erreur :
103
+ **104 critères sur 106 demandent un arbitrage pour obtenir `C`**.
104
+ - **Le moteur fait le travail mécanique** : 102 vérifications statiques, puis le rendu.
105
+ Sur les 258 tests officiels, une règle tranche
106
+ **30 tests `static` sur 22 critères** et **3 tests `rendered` sur 3 critères** ;
107
+ les **225 tests `judgment` sur 92 critères** passent par l’agent.
108
+ - **Chaque verdict cite sa preuve.** `check` et `verify` rejettent un critère inventé, une
109
+ non-conformité sans élément réel, un « conforme » sur des preuves incomplètes.
110
+ - **Mesuré sur un corpus qu’il n’a pas écrit** (W3C ACT). Chiffres et limites :
111
+ [Couverture](https://socialgouv.github.io/ultra11y/couverture.html),
112
+ [Fiabilité](https://socialgouv.github.io/ultra11y/fiabilite.html). Ce n’est pas une
113
+ certification : avant une déclaration officielle, une personne compétente relit les verdicts.
114
+
115
+ ## Référentiels
116
+
117
+ Le RGAA 4.1.2 est livré avec ultra11y (`--standard rgaa`, ou `{ "standard": "rgaa" }` dans
118
+ `.ultra11yrc.json`) ; il repose sur les WCAG 2.2 AA, le socle interne du moteur. Un autre pays
119
+ s’ajoute par un paquet JSON : [`references/packs.md`](skills/ultra11y/references/packs.md), [`CONTRIBUTING.md`](CONTRIBUTING.md).
120
+
121
+ ## Développement
382
122
 
383
123
  ```sh
384
124
  pnpm install
385
- pnpm test # vitest
386
- pnpm run typecheck
387
- pnpm run build # tsup → scripts/ultra11y.mjs (engine) + dist/ (the e2e plugins)
388
- pnpm run check:build # asserts every committed artefact is reproducible from its source
389
- pnpm run build:wcag # re-derive src/data/wcag.json from the vendored W3C source
390
- pnpm run build:pack:rgaa # re-build the RGAA pack from the vendored DINUM source
391
- pnpm run build:criteria # regenerate skills/ultra11y/references/criteria.md
392
- pnpm run demo # audit → report → check → criteria on tests/fixtures
125
+ pnpm test && pnpm run lint && pnpm run typecheck
126
+ pnpm run build # moteur (scripts/ultra11y.mjs) et bibliothèque (dist/)
127
+ pnpm run check:build # chaque artefact commité se reconstruit à l’identique
128
+ pnpm run build:site # régénère les chiffres du site (site/)
129
+ pnpm run build:pack:rgaa # reconstruit le paquet RGAA depuis la source DINUM
393
130
  ```
394
131
 
395
- Releases are cut automatically by **semantic-release** on push to `main` (GitHub release +
396
- npm publish via OIDC trusted publishing, plus the moving `v5` major tag). The version bump is
397
- decided by **Conventional Commits**: a commit whose subject carries no `feat:`/`fix:` prefix
398
- is analysed as *no release*, so a change that must ship needs at least one conventional commit
399
- in the range — otherwise the major alias and npm keep serving the previous version while `main`
400
- moves on.
132
+ Les versions sont publiées par semantic-release à chaque push sur `main`, selon les
133
+ Conventional Commits : un commit sans préfixe `feat:` ou `fix:` ne déclenche aucune version.
401
134
 
402
- ## Data & licensing
135
+ ## Données et licences
403
136
 
404
- - ultra11y's code: **MIT** (see `LICENSE`).
405
- - The **WCAG 2.2** success-criteria dataset (`src/data/wcag.json`) is derived from the official W3C source ([w3c/wcag](https://github.com/w3c/wcag)); WCAG 2.2 is © **W3C**, reused under the **W3C Document License** (only SC ids/titles/levels are reproduced) — see `NOTICE`.
406
- - The **RGAA pack** (`src/data/standards/rgaa.json`, `rgaa.glossary.json`) is derived from the official **RGAA 4.1.2** reference published by DINUM/DISIC, under the **Licence Ouverte / Etalab 2.0** — see `NOTICE`. Attribution: « RGAA 4.1.2 — DINUM ».
407
- - The report format is inspired by DINUM/etalab-ia audit conventions; the native-first authoring rules are adapted from the SocialGouv accessibility skill. No source code was copied.
137
+ - Code d’ultra11y : **MIT** (voir `LICENSE`).
138
+ - Le **paquet RGAA** (`src/data/standards/rgaa.json`, `rgaa.glossary.json`) dérive du **RGAA 4.1.2**
139
+ publié par la DINUM, sous **Licence Ouverte / Etalab 2.0**. Attribution : « RGAA 4.1.2 — DINUM ».
140
+ - Les critères **WCAG 2.2** (`src/data/wcag.json`) dérivent de la source officielle du W3C
141
+ ([w3c/wcag](https://github.com/w3c/wcag)), © **W3C**, sous **W3C Document License**.
142
+ - Le format du rapport s’inspire des conventions d’audit de la DINUM et d’etalab-ia ; les règles
143
+ d’écriture accessible sont adaptées de la skill SocialGouv. Aucun code source n’a été copié.
144
+ - Détail de chaque source et de chaque dépendance intégrée : `NOTICE`.
@@ -13,13 +13,13 @@ function failingFindings(result, failOn) {
13
13
  if (max === void 0) throw new Error(`ultra11y: failOn must be blocking|major|minor (got "${failOn}")`);
14
14
  return (result.findings ?? []).filter((f) => !f.advisory && (RANK[f.severity] ?? 99) <= max);
15
15
  }
16
- function formatFailure(pageName, failing) {
16
+ function formatFailure(pageName, failing, where = ".ultra11y/pages/") {
17
17
  const lines = [`ultra11y: ${failing.length} accessibility non-conformity(ies) on "${pageName}":`];
18
18
  for (const f of failing.slice(0, 20)) {
19
19
  lines.push(` [${f.severity}] ${f.ruleId} (WCAG ${f.criteriaId}) \u2014 ${f.origin?.sourceFile ?? f.file} \u2014 ${f.message}`);
20
20
  }
21
21
  if (failing.length > 20) lines.push(` \u2026 and ${failing.length - 20} more.`);
22
- lines.push("Full detail: .ultra11y/pages/ \u2014 re-audit offline with `ultra11y audit`.");
22
+ lines.push(`Full detail: ${where} \u2014 re-audit offline with \`ultra11y audit\`.`);
23
23
  return lines.join("\n");
24
24
  }
25
25
 
@@ -33,7 +33,10 @@ function enginePath() {
33
33
  }
34
34
  }
35
35
  function auditSnapshot(payload, engine = enginePath()) {
36
- const res = spawnSync(process.execPath, [engine, "snapshot", "write", "--json"], {
36
+ return pipeToEngine(["snapshot", "write", "--json"], payload, engine);
37
+ }
38
+ function pipeToEngine(args, payload, engine) {
39
+ const res = spawnSync(process.execPath, [engine, ...args], {
37
40
  input: JSON.stringify(payload),
38
41
  encoding: "utf8",
39
42
  maxBuffer: 192 * 1024 * 1024