ultra11y 5.58.0 → 5.58.2

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.0";
9
+ var VERSION = "5.58.2";
10
10
  var SCHEMA_VERSION = 2;
11
11
  function isAdjudicated(by) {
12
12
  return by === "agent" || by === "human";
@@ -62754,7 +62754,7 @@ function pageStatus(c2, pageFindings, basis, coverage) {
62754
62754
  if (c2.status === "manual") return "manual";
62755
62755
  if (c2.status === "NA") return "NA";
62756
62756
  if (c2.inapplicable) return c2.status;
62757
- if (c2.decidedBy === "agent" || c2.decidedBy === "human" || c2.decidedBy === "scan") return c2.status;
62757
+ if (c2.status !== "NC" && (c2.decidedBy === "agent" || c2.decidedBy === "human" || c2.decidedBy === "scan")) return c2.status;
62758
62758
  if (automatability(c2.id) !== "static") return "manual";
62759
62759
  return basis === "snapshot" ? "C" : "manual";
62760
62760
  }
@@ -62783,8 +62783,9 @@ function derivePages(result, pages) {
62783
62783
  const pf = own.filter((f) => f.criteriaId === c2.id);
62784
62784
  const status = pageStatus(c2, pf, p.basis, p.coverage);
62785
62785
  const measured2 = status === "C" && c2.status !== "C" && c2.decidedBy === void 0;
62786
- const decidedBy = c2.decidedBy ?? (measured2 ? "scan" : void 0);
62787
- const justification = measured2 ? measuredHereReason(c2.id, p.coverage) : c2.justification;
62786
+ const ruledElsewhere = c2.status === "NC" && status !== "NC" && c2.decidedBy !== void 0;
62787
+ const decidedBy = ruledElsewhere ? void 0 : c2.decidedBy ?? (measured2 ? "scan" : void 0);
62788
+ const justification = measured2 ? measuredHereReason(c2.id, p.coverage) : ruledElsewhere ? void 0 : c2.justification;
62788
62789
  return {
62789
62790
  id: c2.id,
62790
62791
  guideline: c2.guideline,
@@ -62904,11 +62905,24 @@ function commonOrigin(pages) {
62904
62905
  function pageOriginNote(origin, lang) {
62905
62906
  return origin ? L[lang].originNote(origin) : void 0;
62906
62907
  }
62908
+ function adjudicationOnPage(result, adjudication, page) {
62909
+ const stamped = new Set(page.findings.map(findingId));
62910
+ const sources = result.scope.pages?.find((p) => p.id === page.id)?.sources ?? [];
62911
+ const onPage = (f) => stamped.has(findingId(f)) || sources.some((s) => pathMatch2(f.origin?.sourceFile ?? f.file, s));
62912
+ const criteria = adjudication.criteria.flatMap((c2) => {
62913
+ if (c2.status !== "NC") return [c2];
62914
+ const findings = c2.findings.filter(onPage);
62915
+ return findings.some((f) => !f.advisory) ? [{ ...c2, findings }] : [];
62916
+ });
62917
+ return { ...adjudication, criteria };
62918
+ }
62907
62919
  function pageView(result, page) {
62908
62920
  const own = result.scope.pageSubjects?.[page.id];
62921
+ const packAdjudication = result.packAdjudication ? adjudicationOnPage(result, result.packAdjudication, page) : void 0;
62909
62922
  return {
62910
62923
  ...result,
62911
62924
  ...own ? { scope: { ...result.scope, subjectsSeen: own } } : {},
62925
+ ...packAdjudication ? { packAdjudication } : {},
62912
62926
  criteria: page.criteria,
62913
62927
  findings: page.findings,
62914
62928
  ...result.packFindings ? { packFindings: result.packFindings.filter((f) => f.page === page.id) } : {},
@@ -70902,6 +70916,22 @@ function validateSample(raw) {
70902
70916
  });
70903
70917
  }
70904
70918
  }
70919
+ if (s.exempt !== void 0) {
70920
+ if (!Array.isArray(s.exempt)) {
70921
+ err2("sample.exempt", "exempt must be an array of { path, reason }");
70922
+ } else {
70923
+ s.exempt.forEach((e, i2) => {
70924
+ const x = e;
70925
+ if (typeof x !== "object" || x === null || Array.isArray(x)) {
70926
+ err2(`sample.exempt[${i2}]`, "each exemption must be an object { path, reason }");
70927
+ return;
70928
+ }
70929
+ if (typeof x.path !== "string" || x.path.trim() === "") err2(`sample.exempt[${i2}].path`, "path must be a non-empty glob");
70930
+ if (typeof x.reason !== "string" || x.reason.trim() === "")
70931
+ err2(`sample.exempt[${i2}].reason`, "reason is required \u2014 say why this route is left out of the sample");
70932
+ });
70933
+ }
70934
+ }
70905
70935
  const ok = issues.length === 0;
70906
70936
  return { ok, issues, warnings, sample: ok ? normalizeSample(s) : void 0 };
70907
70937
  }
@@ -70917,7 +70947,8 @@ function normalizeSample(s) {
70917
70947
  }));
70918
70948
  const transverse = Array.isArray(s.transverse) ? s.transverse.map(String) : void 0;
70919
70949
  const global = Array.isArray(s.global) ? s.global.map(String) : void 0;
70920
- return { pages, ...transverse?.length ? { transverse } : {}, ...global?.length ? { global } : {} };
70950
+ const exempt = Array.isArray(s.exempt) ? s.exempt.map((e) => ({ path: String(e.path), reason: String(e.reason) })) : void 0;
70951
+ return { pages, ...transverse?.length ? { transverse } : {}, ...global?.length ? { global } : {}, ...exempt?.length ? { exempt } : {} };
70921
70952
  }
70922
70953
  function sampleScope(sample) {
70923
70954
  return {
@@ -70981,7 +71012,8 @@ function mergeSample(existing, proposed) {
70981
71012
  sample: {
70982
71013
  pages,
70983
71014
  ...existing?.transverse?.length ? { transverse: existing.transverse } : {},
70984
- ...existing?.global?.length ? { global: existing.global } : {}
71015
+ ...existing?.global?.length ? { global: existing.global } : {},
71016
+ ...existing?.exempt?.length ? { exempt: existing.exempt } : {}
70985
71017
  },
70986
71018
  added,
70987
71019
  kept: pages.length - added.length
@@ -71006,7 +71038,8 @@ function unionSample(declared, snapshotted) {
71006
71038
  sample: {
71007
71039
  pages: [...pages, ...undeclared],
71008
71040
  ...declared?.transverse?.length ? { transverse: declared.transverse } : {},
71009
- ...declared?.global?.length ? { global: declared.global } : {}
71041
+ ...declared?.global?.length ? { global: declared.global } : {},
71042
+ ...declared?.exempt?.length ? { exempt: declared.exempt } : {}
71010
71043
  },
71011
71044
  undeclared,
71012
71045
  uncaptured
@@ -72953,14 +72986,24 @@ function countByKey(findings) {
72953
72986
  }
72954
72987
  return out2;
72955
72988
  }
72956
- function buildRenderBaseline(findings, pages, standard, date = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10)) {
72989
+ function buildRenderBaseline(findings, pages, standard, date = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), skipped = []) {
72957
72990
  const out2 = {};
72958
72991
  for (const id of [...pages].sort()) out2[id] = {};
72959
72992
  for (const [key2, list] of [...countByKey(gatedFindings(findings))].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)) {
72960
72993
  const page = key2.slice(0, key2.indexOf("|"));
72961
72994
  (out2[page] ??= {})[key2] = list.length;
72962
72995
  }
72963
- return { tool: "ultra11y", kind: RENDER_BASELINE_KIND, schemaVersion: 1, version: VERSION, date, standard, pages: out2 };
72996
+ const missed = [...new Set(skipped)].filter((id) => !(id in out2)).sort();
72997
+ return {
72998
+ tool: "ultra11y",
72999
+ kind: RENDER_BASELINE_KIND,
73000
+ schemaVersion: 1,
73001
+ version: VERSION,
73002
+ date,
73003
+ standard,
73004
+ pages: out2,
73005
+ ...missed.length ? { skipped: missed } : {}
73006
+ };
72964
73007
  }
72965
73008
  function parseRenderBaseline(raw, standard = "wcag") {
72966
73009
  if (typeof raw !== "object" || raw === null) return null;
@@ -72980,7 +73023,8 @@ function parseRenderBaseline(raw, standard = "wcag") {
72980
73023
  version: typeof r.version === "string" ? r.version : "unknown",
72981
73024
  date: typeof r.date === "string" ? r.date : "",
72982
73025
  standard: typeof r.standard === "string" ? r.standard : standard,
72983
- pages
73026
+ pages,
73027
+ ...Array.isArray(r.skipped) ? { skipped: r.skipped.filter((x) => typeof x === "string") } : {}
72984
73028
  };
72985
73029
  }
72986
73030
  const doc = unwrapAudit(raw);
@@ -72994,20 +73038,27 @@ function parseRenderBaseline(raw, standard = "wcag") {
72994
73038
  }
72995
73039
  return null;
72996
73040
  }
72997
- function diffRenderBaseline(findings, pages, baseline, failOn = "bloquant", version = VERSION) {
73041
+ function diffRenderBaseline(findings, pages, baseline, failOn = "bloquant", version = VERSION, opts = {}) {
72998
73042
  const current = countByKey(gatedFindings(findings));
72999
73043
  const newFindings = [];
73000
73044
  const unbaselined = [];
73001
73045
  const without = /* @__PURE__ */ new Set();
73046
+ const fresh = /* @__PURE__ */ new Set();
73002
73047
  let fixed = 0;
73003
73048
  const audited = new Set(pages);
73004
- for (const id of pages) if (!baseline?.pages[id]) without.add(id);
73049
+ const versionMismatch = baseline && baseline.version !== version ? { baseline: baseline.version, current: version } : void 0;
73050
+ const reference = baseline !== null && !versionMismatch && !opts.approximate && Object.keys(baseline.pages).length > 0;
73051
+ const skipped = new Set(baseline?.skipped ?? []);
73052
+ const isNew = (page) => reference && !skipped.has(page);
73053
+ const absent = (page) => void (isNew(page) ? fresh : without).add(page);
73054
+ for (const id of pages) if (!baseline?.pages[id]) absent(id);
73005
73055
  for (const [key2, list] of current) {
73006
73056
  const page = key2.slice(0, key2.indexOf("|"));
73007
73057
  const base = baseline?.pages[page];
73008
73058
  if (!base) {
73009
- without.add(page);
73010
- unbaselined.push(...list);
73059
+ absent(page);
73060
+ if (isNew(page)) newFindings.push(...list);
73061
+ else unbaselined.push(...list);
73011
73062
  continue;
73012
73063
  }
73013
73064
  const had = base[key2] ?? 0;
@@ -73019,15 +73070,16 @@ function diffRenderBaseline(findings, pages, baseline, failOn = "bloquant", vers
73019
73070
  for (const [key2, had] of Object.entries(base)) fixed += Math.max(0, had - (current.get(key2)?.length ?? 0));
73020
73071
  }
73021
73072
  const blocking = newFindings.filter((f) => RANK2[f.severity] <= RANK2[failOn]);
73022
- const versionMismatch = baseline && baseline.version !== version ? { baseline: baseline.version, current: version } : void 0;
73023
73073
  return {
73024
73074
  pages: [...pages].sort(),
73025
73075
  failOn,
73026
73076
  newFindings,
73027
73077
  blocking,
73028
73078
  fixed,
73079
+ newPages: [...fresh].sort(),
73029
73080
  pagesWithoutBaseline: [...without].sort(),
73030
73081
  unbaselined,
73082
+ approximate: opts.approximate === true,
73031
73083
  ...versionMismatch ? { versionMismatch } : {},
73032
73084
  noBaseline: baseline === null,
73033
73085
  ok: blocking.length === 0 || versionMismatch !== void 0
@@ -73042,7 +73094,7 @@ function renderDiffWarnings(diff, lang = "en") {
73042
73094
  );
73043
73095
  else if (diff.pagesWithoutBaseline.length)
73044
73096
  out2.push(
73045
- fr ? `page(s) absente(s) de la baseline, ses constats ne bloquent pas : ${diff.pagesWithoutBaseline.join(", ")}.` : `page(s) the baseline never measured, their findings do not gate: ${diff.pagesWithoutBaseline.join(", ")}.`
73097
+ diff.approximate ? fr ? `baseline approch\xE9e (pas celle du merge-base) : les pages qu'elle ne conna\xEEt pas sont signal\xE9es sans bloquer : ${diff.pagesWithoutBaseline.join(", ")}.` : `approximate baseline (not the merge-base's own): pages it does not know are reported without gating: ${diff.pagesWithoutBaseline.join(", ")}.` : fr ? `page(s) absente(s) de la baseline, ses constats ne bloquent pas : ${diff.pagesWithoutBaseline.join(", ")}.` : `page(s) the baseline never measured, their findings do not gate: ${diff.pagesWithoutBaseline.join(", ")}.`
73046
73098
  );
73047
73099
  if (diff.versionMismatch)
73048
73100
  out2.push(
@@ -73068,6 +73120,11 @@ function renderDiffMarkdown(diff, lang = "en", max = 50) {
73068
73120
  ""
73069
73121
  );
73070
73122
  for (const w of renderDiffWarnings(diff, lang)) out2.push(`> \u26A0\uFE0F ${w}`, "");
73123
+ if (diff.newPages.length)
73124
+ out2.push(
73125
+ fr ? `\u{1F195} Nouvelle(s) page(s), absente(s) de la baseline : jug\xE9e(s) sans r\xE9f\xE9rence, chacun de ses constats \u2265 ${sev} bloque \u2014 ${diff.newPages.join(", ")}.` : `\u{1F195} New page(s), absent from the baseline: judged with no reference, every finding \u2265 ${sev} on it gates \u2014 ${diff.newPages.join(", ")}.`,
73126
+ ""
73127
+ );
73071
73128
  if (diff.newFindings.length) {
73072
73129
  out2.push(fr ? "| Page | Crit\xE8re | R\xE8gle | S\xE9v\xE9rit\xE9 | \xC9l\xE9ment |" : "| Page | Criterion | Rule | Severity | Element |", "|---|---|---|---|---|");
73073
73130
  for (const f of diff.newFindings.slice(0, max))
@@ -73113,6 +73170,19 @@ var extOf = (f) => {
73113
73170
  return i2 <= 0 ? "" : b.slice(i2).toLowerCase();
73114
73171
  };
73115
73172
  var norm5 = (p) => posix3.normalize(toPosix(p)).replace(/^\.\//, "");
73173
+ var ROUTE_FILES = [
73174
+ // Next.js App Router: app/**/page.* — at any depth, so a config at a workspace root still sees
73175
+ // `apps/web/src/app/**`. A `page.*` file under an `app/` directory is a route almost everywhere;
73176
+ // where it is not, `sample.exempt` says so.
73177
+ /(?:^|\/)app\/(?:.+\/)?page\.(?:tsx|jsx|ts|js|mdx)$/,
73178
+ // Next.js Pages Router, Nuxt, Astro: pages/** (minus `_app`/`_document`/… and API routes)
73179
+ /^(?:src\/)?pages\/(?!(?:.+\/)?_)(?!api\/)(?:.+\/)?[^/]+\.(?:tsx|jsx|ts|js|mdx|md|vue|astro|svelte)$/,
73180
+ // SvelteKit: routes/**/+page.svelte — unambiguous, so at any depth too
73181
+ /(?:^|\/)routes\/(?:.+\/)?\+page\.svelte$/
73182
+ ];
73183
+ function isRouteFile(rel2) {
73184
+ return !isTestArtifact(rel2) && ROUTE_FILES.some((re) => re.test(rel2));
73185
+ }
73116
73186
  var BLOCK_COMMENT = /\/\*[\s\S]*?\*\//g;
73117
73187
  var LINE_COMMENT = /^\s*\/\/.*$/gm;
73118
73188
  var IMPORT_RE = /\bimport\s+(type\s+)?([^;'"`]*?)\s*\bfrom\s*(["'])([^"'\n]+)\3/g;
@@ -73330,9 +73400,22 @@ function nextWrappers(page, known) {
73330
73400
  }
73331
73401
  function selectAffected(input, graph = buildAffectedGraph(input.root)) {
73332
73402
  const changed = [...new Set(input.changed.map(norm5))].sort();
73333
- const empty = { pages: [], all: false, none: true, unmapped: [], global: [], reasons: {}, unsourced: [], changed: changed.length };
73403
+ const empty = {
73404
+ pages: [],
73405
+ all: false,
73406
+ none: true,
73407
+ unmapped: [],
73408
+ global: [],
73409
+ reasons: {},
73410
+ unsourced: [],
73411
+ unsampled: [],
73412
+ changed: changed.length
73413
+ };
73334
73414
  const unsourced = input.pages.filter((p) => !p.sources?.length).map((p) => p.id);
73335
73415
  if (!changed.length) return { ...empty, unsourced };
73416
+ const declared = new Set(input.pages.flatMap((p) => (p.sources ?? []).map(norm5)));
73417
+ const isExempt = input.exempt?.length ? compileGlobs(input.exempt.map(norm5)) ?? (() => false) : () => false;
73418
+ const unsampled = changed.filter((f) => isRouteFile(f) && !declared.has(f) && !isExempt(f) && existsSync34(join43(input.root, f)));
73336
73419
  const isGlobal = compileGlobs([...IMPLICIT_GLOBAL, ...(input.global ?? []).map(norm5)]) ?? (() => false);
73337
73420
  const globalHits = changed.filter((f) => isGlobal(f));
73338
73421
  if (globalHits.length)
@@ -73342,7 +73425,8 @@ function selectAffected(input, graph = buildAffectedGraph(input.root)) {
73342
73425
  all: true,
73343
73426
  none: false,
73344
73427
  global: globalHits,
73345
- unsourced
73428
+ unsourced,
73429
+ unsampled
73346
73430
  };
73347
73431
  const changedSet = new Set(changed);
73348
73432
  const reached = /* @__PURE__ */ new Set();
@@ -73363,7 +73447,7 @@ function selectAffected(input, graph = buildAffectedGraph(input.root)) {
73363
73447
  const unmapped = changed.filter(
73364
73448
  (f) => !reached.has(f) && !f.startsWith("../") && MARKUP_EXT.has(extOf(f)) && !isTestArtifact(f) && existsSync34(join43(input.root, f))
73365
73449
  );
73366
- return { pages, all: false, none: pages.length === 0, unmapped, global: [], reasons, unsourced, changed: changed.length };
73450
+ return { pages, all: false, none: pages.length === 0, unmapped, global: [], reasons, unsourced, unsampled, changed: changed.length };
73367
73451
  }
73368
73452
  function git3(cwd, args2) {
73369
73453
  return execFileSync7("git", args2, { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], maxBuffer: 64 * 1024 * 1024 });
@@ -80039,8 +80123,8 @@ Usage:
80039
80123
  ultra11y audit [--captures <dir>] [--no-captures] [--require-captures] (rendered-DOM captures + .ultra11y/pages snapshots: audit real HTML)
80040
80124
  ultra11y audit [--format sarif|github] (CI: SARIF for code scanning, or inline annotations + job summary)
80041
80125
  ultra11y audit --in <audit.json> [--fail-on blocking|major|minor] [--format sarif|github] (re-gate an audit already computed \u2014 e.g. one carrying adjudicated verdicts \u2014 without a second detection pass)
80042
- ultra11y audit --lite [--pages <ids>] [--root <dir>] [--baseline <file>] [--write-baseline <file>] [--fail-on blocking|major|minor] [--format sarif|github] [--out <dir>] [--json] (rendered regression gate: the page snapshots alone, engine only, fails on NEW findings only)
80043
- ultra11y affected --since <ref> | --all [--root <dir>] [--json] (the sample pages a diff can change: sources + their imports, sample.global, the merge-base)
80126
+ ultra11y audit --lite [--pages <ids>] [--root <dir>] [--baseline <file> [--baseline-approximate]] [--write-baseline <file>] [--fail-on blocking|major|minor] [--format sarif|github] [--out <dir>] [--json] (rendered regression gate: the page snapshots alone, engine only, fails on NEW findings only)
80127
+ ultra11y affected --since <ref> | --all [--root <dir>] [--require-sampled] [--json] (the sample pages a diff can change: sources + their imports, sample.global, the merge-base)
80044
80128
  ultra11y report --in <audit.json> [--out <dir>] [--standard <pack>] [--format sarif|github] [--lang auto|en|fr]
80045
80129
  ultra11y report --in <audit.json> [--evidence [--evidence-max <n>]] [--out <dir>] (the Markdown report, illustrated with annotated crops)
80046
80130
  ultra11y report --in <audit.json> --html [--evidence] [--inline-budget <bytes>] [--out <dir>] (index.html + a printable single file)
@@ -80339,7 +80423,14 @@ Options:
80339
80423
  report. With --baseline it fails only on NEW findings at --fail-on; a
80340
80424
  page the baseline never measured, or a baseline from another ultra11y
80341
80425
  version, warns instead of failing
80342
- --pages <ids> audit --lite: comma-separated page ids to audit (default: every snapshot)
80426
+ --pages <ids> audit --lite: comma-separated page ids to audit (default: every snapshot).
80427
+ A page absent from a same-version baseline is NEW: every finding on it
80428
+ counts as new and gates
80429
+ --baseline-approximate audit --lite: the baseline is not the merge-base's own, so a page it
80430
+ lacks only warns
80431
+ --require-sampled affected: fail when the diff adds or changes a route file (App Router
80432
+ page.*, pages/\u2026, +page.svelte) no sample page declares in its sources and
80433
+ sample.exempt does not exempt
80343
80434
  --write-baseline <file> audit --lite: write the render baseline of this run
80344
80435
  --fail-on <sev> audit/init: gate severity \u2014 blocking|major|minor (fr aliases accepted) (default: blocking)
80345
80436
  --hook init: write a git pre-commit accessibility gate (staged snapshot + auto-fix by default)
@@ -80641,6 +80732,11 @@ function valueFlagsFor(command) {
80641
80732
  var BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
80642
80733
  // `audit --lite`: the rendered regression gate (src/lite.ts).
80643
80734
  "lite",
80735
+ // `audit --lite --baseline-approximate`: the baseline is not the merge-base's own (a closest
80736
+ // cache entry), so a page it lacks may not be this change's — warn instead of gating it.
80737
+ "baseline-approximate",
80738
+ // `affected --require-sampled`: fail on a changed route no sample page declares.
80739
+ "require-sampled",
80644
80740
  // `verify --apply … --prune`: apply what the refutation trial decided to the audit, instead
80645
80741
  // of only reporting it (src/refute.ts).
80646
80742
  "prune",
@@ -81125,7 +81221,17 @@ async function cmdAuditLite(p) {
81125
81221
  const findings = findingsForStandard(result, standard);
81126
81222
  const writeTo = typeof p.flags["write-baseline"] === "string" && p.flags["write-baseline"] ? p.flags["write-baseline"] : void 0;
81127
81223
  if (writeTo) {
81128
- const baseline2 = buildRenderBaseline(findings, selected, standard);
81224
+ let declared = [];
81225
+ try {
81226
+ declared = (loadConfig(root)?.sample?.pages ?? []).map((pg) => pg.id).filter((id) => typeof id === "string");
81227
+ } catch {
81228
+ }
81229
+ const asked = typeof p.flags.pages === "string" ? p.flags.pages.split(/[\s,]+/).filter(Boolean) : [];
81230
+ const baseline2 = buildRenderBaseline(findings, selected, standard, void 0, [...asked, ...declared]);
81231
+ if (baseline2.skipped?.length)
81232
+ warnings.push(
81233
+ lang === "fr" ? `baseline \xE9crite sans ${baseline2.skipped.length} page(s) d\xE9clar\xE9e(s) faute d'instantan\xE9 (${baseline2.skipped.join(", ")}) : elles ne seront pas jug\xE9es nouvelles.` : `baseline written without ${baseline2.skipped.length} declared page(s) that left no snapshot (${baseline2.skipped.join(", ")}): they will not be judged new.`
81234
+ );
81129
81235
  mkdirSync20(dirname22(writeTo), { recursive: true });
81130
81236
  writeFileSync23(writeTo, `${JSON.stringify(baseline2, null, 2)}
81131
81237
  `);
@@ -81144,7 +81250,7 @@ async function cmdAuditLite(p) {
81144
81250
  }
81145
81251
  }
81146
81252
  const gating = baselineFlag !== void 0;
81147
- const diff = diffRenderBaseline(findings, selected, baseline, failOn);
81253
+ const diff = diffRenderBaseline(findings, selected, baseline, failOn, void 0, { approximate: p.flags["baseline-approximate"] === true });
81148
81254
  warnings.push(...gating ? renderDiffWarnings(diff, lang) : []);
81149
81255
  if (!selected.length) warnings.push(lang === "fr" ? `aucun instantan\xE9 de page \xE0 auditer sous ${pagesDir}.` : `no page snapshot to audit under ${pagesDir}.`);
81150
81256
  const reported = gating ? diff.newFindings : gatedFindings(findings);
@@ -81217,7 +81323,7 @@ function cmdAffected(p) {
81217
81323
  }
81218
81324
  if (every) {
81219
81325
  const pages = v.sample.pages.map((pg) => pg.id);
81220
- const r2 = { pages, all: true, none: pages.length === 0, unmapped: [], global: [], reasons: {}, unsourced: [], changed: 0 };
81326
+ const r2 = { pages, all: true, none: pages.length === 0, unmapped: [], global: [], reasons: {}, unsourced: [], unsampled: [], changed: 0 };
81221
81327
  if (p.flags.json) console.log(JSON.stringify(r2, null, 2));
81222
81328
  else console.log(lang === "fr" ? `Toutes les pages (${pages.length}).` : `Every page (${pages.length}).`);
81223
81329
  return 0;
@@ -81229,12 +81335,19 @@ function cmdAffected(p) {
81229
81335
  console.error(`ultra11y affected: ${e instanceof Error ? e.message : String(e)}`);
81230
81336
  return 2;
81231
81337
  }
81232
- const r = selectAffected({ root, pages: v.sample.pages, global: v.sample.global, changed: changed.files });
81338
+ const r = selectAffected({ root, pages: v.sample.pages, global: v.sample.global, exempt: v.sample.exempt?.map((e) => e.path), changed: changed.files });
81339
+ const fr = lang === "fr";
81340
+ const requireSampled = p.flags["require-sampled"] === true;
81341
+ const unsampledMessage = r.unsampled.length ? fr ? `route(s) ajout\xE9e(s) ou modifi\xE9e(s) qu'aucune page de l'\xE9chantillon ne d\xE9clare : ${r.unsampled.join(", ")} \u2014 d\xE9clarez la page dans \`sample.pages\` (avec ses \`sources\`), ou exemptez-la dans \`sample.exempt\` avec sa raison.` : `route(s) added or changed that no sample page declares: ${r.unsampled.join(", ")} \u2014 declare the page in \`sample.pages\` (with its \`sources\`), or exempt it in \`sample.exempt\` with a reason.` : "";
81342
+ const sampledVerdict = () => {
81343
+ if (!unsampledMessage) return 0;
81344
+ console.error(`${requireSampled ? "\u2717" : "\u26A0"} ${unsampledMessage}`);
81345
+ return requireSampled ? 1 : 0;
81346
+ };
81233
81347
  if (p.flags.json) {
81234
81348
  console.log(JSON.stringify({ since, mergeBase: changed.mergeBase, ...r }, null, 2));
81235
- return 0;
81349
+ return sampledVerdict();
81236
81350
  }
81237
- const fr = lang === "fr";
81238
81351
  if (r.all)
81239
81352
  console.log(
81240
81353
  fr ? `Toutes les pages (${r.pages.length}) : fichier(s) global(aux) touch\xE9(s) \u2014 ${r.global.join(", ")}.` : `Every page (${r.pages.length}): global file(s) touched \u2014 ${r.global.join(", ")}.`
@@ -81252,7 +81365,7 @@ function cmdAffected(p) {
81252
81365
  console.error(
81253
81366
  fr ? `\u26A0 page(s) sans \`sources\`, s\xE9lectionn\xE9e(s) seulement par un fichier global : ${r.unsourced.join(", ")}` : `\u26A0 page(s) declaring no \`sources\`, selected only by a global file: ${r.unsourced.join(", ")}`
81254
81367
  );
81255
- return 0;
81368
+ return sampledVerdict();
81256
81369
  }
81257
81370
  async function cmdDev(p) {
81258
81371
  const root = typeof p.flags.root === "string" && p.flags.root ? p.flags.root : ".";
@@ -3,7 +3,7 @@ name: ultra11y
3
3
  description: "Use to AUDIT a site, repository, or page against RGAA 4.1.2, the French State's accessibility standard (référentiel de l'État), on a WCAG 2.2 AA core (other country standards as packs); produce a dated conformance report, criterion grid, PRD backlog, or tickets; AUTHOR accessible markup; fix accessibility; or wire a repo gate and rendered-DOM capture pipeline. The bundled install-free engine runs 102 static checks tied to success criteria, while the agent adjudicates judgment criteria and routes rendering criteria to browser scans; check/verify reject invented non-conformities and never declare conforming what was not verified. Use `review-a11y` instead for a review scoped only to a diff, branch, or PR."
4
4
  license: MIT
5
5
  metadata:
6
- version: 5.58.0
6
+ version: 5.58.2
7
7
  ---
8
8
 
9
9
  # ultra11y — audit WCAG 2.2 AA and write accessible markup
@@ -638,7 +638,11 @@ capture.
638
638
  stylesheets, Sass `@use`), the App Router `layout`/`template` above a `page`, and
639
639
  `sample.global` (a touched global file selects every page). Outputs `affected-pages`
640
640
  (comma-separated ids), `affected-all`, `affected-none`. On a push to the default branch it
641
- selects every page. Changed markup no page reaches is warned as `unmapped`.
641
+ selects every page. Changed markup no page reaches is warned as `unmapped`. Route files the
642
+ diff adds or changes (App Router `page.*`, a `pages/` router, SvelteKit `+page.svelte`) that no
643
+ page declares in its `sources` are listed in `affected-unsampled`; `require-sampled: true`
644
+ fails on them — declare the page in `sample.pages`, or exempt it in
645
+ `sample.exempt: [{ "path": "<glob>", "reason": "…" }]` (the reason is required).
642
646
  2. Your workflow captures those pages only (`ULTRA11Y_PAGES` filtered in your suite), or skips.
643
647
  3. `step: audit` runs `ultra11y audit --lite --pages <ids>` over `.ultra11y/pages/`: no source,
644
648
  no adjudication, no page report, no PDF, no pixel tier, no HTML. On a pull request it restores
@@ -649,7 +653,11 @@ capture.
649
653
  The baseline keys a finding on `page|rule|criterion|normalized selector`, a multiset: a finding
650
654
  that only moved is not new, a third occurrence of a key that had two is. It is separate from
651
655
  `findingId`, which the ledger and the full run's SARIF keep using. A page the baseline never
652
- measured, or a baseline written by another ultra11y version, warns and never fails. Surfaces: the
656
+ measured is NEW when the baseline is the merge-base's own and of the same version — the push that
657
+ writes it records every sample page, clean ones included — so every finding on it gates, and the
658
+ summary says the page is new. It only warns when the baseline is missing, from another ultra11y
659
+ version, or the closest cache entry rather than the merge-base's (`--baseline-approximate`), and
660
+ for a page the baseline records as `skipped` (declared or asked for, but no snapshot on that push). Surfaces: the
653
661
  job summary, annotations, SARIF under category `ultra11y-lite-<standard>`; no sticky comment.
654
662
  A complete workflow is in the README.
655
663