ultra11y 5.58.2 → 5.58.3

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.
@@ -6,7 +6,7 @@ import { join as join57, relative as relative8, resolve as resolve20, sep as sep
6
6
  import { fileURLToPath as fileURLToPath6, pathToFileURL as pathToFileURL3 } from "url";
7
7
 
8
8
  // src/types.ts
9
- var VERSION = "5.58.2";
9
+ var VERSION = "5.58.3";
10
10
  var SCHEMA_VERSION = 2;
11
11
  function isAdjudicated(by) {
12
12
  return by === "agent" || by === "human";
@@ -39066,8 +39066,8 @@ var MSG_CATALOG = {
39066
39066
  en: (p) => `Untagged PDF document (PDF ${p.version}) \u2014 ${p.marked === "yes" ? "/MarkInfo declares it marked" : "no /MarkInfo << /Marked true >>"}, ${p.structTree === "yes" ? "a structure tree exists" : "no structure tree (/StructTreeRoot)"}: assistive technology reads a flat stream of text with no headings, lists or tables.`
39067
39067
  },
39068
39068
  remediation: {
39069
- fr: () => `Produisez un PDF balis\xE9 (PDF/UA-1) depuis l'outil source, ou proposez une version alternative accessible (HTML ou document balis\xE9) ; v\xE9rifiez le r\xE9sultat avec veraPDF ou PAC.`,
39070
- en: () => `Produce a tagged PDF (PDF/UA-1) from the source tool, or offer an accessible alternative version (HTML or a tagged document); check the result with veraPDF or PAC.`
39069
+ fr: () => `Produisez un PDF balis\xE9 (PDF/UA-1) depuis l'outil source, ou proposez une version alternative accessible (HTML ou document balis\xE9) ; v\xE9rifiez le r\xE9sultat avec veraPDF ou PAC. En JavaScript, utilisez PDFKit (https://github.com/foliojs/pdfkit) : options \`subset: 'PDF/UA'\`, \`tagged: true\`, \`displayTitle: true\`, \`lang\`, un titre dans \`info\`, des polices TrueType ou OpenType incorpor\xE9es, et tout le contenu balis\xE9 ou marqu\xE9 comme artefact. PDFKit ne balise ni les annotations (dont les liens) ni les formulaires : pour ces contenus, pr\xE9voyez une version alternative accessible.`,
39070
+ en: () => `Produce a tagged PDF (PDF/UA-1) from the source tool, or offer an accessible alternative version (HTML or a tagged document); check the result with veraPDF or PAC. In JavaScript, use PDFKit (https://github.com/foliojs/pdfkit): options \`subset: 'PDF/UA'\`, \`tagged: true\`, \`displayTitle: true\`, \`lang\`, a title in \`info\`, embedded TrueType or OpenType fonts, and all content tagged or marked as an artifact. PDFKit does not tag annotations (links included) or forms: for those, provide an accessible alternative version.`
39071
39071
  }
39072
39072
  },
39073
39073
  "pdf-lang-missing": {
@@ -62905,11 +62905,19 @@ function commonOrigin(pages) {
62905
62905
  function pageOriginNote(origin, lang) {
62906
62906
  return origin ? L[lang].originNote(origin) : void 0;
62907
62907
  }
62908
+ var NOTHING_ON_THIS_PAGE = "Nothing of this criterion's kind is present on this page.";
62908
62909
  function adjudicationOnPage(result, adjudication, page) {
62909
62910
  const stamped = new Set(page.findings.map(findingId));
62910
62911
  const sources = result.scope.pages?.find((p) => p.id === page.id)?.sources ?? [];
62911
62912
  const onPage = (f) => stamped.has(findingId(f)) || sources.some((s) => pathMatch2(f.origin?.sourceFile ?? f.file, s));
62913
+ const seen = result.scope.pageSubjects?.[page.id];
62914
+ const absentHere = (id) => {
62915
+ if (!seen) return false;
62916
+ const wcag = getCriterion(loadPack(adjudication.standard), id)?.wcag ?? [];
62917
+ return subjectsAbsent(subjectsForPackCriterion(adjudication.standard, id, wcag), new Set(seen));
62918
+ };
62912
62919
  const criteria = adjudication.criteria.flatMap((c2) => {
62920
+ if (c2.status === "C" && absentHere(c2.id)) return [{ ...c2, status: "NA", justification: NOTHING_ON_THIS_PAGE }];
62913
62921
  if (c2.status !== "NC") return [c2];
62914
62922
  const findings = c2.findings.filter(onPage);
62915
62923
  return findings.some((f) => !f.advisory) ? [{ ...c2, findings }] : [];
@@ -62933,6 +62941,7 @@ function pageView(result, page) {
62933
62941
  function pageGridModel(result, derived, standard, lang) {
62934
62942
  const status = /* @__PURE__ */ new Map();
62935
62943
  const human = /* @__PURE__ */ new Set();
62944
+ const inapplicable = /* @__PURE__ */ new Set();
62936
62945
  const put = (rowId, pageId, s) => {
62937
62946
  const m = status.get(rowId) ?? /* @__PURE__ */ new Map();
62938
62947
  m.set(pageId, s);
@@ -62945,18 +62954,20 @@ function pageGridModel(result, derived, standard, lang) {
62945
62954
  put(c2.id, p.id, c2.status);
62946
62955
  if (c2.decidedBy === "human") human.add(`${c2.id}|${p.id}`);
62947
62956
  }
62948
- return { rows: rows2, status, human };
62957
+ return { rows: rows2, status, human, inapplicable };
62949
62958
  }
62950
62959
  const pack = loadPack(standard);
62951
62960
  const rows = pack.criteria.map((pc) => ({ id: pc.id, label: pc.id, group: `${pc.theme}. ${themeName(pack, pc.theme, lang) ?? ""}`.trim() }));
62952
62961
  for (const p of derived) {
62953
62962
  for (const pc of derivePackResults(pageView(result, p), standard, p.id)) {
62954
62963
  const criterion = pack.criteria.find((row) => row.id === pc.id);
62955
- put(pc.id, p.id, isProvisionalJudgmentInapplicable(pc, criterion) ? "manual" : pc.status);
62964
+ const provisional = isProvisionalJudgmentInapplicable(pc, criterion);
62965
+ put(pc.id, p.id, provisional ? "manual" : pc.status);
62956
62966
  if (pc.decidedBy === "human") human.add(`${pc.id}|${p.id}`);
62967
+ if (pc.inapplicable && !provisional) inapplicable.add(`${pc.id}|${p.id}`);
62957
62968
  }
62958
62969
  }
62959
- return { rows, status, human };
62970
+ return { rows, status, human, inapplicable };
62960
62971
  }
62961
62972
  function renderRedirected(redirected, lang = "en") {
62962
62973
  const fr = lang === "fr";
@@ -62972,16 +62983,24 @@ function renderRedirected(redirected, lang = "en") {
62972
62983
  }
62973
62984
  return out2;
62974
62985
  }
62975
- function gridRate(rows, status, pageId) {
62986
+ function gridRate(rows, status, pageId, inapplicable) {
62976
62987
  let c2 = 0;
62977
62988
  let nc = 0;
62989
+ let open = 0;
62990
+ let absent = 0;
62978
62991
  for (const row of rows) {
62979
62992
  const st = status.get(row.id)?.get(pageId);
62980
- if (st === "C") c2++;
62981
- else if (st === "NC") nc++;
62993
+ if (st === "C") {
62994
+ c2++;
62995
+ if (inapplicable?.has(`${row.id}|${pageId}`)) absent++;
62996
+ } else if (st === "NC") nc++;
62997
+ else if (st === "manual") open++;
62982
62998
  }
62983
62999
  const decided = c2 + nc;
62984
- return [decided === 0 ? null : Math.round(c2 / decided * 100), decided, rows.length];
63000
+ if (!inapplicable) return [decided === 0 ? null : Math.round(c2 / decided * 100), decided, rows.length];
63001
+ const validated = c2 - absent;
63002
+ const applicable = validated + nc + open;
63003
+ return [validated + nc === 0 ? null : Math.round(validated / applicable * 100), validated, applicable];
62985
63004
  }
62986
63005
  function renderPageGrid(result, pages, standard = CORE2, lang = "en") {
62987
63006
  const s = L[lang];
@@ -63000,8 +63019,10 @@ function renderPageGrid(result, pages, standard = CORE2, lang = "en") {
63000
63019
  if (originNote) out2.push(`> ${originNote}`, "");
63001
63020
  const head = [s.criterion, ...derived.map((p) => pageColumnLabel(p, origin))];
63002
63021
  out2.push(`| ${head.join(" | ")} |`, `| ${head.map(() => "---").join(" | ")} |`);
63003
- const { rows, status, human } = pageGridModel(result, derived, standard, lang);
63004
- out2.push(`| **${s.rate}** | ${derived.map((p) => `**${formatRate(...gridRate(rows, status, p.id))}**`).join(" | ")} |`);
63022
+ const { rows, status, human, inapplicable } = pageGridModel(result, derived, standard, lang);
63023
+ out2.push(
63024
+ `| **${s.rate}** | ${derived.map((p) => `**${formatRate(...gridRate(rows, status, p.id, isCore(standard) ? void 0 : inapplicable))}**`).join(" | ")} |`
63025
+ );
63005
63026
  out2.push(`| _${s.snapshot}?_ | ${derived.map((p) => `_${basisLabel(p.basis, lang)}_`).join(" | ")} |`);
63006
63027
  let group = "";
63007
63028
  let humanRuled = false;
@@ -63764,13 +63785,17 @@ var L4 = {
63764
63785
  producer: "Producteur",
63765
63786
  auth: "Authentification requise",
63766
63787
  rate: "Taux de r\xE9ussite automatique (v\xE9rifications statiques)",
63788
+ packRate: "Taux de conformit\xE9 de la page",
63767
63789
  // The index has its own, shorter header — the sheet's label is a full sentence and would
63768
63790
  // wreck an eight-column table. Kept as a SEPARATE key: editing `rate` in place would
63769
63791
  // silently reword the sheet bullet too.
63770
63792
  rateShort: "Taux (crit\xE8res d\xE9cid\xE9s)",
63793
+ packRateShort: "Taux (valid\xE9s \xF7 applicables)",
63771
63794
  rateNote: "sous-ensemble d\xE9cidable : C \xF7 (C + NC)",
63795
+ packRateNote: "crit\xE8res valid\xE9s \xF7 crit\xE8res applicables, ceux \xE0 \xE9valuer comptant au d\xE9nominateur",
63772
63796
  tally: (c2, nc, na, m) => `${c2} conforme(s) \xB7 ${nc} non conforme(s) \xB7 ${na} non applicable(s) \xB7 ${m} \xE0 \xE9valuer`,
63773
63797
  coverage: (decided, total) => `Couverture : ${decided}/${total} crit\xE8re(s) \xE9valu\xE9(s) \u2014 le taux ci-dessus ne porte que sur eux, et ne dit rien des ${total - decided} autres.`,
63798
+ packCoverage: (decided, total) => `Couverture : ${decided}/${total} crit\xE8re(s) \xE9valu\xE9(s). Tant qu'il en reste ${total - decided} \xE0 \xE9valuer, le taux ci-dessus est un plancher.`,
63774
63799
  tests: "Tests",
63775
63800
  screenshotAlt: (n) => `Capture d'\xE9cran de la page ${n}`,
63776
63801
  noScreenshot: "Aucune capture d'\xE9cran pour cette page (le producteur n'en a pas fourni) \u2014 le tier pixel est donc inactif ici.",
@@ -63789,7 +63814,8 @@ var L4 = {
63789
63814
  blocking: "Bloquant",
63790
63815
  major: "Majeur",
63791
63816
  minor: "Mineur",
63792
- indexNote: "Une fiche par page. `X % (d/t)` : le taux ne porte que sur les `d` crit\xE8res d\xE9cid\xE9s sur `t` \u2014 il ne dit rien des autres. `\u2014` signifie qu'aucun crit\xE8re n'a \xE9t\xE9 d\xE9cid\xE9 sur cette page, et ne vaut donc NI conformit\xE9 NI non-conformit\xE9."
63817
+ indexNote: "Une fiche par page. `X % (d/t)` : le taux ne porte que sur les `d` crit\xE8res d\xE9cid\xE9s sur `t` \u2014 il ne dit rien des autres. `\u2014` signifie qu'aucun crit\xE8re n'a \xE9t\xE9 d\xE9cid\xE9 sur cette page, et ne vaut donc NI conformit\xE9 NI non-conformit\xE9.",
63818
+ packIndexNote: "Une fiche par page. `X % (v/a)` : crit\xE8res valid\xE9s \xF7 crit\xE8res applicables, la formule du taux global. Un crit\xE8re sans sujet sur la page sort du calcul ; un crit\xE8re \xE0 \xE9valuer reste au d\xE9nominateur, le taux est donc un plancher. `\u2014` signifie qu'aucun crit\xE8re n'a \xE9t\xE9 d\xE9cid\xE9 sur cette page, et ne vaut donc NI conformit\xE9 NI non-conformit\xE9."
63793
63819
  },
63794
63820
  en: {
63795
63821
  docTitle: "Page-by-page accessibility report",
@@ -63807,10 +63833,14 @@ var L4 = {
63807
63833
  producer: "Producer",
63808
63834
  auth: "Authentication required",
63809
63835
  rate: "Automatic static-check pass rate",
63836
+ packRate: "Page conformance rate",
63810
63837
  rateShort: "Rate (decided criteria)",
63838
+ packRateShort: "Rate (validated \xF7 applicable)",
63811
63839
  rateNote: "decidable subset: C \xF7 (C + NC)",
63840
+ packRateNote: "validated criteria \xF7 applicable criteria, those still to assess counting in the denominator",
63812
63841
  tally: (c2, nc, na, m) => `${c2} conforming \xB7 ${nc} non-conforming \xB7 ${na} not applicable \xB7 ${m} to assess`,
63813
63842
  coverage: (decided, total) => `Coverage: ${decided}/${total} criteria assessed \u2014 the rate above covers only those, and says nothing about the other ${total - decided}.`,
63843
+ packCoverage: (decided, total) => `Coverage: ${decided}/${total} criteria assessed. While ${total - decided} remain to assess, the rate above is a floor.`,
63814
63844
  tests: "Tests",
63815
63845
  screenshotAlt: (n) => `Screenshot of the ${n} page`,
63816
63846
  noScreenshot: "No screenshot for this page (the producer supplied none) \u2014 the pixel tier is therefore inactive here.",
@@ -63829,7 +63859,8 @@ var L4 = {
63829
63859
  blocking: "Blocking",
63830
63860
  major: "Major",
63831
63861
  minor: "Minor",
63832
- indexNote: "One sheet per page. `X % (d/t)`: the rate covers only the `d` criteria decided out of `t` \u2014 it says nothing about the others. `\u2014` means no criterion was decided on this page, so it is NEITHER conformity NOR non-conformity."
63862
+ indexNote: "One sheet per page. `X % (d/t)`: the rate covers only the `d` criteria decided out of `t` \u2014 it says nothing about the others. `\u2014` means no criterion was decided on this page, so it is NEITHER conformity NOR non-conformity.",
63863
+ packIndexNote: "One sheet per page. `X % (v/a)`: validated criteria \xF7 applicable criteria, the formula of the overall rate. A criterion with no subject on the page leaves the calculation; one still to assess stays in the denominator, so the rate is a floor. `\u2014` means no criterion was decided on this page, so it is NEITHER conformity NOR non-conformity."
63833
63864
  }
63834
63865
  };
63835
63866
  function pageCriterionRows(result, page, standard, lang) {
@@ -63874,7 +63905,7 @@ function pagesForStandard(result, pages, standard, lang) {
63874
63905
  findings: [],
63875
63906
  ...r.decidedBy ? { decidedBy: r.decidedBy } : {}
63876
63907
  })),
63877
- conformancePct: pageRatePct(rows),
63908
+ conformancePct: pageRatePct(rows, standard),
63878
63909
  decided: cov.decided,
63879
63910
  total: cov.total
63880
63911
  };
@@ -63898,9 +63929,36 @@ function pageCoverage(rows) {
63898
63929
  const t3 = pageTally(rows);
63899
63930
  return { decided: t3.c + t3.nc, total: rows.length };
63900
63931
  }
63901
- function pageRatePct(rows) {
63902
- const { c: c2, nc } = pageTally(rows);
63903
- return c2 + nc === 0 ? null : Math.round(c2 / (c2 + nc) * 100);
63932
+ function conformanceRate(t3) {
63933
+ const validated = Math.max(0, t3.c - t3.na);
63934
+ const applicable = validated + t3.nc + t3.manual;
63935
+ return {
63936
+ // No applicable criterion is not a failure — it is a scope with nothing of any kind in it,
63937
+ // and the repository's convention for an empty denominator is 100 (src/audit.ts
63938
+ // conformancePct). Divergent conventions on the same question is how two numbers describing
63939
+ // one grid start disagreeing.
63940
+ pct: applicable === 0 ? 100 : Math.round(validated / applicable * 100),
63941
+ validated,
63942
+ applicable,
63943
+ na: t3.na,
63944
+ open: t3.manual,
63945
+ decided: t3.c + t3.nc,
63946
+ total: t3.c + t3.nc + t3.manual
63947
+ };
63948
+ }
63949
+ function pageRatePct(rows, standard) {
63950
+ const t3 = pageTally(rows);
63951
+ if (isCore(standard)) return t3.c + t3.nc === 0 ? null : Math.round(t3.c / (t3.c + t3.nc) * 100);
63952
+ const rate = conformanceRate(t3);
63953
+ return rate.validated + t3.nc === 0 ? null : rate.pct;
63954
+ }
63955
+ function formatPageRate(rows, standard) {
63956
+ if (isCore(standard)) {
63957
+ const cov = pageCoverage(rows);
63958
+ return formatRate(pageRatePct(rows, standard), cov.decided, cov.total);
63959
+ }
63960
+ const rate = conformanceRate(pageTally(rows));
63961
+ return formatRate(pageRatePct(rows, standard), rate.validated, rate.applicable);
63904
63962
  }
63905
63963
  function renderPageReport(result, page, opts = {}) {
63906
63964
  const standard = opts.standard ?? CORE2;
@@ -63917,10 +63975,13 @@ function renderPageReport(result, page, opts = {}) {
63917
63975
  const rows = pageCriterionRows(result, page, standard, lang);
63918
63976
  const t3 = pageTally(rows);
63919
63977
  const cov = pageCoverage(rows);
63920
- const rate = pageRatePct(rows);
63921
- out2.push(`- **${s.rate}** : **${rate === null ? "\u2014" : `${rate} %`}** _(${s.rateNote})_`);
63978
+ const pack = !isCore(standard);
63979
+ const rate = pageRatePct(rows, standard);
63980
+ out2.push(
63981
+ pack ? `- **${s.packRate}** : **${formatPageRate(rows, standard)}** _(${s.packRateNote})_` : `- **${s.rate}** : **${rate === null ? "\u2014" : `${rate} %`}** _(${s.rateNote})_`
63982
+ );
63922
63983
  out2.push(`- ${pageTallyNote(t3, lang)}`);
63923
- out2.push(`- ${s.coverage(cov.decided, cov.total)}`, "");
63984
+ out2.push(`- ${(pack ? s.packCoverage : s.coverage)(cov.decided, cov.total)}`, "");
63924
63985
  if (page.basis !== "snapshot") out2.push(`> \u26A0\uFE0F ${page.basis === "loading" ? pageBasisWarning("loading", lang) : s.sourceWarn}`, "");
63925
63986
  const shot = opts.screenshots?.get(page.id);
63926
63987
  if (shot) out2.push(`![${s.screenshotAlt(page.name)}](${shot})`, "");
@@ -63975,16 +64036,16 @@ function renderPagesIndex(result, pages, opts = {}) {
63975
64036
  const lang = opts.lang ?? "en";
63976
64037
  const s = L4[lang];
63977
64038
  const out2 = header2(result, pages, standard, lang, s.indexTitle);
63978
- out2.push(`> ${s.indexNote}`, "");
63979
- out2.push(`| ${s.page} | ${s.url} | ${s.basis} | ${s.rateShort} | ${s.blocking} | ${s.major} | ${s.minor} | ${s.sheet} |`);
64039
+ const pack = !isCore(standard);
64040
+ out2.push(`> ${pack ? s.packIndexNote : s.indexNote}`, "");
64041
+ out2.push(`| ${s.page} | ${s.url} | ${s.basis} | ${pack ? s.packRateShort : s.rateShort} | ${s.blocking} | ${s.major} | ${s.minor} | ${s.sheet} |`);
63980
64042
  out2.push("| --- | --- | --- | --- | --- | --- | --- | --- |");
63981
64043
  for (const p of pages) {
63982
64044
  const rows = pageCriterionRows(result, p, standard, lang);
63983
- const cov = pageCoverage(rows);
63984
64045
  const nc = [...p.findings, ...(result.packFindings ?? []).filter((f) => f.page === p.id)].filter((f) => !f.advisory);
63985
64046
  const href = opts.hrefs?.get(p.id);
63986
64047
  out2.push(
63987
- `| ${p.name}${p.auth ? " \u{1F512}" : ""} | \`${p.url}\` | ${basisLabel(p.basis, lang)} | ${formatRate(pageRatePct(rows), cov.decided, cov.total)} | ${nc.filter((f) => f.severity === "bloquant").length} | ${nc.filter((f) => f.severity === "majeur").length} | ${nc.filter((f) => f.severity === "mineur").length} | ${href ? `[${p.id}](${href})` : p.id} |`
64048
+ `| ${p.name}${p.auth ? " \u{1F512}" : ""} | \`${p.url}\` | ${basisLabel(p.basis, lang)} | ${formatPageRate(rows, standard)} | ${nc.filter((f) => f.severity === "bloquant").length} | ${nc.filter((f) => f.severity === "majeur").length} | ${nc.filter((f) => f.severity === "mineur").length} | ${href ? `[${p.id}](${href})` : p.id} |`
63988
64049
  );
63989
64050
  }
63990
64051
  out2.push("");
@@ -64501,23 +64562,6 @@ function reportCoverage(groups) {
64501
64562
  const t3 = reportTotals(groups);
64502
64563
  return { decided: t3.c + t3.nc, total: t3.c + t3.nc + t3.manual };
64503
64564
  }
64504
- function conformanceRate(t3) {
64505
- const validated = Math.max(0, t3.c - t3.na);
64506
- const applicable = validated + t3.nc + t3.manual;
64507
- return {
64508
- // No applicable criterion is not a failure — it is a scope with nothing of any kind in it,
64509
- // and the repository's convention for an empty denominator is 100 (src/audit.ts
64510
- // conformancePct). Divergent conventions on the same question is how two numbers describing
64511
- // one grid start disagreeing.
64512
- pct: applicable === 0 ? 100 : Math.round(validated / applicable * 100),
64513
- validated,
64514
- applicable,
64515
- na: t3.na,
64516
- open: t3.manual,
64517
- decided: t3.c + t3.nc,
64518
- total: t3.c + t3.nc + t3.manual
64519
- };
64520
- }
64521
64565
  function averageConformanceRate(r, pages, standard, lang) {
64522
64566
  const rated = pages.map((p) => {
64523
64567
  const rate = conformanceRate(pageTally(pageCriterionRows(r, p, standard, lang)));
@@ -64779,8 +64823,7 @@ function renderPageRates(r, pages, standard, lang) {
64779
64823
  out2.push("| --- | --- | --- | --- |");
64780
64824
  for (const p of pages) {
64781
64825
  const rows = pageCriterionRows(r, p, standard, lang);
64782
- const cov = pageCoverage(rows);
64783
- out2.push(`| ${p.name}${p.auth ? " \u{1F512}" : ""} | \`${p.url}\` | ${basisLabel(p.basis, lang)} | ${formatRate(pageRatePct(rows), cov.decided, cov.total)} |`);
64826
+ out2.push(`| ${p.name}${p.auth ? " \u{1F512}" : ""} | \`${p.url}\` | ${basisLabel(p.basis, lang)} | ${formatPageRate(rows, standard)} |`);
64784
64827
  }
64785
64828
  out2.push("");
64786
64829
  return out2;
@@ -65038,12 +65081,11 @@ function render(r, lang, opts) {
65038
65081
  if (derivedPages.length) {
65039
65082
  out2.push('<a id="page-rates"></a>', `## \u{1F4CB} ${s.pageRatesTitle}`, "", `> ${s.pageRatesNoteBusiness}${average ? s.conformanceColNote : ""}`, "");
65040
65083
  const conf = average ? new Map(average.pages.map((p) => [p.id, p])) : void 0;
65041
- out2.push(`| ${s.pageCol} | ${s.urlCol} | ${s.rateCol} |${conf ? ` ${s.conformanceCol} |` : ""}`, `| --- | --- | --- |${conf ? " --- |" : ""}`);
65084
+ out2.push(`| ${s.pageCol} | ${s.urlCol} | ${conf ? s.conformanceCol : s.rateCol} |`, "| --- | --- | --- |");
65042
65085
  for (const p of derivedPages) {
65043
65086
  const criteria = pageCriterionRows(r, p, opts.standard, lang);
65044
- const cov = pageCoverage(criteria);
65045
- const cell4 = conf ? ` ${pageConformanceCell(conf.get(p.id))} |` : "";
65046
- out2.push(`| ${mdText(p.name)}${p.auth ? " \u{1F512}" : ""} | ${urlText(p.url)} | ${formatRate(pageRatePct(criteria), cov.decided, cov.total)} |${cell4}`);
65087
+ const cell4 = conf ? pageConformanceCell(conf.get(p.id)) : formatPageRate(criteria, opts.standard);
65088
+ out2.push(`| ${mdText(p.name)}${p.auth ? " \u{1F512}" : ""} | ${urlText(p.url)} | ${cell4} |`);
65047
65089
  }
65048
65090
  out2.push("");
65049
65091
  }
@@ -75879,12 +75921,11 @@ function scoreboardBlocks(result, standard, lang, sheetHref) {
75879
75921
  const derived = derivePages(result, scope);
75880
75922
  const rows = derived.map((p) => {
75881
75923
  const criteria = pageCriterionRows(result, p, standard, lang);
75882
- const cov = pageCoverage(criteria);
75883
75924
  return [
75884
75925
  { text: `${p.name}${p.auth ? " \u{1F512}" : ""}`, ...sheetHref ? { href: sheetHref(p.id) } : {} },
75885
75926
  { text: p.url, mono: true },
75886
75927
  { text: basisLabel(p.basis, lang) },
75887
- { text: formatRate(pageRatePct(criteria), cov.decided, cov.total), align: "end" }
75928
+ { text: formatPageRate(criteria, standard), align: "end" }
75888
75929
  ];
75889
75930
  });
75890
75931
  const out2 = [
@@ -75936,7 +75977,6 @@ function pageGridBlocks(result, page, standard, lang) {
75936
75977
  const t3 = T4[lang];
75937
75978
  const rows = pageCriterionRows(result, page, standard, lang);
75938
75979
  if (!rows.length) return [];
75939
- const cov = pageCoverage(rows);
75940
75980
  const tally = pageTally(rows);
75941
75981
  const table = { kind: "table", caption: t3.gridCaption(page.name), columns: [{ text: t3.criterion }, { text: t3.status }], rows: [] };
75942
75982
  let group = "";
@@ -75953,7 +75993,7 @@ function pageGridBlocks(result, page, standard, lang) {
75953
75993
  kind: "para",
75954
75994
  runs: [
75955
75995
  { text: `${t3.pageRate} : `, strong: true },
75956
- { text: formatRate(pageRatePct(rows), cov.decided, cov.total), strong: true }
75996
+ { text: formatPageRate(rows, standard), strong: true }
75957
75997
  ]
75958
75998
  },
75959
75999
  { kind: "para", runs: [{ text: t3.tally(tally.c, tally.nc, tally.na, tally.manual) }] },
@@ -27,7 +27,7 @@ variables:
27
27
  ULTRA11Y_LANG: en
28
28
  # Exact by default: a CI report must say which engine produced it. The release script keeps
29
29
  # this pin aligned with the package version; override only for a deliberate upgrade test.
30
- ULTRA11Y_VERSION: '5.58.2'
30
+ ULTRA11Y_VERSION: '5.58.3'
31
31
  # Batches of 8 amortise the prompt; each accepted verdict is checkpointed before the next
32
32
  # batch, and later passes receive only the residue.
33
33
  ULTRA11Y_GRAIN: batch
@@ -28,7 +28,7 @@ import {
28
28
  type PageResolver,
29
29
  pageResolver,
30
30
  } from "./pages.js";
31
- import { pageCoverage, pageCriterionRows, pageRatePct, pageTally } from "./pages-report.js";
31
+ import { formatPageRate, pageCriterionRows, pageTally } from "./pages-report.js";
32
32
  import { partitionUnits, prdUnits, type PrdUnit } from "./prd.js";
33
33
  import {
34
34
  automationOverview,
@@ -499,12 +499,11 @@ export function scoreboardBlocks(result: AuditResult, standard: StandardId, lang
499
499
  // quote a rate out of 55 beside a document counting 106.
500
500
  const rows = derived.map((p) => {
501
501
  const criteria = pageCriterionRows(result, p, standard, lang);
502
- const cov = pageCoverage(criteria);
503
502
  return [
504
503
  { text: `${p.name}${p.auth ? " 🔒" : ""}`, ...(sheetHref ? { href: sheetHref(p.id) } : {}) },
505
504
  { text: p.url, mono: true },
506
505
  { text: basisLabel(p.basis, lang) },
507
- { text: formatRate(pageRatePct(criteria), cov.decided, cov.total), align: "end" as const },
506
+ { text: formatPageRate(criteria, standard), align: "end" as const },
508
507
  ];
509
508
  });
510
509
  const out: Block[] = [
@@ -562,7 +561,6 @@ function pageGridBlocks(result: AuditResult, page: PageResult, standard: Standar
562
561
  const t = T[lang];
563
562
  const rows = pageCriterionRows(result, page, standard, lang);
564
563
  if (!rows.length) return [];
565
- const cov = pageCoverage(rows);
566
564
  const tally = pageTally(rows);
567
565
  const table: Block = { kind: "table", caption: t.gridCaption(page.name), columns: [{ text: t.criterion }, { text: t.status }], rows: [] };
568
566
  let group = "";
@@ -580,7 +578,7 @@ function pageGridBlocks(result: AuditResult, page: PageResult, standard: Standar
580
578
  kind: "para",
581
579
  runs: [
582
580
  { text: `${t.pageRate} : `, strong: true },
583
- { text: formatRate(pageRatePct(rows), cov.decided, cov.total), strong: true },
581
+ { text: formatPageRate(rows, standard), strong: true },
584
582
  ],
585
583
  },
586
584
  { kind: "para", runs: [{ text: t.tally(tally.c, tally.nc, tally.na, tally.manual) }] },
package/src/messages.ts CHANGED
@@ -33,9 +33,9 @@ export const MSG_CATALOG: Record<string, MsgEntry> = {
33
33
  },
34
34
  remediation: {
35
35
  fr: () =>
36
- `Produisez un PDF balisé (PDF/UA-1) depuis l'outil source, ou proposez une version alternative accessible (HTML ou document balisé) ; vérifiez le résultat avec veraPDF ou PAC.`,
36
+ `Produisez un PDF balisé (PDF/UA-1) depuis l'outil source, ou proposez une version alternative accessible (HTML ou document balisé) ; vérifiez le résultat avec veraPDF ou PAC. En JavaScript, utilisez PDFKit (https://github.com/foliojs/pdfkit) : options \`subset: 'PDF/UA'\`, \`tagged: true\`, \`displayTitle: true\`, \`lang\`, un titre dans \`info\`, des polices TrueType ou OpenType incorporées, et tout le contenu balisé ou marqué comme artefact. PDFKit ne balise ni les annotations (dont les liens) ni les formulaires : pour ces contenus, prévoyez une version alternative accessible.`,
37
37
  en: () =>
38
- `Produce a tagged PDF (PDF/UA-1) from the source tool, or offer an accessible alternative version (HTML or a tagged document); check the result with veraPDF or PAC.`,
38
+ `Produce a tagged PDF (PDF/UA-1) from the source tool, or offer an accessible alternative version (HTML or a tagged document); check the result with veraPDF or PAC. In JavaScript, use PDFKit (https://github.com/foliojs/pdfkit): options \`subset: 'PDF/UA'\`, \`tagged: true\`, \`displayTitle: true\`, \`lang\`, a title in \`info\`, embedded TrueType or OpenType fonts, and all content tagged or marked as an artifact. PDFKit does not tag annotations (links included) or forms: for those, provide an accessible alternative version.`,
39
39
  },
40
40
  },
41
41
  "pdf-lang-missing": {
@@ -74,14 +74,19 @@ const L = {
74
74
  producer: "Producteur",
75
75
  auth: "Authentification requise",
76
76
  rate: "Taux de réussite automatique (vérifications statiques)",
77
+ packRate: "Taux de conformité de la page",
77
78
  // The index has its own, shorter header — the sheet's label is a full sentence and would
78
79
  // wreck an eight-column table. Kept as a SEPARATE key: editing `rate` in place would
79
80
  // silently reword the sheet bullet too.
80
81
  rateShort: "Taux (critères décidés)",
82
+ packRateShort: "Taux (validés ÷ applicables)",
81
83
  rateNote: "sous-ensemble décidable : C ÷ (C + NC)",
84
+ packRateNote: "critères validés ÷ critères applicables, ceux à évaluer comptant au dénominateur",
82
85
  tally: (c: number, nc: number, na: number, m: number) => `${c} conforme(s) · ${nc} non conforme(s) · ${na} non applicable(s) · ${m} à évaluer`,
83
86
  coverage: (decided: number, total: number) =>
84
87
  `Couverture : ${decided}/${total} critère(s) évalué(s) — le taux ci-dessus ne porte que sur eux, et ne dit rien des ${total - decided} autres.`,
88
+ packCoverage: (decided: number, total: number) =>
89
+ `Couverture : ${decided}/${total} critère(s) évalué(s). Tant qu'il en reste ${total - decided} à évaluer, le taux ci-dessus est un plancher.`,
85
90
  tests: "Tests",
86
91
  screenshotAlt: (n: string) => `Capture d'écran de la page ${n}`,
87
92
  noScreenshot: "Aucune capture d'écran pour cette page (le producteur n'en a pas fourni) — le tier pixel est donc inactif ici.",
@@ -105,6 +110,8 @@ const L = {
105
110
  minor: "Mineur",
106
111
  indexNote:
107
112
  "Une fiche par page. `X % (d/t)` : le taux ne porte que sur les `d` critères décidés sur `t` — il ne dit rien des autres. `—` signifie qu'aucun critère n'a été décidé sur cette page, et ne vaut donc NI conformité NI non-conformité.",
113
+ packIndexNote:
114
+ "Une fiche par page. `X % (v/a)` : critères validés ÷ critères applicables, la formule du taux global. Un critère sans sujet sur la page sort du calcul ; un critère à évaluer reste au dénominateur, le taux est donc un plancher. `—` signifie qu'aucun critère n'a été décidé sur cette page, et ne vaut donc NI conformité NI non-conformité.",
108
115
  },
109
116
  en: {
110
117
  docTitle: "Page-by-page accessibility report",
@@ -122,11 +129,16 @@ const L = {
122
129
  producer: "Producer",
123
130
  auth: "Authentication required",
124
131
  rate: "Automatic static-check pass rate",
132
+ packRate: "Page conformance rate",
125
133
  rateShort: "Rate (decided criteria)",
134
+ packRateShort: "Rate (validated ÷ applicable)",
126
135
  rateNote: "decidable subset: C ÷ (C + NC)",
136
+ packRateNote: "validated criteria ÷ applicable criteria, those still to assess counting in the denominator",
127
137
  tally: (c: number, nc: number, na: number, m: number) => `${c} conforming · ${nc} non-conforming · ${na} not applicable · ${m} to assess`,
128
138
  coverage: (decided: number, total: number) =>
129
139
  `Coverage: ${decided}/${total} criteria assessed — the rate above covers only those, and says nothing about the other ${total - decided}.`,
140
+ packCoverage: (decided: number, total: number) =>
141
+ `Coverage: ${decided}/${total} criteria assessed. While ${total - decided} remain to assess, the rate above is a floor.`,
130
142
  tests: "Tests",
131
143
  screenshotAlt: (n: string) => `Screenshot of the ${n} page`,
132
144
  noScreenshot: "No screenshot for this page (the producer supplied none) — the pixel tier is therefore inactive here.",
@@ -150,6 +162,8 @@ const L = {
150
162
  minor: "Minor",
151
163
  indexNote:
152
164
  "One sheet per page. `X % (d/t)`: the rate covers only the `d` criteria decided out of `t` — it says nothing about the others. `—` means no criterion was decided on this page, so it is NEITHER conformity NOR non-conformity.",
165
+ packIndexNote:
166
+ "One sheet per page. `X % (v/a)`: validated criteria ÷ applicable criteria, the formula of the overall rate. A criterion with no subject on the page leaves the calculation; one still to assess stays in the denominator, so the rate is a floor. `—` means no criterion was decided on this page, so it is NEITHER conformity NOR non-conformity.",
153
167
  },
154
168
  } as const;
155
169
 
@@ -250,7 +264,7 @@ export function pagesForStandard(result: AuditResult, pages: PageResult[], stand
250
264
  findings: [],
251
265
  ...(r.decidedBy ? { decidedBy: r.decidedBy } : {}),
252
266
  })),
253
- conformancePct: pageRatePct(rows),
267
+ conformancePct: pageRatePct(rows, standard),
254
268
  decided: cov.decided,
255
269
  total: cov.total,
256
270
  };
@@ -286,15 +300,59 @@ export function pageCoverage(rows: PageCriterionRow[]): { decided: number; total
286
300
  return { decided: t.c + t.nc, total: rows.length };
287
301
  }
288
302
 
289
- /** The rate over the criteria of the ACTIVE standard, decided ones only. Under a pack this is
290
- * the pack's own arithmetic, not the WCAG one, so the number agrees with the grid above it
291
- * rather than with a different denominator.
303
+ export interface ConformanceRate {
304
+ pct: number;
305
+ validated: number;
306
+ applicable: number;
307
+ na: number;
308
+ open: number;
309
+ decided: number;
310
+ total: number;
311
+ }
312
+
313
+ export function conformanceRate(t: { c: number; nc: number; na: number; manual: number }): ConformanceRate {
314
+ const validated = Math.max(0, t.c - t.na);
315
+ const applicable = validated + t.nc + t.manual;
316
+ return {
317
+ // No applicable criterion is not a failure — it is a scope with nothing of any kind in it,
318
+ // and the repository's convention for an empty denominator is 100 (src/audit.ts
319
+ // conformancePct). Divergent conventions on the same question is how two numbers describing
320
+ // one grid start disagreeing.
321
+ pct: applicable === 0 ? 100 : Math.round((validated / applicable) * 100),
322
+ validated,
323
+ applicable,
324
+ na: t.na,
325
+ open: t.manual,
326
+ decided: t.c + t.nc,
327
+ total: t.c + t.nc + t.manual,
328
+ };
329
+ }
330
+
331
+ /** A page's rate, by the arithmetic of the overall rate of the ACTIVE standard. The WCAG core's
332
+ * overall rate is C ÷ (C + NC); a pack's follows its own method, here RGAA's.
333
+ *
334
+ * Under a pack it was C ÷ (C + NC), which printed two numbers no reader could reconcile. A criterion with no
335
+ * subject counted as validated, and one still to assess did not count at all, so a real 38-page
336
+ * run published « 93 % » on every page above an overall 81 %, and a page with no located
337
+ * non-conformity read 100 % with fourteen criteria nobody had settled.
292
338
  *
293
339
  * NULL when nothing was decided — see `pct` in src/pages.ts. Returning 100 there is what let a
294
340
  * page nobody had assessed be quoted as a page with nothing wrong. */
295
- export function pageRatePct(rows: PageCriterionRow[]): number | null {
296
- const { c, nc } = pageTally(rows);
297
- return c + nc === 0 ? null : Math.round((c / (c + nc)) * 100);
341
+ export function pageRatePct(rows: PageCriterionRow[], standard: StandardId): number | null {
342
+ const t = pageTally(rows);
343
+ if (isCore(standard)) return t.c + t.nc === 0 ? null : Math.round((t.c / (t.c + t.nc)) * 100);
344
+ const rate = conformanceRate(t);
345
+ return rate.validated + t.nc === 0 ? null : rate.pct;
346
+ }
347
+
348
+ /** A page's rate with the two numbers it is computed from, as every surface prints it. */
349
+ export function formatPageRate(rows: PageCriterionRow[], standard: StandardId): string {
350
+ if (isCore(standard)) {
351
+ const cov = pageCoverage(rows);
352
+ return formatRate(pageRatePct(rows, standard), cov.decided, cov.total);
353
+ }
354
+ const rate = conformanceRate(pageTally(rows));
355
+ return formatRate(pageRatePct(rows, standard), rate.validated, rate.applicable);
298
356
  }
299
357
 
300
358
  /** One page's dossier: identity, screenshot, rate, the full criteria grid, then every
@@ -317,12 +375,17 @@ export function renderPageReport(result: AuditResult, page: PageResult, opts: Pa
317
375
  const rows = pageCriterionRows(result, page, standard, lang);
318
376
  const t = pageTally(rows);
319
377
  const cov = pageCoverage(rows);
320
- const rate = pageRatePct(rows);
321
- out.push(`- **${s.rate}** : **${rate === null ? "—" : `${rate} %`}** _(${s.rateNote})_`);
378
+ const pack = !isCore(standard);
379
+ const rate = pageRatePct(rows, standard);
380
+ out.push(
381
+ pack
382
+ ? `- **${s.packRate}** : **${formatPageRate(rows, standard)}** _(${s.packRateNote})_`
383
+ : `- **${s.rate}** : **${rate === null ? "—" : `${rate} %`}** _(${s.rateNote})_`,
384
+ );
322
385
  out.push(`- ${pageTallyNote(t, lang)}`);
323
386
  // The rate alone reads as a verdict on the page. Naming the denominator next to it is
324
387
  // what stops "100 %" over six decided criteria from being quoted as a conformant page.
325
- out.push(`- ${s.coverage(cov.decided, cov.total)}`, "");
388
+ out.push(`- ${(pack ? s.packCoverage : s.coverage)(cov.decided, cov.total)}`, "");
326
389
 
327
390
  // A source-only page cannot earn conformity by silence. Say so ON THE PAGE, not only in a
328
391
  // legend the reader may never reach — this is the sentence that stops a clean-looking
@@ -403,19 +466,19 @@ export function renderPagesIndex(result: AuditResult, pages: PageResult[], opts:
403
466
  const lang = opts.lang ?? "en";
404
467
  const s = L[lang];
405
468
  const out = header(result, pages, standard, lang, s.indexTitle);
406
- out.push(`> ${s.indexNote}`, "");
407
- out.push(`| ${s.page} | ${s.url} | ${s.basis} | ${s.rateShort} | ${s.blocking} | ${s.major} | ${s.minor} | ${s.sheet} |`);
469
+ const pack = !isCore(standard);
470
+ out.push(`> ${pack ? s.packIndexNote : s.indexNote}`, "");
471
+ out.push(`| ${s.page} | ${s.url} | ${s.basis} | ${pack ? s.packRateShort : s.rateShort} | ${s.blocking} | ${s.major} | ${s.minor} | ${s.sheet} |`);
408
472
  out.push("| --- | --- | --- | --- | --- | --- | --- | --- |");
409
473
  for (const p of pages) {
410
474
  const rows = pageCriterionRows(result, p, standard, lang);
411
- const cov = pageCoverage(rows);
412
475
  // Severity counts must see the SAME findings the rate did. Under a pack the rate comes from
413
476
  // `derivePackResults`, which reads packFindings; counting only `p.findings` printed
414
477
  // "0 · 0 · 0" beside a rate that had already counted those non-conformities.
415
478
  const nc = [...p.findings, ...(result.packFindings ?? []).filter((f) => f.page === p.id)].filter((f) => !f.advisory);
416
479
  const href = opts.hrefs?.get(p.id);
417
480
  out.push(
418
- `| ${p.name}${p.auth ? " 🔒" : ""} | \`${p.url}\` | ${basisLabel(p.basis, lang)} | ${formatRate(pageRatePct(rows), cov.decided, cov.total)} | ${
481
+ `| ${p.name}${p.auth ? " 🔒" : ""} | \`${p.url}\` | ${basisLabel(p.basis, lang)} | ${formatPageRate(rows, standard)} | ${
419
482
  nc.filter((f) => f.severity === "bloquant").length
420
483
  } | ${nc.filter((f) => f.severity === "majeur").length} | ${nc.filter((f) => f.severity === "mineur").length} | ${href ? `[${p.id}](${href})` : p.id} |`,
421
484
  );