ultra11y 5.54.4 → 5.55.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 (38) 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 +14 -4
  6. package/package.json +1 -1
  7. package/scripts/build-pack-rgaa.mjs +19 -2
  8. package/scripts/build-standards.mjs +5 -3
  9. package/scripts/ultra11y.mjs +2079 -504
  10. package/skills/review-a11y/SKILL.md +1 -1
  11. package/skills/review-a11y/scripts/ultra11y.mjs +2079 -504
  12. package/skills/ultra11y/SKILL.md +3 -3
  13. package/skills/ultra11y/references/audit.md +28 -0
  14. package/skills/ultra11y/references/criteria.md +4 -4
  15. package/skills/ultra11y/references/dynamic.md +16 -0
  16. package/skills/ultra11y/references/rgaa-automation.md +2 -2
  17. package/skills/ultra11y/references/rgaa-review.md +2 -1
  18. package/skills/ultra11y/scripts/ultra11y.mjs +2079 -504
  19. package/skills/ultra11y/templates/gitlab-ci.yml +1 -1
  20. package/src/adjudicate-subjects.ts +49 -12
  21. package/src/adjudicate.ts +9 -1
  22. package/src/audit.ts +86 -0
  23. package/src/cli.ts +51 -3
  24. package/src/data/standards/rgaa.json +33 -2
  25. package/src/data/wcag.json +7 -4
  26. package/src/documents.ts +256 -0
  27. package/src/glob.ts +35 -2
  28. package/src/messages.ts +76 -0
  29. package/src/pages.ts +2 -0
  30. package/src/parse/html.ts +9 -2
  31. package/src/parse/pdf.ts +1217 -0
  32. package/src/report.ts +57 -0
  33. package/src/rules/pdf.ts +130 -0
  34. package/src/rules/registry.ts +5 -0
  35. package/src/rules/rule.ts +3 -0
  36. package/src/scan.ts +25 -0
  37. package/src/standards/derive.ts +7 -1
  38. package/src/types.ts +49 -1
@@ -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": "5.54.4",
13
+ "version": "5.55.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": "5.54.4",
4
+ "version": "5.55.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": "5.54.4",
4
+ "version": "5.55.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",
@@ -27,7 +27,7 @@ import { fileURLToPath } from "node:url";
27
27
  // Ownership marker: `ultra11y install --opencode` refuses to overwrite a plugin file that
28
28
  // does not carry it, so a user's own ultra11y.js is never clobbered.
29
29
  const ULTRA11Y_OPENCODE_PLUGIN = "ULTRA11Y_OPENCODE_PLUGIN";
30
- const ULTRA11Y_PLUGIN_VERSION = "5.54.4";
30
+ const ULTRA11Y_PLUGIN_VERSION = "5.55.0";
31
31
 
32
32
  const here = dirname(fileURLToPath(import.meta.url));
33
33
 
package/README.md CHANGED
@@ -27,7 +27,7 @@ Full details, thresholds and off-switches under [Install](#install).</sub>
27
27
 
28
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
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 — 97 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:
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:
31
31
 
32
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
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".
@@ -320,7 +320,7 @@ a test). See [`CONTRIBUTING.md`](CONTRIBUTING.md) and `skills/ultra11y/reference
320
320
 
321
321
  ### What RGAA automation actually covers
322
322
 
323
- The engine's 97 rules are not 97 RGAA criteria: several rules can evidence the same official
323
+ The engine's 102 rules are not 102 RGAA criteria: several rules can evidence the same official
324
324
  test, and a rule can detect a useful symptom without exhausting the criterion's alternatives,
325
325
  exceptions or relevance checks. The generated contract classifies all **258 official RGAA
326
326
  tests**:
@@ -331,8 +331,8 @@ tests**:
331
331
  - **3 `rendered` tests across 3 criteria:** `1.1`, `8.1`, `10.7`.
332
332
  - Those two tiers cover **24 distinct criteria that can produce a deterministic `NC`**;
333
333
  `1.1` belongs to both.
334
- - **53 criteria receive a normative engine signal:** 24 have at least one decisive rule and
335
- 42 receive candidate evidence, with overlap. One additional criterion receives only an
334
+ - **54 criteria receive a normative engine signal:** 24 have at least one decisive rule and
335
+ 43 receive candidate evidence, with overlap. One additional criterion receives only an
336
336
  advisory signal. A candidate is forwarded to adjudication and never changes a verdict by
337
337
  itself.
338
338
  - Only **8.3 and 8.5** may earn `C` from a complete silent measurement. For the other
@@ -358,6 +358,16 @@ promoted only when a narrower rule demonstrably exhausts its cited official test
358
358
  The generated [106-criterion / 258-test matrix](skills/ultra11y/references/rgaa-automation.md)
359
359
  is the source of truth; CI rebuilds it from the vendored DINUM data and rejects drift.
360
360
 
361
+ **Downloadable PDF documents (RGAA 13.3).** The engine reads PDFs with its own zero-dependency
362
+ reader (Node `zlib` only): `audit report.pdf` / `audit "public/**/*.pdf"`, and `scan` downloads
363
+ the same-origin PDFs each captured page links to (bounded, `--no-pdf` to opt out) into
364
+ `.ultra11y/documents/`. Five document checks — `pdf-untagged`, `pdf-lang-missing`,
365
+ `pdf-title-missing` (title + `DisplayDocTitle`), `pdf-no-text` (image-only scan) and the advisory
366
+ `pdf-structure-shallow` — are listed per document in the report and reach RGAA 13.3 as
367
+ **candidate** evidence: an accessible alternative version may exist, so they never decide a
368
+ verdict, and passing them is never PDF/UA conformance (veraPDF/PAC establish that). An encrypted
369
+ or malformed file is reported unreadable. See `skills/ultra11y/references/audit.md`.
370
+
361
371
  ### Scale, fixes, and repo automation
362
372
 
363
373
  - **Scale** — the engine streams file-by-file (bounded memory), audits **only markup**,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultra11y",
3
- "version": "5.54.4",
3
+ "version": "5.55.0",
4
4
  "description": "Audit d'accessibilité RGAA 4.1.2, le référentiel de l'État : rapport daté, grille des 106 critères, backlog et tickets. Moteur statique, navigateur et jugement IA contre-vérifié. Il ne déclare jamais conforme ce qu'il n'a pas vérifié. Socle WCAG 2.2 AA.",
5
5
  "homepage": "https://socialgouv.github.io/ultra11y/",
6
6
  "type": "module",
@@ -154,8 +154,17 @@ const RULE_SC = {
154
154
  "field-label-in-name-mismatch": ["2.5.3"],
155
155
  "invalid-aria-attr": ["4.1.2"], "invalid-aria-value": ["4.1.2"], "aria-required-attr": ["4.1.2"], "aria-prohibited-attr": ["4.1.2"],
156
156
  "dl-structure": ["1.3.1"], "on-input-context-change": ["3.2.2"],
157
+ // Document rules (src/rules/pdf.ts) — the SC each one evidences in WCAG terms.
158
+ "pdf-untagged": ["1.3.1"], "pdf-lang-missing": ["3.1.1"], "pdf-title-missing": ["2.4.2"], "pdf-no-text": ["1.1.1"],
159
+ "pdf-structure-shallow": ["1.3.1"],
157
160
  };
158
161
 
162
+ // DOCUMENT RULES are routed by rule id, not by success criterion (src/standards/derive.ts): a
163
+ // downloadable document is not the page, and RGAA files every failure of one under 13.3 — whose
164
+ // crosswalk does not include 2.4.2, the SC a PDF's missing title evidences. So the shared-SC
165
+ // self-check below does not apply to them; their single home is stated in RULE_TO_CRITERIA.
166
+ const DOCUMENT_RULES = new Set(["pdf-untagged", "pdf-lang-missing", "pdf-title-missing", "pdf-no-text", "pdf-structure-shallow"]);
167
+
159
168
  // ---- Judgment criteria: RGAA wordings that ask MORE than their WCAG mapping ----
160
169
  // A criterion derives its status from the WCAG SCs DINUM's own crosswalk cites, and the
161
170
  // projection returns `C` as soon as one mapped SC is `C`. That is right when the RGAA
@@ -184,7 +193,7 @@ const JUDGMENT_CRITERIA = {
184
193
  // that fails them is the one drawn with no list markup at all. An absence of <ul> is not an
185
194
  // absence of lists, so a clean or empty pass must never close 9.3 on its own.
186
195
  "9.3": "« les informations regroupées visuellement sous forme de liste » — un regroupement visuel se constate à la lecture ; l’absence de <ul>/<ol>/<dl> ne prouve pas l’absence de liste.",
187
- "13.3": "« version accessible du document en téléchargement » — aucune règle moteur ne peut ouvrir le document ; les CS mappés ne portent que sur la page.",
196
+ "13.3": "« version accessible du document en téléchargement » — les règles pdf-* lisent un PDF téléchargé (balisage, langue, titre, texte extractible, structure) et n'en relèvent que les défauts grossiers ; elles ne voient ni la conformité PDF/UA ni l'existence d'une version alternative accessible, que la condition « si nécessaire » admet.",
188
197
  "13.4": "« cette version offre-t-elle la même information ? » — comparaison de deux documents, hors de portée d’un audit de la page.",
189
198
  };
190
199
 
@@ -324,6 +333,10 @@ const RULE_TO_CRITERIA = {
324
333
  // Theme 13 — consultation (13.1 time limits, 13.8 moving/blinking)
325
334
  "meta-refresh-redirect": ["13.1"], "blink-marquee": ["13.8"], "autoplay-media": ["4.10"],
326
335
  "axe:no-autoplay-audio": ["4.10"], "axe:blink": ["13.8"], "axe:marquee": ["13.8"],
336
+ // 13.3 — the downloadable documents themselves (src/rules/pdf.ts). CANDIDATE evidence only:
337
+ // the criterion is met by an accessible alternative version too, which no document check sees.
338
+ "pdf-untagged": ["13.3"], "pdf-lang-missing": ["13.3"], "pdf-title-missing": ["13.3"], "pdf-no-text": ["13.3"],
339
+ "pdf-structure-shallow": ["13.3"],
327
340
  };
328
341
 
329
342
  // A rule firing is NOT automatically a complete RGAA failure. Most engine rules are useful
@@ -454,6 +467,10 @@ const CANDIDATE_RULE_TESTS = {
454
467
  "13.1|meta-refresh-redirect": ["2"],
455
468
  "13.8|axe:blink": ["2"],
456
469
  "13.8|axe:marquee": ["1"],
470
+ "13.3|pdf-untagged": ["1"],
471
+ "13.3|pdf-lang-missing": ["1"],
472
+ "13.3|pdf-title-missing": ["1"],
473
+ "13.3|pdf-no-text": ["1"],
457
474
  };
458
475
 
459
476
  // WHICH CRITERIA MAY BE CONCLUDED FROM A CLEAN ENGINE PASS — the shortest list in this file,
@@ -537,7 +554,7 @@ async function main() {
537
554
  const scs = RULE_SC[ruleId]; // undefined for axe:/dyn- (namespaced, not statically validated)
538
555
  for (const cid of critIds) {
539
556
  if (!wcagById.has(cid)) throw new Error(`RULE_TO_CRITERIA: rule "${ruleId}" → unknown RGAA criterion "${cid}"`);
540
- if (scs && !scs.some((sc) => wcagById.get(cid).has(sc))) {
557
+ if (scs && !DOCUMENT_RULES.has(ruleId) && !scs.some((sc) => wcagById.get(cid).has(sc))) {
541
558
  throw new Error(`RULE_TO_CRITERIA: "${ruleId}" (SC ${scs.join(",")}) under RGAA ${cid} (WCAG ${[...wcagById.get(cid)].join(",")}) — no shared SC, entry is inert`);
542
559
  }
543
560
  (critRules[cid] ||= new Set()).add(ruleId);
@@ -639,7 +639,7 @@ const NEEDS_RENDERING = new Set([
639
639
  // icon-only-control-unnamed) appear under BOTH their SCs so registry's bidirectional
640
640
  // rule↔dataset cross-check holds.
641
641
  const RULE_SC_COVERAGE = {
642
- "1.1.1": ["img-alt-missing", "canvas-fallback-missing", "decorative-alt-misuse", "decorative-marked-exposed", "input-image-alt-missing", "object-embed-no-name", "chart-no-accessible-name", "figure-caption-unassociated"],
642
+ "1.1.1": ["img-alt-missing", "canvas-fallback-missing", "decorative-alt-misuse", "decorative-marked-exposed", "input-image-alt-missing", "object-embed-no-name", "chart-no-accessible-name", "figure-caption-unassociated", "pdf-no-text"],
643
643
  "1.2.2": ["media-no-track"],
644
644
  "1.3.1": [
645
645
  "fieldset-legend-missing", "data-table-no-headers", "table-caption-missing",
@@ -649,6 +649,8 @@ const RULE_SC_COVERAGE = {
649
649
  "headers-attr-dangling", "th-no-data-cells", "table-scope-invalid",
650
650
  "radio-checkbox-group-ungrouped", "table-empty-data-cell", "css-generated-content-informative",
651
651
  "presentational-element", "presentational-attribute", "presentational-spacing",
652
+ // Document rules (src/rules/pdf.ts): read on a downloadable PDF, kept out of the page verdict.
653
+ "pdf-untagged", "pdf-structure-shallow",
652
654
  ],
653
655
  "1.3.5": ["field-purpose-incomplete", "autocomplete-token-invalid"],
654
656
  "1.4.2": ["autoplay-media"],
@@ -662,14 +664,14 @@ const RULE_SC_COVERAGE = {
662
664
  "2.2.1": ["meta-refresh-redirect"],
663
665
  "2.2.2": ["autoplay-media", "blink-marquee"],
664
666
  "2.4.1": ["skip-link-target-missing", "bypass-blocks-missing"],
665
- "2.4.2": ["title-missing-empty"],
667
+ "2.4.2": ["title-missing-empty", "pdf-title-missing"],
666
668
  "2.4.3": ["positive-tabindex"],
667
669
  "2.4.7": ["rendered-focus-not-visible"],
668
670
  "2.4.4": ["link-empty-name", "icon-only-control-unnamed"],
669
671
  "2.5.3": ["label-in-name-mismatch", "form-label-in-name-mismatch", "link-label-in-name-mismatch", "field-label-in-name-mismatch"],
670
672
  "3.2.2": ["on-input-context-change"],
671
673
  "3.3.8": ["credential-entry-blocked"],
672
- "3.1.1": ["html-lang-missing", "document-language-missing", "html-lang-xml-lang-mismatch", "lang-invalid"],
674
+ "3.1.1": ["html-lang-missing", "document-language-missing", "html-lang-xml-lang-mismatch", "lang-invalid", "pdf-lang-missing"],
673
675
  "3.1.2": ["inline-lang-change-missing", "lang-invalid"],
674
676
  "3.3.1": ["aria-invalid-no-description", "error-not-associated"],
675
677
  "3.3.2": ["radio-checkbox-group-ungrouped", "date-fields-ungrouped"],