ultra11y 5.57.0 → 5.57.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.
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/cli.ts
4
- import { realpathSync as realpathSync9, writeFileSync as writeFileSync23, mkdirSync as mkdirSync20, existsSync as existsSync42, readFileSync as readFileSync38, appendFileSync, copyFileSync as copyFileSync4 } from "fs";
5
- import { join as join55, relative as relative7, resolve as resolve18, sep as sep7, dirname as dirname22 } from "path";
4
+ import { realpathSync as realpathSync9, writeFileSync as writeFileSync23, mkdirSync as mkdirSync20, existsSync as existsSync44, readFileSync as readFileSync38, appendFileSync, copyFileSync as copyFileSync4 } from "fs";
5
+ import { join as join56, relative as relative7, resolve as resolve19, sep as sep7, dirname as dirname22 } from "path";
6
6
  import { fileURLToPath as fileURLToPath6, pathToFileURL as pathToFileURL3 } from "url";
7
7
 
8
8
  // src/types.ts
9
- var VERSION = "5.57.0";
9
+ var VERSION = "5.57.2";
10
10
  var SCHEMA_VERSION = 2;
11
11
  function isAdjudicated(by) {
12
12
  return by === "agent" || by === "human";
@@ -5811,8 +5811,8 @@ var FunctionBindErrors = {
5811
5811
  UnsupportedBind: "Binding should be performed on object property.",
5812
5812
  UnsupportedBindRHS: "The right-hand side of binding can not be super or import."
5813
5813
  };
5814
- function defineHidden(obj, key2, value) {
5815
- Object.defineProperty(obj, key2, {
5814
+ function defineHidden(obj2, key2, value) {
5815
+ Object.defineProperty(obj2, key2, {
5816
5816
  enumerable: false,
5817
5817
  configurable: true,
5818
5818
  value
@@ -22287,7 +22287,7 @@ async function Module2(moduleArg = {}) {
22287
22287
  var GOT = {};
22288
22288
  var currentModuleWeakSymbols = /* @__PURE__ */ new Set([]);
22289
22289
  var GOTHandler = {
22290
- get(obj, symName) {
22290
+ get(obj2, symName) {
22291
22291
  var rtn = GOT[symName];
22292
22292
  if (!rtn) {
22293
22293
  rtn = GOT[symName] = new WebAssembly.Global({
@@ -22522,9 +22522,9 @@ async function Module2(moduleArg = {}) {
22522
22522
  return ret;
22523
22523
  }, "getMemory");
22524
22524
  var isInternalSym = /* @__PURE__ */ __name((symName) => ["__cpp_exception", "__c_longjmp", "__wasm_apply_data_relocs", "__dso_handle", "__tls_size", "__tls_align", "__set_stack_limits", "_emscripten_tls_init", "__wasm_init_tls", "__wasm_call_ctors", "__start_em_asm", "__stop_em_asm", "__start_em_js", "__stop_em_js"].includes(symName) || symName.startsWith("__em_js__"), "isInternalSym");
22525
- var uleb128EncodeWithLen = /* @__PURE__ */ __name((arr) => {
22526
- const n = arr.length;
22527
- return [n % 128 | 128, n >> 7, ...arr];
22525
+ var uleb128EncodeWithLen = /* @__PURE__ */ __name((arr2) => {
22526
+ const n = arr2.length;
22527
+ return [n % 128 | 128, n >> 7, ...arr2];
22528
22528
  }, "uleb128EncodeWithLen");
22529
22529
  var wasmTypeCodes = {
22530
22530
  "i": 127,
@@ -26077,8 +26077,8 @@ function readName(node) {
26077
26077
  }
26078
26078
  function readReceiver(node) {
26079
26079
  if (!node || node.namedChildren.length === 0) return void 0;
26080
- const obj = node.childForFieldName("object") ?? node.childForFieldName("operand") ?? node.childForFieldName("value") ?? node.childForFieldName("path") ?? node.childForFieldName("expression") ?? node.childForFieldName("argument") ?? node.childForFieldName("receiver") ?? node.childForFieldName("table");
26081
- const name2 = obj ? readName(obj) : void 0;
26080
+ const obj2 = node.childForFieldName("object") ?? node.childForFieldName("operand") ?? node.childForFieldName("value") ?? node.childForFieldName("path") ?? node.childForFieldName("expression") ?? node.childForFieldName("argument") ?? node.childForFieldName("receiver") ?? node.childForFieldName("table");
26081
+ const name2 = obj2 ? readName(obj2) : void 0;
26082
26082
  return name2 && /^[A-Za-z_]\w*$/.test(name2) ? name2 : void 0;
26083
26083
  }
26084
26084
  function readTypeName(node) {
@@ -27573,8 +27573,8 @@ function extractAst(rel2, ext2, content, opts = {}) {
27573
27573
  const prop = left.childForFieldName("property");
27574
27574
  if (prop?.type === "property_identifier") {
27575
27575
  name2 = prop.text;
27576
- const obj = left.text.slice(0, left.text.length - prop.text.length - 1);
27577
- exportedAssign = obj === "exports" || obj === "module.exports";
27576
+ const obj2 = left.text.slice(0, left.text.length - prop.text.length - 1);
27577
+ exportedAssign = obj2 === "exports" || obj2 === "module.exports";
27578
27578
  }
27579
27579
  } else if (left.type === "identifier") {
27580
27580
  name2 = left.text;
@@ -27598,8 +27598,8 @@ function extractAst(rel2, ext2, content, opts = {}) {
27598
27598
  } else if (left?.type === "member_expression" && right) {
27599
27599
  const prop = left.childForFieldName("property");
27600
27600
  if (prop?.type === "property_identifier") {
27601
- const obj = left.text.slice(0, left.text.length - prop.text.length - 1);
27602
- if (obj === "exports" || obj === "module.exports") {
27601
+ const obj2 = left.text.slice(0, left.text.length - prop.text.length - 1);
27602
+ if (obj2 === "exports" || obj2 === "module.exports") {
27603
27603
  if (right.type === "identifier") exportedNames.add(right.text);
27604
27604
  if (right.type !== "identifier" || right.text !== prop.text) {
27605
27605
  emit2({
@@ -28342,9 +28342,9 @@ function scanRepo(root, opts = {}) {
28342
28342
  const languages = {};
28343
28343
  const docText = /* @__PURE__ */ new Map();
28344
28344
  const mtimes = /* @__PURE__ */ new Map();
28345
- const cache = opts.cache;
28346
- let allReused = cache !== void 0;
28347
- let cacheDirty = cache === void 0;
28345
+ const cache2 = opts.cache;
28346
+ let allReused = cache2 !== void 0;
28347
+ let cacheDirty = cache2 === void 0;
28348
28348
  const it = keptFiles(root, opts);
28349
28349
  let step = it.next();
28350
28350
  for (; !step.done; step = it.next()) {
@@ -28404,7 +28404,7 @@ function scanRepo(root, opts = {}) {
28404
28404
  files.push(record);
28405
28405
  }
28406
28406
  files.sort(byKey((f) => f.rel));
28407
- if (cache !== void 0 && files.length !== cache.size) {
28407
+ if (cache2 !== void 0 && files.length !== cache2.size) {
28408
28408
  allReused = false;
28409
28409
  cacheDirty = true;
28410
28410
  }
@@ -28628,10 +28628,10 @@ function toCacheMap(scan2) {
28628
28628
  for (const f of scan2.files) m.set(f.rel, { hash: f.hash, record: f, size: f.size, mtimeMs: scan2.mtimes.get(f.rel) });
28629
28629
  return m;
28630
28630
  }
28631
- function needsGrammarWarm(walked, cache, fullHash = false) {
28631
+ function needsGrammarWarm(walked, cache2, fullHash = false) {
28632
28632
  const codeFiles = walked.files.filter((file) => classify(file.rel, file.ext) === "code");
28633
28633
  return fullHash && codeFiles.length > 0 || codeFiles.some((file) => {
28634
- const cached = cache.get(file.rel);
28634
+ const cached = cache2.get(file.rel);
28635
28635
  return !cached || cached.size !== file.size || cached.mtimeMs !== file.mtimeMs;
28636
28636
  });
28637
28637
  }
@@ -29033,11 +29033,11 @@ function buildResolveContext(scan2) {
29033
29033
  const csharpNamespaces = /* @__PURE__ */ new Map();
29034
29034
  for (const f of scan2.files) {
29035
29035
  if (f.ext !== ".cs" || !f.pkg) continue;
29036
- let arr = csharpNamespaces.get(f.pkg);
29037
- if (!arr) csharpNamespaces.set(f.pkg, arr = []);
29038
- arr.push(f.rel);
29036
+ let arr2 = csharpNamespaces.get(f.pkg);
29037
+ if (!arr2) csharpNamespaces.set(f.pkg, arr2 = []);
29038
+ arr2.push(f.rel);
29039
29039
  }
29040
- for (const arr of csharpNamespaces.values()) arr.sort(byStr);
29040
+ for (const arr2 of csharpNamespaces.values()) arr2.sort(byStr);
29041
29041
  return {
29042
29042
  fileSet,
29043
29043
  dirSet,
@@ -29550,9 +29550,9 @@ function resolveCallEdges(scan2, importPairs) {
29550
29550
  const dedup = `${s.name} ${s.file}`;
29551
29551
  if (seen.has(dedup)) continue;
29552
29552
  seen.add(dedup);
29553
- let arr = defs.get(s.name);
29554
- if (!arr) defs.set(s.name, arr = []);
29555
- arr.push({ file: s.file, lang: s.lang });
29553
+ let arr2 = defs.get(s.name);
29554
+ if (!arr2) defs.set(s.name, arr2 = []);
29555
+ arr2.push({ file: s.file, lang: s.lang });
29556
29556
  }
29557
29557
  }
29558
29558
  const agg = /* @__PURE__ */ new Map();
@@ -29610,9 +29610,9 @@ function typeDefs(scan2) {
29610
29610
  const dedup = `${s.name} ${s.file}`;
29611
29611
  if (seen.has(dedup)) continue;
29612
29612
  seen.add(dedup);
29613
- let arr = defs.get(s.name);
29614
- if (!arr) defs.set(s.name, arr = []);
29615
- arr.push({ name: s.name, file: s.file, kind: s.kind, lang: s.lang, line: s.line });
29613
+ let arr2 = defs.get(s.name);
29614
+ if (!arr2) defs.set(s.name, arr2 = []);
29615
+ arr2.push({ name: s.name, file: s.file, kind: s.kind, lang: s.lang, line: s.line });
29616
29616
  }
29617
29617
  }
29618
29618
  return defs;
@@ -29662,8 +29662,8 @@ function buildTypeHierarchy(scan2, importPairs) {
29662
29662
  const resolved = resolveRelations(scan2, importPairs);
29663
29663
  const entries = /* @__PURE__ */ new Map();
29664
29664
  const keyOf2 = (name2, file) => `${name2}${SEP}${file}`;
29665
- for (const arr of defs.values()) {
29666
- for (const d of arr) {
29665
+ for (const arr2 of defs.values()) {
29666
+ for (const d of arr2) {
29667
29667
  entries.set(keyOf2(d.name, d.file), {
29668
29668
  name: d.name,
29669
29669
  file: d.file,
@@ -29801,9 +29801,9 @@ function buildSymbolIndex(scan2, refs = /* @__PURE__ */ new Map(), schemaVersion
29801
29801
  const defsByName = /* @__PURE__ */ new Map();
29802
29802
  for (const f of scan2.files) {
29803
29803
  for (const s of f.symbols) {
29804
- let arr = defsByName.get(s.name);
29805
- if (!arr) defsByName.set(s.name, arr = []);
29806
- arr.push({
29804
+ let arr2 = defsByName.get(s.name);
29805
+ if (!arr2) defsByName.set(s.name, arr2 = []);
29806
+ arr2.push({
29807
29807
  file: s.file,
29808
29808
  line: s.line,
29809
29809
  ...s.endLine !== void 0 ? { endLine: s.endLine } : {},
@@ -29849,9 +29849,9 @@ function buildCallerIndex(scan2, importPairs, opts = {}) {
29849
29849
  if (!s.exported || REFERENCE_KINDS2.has(s.kind)) continue;
29850
29850
  if (seen.has(s.name)) continue;
29851
29851
  seen.add(s.name);
29852
- let arr = defs.get(s.name);
29853
- if (!arr) defs.set(s.name, arr = []);
29854
- arr.push(s);
29852
+ let arr2 = defs.get(s.name);
29853
+ if (!arr2) defs.set(s.name, arr2 = []);
29854
+ arr2.push(s);
29855
29855
  }
29856
29856
  }
29857
29857
  const defsByFamily = /* @__PURE__ */ new Map();
@@ -29943,9 +29943,9 @@ function buildRawCallerIndex(scan2) {
29943
29943
  if (c2.receiver !== void 0) site.receiver = c2.receiver;
29944
29944
  const enc = enclosingAmong(symbols, c2.line);
29945
29945
  if (enc) site.enclosingSymbol = enc;
29946
- let arr = byName.get(c2.name);
29947
- if (!arr) byName.set(c2.name, arr = []);
29948
- arr.push(site);
29946
+ let arr2 = byName.get(c2.name);
29947
+ if (!arr2) byName.set(c2.name, arr2 = []);
29948
+ arr2.push(site);
29949
29949
  }
29950
29950
  }
29951
29951
  const index = /* @__PURE__ */ new Map();
@@ -29997,9 +29997,9 @@ function buildSymbolGraph(scan2, importPairs) {
29997
29997
  const key2 = `${s.name} ${s.file}`;
29998
29998
  if (defSeen.has(key2)) continue;
29999
29999
  defSeen.add(key2);
30000
- let arr = defs.get(s.name);
30001
- if (!arr) defs.set(s.name, arr = []);
30002
- arr.push(s);
30000
+ let arr2 = defs.get(s.name);
30001
+ if (!arr2) defs.set(s.name, arr2 = []);
30002
+ arr2.push(s);
30003
30003
  }
30004
30004
  perFile.set(f.rel, usable);
30005
30005
  }
@@ -30251,12 +30251,12 @@ function buildStemIndex(docs) {
30251
30251
  seen.add(term);
30252
30252
  const stem = stemOf(term);
30253
30253
  if (stem === term) continue;
30254
- let arr = index.get(stem);
30255
- if (!arr) index.set(stem, arr = []);
30256
- arr.push(term);
30254
+ let arr2 = index.get(stem);
30255
+ if (!arr2) index.set(stem, arr2 = []);
30256
+ arr2.push(term);
30257
30257
  }
30258
30258
  }
30259
- for (const arr of index.values()) arr.sort(byStr);
30259
+ for (const arr2 of index.values()) arr2.sort(byStr);
30260
30260
  return index;
30261
30261
  }
30262
30262
  function buildTrigramIndex(docs) {
@@ -32119,9 +32119,9 @@ var init_surprise = __esm({
32119
32119
  DEP_KINDS = /* @__PURE__ */ new Set(["import", "call", "use"]);
32120
32120
  }
32121
32121
  });
32122
- function sortObject(obj) {
32122
+ function sortObject(obj2) {
32123
32123
  const out2 = {};
32124
- for (const k of Object.keys(obj).sort(byStr)) out2[k] = obj[k];
32124
+ for (const k of Object.keys(obj2).sort(byStr)) out2[k] = obj2[k];
32125
32125
  return out2;
32126
32126
  }
32127
32127
  function renderGraphJson(graph) {
@@ -34878,9 +34878,9 @@ async function callTool(name2, args2, defaultRepo) {
34878
34878
  const entry2 = index.get(lookup2);
34879
34879
  return JSON.stringify(entry2 ?? { error: `no tracked callers for "${lookup2}"` }, null, 2);
34880
34880
  }
34881
- const obj = {};
34882
- for (const [k, v] of index) obj[k] = v;
34883
- return JSON.stringify(obj, null, 2);
34881
+ const obj2 = {};
34882
+ for (const [k, v] of index) obj2[k] = v;
34883
+ return JSON.stringify(obj2, null, 2);
34884
34884
  }
34885
34885
  if (name2 === "workspaces") {
34886
34886
  const info2 = detectWorkspaces(repo);
@@ -35101,9 +35101,9 @@ async function callTool(name2, args2, defaultRepo) {
35101
35101
  const hierarchy = hierarchyFor(readScan());
35102
35102
  const wanted = str(args2.name);
35103
35103
  if (!wanted) {
35104
- const obj = {};
35105
- for (const [key2, entry22] of hierarchy) obj[key2] = entry22;
35106
- return JSON.stringify(obj, null, 2);
35104
+ const obj2 = {};
35105
+ for (const [key2, entry22] of hierarchy) obj2[key2] = entry22;
35106
+ return JSON.stringify(obj2, null, 2);
35107
35107
  }
35108
35108
  const entry2 = hierarchy.get(wanted);
35109
35109
  if (!entry2) return JSON.stringify({ error: `no type named ${wanted}` }, null, 2);
@@ -36117,9 +36117,9 @@ function renderScip(scan2, opts = {}) {
36117
36117
  const symbolString = makeUnique(baseSymbol(f.rel, sym), sym.line, used);
36118
36118
  entries.push({ sym, symbolString });
36119
36119
  if (sym.exported && !REFERENCE_KINDS6.has(sym.kind)) {
36120
- let arr = defByName.get(sym.name);
36121
- if (!arr) defByName.set(sym.name, arr = []);
36122
- arr.push({ symbolString, family: familyOf2(sym.lang) });
36120
+ let arr2 = defByName.get(sym.name);
36121
+ if (!arr2) defByName.set(sym.name, arr2 = []);
36122
+ arr2.push({ symbolString, family: familyOf2(sym.lang) });
36123
36123
  }
36124
36124
  }
36125
36125
  docDefs.set(f.rel, entries);
@@ -36233,11 +36233,11 @@ function dependentsOf(edges) {
36233
36233
  const map = /* @__PURE__ */ new Map();
36234
36234
  for (const e of edges) {
36235
36235
  if (e.dangling || !DEPENDS_KINDS.has(e.kind)) continue;
36236
- let arr = map.get(e.to);
36237
- if (!arr) map.set(e.to, arr = []);
36238
- arr.push(e);
36236
+ let arr2 = map.get(e.to);
36237
+ if (!arr2) map.set(e.to, arr2 = []);
36238
+ arr2.push(e);
36239
36239
  }
36240
- for (const arr of map.values()) arr.sort((a, b) => byStr(a.from, b.from));
36240
+ for (const arr2 of map.values()) arr2.sort((a, b) => byStr(a.from, b.from));
36241
36241
  dependentsMemo.set(edges, { length: edges.length, map });
36242
36242
  return map;
36243
36243
  }
@@ -36259,8 +36259,8 @@ function adjacencyOf(edges, kinds) {
36259
36259
  degree.set(e.from, (degree.get(e.from) ?? 0) + 1);
36260
36260
  degree.set(e.to, (degree.get(e.to) ?? 0) + 1);
36261
36261
  }
36262
- for (const arr of out2.values()) arr.sort((a, b) => byStr(a.to, b.to));
36263
- for (const arr of inn.values()) arr.sort((a, b) => byStr(a.from, b.from));
36262
+ for (const arr2 of out2.values()) arr2.sort((a, b) => byStr(a.to, b.to));
36263
+ for (const arr2 of inn.values()) arr2.sort((a, b) => byStr(a.from, b.from));
36264
36264
  const adj = { out: out2, inn, degree, threshold: hubThreshold([...degree.values()]) };
36265
36265
  entry2.views.set(viewKey, adj);
36266
36266
  return adj;
@@ -36409,12 +36409,12 @@ function computeDelta(graph, symbols, diff, depth = DEFAULT_DELTA_DEPTH) {
36409
36409
  if (symbols) {
36410
36410
  for (const [name2, entries] of Object.entries(symbols.defs)) {
36411
36411
  for (const d of entries) {
36412
- let arr = defsByFile.get(d.file);
36413
- if (!arr) defsByFile.set(d.file, arr = []);
36414
- arr.push({ name: name2, ...d });
36412
+ let arr2 = defsByFile.get(d.file);
36413
+ if (!arr2) defsByFile.set(d.file, arr2 = []);
36414
+ arr2.push({ name: name2, ...d });
36415
36415
  }
36416
36416
  }
36417
- for (const arr of defsByFile.values()) arr.sort((a, b) => a.line - b.line || byStr(a.name, b.name));
36417
+ for (const arr2 of defsByFile.values()) arr2.sort((a, b) => a.line - b.line || byStr(a.name, b.name));
36418
36418
  }
36419
36419
  const deleted = [];
36420
36420
  const unindexed = [];
@@ -36463,9 +36463,9 @@ function computeDelta(graph, symbols, diff, depth = DEFAULT_DELTA_DEPTH) {
36463
36463
  const byModule = /* @__PURE__ */ new Map();
36464
36464
  for (const c2 of changes) {
36465
36465
  if (c2.status === "deleted" || !c2.module) continue;
36466
- let arr = byModule.get(c2.module);
36467
- if (!arr) byModule.set(c2.module, arr = []);
36468
- arr.push(c2);
36466
+ let arr2 = byModule.get(c2.module);
36467
+ if (!arr2) byModule.set(c2.module, arr2 = []);
36468
+ arr2.push(c2);
36469
36469
  }
36470
36470
  const nonTestCode = /* @__PURE__ */ new Set();
36471
36471
  for (const f of graph.files) {
@@ -37079,12 +37079,12 @@ async function runCli(rawArgv) {
37079
37079
  const outDir = flags2.out;
37080
37080
  mkdirSync3(outDir, { recursive: true });
37081
37081
  const cachePath = join22(outDir, "cache.json");
37082
- let cache;
37082
+ let cache2;
37083
37083
  let meta2 = {};
37084
37084
  try {
37085
37085
  const parsed = JSON.parse(readFileSync13(cachePath, "utf8"));
37086
37086
  if (parsed.schemaVersion === SCHEMA_VERSION2 && parsed.extractorVersion === EXTRACTOR_VERSION) {
37087
- cache = new Map(Object.entries(parsed.files));
37087
+ cache2 = new Map(Object.entries(parsed.files));
37088
37088
  meta2 = {
37089
37089
  engineVersion: parsed.engineVersion,
37090
37090
  commit: parsed.commit,
@@ -37098,7 +37098,7 @@ async function runCli(rawArgv) {
37098
37098
  await warmPresentGrammars();
37099
37099
  const scan2 = await scanRepoParallel(flags2.repo, {
37100
37100
  ...scanOptions(flags2, precomputedWalk),
37101
- cache,
37101
+ cache: cache2,
37102
37102
  out: outDir,
37103
37103
  workers: flags2.workers
37104
37104
  });
@@ -37192,9 +37192,9 @@ async function runCli(rawArgv) {
37192
37192
  } else if (cmd === "callers") {
37193
37193
  const scan2 = await readScan();
37194
37194
  const index = buildCallerIndex(scan2, void 0, { recall: flags2.recall });
37195
- const obj = {};
37196
- for (const [name2, entry2] of index) obj[name2] = entry2;
37197
- emit(JSON.stringify(obj, null, 2) + "\n", flags2.out);
37195
+ const obj2 = {};
37196
+ for (const [name2, entry2] of index) obj2[name2] = entry2;
37197
+ emit(JSON.stringify(obj2, null, 2) + "\n", flags2.out);
37198
37198
  } else if (cmd === "hierarchy") {
37199
37199
  const scan2 = await readScan();
37200
37200
  const hierarchy = buildTypeHierarchy(scan2, computeImportPairs(scan2));
@@ -37203,9 +37203,9 @@ async function runCli(rawArgv) {
37203
37203
  if (!entry2) throw new Error(`no type named ${flags2.positional}`);
37204
37204
  emit(JSON.stringify(entry2, null, 2) + "\n", flags2.out);
37205
37205
  } else {
37206
- const obj = {};
37207
- for (const [key2, entry2] of hierarchy) obj[key2] = entry2;
37208
- emit(JSON.stringify(obj, null, 2) + "\n", flags2.out);
37206
+ const obj2 = {};
37207
+ for (const [key2, entry2] of hierarchy) obj2[key2] = entry2;
37208
+ emit(JSON.stringify(obj2, null, 2) + "\n", flags2.out);
37209
37209
  }
37210
37210
  } else if (cmd === "implementations") {
37211
37211
  if (!flags2.positional) throw new Error("implementations needs a type name: cli.mjs implementations <Name> --repo <dir>");
@@ -37844,47 +37844,258 @@ function actionTimeout(limits, deadline) {
37844
37844
  const left = deadline ? deadline.left() : limits.actionTimeoutMs;
37845
37845
  return Math.max(1, Math.min(limits.actionTimeoutMs, left || limits.actionTimeoutMs));
37846
37846
  }
37847
- var REFLOW_PROBE = `(() => {
37847
+ var DEV_TOOL_HOSTS = ["nextjs-portal", "vite-error-overlay", "astro-dev-toolbar", "nuxt-devtools-container", "nuxt-devtools"];
37848
+ var FRAMES = `
37849
+ const __frames = () => new Promise((res) => {
37850
+ let done = false;
37851
+ const end = () => { if (!done) { done = true; res(true); } };
37852
+ setTimeout(end, 200);
37853
+ try { requestAnimationFrame(() => requestAnimationFrame(end)); } catch { end(); }
37854
+ });
37855
+ `;
37856
+ var REFLOW_PROBE = `(async () => { ${PRELUDE} ${FRAMES}
37857
+ await __frames();
37848
37858
  const el = document.scrollingElement || document.documentElement;
37849
- return { horizontalScroll: el.scrollWidth > el.clientWidth + 2 };
37850
- })()`;
37851
- var REFLOW_ZOOM_PROBE = `(() => { ${PRELUDE}
37852
- const root = document.documentElement;
37853
- const prev = root.style.fontSize;
37854
- root.style.fontSize = '200%';
37855
- const hits = [];
37856
- for (const e of Array.from(document.querySelectorAll('p,li,h1,h2,h3,h4,h5,h6,td,th,button,a,label,span'))) {
37857
- if (!__vis(e)) continue;
37858
- if ((e.textContent || '').trim().length < 8) continue;
37859
+ const vw = el.clientWidth;
37860
+ const horizontalScroll = el.scrollWidth > vw + 2;
37861
+ if (!horizontalScroll) return { horizontalScroll };
37862
+ const sx = window.scrollX || 0;
37863
+ const contained = (e) => {
37864
+ for (let n = e.parentElement; n && n !== document.body && n !== document.documentElement; n = n.parentElement) {
37865
+ if (getComputedStyle(n).overflowX !== 'visible') return true;
37866
+ }
37867
+ return false;
37868
+ };
37869
+ const boxes = new Set();
37870
+ const outer = [];
37871
+ const content = [];
37872
+ for (const e of Array.from(document.querySelectorAll('body, body *'))) {
37873
+ const r = e.getBoundingClientRect();
37874
+ if (r.width <= 0 || r.height <= 0) continue;
37859
37875
  const s = getComputedStyle(e);
37860
- const clip = s.overflow === 'hidden' || s.overflowY === 'hidden' || s.overflowX === 'hidden';
37861
- const noWrap = s.whiteSpace === 'nowrap' || s.textOverflow === 'ellipsis';
37862
- if ((clip || noWrap) && (e.scrollHeight > e.clientHeight + 6 || e.scrollWidth > e.clientWidth + 6)) {
37863
- hits.push({ selector: __sel(e), html: __html(e), detail: 'Texte tronqu\xE9/masqu\xE9 \xE0 200% (conteneur overflow:hidden / nowrap) \u2014 perte de contenu au zoom (1.4.4).' });
37876
+ if (s.position === 'fixed' || s.display === 'none' || s.visibility === 'hidden') continue;
37877
+ const boxOver = r.right + sx - vw;
37878
+ const contentOver = s.overflowX === 'visible' ? r.left + sx + e.scrollWidth - vw : 0;
37879
+ if (boxOver <= 2 && contentOver <= 2) continue;
37880
+ if (contained(e)) continue;
37881
+ if (boxOver > 2) {
37882
+ boxes.add(e);
37883
+ let top = true;
37884
+ for (let n = e.parentElement; n; n = n.parentElement) if (boxes.has(n)) { top = false; break; }
37885
+ if (top) outer.push([e, 'd\xE9borde de ' + Math.round(boxOver) + 'px \xE0 droite (largeur ' + Math.round(r.width) + 'px)']);
37886
+ } else {
37887
+ content.push([e, 'son contenu (texte ou pseudo-\xE9l\xE9ment) d\xE9borde de ' + Math.round(contentOver) + 'px \xE0 droite de la bo\xEEte']);
37864
37888
  }
37865
- if (hits.length >= 12) break;
37866
37889
  }
37867
- root.style.fontSize = prev;
37868
- return hits;
37890
+ // A box wider than the viewport is the cause; failing one, the DEEPEST element whose own
37891
+ // content (a long word, a ::before/::after) spills out \u2014 its ancestors only carry the spill.
37892
+ const deepest = content.filter(([e]) => !content.some(([o]) => o !== e && e.contains(o)) && !Array.from(boxes).some((b) => e.contains(b)));
37893
+ const widening = outer.concat(deepest).slice(0, 5).map(([e, d]) => ({ selector: __sel(e), html: __html(e), detail: d }));
37894
+ return { horizontalScroll, widening };
37869
37895
  })()`;
37870
- var TEXT_SPACING_CSS = "* { line-height: 1.5 !important; letter-spacing: 0.12em !important; word-spacing: 0.16em !important; } p { margin-bottom: 2em !important; }";
37871
- var TEXT_SPACING_PROBE = `(() => { ${PRELUDE}
37872
- const hits = [];
37873
- for (const e of Array.from(document.querySelectorAll('p,li,span,a,button,h1,h2,h3,h4,h5,h6,td,th,label,div'))) {
37896
+ var STRESS_LIB = `${FRAMES}
37897
+ const __pause = (ms) => new Promise((res) => setTimeout(res, ms));
37898
+ const __CONTROLS = 'a[href],button,input:not([type=hidden]),select,textarea,summary,[role=button],[role=link],[role=checkbox],[role=radio],[role=tab],[role=switch],[tabindex]:not([tabindex="-1"])';
37899
+ // How far the element's CONTENT \u2014 its text and its child boxes, as laid out \u2014 reaches past the
37900
+ // padding box its overflow clips at. Not \`scrollWidth\`: that counts a child's margin too, and
37901
+ // the spacing override gives every paragraph a 2em bottom margin, so a panel sized to its text
37902
+ // would read as \xAB clipped \xBB by a margin nobody can see. And not one Range over the whole
37903
+ // subtree either: an sr-only label is a 1px clipped box whose text is still laid out at full
37904
+ // width, and counting that text would call every icon-only button \xAB clipped \xBB. A descendant
37905
+ // that is not painted is skipped with everything inside it; one that clips its own overflow
37906
+ // counts by its own box, its content being its own measurement; a panel's padding is not
37907
+ // content, so a design system's tab container trimming its panel's bottom padding is not a loss.
37908
+ const __REPLACED = ['img', 'svg', 'video', 'canvas', 'iframe', 'object', 'embed', 'input', 'select', 'textarea', 'button', 'meter', 'progress', 'audio'];
37909
+ const __extent = (e) => {
37910
+ let l = Infinity, t = Infinity, r = -Infinity, b = -Infinity;
37911
+ const add = (q) => { if (!q || (!q.width && !q.height)) return; l = Math.min(l, q.left); t = Math.min(t, q.top); r = Math.max(r, q.right); b = Math.max(b, q.bottom); };
37912
+ const range = document.createRange();
37913
+ const walk = (n, depth) => {
37914
+ for (const c of Array.from(n.childNodes)) {
37915
+ if (c.nodeType === 3) {
37916
+ if (!c.textContent || !c.textContent.trim()) continue;
37917
+ range.selectNodeContents(c);
37918
+ add(range.getBoundingClientRect());
37919
+ } else if (c.nodeType === 1) {
37920
+ const cs = getComputedStyle(c);
37921
+ if (cs.display === 'contents') { if (depth < 40) walk(c, depth + 1); continue; }
37922
+ if (!__vis(c)) continue;
37923
+ // CONTENT, not decoration: a replaced element or a form control counts by its box, a
37924
+ // box that clips counts by its box; any other element only through what it holds \u2014 its
37925
+ // padding, its background and its margins are nothing a reader can lose.
37926
+ if (__REPLACED.indexOf(c.localName) >= 0 || cs.overflowX !== 'visible' || cs.overflowY !== 'visible') add(c.getBoundingClientRect());
37927
+ else if (depth < 40) walk(c, depth + 1);
37928
+ }
37929
+ }
37930
+ };
37931
+ walk(e, 0);
37932
+ return l === Infinity ? null : { left: l, top: t, right: r, bottom: b, width: r - l, height: b - t };
37933
+ };
37934
+ const __excess = (e) => {
37935
+ const r = e.getBoundingClientRect();
37936
+ const left = r.left + e.clientLeft, top = r.top + e.clientTop;
37937
+ const right = left + e.clientWidth, bottom = top + e.clientHeight;
37938
+ const t = __extent(e);
37939
+ if (!t) return { x: 0, y: 0, sw: 1, sh: 1 };
37940
+ return {
37941
+ x: Math.max(0, t.right - right) + Math.max(0, left - t.left),
37942
+ y: Math.max(0, t.bottom - bottom) + Math.max(0, top - t.top),
37943
+ sw: Math.max(1, t.width),
37944
+ sh: Math.max(1, t.height),
37945
+ };
37946
+ };
37947
+ const __clipsX = (s) => s.overflowX === 'hidden' || s.overflowX === 'clip' || s.overflow === 'hidden' || s.textOverflow === 'ellipsis';
37948
+ const __clipsY = (s) => s.overflowY === 'hidden' || s.overflowY === 'clip' || s.overflow === 'hidden';
37949
+ const __clipBase = (sel) => {
37950
+ const m = new Map();
37951
+ for (const e of Array.from(document.querySelectorAll(sel))) {
37874
37952
  if (!__vis(e)) continue;
37875
37953
  if ((e.textContent || '').trim().length < 8) continue;
37954
+ // Only a box that CLIPS can lose content by clipping, and the stress changes spacing and
37955
+ // size, never a box's overflow \u2014 so the rest of the page is not measured at all.
37876
37956
  const s = getComputedStyle(e);
37877
- const clipped = (s.overflowX === 'hidden' || s.overflowY === 'hidden' || s.overflow === 'hidden') && (e.scrollHeight > e.clientHeight + 2 || e.scrollWidth > e.clientWidth + 2);
37878
- const ellipsis = s.textOverflow === 'ellipsis' && e.scrollWidth > e.clientWidth + 2;
37879
- if (clipped || ellipsis) {
37880
- // No criterion id in the text: every rendering already names the criterion this finding
37881
- // belongs to, and a hard-coded \xAB 1.4.12 \xBB is a WCAG number appearing inside a deliverable
37882
- // that may be keyed on another standard entirely.
37883
- hits.push({ selector: __sel(e), html: __html(e), detail: 'Texte tronqu\xE9/masqu\xE9 sous l\\'espacement de texte impos\xE9 \u2014 perte de contenu.' });
37884
- }
37885
- if (hits.length >= 20) break;
37957
+ if (!__clipsX(s) && !__clipsY(s)) continue;
37958
+ m.set(e, { ...__excess(e), slack: (parseFloat(s.fontSize) || 16) / 2 });
37959
+ }
37960
+ return m;
37961
+ };
37962
+ const __clipLost = (e, b, tol) => {
37963
+ if (!e.isConnected || !__vis(e)) return false;
37964
+ const s = getComputedStyle(e);
37965
+ const now = __excess(e);
37966
+ // Whole at baseline: any cut the stress makes is a loss. Cut by up to half a glyph (a fixed
37967
+ // box shaving its descenders): the stress must cut MORE, in pixels and as a share of the
37968
+ // content \u2014 a box sized in rem that hides a sliver at 100 % hides the same share at 200 %.
37969
+ // Cut by more than that: hidden by design, never reported.
37970
+ const lost = (clips, b0, s0, n0, s1) => {
37971
+ if (!clips || n0 <= tol) return false;
37972
+ if (b0 <= tol) return true;
37973
+ if (b0 > Math.max(tol, b.slack)) return false;
37974
+ return n0 - b0 > tol && n0 / s1 - b0 / s0 > 0.05;
37975
+ };
37976
+ return lost(__clipsX(s), b.x, b.sw, now.x, now.sw) || lost(__clipsY(s), b.y, b.sh, now.y, now.sh);
37977
+ };
37978
+ const __up = (n) => n.parentElement || (n.getRootNode && n.getRootNode() instanceof ShadowRoot ? n.getRootNode().host : null);
37979
+ const __within = (n, e) => { for (; n; n = __up(n)) if (n === e) return true; return false; };
37980
+ const __fixedish = (n) => {
37981
+ for (; n && n !== document.documentElement; n = __up(n)) {
37982
+ if (${JSON.stringify(DEV_TOOL_HOSTS)}.indexOf((n.localName || '').toLowerCase()) >= 0) return true;
37983
+ const p = getComputedStyle(n).position;
37984
+ if (p === 'fixed' || p === 'sticky') return true;
37985
+ }
37986
+ return false;
37987
+ };
37988
+ const __topAt = (e) => {
37989
+ let r = e.getBoundingClientRect();
37990
+ if (r.width < 1 || r.height < 1) return undefined;
37991
+ const inView = (r) => {
37992
+ const x = r.left + r.width / 2, y = r.top + r.height / 2;
37993
+ return x >= 0 && y >= 0 && x < window.innerWidth && y < window.innerHeight;
37994
+ };
37995
+ if (!inView(r)) {
37996
+ window.scrollTo({ left: Math.max(0, window.scrollX + r.left + r.width / 2 - window.innerWidth / 2), top: Math.max(0, window.scrollY + r.top + r.height / 2 - window.innerHeight / 2), behavior: 'instant' });
37997
+ r = e.getBoundingClientRect();
37998
+ if (!inView(r)) return undefined;
37999
+ }
38000
+ const x = r.left + r.width / 2, y = r.top + r.height / 2;
38001
+ let t = document.elementFromPoint(x, y);
38002
+ // Into open shadow roots: the host is not what sits on top, its rendered content is \u2014 and a
38003
+ // dev-tools overlay's fixed layer lives in there.
38004
+ for (let i = 0; t && t.shadowRoot && i < 8; i++) {
38005
+ const d = t.shadowRoot.elementFromPoint(x, y);
38006
+ if (!d || d === t) break;
38007
+ t = d;
38008
+ }
38009
+ if (!t) return undefined;
38010
+ if (__within(t, e)) return null;
38011
+ if (t.tagName === 'LABEL' && t.control === e) return null;
38012
+ if (__within(e, t)) return undefined;
38013
+ return t;
38014
+ };
38015
+ const __hitBase = () => {
38016
+ const m = new Set();
38017
+ for (const e of Array.from(document.querySelectorAll(__CONTROLS))) {
38018
+ if (!__vis(e)) continue;
38019
+ if (__topAt(e) === null) m.add(e);
38020
+ }
38021
+ return m;
38022
+ };
38023
+ const __covered = (e) => {
38024
+ if (!e.isConnected || !__vis(e)) return null;
38025
+ const t = __topAt(e);
38026
+ if (!t || __fixedish(t)) return null;
38027
+ return t;
38028
+ };
38029
+ const __compare = async (base, tol, clipDetail, coverDetail, max) => {
38030
+ const look = () => {
38031
+ const clip = [];
38032
+ for (const [e, b] of base.clip) if (__clipLost(e, b, tol)) clip.push(e);
38033
+ const cover = [];
38034
+ for (const e of base.hit) { const t = __covered(e); if (t) cover.push([e, t]); }
38035
+ return { clip, cover };
38036
+ };
38037
+ await __frames();
38038
+ let first = look();
38039
+ if (first.clip.length || first.cover.length) {
38040
+ await __pause(150);
38041
+ await __frames();
38042
+ const again = look();
38043
+ const stillClip = new Set(again.clip);
38044
+ const stillCover = new Map(again.cover);
38045
+ first = { clip: first.clip.filter((e) => stillClip.has(e)), cover: first.cover.filter(([e]) => stillCover.has(e)).map(([e]) => [e, stillCover.get(e)]) };
38046
+ }
38047
+ const hits = [];
38048
+ for (const e of first.clip) {
38049
+ if (hits.length >= max) break;
38050
+ hits.push({ selector: __sel(e), html: __html(e), detail: clipDetail });
38051
+ }
38052
+ for (const [e, t] of first.cover) {
38053
+ if (hits.length >= max) break;
38054
+ hits.push({ selector: __sel(e), html: __html(e), detail: coverDetail.replace('{by}', __sel(t)) });
37886
38055
  }
37887
38056
  return hits;
38057
+ };
38058
+ `;
38059
+ var REFLOW_ZOOM_PROBE = `(async () => { ${PRELUDE} ${STRESS_LIB}
38060
+ const root = document.documentElement;
38061
+ const prev = root.style.fontSize;
38062
+ const sx = window.scrollX, sy = window.scrollY;
38063
+ const base = { clip: __clipBase('p,li,h1,h2,h3,h4,h5,h6,td,th,button,a,label,span,div'), hit: __hitBase() };
38064
+ window.scrollTo({ left: sx, top: sy, behavior: 'instant' });
38065
+ root.style.fontSize = '200%';
38066
+ try {
38067
+ return await __compare(base, 6,
38068
+ 'Texte tronqu\xE9/masqu\xE9 \xE0 200 % alors qu\\'il \xE9tait enti\xE8rement visible au rendu normal \u2014 perte de contenu au zoom.',
38069
+ 'Contr\xF4le recouvert par {by} \xE0 200 % alors qu\\'il ne l\\'\xE9tait pas au rendu normal \u2014 chevauchement, le contr\xF4le n\\'est plus atteignable \xE0 cet endroit.',
38070
+ 12);
38071
+ } finally {
38072
+ root.style.fontSize = prev;
38073
+ window.scrollTo({ left: sx, top: sy, behavior: 'instant' });
38074
+ }
38075
+ })()`;
38076
+ var TEXT_SPACING_CSS = "* { line-height: 1.5 !important; letter-spacing: 0.12em !important; word-spacing: 0.16em !important; } p { margin-bottom: 2em !important; }";
38077
+ var TEXT_SPACING_BASELINE_STEP = `(() => { ${PRELUDE} ${STRESS_LIB}
38078
+ const sx = window.scrollX, sy = window.scrollY;
38079
+ window.__u11ySpacingBase = { clip: __clipBase('p,li,span,a,button,h1,h2,h3,h4,h5,h6,td,th,label,div'), hit: __hitBase() };
38080
+ window.scrollTo({ left: sx, top: sy, behavior: 'instant' });
38081
+ return true;
38082
+ })()`;
38083
+ var TEXT_SPACING_PROBE = `(async () => { ${PRELUDE} ${STRESS_LIB}
38084
+ const base = window.__u11ySpacingBase;
38085
+ delete window.__u11ySpacingBase;
38086
+ if (!base) throw new Error('ultra11y: the text-spacing baseline was not recorded before the override, so nothing can be compared');
38087
+ const sx = window.scrollX, sy = window.scrollY;
38088
+ try {
38089
+ // No criterion id in the text: every rendering already names the criterion this finding
38090
+ // belongs to, and a hard-coded \xAB 1.4.12 \xBB is a WCAG number appearing inside a deliverable
38091
+ // that may be keyed on another standard entirely.
38092
+ return await __compare(base, 2,
38093
+ 'Texte tronqu\xE9/masqu\xE9 sous l\\'espacement de texte impos\xE9 alors qu\\'il \xE9tait enti\xE8rement visible au rendu normal \u2014 perte de contenu.',
38094
+ 'Contr\xF4le recouvert par {by} sous l\\'espacement de texte impos\xE9 alors qu\\'il ne l\\'\xE9tait pas au rendu normal \u2014 chevauchement, le contr\xF4le n\\'est plus atteignable \xE0 cet endroit.',
38095
+ 20);
38096
+ } finally {
38097
+ window.scrollTo({ left: sx, top: sy, behavior: 'instant' });
38098
+ }
37888
38099
  })()`;
37889
38100
  function focusSetupExpr(scope = "", maxFocusables = PROBE_DEFAULTS.maxFocusables) {
37890
38101
  const rootExpr = scope ? `document.querySelectorAll(${JSON.stringify(scope)})` : `[document.documentElement]`;
@@ -37967,7 +38178,6 @@ function focusSetupExpr(scope = "", maxFocusables = PROBE_DEFAULTS.maxFocusables
37967
38178
  return { n: n, total: total };
37968
38179
  })()`;
37969
38180
  }
37970
- var DEV_TOOL_HOSTS = ["nextjs-portal", "vite-error-overlay", "astro-dev-toolbar", "nuxt-devtools-container", "nuxt-devtools"];
37971
38181
  var FOCUS_CHECK_PROBE = `(() => {
37972
38182
  const e = document.activeElement;
37973
38183
  // FOCUS LEFT THE DOCUMENT \u2014 the normal end of a tab ring, and nothing to measure.
@@ -39955,10 +40165,13 @@ var MSG_CATALOG = {
39955
40165
  // (set in mergeDynamic) so a LATER `report`/`prd --lang` re-render can still
39956
40166
  // resolve the OTHER language, instead of staying stuck in whatever language was
39957
40167
  // baked at merge/scan time.
40168
+ // `widening` — the selectors of the boxes the probe found wider than the viewport. Absent on a
40169
+ // finding recorded before the probe named causes, or by a producer that did not look: the sentence then states
40170
+ // the scroll and nothing else, never a cause nobody measured.
39958
40171
  "dyn-reflow": {
39959
40172
  message: {
39960
- fr: () => `D\xE9filement horizontal \xE0 320px de large \u2014 le contenu ne se redistribue pas (reflow).`,
39961
- en: () => `Horizontal scrolling at 320px width \u2014 content does not reflow.`
40173
+ fr: (p) => `D\xE9filement horizontal \xE0 320px de large${p.widening ? ` \u2014 la page est \xE9largie par ${String(p.widening)}` : ""}.`,
40174
+ en: (p) => `Horizontal scrolling at 320px width${p.widening ? ` \u2014 the page is widened by ${String(p.widening)}` : ""}.`
39962
40175
  },
39963
40176
  remediation: {
39964
40177
  fr: () => `V\xE9rifi\xE9 au rendu par axe-core ; corrigez l'\xE9l\xE9ment cit\xE9.`,
@@ -48424,6 +48637,67 @@ function pdfDocumentAnchor(doc) {
48424
48637
  }
48425
48638
  var declsText = (decls) => Object.entries(decls).map(([k, v]) => `${k}: ${v}`).join("; ").slice(0, 100);
48426
48639
  var t = (el, n = 60) => textContent(el).trim().replace(/\s+/g, " ").slice(0, n);
48640
+ var NON_RENDERED_TAGS = /* @__PURE__ */ new Set(["script", "style", "template", "noscript"]);
48641
+ var inNonRendered = (e) => NON_RENDERED_TAGS.has(e.tag) || e.tag === "head" || ancestors(e).some((a) => NON_RENDERED_TAGS.has(a.tag) || a.tag === "head");
48642
+ function literalOfContainer(raw) {
48643
+ const m = /^\{\s*(?:"((?:[^"\\]|\\.)*)"|'((?:[^'\\]|\\.)*)'|`((?:[^`\\$]|\\.|\$(?!\{))*)`)\s*\}$/s.exec(raw);
48644
+ if (!m) return void 0;
48645
+ return (m[1] ?? m[2] ?? m[3] ?? "").replace(/\\(.)/g, "$1");
48646
+ }
48647
+ function stripExpressions(s) {
48648
+ let out2 = "";
48649
+ let depth = 0;
48650
+ let start2 = 0;
48651
+ for (let i2 = 0; i2 < s.length; i2++) {
48652
+ const c2 = s[i2];
48653
+ if (c2 === "{") {
48654
+ if (depth === 0) start2 = i2;
48655
+ depth++;
48656
+ } else if (c2 === "}" && depth > 0) {
48657
+ depth--;
48658
+ if (depth === 0) out2 += literalOfContainer(s.slice(start2, i2 + 1)) ?? " ";
48659
+ } else if (depth === 0) out2 += c2;
48660
+ }
48661
+ return out2;
48662
+ }
48663
+ function renderedData(doc, data2) {
48664
+ if (doc.kind === "jsx-ast") return data2.trimStart().startsWith("{") ? literalOfContainer(data2.trim()) ?? "" : data2;
48665
+ if (doc.kind === "jsx-lossy" || doc.kind === "sfc") return stripExpressions(data2);
48666
+ return data2;
48667
+ }
48668
+ function ownRenderedText(doc, el) {
48669
+ if (inNonRendered(el)) return "";
48670
+ return el.children.filter((c2) => c2.type === "text").map((c2) => renderedData(doc, c2.data)).join("").replace(/\s+/g, " ").trim();
48671
+ }
48672
+ function renderedText(doc, el) {
48673
+ const walk3 = (e) => {
48674
+ let out2 = "";
48675
+ for (const c2 of e.children) {
48676
+ if (c2.type === "text") out2 += renderedData(doc, c2.data);
48677
+ else if (!NON_RENDERED_TAGS.has(c2.tag)) out2 += walk3(c2);
48678
+ }
48679
+ return out2;
48680
+ };
48681
+ return inNonRendered(el) ? "" : walk3(el);
48682
+ }
48683
+ var rt = (doc, el, n = 60) => renderedText(doc, el).replace(/\s+/g, " ").trim().slice(0, n);
48684
+ var TEXT_PROP = /^(?:label|title|subtitle|description|desc|hint|hinttext|text|legend|message|caption|heading|helper|helpertext|instructiontext|content|placeholder|tooltip|summary|detail|details|explanation|notice)$/i;
48685
+ function textRuns(doc) {
48686
+ const out2 = [];
48687
+ const component = doc.kind === "jsx-ast" || doc.kind === "jsx-lossy" || doc.kind === "sfc";
48688
+ for (const e of doc.elements) {
48689
+ if (["title", "head", "html"].includes(e.tag) || inNonRendered(e)) continue;
48690
+ const own = ownRenderedText(doc, e);
48691
+ if (own) out2.push({ el: e, text: own });
48692
+ if (component && /^[A-Z]/.test(e.tag)) {
48693
+ for (const [name2, value] of Object.entries(e.attribs)) {
48694
+ if (!TEXT_PROP.test(name2) || typeof value !== "string" || value.trim() === "" || value.trim().startsWith("{")) continue;
48695
+ out2.push({ el: e, text: value.replace(/\s+/g, " ").trim() });
48696
+ }
48697
+ }
48698
+ }
48699
+ return out2;
48700
+ }
48427
48701
  function nearestHeading(doc, el) {
48428
48702
  const headings2 = elementsByTag(doc, "h1", "h2", "h3", "h4", "h5", "h6").filter((x) => x.start < el.start);
48429
48703
  const last = headings2[headings2.length - 1];
@@ -48512,7 +48786,7 @@ var CRYPTIC = new RegExp("\\p{Extended_Pictographic}|(?:^|\\s)[:;=][-']?[)(DPp/\
48512
48786
  var TEMPORAL_MEDIA_HOST = /(youtube|youtu\.be|vimeo|dailymotion|soundcloud|spotify|twitch|wistia|brightcove|jwplayer|videopress|podcast|player|vid[eé]o|audio|baladodiffusion|\.(?:mp4|webm|ogv|ogg|mov|m4v|mp3|wav|m4a|m3u8))/i;
48513
48787
  var TEMPORAL_MEDIA_VALUE = /(?:^|[/.?=&_-])(?:audio|video|player|podcast|mp[34]|webm|ogg|ogv|wav|m4a|mov|avi|mpeg)(?:$|[/.?=&_-])/i;
48514
48788
  var ROUTER_IMPORT = /['"](?:react-router(?:-dom)?|next\/(?:router|navigation)|vue-router|@remix-run\/[\w-]+|@tanstack\/[\w-]*router|@sveltejs\/kit|\$app\/(?:navigation|stores))['"]/;
48515
- var FOREIGN_LEXICON = /\b(?:the|and|with|your|about|please|download|settings|welcome|dashboard|overview|read more|learn more|sign in|sign up|log in|get started|coming soon|powered by)\b/i;
48789
+ var FOREIGN_LEXICON = /(?<![\p{L}\p{N}_'’-])(?:the|and|with|your|you|our|we|this|that|these|those|from|for|of|to|is|are|was|were|will|would|should|can't|don't|do|does|not|here|there|what|which|who|how|why|when|about|please|download|settings|welcome|dashboard|overview|read more|learn more|sign in|sign up|log in|get started|coming soon|powered by)(?![\p{L}\p{N}_'’-])/iu;
48516
48790
  var CONTROL_TAGS = ["input", "select", "textarea"];
48517
48791
  var FIELD_TAGS = /* @__PURE__ */ new Set(["datalist", "output", "progress", "meter"]);
48518
48792
  var FIELD_ROLES = /* @__PURE__ */ new Set(["textbox", "searchbox", "combobox", "listbox", "checkbox", "radio", "switch", "slider", "spinbutton", "progressbar", "option"]);
@@ -48566,6 +48840,8 @@ function bulletParagraphRuns(doc) {
48566
48840
  }
48567
48841
  return out2;
48568
48842
  }
48843
+ var SITEMAP_ADDRESS = /plan[-_]du[-_]site|sitemap|site[-_]map/i;
48844
+ var SITEMAP_TEXT = /\bplan du site\b|\bsite ?map\b/i;
48569
48845
  var INTERACTIVE_TAGS = ["a", "button", "input", "select", "textarea", "summary", "details", "label"];
48570
48846
  function embeddedMediaKind(el) {
48571
48847
  const type = (attr(el, "type") ?? "").toLowerCase();
@@ -48581,6 +48857,13 @@ function labelFor(doc, el) {
48581
48857
  const wrapping = ancestors(el).find((a) => a.tag === "label");
48582
48858
  return wrapping ? t(wrapping, 40) : "";
48583
48859
  }
48860
+ function labelledByText(doc, el) {
48861
+ const ids2 = (attr(el, "aria-labelledby") ?? "").trim();
48862
+ if (ids2 === "" || ids2.startsWith("{")) return void 0;
48863
+ const parts2 = ids2.split(/\s+/).map((id) => doc.byId.get(id));
48864
+ if (parts2.some((p) => p === void 0)) return void 0;
48865
+ return parts2.map((p) => rt(doc, p, 60)).join(" ").slice(0, 80);
48866
+ }
48584
48867
  function labelElementTokens(doc, el) {
48585
48868
  const id = attr(el, "id");
48586
48869
  if (id && elementsByTag(doc, "label").some((l) => attr(l, "for") === id)) return ["label"];
@@ -48598,12 +48881,13 @@ function viewportMeta(d) {
48598
48881
  return h(d, m, `<meta name="viewport" content="${content}">${blocks ? " \u2014 RESTRICTS zoom" : ""}`, `viewport|${content}`);
48599
48882
  });
48600
48883
  }
48601
- function cssEvidence(d, re, captured, kind) {
48884
+ function cssEvidence(docs, d, re, captured, kind) {
48602
48885
  return [
48603
48886
  ...linesOf(d, re, 60).map((l) => hAt(d, l.line, "css", `${kind}-relevant declaration: ${l.text}`, `${kind}decl|${l.text}`)),
48604
- ...(d.signals?.css?.rules ?? []).filter(captured).slice(0, 40).map((r) => hAt(d, 1, `css:${r.selector}`, `captured rule: ${r.selector.slice(0, 60)} { ${declsText(r.decls)} }`, `${kind}css|${r.selector}`))
48887
+ ...pageRules(docs, d).filter(captured).slice(0, 40).map((r) => hAt(d, 1, `css:${r.selector}`, `captured rule: ${r.selector.slice(0, 60)} { ${declsText(r.decls)} }${r.where}`, `${kind}css|${r.selector}`))
48605
48888
  ];
48606
48889
  }
48890
+ var SENSORY = /(?<![\p{L}-])(?:ci-dessus|ci-dessous|à droite|a droite|à gauche|a gauche|bouton (?:vert|rouge|bleu)|en rouge|en vert|le carré|la case de droite|above|below|to the right|to the left|green button|red button|round button)(?![\p{L}-])/iu;
48607
48891
  var INSTRUCTION = /\b(?:cliquez|cliquer|sélectionnez|selectionnez|utilisez|appuyez|touchez|consultez|reportez-vous|remplissez|choisissez|ci-après|ci-contre|ci-dessus|ci-dessous|à droite|à gauche|en haut|en bas|click|select|press|tap|use the|see the|fill in|choose)\b/i;
48608
48892
  function isTabbable(e) {
48609
48893
  const ti = attr(e, "tabindex");
@@ -48623,7 +48907,8 @@ function measured(sc) {
48623
48907
  const probes = s.probes;
48624
48908
  if (probes?.probed?.includes(sc)) {
48625
48909
  const issues = PROBE_KEYS[sc]?.flatMap((k) => probes[k] ?? []) ?? [];
48626
- const scroll = sc === "1.4.10" && probes.reflow ? ` horizontal scroll at 320px: ${probes.reflow.horizontalScroll ? "YES" : "no"};` : "";
48910
+ const wide = (probes.reflow?.widening ?? []).map((w) => w.selector).filter(Boolean);
48911
+ const scroll = sc === "1.4.10" && probes.reflow ? ` horizontal scroll at 320px: ${probes.reflow.horizontalScroll ? `YES${wide.length ? ` (widened by ${wide.join(", ")})` : ""}` : "no"};` : "";
48627
48912
  out2.push(
48628
48913
  hAt(
48629
48914
  d,
@@ -48677,6 +48962,203 @@ var PROBE_KEYS = {
48677
48962
  };
48678
48963
  var MEASURED_SCS = ["1.3.4", "1.4.1", "1.4.3", "1.4.4", "1.4.10", "1.4.11", "1.4.12", "1.4.13", "2.1.2", "2.4.7", "2.4.11", "4.1.3"];
48679
48964
  var insideRoleImg = (e) => ancestors(e).some((a) => roleOf(a) === "img");
48965
+ var hiddenDecoration = (e) => [e, ...ancestors(e)].some((a) => (attr(a, "aria-hidden") ?? "").trim().toLowerCase() === "true" || attr(a, "hidden") !== void 0) || ["presentation", "none"].includes(roleOf(e));
48966
+ var CHART_COMPONENT = /^(?:ReactECharts|EChartsReact|ECharts|ReactApexChart|ApexChart|Chart|ChartJs|Line|Bar|Doughnut|Pie|Radar|Scatter|Bubble|PolarArea|Plot|(?:Bar|Line|Area|Pie|Radar|RadialBar|Scatter|Composed|Funnel|Treemap|Sankey)Chart|Map|MapContainer|Stage)$/;
48967
+ function nonTemporalMediaOf(d) {
48968
+ const out2 = [];
48969
+ const seen = /* @__PURE__ */ new Set();
48970
+ for (const e of d.elements) {
48971
+ const isMedia = e.tag === "canvas" || e.tag === "svg" && !ancestors(e).some((a) => a.tag === "svg") || ["object", "embed"].includes(e.tag) && embeddedMediaKind(e) !== "temporal" || CHART_COMPONENT.test(e.tag);
48972
+ if (!isMedia || hiddenDecoration(e) || inNonRendered(e)) continue;
48973
+ const container = ancestors(e).find((a) => roleOf(a) === "img" || a.tag === "figure");
48974
+ const key2 = container ?? e;
48975
+ if (seen.has(key2) || ancestors(e).some((a) => seen.has(a))) continue;
48976
+ seen.add(key2);
48977
+ const figure = [e, ...ancestors(e)].find((a) => a.tag === "figure");
48978
+ const caption = figure?.children.find((c2) => c2.type === "element" && c2.tag === "figcaption");
48979
+ const candidates2 = [
48980
+ container && roleOf(container) === "img" ? attr(container, "aria-label") : void 0,
48981
+ attr(e, "aria-label"),
48982
+ attr(e, "title"),
48983
+ caption ? rt(d, caption, 80) : void 0
48984
+ ].filter((x) => x !== void 0 && x.trim() !== "");
48985
+ const name2 = candidates2.find((x) => !x.trim().startsWith("{")) ?? candidates2[0];
48986
+ out2.push({ el: e, ...container ? { container } : {}, name: (name2 ?? "").replace(/\s+/g, " ").trim().slice(0, 100) });
48987
+ }
48988
+ return out2;
48989
+ }
48990
+ var describeMedium = (d, m) => {
48991
+ const kind = /^[A-Z]/.test(m.el.tag) ? `chart component <${m.el.tag}>` : `<${m.el.tag}>`;
48992
+ const where = m.container ? ` in <${m.container.tag}${roleOf(m.container) ? ` role="${roleOf(m.container)}"` : ""}>` : "";
48993
+ const fallback = ["canvas", "object", "embed"].includes(m.el.tag) ? rt(d, m.el, 60) : "";
48994
+ return `${kind}${where} name="${m.name}"${fallback ? ` fallback="${fallback}"` : ""}`;
48995
+ };
48996
+ var STATE_DATA_ATTR = /^data-(?:[\w-]*-)?(?:current|active|selected|state|status|level|severity|tone|step)(?:-[\w-]*)?$/i;
48997
+ var STATE_WORDS = "active|current|selected|error|success|warning|valid|invalid|danger|done|complete|completed|pending|positive|negative|above|below|over|under|high|low|highlight|highlighted|alert|ok|ko";
48998
+ var STATE_SEGMENT = new RegExp(`(?:^|[-_])(?:is-|has-)?(?:${STATE_WORDS})$`, "i");
48999
+ var STATE_WHOLE = new RegExp(`^(?:is-|has-)?(?:${STATE_WORDS})$`, "i");
49000
+ var STATE_CAMEL = new RegExp(`[a-z](?:${STATE_WORDS.replace(/(^|\|)(\w)/g, (_m, sep8, c2) => `${sep8}${c2.toUpperCase()}`)})$`);
49001
+ function stateClasses(e) {
49002
+ const raw = attr(e, "class") ?? "";
49003
+ if (raw.trim().startsWith("{")) return [];
49004
+ return raw.split(/\s+/).filter(Boolean).filter((c2) => {
49005
+ if (/__|--/.test(c2)) {
49006
+ const seg = c2.split(/__|--/).pop() ?? "";
49007
+ return STATE_SEGMENT.test(seg) || STATE_CAMEL.test(seg);
49008
+ }
49009
+ return STATE_WHOLE.test(c2);
49010
+ });
49011
+ }
49012
+ var compoundCache = /* @__PURE__ */ new Map();
49013
+ function subjectCompounds(selector) {
49014
+ const hit = compoundCache.get(selector);
49015
+ if (hit !== void 0) return hit;
49016
+ const parts2 = [];
49017
+ let depth = 0;
49018
+ let cur = "";
49019
+ for (let i2 = 0; i2 < selector.length; i2++) {
49020
+ const c2 = selector[i2];
49021
+ if (c2 === "\\") {
49022
+ cur += c2 + (selector[i2 + 1] ?? "");
49023
+ i2++;
49024
+ continue;
49025
+ }
49026
+ if (c2 === "(" || c2 === "[") depth++;
49027
+ if (c2 === ")" || c2 === "]") depth--;
49028
+ if (c2 === "," && depth === 0) {
49029
+ parts2.push(cur);
49030
+ cur = "";
49031
+ } else cur += c2;
49032
+ }
49033
+ parts2.push(cur);
49034
+ const out2 = [];
49035
+ for (const part of parts2) {
49036
+ let last = "";
49037
+ depth = 0;
49038
+ for (let i2 = 0; i2 < part.length; i2++) {
49039
+ const c2 = part[i2];
49040
+ if (c2 === "\\") {
49041
+ last += c2 + (part[i2 + 1] ?? "");
49042
+ i2++;
49043
+ continue;
49044
+ }
49045
+ if (c2 === "(" || c2 === "[") depth++;
49046
+ if (c2 === ")" || c2 === "]") depth--;
49047
+ if (depth === 0 && /[\s>+~]/.test(c2)) last = "";
49048
+ else last += c2;
49049
+ }
49050
+ let bare = "";
49051
+ depth = 0;
49052
+ let inPseudo = false;
49053
+ let inBracket = false;
49054
+ for (let i2 = 0; i2 < last.length; i2++) {
49055
+ const c2 = last[i2];
49056
+ if (c2 === "\\") {
49057
+ if (!inPseudo) bare += c2 + (last[i2 + 1] ?? "");
49058
+ i2++;
49059
+ continue;
49060
+ }
49061
+ if (inPseudo) {
49062
+ if (c2 === "(") depth++;
49063
+ else if (c2 === ")") depth--;
49064
+ else if (depth === 0 && /[.#[]/.test(c2)) {
49065
+ inPseudo = false;
49066
+ inBracket = c2 === "[";
49067
+ bare += c2;
49068
+ }
49069
+ continue;
49070
+ }
49071
+ if (c2 === "[") inBracket = true;
49072
+ else if (c2 === "]") inBracket = false;
49073
+ if (c2 === ":" && !inBracket) {
49074
+ inPseudo = true;
49075
+ depth = 0;
49076
+ } else bare += c2;
49077
+ }
49078
+ const unesc = (x) => x.replace(/\\(.)/g, "$1");
49079
+ const tag = /^[a-zA-Z][\w-]*/.exec(bare)?.[0]?.toLowerCase();
49080
+ const ids2 = [...bare.matchAll(/#((?:\\.|[\w-])+)/g)].map((m) => unesc(m[1]));
49081
+ const classes = [...bare.matchAll(/\.((?:\\.|[\w-])+)/g)].map((m) => unesc(m[1]));
49082
+ const attrs = [...bare.matchAll(/\[\s*([\w:-]+)/g)].map((m) => m[1].toLowerCase());
49083
+ if (!tag && !ids2.length && !classes.length && !attrs.length) {
49084
+ compoundCache.set(selector, null);
49085
+ return null;
49086
+ }
49087
+ out2.push({ ...tag ? { tag } : {}, ids: ids2, classes, attrs });
49088
+ }
49089
+ compoundCache.set(selector, out2);
49090
+ return out2;
49091
+ }
49092
+ var componentKey = (cls) => {
49093
+ const m = /^(.+?)__|^(.+?)--/.exec(cls);
49094
+ return m ? m[1] ?? m[2] : void 0;
49095
+ };
49096
+ var componentName = (cls) => /^([A-Z][\w]*?)(?:[-_]module\b|_[a-z])/.exec(cls)?.[1];
49097
+ var domIndexCache = /* @__PURE__ */ new WeakMap();
49098
+ function domIndex(d) {
49099
+ const hit = domIndexCache.get(d);
49100
+ if (hit) return hit;
49101
+ const idx = { tags: /* @__PURE__ */ new Set(), ids: /* @__PURE__ */ new Set(), classes: /* @__PURE__ */ new Set(), keys: /* @__PURE__ */ new Set(), elements: [] };
49102
+ for (const e of d.elements) {
49103
+ const classes = new Set((attr(e, "class") ?? "").split(/\s+/).filter(Boolean));
49104
+ const id = attr(e, "id");
49105
+ idx.tags.add(e.tag);
49106
+ if (id) idx.ids.add(id);
49107
+ for (const c2 of classes) {
49108
+ idx.classes.add(c2);
49109
+ const k = componentKey(c2);
49110
+ if (k) idx.keys.add(k);
49111
+ }
49112
+ idx.elements.push({ tag: e.tag, ...id ? { id } : {}, classes, attrs: new Set(Object.keys(e.attribs).map((a) => a.toLowerCase())) });
49113
+ }
49114
+ domIndexCache.set(d, idx);
49115
+ return idx;
49116
+ }
49117
+ function ruleReach(d, selector) {
49118
+ const compounds = subjectCompounds(selector);
49119
+ if (!compounds) return "rendered";
49120
+ const idx = domIndex(d);
49121
+ const matches = (c2) => (!c2.tag || idx.tags.has(c2.tag)) && c2.ids.every((i2) => idx.ids.has(i2)) && c2.classes.every((k) => idx.classes.has(k)) && idx.elements.some(
49122
+ (e) => (!c2.tag || e.tag === c2.tag) && c2.ids.every((i2) => e.id === i2) && c2.classes.every((k) => e.classes.has(k)) && c2.attrs.every((a) => e.attrs.has(a))
49123
+ );
49124
+ if (compounds.some(matches)) return "rendered";
49125
+ const component = compounds.some((c2) => c2.classes.some((k) => idx.classes.has(k) || componentKey(k) !== void 0 && idx.keys.has(componentKey(k))));
49126
+ return component ? "component" : "absent";
49127
+ }
49128
+ var attributionCache = /* @__PURE__ */ new WeakMap();
49129
+ function attributedRules(docs) {
49130
+ const hit = attributionCache.get(docs);
49131
+ if (hit) return hit;
49132
+ const out2 = /* @__PURE__ */ new Map();
49133
+ const placed = /* @__PURE__ */ new Set();
49134
+ const unplaced = /* @__PURE__ */ new Map();
49135
+ for (const d of docs) {
49136
+ const rules = d.signals?.css?.rules;
49137
+ if (!rules) continue;
49138
+ const mine = [];
49139
+ for (const rule of rules) {
49140
+ const key2 = `${rule.media ?? ""}|${rule.selector}|${JSON.stringify(rule.decls)}`;
49141
+ const reach = ruleReach(d, rule.selector);
49142
+ if (reach === "absent") {
49143
+ if (!unplaced.has(key2)) unplaced.set(key2, { d, rule });
49144
+ continue;
49145
+ }
49146
+ placed.add(key2);
49147
+ mine.push({ rule, reach });
49148
+ }
49149
+ out2.set(d, mine);
49150
+ }
49151
+ for (const [key2, { d, rule }] of unplaced) if (!placed.has(key2)) out2.get(d).push({ rule, reach: "absent" });
49152
+ attributionCache.set(docs, out2);
49153
+ return out2;
49154
+ }
49155
+ function pageRules(docs, d) {
49156
+ return (attributedRules(docs).get(d) ?? []).map(({ rule, reach }) => {
49157
+ const comp = subjectCompounds(rule.selector)?.flatMap((c2) => c2.classes).map(componentName).find((x) => x !== void 0);
49158
+ const where = reach === "rendered" ? comp ? ` [component ${comp}]` : "" : reach === "component" ? ` [component ${comp ?? "present"} is on this page; the state this rule targets was not captured]` : ` [no captured page renders an element this rule targets \u2014 a state class, or a component on a page that was not captured]`;
49159
+ return { ...rule, where };
49160
+ });
49161
+ }
48680
49162
  var SUBJECTS = {
48681
49163
  // Every image-like element and the alternative it carries. Class = (alt, src): the same
48682
49164
  // logo on 38 pages is one decision, not 38.
@@ -48734,11 +49216,17 @@ var SUBJECTS = {
48734
49216
  controls: (docs) => docs.flatMap(
48735
49217
  (d) => d.elements.filter(isFormField).map((e) => {
48736
49218
  const native = CONTROL_TAGS.includes(e.tag) || FIELD_TAGS.has(e.tag);
49219
+ const labelledBy = labelledByText(d, e);
48737
49220
  return h(
48738
49221
  d,
48739
49222
  e,
48740
- `<${e.tag}${attr(e, "type") ? ` type="${attr(e, "type")}"` : ""}${native ? "" : ` role="${roleOf(e)}"`}> label="${labelFor(d, e)}" placeholder="${attr(e, "placeholder") ?? ""}" aria-label="${attr(e, "aria-label") ?? ""}" aria-labelledby="${attr(e, "aria-labelledby") ?? ""}" title="${attr(e, "title") ?? ""}" required=${attr(e, "required") !== void 0 || attr(e, "aria-required") === "true"} describedby="${attr(e, "aria-describedby") ?? ""}"`,
48741
- `control|${e.tag}|${attr(e, "type") ?? roleOf(e)}|${labelFor(d, e)}|${attr(e, "name") ?? ""}`,
49223
+ `<${e.tag}${attr(e, "type") ? ` type="${attr(e, "type")}"` : ""}${native ? "" : ` role="${roleOf(e)}"`}> label="${labelFor(d, e)}" placeholder="${attr(e, "placeholder") ?? ""}" aria-label="${attr(e, "aria-label") ?? ""}" aria-labelledby="${attr(e, "aria-labelledby") ?? ""}"${labelledBy !== void 0 ? ` labelledby-text="${labelledBy}"` : ""} title="${attr(e, "title") ?? ""}" required=${attr(e, "required") !== void 0 || attr(e, "aria-required") === "true"} describedby="${attr(e, "aria-describedby") ?? ""}"`,
49224
+ // EVERY naming mechanism is part of the identity (#130). The class used to be the
49225
+ // `<label>` text and the `name` only, so on a step whose fields are named by
49226
+ // `aria-labelledby` — no <label>, no name — every field collapsed into one class with
49227
+ // a step-1 `aria-label` field and travelled as its `alsoAt`: the labels 11.2/11.4/11.5
49228
+ // are ruled on were never shown.
49229
+ `control|${e.tag}|${attr(e, "type") ?? roleOf(e)}|${labelFor(d, e)}|${attr(e, "name") ?? ""}|${attr(e, "aria-label") ?? ""}|${labelledBy ?? attr(e, "aria-labelledby") ?? ""}|${attr(e, "title") ?? ""}|${attr(e, "placeholder") ?? ""}`,
48742
49230
  labelElementTokens(d, e)
48743
49231
  );
48744
49232
  })
@@ -48952,15 +49440,19 @@ var SUBJECTS = {
48952
49440
  `declaredlang|${attr(e, "lang") ?? ""}`
48953
49441
  )
48954
49442
  ),
48955
- ...d.elements.filter((e) => e.tag !== "html" && attr(e, "lang") !== void 0).map((e) => h(d, e, `lang="${attr(e, "lang")}" text="${t(e, 40)}"`, `lang|${attr(e, "lang")}|${t(e, 40)}`)),
48956
- ...d.elements.filter(
48957
- (e) => e.children.some((c2) => c2.type === "text" && c2.data.trim() !== "") && FOREIGN_LEXICON.test(textContent(e)) && attr(e, "lang") === void 0 && roleOf(e) !== "img" && !insideRoleImg(e)
49443
+ ...d.elements.filter((e) => e.tag !== "html" && attr(e, "lang") !== void 0).map((e) => h(d, e, `lang="${attr(e, "lang")}" text="${rt(d, e, 40)}"`, `lang|${attr(e, "lang")}|${rt(d, e, 40)}`)),
49444
+ // RENDERED text only (#129): a JSX comment, a code fragment or a framework's `<script>`
49445
+ // payload is not a passage of the page. The run is the element's OWN text, so the
49446
+ // candidate is the element that holds the phrase rather than each of its ancestors, and
49447
+ // a phrase already inside a `lang` override is marked.
49448
+ ...textRuns(d).filter(
49449
+ ({ el: e, text }) => FOREIGN_LEXICON.test(text) && ![e, ...ancestors(e)].some((a) => a.tag !== "html" && attr(a, "lang") !== void 0) && roleOf(e) !== "img" && !insideRoleImg(e)
48958
49450
  ).map(
48959
- (e) => h(
49451
+ ({ el: e, text }) => h(
48960
49452
  d,
48961
49453
  e,
48962
- `candidate foreign passage, NOT marked with lang: "${t(e, 60)}" \u2014 a proper noun, a technical term or a word in common use is exempt`,
48963
- `foreign|${t(e, 60)}`
49454
+ `candidate foreign passage, NOT marked with lang: "${text.slice(0, 80)}" \u2014 a proper noun, a technical term or a word in common use is exempt`,
49455
+ `foreign|${text.slice(0, 60)}`
48964
49456
  )
48965
49457
  )
48966
49458
  ]),
@@ -49123,11 +49615,13 @@ var SUBJECTS = {
49123
49615
  ...d.elements.filter((e) => attr(e, "accesskey") !== void 0).map((e) => h(d, e, `accesskey="${attr(e, "accesskey")}" on <${e.tag}> "${t(e, 40)}"`, `accesskey|${attr(e, "accesskey")}`))
49124
49616
  ]),
49125
49617
  // Instructions that lean on a sensory characteristic alone.
49618
+ //
49619
+ // RENDERED text only (#129). This used to match the raw source line, so a component's code
49620
+ // comments (« the legend below it », « pinned to the left of the title ») were handed to
49621
+ // 10.9/10.10 as instructions the page gives. A component's literal text props are rendered
49622
+ // text and stay in.
49126
49623
  sensoryText: (docs) => docs.flatMap(
49127
- (d) => linesOf(
49128
- d,
49129
- /\b(?:ci-dessus|ci-dessous|à droite|a droite|à gauche|a gauche|bouton (?:vert|rouge|bleu)|en rouge|en vert|le carré|la case de droite|above|below|to the right|to the left|green button|red button|round button)\b/i
49130
- ).map((l) => hAt(d, l.line, "text", `sensory-sounding instruction: ${l.text}`, `sensory|${l.text}`))
49624
+ (d) => textRuns(d).filter(({ text }) => SENSORY.test(text)).map(({ el, text }) => h(d, el, `sensory-sounding instruction: "${text.slice(0, 120)}"`, `sensory|${text.slice(0, 100)}`))
49131
49625
  ),
49132
49626
  // Time limits: session expiry, meta refresh, timed redirects.
49133
49627
  timers: (docs) => docs.flatMap((d) => [
@@ -49152,6 +49646,81 @@ var SUBJECTS = {
49152
49646
  (e) => h(d, e, `<${e.tag} autoplay=${attr(e, "autoplay") !== void 0} controls=${attr(e, "controls") !== void 0}>`, `media|${e.tag}`)
49153
49647
  )
49154
49648
  ]),
49649
+ // RGAA 4.8/4.9 — the non-temporal media themselves (#130): a chart drawn in a `<canvas>` or
49650
+ // an SVG, a non-temporal plug-in, a chart component. One per medium, named by the container
49651
+ // that carries its alternative — which is what 4.8 (« a-t-il une alternative ? ») and 4.9
49652
+ // (« est-elle pertinente ? ») are ruled on.
49653
+ nonTemporalMedia: (docs) => docs.flatMap(
49654
+ (d) => nonTemporalMediaOf(d).map(
49655
+ (m) => h(
49656
+ d,
49657
+ m.el,
49658
+ `${describeMedium(d, m)} \u2014 non-temporal media: is an alternative given (adjacent text, a data table, a text description), and does it convey the same information?`,
49659
+ `ntmedia|${m.el.tag}|${m.name}|${attr(m.el, "src") ?? attr(m.el, "data") ?? ""}`
49660
+ )
49661
+ )
49662
+ ),
49663
+ // RGAA 3.1 — elements whose STATE the page draws, and so may draw in colour alone (#130).
49664
+ colourState: (docs) => docs.flatMap(
49665
+ (d) => d.elements.filter((e) => !inNonRendered(e)).flatMap((e) => {
49666
+ const marks = [];
49667
+ const current = (attr(e, "aria-current") ?? "").trim().toLowerCase();
49668
+ if (current !== "" && current !== "false" && !current.startsWith("{")) marks.push(`aria-current="${current}"`);
49669
+ if ((attr(e, "aria-selected") ?? "").trim().toLowerCase() === "true") marks.push(`aria-selected="true"`);
49670
+ for (const [name2, value] of Object.entries(e.attribs)) if (STATE_DATA_ATTR.test(name2)) marks.push(`${name2}="${String(value).slice(0, 30)}"`);
49671
+ for (const c2 of stateClasses(e)) marks.push(`class "${c2}"`);
49672
+ for (const a of ["class", "style"]) {
49673
+ const v = (attr(e, a) ?? "").trim();
49674
+ if (v.startsWith("{") && /\?[^?:]*:|&&/.test(v)) marks.push(`${a} chosen by a condition ${v.replace(/\s+/g, " ").slice(0, 80)}`);
49675
+ }
49676
+ if (!marks.length) return [];
49677
+ const text = rt(d, e, 50);
49678
+ return [
49679
+ h(
49680
+ d,
49681
+ e,
49682
+ `<${e.tag}> state drawn by ${marks.join(", ")} text="${text}" \u2014 is this state ALSO given by text, shape or position, not by colour alone?`,
49683
+ `colourstate|${e.tag}|${marks.map((m) => m.replace(/="[^"]*"$/, "")).join(",")}|${text}`
49684
+ )
49685
+ ];
49686
+ })
49687
+ ),
49688
+ // RGAA 12.3 — the site map page ITSELF (#130). `navMechanisms` finds the link that leads to
49689
+ // it; « la page plan du site est-elle pertinente ? » is ruled on what the page lists, and
49690
+ // where each entry leads.
49691
+ siteMapPage: (docs) => docs.flatMap((d) => {
49692
+ const page = pageOfDoc(d.file);
49693
+ const titled = elementsByTag(d, "h1", "title").some((e) => SITEMAP_TEXT.test(rt(d, e, 80)));
49694
+ const isSiteMap = titled || SITEMAP_ADDRESS.test(page ?? d.file.replace(/\\/g, "/").split("/").slice(-3).join("/"));
49695
+ if (!isSiteMap) return [];
49696
+ const main2 = elementsByTag(d, "main")[0];
49697
+ const chrome = (e) => ancestors(e).some((a) => ["header", "footer"].includes(a.tag) || ["banner", "contentinfo"].includes(roleOf(a)));
49698
+ const entries = d.elements.filter(
49699
+ (e) => attr(e, "href") !== void 0 && (main2 ? ancestors(e).includes(main2) : !chrome(e)) && !ancestors(e).some((a) => a.tag === "nav" && /fil d|breadcrumb/i.test(`${attr(a, "aria-label") ?? ""} ${attr(a, "class") ?? ""}`))
49700
+ );
49701
+ const where = page !== void 0 ? `page="${page}"` : `source ${d.file}`;
49702
+ const head = elementsByTag(d, "h1")[0] ?? main2 ?? elementsByTag(d, "html")[0] ?? entries[0];
49703
+ const out2 = [];
49704
+ if (head)
49705
+ out2.push(
49706
+ h(
49707
+ d,
49708
+ head,
49709
+ `${where} \u2014 THE SITE MAP PAGE: ${entries.length} entr${entries.length === 1 ? "y" : "ies"}${entries.length ? `: ${entries.slice(0, 30).map((e) => `"${rt(d, e, 30)}" \u2192 ${attr(e, "href")}`).join(", ")}${entries.length > 30 ? " \u2026" : ""}` : ""} \u2014 is it representative of the site's architecture?`,
49710
+ `sitemappage|${page ?? d.file}`
49711
+ )
49712
+ );
49713
+ for (const e of entries)
49714
+ out2.push(
49715
+ h(
49716
+ d,
49717
+ e,
49718
+ `site-map entry text="${rt(d, e, 60)}" href="${attr(e, "href")}" section="${nearestHeading(d, e) ?? ""}" \u2014 does it work, and lead to the page it names?`,
49719
+ `sitemapentry|${rt(d, e, 60)}|${attr(e, "href")}`
49720
+ )
49721
+ );
49722
+ return out2;
49723
+ }),
49155
49724
  // RGAA 4.11 — temporal players and the code that controls their consultation. This must
49156
49725
  // not inherit WCAG 2.1.1/2.1.2's page-wide union of pointer handlers and focusables: an
49157
49726
  // unrelated clickable card says nothing about whether an <audio> can be paused.
@@ -49171,13 +49740,14 @@ var SUBJECTS = {
49171
49740
  // RGAA 4.12 — non-temporal plug-in/SVG/canvas media. Static instances are included too:
49172
49741
  // the adjudicator must first establish whether they expose consultation controls before it
49173
49742
  // can legitimately answer NA. Temporal players and generic event handlers stay out.
49743
+ // Hidden decoration (`<svg aria-hidden="true">`) is not media anyone consults (#130).
49174
49744
  nonTemporalMediaControls: (docs) => docs.flatMap((d) => [
49175
- ...d.elements.filter((e) => e.tag === "svg" || e.tag === "canvas" || ["object", "embed"].includes(e.tag) && embeddedMediaKind(e) !== "temporal").map(
49176
- (e) => h(
49745
+ ...nonTemporalMediaOf(d).map(
49746
+ (m) => h(
49177
49747
  d,
49178
- e,
49179
- `<${e.tag}> non-temporal media \u2014 inspect any pan/zoom/navigation/control function for keyboard and pointer operation`,
49180
- `non-temporal-media|${e.tag}|${attr(e, "src") ?? attr(e, "data") ?? attr(e, "id") ?? ""}`
49748
+ m.el,
49749
+ `${describeMedium(d, m)} non-temporal media \u2014 inspect any pan/zoom/navigation/control function for keyboard and pointer operation`,
49750
+ `non-temporal-media|${m.el.tag}|${m.name}|${attr(m.el, "src") ?? attr(m.el, "data") ?? ""}`
49181
49751
  )
49182
49752
  ),
49183
49753
  ...linesOf(d, /\b(?:svgPanZoom|panzoom|zoomIn|zoomOut|getContext)\b/i).map(
@@ -49201,12 +49771,12 @@ var SUBJECTS = {
49201
49771
  (e) => h(d, e, `<script> \u2014 inspect for luminance/colour states toggled rapidly`, `flash-script|${attr(e, "src") ?? t(e, 80)}`)
49202
49772
  ),
49203
49773
  ...d.elements.filter((e) => /animation|transition/i.test(attr(e, "style") ?? "")).map((e) => h(d, e, `inline visual animation: ${(attr(e, "style") ?? "").slice(0, 100)}`, `flash-inline|${attr(e, "style") ?? ""}`)),
49204
- ...(d.signals?.css?.rules ?? []).filter((r) => r.decls.animation !== void 0 || r.decls.animationName !== void 0).map(
49774
+ ...pageRules(docs, d).filter((r) => r.decls.animation !== void 0 || r.decls.animationName !== void 0).map(
49205
49775
  (r) => hAt(
49206
49776
  d,
49207
49777
  1,
49208
49778
  `css:${r.selector}`,
49209
- `stylesheet animation: ${r.selector.slice(0, 60)} { ${declsText(r.decls)} } \u2014 inspect keyframes for rapid opposing luminance changes`,
49779
+ `stylesheet animation: ${r.selector.slice(0, 60)} { ${declsText(r.decls)} }${r.where} \u2014 inspect keyframes for rapid opposing luminance changes`,
49210
49780
  `flash-css|${r.selector}|${declsText(r.decls)}`
49211
49781
  )
49212
49782
  ),
@@ -49339,12 +49909,12 @@ var SUBJECTS = {
49339
49909
  `orderinline|${(attr(e, "style") ?? "").slice(0, 80)}`
49340
49910
  )
49341
49911
  ),
49342
- ...(d.signals?.css?.rules ?? []).filter((r) => r.decls.order !== void 0 || /-reverse/.test(r.decls.flexDirection ?? "") || /reverse/.test(r.decls.flexFlow ?? "")).slice(0, 60).map(
49912
+ ...pageRules(docs, d).filter((r) => r.decls.order !== void 0 || /-reverse/.test(r.decls.flexDirection ?? "") || /reverse/.test(r.decls.flexFlow ?? "")).slice(0, 60).map(
49343
49913
  (r) => hAt(
49344
49914
  d,
49345
49915
  1,
49346
49916
  `css:${r.selector}`,
49347
- `stylesheet reorders layout: ${r.selector.slice(0, 60)} { ${declsText(r.decls)} } \u2014 does it move meaning-bearing content?`,
49917
+ `stylesheet reorders layout: ${r.selector.slice(0, 60)} { ${declsText(r.decls)} }${r.where} \u2014 does it move meaning-bearing content?`,
49348
49918
  `ordercss|${r.selector}`
49349
49919
  )
49350
49920
  )
@@ -49477,24 +50047,23 @@ var SUBJECTS = {
49477
50047
  // without them (« … », “…”, "…" of a dozen characters or more). It inherited `structure` —
49478
50048
  // headings, tables and lists — which never held a quotation.
49479
50049
  quotes: (docs) => docs.flatMap((d) => [
49480
- ...elementsByTag(d, "q", "blockquote").map((e) => h(d, e, `<${e.tag}> "${t(e, 80)}" \u2014 is it a quotation?`, `quote|${e.tag}|${t(e, 60)}`)),
49481
- ...d.elements.filter(
49482
- (e) => !["q", "blockquote", "script", "style", "code", "pre"].includes(e.tag) && e.children.some((c2) => c2.type === "text" && /«[^»]{12,}»|“[^”]{12,}”|"[^"<>]{12,}"/.test(c2.data))
49483
- ).slice(0, 40).map((e) => h(d, e, `quoted text without <q>/<blockquote>: "${t(e, 80)}" \u2014 a citation?`, `quotetext|${t(e, 60)}`))
50050
+ ...elementsByTag(d, "q", "blockquote").map((e) => h(d, e, `<${e.tag}> "${rt(d, e, 80)}" \u2014 is it a quotation?`, `quote|${e.tag}|${rt(d, e, 60)}`)),
50051
+ // Rendered text only (#129): a string in a JSX expression is code, not a quotation.
50052
+ ...d.elements.filter((e) => !["q", "blockquote", "code", "pre"].includes(e.tag) && /«[^»]{12,}»|“[^”]{12,}”|"[^"<>]{12,}"/.test(ownRenderedText(d, e))).slice(0, 40).map((e) => h(d, e, `quoted text without <q>/<blockquote>: "${rt(d, e, 80)}" \u2014 a citation?`, `quotetext|${rt(d, e, 60)}`))
49484
50053
  ]),
49485
50054
  // RGAA 13.5/13.6 — « contenu cryptique (art ASCII, émoticône, syntaxe cryptique) ». It used
49486
50055
  // to inherit `images` through WCAG 1.1.1, so a page with an emoticon and no image closed both
49487
50056
  // criteria « non applicable » over the very content they are about.
49488
50057
  cryptic: (docs) => docs.flatMap(
49489
- (d) => d.elements.filter((e) => !["script", "style", "title", "head"].includes(e.tag)).filter((e) => {
49490
- const own = e.children.filter((c2) => c2.type === "text").map((c2) => c2.data).join(" ");
50058
+ (d) => d.elements.filter((e) => e.tag !== "title").filter((e) => {
50059
+ const own = ownRenderedText(d, e);
49491
50060
  return CRYPTIC.test(own) || e.tag === "pre" && /[^\w\s]{6,}/.test(own);
49492
50061
  }).slice(0, 40).map(
49493
50062
  (e) => h(
49494
50063
  d,
49495
50064
  e,
49496
- `cryptic content: "${t(e, 60)}" title="${attr(e, "title") ?? ""}" aria-label="${attr(e, "aria-label") ?? ""}" \u2014 is an alternative given (title or adjacent definition)?`,
49497
- `cryptic|${t(e, 40)}`
50065
+ `cryptic content: "${rt(d, e, 60)}" title="${attr(e, "title") ?? ""}" aria-label="${attr(e, "aria-label") ?? ""}" \u2014 is an alternative given (title or adjacent definition)?`,
50066
+ `cryptic|${rt(d, e, 40)}`
49498
50067
  )
49499
50068
  )
49500
50069
  ),
@@ -49543,13 +50112,15 @@ var SUBJECTS = {
49543
50112
  // CSS de couleurs de fond et de police ». Inline `style` colours are `colourPairs`.
49544
50113
  colourDecls: (docs) => docs.flatMap((d) => [
49545
50114
  ...linesOf(d, /(?:^|[\s;{])(?:color|background(?:-color)?)\s*:\s*[^;}"'<]+/i, 60).filter((l) => !/\bstyle\s*=/.test(l.text)).map((l) => hAt(d, l.line, "css", `colour declaration: ${l.text}`, `colourdecl|${l.text}`)),
49546
- ...(d.signals?.css?.rules ?? []).filter((r) => r.decls.color !== void 0 || r.decls.backgroundColor !== void 0 || r.decls.background !== void 0).slice(0, 60).map(
49547
- (r) => hAt(
50115
+ // A longhand the browser expanded from a shorthand it did not set comes back EMPTY
50116
+ // (`backgroundColor: ""`): that is no colour declaration, and it used to be shown as one.
50117
+ ...pageRules(docs, d).map((r) => ({ r, fg: (r.decls.color ?? "").trim(), bg: (r.decls.backgroundColor || r.decls.background || "").trim() })).filter(({ fg, bg }) => fg !== "" || bg !== "").slice(0, 60).map(
50118
+ ({ r, fg, bg }) => hAt(
49548
50119
  d,
49549
50120
  1,
49550
50121
  `css:${r.selector}`,
49551
- `stylesheet colours: ${r.selector.slice(0, 60)} { color: ${r.decls.color ?? "\u2014"}; background: ${r.decls.backgroundColor ?? r.decls.background ?? "\u2014"} }`,
49552
- `colourcss|${r.selector}|${r.decls.color ?? ""}|${r.decls.backgroundColor ?? r.decls.background ?? ""}`
50122
+ `stylesheet colours: ${r.selector.slice(0, 60)} { color: ${fg || "\u2014"}; background: ${bg || "\u2014"} }${r.where}`,
50123
+ `colourcss|${r.selector}|${fg}|${bg}`
49553
50124
  )
49554
50125
  )
49555
50126
  ]),
@@ -49580,6 +50151,7 @@ var SUBJECTS = {
49580
50151
  zoom: (docs) => docs.flatMap((d) => [
49581
50152
  ...viewportMeta(d),
49582
50153
  ...cssEvidence(
50154
+ docs,
49583
50155
  d,
49584
50156
  /\b(?:max-)?height\s*:\s*\d+(?:\.\d+)?px|\boverflow(?:-y)?\s*:\s*(?:hidden|clip)|\bfont-size\s*:\s*\d+(?:\.\d+)?px/i,
49585
50157
  (r) => Boolean((r.decls.height ?? r.decls.maxHeight ?? "").endsWith("px") || /hidden|clip/.test(r.decls.overflow ?? r.decls.overflowY ?? "")),
@@ -49592,6 +50164,7 @@ var SUBJECTS = {
49592
50164
  reflow: (docs) => docs.flatMap((d) => [
49593
50165
  ...viewportMeta(d),
49594
50166
  ...cssEvidence(
50167
+ docs,
49595
50168
  d,
49596
50169
  /\b(?:min-)?width\s*:\s*(?:3[2-9]\d|[4-9]\d\d|\d{4,})px|\bwhite-space\s*:\s*(?:nowrap|pre)\b|\boverflow-x\s*:/i,
49597
50170
  (r) => Boolean(/^(?:3[2-9]\d|[4-9]\d\d|\d{4,})px$/.test((r.decls.width ?? r.decls.minWidth ?? "").trim()) || /nowrap|pre/.test(r.decls.whiteSpace ?? "")),
@@ -49605,6 +50178,7 @@ var SUBJECTS = {
49605
50178
  // !important (the decisive rules), any spacing at all, and a box too small to grow.
49606
50179
  textSpacing: (docs) => docs.flatMap(
49607
50180
  (d) => cssEvidence(
50181
+ docs,
49608
50182
  d,
49609
50183
  /\b(?:line-height|letter-spacing|word-spacing)\s*:|\b(?:max-)?height\s*:\s*\d+(?:\.\d+)?px/i,
49610
50184
  (r) => r.decls.lineHeight !== void 0 || r.decls.letterSpacing !== void 0 || r.decls.wordSpacing !== void 0 || (r.decls.height ?? "").endsWith("px"),
@@ -49618,12 +50192,12 @@ var SUBJECTS = {
49618
50192
  ...linesOf(d, /@media[^{]*\borientation\b|\borientation\.lock\s*\(|\block(?:Orientation)?\s*\(\s*["'](?:portrait|landscape)|"orientation"\s*:/i).map(
49619
50193
  (l) => hAt(d, l.line, "orientation", `orientation-dependent code: ${l.text}`, `orientation|${l.text}`)
49620
50194
  ),
49621
- ...(d.signals?.css?.rules ?? []).filter((r) => /orientation/i.test(r.media ?? "")).slice(0, 30).map(
50195
+ ...pageRules(docs, d).filter((r) => /orientation/i.test(r.media ?? "")).slice(0, 30).map(
49622
50196
  (r) => hAt(
49623
50197
  d,
49624
50198
  1,
49625
50199
  `css:${r.selector}`,
49626
- `@media ${r.media} { ${r.selector.slice(0, 50)} { ${declsText(r.decls)} } }`,
50200
+ `@media ${r.media} { ${r.selector.slice(0, 50)} { ${declsText(r.decls)} } }${r.where}`,
49627
50201
  `orientationcss|${r.media}|${r.selector}`
49628
50202
  )
49629
50203
  )
@@ -49639,12 +50213,12 @@ var SUBJECTS = {
49639
50213
  `focusrule|${l.text}`
49640
50214
  )
49641
50215
  ),
49642
- ...(d.signals?.css?.rules ?? []).filter((r) => /:focus/.test(r.selector)).slice(0, 40).map(
50216
+ ...pageRules(docs, d).filter((r) => /:focus/.test(r.selector)).slice(0, 40).map(
49643
50217
  (r) => hAt(
49644
50218
  d,
49645
50219
  1,
49646
50220
  `css:${r.selector}`,
49647
- `captured focus rule: ${r.selector.slice(0, 60)} { ${declsText(r.decls)} }`,
50221
+ `captured focus rule: ${r.selector.slice(0, 60)} { ${declsText(r.decls)} }${r.where}`,
49648
50222
  `focuscss|${r.selector}|${declsText(r.decls)}`
49649
50223
  )
49650
50224
  )
@@ -49700,19 +50274,27 @@ var SUBJECTS = {
49700
50274
  // already lean on a sensory word; this adds every instruction, because a conformity is ruled
49701
50275
  // on the ones that name their target too, and a page with none of the leads had nothing to cite.
49702
50276
  instructions: (docs) => docs.flatMap(
49703
- (d) => d.elements.filter(
49704
- (e) => !["script", "style", "title", "head", "html", "body"].includes(e.tag) && e.children.some((c2) => c2.type === "text" && INSTRUCTION.test(c2.data))
49705
- ).slice(0, 40).map((e) => h(d, e, `instruction: "${t(e, 100)}" \u2014 does it rely on shape, size or position alone?`, `instruction|${t(e, 80)}`))
50277
+ (d) => (
50278
+ // Rendered text only (#129) — see `textRuns`.
50279
+ textRuns(d).filter(({ el, text }) => el.tag !== "body" && INSTRUCTION.test(text)).slice(0, 40).map(
50280
+ ({ el, text }) => h(
50281
+ d,
50282
+ el,
50283
+ `instruction: "${text === ownRenderedText(d, el) ? rt(d, el, 100) : text.slice(0, 100)}" \u2014 does it rely on shape, size or position alone?`,
50284
+ `instruction|${text.slice(0, 80)}`
50285
+ )
50286
+ )
50287
+ )
49706
50288
  ),
49707
50289
  // Content pinned over the page — what can obscure a focused element.
49708
50290
  stickies: (docs) => docs.flatMap((d) => [
49709
50291
  ...d.elements.filter((e) => /position\s*:\s*(?:fixed|sticky)/.test(attr(e, "style") ?? "")).map((e) => h(d, e, `pinned element (inline): ${(attr(e, "style") ?? "").slice(0, 60)} \u2014 can it cover a focused element?`, `sticky|${selectorFor(e)}`)),
49710
- ...(d.signals?.css?.rules ?? []).filter((r) => /^(?:fixed|sticky)$/.test((r.decls.position ?? "").trim())).slice(0, 60).map(
50292
+ ...pageRules(docs, d).filter((r) => /^(?:fixed|sticky)$/.test((r.decls.position ?? "").trim())).slice(0, 60).map(
49711
50293
  (r) => hAt(
49712
50294
  d,
49713
50295
  1,
49714
50296
  `css:${r.selector}`,
49715
- `pinned by stylesheet: ${r.selector.slice(0, 60)} { position: ${r.decls.position} } \u2014 can it cover a focused element?`,
50297
+ `pinned by stylesheet: ${r.selector.slice(0, 60)} { position: ${r.decls.position} }${r.where} \u2014 can it cover a focused element?`,
49716
50298
  `stickycss|${r.selector}`
49717
50299
  )
49718
50300
  )
@@ -49836,7 +50418,8 @@ var PACK_SUBJECTS = {
49836
50418
  // Theme 12 — navigation.
49837
50419
  "12.1": ["navMechanisms"],
49838
50420
  "12.2": ["repeatedBlocks"],
49839
- "12.3": ["navMechanisms"],
50421
+ // The site map page's own content first — 12.3 asks whether IT is pertinent (#130).
50422
+ "12.3": ["siteMapPage", "navMechanisms"],
49840
50423
  "12.4": ["repeatedBlocks", "navMechanisms"],
49841
50424
  // The search engine is the criterion's subject, and `navMechanisms` is what finds it.
49842
50425
  "12.5": ["repeatedBlocks", "navMechanisms"],
@@ -49860,12 +50443,18 @@ var PACK_SUBJECTS = {
49860
50443
  "4.6": ["temporalMedia", "motion"],
49861
50444
  "4.7": ["temporalMedia"],
49862
50445
  "4.13": ["temporalMedia", "nonTemporalMediaControls"],
50446
+ // 4.8/4.9 inherited `images` from WCAG 1.1.1 and were handed a copy of 1.6's image list,
50447
+ // without the canvas charts that are the site's non-temporal media (#130).
50448
+ "4.8": ["nonTemporalMedia"],
50449
+ "4.9": ["nonTemporalMedia"],
49863
50450
  // 4.11/4.12 map to the same keyboard SCs but ask about disjoint media populations.
49864
50451
  // Inheriting the union handed both criteria every pointer handler and focusable in scope.
49865
50452
  "4.11": ["temporalMediaControls"],
49866
50453
  "4.12": ["nonTemporalMediaControls"],
49867
50454
  // Theme 3 — colour. The question is about what colour alone conveys, not the outline.
49868
- "3.1": ["colourPairs", "links"],
50455
+ // What 3.1 is about is a STATE drawn in colour — a current step, a threshold bar, a status
50456
+ // badge — and a chart, which encodes its series in colour (#130). Links follow.
50457
+ "3.1": ["colourState", "nonTemporalMedia", "colourPairs", "links"],
49869
50458
  "3.2": ["colourPairs", "computedColours", "colourDecls", "rendered:1.4.3", "stylesheets"],
49870
50459
  "3.3": ["colourPairs", "colourDecls", "rendered:1.4.11", "controls", "buttons", "stylesheets"],
49871
50460
  // Theme 7 — scripts. "Is each script operable by keyboard AND pointer?" is about the
@@ -54947,15 +55536,15 @@ var Lexer = class {
54947
55536
  }
54948
55537
  if (c2 === 91) {
54949
55538
  this.pos++;
54950
- const arr = [];
55539
+ const arr2 = [];
54951
55540
  for (; ; ) {
54952
55541
  this.skipWs();
54953
55542
  if (this.pos >= b.length) throw new PdfUnreadable("truncated", "unterminated array");
54954
55543
  if (b[this.pos] === 93) {
54955
55544
  this.pos++;
54956
- return arr;
55545
+ return arr2;
54957
55546
  }
54958
- arr.push(this.parse(depth + 1));
55547
+ arr2.push(this.parse(depth + 1));
54959
55548
  }
54960
55549
  }
54961
55550
  const tok = this.readToken();
@@ -55322,15 +55911,15 @@ var PdfDocument = class {
55322
55911
  }
55323
55912
  }
55324
55913
  }
55325
- const obj = this.parseIndirectAt(offset);
55326
- if (!(obj instanceof PdfStream) || nameOf2(obj.dict.get("Type")) !== "XRef")
55914
+ const obj2 = this.parseIndirectAt(offset);
55915
+ if (!(obj2 instanceof PdfStream) || nameOf2(obj2.dict.get("Type")) !== "XRef")
55327
55916
  throw new PdfUnreadable("malformed", "startxref points at neither a table nor an xref stream");
55328
55917
  this.xrefStream = true;
55329
- const data2 = this.decode(obj);
55330
- const w = obj.dict.get("W")?.map((x) => num2(x) ?? 0) ?? [];
55918
+ const data2 = this.decode(obj2);
55919
+ const w = obj2.dict.get("W")?.map((x) => num2(x) ?? 0) ?? [];
55331
55920
  if (w.length !== 3) throw new PdfUnreadable("malformed", "xref stream without /W");
55332
- const size = num2(obj.dict.get("Size")) ?? 0;
55333
- const index = (obj.dict.get("Index") ?? [0, size]).map((x) => num2(x) ?? 0);
55921
+ const size = num2(obj2.dict.get("Size")) ?? 0;
55922
+ const index = (obj2.dict.get("Index") ?? [0, size]).map((x) => num2(x) ?? 0);
55334
55923
  const rowLen = w[0] + w[1] + w[2];
55335
55924
  const field = (p2, n) => {
55336
55925
  let v = 0;
@@ -55353,7 +55942,7 @@ var PdfDocument = class {
55353
55942
  }
55354
55943
  }
55355
55944
  }
55356
- return obj.dict;
55945
+ return obj2.dict;
55357
55946
  }
55358
55947
  /** The xref lied or is missing: rebuild it from every `N G obj` header in the file (last
55359
55948
  * definition wins, as in an incremental update), and the trailer from the last `trailer`
@@ -56401,9 +56990,9 @@ function foldDoc(acc, doc, graph) {
56401
56990
  }
56402
56991
  for (const f of findings) {
56403
56992
  acc.allFindings.push(f);
56404
- const arr = acc.byCriterion.get(f.criteriaId) ?? [];
56405
- arr.push(f);
56406
- acc.byCriterion.set(f.criteriaId, arr);
56993
+ const arr2 = acc.byCriterion.get(f.criteriaId) ?? [];
56994
+ arr2.push(f);
56995
+ acc.byCriterion.set(f.criteriaId, arr2);
56407
56996
  }
56408
56997
  for (const pack of listPacks()) {
56409
56998
  if (pack.rules?.length) acc.packFindings.push(...runPackRules(doc, pack));
@@ -56631,7 +57220,19 @@ function probeFindings(probes, file, page) {
56631
57220
  for (const h2 of hits) add2(PROBE_WCAG[engine], `dyn-${engine}`, PROBE_SEVERITY[engine], h2.selector, h2.html, h2.detail);
56632
57221
  }
56633
57222
  if (probes.reflow?.horizontalScroll) {
56634
- add2("1.4.10", "dyn-reflow", "majeur", "document", "", "Horizontal scrolling at 320px width \u2014 content does not reflow.");
57223
+ const wide = probes.reflow.widening ?? [];
57224
+ const widening = wide.map((w) => w.selector).filter(Boolean).join(", ");
57225
+ const params = widening ? { widening } : {};
57226
+ add2(
57227
+ "1.4.10",
57228
+ "dyn-reflow",
57229
+ "majeur",
57230
+ wide[0]?.selector ?? "document",
57231
+ wide[0]?.html ?? "",
57232
+ resolveMessage({ message: "", msg: { id: "dyn-reflow", params } }, "en")
57233
+ );
57234
+ const f = out2[out2.length - 1];
57235
+ if (f) f.msg = { id: "dyn-reflow", params };
56635
57236
  }
56636
57237
  return out2;
56637
57238
  }
@@ -57414,15 +58015,15 @@ var rgaa_default2 = {
57414
58015
  en: "Structure via headings"
57415
58016
  },
57416
58017
  summary: {
57417
- fr: "L'information est structur\xE9e par une hi\xE9rarchie de titres (h1\u2026h6) sans saut de niveau, avec un h1 unique.",
57418
- en: "Content is structured by a heading hierarchy (h1\u2026h6) with no skipped level and a single h1."
58018
+ fr: `Chaque passage qui joue le r\xF4le d'un titre est balis\xE9 comme tel (h1\u2026h6, ou role="heading" avec aria-level), son contenu est pertinent et la hi\xE9rarchie reste coh\xE9rente. Un saut de niveau (un h3 juste apr\xE8s un h1) ou l'absence de h1 n'invalide pas le crit\xE8re (glossaire RGAA, \xAB Titre \xBB).`,
58019
+ en: 'Every passage acting as a heading is marked up as one (h1\u2026h6, or role="heading" with aria-level), its text is relevant, and the hierarchy stays coherent. A skipped level (an h3 right after an h1) or a missing h1 does not fail the criterion (RGAA glossary, \xAB Titre \xBB).'
57419
58020
  },
57420
58021
  impact: "high",
57421
58022
  examples: [
57422
58023
  {
57423
58024
  lang: "html",
57424
- bad: "<h1>Titre</h1><h3>Sous-section</h3>",
57425
- good: "<h1>Titre</h1><h2>Sous-section</h2>"
58025
+ bad: '<h1>Nos services</h1><p class="titre-section"><strong>D\xE9clarer en ligne</strong></p>',
58026
+ good: "<h1>Nos services</h1><h2>D\xE9clarer en ligne</h2>"
57426
58027
  }
57427
58028
  ],
57428
58029
  reference: "https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#9.1"
@@ -66700,8 +67301,101 @@ function openPerPage(audit2, standard, lang) {
66700
67301
  }
66701
67302
 
66702
67303
  // src/adjudicate.ts
66703
- import { mkdirSync as mkdirSync10, statSync as statSync14, writeFileSync as writeFileSync11 } from "fs";
66704
- import { isAbsolute as isAbsolute4, join as join36, relative as relative5, resolve as resolve11 } from "path";
67304
+ import { existsSync as existsSync27, mkdirSync as mkdirSync10, statSync as statSync15, writeFileSync as writeFileSync11 } from "fs";
67305
+ import { isAbsolute as isAbsolute4, join as join37, relative as relative5, resolve as resolve12 } from "path";
67306
+
67307
+ // src/verapdf.ts
67308
+ import { spawnSync as spawnSync2 } from "child_process";
67309
+ import { existsSync as existsSync26, statSync as statSync14 } from "fs";
67310
+ import { delimiter, join as join36, resolve as resolve11 } from "path";
67311
+ var OFF = /^(?:off|0|false|no)$/i;
67312
+ function veraPdfCommand(env = process.env) {
67313
+ const pinned = env.ULTRA11Y_VERAPDF?.trim();
67314
+ if (pinned) return OFF.test(pinned) ? void 0 : pinned;
67315
+ const names = process.platform === "win32" ? ["verapdf.bat", "verapdf.exe", "verapdf"] : ["verapdf"];
67316
+ for (const dir of (env.PATH ?? "").split(delimiter)) {
67317
+ if (!dir) continue;
67318
+ for (const n of names) {
67319
+ const p = join36(dir, n);
67320
+ try {
67321
+ if (existsSync26(p) && statSync14(p).isFile()) return p;
67322
+ } catch {
67323
+ }
67324
+ }
67325
+ }
67326
+ return void 0;
67327
+ }
67328
+ var obj = (v) => v && typeof v === "object" && !Array.isArray(v) ? v : void 0;
67329
+ var arr = (v) => Array.isArray(v) ? v : [];
67330
+ function parseVeraPdfJson(stdout, files, absolute) {
67331
+ let report;
67332
+ try {
67333
+ report = obj(obj(JSON.parse(stdout))?.report);
67334
+ } catch {
67335
+ report = void 0;
67336
+ }
67337
+ const results = /* @__PURE__ */ new Map();
67338
+ const version = arr(obj(report?.buildInformation)?.releaseDetails).map(obj).find((d) => d?.id === "apps")?.version;
67339
+ for (const job of arr(report?.jobs).map(obj)) {
67340
+ const name2 = obj(job?.itemDetails)?.name;
67341
+ const i2 = typeof name2 === "string" ? absolute.indexOf(resolve11(name2)) : -1;
67342
+ if (i2 < 0) continue;
67343
+ const file = files[i2];
67344
+ const v = arr(job?.validationResult).map(obj)[0] ?? obj(job?.validationResult);
67345
+ if (!v || typeof v.compliant !== "boolean") {
67346
+ const why = obj(arr(job?.taskResult)[0])?.exceptionMessage ?? obj(job?.taskException)?.message ?? job?.jobEndStatus;
67347
+ results.set(file, { file, failedRules: [], error: typeof why === "string" && why ? why : "not validated" });
67348
+ continue;
67349
+ }
67350
+ const failedRules = arr(obj(v.details)?.ruleSummaries).map(obj).filter((r) => r !== void 0 && (r.status === "failed" || r.ruleStatus === "FAILED")).map((r) => ({
67351
+ clause: String(r.clause ?? "?"),
67352
+ testNumber: Number(r.testNumber ?? 0),
67353
+ description: String(r.description ?? ""),
67354
+ failedChecks: Number(r.failedChecks ?? 0)
67355
+ }));
67356
+ results.set(file, { file, compliant: v.compliant, ...typeof v.profileName === "string" ? { profile: v.profileName } : {}, failedRules });
67357
+ }
67358
+ return {
67359
+ ...typeof version === "string" ? { version } : {},
67360
+ results: files.map(
67361
+ (file) => results.get(file) ?? { file, failedRules: [], error: report ? "absent from veraPDF's report" : "veraPDF produced no readable report" }
67362
+ )
67363
+ };
67364
+ }
67365
+ var cache = /* @__PURE__ */ new Map();
67366
+ function runVeraPdf(files, opts = {}) {
67367
+ const command = veraPdfCommand(opts.env);
67368
+ if (!command || !files.length) return void 0;
67369
+ const absolute = files.map((f) => resolve11(opts.cwd ?? process.cwd(), f));
67370
+ const key2 = JSON.stringify([
67371
+ command,
67372
+ absolute.map((p) => {
67373
+ try {
67374
+ const st = statSync14(p);
67375
+ return `${p}|${st.size}|${st.mtimeMs}`;
67376
+ } catch {
67377
+ return `${p}|missing`;
67378
+ }
67379
+ })
67380
+ ]);
67381
+ if (cache.has(key2)) return cache.get(key2);
67382
+ const run2 = spawnSync2(command, ["--flavour", "ua1", "--format", "json", ...absolute], {
67383
+ encoding: "utf8",
67384
+ timeout: opts.timeoutMs ?? 12e4,
67385
+ maxBuffer: 64 * 1024 * 1024,
67386
+ env: opts.env ? { ...process.env, ...opts.env } : process.env,
67387
+ ...process.platform === "win32" ? { shell: true } : {}
67388
+ });
67389
+ let report;
67390
+ if (run2.error || !run2.stdout?.trim()) {
67391
+ const why = run2.error?.message ?? (run2.stderr?.trim().split("\n")[0] || `exit ${run2.status}`);
67392
+ report = { command, results: files.map((file) => ({ file, failedRules: [], error: `veraPDF did not run: ${why}` })) };
67393
+ } else {
67394
+ report = { command, ...parseVeraPdfJson(run2.stdout, files, absolute) };
67395
+ }
67396
+ cache.set(key2, report);
67397
+ return report;
67398
+ }
66705
67399
 
66706
67400
  // src/data/adjudication.json
66707
67401
  var adjudication_default = {
@@ -67499,6 +68193,7 @@ function adjudicationForWcagRefs(scs, lang) {
67499
68193
  var ADJUDICATE_MAX_EVIDENCE_CLASSES = 1200;
67500
68194
  var ALSO_AT_SHOWN = 8;
67501
68195
  var CITE_DRIFT_DEFAULT = 10;
68196
+ var RECOMMENDATION_SHAPE = "optional on any verdict, never changes a status: each entry is an OBJECT { file, line, message, selector?, snippet? } \u2014 `file`/`line` (and the `snippet`) copied from this criterion's own evidence, grounded against the source exactly like an NC finding but with no normativeRef; a bare sentence, or an object without `file`, is refused";
67502
68197
  function adjudicationContract() {
67503
68198
  return {
67504
68199
  verdicts: [...VERDICTS],
@@ -67508,7 +68203,8 @@ function adjudicationContract() {
67508
68203
  NA: "a non-empty justification, and citations[] whenever evidence was presented \u2014 a criterion whose subject exists NOWHERE in the audited scope is NA, never NC",
67509
68204
  NC: "at least one groundable finding, each naming the `file` it was observed in (an NC with no location is refused as flatly as an uncited C \u2014 and a non-conformity that rests on an ABSENCE is still observed on an element of a page, so cite that element) and each citing a normativeRef that resolves against the active standard",
67510
68205
  manual: `a reason \u2208 {${MANUAL_REASON_VALUES.join(", ")}}`,
67511
- human: `decidedBy "human" (a human auditor's verdict, instead of the default "agent") requires auditor: { name, organisation? } \u2014 the same evidence gate applies, and the verdict is reported under the auditor's name`
68206
+ human: `decidedBy "human" (a human auditor's verdict, instead of the default "agent") requires auditor: { name, organisation? } \u2014 the same evidence gate applies, and the verdict is reported under the auditor's name`,
68207
+ recommendations: RECOMMENDATION_SHAPE
67512
68208
  }
67513
68209
  };
67514
68210
  }
@@ -67519,7 +68215,7 @@ function docsForAudit(audit2, cwd) {
67519
68215
  const docs = [];
67520
68216
  for (const f of files) {
67521
68217
  try {
67522
- const path = cwd ? resolve11(cwd, f) : f;
68218
+ const path = cwd ? resolve12(cwd, f) : f;
67523
68219
  if (isPdfPath(f)) {
67524
68220
  docs.push(loadPdfDoc(path, f));
67525
68221
  continue;
@@ -67749,7 +68445,7 @@ function canonicalEvidenceFile(file) {
67749
68445
  const marker = `${PAGES_DIR}/`;
67750
68446
  const at = posix3.lastIndexOf(marker);
67751
68447
  if (at >= 0) return posix3.slice(at);
67752
- return /^https?:\/\//i.test(posix3) ? posix3 : resolve11(posix3).replace(/\\/g, "/");
68448
+ return /^https?:\/\//i.test(posix3) ? posix3 : resolve12(posix3).replace(/\\/g, "/");
67753
68449
  }
67754
68450
  function worklistPath(file) {
67755
68451
  if (!isAbsolute4(file)) return file;
@@ -67768,12 +68464,12 @@ function relativizeItem(it) {
67768
68464
  };
67769
68465
  }
67770
68466
  function withinAuditInput(file, audit2, cwd) {
67771
- const target = resolve11(cwd ?? process.cwd(), file);
68467
+ const target = resolve12(cwd ?? process.cwd(), file);
67772
68468
  for (const input of audit2.scope.inputs) {
67773
68469
  if (input === "-" || input === "<stdin>") continue;
67774
- const root = resolve11(cwd ?? process.cwd(), input);
68470
+ const root = resolve12(cwd ?? process.cwd(), input);
67775
68471
  try {
67776
- if (statSync14(root).isDirectory()) {
68472
+ if (statSync15(root).isDirectory()) {
67777
68473
  const rel2 = relative5(root, target);
67778
68474
  if (rel2 === "" || rel2 !== ".." && !rel2.startsWith("../") && !isAbsolute4(rel2)) return true;
67779
68475
  } else if (root === target) return true;
@@ -68096,7 +68792,10 @@ function applyAdjudication(audit2, adj, opts = {}) {
68096
68792
  else if (it.reason === "needs-rendered-dom" && it.evidence.some((e) => snapshotPageId(e.file) !== void 0))
68097
68793
  blame(
68098
68794
  it.criteriaId,
68099
- `criterion ${it.criteriaId}: "needs-rendered-dom", but this criterion's own evidence is anchored in a page capture \u2014 the rendered page is on disk under .ultra11y/pages/<id>/ (dom.html, styles.json, boxes.json, axtree.json, screen.png). Decide it from those files, or answer "undecidable" and say what the capture does not settle.`
68795
+ `criterion ${it.criteriaId}: "needs-rendered-dom", but this criterion's own evidence is anchored in a page capture \u2014 the rendered page is on disk under .ultra11y/pages/<id>/ (${captureFilesPresent(
68796
+ it.evidence.map((e) => e.file),
68797
+ opts.cwd
68798
+ ).join(", ")}). Decide it from those files, or answer "undecidable" and say what the capture does not settle.`
68100
68799
  );
68101
68800
  } else {
68102
68801
  blame(it.criteriaId, `criterion ${it.criteriaId}: unknown verdict "${String(v)}" \u2014 expected one of ${VERDICTS.join(" | ")}`);
@@ -68105,7 +68804,7 @@ function applyAdjudication(audit2, adj, opts = {}) {
68105
68804
  if (typeof rec.file !== "string" || !rec.file.trim()) {
68106
68805
  blame(
68107
68806
  it.criteriaId,
68108
- `criterion ${it.criteriaId}: a recommendation must name the file it was observed in \u2014 copy a file and line from this criterion's own evidence, or drop the recommendation`
68807
+ `criterion ${it.criteriaId}: a recommendation must name the file it was observed in \u2014 write it as an object { file, line, message, selector?, snippet? } with a file and line copied from this criterion's own evidence, or drop the recommendation`
68109
68808
  );
68110
68809
  continue;
68111
68810
  }
@@ -68311,6 +69010,71 @@ var residualScanReason = () => "Rendering criterion \u2014 decide on the rendere
68311
69010
  var residualUndecidableReason = () => "Left as an explicit residual risk (not decidable from the available evidence).";
68312
69011
  var residualRejectedReason = (why) => `Adjudication refused by the gate \u2014 ${why.replace(/^criterion \S+: /, "")}. Re-adjudicate this criterion.`;
68313
69012
  var SNIPPET_SHOWN = 200;
69013
+ var CAPTURE_FILES = ["dom.html", "styles.json", "boxes.json", "css.json", "probes.json", "axe.json", "axtree.json", "screen.png"];
69014
+ var CAPTURE_FILE_LABEL = {
69015
+ fr: {
69016
+ "dom.html": "le DOM s\xE9rialis\xE9 par le navigateur",
69017
+ "styles.json": "les styles calcul\xE9s",
69018
+ "boxes.json": "les bo\xEEtes et positions",
69019
+ "css.json": "les r\xE8gles CSS lues dans les feuilles de style",
69020
+ "probes.json": "les mesures des sondes en direct",
69021
+ "axe.json": "les r\xE9sultats axe-core de la page",
69022
+ "axtree.json": "l'arbre d'accessibilit\xE9",
69023
+ "screen.png": "la capture d'\xE9cran"
69024
+ },
69025
+ en: {
69026
+ "dom.html": "the DOM the browser serialized",
69027
+ "styles.json": "computed styles",
69028
+ "boxes.json": "boxes and positions",
69029
+ "css.json": "the CSS rules read from the stylesheets",
69030
+ "probes.json": "the live probes' measurements",
69031
+ "axe.json": "axe-core's results on the page",
69032
+ "axtree.json": "the accessibility tree",
69033
+ "screen.png": "the screenshot"
69034
+ }
69035
+ };
69036
+ function captureFilesPresent(files, cwd) {
69037
+ const dirs = /* @__PURE__ */ new Set();
69038
+ for (const f of files) {
69039
+ const m = /^(.*(?:^|\/)\.ultra11y\/pages\/[^/]+)\//.exec(f.replace(/\\/g, "/"));
69040
+ if (m?.[1]) dirs.add(resolve12(cwd ?? process.cwd(), m[1]));
69041
+ }
69042
+ const present = CAPTURE_FILES.filter((name2) => [...dirs].some((d) => existsSync27(join37(d, name2))));
69043
+ return present.length ? present : ["dom.html"];
69044
+ }
69045
+ var VERAPDF_RULES_SHOWN = 6;
69046
+ function veraPdfBlock(pdfs, lang, cwd) {
69047
+ const report = runVeraPdf(pdfs, { cwd });
69048
+ if (!report) return [];
69049
+ const fr = lang === "fr";
69050
+ const name2 = `veraPDF${report.version ? ` ${report.version}` : ""}`;
69051
+ const out2 = [
69052
+ fr ? `> **Validateur externe \u2014 ${name2}, profil PDF/UA-1** \u2014 r\xE9sultat d'un outil EXTERNE install\xE9 sur cette machine, pas un contr\xF4le du moteur : il ne se cite pas (ce n'est pas une \xE9vidence) et ne tranche rien. PDF/UA-1 n'est pas le RGAA 13.3 : une version alternative accessible satisfait le crit\xE8re quel que soit le PDF, et un PDF valide PDF/UA reste \xE0 juger. \xC0 lire \xE0 c\xF4t\xE9 des contr\xF4les du moteur ci-dessus, jamais \xE0 leur place.` : `> **External validator \u2014 ${name2}, PDF/UA-1 profile** \u2014 the result of an EXTERNAL tool installed on this machine, not an engine check: it is not citable (it is not evidence) and decides nothing. PDF/UA-1 is not RGAA 13.3: an accessible alternative version satisfies the criterion whatever the PDF is, and a PDF/UA-valid file still has to be judged. Read it beside the engine's checks above, never in their place.`,
69053
+ ""
69054
+ ];
69055
+ for (const r of report.results) {
69056
+ if (r.compliant === true)
69057
+ out2.push(
69058
+ fr ? `- \`${r.file}\` \u2014 conforme au profil PDF/UA-1 selon veraPDF` : `- \`${r.file}\` \u2014 compliant with the PDF/UA-1 profile according to veraPDF`
69059
+ );
69060
+ else if (r.compliant === false) {
69061
+ const rules = r.failedRules.slice(0, VERAPDF_RULES_SHOWN).map((x) => `\`${x.clause}-${x.testNumber}\` ${x.description.replace(/\s+/g, " ").slice(0, 90)}`).join(" ; ");
69062
+ const more = r.failedRules.length > VERAPDF_RULES_SHOWN ? ` ; \u2026 +${r.failedRules.length - VERAPDF_RULES_SHOWN}` : "";
69063
+ out2.push(
69064
+ fr ? `- \`${r.file}\` \u2014 NON conforme au profil PDF/UA-1 selon veraPDF : ${r.failedRules.length} r\xE8gle(s) en \xE9chec${rules ? ` \u2014 ${rules}${more}` : ""}` : `- \`${r.file}\` \u2014 NOT compliant with the PDF/UA-1 profile according to veraPDF: ${r.failedRules.length} failed rule(s)${rules ? ` \u2014 ${rules}${more}` : ""}`
69065
+ );
69066
+ } else
69067
+ out2.push(
69068
+ fr ? `- \`${r.file}\` \u2014 non valid\xE9 par veraPDF (${r.error ?? "?"}) : aucun r\xE9sultat externe` : `- \`${r.file}\` \u2014 not validated by veraPDF (${r.error ?? "?"}): no external result`
69069
+ );
69070
+ }
69071
+ out2.push("");
69072
+ return out2;
69073
+ }
69074
+ function listFiles(files, labels, and) {
69075
+ const parts2 = files.map((f) => `\`${f}\` (${labels[f]})`);
69076
+ return parts2.length > 1 ? `${parts2.slice(0, -1).join(", ")} ${and} ${parts2[parts2.length - 1]}` : parts2[0] ?? "";
69077
+ }
68314
69078
  var T2 = {
68315
69079
  fr: {
68316
69080
  title: "# Adjudication des crit\xE8res \xE0 \xE9valuer (ultra11y)",
@@ -68321,7 +69085,7 @@ var T2 = {
68321
69085
  "- `NA` \u2014 non applicable (renseignez `justification` ; si des \xE9vidences sont pr\xE9sent\xE9es, citez-les aussi dans `citations[]` pour dire lesquelles sortent du p\xE9rim\xE8tre) ;",
68322
69086
  "- `manual` \u2014 ind\xE9cidable statiquement (renseignez `reason` : `needs-rendered-dom` \u2192 `scan`, ou `undecidable`)."
68323
69087
  ],
68324
- rule: "> Ne signalez une NC que si un test pr\xE9cis du r\xE9f\xE9rentiel actif \xE9choue \u2014 citez-le (`normativeRef`). Une bonne pratique sans test normatif est une recommandation (`recommendations[]`, non normative). Une simple pr\xE9occupation UX n'est ni l'un ni l'autre.\n>\n> Sym\xE9triquement, un `C` se cite comme une NC : il faut nommer dans `citations[]` les \xE9vidences lev\xE9es. **Un crit\xE8re pr\xE9sent\xE9 sans aucune \xE9vidence ne peut pas \xEAtre `C`** \u2014 c'est `manual` (`undecidable`), ou `NA` si rien n'est concern\xE9.",
69088
+ rule: "> Ne signalez une NC que si un test pr\xE9cis du r\xE9f\xE9rentiel actif \xE9choue \u2014 citez-le (`normativeRef`). Une bonne pratique sans test normatif est une recommandation (`recommendations[]`, non normative) : chaque entr\xE9e est un objet `{ file, line, message, selector?, snippet? }` dont `file`/`line` sont recopi\xE9s depuis les \xE9vidences du crit\xE8re \u2014 une phrase seule est refus\xE9e. Une simple pr\xE9occupation UX n'est ni l'un ni l'autre.\n>\n> Sym\xE9triquement, un `C` se cite comme une NC : il faut nommer dans `citations[]` les \xE9vidences lev\xE9es. **Un crit\xE8re pr\xE9sent\xE9 sans aucune \xE9vidence ne peut pas \xEAtre `C`** \u2014 c'est `manual` (`undecidable`), ou `NA` si rien n'est concern\xE9.",
68325
69089
  then: "Puis : `ultra11y verify --apply ADJUDICATE.todo.json --in <audit.json> --out <dir>` (\xE9choue si un verdict manque sa justification, ses citations, son finding ou sa raison).",
68326
69090
  evidence: "\xC9vidences",
68327
69091
  classes: "classes de contenu distinctes",
@@ -68330,7 +69094,7 @@ var T2 = {
68330
69094
  on: "sur",
68331
69095
  alsoAt: "aussi en",
68332
69096
  snippetLabel: "`snippet` \xE0 copier dans la citation",
68333
- renderedAvailable: "**RENDU DISPONIBLE.** Cet audit a ing\xE9r\xE9 des captures de page : le rendu de la page est sur le disque, sous `.ultra11y/pages/<id>/` \u2014 `dom.html` (le DOM s\xE9rialis\xE9 par le navigateur), `styles.json` (les styles calcul\xE9s), `boxes.json` (les bo\xEEtes et positions), `axtree.json` (l'arbre d'accessibilit\xE9) et `screen.png`. Un crit\xE8re \xAB \xE0 restituer \xBB \u2014 information par la couleur, op\xE9rabilit\xE9 clavier d'un script, geste au pointeur \u2014 se tranche DEPUIS CES FICHIERS : lisez-les comme vous liriez la source. `needs-rendered-dom` reste la bonne r\xE9ponse pour un crit\xE8re dont aucune capture ne porte le sujet, et pour lui seul.",
69097
+ renderedAvailable: (files) => `**RENDU DISPONIBLE.** Cet audit a ing\xE9r\xE9 des captures de page : le rendu de la page est sur le disque, sous \`.ultra11y/pages/<id>/\` \u2014 ${listFiles(files, CAPTURE_FILE_LABEL.fr, "et")}. Un crit\xE8re \xAB \xE0 restituer \xBB \u2014 information par la couleur, op\xE9rabilit\xE9 clavier d'un script, geste au pointeur \u2014 se tranche DEPUIS CES FICHIERS : lisez-les comme vous liriez la source. \`needs-rendered-dom\` reste la bonne r\xE9ponse pour un crit\xE8re dont aucune capture ne porte le sujet, et pour lui seul.`,
68334
69098
  nothingRendered: (ids2) => `**AUCUN RENDU DANS CETTE PORT\xC9E.** ${ids2.length} crit\xE8re(s) exigent une page rendue, et aucune page n'a \xE9t\xE9 instantan\xE9e ici : personne ne peut les trancher depuis la source, et \`needs-rendered-dom\` est pour eux la seule r\xE9ponse honn\xEAte. Rendez AVANT d'adjuger \u2014 \`ultra11y scan <url> --merge <audit.json>\` (ou \`scan --sample\`) \u2014 puis reconstruisez cette liste : la mesure en ferme la plupart sans mod\xE8le, donc sans facture. Concern\xE9s : ${ids2.map((id) => `\`${id}\``).join(" \xB7 ")}`,
68335
69099
  briefContract: "> **CONTRAT DE VERDICT** \u2014 le pli est FERM\xC9 : un verdict auquel il manque son champ obligatoire est refus\xE9, et son crit\xE8re retourne \xAB \xE0 \xE9valuer \xBB en portant le refus. Renseignez le verdict de CE crit\xE8re, ici :",
68336
69100
  absenceRule: "> **UNE NC EN FORME D'ABSENCE S'ANCRE QUAND M\xCAME.** \xAB Il n'y a pas de second syst\xE8me de navigation \xBB, \xAB il n'y a pas de moteur de recherche \xBB, \xAB aucun message d'erreur ne sugg\xE8re le format attendu \xBB : une absence se CONSTATE quelque part. Citez l'\xE9l\xE9ment et la page o\xF9 vous l'avez constat\xE9e \u2014 le `<nav>`, le `<header>`, le formulaire \u2014 avec son `file`, sa `line` et son `snippet`. Une NC sans `file` est refus\xE9e aussi s\xFBrement qu'un `C` sans citations. Et si le sujet du crit\xE8re n'existe nulle part dans le p\xE9rim\xE8tre audit\xE9, le verdict n'est pas `NC` : c'est `NA`, avec sa justification.",
@@ -68375,7 +69139,7 @@ var T2 = {
68375
69139
  "- `NA` \u2014 not applicable (fill `justification`; when evidence is presented, cite it too in `citations[]` to say which items are out of scope);",
68376
69140
  "- `manual` \u2014 not statically decidable (fill `reason`: `needs-rendered-dom` \u2192 `scan`, or `undecidable`)."
68377
69141
  ],
68378
- rule: "> Report NC only if a precise test of the active standard fails \u2014 cite it (`normativeRef`). A good practice without a normative test is a recommendation (`recommendations[]`, non-normative). A purely UX concern is neither.\n>\n> A `C` is cited the same way an NC is: name the evidence you cleared in `citations[]`. **A criterion presented with no evidence at all cannot be `C`** \u2014 record `manual` (`undecidable`), or `NA` only if the scope provably contains nothing the criterion is about. No harvested evidence is NOT that proof: a page with content always has a reading order, a focus order, text to space and a layout to reflow or rotate \u2014 an uncited NA is put on trial by `verify`.",
69142
+ rule: "> Report NC only if a precise test of the active standard fails \u2014 cite it (`normativeRef`). A good practice without a normative test is a recommendation (`recommendations[]`, non-normative): each entry is an object `{ file, line, message, selector?, snippet? }` whose `file`/`line` are copied from the criterion's own evidence \u2014 a bare sentence is refused. A purely UX concern is neither.\n>\n> A `C` is cited the same way an NC is: name the evidence you cleared in `citations[]`. **A criterion presented with no evidence at all cannot be `C`** \u2014 record `manual` (`undecidable`), or `NA` only if the scope provably contains nothing the criterion is about. No harvested evidence is NOT that proof: a page with content always has a reading order, a focus order, text to space and a layout to reflow or rotate \u2014 an uncited NA is put on trial by `verify`.",
68379
69143
  then: "Then: `ultra11y verify --apply ADJUDICATE.todo.json --in <audit.json> --out <dir>` (fails if any verdict lacks its justification, citations, finding or reason).",
68380
69144
  evidence: "Evidence",
68381
69145
  classes: "distinct content classes",
@@ -68384,7 +69148,7 @@ var T2 = {
68384
69148
  on: "on",
68385
69149
  alsoAt: "also at",
68386
69150
  snippetLabel: "`snippet` to copy into the citation",
68387
- renderedAvailable: "**THE RENDERED PAGE IS AVAILABLE.** This audit ingested page captures: the rendered page is on disk under `.ultra11y/pages/<id>/` \u2014 `dom.html` (the DOM the browser serialized), `styles.json` (computed styles), `boxes.json` (boxes and positions), `axtree.json` (the accessibility tree) and `screen.png`. A needs-rendering criterion \u2014 information by colour, keyboard operability of a script, a pointer gesture \u2014 is decided FROM THOSE FILES: read them as you would read the source. `needs-rendered-dom` stays the right answer for a criterion no capture carries the subject of, and for that alone.",
69151
+ renderedAvailable: (files) => `**THE RENDERED PAGE IS AVAILABLE.** This audit ingested page captures: the rendered page is on disk under \`.ultra11y/pages/<id>/\` \u2014 ${listFiles(files, CAPTURE_FILE_LABEL.en, "and")}. A needs-rendering criterion \u2014 information by colour, keyboard operability of a script, a pointer gesture \u2014 is decided FROM THOSE FILES: read them as you would read the source. \`needs-rendered-dom\` stays the right answer for a criterion no capture carries the subject of, and for that alone.`,
68388
69152
  nothingRendered: (ids2) => `**NOTHING WAS RENDERED IN THIS SCOPE.** ${ids2.length} criteria need a rendered page, and no page was snapshotted here: nobody can settle them from source, and \`needs-rendered-dom\` is the only honest answer for them. Render BEFORE adjudicating \u2014 \`ultra11y scan <url> --merge <audit.json>\` (or \`scan --sample\`) \u2014 then rebuild this worklist: the measurement closes most of them with no model in the loop, and so with no bill. Affected: ${ids2.map((id) => `\`${id}\``).join(" \xB7 ")}`,
68389
69153
  briefContract: "> **VERDICT CONTRACT** \u2014 the fold is FAIL-CLOSED: a verdict missing its required field is refused, and its criterion goes back to \xAB to assess \xBB carrying the refusal. Record THIS criterion's verdict, here:",
68390
69154
  absenceRule: "> **AN NC SHAPED LIKE AN ABSENCE STILL HAS TO BE ANCHORED.** \xAB There is no second navigation system \xBB, \xAB there is no search engine \xBB, \xAB no error message suggests the expected format \xBB: an absence is OBSERVED somewhere. Cite the element and the page you observed it on \u2014 the `<nav>`, the `<header>`, the form \u2014 with its `file`, `line` and `snippet`. An NC with no `file` is refused exactly as surely as a `C` with no citations. And when the criterion's subject exists nowhere in the audited scope, the verdict is not `NC`: it is `NA`, with its justification.",
@@ -68484,7 +69248,15 @@ function formatAdjudication(items, lang = "en", standard = CORE2, opts = {}) {
68484
69248
  const pack = isCore(standard) ? void 0 : loadPack(standard);
68485
69249
  const out2 = opts.contract === false ? [] : opts.preamble === false ? [s.briefContract, "", ...s.verdicts, "", s.rule, "", s.absenceRule, ""] : [s.title, "", s.intro, "", ...s.verdicts, "", s.rule, "", s.absenceRule, "", s.then, ""];
68486
69250
  if (items.some((it) => it.evidence.some((e) => isSnapshotFile(e.file)))) {
68487
- out2.push(`> ${s.renderedAvailable}`, "");
69251
+ out2.push(
69252
+ `> ${s.renderedAvailable(
69253
+ captureFilesPresent(
69254
+ items.flatMap((it) => it.evidence.map((e) => e.file)),
69255
+ opts.cwd
69256
+ )
69257
+ )}`,
69258
+ ""
69259
+ );
68488
69260
  }
68489
69261
  if (opts.unrendered?.length) {
68490
69262
  out2.push(`> ${s.nothingRendered(opts.unrendered)}`, "");
@@ -68533,6 +69305,8 @@ function formatAdjudication(items, lang = "en", standard = CORE2, opts = {}) {
68533
69305
  }
68534
69306
  out2.push("");
68535
69307
  }
69308
+ const pdfs = [...new Set(it.evidence.filter((e) => isPdfPath(e.file)).map((e) => e.file))];
69309
+ if (pdfs.length) out2.push(...veraPdfBlock(pdfs, lang, opts.cwd));
68536
69310
  const crit = pack ? getCriterion(pack, it.criteriaId) : void 0;
68537
69311
  if (pack) {
68538
69312
  if (!crit?.methodology || Object.keys(crit.methodology).length === 0) {
@@ -68606,8 +69380,8 @@ function formatAdjudication(items, lang = "en", standard = CORE2, opts = {}) {
68606
69380
  function writeAdjudication(items, outDir, opts) {
68607
69381
  mkdirSync10(outDir, { recursive: true });
68608
69382
  items = items.map(relativizeItem);
68609
- const todoPath = join36(outDir, "ADJUDICATE.todo.json");
68610
- const mdPath = join36(outDir, "ADJUDICATE.md");
69383
+ const todoPath = join37(outDir, "ADJUDICATE.todo.json");
69384
+ const mdPath = join37(outDir, "ADJUDICATE.md");
68611
69385
  const file = {
68612
69386
  tool: "ultra11y",
68613
69387
  kind: "adjudication",
@@ -68625,15 +69399,15 @@ function writeAdjudication(items, outDir, opts) {
68625
69399
  ...opts.web ? { web: true } : {}
68626
69400
  })
68627
69401
  );
68628
- const verdictsPath = join36(outDir, "ADJUDICATE.verdicts.json");
69402
+ const verdictsPath = join37(outDir, "ADJUDICATE.verdicts.json");
68629
69403
  writeFileSync11(verdictsPath, JSON.stringify({ ...file, items: slimAdjudicationItems(items) }, null, 2) + "\n");
68630
- const itemsDir = join36(outDir, "adjudicate");
69404
+ const itemsDir = join37(outDir, "adjudicate");
68631
69405
  mkdirSync10(itemsDir, { recursive: true });
68632
69406
  const unrendered = new Set(opts.unrendered ?? []);
68633
69407
  for (const it of items) {
68634
69408
  const mine = unrendered.has(it.criteriaId) ? [it.criteriaId] : [];
68635
69409
  writeFileSync11(
68636
- join36(itemsDir, `${it.criteriaId}.md`),
69410
+ join37(itemsDir, `${it.criteriaId}.md`),
68637
69411
  formatAdjudication([it], opts.lang ?? "en", opts.standard, {
68638
69412
  preamble: false,
68639
69413
  ...mine.length ? { unrendered: mine } : {},
@@ -68798,11 +69572,11 @@ function pruneRefuted(audit2, standard, items, lang = "en", untried = []) {
68798
69572
 
68799
69573
  // src/ledger.ts
68800
69574
  import { createHash as createHash7 } from "crypto";
68801
- import { existsSync as existsSync26, mkdirSync as mkdirSync11, readFileSync as readFileSync24, writeFileSync as writeFileSync12 } from "fs";
68802
- import { dirname as dirname14, isAbsolute as isAbsolute5, join as join37, resolve as resolve12 } from "path";
69575
+ import { existsSync as existsSync28, mkdirSync as mkdirSync11, readFileSync as readFileSync24, writeFileSync as writeFileSync12 } from "fs";
69576
+ import { dirname as dirname14, isAbsolute as isAbsolute5, join as join38, resolve as resolve13 } from "path";
68803
69577
  var LEDGER_DIR = ".ultra11y/verdicts";
68804
69578
  function ledgerPath(standard, root = ".") {
68805
- return join37(root, LEDGER_DIR, `${standard}.json`);
69579
+ return join38(root, LEDGER_DIR, `${standard}.json`);
68806
69580
  }
68807
69581
  var norm3 = (s) => s.replace(/\s+/g, " ").trim();
68808
69582
  var canonicalFile2 = (file) => {
@@ -68814,7 +69588,7 @@ var canonicalFile2 = (file) => {
68814
69588
  function identityFile(file, root) {
68815
69589
  const canonical = canonicalFile2(file);
68816
69590
  if (root === void 0 || canonical.startsWith(`${PAGES_DIR}/`) || !isAbsolute5(canonical)) return canonical;
68817
- return repoRelative(canonical, resolve12(root));
69591
+ return repoRelative(canonical, resolve13(root));
68818
69592
  }
68819
69593
  function portableFile(file, root) {
68820
69594
  return identityFile(file, root);
@@ -68873,7 +69647,7 @@ function verdictStillHolds(entry2, today2, opts) {
68873
69647
  `Ledger verdict is STALE \u2014 ${added.size} piece(s) of evidence are NEW since the verdict was recorded on ${entry2.date} (${was} item(s) then, ${today2.length} now). A conformity covers what was read, and this was not. Re-adjudicate this criterion.`
68874
69648
  );
68875
69649
  }
68876
- const exists = opts.fileExists ?? ((f) => existsSync26(f));
69650
+ const exists = opts.fileExists ?? ((f) => existsSync28(f));
68877
69651
  const contributing = /* @__PURE__ */ new Set([...evidenceFilesOf(today2), ...evidenceFilesOf(today2, root)]);
68878
69652
  const silent = (entry2.evidenceFiles ?? []).filter((f) => !contributing.has(f) && !contributing.has(identityFile(f, root)) && exists(f));
68879
69653
  if (silent.length > 0) {
@@ -68911,7 +69685,7 @@ function isLedger(v) {
68911
69685
  return !!o && typeof o === "object" && o.tool === "ultra11y" && o.kind === "verdict-ledger" && Array.isArray(o.entries);
68912
69686
  }
68913
69687
  function readLedger(path) {
68914
- if (!existsSync26(path)) return void 0;
69688
+ if (!existsSync28(path)) return void 0;
68915
69689
  try {
68916
69690
  const parsed = JSON.parse(readFileSync24(path, "utf8"));
68917
69691
  return isLedger(parsed) ? parsed : void 0;
@@ -68920,7 +69694,7 @@ function readLedger(path) {
68920
69694
  }
68921
69695
  }
68922
69696
  function unreadableCaptures(audit2, cwd = ".") {
68923
- return (audit2.scope.pagesAudited ?? []).filter((id) => !existsSync26(join37(cwd, PAGES_DIR, id, "dom.html")));
69697
+ return (audit2.scope.pagesAudited ?? []).filter((id) => !existsSync28(join38(cwd, PAGES_DIR, id, "dom.html")));
68924
69698
  }
68925
69699
  function writeLedger(path, ledger) {
68926
69700
  mkdirSync11(dirname14(path), { recursive: true });
@@ -69018,7 +69792,7 @@ function replayLedger(audit2, ledger, opts = {}) {
69018
69792
  const unreadable2 = (audit2.scope.pagesAudited ?? []).filter((id) => {
69019
69793
  const canonical = `${PAGES_DIR}/${id}/dom.html`;
69020
69794
  const fromInputs = currentFiles.get(canonical);
69021
- return !(fromInputs && existsSync26(fromInputs)) && !existsSync26(join37(root, canonical));
69795
+ return !(fromInputs && existsSync28(fromInputs)) && !existsSync28(join38(root, canonical));
69022
69796
  });
69023
69797
  const harvestComplete = unreadable2.length === 0;
69024
69798
  for (const e of ledger.entries) if (!open.has(e.criteriaId)) obsolete.push(e.criteriaId);
@@ -69031,7 +69805,7 @@ function replayLedger(audit2, ledger, opts = {}) {
69031
69805
  }
69032
69806
  const held = verdictStillHolds(e, it.evidence, {
69033
69807
  harvestComplete,
69034
- fileExists: (f) => existsSync26(join37(root, f)),
69808
+ fileExists: (f) => existsSync28(join38(root, f)),
69035
69809
  root
69036
69810
  });
69037
69811
  if (!held.holds) {
@@ -69064,8 +69838,8 @@ function replayLedger(audit2, ledger, opts = {}) {
69064
69838
 
69065
69839
  // src/agent-cli.ts
69066
69840
  import { spawn as spawn2 } from "child_process";
69067
- import { existsSync as existsSync27 } from "fs";
69068
- import { delimiter, join as join38 } from "path";
69841
+ import { existsSync as existsSync29 } from "fs";
69842
+ import { delimiter as delimiter2, join as join39 } from "path";
69069
69843
 
69070
69844
  // src/verdict-rules.ts
69071
69845
  var VERDICT_KINDS = `Rule it (the apply gate is FAIL-CLOSED \u2014 a verdict missing its required field does not fold, and its criterion goes back to \xAB to assess \xBB carrying the refusal):
@@ -69077,7 +69851,7 @@ var WORKLIST_RULE = `THE WORKLIST IS THE RESIDUAL. Return exactly one verdict fo
69077
69851
  var ABSENCE_RULE = `AN NC SHAPED LIKE AN ABSENCE IS STILL ANCHORED. \xAB No second navigation system \xBB, \xAB no search engine \xBB, \xAB no error message suggests the expected format \xBB \u2014 an absence is OBSERVED somewhere: cite the element and the page you observed it on. And when the criterion's subject exists nowhere in the audited scope, the verdict is \`NA\` with its justification, never \`NC\`.
69078
69852
 
69079
69853
  AND CITE FROM THIS CRITERION'S OWN ANCHORS, NOT THE THING YOU ARE RULING OUT. An absence pulls you toward the element you are arguing ABOUT \u2014 the search form that is not a site search engine, the menu that is not a second navigation system \u2014 and that element is, precisely because it is off-topic, absent from what this criterion was harvested. A citation on one of the criterion's own anchors is vouched for by the harvest; one outside it has its snippet verified LITERALLY, character for character, and a retyping then fails. Cite the region you inspected \u2014 the \`header\`, the \`nav\`, the \`footer\` the brief listed \u2014 and say in the justification what you did not find in it.`;
69080
- var CAPTURE_RULE = `THE RENDERED PAGE MAY BE ON DISK. When a criterion's evidence is anchored under \`.ultra11y/pages/<id>/\`, the browser already ran: \`dom.html\`, \`styles.json\`, \`boxes.json\`, \`axtree.json\` and \`screen.png\` are there to read. \`needs-rendered-dom\` is refused on such a criterion \u2014 decide it from those files, or answer \`undecidable\` and say what the capture does not settle.`;
69854
+ var CAPTURE_RULE = `THE RENDERED PAGE MAY BE ON DISK. When a criterion's evidence is anchored under \`.ultra11y/pages/<id>/\`, the browser already ran: \`dom.html\` is there to read, beside whichever digests its producer captured (\`styles.json\`, \`boxes.json\`, \`css.json\`, \`probes.json\`, \`screen.png\`\u2026) \u2014 the brief names the ones that exist, and only those. \`needs-rendered-dom\` is refused on such a criterion \u2014 decide it from those files, or answer \`undecidable\` and say what the capture does not settle.`;
69081
69855
  var NEVER_GUESS_RULE = `Never guess. A criterion you cannot decide from real evidence stays \`manual\` with its reason \u2014 that is a valid, honest verdict, and it is worth more than a verdict the gate throws away.`;
69082
69856
  var SCOPE_RULE = `Rule ONLY on the criteria presented. Never introduce another \u2014 a verdict for a criterion nobody asked about is dropped, and under the fold it would otherwise overwrite what the deterministic engine already decided.`;
69083
69857
  var CONFORMITY_RULE = `A \`C\` WILL BE ATTACKED, exactly as an \`NC\` is. Every conformity you record goes into an adversarial worklist where a second reader opens your citations and asks whether they ESTABLISH the criterion or merely show that its subject exists \u2014 a present \`alt\` is not a relevant \`alt\`, a present \`<title>\` is not a title that describes the page. Cite the evidence that answers the criterion's own question, and when the evidence only proves presence, the honest verdict is \`manual\`.`;
@@ -69346,7 +70120,7 @@ var DEFAULT_CLI_MODEL = "claude-haiku-4-5-20251001";
69346
70120
  var EFFORT_LEVELS = ["low", "medium", "high", "xhigh", "max"];
69347
70121
  var DEFAULT_TIMEOUT_MS2 = 10 * 6e4;
69348
70122
  function realSpawn(argv, input, timeoutMs) {
69349
- return new Promise((resolve19, reject) => {
70123
+ return new Promise((resolve20, reject) => {
69350
70124
  const child = spawn2(argv[0], argv.slice(1), { stdio: ["pipe", "pipe", "pipe"] });
69351
70125
  let stdout = "";
69352
70126
  let stderr = "";
@@ -69367,7 +70141,7 @@ function realSpawn(argv, input, timeoutMs) {
69367
70141
  });
69368
70142
  child.on("close", (code2) => {
69369
70143
  clearTimeout(timer);
69370
- resolve19({ code: code2, stdout, stderr, timedOut });
70144
+ resolve20({ code: code2, stdout, stderr, timedOut });
69371
70145
  });
69372
70146
  child.stdin.end(input);
69373
70147
  });
@@ -69375,10 +70149,10 @@ function realSpawn(argv, input, timeoutMs) {
69375
70149
  function claudeBin() {
69376
70150
  const pinned = process.env.ULTRA11Y_CLAUDE_BIN?.trim();
69377
70151
  if (pinned) return [pinned];
69378
- for (const dir of (process.env.PATH ?? "").split(delimiter)) {
70152
+ for (const dir of (process.env.PATH ?? "").split(delimiter2)) {
69379
70153
  if (!dir) continue;
69380
- const candidate = join38(dir, "claude");
69381
- if (existsSync27(candidate)) return [candidate];
70154
+ const candidate = join39(dir, "claude");
70155
+ if (existsSync29(candidate)) return [candidate];
69382
70156
  }
69383
70157
  return ["npx", "--yes", "@anthropic-ai/claude-code"];
69384
70158
  }
@@ -69536,14 +70310,14 @@ async function runCli2(argv, prompt, opts, extract) {
69536
70310
 
69537
70311
  // src/agent-codex.ts
69538
70312
  import { spawn as spawn3 } from "child_process";
69539
- import { existsSync as existsSync28, mkdtempSync as mkdtempSync3, rmSync as rmSync4, writeFileSync as writeFileSync13 } from "fs";
70313
+ import { existsSync as existsSync30, mkdtempSync as mkdtempSync3, rmSync as rmSync4, writeFileSync as writeFileSync13 } from "fs";
69540
70314
  import { tmpdir as tmpdir2 } from "os";
69541
- import { delimiter as delimiter2, dirname as dirname15, join as join39 } from "path";
70315
+ import { delimiter as delimiter3, dirname as dirname15, join as join40 } from "path";
69542
70316
  var MAX_ATTEMPTS3 = 4;
69543
70317
  var CODEX_EFFORT_LEVELS = ["minimal", "low", "medium", "high", "xhigh"];
69544
70318
  var DEFAULT_CODEX_TIMEOUT_MS = 10 * 6e4;
69545
70319
  function realSpawn2(argv, input, timeoutMs) {
69546
- return new Promise((resolve19, reject) => {
70320
+ return new Promise((resolve20, reject) => {
69547
70321
  const child = spawn3(argv[0], argv.slice(1), { stdio: ["pipe", "pipe", "pipe"] });
69548
70322
  let stdout = "";
69549
70323
  let stderr = "";
@@ -69564,7 +70338,7 @@ function realSpawn2(argv, input, timeoutMs) {
69564
70338
  });
69565
70339
  child.on("close", (code2) => {
69566
70340
  clearTimeout(timer);
69567
- resolve19({ code: code2, stdout, stderr, timedOut });
70341
+ resolve20({ code: code2, stdout, stderr, timedOut });
69568
70342
  });
69569
70343
  child.stdin.end(input);
69570
70344
  });
@@ -69572,10 +70346,10 @@ function realSpawn2(argv, input, timeoutMs) {
69572
70346
  function codexBin() {
69573
70347
  const pinned = process.env.ULTRA11Y_CODEX_BIN?.trim();
69574
70348
  if (pinned) return [pinned];
69575
- for (const dir of (process.env.PATH ?? "").split(delimiter2)) {
70349
+ for (const dir of (process.env.PATH ?? "").split(delimiter3)) {
69576
70350
  if (!dir) continue;
69577
- const candidate = join39(dir, "codex");
69578
- if (existsSync28(candidate)) return [candidate];
70351
+ const candidate = join40(dir, "codex");
70352
+ if (existsSync30(candidate)) return [candidate];
69579
70353
  }
69580
70354
  return ["npx", "--yes", "@openai/codex"];
69581
70355
  }
@@ -69683,14 +70457,14 @@ WORKLIST
69683
70457
 
69684
70458
  ${worklist}`;
69685
70459
  }
69686
- var sleep3 = (ms) => ms <= 0 ? Promise.resolve() : new Promise((resolve19) => setTimeout(resolve19, ms));
70460
+ var sleep3 = (ms) => ms <= 0 ? Promise.resolve() : new Promise((resolve20) => setTimeout(resolve20, ms));
69687
70461
  function transient(message) {
69688
70462
  return /429|rate.?limit|overload|temporar|try again|service unavailable|\b5\d\d\b/i.test(message);
69689
70463
  }
69690
70464
  async function runCodex(schema, prompt, opts, extract) {
69691
70465
  const run2 = opts.spawnImpl ?? realSpawn2;
69692
- const dir = mkdtempSync3(join39(tmpdir2(), "ultra11y-codex-"));
69693
- const schemaPath = join39(dir, "schema.json");
70466
+ const dir = mkdtempSync3(join40(tmpdir2(), "ultra11y-codex-"));
70467
+ const schemaPath = join40(dir, "schema.json");
69694
70468
  writeFileSync13(schemaPath, `${JSON.stringify(schema)}
69695
70469
  `, { mode: 384 });
69696
70470
  let lastError = "";
@@ -69744,9 +70518,9 @@ async function refuteBatchCodex(items, prompt, opts, lang = "en") {
69744
70518
 
69745
70519
  // src/scan.ts
69746
70520
  import { execFileSync as execFileSync6 } from "child_process";
69747
- import { mkdtempSync as mkdtempSync4, writeFileSync as writeFileSync14, existsSync as existsSync30, statSync as statSync15, readdirSync as readdirSync7, rmSync as rmSync5, readFileSync as readFileSync25 } from "fs";
70521
+ import { mkdtempSync as mkdtempSync4, writeFileSync as writeFileSync14, existsSync as existsSync32, statSync as statSync16, readdirSync as readdirSync7, rmSync as rmSync5, readFileSync as readFileSync25 } from "fs";
69748
70522
  import { tmpdir as tmpdir3 } from "os";
69749
- import { join as join40, resolve as resolve13 } from "path";
70523
+ import { join as join41, resolve as resolve14 } from "path";
69750
70524
  import { fileURLToPath as fileURLToPath4 } from "url";
69751
70525
 
69752
70526
  // src/crawl.ts
@@ -69852,7 +70626,7 @@ async function crawlUrls(start2, opts) {
69852
70626
  }
69853
70627
 
69854
70628
  // src/sample.ts
69855
- import { existsSync as existsSync29 } from "fs";
70629
+ import { existsSync as existsSync31 } from "fs";
69856
70630
  function looksLikeTarget(u) {
69857
70631
  return /^https?:\/\//i.test(u) || /^(\.\.?[/\\]|[/\\])/.test(u) || /\.x?html?$/i.test(u);
69858
70632
  }
@@ -69888,7 +70662,7 @@ function validateSample(raw) {
69888
70662
  if (p.auth !== void 0 && typeof p.auth !== "boolean") err2(`sample.pages[${i2}].auth`, "auth must be a boolean");
69889
70663
  if (p.storageState !== void 0 && (typeof p.storageState !== "string" || p.storageState.trim() === "")) {
69890
70664
  err2(`sample.pages[${i2}].storageState`, "storageState must be a non-empty file path string");
69891
- } else if (typeof p.storageState === "string" && p.storageState.trim() !== "" && !existsSync29(p.storageState)) {
70665
+ } else if (typeof p.storageState === "string" && p.storageState.trim() !== "" && !existsSync31(p.storageState)) {
69892
70666
  warn(
69893
70667
  `sample.pages[${i2}].storageState`,
69894
70668
  `storageState path not found: "${p.storageState}" (resolved from the current directory) \u2014 the scan will not be able to load this session`
@@ -70027,6 +70801,7 @@ const target = process.argv[2];
70027
70801
  const isFile = target.startsWith("/work/");
70028
70802
  const SNAPSHOT = process.env.ULTRA11Y_SNAPSHOT !== "0";
70029
70803
  const COLLECT = ${JSON.stringify(COLLECT_SNAPSHOT)};
70804
+ const REFLOW = ${JSON.stringify(REFLOW_PROBE)};
70030
70805
  const browser = await chromium.launch({ args: ["--no-sandbox", "--disable-dev-shm-usage"] });
70031
70806
  try {
70032
70807
  const page = await browser.newPage();
@@ -70043,10 +70818,9 @@ try {
70043
70818
  await page.addScriptTag({ content: axe.source });
70044
70819
  const axeRes = await page.evaluate(async () => await window.axe.run(document, { resultTypes: ["violations"] }));
70045
70820
  await page.setViewportSize({ width: 320, height: 800 });
70046
- const reflow = await page.evaluate(() => {
70047
- const el = document.scrollingElement || document.documentElement;
70048
- return { horizontalScroll: el.scrollWidth > el.clientWidth + 2 };
70049
- });
70821
+ // The same probe the local runtime runs (src/probes.ts REFLOW_PROBE): it waits for the
70822
+ // relayout and names the boxes that widen the page, instead of a bare yes/no.
70823
+ const reflow = await page.evaluate(REFLOW);
70050
70824
  const violations = axeRes.violations.map((v) => ({
70051
70825
  id: v.id, impact: v.impact, help: v.help, tags: v.tags,
70052
70826
  nodes: v.nodes.slice(0, 10).map((n) => ({ target: n.target, html: (n.html || "").slice(0, 200) })),
@@ -70087,11 +70861,11 @@ function imageExists(tag) {
70087
70861
  }
70088
70862
  var CTX_PREFIX = "ultra11y-dyn-";
70089
70863
  function buildImage(tag = IMAGE_TAG) {
70090
- const ctx = mkdtempSync4(join40(tmpdir3(), CTX_PREFIX));
70864
+ const ctx = mkdtempSync4(join41(tmpdir3(), CTX_PREFIX));
70091
70865
  try {
70092
- writeFileSync14(join40(ctx, "runner.mjs"), RUNNER);
70093
- writeFileSync14(join40(ctx, "package.json"), PKG);
70094
- writeFileSync14(join40(ctx, "Dockerfile"), DOCKERFILE);
70866
+ writeFileSync14(join41(ctx, "runner.mjs"), RUNNER);
70867
+ writeFileSync14(join41(ctx, "package.json"), PKG);
70868
+ writeFileSync14(join41(ctx, "Dockerfile"), DOCKERFILE);
70095
70869
  execFileSync6("docker", ["build", "-t", tag, ctx], { stdio: "inherit", timeout: 9e5 });
70096
70870
  } finally {
70097
70871
  rmSync5(ctx, { recursive: true, force: true });
@@ -70102,7 +70876,7 @@ function cleanTempContexts() {
70102
70876
  const dir = tmpdir3();
70103
70877
  for (const name2 of readdirSync7(dir)) {
70104
70878
  if (!name2.startsWith(CTX_PREFIX)) continue;
70105
- rmSync5(join40(dir, name2), { recursive: true, force: true });
70879
+ rmSync5(join41(dir, name2), { recursive: true, force: true });
70106
70880
  removed++;
70107
70881
  }
70108
70882
  return removed;
@@ -70118,6 +70892,10 @@ function cleanDynamic(tag = IMAGE_TAG) {
70118
70892
  }
70119
70893
  return { imageRemoved, tempContextsRemoved: cleanTempContexts() };
70120
70894
  }
70895
+ function reflowWidening(reflow) {
70896
+ const sels = (reflow?.widening ?? []).map((w) => w.selector).filter(Boolean);
70897
+ return sels.length ? sels.join(", ") : void 0;
70898
+ }
70121
70899
  function pageIdFor(url) {
70122
70900
  const isUrl3 = /^https?:\/\//i.test(url);
70123
70901
  if (isUrl3) return slugifyPageId(url);
@@ -70232,7 +71010,7 @@ function runRunner(target, isFile, tag, snapshot = true) {
70232
71010
  const hostTarget = target;
70233
71011
  const args2 = ["run", "--rm"];
70234
71012
  if (!snapshot) args2.push("-e", "ULTRA11Y_SNAPSHOT=0");
70235
- if (isFile) args2.push("-v", `${resolve13(target)}:${MOUNT}:ro`);
71013
+ if (isFile) args2.push("-v", `${resolve14(target)}:${MOUNT}:ro`);
70236
71014
  else {
70237
71015
  const gw = loopbackToHostGateway(target);
70238
71016
  if (gw.addHost && process.platform === "linux") {
@@ -70292,16 +71070,19 @@ function toDynamicResult(out2, target, lang = "en", engine = "axe-core@playwrigh
70292
71070
  }
70293
71071
  }
70294
71072
  if (out2.reflow?.horizontalScroll) {
71073
+ const widening = reflowWidening(out2.reflow);
71074
+ const first = out2.reflow.widening?.[0];
70295
71075
  findings.push({
70296
71076
  criteriaId: "1.4.10",
70297
71077
  axeRule: "reflow",
70298
71078
  impact: "serious",
70299
71079
  severity: "majeur",
70300
- message: lang === "fr" ? "D\xE9filement horizontal \xE0 320px de large \u2014 le contenu ne se redistribue pas (reflow)." : "Horizontal scrolling at 320px width \u2014 content does not reflow.",
70301
- selector: "document",
70302
- snippet: "",
71080
+ message: resolveMessage({ message: "", msg: { id: "dyn-reflow", params: widening ? { widening } : {} } }, lang),
71081
+ selector: first?.selector || "document",
71082
+ snippet: first?.html ?? "",
70303
71083
  engine: "reflow",
70304
- page
71084
+ page,
71085
+ ...widening ? { widening } : {}
70305
71086
  });
70306
71087
  }
70307
71088
  for (const { key: key2, engine: probe } of PROBE_FIELDS) {
@@ -70327,7 +71108,7 @@ function toDynamicResult(out2, target, lang = "en", engine = "axe-core@playwrigh
70327
71108
  var DOCKER_TESTED_SCS = ["1.4.10"];
70328
71109
  function runScan(opts) {
70329
71110
  const isUrl3 = /^https?:\/\//i.test(opts.target);
70330
- if (!isUrl3 && !existsSync30(opts.target)) {
71111
+ if (!isUrl3 && !existsSync32(opts.target)) {
70331
71112
  throw new Error(`File not found: ${opts.target}. Pass an http(s):// URL or an existing HTML file.`);
70332
71113
  }
70333
71114
  if (!dockerAvailable()) {
@@ -70335,7 +71116,7 @@ function runScan(opts) {
70335
71116
  }
70336
71117
  const tag = opts.tag ?? IMAGE_TAG;
70337
71118
  if (!imageExists(tag)) buildImage(tag);
70338
- const isFile = !isUrl3 && existsSync30(opts.target) && statSync15(opts.target).isFile();
71119
+ const isFile = !isUrl3 && existsSync32(opts.target) && statSync16(opts.target).isFile();
70339
71120
  const out2 = runRunner(opts.target, isFile, tag, Boolean(opts.snapshotRoot));
70340
71121
  const id = opts.snapshotRoot ? writeRunnerSnapshot(opts.snapshotRoot, out2, opts.target) : void 0;
70341
71122
  return { ...toDynamicResult(out2, opts.target), testedScs: [...DOCKER_TESTED_SCS], ...id ? { snapshots: [id] } : {} };
@@ -70425,7 +71206,7 @@ async function runCrawlScan(opts) {
70425
71206
  var sevRank = { bloquant: 3, majeur: 2, mineur: 1 };
70426
71207
  function resolveHostAnchor(file, snippet2) {
70427
71208
  const s = snippet2?.trim();
70428
- if (!s || !existsSync30(file)) return null;
71209
+ if (!s || !existsSync32(file)) return null;
70429
71210
  let source;
70430
71211
  try {
70431
71212
  source = readFileSync25(file, "utf8");
@@ -70485,7 +71266,7 @@ function mergeDynamic(audit2, dynamic, lang = "en") {
70485
71266
  for (const df of dynamic.findings) {
70486
71267
  const c2 = byId2.get(df.criteriaId);
70487
71268
  if (!c2) continue;
70488
- const msg = df.engine === "reflow" ? { id: "dyn-reflow" } : { id: "dyn-remediation", params: { message: df.message } };
71269
+ const msg = df.engine === "reflow" ? { id: "dyn-reflow", ...df.widening ? { params: { widening: df.widening } } : {} } : { id: "dyn-remediation", params: { message: df.message } };
70489
71270
  const file = df.page ?? dynamic.target;
70490
71271
  const anchor = resolveHostAnchor(file, df.snippet);
70491
71272
  const finding = {
@@ -70640,9 +71421,9 @@ function mergeSnapshotAudit(base, snap) {
70640
71421
  }
70641
71422
 
70642
71423
  // src/scan-local.ts
70643
- import { existsSync as existsSync31, realpathSync as realpathSync4, statSync as statSync16 } from "fs";
71424
+ import { existsSync as existsSync33, realpathSync as realpathSync4, statSync as statSync17 } from "fs";
70644
71425
  import { createRequire } from "module";
70645
- import { dirname as dirname16, join as join41, resolve as resolve14 } from "path";
71426
+ import { dirname as dirname16, join as join42, resolve as resolve15 } from "path";
70646
71427
  var LOCAL_ENGINE = "axe-core@playwright (local)";
70647
71428
  var LOCAL_TESTED_SCS = ["1.4.4", "1.4.10", "1.4.12", "2.4.7", "2.4.11", "1.4.13", "2.1.2"];
70648
71429
  function localTestedScs(interact) {
@@ -70657,7 +71438,7 @@ function measuredScs(outs, interact) {
70657
71438
  var PW_SPEC = "@playwright/test";
70658
71439
  var AXE_SPEC = "@axe-core/playwright";
70659
71440
  function resolveAnchors(cwd) {
70660
- return [resolve14(cwd, "package.json"), import.meta.url];
71441
+ return [resolve15(cwd, "package.json"), import.meta.url];
70661
71442
  }
70662
71443
  function requireRuntime(cwd, spec) {
70663
71444
  let last;
@@ -70691,7 +71472,7 @@ function localTierStatus(cwd, choice = {}) {
70691
71472
  const executable = choice.browserPath;
70692
71473
  let isFile = false;
70693
71474
  try {
70694
- isFile = statSync16(executable).isFile();
71475
+ isFile = statSync17(executable).isFile();
70695
71476
  } catch {
70696
71477
  isFile = false;
70697
71478
  }
@@ -70707,9 +71488,9 @@ function localTierStatus(cwd, choice = {}) {
70707
71488
  try {
70708
71489
  const pw = requireRuntime(cwd, PW_SPEC);
70709
71490
  const bin = pw.chromium?.executablePath?.();
70710
- if (typeof bin === "string" && bin.length > 0 && !existsSync31(bin)) {
71491
+ if (typeof bin === "string" && bin.length > 0 && !existsSync33(bin)) {
70711
71492
  const pw2 = resolvedPlaywright(cwd);
70712
- const cliJs = pw2 ? join41(dirname16(pw2.path), "cli.js") : void 0;
71493
+ const cliJs = pw2 ? join42(dirname16(pw2.path), "cli.js") : void 0;
70713
71494
  return {
70714
71495
  ok: false,
70715
71496
  reason: `no browser binary at ${bin} for ${PW_SPEC}${pw2?.version ? `@${pw2.version}` : ""}${pw2 ? ` (${pw2.path})` : ""} \u2014 run \`${cliJs ? `node ${cliJs}` : "npx playwright"} install chromium\`, or pass --runtime local to fall back on an installed Google Chrome`
@@ -70764,7 +71545,7 @@ var realDir = (dir) => {
70764
71545
  try {
70765
71546
  return realpathSync4(dir);
70766
71547
  } catch {
70767
- return resolve14(dir);
71548
+ return resolve15(dir);
70768
71549
  }
70769
71550
  };
70770
71551
  var MISSING_BROWSER = /Executable doesn'?t exist|playwright install|browserType\.launch/i;
@@ -70800,8 +71581,8 @@ async function launchChromium(chromium, cwd = ".", warn = (m) => console.error(m
70800
71581
  const msg = first instanceof Error ? first.message : String(first);
70801
71582
  const pw = resolvedPlaywright(cwd);
70802
71583
  const which = pw ? `${PW_SPEC}${pw.version ? `@${pw.version}` : ""} resolved at ${pw.path}` : `${PW_SPEC} (resolution path unknown)`;
70803
- const own = pw ? !pw.path.startsWith(realDir(cwd)) && !pw.path.startsWith(resolve14(cwd)) : false;
70804
- const cliJs = pw ? join41(dirname16(pw.path), "cli.js") : "node_modules/@playwright/test/cli.js";
71584
+ const own = pw ? !pw.path.startsWith(realDir(cwd)) && !pw.path.startsWith(resolve15(cwd)) : false;
71585
+ const cliJs = pw ? join42(dirname16(pw.path), "cli.js") : "node_modules/@playwright/test/cli.js";
70805
71586
  throw new Error(
70806
71587
  `Could not launch Chromium: the browser for ${which} is not installed, and no installed Google Chrome was found either. Install the browser for THAT Playwright \u2014 \`node ${cliJs} install chromium\`${own ? " (this is ultra11y's own Playwright, not the audited project's)" : ""} \u2014 or install Google Chrome, or use --runtime docker. (${msg.split("\n")[0]})`
70807
71588
  );
@@ -70987,7 +71768,7 @@ async function runOnPage(browser, AxeBuilder, target, isFile, opts) {
70987
71768
  const page = await context.newPage();
70988
71769
  const empty = [];
70989
71770
  try {
70990
- const url = isFile ? "file://" + resolve14(target) : target;
71771
+ const url = isFile ? "file://" + resolve15(target) : target;
70991
71772
  const response = await page.goto(url, { waitUntil: "load", timeout: 45e3 });
70992
71773
  await page.waitForLoadState("networkidle", { timeout: 8e3 }).catch(() => {
70993
71774
  });
@@ -71091,6 +71872,7 @@ async function runOnPage(browser, AxeBuilder, target, isFile, opts) {
71091
71872
  await page.setViewportSize({ width: 1280, height: 900 }).catch(() => {
71092
71873
  });
71093
71874
  const textSpacing = await ran("1.4.12", [], async () => {
71875
+ await page.evaluate(TEXT_SPACING_BASELINE_STEP);
71094
71876
  await page.addStyleTag({ content: TEXT_SPACING_CSS });
71095
71877
  return await page.evaluate(TEXT_SPACING_PROBE);
71096
71878
  });
@@ -71138,10 +71920,10 @@ async function runOnPage(browser, AxeBuilder, target, isFile, opts) {
71138
71920
  }
71139
71921
  async function runScanLocal(opts) {
71140
71922
  const isUrl3 = /^https?:\/\//i.test(opts.target);
71141
- if (!isUrl3 && !existsSync31(opts.target)) {
71923
+ if (!isUrl3 && !existsSync33(opts.target)) {
71142
71924
  throw new Error(`File not found: ${opts.target}. Pass an http(s):// URL or an existing HTML file.`);
71143
71925
  }
71144
- const isFile = !isUrl3 && statSync16(opts.target).isFile();
71926
+ const isFile = !isUrl3 && statSync17(opts.target).isFile();
71145
71927
  const lang = opts.lang ?? "en";
71146
71928
  const interact = opts.interact !== false;
71147
71929
  const { chromium, AxeBuilder } = resolveLocalDeps(opts.cwd);
@@ -71254,7 +72036,7 @@ async function runSampleScanLocal(pages, opts) {
71254
72036
  });
71255
72037
  continue;
71256
72038
  }
71257
- const requestedUrl = isFile ? "file://" + resolve14(page.url) : page.url;
72039
+ const requestedUrl = isFile ? "file://" + resolve15(page.url) : page.url;
71258
72040
  const landedUrl = out2.landedUrl ?? out2.url;
71259
72041
  if (!landedOnRequestedPage(requestedUrl, landedUrl)) {
71260
72042
  redirected.push({ id: page.id, name: page.name, requested: page.url, landed: landedUrl, reason: "redirect" });
@@ -71794,7 +72576,7 @@ function fixSummary(r, lang = "fr", write = false, standard = CORE2) {
71794
72576
  // src/init.ts
71795
72577
  import { writeFileSync as writeFileSync16, mkdirSync as mkdirSync12, chmodSync as chmodSync2, realpathSync as realpathSync5 } from "fs";
71796
72578
  import { execFileSync as execFileSync7 } from "child_process";
71797
- import { join as join42, relative as relative6, sep as sep4 } from "path";
72579
+ import { join as join43, relative as relative6, sep as sep4 } from "path";
71798
72580
  var EN_SEV = { bloquant: "blocking", majeur: "major", mineur: "minor" };
71799
72581
  function repoRoot() {
71800
72582
  try {
@@ -71912,23 +72694,23 @@ jobs:
71912
72694
  `;
71913
72695
  }
71914
72696
  function writeHook(root, enginePath, failOn, mode = "staged") {
71915
- const dir = join42(root, ".git", "hooks");
72697
+ const dir = join43(root, ".git", "hooks");
71916
72698
  mkdirSync12(dir, { recursive: true });
71917
- const path = join42(dir, "pre-commit");
72699
+ const path = join43(dir, "pre-commit");
71918
72700
  writeFileSync16(path, mode === "baseline" ? hookScript(enginePath, failOn) : stagedHookScript(enginePath, failOn));
71919
72701
  chmodSync2(path, 493);
71920
72702
  return path;
71921
72703
  }
71922
72704
  function writeCi(root, enginePath, failOn) {
71923
- const dir = join42(root, ".github", "workflows");
72705
+ const dir = join43(root, ".github", "workflows");
71924
72706
  mkdirSync12(dir, { recursive: true });
71925
- const path = join42(dir, "a11y.yml");
72707
+ const path = join43(dir, "a11y.yml");
71926
72708
  writeFileSync16(path, ciWorkflow(enginePath, failOn));
71927
72709
  return path;
71928
72710
  }
71929
72711
 
71930
72712
  // src/install/json-edit.ts
71931
- import { copyFileSync as copyFileSync2, existsSync as existsSync32, mkdirSync as mkdirSync13, readFileSync as readFileSync26, renameSync as renameSync3, rmSync as rmSync6, writeFileSync as writeFileSync17 } from "fs";
72713
+ import { copyFileSync as copyFileSync2, existsSync as existsSync34, mkdirSync as mkdirSync13, readFileSync as readFileSync26, renameSync as renameSync3, rmSync as rmSync6, writeFileSync as writeFileSync17 } from "fs";
71932
72714
  import { dirname as dirname17 } from "path";
71933
72715
  var SettingsParseError = class extends Error {
71934
72716
  constructor(path, cause) {
@@ -71942,10 +72724,10 @@ function stamp() {
71942
72724
  return (/* @__PURE__ */ new Date()).toISOString().replaceAll(/[:.]/g, "-");
71943
72725
  }
71944
72726
  function writeTextWithBackup(path, content, marker = "ultra11y") {
71945
- if (existsSync32(path) && readFileSync26(path, "utf8") === content) return { path, changed: false };
72727
+ if (existsSync34(path) && readFileSync26(path, "utf8") === content) return { path, changed: false };
71946
72728
  mkdirSync13(dirname17(path), { recursive: true });
71947
72729
  let backup;
71948
- if (existsSync32(path)) {
72730
+ if (existsSync34(path)) {
71949
72731
  backup = `${path}.${marker}-backup-${stamp()}`;
71950
72732
  copyFileSync2(path, backup);
71951
72733
  }
@@ -71961,7 +72743,7 @@ function writeTextWithBackup(path, content, marker = "ultra11y") {
71961
72743
  }
71962
72744
  function editJsonFile(path, mutate) {
71963
72745
  let root = {};
71964
- if (existsSync32(path)) {
72746
+ if (existsSync34(path)) {
71965
72747
  const raw = readFileSync26(path, "utf8");
71966
72748
  if (raw.trim()) {
71967
72749
  let parsed;
@@ -71978,7 +72760,7 @@ function editJsonFile(path, mutate) {
71978
72760
  }
71979
72761
  const before = JSON.stringify(root);
71980
72762
  mutate(root);
71981
- if (JSON.stringify(root) === before && existsSync32(path)) return { path, changed: false };
72763
+ if (JSON.stringify(root) === before && existsSync34(path)) return { path, changed: false };
71982
72764
  return writeTextWithBackup(path, `${JSON.stringify(root, null, 2)}
71983
72765
  `);
71984
72766
  }
@@ -72025,7 +72807,7 @@ function claudeCodeWired(settingsPath) {
72025
72807
  }
72026
72808
 
72027
72809
  // src/install/text-edit.ts
72028
- import { existsSync as existsSync33, readFileSync as readFileSync27, rmSync as rmSync7 } from "fs";
72810
+ import { existsSync as existsSync35, readFileSync as readFileSync27, rmSync as rmSync7 } from "fs";
72029
72811
  var BLOCK_BEGIN = "<!-- BEGIN ultra11y (managed by `ultra11y install --agents-md`; edit outside this block) -->";
72030
72812
  var BLOCK_END = "<!-- END ultra11y -->";
72031
72813
  var blockRe = () => new RegExp(`${escapeRe2(BLOCK_BEGIN)}[\\s\\S]*?${escapeRe2(BLOCK_END)}\\n?`);
@@ -72037,14 +72819,14 @@ function upsertManagedBlock(path, body3) {
72037
72819
  ${body3.trim()}
72038
72820
  ${BLOCK_END}
72039
72821
  `;
72040
- if (!existsSync33(path)) return writeTextWithBackup(path, block);
72822
+ if (!existsSync35(path)) return writeTextWithBackup(path, block);
72041
72823
  const current = readFileSync27(path, "utf8");
72042
72824
  if (blockRe().test(current)) return writeTextWithBackup(path, current.replace(blockRe(), block));
72043
72825
  const sep8 = current.endsWith("\n\n") ? "" : current.endsWith("\n") ? "\n" : "\n\n";
72044
72826
  return writeTextWithBackup(path, `${current}${sep8}${block}`);
72045
72827
  }
72046
72828
  function removeManagedBlock(path) {
72047
- if (!existsSync33(path)) return { path, changed: false };
72829
+ if (!existsSync35(path)) return { path, changed: false };
72048
72830
  const current = readFileSync27(path, "utf8");
72049
72831
  if (!blockRe().test(current)) return { path, changed: false };
72050
72832
  const rest = current.replace(blockRe(), "");
@@ -72055,13 +72837,13 @@ function removeManagedBlock(path) {
72055
72837
  return writeTextWithBackup(path, rest.replace(/\n+$/, "\n"));
72056
72838
  }
72057
72839
  function hasManagedBlock(path) {
72058
- return existsSync33(path) && blockRe().test(readFileSync27(path, "utf8"));
72840
+ return existsSync35(path) && blockRe().test(readFileSync27(path, "utf8"));
72059
72841
  }
72060
72842
 
72061
72843
  // src/install/agents-md.ts
72062
- import { join as join43 } from "path";
72844
+ import { join as join44 } from "path";
72063
72845
  function agentsMdPath(root) {
72064
- return join43(root, "AGENTS.md");
72846
+ return join44(root, "AGENTS.md");
72065
72847
  }
72066
72848
  function agentsMdBlock(root) {
72067
72849
  const e = engineInvocation(root);
@@ -72116,25 +72898,25 @@ function agentsMdWired(root) {
72116
72898
  }
72117
72899
 
72118
72900
  // src/install/codex.ts
72119
- import { existsSync as existsSync35, readFileSync as readFileSync29 } from "fs";
72120
- import { join as join45 } from "path";
72901
+ import { existsSync as existsSync37, readFileSync as readFileSync29 } from "fs";
72902
+ import { join as join46 } from "path";
72121
72903
 
72122
72904
  // src/install/paths.ts
72123
- import { copyFileSync as copyFileSync3, cpSync, existsSync as existsSync34, mkdirSync as mkdirSync14, readFileSync as readFileSync28, realpathSync as realpathSync6, statSync as statSync17 } from "fs";
72905
+ import { copyFileSync as copyFileSync3, cpSync, existsSync as existsSync36, mkdirSync as mkdirSync14, readFileSync as readFileSync28, realpathSync as realpathSync6, statSync as statSync18 } from "fs";
72124
72906
  import { homedir as homedir2 } from "os";
72125
- import { dirname as dirname18, join as join44 } from "path";
72907
+ import { dirname as dirname18, join as join45 } from "path";
72126
72908
  function codexHome() {
72127
- return process.env.CODEX_HOME || join44(homedir2(), ".codex");
72909
+ return process.env.CODEX_HOME || join45(homedir2(), ".codex");
72128
72910
  }
72129
72911
  function opencodeConfigDir() {
72130
72912
  const xdg = process.env.XDG_CONFIG_HOME;
72131
- return join44(xdg && xdg !== "" ? xdg : join44(homedir2(), ".config"), "opencode");
72913
+ return join45(xdg && xdg !== "" ? xdg : join45(homedir2(), ".config"), "opencode");
72132
72914
  }
72133
72915
  function claudeSettingsPath(project, cwd = process.cwd()) {
72134
- return project ? join44(cwd, ".claude", "settings.json") : join44(homedir2(), ".claude", "settings.json");
72916
+ return project ? join45(cwd, ".claude", "settings.json") : join45(homedir2(), ".claude", "settings.json");
72135
72917
  }
72136
72918
  function pinnedEnginePath() {
72137
- return join44(homedir2(), ".ultra11y", "bin", "ultra11y.mjs");
72919
+ return join45(homedir2(), ".ultra11y", "bin", "ultra11y.mjs");
72138
72920
  }
72139
72921
  function installedCliCommand() {
72140
72922
  const override = process.env.ULTRA11Y_BIN;
@@ -72149,7 +72931,7 @@ function installedCliCommand() {
72149
72931
  if (source && !ephemeral) return `node ${JSON.stringify(source)}`;
72150
72932
  const pin = pinnedEnginePath();
72151
72933
  if (source) {
72152
- mkdirSync14(join44(pin, ".."), { recursive: true });
72934
+ mkdirSync14(join45(pin, ".."), { recursive: true });
72153
72935
  copyFileSync3(source, pin);
72154
72936
  }
72155
72937
  return `node ${JSON.stringify(pin)}`;
@@ -72162,32 +72944,32 @@ function packageRoot() {
72162
72944
  return null;
72163
72945
  }
72164
72946
  for (let i2 = 0; i2 < 6 && dir && dir !== "/"; i2++) {
72165
- if (existsSync34(join44(dir, "skills", "review-a11y", "SKILL.md"))) return dir;
72947
+ if (existsSync36(join45(dir, "skills", "review-a11y", "SKILL.md"))) return dir;
72166
72948
  dir = dirname18(dir);
72167
72949
  }
72168
72950
  return null;
72169
72951
  }
72170
72952
  function bundledSkillsDir() {
72171
72953
  const root = packageRoot();
72172
- const p = root ? join44(root, "skills") : null;
72173
- return p && existsSync34(p) ? p : null;
72954
+ const p = root ? join45(root, "skills") : null;
72955
+ return p && existsSync36(p) ? p : null;
72174
72956
  }
72175
72957
  function bundledOpencodePlugin() {
72176
72958
  const root = packageRoot();
72177
- const p = root ? join44(root, ".opencode", "plugins", "ultra11y.js") : null;
72178
- return p && existsSync34(p) ? p : null;
72959
+ const p = root ? join45(root, ".opencode", "plugins", "ultra11y.js") : null;
72960
+ return p && existsSync36(p) ? p : null;
72179
72961
  }
72180
72962
  function copySkillsInto(source, dest) {
72181
72963
  const out2 = [];
72182
72964
  for (const name2 of ["ultra11y", "review-a11y"]) {
72183
- const from = join44(source, name2);
72184
- if (!existsSync34(from)) continue;
72185
- const to = join44(dest, name2);
72186
- const same = ["SKILL.md", join44("scripts", "ultra11y.mjs")].every((f) => {
72187
- const a = join44(from, f);
72188
- const b = join44(to, f);
72965
+ const from = join45(source, name2);
72966
+ if (!existsSync36(from)) continue;
72967
+ const to = join45(dest, name2);
72968
+ const same = ["SKILL.md", join45("scripts", "ultra11y.mjs")].every((f) => {
72969
+ const a = join45(from, f);
72970
+ const b = join45(to, f);
72189
72971
  try {
72190
- return existsSync34(b) && statSync17(a).size === statSync17(b).size && readFileSync28(a).equals(readFileSync28(b));
72972
+ return existsSync36(b) && statSync18(a).size === statSync18(b).size && readFileSync28(a).equals(readFileSync28(b));
72191
72973
  } catch {
72192
72974
  return false;
72193
72975
  }
@@ -72237,7 +73019,7 @@ function featuresBody(content) {
72237
73019
  function installCodex({ codexDir, command, skillsSource }) {
72238
73020
  const reports = [];
72239
73021
  reports.push(
72240
- editJsonFile(join45(codexDir, "hooks.json"), (root) => {
73022
+ editJsonFile(join46(codexDir, "hooks.json"), (root) => {
72241
73023
  const hooks = root.hooks ??= {};
72242
73024
  hooks.PreToolUse = [
72243
73025
  ...withoutOurs2(hooks.PreToolUse),
@@ -72245,11 +73027,11 @@ function installCodex({ codexDir, command, skillsSource }) {
72245
73027
  ];
72246
73028
  })
72247
73029
  );
72248
- const configPath = join45(codexDir, "config.toml");
72249
- const current = existsSync35(configPath) ? readFileSync29(configPath, "utf8") : "";
73030
+ const configPath = join46(codexDir, "config.toml");
73031
+ const current = existsSync37(configPath) ? readFileSync29(configPath, "utf8") : "";
72250
73032
  const edit = enableHooksFeature(current);
72251
73033
  if (edit.changed) reports.push(writeTextWithBackup(configPath, edit.content));
72252
- if (skillsSource) reports.push(...copySkillsInto(skillsSource, join45(codexDir, "skills")));
73034
+ if (skillsSource) reports.push(...copySkillsInto(skillsSource, join46(codexDir, "skills")));
72253
73035
  return {
72254
73036
  reports,
72255
73037
  guidance: [
@@ -72264,8 +73046,8 @@ function installCodex({ codexDir, command, skillsSource }) {
72264
73046
  }
72265
73047
  function uninstallCodex({ codexDir }) {
72266
73048
  const reports = [];
72267
- const hooksPath = join45(codexDir, "hooks.json");
72268
- if (existsSync35(hooksPath)) {
73049
+ const hooksPath = join46(codexDir, "hooks.json");
73050
+ if (existsSync37(hooksPath)) {
72269
73051
  reports.push(
72270
73052
  editJsonFile(hooksPath, (root) => {
72271
73053
  const hooks = root.hooks;
@@ -72280,20 +73062,20 @@ function uninstallCodex({ codexDir }) {
72280
73062
  return { reports, guidance: ["codex: `[features] hooks = true` was left enabled \u2014 other hooks may depend on it."] };
72281
73063
  }
72282
73064
  function codexWired(codexDir) {
72283
- const root = readJsonSafe(join45(codexDir, "hooks.json"));
73065
+ const root = readJsonSafe(join46(codexDir, "hooks.json"));
72284
73066
  const groups = root?.hooks?.PreToolUse;
72285
73067
  if (!Array.isArray(groups)) return 0;
72286
73068
  return groups.reduce((n, g) => n + (g.hooks ?? []).filter((h2) => String(h2.command ?? "").includes(CODEX_MARKER)).length, 0);
72287
73069
  }
72288
73070
  function codexHooksEnabled(codexDir) {
72289
- const p = join45(codexDir, "config.toml");
72290
- return existsSync35(p) && HOOKS_ON.test(featuresBody(readFileSync29(p, "utf8")));
73071
+ const p = join46(codexDir, "config.toml");
73072
+ return existsSync37(p) && HOOKS_ON.test(featuresBody(readFileSync29(p, "utf8")));
72291
73073
  }
72292
73074
 
72293
73075
  // src/install/opencode.ts
72294
- import { spawnSync as spawnSync2 } from "child_process";
72295
- import { existsSync as existsSync36, readFileSync as readFileSync30, rmSync as rmSync8 } from "fs";
72296
- import { join as join46 } from "path";
73076
+ import { spawnSync as spawnSync3 } from "child_process";
73077
+ import { existsSync as existsSync38, readFileSync as readFileSync30, rmSync as rmSync8 } from "fs";
73078
+ import { join as join47 } from "path";
72297
73079
  var OPENCODE_MARKER = "ULTRA11Y_OPENCODE_PLUGIN";
72298
73080
  var PLUGIN_DIRS = ["plugin", "plugins"];
72299
73081
  function dirFor(major) {
@@ -72302,8 +73084,8 @@ function dirFor(major) {
72302
73084
  function opencodePinKey(major) {
72303
73085
  return major === 2 ? "plugins" : "plugin";
72304
73086
  }
72305
- var pluginFile = (configDir, dir) => join46(configDir, dir, "ultra11y.js");
72306
- var ours = (path) => existsSync36(path) && readFileSync30(path, "utf8").includes(OPENCODE_MARKER);
73087
+ var pluginFile = (configDir, dir) => join47(configDir, dir, "ultra11y.js");
73088
+ var ours = (path) => existsSync38(path) && readFileSync30(path, "utf8").includes(OPENCODE_MARKER);
72307
73089
  function parseOpencodeVersion(text) {
72308
73090
  const m = /\bv?(\d+)\.\d+\.\d+/.exec(text);
72309
73091
  if (!m) return null;
@@ -72312,7 +73094,7 @@ function parseOpencodeVersion(text) {
72312
73094
  return major >= 2 ? 2 : null;
72313
73095
  }
72314
73096
  var runOpencodeVersion = () => {
72315
- const r = spawnSync2("opencode", ["--version"], {
73097
+ const r = spawnSync3("opencode", ["--version"], {
72316
73098
  encoding: "utf8",
72317
73099
  timeout: 1e4,
72318
73100
  stdio: ["ignore", "pipe", "pipe"],
@@ -72342,7 +73124,7 @@ function isUltra11yPin(entry2) {
72342
73124
  }
72343
73125
  function pinnedKeys(configDir) {
72344
73126
  try {
72345
- const cfg = JSON.parse(readFileSync30(join46(configDir, "opencode.json"), "utf8"));
73127
+ const cfg = JSON.parse(readFileSync30(join47(configDir, "opencode.json"), "utf8"));
72346
73128
  return ["plugin", "plugins"].filter((k) => Array.isArray(cfg?.[k]) && cfg[k].some(isUltra11yPin));
72347
73129
  } catch {
72348
73130
  return [];
@@ -72351,28 +73133,28 @@ function pinnedKeys(configDir) {
72351
73133
  function installOpencode({ configDir, pluginSource, skillsSource, enginePath, major = null }) {
72352
73134
  const dir = dirFor(major);
72353
73135
  const target = pluginFile(configDir, dir);
72354
- if (existsSync36(target) && !ours(target)) {
73136
+ if (existsSync38(target) && !ours(target)) {
72355
73137
  throw new Error(`refusing to overwrite ${target}: it is not a file ultra11y wrote. Remove it manually if you want the plugin here.`);
72356
73138
  }
72357
73139
  const reports = [writeTextWithBackup(target, readFileSync30(pluginSource, "utf8"))];
72358
73140
  const guidance = [];
72359
- if (enginePath && existsSync36(enginePath)) {
72360
- reports.push(writeTextWithBackup(join46(configDir, dir, "ultra11y.mjs"), readFileSync30(enginePath, "utf8")));
73141
+ if (enginePath && existsSync38(enginePath)) {
73142
+ reports.push(writeTextWithBackup(join47(configDir, dir, "ultra11y.mjs"), readFileSync30(enginePath, "utf8")));
72361
73143
  }
72362
- if (skillsSource) reports.push(...copySkillsInto(skillsSource, join46(configDir, "skills")));
73144
+ if (skillsSource) reports.push(...copySkillsInto(skillsSource, join47(configDir, "skills")));
72363
73145
  for (const other of PLUGIN_DIRS) {
72364
73146
  if (other === dir) continue;
72365
73147
  const stale = pluginFile(configDir, other);
72366
73148
  if (!ours(stale)) continue;
72367
73149
  rmSync8(stale, { force: true });
72368
- rmSync8(join46(configDir, other, "ultra11y.mjs"), { force: true });
73150
+ rmSync8(join47(configDir, other, "ultra11y.mjs"), { force: true });
72369
73151
  guidance.push(`opencode: moved the plugin from ${other}/ to ${dir}/ \u2014 it is loaded from one place only.`);
72370
73152
  }
72371
73153
  const key2 = opencodePinKey(major);
72372
73154
  guidance.push(
72373
73155
  major === null ? "opencode: no `opencode` on PATH to ask its version \u2014 wired plugin/, which OpenCode 1 and 2 both read (pass --opencode-version 1|2 to choose)." : `opencode: wired for OpenCode ${major}.`,
72374
73156
  "opencode: restart the session \u2014 plugins load at startup.",
72375
- `opencode: the alternative is an npm pin \u2014 add "${key2}": ["ultra11y@latest"] to ${join46(configDir, "opencode.json")} and drop this file.`,
73157
+ `opencode: the alternative is an npm pin \u2014 add "${key2}": ["ultra11y@latest"] to ${join47(configDir, "opencode.json")} and drop this file.`,
72376
73158
  "opencode: the gate surfaces as a blocked tool call whose error message carries the findings (OpenCode has no permission-decision channel)."
72377
73159
  );
72378
73160
  const pins = pinnedKeys(configDir);
@@ -72387,11 +73169,11 @@ function uninstallOpencode({ configDir }) {
72387
73169
  const target = pluginFile(configDir, dir);
72388
73170
  if (!ours(target)) continue;
72389
73171
  rmSync8(target, { force: true });
72390
- rmSync8(join46(configDir, dir, "ultra11y.mjs"), { force: true });
73172
+ rmSync8(join47(configDir, dir, "ultra11y.mjs"), { force: true });
72391
73173
  reports.push({ path: target, changed: true });
72392
73174
  }
72393
- const configPath = join46(configDir, "opencode.json");
72394
- if (existsSync36(configPath)) {
73175
+ const configPath = join47(configDir, "opencode.json");
73176
+ if (existsSync38(configPath)) {
72395
73177
  reports.push(
72396
73178
  editJsonFile(configPath, (root) => {
72397
73179
  for (const key2 of ["plugin", "plugins"]) {
@@ -72417,8 +73199,8 @@ function opencodeWired(configDir) {
72417
73199
  }
72418
73200
 
72419
73201
  // src/install/index.ts
72420
- import { existsSync as existsSync37 } from "fs";
72421
- import { join as join47 } from "path";
73202
+ import { existsSync as existsSync39 } from "fs";
73203
+ import { join as join48 } from "path";
72422
73204
  var ALL_TARGETS = ["claude-code", "codex", "opencode"];
72423
73205
  function parseTargets(flags2) {
72424
73206
  const picked = /* @__PURE__ */ new Set();
@@ -72457,7 +73239,7 @@ function installForTargets(opts) {
72457
73239
  const out3 = installCodex({ codexDir: codexHome(), command: cmd(), skillsSource: opts.skills === false ? null : bundledSkillsDir() });
72458
73240
  r.reports.push(...out3.reports);
72459
73241
  r.guidance.push(...out3.guidance);
72460
- } else r.reports.push({ path: join47(codexHome(), "hooks.json"), changed: false });
73242
+ } else r.reports.push({ path: join48(codexHome(), "hooks.json"), changed: false });
72461
73243
  break;
72462
73244
  }
72463
73245
  case "opencode": {
@@ -72466,15 +73248,15 @@ function installForTargets(opts) {
72466
73248
  r.error = "opencode: this engine was not run from a package carrying .opencode/plugins/ultra11y.js \u2014 install ultra11y from npm and retry.";
72467
73249
  break;
72468
73250
  }
72469
- const configDir = opts.project === true ? join47(cwd, ".opencode") : opencodeConfigDir();
73251
+ const configDir = opts.project === true ? join48(cwd, ".opencode") : opencodeConfigDir();
72470
73252
  const major = opts.opencodeVersion ?? detectOpencodeMajor();
72471
73253
  if (!opts.dryRun) {
72472
- const engine = existsSync37(pinnedEnginePath()) ? pinnedEnginePath() : join47(packageRoot() ?? "", "scripts", "ultra11y.mjs");
73254
+ const engine = existsSync39(pinnedEnginePath()) ? pinnedEnginePath() : join48(packageRoot() ?? "", "scripts", "ultra11y.mjs");
72473
73255
  const out3 = installOpencode({
72474
73256
  configDir,
72475
73257
  pluginSource: source,
72476
73258
  skillsSource: opts.skills === false ? null : bundledSkillsDir(),
72477
- enginePath: existsSync37(engine) ? engine : null,
73259
+ enginePath: existsSync39(engine) ? engine : null,
72478
73260
  major
72479
73261
  });
72480
73262
  r.reports.push(...out3.reports);
@@ -72517,7 +73299,7 @@ function uninstallForTargets(opts) {
72517
73299
  break;
72518
73300
  }
72519
73301
  case "opencode": {
72520
- const out3 = uninstallOpencode({ configDir: opts.project === true ? join47(cwd, ".opencode") : opencodeConfigDir() });
73302
+ const out3 = uninstallOpencode({ configDir: opts.project === true ? join48(cwd, ".opencode") : opencodeConfigDir() });
72521
73303
  r.reports.push(...out3.reports);
72522
73304
  r.guidance.push(...out3.guidance);
72523
73305
  break;
@@ -72538,14 +73320,14 @@ function statusReport(opts = {}) {
72538
73320
  const claudePath = claudeSettingsPath(opts.project === true, cwd);
72539
73321
  const root = projectRoot(cwd);
72540
73322
  const codexDir = codexHome();
72541
- const ocDir = opts.project === true ? join47(cwd, ".opencode") : opencodeConfigDir();
73323
+ const ocDir = opts.project === true ? join48(cwd, ".opencode") : opencodeConfigDir();
72542
73324
  const codexOn = codexWired(codexDir) > 0;
72543
73325
  return [
72544
73326
  { target: "claude-code", wired: claudeCodeWired(claudePath) > 0, path: claudePath, note: "the plugin route wires this separately and does not show here" },
72545
73327
  {
72546
73328
  target: "codex",
72547
73329
  wired: codexOn,
72548
- path: join47(codexDir, "hooks.json"),
73330
+ path: join48(codexDir, "hooks.json"),
72549
73331
  // A wired hook behind a disabled feature flag never fires and looks fine. Say so.
72550
73332
  note: codexOn && !codexHooksEnabled(codexDir) ? "WIRED BUT INERT: `[features] hooks = true` is not set in config.toml" : void 0
72551
73333
  },
@@ -73456,8 +74238,8 @@ function pagesComment(result, opts = {}) {
73456
74238
 
73457
74239
  // src/evidence.ts
73458
74240
  import { createHash as createHash8 } from "crypto";
73459
- import { existsSync as existsSync38, mkdirSync as mkdirSync15, readFileSync as readFileSync31, writeFileSync as writeFileSync18 } from "fs";
73460
- import { join as join48 } from "path";
74241
+ import { existsSync as existsSync40, mkdirSync as mkdirSync15, readFileSync as readFileSync31, writeFileSync as writeFileSync18 } from "fs";
74242
+ import { join as join49 } from "path";
73461
74243
  var DEFAULT_GEOMETRY = { pad: 24, minWidth: 320, minHeight: 120, maxWidth: 960, maxHeight: 540 };
73462
74244
  var DEFAULT_CAPS = { perRule: 6, perPage: 12, total: 200 };
73463
74245
  var HALO = { r: 255, g: 255, b: 255, a: 0.92 };
@@ -73490,10 +74272,10 @@ function resolveScale(img, viewport, boxes) {
73490
74272
  }
73491
74273
  function loadPageEvidence(root, pageId) {
73492
74274
  const dir = snapshotDir(root, pageId);
73493
- const domFile = join48(dir, "dom.html");
73494
- const shotFile = join48(dir, "screen.png");
73495
- if (!existsSync38(domFile)) return { skip: "no-snapshot" };
73496
- if (!existsSync38(shotFile)) return { skip: "no-screenshot" };
74275
+ const domFile = join49(dir, "dom.html");
74276
+ const shotFile = join49(dir, "screen.png");
74277
+ if (!existsSync40(domFile)) return { skip: "no-snapshot" };
74278
+ if (!existsSync40(shotFile)) return { skip: "no-screenshot" };
73497
74279
  let dom;
73498
74280
  let shot;
73499
74281
  try {
@@ -73504,7 +74286,7 @@ function loadPageEvidence(root, pageId) {
73504
74286
  }
73505
74287
  const img = decodePng(shot);
73506
74288
  if (!img) return { skip: "unreadable-image" };
73507
- const digest = readJson3(join48(dir, "boxes.json"));
74289
+ const digest = readJson3(join49(dir, "boxes.json"));
73508
74290
  if (!digest) return { skip: "no-boxes" };
73509
74291
  const doc = parseHtml(dom, domFile);
73510
74292
  const boxes = alignedBoxes(dom, digest, doc);
@@ -73520,7 +74302,7 @@ function loadPageEvidence(root, pageId) {
73520
74302
  return { pageId, img, scale, viewport, ordinalOf, boxes, truncated: Boolean(digest.truncated) };
73521
74303
  }
73522
74304
  function metaOf(dir) {
73523
- const raw = readJson3(join48(dir, "meta.json"));
74305
+ const raw = readJson3(join49(dir, "meta.json"));
73524
74306
  if (raw === void 0) return void 0;
73525
74307
  const v = validateSnapshotMeta(raw);
73526
74308
  return v.ok && v.meta ? v.meta : void 0;
@@ -73685,7 +74467,7 @@ function writeEvidence(result, opts) {
73685
74467
  }
73686
74468
  continue;
73687
74469
  }
73688
- const dir = join48(opts.outDir, "assets", pageId);
74470
+ const dir = join49(opts.outDir, "assets", pageId);
73689
74471
  let wrote = false;
73690
74472
  const perRule = /* @__PURE__ */ new Map();
73691
74473
  const seen = /* @__PURE__ */ new Set();
@@ -73710,7 +74492,7 @@ function writeEvidence(result, opts) {
73710
74492
  continue;
73711
74493
  }
73712
74494
  const name2 = cropName(f);
73713
- const path = join48(dir, name2);
74495
+ const path = join49(dir, name2);
73714
74496
  try {
73715
74497
  if (!wrote) {
73716
74498
  mkdirSync15(dir, { recursive: true });
@@ -73748,8 +74530,8 @@ function writeEvidence(result, opts) {
73748
74530
  }
73749
74531
 
73750
74532
  // src/html-emit.ts
73751
- import { mkdirSync as mkdirSync16, readFileSync as readFileSync32, statSync as statSync18, writeFileSync as writeFileSync19 } from "fs";
73752
- import { join as join49 } from "path";
74533
+ import { mkdirSync as mkdirSync16, readFileSync as readFileSync32, statSync as statSync19, writeFileSync as writeFileSync19 } from "fs";
74534
+ import { join as join50 } from "path";
73753
74535
 
73754
74536
  // src/html.ts
73755
74537
  var MARK4 = { C: "C", NC: "NC", NA: "\u2014", manual: "?" };
@@ -74494,7 +75276,7 @@ var T5 = {
74494
75276
  var mb = (n) => (n / (1024 * 1024)).toFixed(1);
74495
75277
  function inlineSize(path) {
74496
75278
  try {
74497
- return Math.ceil(statSync18(path).size / 3) * 4;
75279
+ return Math.ceil(statSync19(path).size / 3) * 4;
74498
75280
  } catch {
74499
75281
  return 0;
74500
75282
  }
@@ -74572,7 +75354,7 @@ function writeHtml(result, opts) {
74572
75354
  return drawn;
74573
75355
  };
74574
75356
  const flat = opts.layout === "pages";
74575
- const sheetDir = flat ? opts.outDir : join49(opts.outDir, "pages");
75357
+ const sheetDir = flat ? opts.outDir : join50(opts.outDir, "pages");
74576
75358
  const up = flat ? "./" : "../";
74577
75359
  const compositeName = `ultra11y-${stdKey}-${result.date}.html`;
74578
75360
  const nav = flat ? [{ href: "./index.html", text: t3.pagesTitle }] : [
@@ -74591,13 +75373,13 @@ function writeHtml(result, opts) {
74591
75373
  nav: nav.map((n) => ({ ...n, current: n.href === `./${compositeName}` }))
74592
75374
  });
74593
75375
  if (notices.length) composite.blocks.unshift({ kind: "note", tone: "warn", runs: noticeRuns(notices) });
74594
- compositePath = join49(opts.outDir, compositeName);
75376
+ compositePath = join50(opts.outDir, compositeName);
74595
75377
  writeFileSync19(compositePath, renderHtmlDocument(composite));
74596
75378
  }
74597
75379
  const fileCrops = cropLookup(opts.evidence, lang, (_p, href) => href.replace(/^\.\//, up));
74598
75380
  const indexNav = nav.map((n) => ({ ...n, current: n.href === "./index.html" }));
74599
75381
  const index = flat ? pagesIndexDoc(result, { standard, lang, nav: indexNav, sheetHref: (id) => `./page-${id}.html` }) : indexDoc(result, { standard, lang, nav: indexNav, links: nav.filter((n) => n.href !== "./index.html") });
74600
- const indexPath = join49(opts.outDir, "index.html");
75382
+ const indexPath = join50(opts.outDir, "index.html");
74601
75383
  writeFileSync19(indexPath, renderHtmlDocument(index));
74602
75384
  const sheets = [];
74603
75385
  if (opts.pages) {
@@ -74610,7 +75392,7 @@ function writeHtml(result, opts) {
74610
75392
  ];
74611
75393
  if (!flat) {
74612
75394
  writeFileSync19(
74613
- join49(sheetDir, "index.html"),
75395
+ join50(sheetDir, "index.html"),
74614
75396
  renderHtmlDocument(
74615
75397
  pagesIndexDoc(result, {
74616
75398
  standard,
@@ -74620,7 +75402,7 @@ function writeHtml(result, opts) {
74620
75402
  })
74621
75403
  )
74622
75404
  );
74623
- sheets.push(join49(sheetDir, "index.html"));
75405
+ sheets.push(join50(sheetDir, "index.html"));
74624
75406
  }
74625
75407
  for (const p of derived) {
74626
75408
  const doc = pageDoc(result, p, {
@@ -74633,7 +75415,7 @@ function writeHtml(result, opts) {
74633
75415
  // beside the entry point, seen from wherever this sheet sits.
74634
75416
  ...opts.screenshots?.has(p.id) ? { screenshot: `${up}assets/${p.id}.png` } : {}
74635
75417
  });
74636
- const path = join49(sheetDir, `page-${p.id}.html`);
75418
+ const path = join50(sheetDir, `page-${p.id}.html`);
74637
75419
  writeFileSync19(path, renderHtmlDocument(doc));
74638
75420
  sheets.push(path);
74639
75421
  }
@@ -74655,7 +75437,7 @@ function noticeRuns(notices) {
74655
75437
  // src/dev.ts
74656
75438
  import { createServer } from "http";
74657
75439
  import { mkdirSync as mkdirSync17, readFileSync as readFileSync33, writeFileSync as writeFileSync20 } from "fs";
74658
- import { dirname as dirname19, join as join50 } from "path";
75440
+ import { dirname as dirname19, join as join51 } from "path";
74659
75441
  var DEV_DEFAULT_PORT = 4111;
74660
75442
  function criterionLabel3(f, standard) {
74661
75443
  if (isCore(standard)) return `WCAG ${f.criteriaId}`;
@@ -74877,13 +75659,13 @@ function auditCollected(root, payload) {
74877
75659
  ...payload.css ? { css: payload.css } : {},
74878
75660
  ...shot ? { screenshotBase64: shot } : {}
74879
75661
  });
74880
- return { ok: true, result: runAudit({ inputs: [join50(dir, "dom.html")] }) };
75662
+ return { ok: true, result: runAudit({ inputs: [join51(dir, "dom.html")] }) };
74881
75663
  }
74882
75664
  function projectPages(root) {
74883
75665
  const snaps = readSnapshots(root);
74884
75666
  if (!snaps.length) return { result: null, pages: [] };
74885
75667
  const scope = pageScopesFrom(snaps);
74886
- const result = runAudit({ inputs: [join50(root, ".ultra11y/pages")] });
75668
+ const result = runAudit({ inputs: [join51(root, ".ultra11y/pages")] });
74887
75669
  result.scope.pages = scope;
74888
75670
  attributePages(result, scope);
74889
75671
  foldRecordedAdjudication(root, result);
@@ -74897,7 +75679,7 @@ function judgePages(result) {
74897
75679
  function foldRecordedAdjudication(root, fresh) {
74898
75680
  let prior;
74899
75681
  try {
74900
- prior = JSON.parse(readFileSync33(join50(root, "audits", "audit-latest.json"), "utf8"));
75682
+ prior = JSON.parse(readFileSync33(join51(root, "audits", "audit-latest.json"), "utf8"));
74901
75683
  } catch {
74902
75684
  return;
74903
75685
  }
@@ -75013,7 +75795,7 @@ function startDevServer(opts) {
75013
75795
  });
75014
75796
  let auditPath;
75015
75797
  if (applied.ok) {
75016
- auditPath = join50(opts.root, "audits", "audit-latest.json");
75798
+ auditPath = join51(opts.root, "audits", "audit-latest.json");
75017
75799
  mkdirSync17(dirname19(auditPath), { recursive: true });
75018
75800
  writeFileSync20(auditPath, `${JSON.stringify(applied.audit, null, 2)}
75019
75801
  `);
@@ -75042,10 +75824,10 @@ function startDevServer(opts) {
75042
75824
  }
75043
75825
  res.writeHead(404, { "content-type": "text/plain" }).end("not found");
75044
75826
  });
75045
- return new Promise((resolve19, reject) => {
75827
+ return new Promise((resolve20, reject) => {
75046
75828
  server.once("error", reject);
75047
75829
  server.listen(opts.port, "127.0.0.1", () => {
75048
- resolve19({
75830
+ resolve20({
75049
75831
  port: server.address().port,
75050
75832
  close: () => new Promise((r) => server.close(() => r()))
75051
75833
  });
@@ -75333,11 +76115,11 @@ function e2eSetupPlan(runners, paths, lang = "en") {
75333
76115
  }
75334
76116
 
75335
76117
  // src/orchestrate.ts
75336
- import { existsSync as existsSync39, mkdirSync as mkdirSync18, readFileSync as readFileSync34, rmSync as rmSync9, writeFileSync as writeFileSync21 } from "fs";
75337
- import { join as join52, resolve as resolve15 } from "path";
76118
+ import { existsSync as existsSync41, mkdirSync as mkdirSync18, readFileSync as readFileSync34, rmSync as rmSync9, writeFileSync as writeFileSync21 } from "fs";
76119
+ import { join as join53, resolve as resolve16 } from "path";
75338
76120
 
75339
76121
  // src/orchestrate-templates.ts
75340
- import { join as join51 } from "path";
76122
+ import { join as join52 } from "path";
75341
76123
  var ONE_WRITER_FOOTER = `
75342
76124
  ## Return, don't write
75343
76125
 
@@ -75443,7 +76225,7 @@ function toBatches(ids2, batchSize) {
75443
76225
  }
75444
76226
  function phaseWorkflowScript(ph, runAbs, engineAbs, batchSize) {
75445
76227
  const spec = phaseSpec(ph.name);
75446
- const scriptPath = join51(runAbs, "orchestration", `${ph.name}.workflow.mjs`);
76228
+ const scriptPath = join52(runAbs, "orchestration", `${ph.name}.workflow.mjs`);
75447
76229
  const meta2 = { name: `ultra11y-${ph.name}`, description: spec.description(ph.items), phases: [{ title: spec.title }] };
75448
76230
  return [
75449
76231
  `export const meta = ${JSON.stringify(meta2)}`,
@@ -75489,8 +76271,8 @@ There is no fan-out here and no ITEMS selection: you handle EVERY criterion, one
75489
76271
 
75490
76272
  ## Which files \u2014 your prompt decides, and it wins over this document
75491
76273
 
75492
- - **With a shell.** Read \`${join51(runAbs, "ADJUDICATE.todo.json")}\`, fill each item's verdict in place, then fold: \`ultra11y verify --apply ${join51(runAbs, "ADJUDICATE.todo.json")} --in ${join51(runAbs, "audit-latest.json")} --out ${runAbs}\`. Each criterion's brief cites the standard's official page for it; if a wording stays ambiguous and you have a web tool, you MAY read that page to settle it \u2014 never to contradict the vendored text, and a web page is never a \`normativeRef\`.
75493
- - **Without a shell** (CI: Read, Grep, Glob, Edit, Write only). Do NOT open \`ADJUDICATE.todo.json\` or \`ADJUDICATE.md\` \u2014 they run to hundreds of kilobytes and will swamp your context. Read \`${join51(runAbs, "adjudicate")}/<criteriaId>.md\`, one small brief per criterion carrying its evidence, its decision protocol, its numbered tests and this contract in short form. Write your verdicts into \`${join51(runAbs, "ADJUDICATE.verdicts.json")}\` \u2014 the ONLY file you write. Someone else folds; you never run the engine.
76274
+ - **With a shell.** Read \`${join52(runAbs, "ADJUDICATE.todo.json")}\`, fill each item's verdict in place, then fold: \`ultra11y verify --apply ${join52(runAbs, "ADJUDICATE.todo.json")} --in ${join52(runAbs, "audit-latest.json")} --out ${runAbs}\`. Each criterion's brief cites the standard's official page for it; if a wording stays ambiguous and you have a web tool, you MAY read that page to settle it \u2014 never to contradict the vendored text, and a web page is never a \`normativeRef\`.
76275
+ - **Without a shell** (CI: Read, Grep, Glob, Edit, Write only). Do NOT open \`ADJUDICATE.todo.json\` or \`ADJUDICATE.md\` \u2014 they run to hundreds of kilobytes and will swamp your context. Read \`${join52(runAbs, "adjudicate")}/<criteriaId>.md\`, one small brief per criterion carrying its evidence, its decision protocol, its numbered tests and this contract in short form. Write your verdicts into \`${join52(runAbs, "ADJUDICATE.verdicts.json")}\` \u2014 the ONLY file you write. Someone else folds; you never run the engine.
75494
76276
 
75495
76277
  ## For EACH criterion
75496
76278
 
@@ -75507,7 +76289,7 @@ function ecoRefuterContract(runAbs, verify) {
75507
76289
 
75508
76290
  You are an adversarial skeptic verifying the non-conformities of an ultra11y report. Your job is to try to REFUTE each claim: assume it is wrong until the source proves it.
75509
76291
 
75510
- There is no fan-out here and no ITEMS selection: you handle EVERY entry of \`${join51(runAbs, "VERIFY.todo.json")}\` (a JSON array; each entry has \`n\`, \`criteriaId\`, \`file\`, \`line\`, \`selector\`, \`claim\`), one at a time, writing your verdict into that same file.
76292
+ There is no fan-out here and no ITEMS selection: you handle EVERY entry of \`${join52(runAbs, "VERIFY.todo.json")}\` (a JSON array; each entry has \`n\`, \`criteriaId\`, \`file\`, \`line\`, \`selector\`, \`claim\`), one at a time, writing your verdict into that same file.
75511
76293
 
75512
76294
  For EACH entry:
75513
76295
 
@@ -75520,24 +76302,24 @@ For EACH entry:
75520
76302
  When unsure, choose the HARSHER verdict \u2014 a false pass is worse than a false fail.
75521
76303
  3. \`note\` is REQUIRED \u2014 one line grounded in what you read (quote or paraphrase the decisive code).
75522
76304
 
75523
- Then fold: \`ultra11y verify --apply ${join51(runAbs, "VERIFY.todo.json")} --report ${verify.report} ${verify.flags}\` \u2014 the same audit, standard and conformity source the list was generated with, or the claims it covers and the claims the fold expects differ. Without a shell, leave the fold to whoever gave you the file.
76305
+ Then fold: \`ultra11y verify --apply ${join52(runAbs, "VERIFY.todo.json")} --report ${verify.report} ${verify.flags}\` \u2014 the same audit, standard and conformity source the list was generated with, or the claims it covers and the claims the fold expects differ. Without a shell, leave the fold to whoever gave you the file.
75524
76306
  `;
75525
76307
  }
75526
76308
  function agentContracts(runAbs, opts = {}) {
75527
76309
  const footer = ONE_WRITER_FOOTER.replaceAll("<RUN>", runAbs);
75528
- const verify = opts.verify ?? { report: "<report.md>", flags: `--in ${join51(runAbs, "audit-latest.json")}` };
76310
+ const verify = opts.verify ?? { report: "<report.md>", flags: `--in ${join52(runAbs, "audit-latest.json")}` };
75529
76311
  if (opts.eco) return { adjudicator: ecoAdjudicatorContract(runAbs), refuter: ecoRefuterContract(runAbs, verify) };
75530
76312
  return {
75531
76313
  adjudicator: `# Contract: adjudicator
75532
76314
 
75533
76315
  You adjudicate the residual judgment criteria of an ultra11y audit \u2014 the ones the deterministic engine could not decide (alt-text relevance, link purpose in context, reading order\u2026). The ACTIVE STANDARD is recorded in the worklist's \`standard\` field: under a country standard (e.g. \`rgaa\`) the items are that standard's OWN criteria, each carrying its numbered tests \u2014 not WCAG success criteria.
75534
76316
 
75535
- Worklist: \`${join51(runAbs, "ADJUDICATE.todo.json")}\` (an object with \`kind: "adjudication"\` and \`items[]\`). Handle ONLY the criteria whose \`criteriaId\` is named in your prompt (\`ITEMS=<id,\u2026>\`).
76317
+ Worklist: \`${join52(runAbs, "ADJUDICATE.todo.json")}\` (an object with \`kind: "adjudication"\` and \`items[]\`). Handle ONLY the criteria whose \`criteriaId\` is named in your prompt (\`ITEMS=<id,\u2026>\`).
75536
76318
 
75537
76319
  For EACH of your criteria:
75538
76320
 
75539
76321
  1. Read its worklist entry for the EVIDENCE: \`evidence[]\` holds source-anchored excerpts (\`file\`, \`line\`, \`selector\`, \`snippet\`) harvested from the audited code \u2014 open the cited files at the cited lines whenever the snippet alone cannot decide.
75540
- 1b. Read \`${join51(runAbs, "adjudicate")}/<criteriaId>.md\` for the CRITERION ITSELF \u2014 its official wording, its numbered tests with the standard's own test methodology, the technical note, the particular cases and the glossary terms the tests are defined in terms of. The worklist JSON carries none of that: it holds the evidence and the slots your verdict goes into, and ruling on a country standard from the criterion's title alone is how a verdict ends up citing a test it never read. That brief also cites the standard's official page for the criterion: if a wording stays ambiguous and you have a web tool, you MAY read that page to settle it \u2014 never to contradict the vendored text, and a web page is never a \`normativeRef\`.
76322
+ 1b. Read \`${join52(runAbs, "adjudicate")}/<criteriaId>.md\` for the CRITERION ITSELF \u2014 its official wording, its numbered tests with the standard's own test methodology, the technical note, the particular cases and the glossary terms the tests are defined in terms of. The worklist JSON carries none of that: it holds the evidence and the slots your verdict goes into, and ruling on a country standard from the criterion's title alone is how a verdict ends up citing a test it never read. That brief also cites the standard's official page for the criterion: if a wording stays ambiguous and you have a web tool, you MAY read that page to settle it \u2014 never to contradict the vendored text, and a web page is never a \`normativeRef\`.
75541
76323
  2. Rule it (the apply gate is FAIL-CLOSED \u2014 a verdict missing its required field does not fold):
75542
76324
  - \`C\` (conforming) \u2014 REQUIRES \`justification\` explaining why the evidence satisfies the criterion, AND \`citations[]\` naming the evidence you cleared (\`file\`/\`line\` copied VERBATIM from this item's own \`evidence[]\`; an anchor that is not in that list is treated as fabricated). A criterion whose \`evidence[]\` is empty cannot be \`C\` at all \u2014 it is \`manual\` (\`undecidable\`), or \`NA\` only if the scope provably contains nothing the criterion is about. No harvested evidence is NOT that proof: a page with content always has a reading order, a focus order, text to space and a layout to reflow or rotate \u2014 an uncited NA is put on trial by \`verify\`.
75543
76325
  - \`NC\` (non-conforming) \u2014 REQUIRES \`findings\`: at least one groundable \`{ file, line, selector?, message, snippet?, severity?, normativeRef }\` pointing at REAL source. The fold re-grounds every finding; an invented file:line is rejected. \`normativeRef\` MUST cite the precise failed test \u2014 under a country standard, one of the item's OWN tests, which its brief lists for you under \xAB tests to rule on \xBB. A WCAG id looks alike, denotes an unrelated test, and is rejected.
@@ -75551,7 +76333,7 @@ ${footer}`,
75551
76333
 
75552
76334
  You are an adversarial skeptic verifying the non-conformities of an ultra11y report. Your job is to try to REFUTE each claim: assume it is wrong until the source proves it.
75553
76335
 
75554
- Worklist: \`${join51(runAbs, "VERIFY.todo.json")}\` (a JSON array; each entry has \`n\`, \`criteriaId\`, \`file\`, \`line\`, \`selector\`, \`claim\`). Handle ONLY the entries whose \`n\` is named in your prompt (\`ITEMS=<n,\u2026>\`).
76336
+ Worklist: \`${join52(runAbs, "VERIFY.todo.json")}\` (a JSON array; each entry has \`n\`, \`criteriaId\`, \`file\`, \`line\`, \`selector\`, \`claim\`). Handle ONLY the entries whose \`n\` is named in your prompt (\`ITEMS=<n,\u2026>\`).
75555
76337
 
75556
76338
  For EACH of your entries:
75557
76339
 
@@ -75580,8 +76362,8 @@ function runbookMd(manifest, unrendered = []) {
75580
76362
  > no model in the loop \u2014 then re-emit this runbook:
75581
76363
  >
75582
76364
  > \`\`\`
75583
- > ${engine} scan <url> --runtime local --merge ${join51(runAbs, "audit-latest.json")} --out ${runAbs}
75584
- > ${engine} verify --manual --in ${join51(runAbs, "audit-latest.json")} --out ${runAbs}
76365
+ > ${engine} scan <url> --runtime local --merge ${join52(runAbs, "audit-latest.json")} --out ${runAbs}
76366
+ > ${engine} verify --manual --in ${join52(runAbs, "audit-latest.json")} --out ${runAbs}
75585
76367
  > ${engine} orchestrate --run ${runAbs}
75586
76368
  > \`\`\`
75587
76369
  >
@@ -75603,14 +76385,14 @@ ${status}
75603
76385
 
75604
76386
  ## The loop (play every role yourself, one item at a time)
75605
76387
 
75606
- 1. **Audit** (if not done): \`${cmd("audit")}\` \u2192 \`${join51(runAbs, "audit-latest.json")}\`.
75607
- 2. **Adjudicate the residual criteria** \u2014 \`${cmd("adjudicate-worklist")}\` writes \`${join51(runAbs, "ADJUDICATE.todo.json")}\`. For EVERY item, apply \`${join51(runAbs, "orchestration", "agents", "adjudicator.md")}\` yourself (read the evidence, rule C/NC/NA/manual, fill the required justification/findings/reason IN the todo file). Then fold \u2014 gated per verdict, so a refusal costs its own criterion and no other: \`${cmd("adjudicate-fold")}\`. Add \`--ledger .ultra11y/verdicts/<standard>.json\` to RECORD the verdicts that landed, so CI can replay them without a model; \`--strict\` restores the old all-or-nothing fold.
76388
+ 1. **Audit** (if not done): \`${cmd("audit")}\` \u2192 \`${join52(runAbs, "audit-latest.json")}\`.
76389
+ 2. **Adjudicate the residual criteria** \u2014 \`${cmd("adjudicate-worklist")}\` writes \`${join52(runAbs, "ADJUDICATE.todo.json")}\`. For EVERY item, apply \`${join52(runAbs, "orchestration", "agents", "adjudicator.md")}\` yourself (read the evidence, rule C/NC/NA/manual, fill the required justification/findings/reason IN the todo file). Then fold \u2014 gated per verdict, so a refusal costs its own criterion and no other: \`${cmd("adjudicate-fold")}\`. Add \`--ledger .ultra11y/verdicts/<standard>.json\` to RECORD the verdicts that landed, so CI can replay them without a model; \`--strict\` restores the old all-or-nothing fold.
75608
76390
  3. **Report**: \`${cmd("report")}\`.
75609
- 4. **Verify the report's claims** \u2014 \`${cmd("verify-worklist")}\` writes \`${join51(runAbs, "VERIFY.todo.json")}\` (and \`${join51(runAbs, "VERIFY.context.json")}\`, the context it was built from): the report's non-conformities AND the conformities the adjudication cleared in that audit. For EVERY entry, apply \`${join51(runAbs, "orchestration", "agents", "refuter.md")}\` yourself (open file:line, verdict supported/partial/refuted/unsupported + note IN the todo file). Then: \`${cmd("verify-fold")}\`. Generation and apply carry the SAME \`--in\`, \`--standard\` and conformity source (\`--conformities <file>\` / \`--no-conformities\`, if you used one): a list built from another source covers other claims, and \`--max-verify 0\` does not fix that \u2014 regenerate it. \`--no-conformities\` or an explicit \`--max-verify\` makes a PARTIAL trial; do not present it as covering the audit.
76391
+ 4. **Verify the report's claims** \u2014 \`${cmd("verify-worklist")}\` writes \`${join52(runAbs, "VERIFY.todo.json")}\` (and \`${join52(runAbs, "VERIFY.context.json")}\`, the context it was built from): the report's non-conformities AND the conformities the adjudication cleared in that audit. For EVERY entry, apply \`${join52(runAbs, "orchestration", "agents", "refuter.md")}\` yourself (open file:line, verdict supported/partial/refuted/unsupported + note IN the todo file). Then: \`${cmd("verify-fold")}\`. Generation and apply carry the SAME \`--in\`, \`--standard\` and conformity source (\`--conformities <file>\` / \`--no-conformities\`, if you used one): a list built from another source covers other claims, and \`--max-verify 0\` does not fix that \u2014 regenerate it. \`--no-conformities\` or an explicit \`--max-verify\` makes a PARTIAL trial; do not present it as covering the audit.
75610
76392
  5. **Gate**: \`${cmd("gate")}\` must exit 0 before presenting anything.
75611
76393
  6. **Fix & re-audit**: \`${cmd("fix")}\`, hand-apply the judgment fixes, then loop from step 1 until the gate stays green.
75612
76394
 
75613
- With subagents available, prefer the emitted workflows instead: \`orchestrate --run ${runAbs} --phase <p>\` then \`Workflow({ scriptPath: "${join51(runAbs, "orchestration", "<p>.workflow.mjs")}" })\` \u2014 you stay the sole writer either way.
76395
+ With subagents available, prefer the emitted workflows instead: \`orchestrate --run ${runAbs} --phase <p>\` then \`Workflow({ scriptPath: "${join52(runAbs, "orchestration", "<p>.workflow.mjs")}" })\` \u2014 you stay the sole writer either way.
75614
76396
  `;
75615
76397
  }
75616
76398
 
@@ -75623,7 +76405,7 @@ function runStandard(run2) {
75623
76405
  if (ctx?.standard) return ctx.standard;
75624
76406
  for (const f of ["ADJUDICATE.todo.json", "audit-latest.json"]) {
75625
76407
  try {
75626
- const std = JSON.parse(readFileSync34(join52(run2, f), "utf8")).standard;
76408
+ const std = JSON.parse(readFileSync34(join53(run2, f), "utf8")).standard;
75627
76409
  if (typeof std === "string" && std) return std;
75628
76410
  } catch {
75629
76411
  }
@@ -75631,10 +76413,10 @@ function runStandard(run2) {
75631
76413
  return void 0;
75632
76414
  }
75633
76415
  function verifyRunContext(runDir) {
75634
- const run2 = resolve15(runDir);
76416
+ const run2 = resolve16(runDir);
75635
76417
  const ctx = readVerifyContext(run2);
75636
76418
  const standard = runStandard(run2);
75637
- const flagArgs = ["--in", ctx?.in ?? join52(run2, "audit-latest.json")];
76419
+ const flagArgs = ["--in", ctx?.in ?? join53(run2, "audit-latest.json")];
75638
76420
  if (standard) flagArgs.push("--standard", standard);
75639
76421
  if (ctx?.conformities.source === "file") flagArgs.push("--conformities", ctx.conformities.path);
75640
76422
  if (ctx?.conformities.source === "disabled") flagArgs.push("--no-conformities");
@@ -75648,16 +76430,16 @@ function verifyRunContext(runDir) {
75648
76430
  var GLOBS_PLACEHOLDER = "<globs>";
75649
76431
  var REPORT_PLACEHOLDER = "<report.md>";
75650
76432
  function engineArgs(run2) {
75651
- const audit2 = join52(run2, "audit-latest.json");
76433
+ const audit2 = join53(run2, "audit-latest.json");
75652
76434
  const v = verifyRunContext(run2);
75653
76435
  return {
75654
76436
  audit: ["audit", GLOBS_PLACEHOLDER, "--graph", "--out", run2],
75655
76437
  "adjudicate-worklist": ["verify", "--manual", "--in", audit2, "--out", run2],
75656
- "adjudicate-fold": ["verify", "--apply", join52(run2, "ADJUDICATE.todo.json"), "--in", audit2, "--out", run2],
76438
+ "adjudicate-fold": ["verify", "--apply", join53(run2, "ADJUDICATE.todo.json"), "--in", audit2, "--out", run2],
75657
76439
  report: ["report", "--in", audit2, "--out", run2],
75658
76440
  "verify-worklist": ["verify", "--report", v.report, ...v.flagArgs, "--out", run2],
75659
- "verify-fold": ["verify", "--apply", join52(run2, "VERIFY.todo.json"), "--report", v.report, ...v.flagArgs],
75660
- gate: ["check", "--report", v.report, ...v.standard ? ["--standard", v.standard] : [], "--semantic", "--verdicts", join52(run2, "VERIFY.todo.json")],
76441
+ "verify-fold": ["verify", "--apply", join53(run2, "VERIFY.todo.json"), "--report", v.report, ...v.flagArgs],
76442
+ gate: ["check", "--report", v.report, ...v.standard ? ["--standard", v.standard] : [], "--semantic", "--verdicts", join53(run2, "VERIFY.todo.json")],
75661
76443
  fix: ["fix", GLOBS_PLACEHOLDER, "--write", "--iterate"]
75662
76444
  };
75663
76445
  }
@@ -75665,11 +76447,11 @@ function renderCommand(engineAbs, args2) {
75665
76447
  return `node ${engineAbs} ${args2.map((a) => a === GLOBS_PLACEHOLDER ? `"${a}"` : a).join(" ")}`;
75666
76448
  }
75667
76449
  function listPhases(runDir, engineAbs) {
75668
- const run2 = resolve15(runDir);
75669
- const adjPath = join52(run2, "ADJUDICATE.todo.json");
76450
+ const run2 = resolve16(runDir);
76451
+ const adjPath = join53(run2, "ADJUDICATE.todo.json");
75670
76452
  let adjIds = [];
75671
76453
  let adjReady = false;
75672
- if (existsSync39(adjPath)) {
76454
+ if (existsSync41(adjPath)) {
75673
76455
  try {
75674
76456
  const f = JSON.parse(readFileSync34(adjPath, "utf8"));
75675
76457
  if (f && f.kind === "adjudication" && Array.isArray(f.items)) {
@@ -75679,10 +76461,10 @@ function listPhases(runDir, engineAbs) {
75679
76461
  } catch {
75680
76462
  }
75681
76463
  }
75682
- const verPath = join52(run2, "VERIFY.todo.json");
76464
+ const verPath = join53(run2, "VERIFY.todo.json");
75683
76465
  let verIds = [];
75684
76466
  let verReady = false;
75685
- if (existsSync39(verPath)) {
76467
+ if (existsSync41(verPath)) {
75686
76468
  try {
75687
76469
  const items = JSON.parse(readFileSync34(verPath, "utf8"));
75688
76470
  if (Array.isArray(items)) {
@@ -75716,15 +76498,15 @@ function listPhases(runDir, engineAbs) {
75716
76498
  }
75717
76499
  var EXIT_USAGE = "usage / bad input (missing or unreadable file, unknown flag value)";
75718
76500
  function buildManifest(runDir, engineAbs, batchSize = BATCH_SIZE2) {
75719
- const run2 = resolve15(runDir);
76501
+ const run2 = resolve16(runDir);
75720
76502
  const args2 = engineArgs(run2);
75721
76503
  const phases = listPhases(run2, engineAbs);
75722
76504
  const v = verifyRunContext(run2);
75723
- const audit2 = join52(run2, "audit-latest.json");
75724
- const adjTodo = join52(run2, "ADJUDICATE.todo.json");
75725
- const verTodo = join52(run2, "VERIFY.todo.json");
76505
+ const audit2 = join53(run2, "audit-latest.json");
76506
+ const adjTodo = join53(run2, "ADJUDICATE.todo.json");
76507
+ const verTodo = join53(run2, "VERIFY.todo.json");
75726
76508
  const placeholder = (f) => f === GLOBS_PLACEHOLDER || f === REPORT_PLACEHOLDER;
75727
- const ready = (inputs) => inputs.every((f) => placeholder(f) || existsSync39(f));
76509
+ const ready = (inputs) => inputs.every((f) => placeholder(f) || existsSync41(f));
75728
76510
  const engine = (id, title, inputs, outputs, exit, next) => ({
75729
76511
  id,
75730
76512
  kind: "engine",
@@ -75742,7 +76524,7 @@ function buildManifest(runDir, engineAbs, batchSize = BATCH_SIZE2) {
75742
76524
  kind: "judgment",
75743
76525
  title,
75744
76526
  role,
75745
- contract: join52(run2, "orchestration", "agents", `${role}.md`),
76527
+ contract: join53(run2, "orchestration", "agents", `${role}.md`),
75746
76528
  worklist: ph.worklist,
75747
76529
  items: ph.items,
75748
76530
  batches: toBatches(ph.ids, batchSize),
@@ -75778,7 +76560,7 @@ function buildManifest(runDir, engineAbs, batchSize = BATCH_SIZE2) {
75778
76560
  "adjudicate-worklist",
75779
76561
  "Adjudication worklist \u2014 the criteria the engine could not decide",
75780
76562
  [audit2],
75781
- [adjTodo, join52(run2, "ADJUDICATE.md"), join52(run2, "ADJUDICATE.verdicts.json"), join52(run2, "adjudicate")],
76563
+ [adjTodo, join53(run2, "ADJUDICATE.md"), join53(run2, "ADJUDICATE.verdicts.json"), join53(run2, "adjudicate")],
75782
76564
  { "0": "worklist written (possibly empty: nothing to adjudicate)", "2": EXIT_USAGE },
75783
76565
  "adjudicate"
75784
76566
  ),
@@ -75787,7 +76569,7 @@ function buildManifest(runDir, engineAbs, batchSize = BATCH_SIZE2) {
75787
76569
  adj,
75788
76570
  "adjudicator",
75789
76571
  "Adjudicate \u2014 fill every item's verdict (C/NC/NA/manual)",
75790
- [adjTodo, join52(run2, "adjudicate")],
76572
+ [adjTodo, join53(run2, "adjudicate")],
75791
76573
  "adjudicate-fold"
75792
76574
  ),
75793
76575
  engine(
@@ -75814,7 +76596,7 @@ function buildManifest(runDir, engineAbs, batchSize = BATCH_SIZE2) {
75814
76596
  "verify-worklist",
75815
76597
  "Trial worklist \u2014 the report's non-conformities and the audit's claimed conformities",
75816
76598
  [v.report, verAudit],
75817
- [verTodo, join52(run2, "VERIFY.md"), join52(run2, "VERIFY.context.json")],
76599
+ [verTodo, join53(run2, "VERIFY.md"), join53(run2, "VERIFY.context.json")],
75818
76600
  { "0": "worklist written", "2": EXIT_USAGE },
75819
76601
  "verify"
75820
76602
  ),
@@ -75848,16 +76630,16 @@ function buildManifest(runDir, engineAbs, batchSize = BATCH_SIZE2) {
75848
76630
  }
75849
76631
  function unrenderedInRun(run2) {
75850
76632
  try {
75851
- const audit2 = JSON.parse(readFileSync34(join52(run2, "audit-latest.json"), "utf8"));
75852
- const todo = JSON.parse(readFileSync34(join52(run2, "ADJUDICATE.todo.json"), "utf8"));
76633
+ const audit2 = JSON.parse(readFileSync34(join53(run2, "audit-latest.json"), "utf8"));
76634
+ const todo = JSON.parse(readFileSync34(join53(run2, "ADJUDICATE.todo.json"), "utf8"));
75853
76635
  return unrenderedResidual(audit2, todo.items ?? []);
75854
76636
  } catch {
75855
76637
  return [];
75856
76638
  }
75857
76639
  }
75858
76640
  function orchestrateRun(runDir, engineAbs, opts = {}) {
75859
- const run2 = resolve15(runDir);
75860
- if (!existsSync39(run2)) {
76641
+ const run2 = resolve16(runDir);
76642
+ if (!existsSync41(run2)) {
75861
76643
  return { exitCode: 2, written: [], notices: [], errors: [`run dir not found: ${run2}`], phases: [] };
75862
76644
  }
75863
76645
  const phases = listPhases(run2, engineAbs);
@@ -75884,22 +76666,22 @@ function orchestrateRun(runDir, engineAbs, opts = {}) {
75884
76666
  }
75885
76667
  selected = [ph];
75886
76668
  }
75887
- const orchDir = join52(run2, "orchestration");
75888
- const agentsDir = join52(orchDir, "agents");
75889
- mkdirSync18(join52(orchDir, "out"), { recursive: true });
76669
+ const orchDir = join53(run2, "orchestration");
76670
+ const agentsDir = join53(orchDir, "agents");
76671
+ mkdirSync18(join53(orchDir, "out"), { recursive: true });
75890
76672
  mkdirSync18(agentsDir, { recursive: true });
75891
76673
  const written = [];
75892
76674
  const notices = [];
75893
76675
  for (const [name2, content] of Object.entries(agentContracts(run2, { eco: opts.eco === true, verify: verifyRunContext(run2) }))) {
75894
- const p = join52(agentsDir, `${name2}.md`);
76676
+ const p = join53(agentsDir, `${name2}.md`);
75895
76677
  writeFileSync21(p, content);
75896
76678
  written.push(p);
75897
76679
  }
75898
76680
  const emitted = new Set(opts.eco ? [] : selected.filter((p) => p.items > 0).map((p) => p.name));
75899
76681
  for (const ph of phases) {
75900
76682
  if (emitted.has(ph.name)) continue;
75901
- const stale = join52(orchDir, `${ph.name}.workflow.mjs`);
75902
- if (existsSync39(stale)) {
76683
+ const stale = join53(orchDir, `${ph.name}.workflow.mjs`);
76684
+ if (existsSync41(stale)) {
75903
76685
  rmSync9(stale, { force: true });
75904
76686
  notices.push(`phase "${ph.name}": stale workflow removed \u2014 its worklist ${ph.ready ? "is now empty" : "no longer exists"}.`);
75905
76687
  }
@@ -75913,12 +76695,12 @@ function orchestrateRun(runDir, engineAbs, opts = {}) {
75913
76695
  if (ph.items <= SMALL_WORKLIST) {
75914
76696
  notices.push(`phase "${ph.name}": only ${ph.items} item(s) \u2014 the sequential --eco path is equivalent and cheaper.`);
75915
76697
  }
75916
- const p = join52(orchDir, `${ph.name}.workflow.mjs`);
76698
+ const p = join53(orchDir, `${ph.name}.workflow.mjs`);
75917
76699
  writeFileSync21(p, phaseWorkflowScript(ph, run2, engineAbs, BATCH_SIZE2));
75918
76700
  written.push(p);
75919
76701
  }
75920
76702
  }
75921
- const rb = join52(orchDir, "RUNBOOK.md");
76703
+ const rb = join53(orchDir, "RUNBOOK.md");
75922
76704
  writeFileSync21(rb, runbookMd(buildManifest(run2, engineAbs), unrenderedInRun(run2)));
75923
76705
  written.push(rb);
75924
76706
  return { exitCode: 0, written, notices, errors: [], phases };
@@ -76178,8 +76960,8 @@ ${xs.map(line).join("\n")}` : t3.none;
76178
76960
  import { createInterface as createInterface2 } from "readline";
76179
76961
 
76180
76962
  // src/mcp/handlers.ts
76181
- import { existsSync as existsSync40, lstatSync as lstatSync2, mkdirSync as mkdirSync19, readFileSync as readFileSync36, realpathSync as realpathSync7, statSync as statSync19, writeFileSync as writeFileSync22 } from "fs";
76182
- import { basename as basename4, dirname as dirname20, isAbsolute as isAbsolute6, join as join53, resolve as resolve16, sep as sep5 } from "path";
76963
+ import { existsSync as existsSync42, lstatSync as lstatSync2, mkdirSync as mkdirSync19, readFileSync as readFileSync36, realpathSync as realpathSync7, statSync as statSync20, writeFileSync as writeFileSync22 } from "fs";
76964
+ import { basename as basename4, dirname as dirname20, isAbsolute as isAbsolute6, join as join54, resolve as resolve17, sep as sep5 } from "path";
76183
76965
 
76184
76966
  // src/criteria-view.ts
76185
76967
  var CriteriaLookupError = class extends Error {
@@ -76662,9 +77444,9 @@ function positive(v, key2) {
76662
77444
  function requiredCwd(args2, defaults) {
76663
77445
  const cwd = str2(args2.cwd) ?? defaults.defaultCwd;
76664
77446
  if (!cwd) throw new ToolError("`cwd` is required: an absolute path to the project root.");
76665
- const abs = resolve16(cwd);
76666
- if (!existsSync40(abs)) throw new ToolError(`project root not found: ${abs}`);
76667
- if (!statSync19(abs).isDirectory()) throw new ToolError(`\`cwd\` is not a directory: ${abs}`);
77447
+ const abs = resolve17(cwd);
77448
+ if (!existsSync42(abs)) throw new ToolError(`project root not found: ${abs}`);
77449
+ if (!statSync20(abs).isDirectory()) throw new ToolError(`\`cwd\` is not a directory: ${abs}`);
76668
77450
  return abs;
76669
77451
  }
76670
77452
  function optionalCwd(args2, defaults) {
@@ -76776,7 +77558,7 @@ function audit(args2, cwd) {
76776
77558
  process.chdir(cwd);
76777
77559
  const inputs = strArray2(args2.globs) ?? DEFAULT_GLOBS;
76778
77560
  const scopedToDiff = bool(args2.changed) || bool(args2.staged) || str2(args2.since) !== void 0;
76779
- const extra = [CAPTURES_DIR, PAGES_DIR].filter((d) => !scopedToDiff && existsSync40(d) && !inputs.includes(d));
77561
+ const extra = [CAPTURES_DIR, PAGES_DIR].filter((d) => !scopedToDiff && existsSync42(d) && !inputs.includes(d));
76780
77562
  const result = runAudit({
76781
77563
  inputs: [...inputs, ...extra],
76782
77564
  include: strArray2(args2.include),
@@ -76883,7 +77665,7 @@ function handleAdjudicate(args2, cwd) {
76883
77665
  standard,
76884
77666
  count: items.length,
76885
77667
  items,
76886
- worklist: formatAdjudication(items, langOf(args2)),
77668
+ worklist: formatAdjudication(items, langOf(args2), CORE2, { cwd }),
76887
77669
  next: "These are the criteria the engine cannot decide. Read each element's real context with ultra11y_read, then rule on it."
76888
77670
  };
76889
77671
  }
@@ -76895,8 +77677,8 @@ function handlePackCheck(args2, cwd) {
76895
77677
  return { cwd, ...res };
76896
77678
  }
76897
77679
  function handleSampleCheck(cwd, standard) {
76898
- const file = join53(cwd, ".ultra11yrc.json");
76899
- if (!existsSync40(file)) {
77680
+ const file = join54(cwd, ".ultra11yrc.json");
77681
+ if (!existsSync42(file)) {
76900
77682
  throw new ToolError(`no .ultra11yrc.json at ${cwd} \u2014 a page sample must be declared before it can be linted.`);
76901
77683
  }
76902
77684
  let raw;
@@ -77030,7 +77812,7 @@ function handleFold(args2, cwd) {
77030
77812
  };
77031
77813
  }
77032
77814
  mkdirSync19(outDir, { recursive: true });
77033
- const auditPath = join53(outDir, "audit-latest.json");
77815
+ const auditPath = join54(outDir, "audit-latest.json");
77034
77816
  writeFileSync22(auditPath, `${JSON.stringify(auditDocumentFor(r.audit, adj.standard, lang), null, 2)}
77035
77817
  `);
77036
77818
  let ledger;
@@ -77053,7 +77835,7 @@ function containedPath(raw, cwd, field) {
77053
77835
  const refuse = () => {
77054
77836
  throw new ToolError(`\`${field}\` is outside the project: ${raw}. The fold reads and writes inside its cwd only.`);
77055
77837
  };
77056
- const target = resolve16(cwd, raw);
77838
+ const target = resolve17(cwd, raw);
77057
77839
  let existing = target;
77058
77840
  const rest = [];
77059
77841
  for (; ; ) {
@@ -77069,7 +77851,7 @@ function containedPath(raw, cwd, field) {
77069
77851
  }
77070
77852
  let real;
77071
77853
  try {
77072
- real = join53(realpathSync7(existing), ...rest);
77854
+ real = join54(realpathSync7(existing), ...rest);
77073
77855
  } catch {
77074
77856
  return refuse();
77075
77857
  }
@@ -77106,10 +77888,10 @@ function handleInit(args2, cwd) {
77106
77888
  if (failOn === null) {
77107
77889
  throw new ToolError(`\`fail_on\` must be one of: ${FAIL_ON_TOKENS} (got "${failOnRaw}")`);
77108
77890
  }
77109
- const enginePath = resolve16("scripts/ultra11y.mjs");
77891
+ const enginePath = resolve17("scripts/ultra11y.mjs");
77110
77892
  const written = [];
77111
77893
  if (bool(args2.hook)) written.push(writeHook(cwd, enginePath, failOn));
77112
- if (bool(args2.ci)) written.push(join53(cwd, ".github/workflows/a11y.yml"));
77894
+ if (bool(args2.ci)) written.push(join54(cwd, ".github/workflows/a11y.yml"));
77113
77895
  if (!written.length) {
77114
77896
  throw new ToolError("nothing to install \u2014 pass hook:true and/or ci:true.");
77115
77897
  }
@@ -77129,7 +77911,7 @@ function reportText(args2, tool) {
77129
77911
  if (inline) return inline;
77130
77912
  if (!file) throw new ToolError(`\`report_text\` is required \u2014 the report markdown for ultra11y_${tool} to work on.`);
77131
77913
  if (!isAbsolute6(file)) throw new ToolError("`report_file` must be an absolute path.");
77132
- if (!existsSync40(file)) throw new ToolError(`report file not found: ${file}`);
77914
+ if (!existsSync42(file)) throw new ToolError(`report file not found: ${file}`);
77133
77915
  try {
77134
77916
  return withReportAnnexes(readFileSync36(file, "utf8"), file, (p) => readFileSync36(p, "utf8"));
77135
77917
  } catch (e) {
@@ -77201,7 +77983,7 @@ function handleMethod(args2) {
77201
77983
  function handleRead(args2, cwd) {
77202
77984
  const raw = str2(args2.path);
77203
77985
  if (!raw) throw new ToolError("`path` is required \u2014 relative to the project root, or an absolute path inside it.");
77204
- const target = isAbsolute6(raw) ? raw : join53(cwd, raw);
77986
+ const target = isAbsolute6(raw) ? raw : join54(cwd, raw);
77205
77987
  let real;
77206
77988
  try {
77207
77989
  real = realpathSync7(target);
@@ -77212,7 +77994,7 @@ function handleRead(args2, cwd) {
77212
77994
  if (real !== root && !real.startsWith(root + sep5)) {
77213
77995
  throw new ToolError(`path is outside the project: ${raw}. Use your own file tool for anything else.`);
77214
77996
  }
77215
- const st = statSync19(real);
77997
+ const st = statSync20(real);
77216
77998
  if (!st.isFile()) throw new ToolError(`not a file: ${raw}`);
77217
77999
  if (st.size > MAX_READ_BYTES) throw new ToolError(`file is too large to read (${st.size} bytes): ${raw}`);
77218
78000
  const lines = readFileSync36(real, "utf8").split("\n");
@@ -77261,12 +78043,12 @@ function validateArgs2(schema, args2) {
77261
78043
  }
77262
78044
  if (spec.type === "array") {
77263
78045
  if (actual !== "array") return `\`${key2}\` must be an array, got ${actual}`;
77264
- const arr = value;
77265
- if (spec.items?.type === "string" && !arr.every((x) => typeof x === "string")) {
78046
+ const arr2 = value;
78047
+ if (spec.items?.type === "string" && !arr2.every((x) => typeof x === "string")) {
77266
78048
  return `\`${key2}\` must be an array of strings`;
77267
78049
  }
77268
78050
  if (spec.enum) {
77269
- const bad = arr.find((x) => typeof x === "string" && !spec.enum.includes(x));
78051
+ const bad = arr2.find((x) => typeof x === "string" && !spec.enum.includes(x));
77270
78052
  if (bad !== void 0) return `\`${key2}\` contains "${String(bad)}" \u2014 allowed: ${spec.enum.join(", ")}`;
77271
78053
  }
77272
78054
  continue;
@@ -77910,25 +78692,25 @@ function str3(v) {
77910
78692
  var DECLARED = new Set([...TOOLS2, ...WRITE_TOOLS].map((t3) => t3.name));
77911
78693
 
77912
78694
  // src/mcp/resources.ts
77913
- import { existsSync as existsSync41, readdirSync as readdirSync8, readFileSync as readFileSync37, realpathSync as realpathSync8, statSync as statSync20 } from "fs";
77914
- import { basename as basename5, dirname as dirname21, join as join54, resolve as resolve17, sep as sep6 } from "path";
78695
+ import { existsSync as existsSync43, readdirSync as readdirSync8, readFileSync as readFileSync37, realpathSync as realpathSync8, statSync as statSync21 } from "fs";
78696
+ import { basename as basename5, dirname as dirname21, join as join55, resolve as resolve18, sep as sep6 } from "path";
77915
78697
  import { fileURLToPath as fileURLToPath5 } from "url";
77916
78698
  var SKILL_NAME = "ultra11y";
77917
78699
  var URI_SCHEME = "skill://";
77918
78700
  function resolveSkillRoot(moduleDir) {
77919
78701
  const here = moduleDir ?? dirname21(fileURLToPath5(import.meta.url));
77920
- const candidates2 = [resolve17(here, ".."), resolve17(here, "..", "skills", SKILL_NAME), resolve17(here, "..", "..", "skills", SKILL_NAME)];
77921
- return candidates2.find((dir) => existsSync41(join54(dir, "SKILL.md")));
78702
+ const candidates2 = [resolve18(here, ".."), resolve18(here, "..", "skills", SKILL_NAME), resolve18(here, "..", "..", "skills", SKILL_NAME)];
78703
+ return candidates2.find((dir) => existsSync43(join55(dir, "SKILL.md")));
77922
78704
  }
77923
78705
  function listResources(moduleDir) {
77924
78706
  const root = resolveSkillRoot(moduleDir);
77925
78707
  if (!root) return [];
77926
78708
  const out2 = [describe(root, "SKILL.md", `${SKILL_NAME}: the skill`)];
77927
- const refDir = join54(root, "references");
77928
- if (!existsSync41(refDir)) return out2;
78709
+ const refDir = join55(root, "references");
78710
+ if (!existsSync43(refDir)) return out2;
77929
78711
  for (const file of readdirSync8(refDir).sort()) {
77930
78712
  if (!file.endsWith(".md")) continue;
77931
- out2.push(describe(root, join54("references", file), `${SKILL_NAME} reference: ${basename5(file, ".md")}`));
78713
+ out2.push(describe(root, join55("references", file), `${SKILL_NAME} reference: ${basename5(file, ".md")}`));
77932
78714
  }
77933
78715
  return out2;
77934
78716
  }
@@ -77940,7 +78722,7 @@ function readResource(uri, moduleDir) {
77940
78722
  if (!root) throw new ResourceError("no skill payload found next to this build \u2014 nothing to read");
77941
78723
  const rel2 = uri.slice(URI_SCHEME.length);
77942
78724
  if (!rel2) throw new ResourceError("empty resource path");
77943
- const target = resolve17(root, rel2);
78725
+ const target = resolve18(root, rel2);
77944
78726
  const rootReal = realpathSync8(root);
77945
78727
  let targetReal;
77946
78728
  try {
@@ -77951,7 +78733,7 @@ function readResource(uri, moduleDir) {
77951
78733
  if (targetReal !== rootReal && !targetReal.startsWith(rootReal + sep6)) {
77952
78734
  throw new ResourceError(`resource path escapes the skill root: ${uri}`);
77953
78735
  }
77954
- if (!statSync20(targetReal).isFile()) throw new ResourceError(`not a file: ${uri}`);
78736
+ if (!statSync21(targetReal).isFile()) throw new ResourceError(`not a file: ${uri}`);
77955
78737
  return { uri, mimeType: "text/markdown", text: readFileSync37(targetReal, "utf8") };
77956
78738
  }
77957
78739
  var ResourceError = class extends Error {
@@ -77963,7 +78745,7 @@ function describe(root, rel2, fallbackTitle) {
77963
78745
  title: fallbackTitle,
77964
78746
  mimeType: "text/markdown"
77965
78747
  };
77966
- const summary = firstProse(join54(root, rel2));
78748
+ const summary = firstProse(join55(root, rel2));
77967
78749
  if (summary) decl.description = summary;
77968
78750
  return decl;
77969
78751
  }
@@ -78352,14 +79134,14 @@ function startHttpServer(opts = {}) {
78352
79134
  server.requestTimeout = 0;
78353
79135
  server.headersTimeout = 6e4;
78354
79136
  server.keepAliveTimeout = 12e4;
78355
- return new Promise((resolve19, reject) => {
79137
+ return new Promise((resolve20, reject) => {
78356
79138
  server.once("error", reject);
78357
79139
  server.listen(opts.port ?? 0, bind, () => {
78358
79140
  server.removeListener("error", reject);
78359
79141
  const addr2 = server.address();
78360
79142
  const port = typeof addr2 === "object" && addr2 ? addr2.port : opts.port ?? 0;
78361
79143
  const host = bind.includes(":") ? `[${bind}]` : bind;
78362
- resolve19({
79144
+ resolve20({
78363
79145
  server,
78364
79146
  port,
78365
79147
  url: `http://${host}:${port}${MCP_PATH}`,
@@ -78468,7 +79250,7 @@ function sendJson(res, status, body3, origin, extra = {}) {
78468
79250
  }
78469
79251
  var DRAIN_LIMIT = MAX_BODY_BYTES * 8;
78470
79252
  function readBody2(req) {
78471
- return new Promise((resolve19, reject) => {
79253
+ return new Promise((resolve20, reject) => {
78472
79254
  const chunks = [];
78473
79255
  let size = 0;
78474
79256
  let over = false;
@@ -78492,7 +79274,7 @@ function readBody2(req) {
78492
79274
  });
78493
79275
  req.on("end", () => {
78494
79276
  if (over) reject(new Error("too large"));
78495
- else resolve19(Buffer.concat(chunks).toString("utf8"));
79277
+ else resolve20(Buffer.concat(chunks).toString("utf8"));
78496
79278
  });
78497
79279
  req.on("error", reject);
78498
79280
  req.on("aborted", () => reject(new Error("client aborted the request")));
@@ -79405,13 +80187,13 @@ async function cmdAudit(p) {
79405
80187
  const capturesFlag = typeof p.flags.captures === "string" && p.flags.captures ? p.flags.captures : void 0;
79406
80188
  const capturesDir = capturesFlag ?? CAPTURES_DIR;
79407
80189
  const scopedToDiff = p.flags.changed === true || p.flags.staged === true || since !== void 0;
79408
- const capturesWanted = p.flags["no-captures"] !== true && !inputs.includes("-") && (capturesFlag !== void 0 || existsSync42(capturesDir));
80190
+ const capturesWanted = p.flags["no-captures"] !== true && !inputs.includes("-") && (capturesFlag !== void 0 || existsSync44(capturesDir));
79409
80191
  const useCaptures = capturesWanted && !scopedToDiff && !inputs.includes(capturesDir);
79410
- const pagesWanted = p.flags["no-captures"] !== true && !inputs.includes("-") && existsSync42(PAGES_DIR);
80192
+ const pagesWanted = p.flags["no-captures"] !== true && !inputs.includes("-") && existsSync44(PAGES_DIR);
79411
80193
  const usePages = pagesWanted && !scopedToDiff && !inputs.includes(PAGES_DIR);
79412
80194
  const pagesInScope = pagesWanted && !scopedToDiff;
79413
80195
  const documentsGlob = `${DOCUMENTS_DIR}/*.pdf`;
79414
- const useDocuments = p.flags["no-pdf"] !== true && !inputs.includes("-") && !scopedToDiff && existsSync42(DOCUMENTS_DIR) && !inputs.includes(documentsGlob) && !inputs.includes(DOCUMENTS_DIR);
80196
+ const useDocuments = p.flags["no-pdf"] !== true && !inputs.includes("-") && !scopedToDiff && existsSync44(DOCUMENTS_DIR) && !inputs.includes(documentsGlob) && !inputs.includes(DOCUMENTS_DIR);
79415
80197
  const auditInputs = [...inputs, ...useCaptures ? [capturesDir] : [], ...usePages ? [PAGES_DIR] : [], ...useDocuments ? [documentsGlob] : []];
79416
80198
  if (useCaptures)
79417
80199
  console.error(
@@ -79456,7 +80238,7 @@ async function cmdAudit(p) {
79456
80238
  if (typeof p.flags.out === "string") {
79457
80239
  const out2 = p.flags.out;
79458
80240
  const asFile = out2.toLowerCase().endsWith(".json");
79459
- const target = asFile ? out2 : join55(out2, "audit-latest.json");
80241
+ const target = asFile ? out2 : join56(out2, "audit-latest.json");
79460
80242
  try {
79461
80243
  mkdirSync20(asFile ? dirname22(out2) : out2, { recursive: true });
79462
80244
  writeFileSync23(target, JSON.stringify(document, null, 2) + "\n");
@@ -79478,7 +80260,7 @@ async function cmdAudit(p) {
79478
80260
  const baselineFlag = p.flags.baseline;
79479
80261
  if (typeof baselineFlag === "string" && baselineFlag) {
79480
80262
  let baseline = null;
79481
- if (existsSync42(baselineFlag)) {
80263
+ if (existsSync44(baselineFlag)) {
79482
80264
  try {
79483
80265
  const parsed = unwrapAudit(JSON.parse(readText(baselineFlag)));
79484
80266
  if (isCurrentAudit(parsed)) baseline = parsed;
@@ -79532,11 +80314,11 @@ async function cmdDev(p) {
79532
80314
  return 2;
79533
80315
  }
79534
80316
  if (p.flags.next === true) {
79535
- const dir = join55(root, ".ultra11y", "next");
80317
+ const dir = join56(root, ".ultra11y", "next");
79536
80318
  const rel2 = ".ultra11y/next/overlay.jsx";
79537
80319
  try {
79538
80320
  mkdirSync20(dir, { recursive: true });
79539
- writeFileSync23(join55(dir, "overlay.jsx"), nextOverlayComponent(port));
80321
+ writeFileSync23(join56(dir, "overlay.jsx"), nextOverlayComponent(port));
79540
80322
  } catch (e) {
79541
80323
  console.error(`ultra11y dev: could not write ${rel2}: ${e instanceof Error ? e.message : String(e)}`);
79542
80324
  return 1;
@@ -79567,9 +80349,9 @@ async function cmdDev(p) {
79567
80349
  }
79568
80350
  console.error(fr ? `ultra11y dev : tableau de bord sur http://127.0.0.1:${server.port}` : `ultra11y dev: dashboard on http://127.0.0.1:${server.port}`);
79569
80351
  console.error(fr ? "Boucle locale uniquement (l'outil \xE9crit des fichiers). Ctrl-C pour arr\xEAter." : "Loopback only (the tool writes files). Ctrl-C to stop.");
79570
- await new Promise((resolve19) => {
80352
+ await new Promise((resolve20) => {
79571
80353
  const stop2 = () => {
79572
- void server.close().then(resolve19);
80354
+ void server.close().then(resolve20);
79573
80355
  };
79574
80356
  process.once("SIGINT", stop2);
79575
80357
  process.once("SIGTERM", stop2);
@@ -79585,7 +80367,7 @@ async function cmdPagesDiscover(p) {
79585
80367
  const snaps = sampleFromSnapshots(readSnapshots(root));
79586
80368
  if (!snaps.length) {
79587
80369
  console.error(
79588
- lang === "fr" ? `ultra11y pages discover : aucun instantan\xE9 sous ${join55(root, PAGES_DIR)} \u2014 lancez d'abord vos tests E2E avec checkA11y, ou \`scan --sample\`.` : `ultra11y pages discover: no snapshot under ${join55(root, PAGES_DIR)} \u2014 run your E2E tests with checkA11y first, or \`scan --sample\`.`
80370
+ lang === "fr" ? `ultra11y pages discover : aucun instantan\xE9 sous ${join56(root, PAGES_DIR)} \u2014 lancez d'abord vos tests E2E avec checkA11y, ou \`scan --sample\`.` : `ultra11y pages discover: no snapshot under ${join56(root, PAGES_DIR)} \u2014 run your E2E tests with checkA11y first, or \`scan --sample\`.`
79589
80371
  );
79590
80372
  return 1;
79591
80373
  }
@@ -79599,9 +80381,9 @@ async function cmdPagesDiscover(p) {
79599
80381
  }
79600
80382
  const depth = typeof p.flags.depth === "string" ? Number(p.flags.depth) : void 0;
79601
80383
  const max = typeof p.flags.max === "string" ? Number(p.flags.max) : void 0;
79602
- const cache = /* @__PURE__ */ new Map();
80384
+ const cache2 = /* @__PURE__ */ new Map();
79603
80385
  const fetchHtml2 = async (url) => {
79604
- const hit = cache.get(url);
80386
+ const hit = cache2.get(url);
79605
80387
  if (hit !== void 0) return hit;
79606
80388
  let html = "";
79607
80389
  try {
@@ -79609,7 +80391,7 @@ async function cmdPagesDiscover(p) {
79609
80391
  if (res.ok) html = await res.text();
79610
80392
  } catch {
79611
80393
  }
79612
- cache.set(url, html);
80394
+ cache2.set(url, html);
79613
80395
  return html;
79614
80396
  };
79615
80397
  let urls;
@@ -79666,9 +80448,9 @@ ${found} page(s) discovered, ${merged.added.length} new. Nothing was written \u2
79666
80448
  }
79667
80449
  return 0;
79668
80450
  }
79669
- const file = join55(process.cwd(), ".ultra11yrc.json");
80451
+ const file = join56(process.cwd(), ".ultra11yrc.json");
79670
80452
  let doc = {};
79671
- if (existsSync42(file)) {
80453
+ if (existsSync44(file)) {
79672
80454
  try {
79673
80455
  doc = JSON.parse(readText(file));
79674
80456
  } catch {
@@ -79733,7 +80515,7 @@ async function cmdPages(p) {
79733
80515
  const outDir2 = typeof p.flags.out === "string" && p.flags.out ? p.flags.out : "";
79734
80516
  if (outDir2) {
79735
80517
  mkdirSync20(outDir2, { recursive: true });
79736
- writeFileSync23(join55(outDir2, "pages.json"), `${json}
80518
+ writeFileSync23(join56(outDir2, "pages.json"), `${json}
79737
80519
  `);
79738
80520
  }
79739
80521
  return 0;
@@ -79759,27 +80541,27 @@ async function cmdPages(p) {
79759
80541
  const derived = derivePages(result, scope);
79760
80542
  const split = p.flags.split === "page";
79761
80543
  const outDir = typeof p.flags.out === "string" && p.flags.out ? p.flags.out : void 0;
79762
- const shotOf = (id) => join55(PAGES_DIR, id, "screen.png");
80544
+ const shotOf = (id) => join56(PAGES_DIR, id, "screen.png");
79763
80545
  const shotsRelative = (fileDir) => {
79764
80546
  const m = /* @__PURE__ */ new Map();
79765
80547
  for (const pg of derived) {
79766
- if (existsSync42(shotOf(pg.id))) m.set(pg.id, relative7(fileDir, shotOf(pg.id)).split("\\").join("/"));
80548
+ if (existsSync44(shotOf(pg.id))) m.set(pg.id, relative7(fileDir, shotOf(pg.id)).split("\\").join("/"));
79767
80549
  }
79768
80550
  return m;
79769
80551
  };
79770
80552
  const shotPaths = (pages) => {
79771
80553
  const m = /* @__PURE__ */ new Map();
79772
- for (const pg of pages) if (existsSync42(shotOf(pg.id))) m.set(pg.id, shotOf(pg.id));
80554
+ for (const pg of pages) if (existsSync44(shotOf(pg.id))) m.set(pg.id, shotOf(pg.id));
79773
80555
  return m;
79774
80556
  };
79775
80557
  const shotsCopiedInto = (dir) => {
79776
80558
  const m = /* @__PURE__ */ new Map();
79777
- const assets = join55(dir, "assets");
80559
+ const assets = join56(dir, "assets");
79778
80560
  for (const pg of derived) {
79779
80561
  const src = shotOf(pg.id);
79780
- if (!existsSync42(src)) continue;
80562
+ if (!existsSync44(src)) continue;
79781
80563
  mkdirSync20(assets, { recursive: true });
79782
- copyFileSync4(src, join55(assets, `${pg.id}.png`));
80564
+ copyFileSync4(src, join56(assets, `${pg.id}.png`));
79783
80565
  m.set(pg.id, `./assets/${pg.id}.png`);
79784
80566
  }
79785
80567
  return m;
@@ -79805,7 +80587,7 @@ async function cmdPages(p) {
79805
80587
  if (manifest) {
79806
80588
  const total = evidenceNotice(manifest, null, lang);
79807
80589
  console.error(
79808
- lang === "fr" ? `ultra11y : ${manifest.totals.imaged} vignette(s) \xE9crite(s) dans ${join55(outDir, "assets")}.` : `ultra11y: ${manifest.totals.imaged} crop(s) written to ${join55(outDir, "assets")}.`
80590
+ lang === "fr" ? `ultra11y : ${manifest.totals.imaged} vignette(s) \xE9crite(s) dans ${join56(outDir, "assets")}.` : `ultra11y: ${manifest.totals.imaged} crop(s) written to ${join56(outDir, "assets")}.`
79809
80591
  );
79810
80592
  for (const line of total) console.error(line);
79811
80593
  }
@@ -79814,7 +80596,7 @@ async function cmdPages(p) {
79814
80596
  ...manifest ? { evidenceNotice: (id) => evidenceNotice(manifest, id, lang) } : {}
79815
80597
  };
79816
80598
  if (!split) {
79817
- const file = join55(outDir, `pages-${result.date}.md`);
80599
+ const file = join56(outDir, `pages-${result.date}.md`);
79818
80600
  writeFileSync23(file, `${renderPagesDocument(result, derived, { standard, lang, screenshots: shotsCopiedInto(outDir), ...evidenceOpts })}
79819
80601
  `);
79820
80602
  const html2 = wantHtml ? emitHtml(result, {
@@ -79834,10 +80616,10 @@ async function cmdPages(p) {
79834
80616
  const sheet = (id) => `page-${id}.md`;
79835
80617
  const hrefs = new Map(derived.map((pg) => [pg.id, `./${sheet(pg.id)}`]));
79836
80618
  for (const pg of derived) {
79837
- writeFileSync23(join55(outDir, sheet(pg.id)), `${renderPageDocument(result, pg, { standard, lang, screenshots: shots, ...evidenceOpts })}
80619
+ writeFileSync23(join56(outDir, sheet(pg.id)), `${renderPageDocument(result, pg, { standard, lang, screenshots: shots, ...evidenceOpts })}
79838
80620
  `);
79839
80621
  }
79840
- const index = join55(outDir, "index.md");
80622
+ const index = join56(outDir, "index.md");
79841
80623
  writeFileSync23(index, `${renderPagesIndex(result, derived, { standard, lang, hrefs })}
79842
80624
  `);
79843
80625
  const html = wantHtml ? emitHtml(result, {
@@ -79889,7 +80671,7 @@ async function cmdSnapshot(p) {
79889
80671
  2
79890
80672
  )
79891
80673
  );
79892
- else if (!snaps.length) console.log(lang === "fr" ? `Aucun instantan\xE9 dans ${join55(root, PAGES_DIR)}.` : `No snapshot in ${join55(root, PAGES_DIR)}.`);
80674
+ else if (!snaps.length) console.log(lang === "fr" ? `Aucun instantan\xE9 dans ${join56(root, PAGES_DIR)}.` : `No snapshot in ${join56(root, PAGES_DIR)}.`);
79893
80675
  else for (const s of snaps) console.log(`${s.meta.id} ${s.meta.name} ${s.meta.url}${s.meta.auth ? " [auth]" : ""}`);
79894
80676
  return 0;
79895
80677
  }
@@ -79943,7 +80725,7 @@ async function cmdSnapshot(p) {
79943
80725
  console.error(`ultra11y snapshot write: could not write the snapshot: ${e instanceof Error ? e.message : String(e)}`);
79944
80726
  return 1;
79945
80727
  }
79946
- const result = runAudit({ inputs: [join55(dir, "dom.html")], onWarn: (m) => console.error(m) });
80728
+ const result = runAudit({ inputs: [join56(dir, "dom.html")], onWarn: (m) => console.error(m) });
79947
80729
  const failOnRaw = p.flags["fail-on"];
79948
80730
  const failOnParsed = parseFailOn(failOnRaw);
79949
80731
  if (failOnRaw !== void 0 && failOnParsed === null) {
@@ -79975,8 +80757,8 @@ function cmdInit(p) {
79975
80757
  if (want.baseline) {
79976
80758
  const inputs = p.positionals.length ? p.positionals : ["."];
79977
80759
  const result = runAudit({ inputs, onWarn: (m) => console.error(m) });
79978
- mkdirSync20(join55(root, "audits"), { recursive: true });
79979
- const bp = join55(root, "audits", "baseline.json");
80760
+ mkdirSync20(join56(root, "audits"), { recursive: true });
80761
+ const bp = join56(root, "audits", "baseline.json");
79980
80762
  writeFileSync23(bp, JSON.stringify(result, null, 2) + "\n");
79981
80763
  wrote.push(bp);
79982
80764
  }
@@ -80303,7 +81085,7 @@ async function cmdTickets(p) {
80303
81085
  let setPath;
80304
81086
  if (ticketsOut) {
80305
81087
  mkdirSync20(ticketsOut, { recursive: true });
80306
- setPath = join55(ticketsOut, `issues-${result.date}.json`);
81088
+ setPath = join56(ticketsOut, `issues-${result.date}.json`);
80307
81089
  const payload = {
80308
81090
  tool: "ultra11y",
80309
81091
  kind: "issues",
@@ -80404,8 +81186,8 @@ async function cmdTickets(p) {
80404
81186
  return pushed.failed > 0 ? 1 : 0;
80405
81187
  }
80406
81188
  function depsAt(root) {
80407
- const pkgPath = join55(root, "package.json");
80408
- if (!existsSync42(pkgPath)) return {};
81189
+ const pkgPath = join56(root, "package.json");
81190
+ if (!existsSync44(pkgPath)) return {};
80409
81191
  try {
80410
81192
  const pkg = JSON.parse(readText(pkgPath));
80411
81193
  return { ...pkg.dependencies ?? {}, ...pkg.devDependencies ?? {} };
@@ -80431,24 +81213,24 @@ function cmdRender(p) {
80431
81213
  console.error(`ultra11y render: --runner must be playwright|cypress|auto (got "${forced}").`);
80432
81214
  return 2;
80433
81215
  }
80434
- const detected = detectE2eRunner(depsAt(root), (f) => existsSync42(join55(root, f)));
81216
+ const detected = detectE2eRunner(depsAt(root), (f) => existsSync44(join56(root, f)));
80435
81217
  const runners = forced && forced !== "auto" ? [forced] : detected;
80436
81218
  if (!runners.length) {
80437
81219
  console.error(e2eSetupPlan([], {}, lang));
80438
81220
  return 1;
80439
81221
  }
80440
81222
  const engineRef = engineRefFor(root);
80441
- const dir = join55(root, ".ultra11y", "e2e");
81223
+ const dir = join56(root, ".ultra11y", "e2e");
80442
81224
  const paths = {};
80443
81225
  try {
80444
81226
  mkdirSync20(dir, { recursive: true });
80445
81227
  if (runners.includes("playwright")) {
80446
- writeFileSync23(join55(dir, "playwright.mjs"), playwrightFixture(engineRef));
81228
+ writeFileSync23(join56(dir, "playwright.mjs"), playwrightFixture(engineRef));
80447
81229
  paths.playwright = ".ultra11y/e2e/playwright.mjs";
80448
81230
  }
80449
81231
  if (runners.includes("cypress")) {
80450
- writeFileSync23(join55(dir, "cypress-plugin.mjs"), cypressPlugin(engineRef));
80451
- writeFileSync23(join55(dir, "cypress-commands.mjs"), cypressCommands());
81232
+ writeFileSync23(join56(dir, "cypress-plugin.mjs"), cypressPlugin(engineRef));
81233
+ writeFileSync23(join56(dir, "cypress-commands.mjs"), cypressCommands());
80452
81234
  paths.cypressPlugin = ".ultra11y/e2e/cypress-plugin.mjs";
80453
81235
  paths.cypressCommands = ".ultra11y/e2e/cypress-commands.mjs";
80454
81236
  }
@@ -80477,7 +81259,7 @@ Fill in COMPONENTS, run it (e.g. npx tsx ${out2}), then: node scripts/ultra11y.m
80477
81259
  }
80478
81260
  if (p.flags.setup === true) {
80479
81261
  const rel2 = ".ultra11y/capture-setup.mjs";
80480
- const out2 = join55(root, rel2);
81262
+ const out2 = join56(root, rel2);
80481
81263
  try {
80482
81264
  mkdirSync20(dirname22(out2), { recursive: true });
80483
81265
  writeFileSync23(out2, captureSetup());
@@ -80486,20 +81268,20 @@ Fill in COMPONENTS, run it (e.g. npx tsx ${out2}), then: node scripts/ultra11y.m
80486
81268
  return 1;
80487
81269
  }
80488
81270
  let setupDeps = {};
80489
- const setupPkg = join55(root, "package.json");
80490
- if (existsSync42(setupPkg)) {
81271
+ const setupPkg = join56(root, "package.json");
81272
+ if (existsSync44(setupPkg)) {
80491
81273
  try {
80492
81274
  const pkg = JSON.parse(readText(setupPkg));
80493
81275
  setupDeps = { ...pkg.dependencies ?? {}, ...pkg.devDependencies ?? {} };
80494
81276
  } catch {
80495
81277
  }
80496
81278
  }
80497
- const tr = detectTestRunner(setupDeps, (f) => existsSync42(join55(root, f)));
81279
+ const tr = detectTestRunner(setupDeps, (f) => existsSync44(join56(root, f)));
80498
81280
  console.log(captureSetupPlan(tr, rel2, lang));
80499
81281
  const gaLine = ".ultra11y/captures/*.html text eol=lf linguist-generated=true";
80500
- const gaPath = join55(root, ".gitattributes");
81282
+ const gaPath = join56(root, ".gitattributes");
80501
81283
  try {
80502
- const existing = existsSync42(gaPath) ? readFileSync38(gaPath, "utf8") : "";
81284
+ const existing = existsSync44(gaPath) ? readFileSync38(gaPath, "utf8") : "";
80503
81285
  if (!existing.includes(".ultra11y/captures/")) {
80504
81286
  appendFileSync(gaPath, (existing && !existing.endsWith("\n") ? "\n" : "") + gaLine + "\n");
80505
81287
  console.log(lang === "fr" ? `.gitattributes : ajout\xE9 \xAB ${gaLine} \xBB` : `.gitattributes: added "${gaLine}"`);
@@ -80507,8 +81289,8 @@ Fill in COMPONENTS, run it (e.g. npx tsx ${out2}), then: node scripts/ultra11y.m
80507
81289
  } catch {
80508
81290
  }
80509
81291
  try {
80510
- const giPath = join55(root, ".gitignore");
80511
- if (existsSync42(giPath) && /^\s*\/?\.ultra11y(\/\**)?\/?\s*$/m.test(readFileSync38(giPath, "utf8")))
81292
+ const giPath = join56(root, ".gitignore");
81293
+ if (existsSync44(giPath) && /^\s*\/?\.ultra11y(\/\**)?\/?\s*$/m.test(readFileSync38(giPath, "utf8")))
80512
81294
  console.error(
80513
81295
  lang === "fr" ? "\u26A0\uFE0F .ultra11y semble ignor\xE9 par .gitignore \u2014 les captures doivent \xEAtre committ\xE9es pour le gate (ajoutez \xAB !.ultra11y/captures/ \xBB)." : '\u26A0\uFE0F .ultra11y appears gitignored \u2014 captures must be committed for the gate (add "!.ultra11y/captures/").'
80514
81296
  );
@@ -80518,8 +81300,8 @@ Fill in COMPONENTS, run it (e.g. npx tsx ${out2}), then: node scripts/ultra11y.m
80518
81300
  }
80519
81301
  if (p.flags.storybook === true || typeof p.flags.storybook === "string") {
80520
81302
  const sbDir = p.positionals[0] ?? "storybook-static";
80521
- const indexPath = existsSync42(join55(sbDir, "index.json")) ? join55(sbDir, "index.json") : join55(sbDir, "stories.json");
80522
- if (!existsSync42(indexPath)) {
81303
+ const indexPath = existsSync44(join56(sbDir, "index.json")) ? join56(sbDir, "index.json") : join56(sbDir, "stories.json");
81304
+ if (!existsSync44(indexPath)) {
80523
81305
  console.error(
80524
81306
  lang === "fr" ? `ultra11y render : aucun index Storybook (index.json/stories.json) dans ${sbDir}.` : `ultra11y render: no Storybook index (index.json/stories.json) in ${sbDir}.`
80525
81307
  );
@@ -80529,7 +81311,7 @@ Fill in COMPONENTS, run it (e.g. npx tsx ${out2}), then: node scripts/ultra11y.m
80529
81311
  const provById = new Map(stories.map((s) => [s.id, storyProvenance(s)]));
80530
81312
  const capturesFlag = typeof p.flags.captures === "string" && p.flags.captures ? p.flags.captures : void 0;
80531
81313
  const htmlDir = capturesFlag ?? sbDir;
80532
- const htmlFiles = existsSync42(htmlDir) ? discover([htmlDir]).files.filter((f) => /\.html?$/i.test(f)) : [];
81314
+ const htmlFiles = existsSync44(htmlDir) ? discover([htmlDir]).files.filter((f) => /\.html?$/i.test(f)) : [];
80533
81315
  const outDir = ".ultra11y/captures";
80534
81316
  let attributed = 0;
80535
81317
  let skipped = 0;
@@ -80552,7 +81334,7 @@ Fill in COMPONENTS, run it (e.g. npx tsx ${out2}), then: node scripts/ultra11y.m
80552
81334
  }
80553
81335
  try {
80554
81336
  mkdirSync20(outDir, { recursive: true });
80555
- writeFileSync23(join55(outDir, `${hitId}.html`), `${formatCaptureComment(prov)}
81337
+ writeFileSync23(join56(outDir, `${hitId}.html`), `${formatCaptureComment(prov)}
80556
81338
  ${raw}${raw.endsWith("\n") ? "" : "\n"}`);
80557
81339
  attributed++;
80558
81340
  } catch {
@@ -80574,11 +81356,11 @@ ${raw}${raw.endsWith("\n") ? "" : "\n"}`);
80574
81356
  }
80575
81357
  if (p.flags.coverage === true) {
80576
81358
  const capturesFlag = typeof p.flags.captures === "string" && p.flags.captures ? p.flags.captures : void 0;
80577
- const capturesDir = capturesFlag ?? join55(root, ".ultra11y/captures");
81359
+ const capturesDir = capturesFlag ?? join56(root, ".ultra11y/captures");
80578
81360
  const graphExt = [...GRAPH_ONLY_EXT, ...asList(p.flags.ext) ?? []];
80579
81361
  const sourceFiles = discover([root], { include: asList(p.flags.include), exclude: asList(p.flags.exclude), ext: graphExt }).files;
80580
81362
  const graph = buildGraphStreaming(sourceFiles);
80581
- const capFiles = existsSync42(capturesDir) ? discover([capturesDir]).files : [];
81363
+ const capFiles = existsSync44(capturesDir) ? discover([capturesDir]).files : [];
80582
81364
  const entries = capFiles.map((f) => ({ file: toPosix(f), provenance: parseCaptureProvenance(readText(f)) }));
80583
81365
  const cov = computeCaptureCoverage(graph, entries);
80584
81366
  if (p.flags.json) console.log(JSON.stringify(cov, null, 2));
@@ -80586,15 +81368,15 @@ ${raw}${raw.endsWith("\n") ? "" : "\n"}`);
80586
81368
  return 0;
80587
81369
  }
80588
81370
  let deps = {};
80589
- const pkgPath = join55(root, "package.json");
80590
- if (existsSync42(pkgPath)) {
81371
+ const pkgPath = join56(root, "package.json");
81372
+ if (existsSync44(pkgPath)) {
80591
81373
  try {
80592
81374
  const pkg = JSON.parse(readText(pkgPath));
80593
81375
  deps = { ...pkg.dependencies ?? {}, ...pkg.devDependencies ?? {} };
80594
81376
  } catch {
80595
81377
  }
80596
81378
  }
80597
- const detection = detectFrameworks(deps, (f) => existsSync42(join55(root, f)));
81379
+ const detection = detectFrameworks(deps, (f) => existsSync44(join56(root, f)));
80598
81380
  if (p.flags.json) console.log(JSON.stringify(detection, null, 2));
80599
81381
  else console.log(renderPlan(detection, lang));
80600
81382
  return 0;
@@ -80764,7 +81546,7 @@ function cmdVerify(p) {
80764
81546
  const trial = conformityTrial(p, standard, lang);
80765
81547
  const expected = [...expectedNc, ...buildConformityWorklist(trial.claims, expectedNc.length, Number.POSITIVE_INFINITY)];
80766
81548
  const r = applyVerdicts(items, expected);
80767
- const ctx = readVerifyContext(dirname22(resolve18(apply)));
81549
+ const ctx = readVerifyContext(dirname22(resolve19(apply)));
80768
81550
  const absentItems = r.failures.filter((f) => !items.includes(f));
80769
81551
  const absentC = absentItems.filter((f) => f.kind === "c").length;
80770
81552
  const sourceDiffers = ctx ? !sameConformitySource(ctx.conformities, trial.source) : absentC > 0 && !items.some((it) => it.kind === "c");
@@ -80860,7 +81642,7 @@ function cmdVerifySummary(p) {
80860
81642
  if (typeof prunedFlag === "string" && prunedFlag) {
80861
81643
  const raw = readJson4(prunedFlag, "pruned");
80862
81644
  if (raw === void 0) return 2;
80863
- pruned = { audit: unwrapAudit(raw), path: resolve18(prunedFlag) };
81645
+ pruned = { audit: unwrapAudit(raw), path: resolve19(prunedFlag) };
80864
81646
  }
80865
81647
  const reportMd = readReportInput(reportPath, "verify");
80866
81648
  if (reportMd === null) return 2;
@@ -80869,11 +81651,11 @@ function cmdVerifySummary(p) {
80869
81651
  standard,
80870
81652
  lang,
80871
81653
  audit: audit2,
80872
- auditPath: resolve18(auditPath),
81654
+ auditPath: resolve19(auditPath),
80873
81655
  verdicts,
80874
- verdictsPath: resolve18(verdictsPath),
81656
+ verdictsPath: resolve19(verdictsPath),
80875
81657
  reportMd,
80876
- reportPath: resolve18(reportPath),
81658
+ reportPath: resolve19(reportPath),
80877
81659
  ...pruned ? { pruned } : {},
80878
81660
  gate
80879
81661
  });
@@ -80883,7 +81665,7 @@ function cmdVerifySummary(p) {
80883
81665
  }
80884
81666
  const out2 = typeof p.flags.out === "string" && p.flags.out ? p.flags.out : ".";
80885
81667
  mkdirSync20(out2, { recursive: true });
80886
- const mdPath = join55(out2, "TRIAL.md");
81668
+ const mdPath = join56(out2, "TRIAL.md");
80887
81669
  writeFileSync23(mdPath, formatTrialSummary(summary, lang));
80888
81670
  console.log(
80889
81671
  summary.validated ? lang === "fr" ? `\u2713 Bilan de contre-expertise \u2192 ${mdPath} \u2014 gate s\xE9mantique vert.` : `\u2713 Counter-review summary \u2192 ${mdPath} \u2014 semantic gate green.` : lang === "fr" ? `Bilan de contre-expertise \u2192 ${mdPath} \u2014 audit NON valid\xE9 (gate ${summary.gate.ok ? "vert" : "en \xE9chec"}, ${summary.contestedEngine.length} d\xE9cision(s) moteur contest\xE9e(s), ${summary.untried.length} jamais mise(s) \xE0 l'\xE9preuve, ${summary.foreign.length} \xE9trang\xE8re(s)).` : `Counter-review summary \u2192 ${mdPath} \u2014 audit NOT validated (gate ${summary.gate.ok ? "green" : "failing"}, ${summary.contestedEngine.length} contested engine decision(s), ${summary.untried.length} never tried, ${summary.foreign.length} foreign).`
@@ -80910,7 +81692,7 @@ function applyPrune(p, standard, items, lang, untried = []) {
80910
81692
  let ledgerRepair;
80911
81693
  if (ledgerFile) {
80912
81694
  let ledger = readLedger(ledgerFile);
80913
- if (!ledger && !existsSync42(ledgerFile)) {
81695
+ if (!ledger && !existsSync44(ledgerFile)) {
80914
81696
  ledger = emptyLedger(standard);
80915
81697
  console.error(
80916
81698
  lang === "fr" ? `\u26A0 Aucun registre en ${ledgerFile} \u2014 un registre vide est cr\xE9\xE9. Les verdicts d\xE9j\xE0 repli\xE9s n'y figurent pas : repliez-les avec \`verify --apply <ADJUDICATE.todo.json> --ledger\` pour qu'ils soient rejouables.` : `\u26A0 No ledger at ${ledgerFile} \u2014 creating an empty one. Verdicts folded earlier are not in it: fold them with \`verify --apply <ADJUDICATE.todo.json> --ledger\` to make them replayable.`
@@ -80927,7 +81709,7 @@ function applyPrune(p, standard, items, lang, untried = []) {
80927
81709
  }
80928
81710
  const out2 = typeof p.flags.out === "string" ? p.flags.out : ".";
80929
81711
  mkdirSync20(out2, { recursive: true });
80930
- writeFileSync23(join55(out2, "audit-latest.json"), JSON.stringify(auditDocumentFor(pruned.audit, standard, lang), null, 2) + "\n");
81712
+ writeFileSync23(join56(out2, "audit-latest.json"), JSON.stringify(auditDocumentFor(pruned.audit, standard, lang), null, 2) + "\n");
80931
81713
  if (ledgerFile && ledgerRepair) {
80932
81714
  writeLedger(ledgerFile, ledgerRepair.ledger);
80933
81715
  if (!p.flags.json)
@@ -81046,8 +81828,8 @@ function cmdVerifyWorklist(p, langIn) {
81046
81828
  const contextPath = writeVerifyContext(out2, {
81047
81829
  kind: "verify-context",
81048
81830
  standard,
81049
- report: rep === "-" ? rep : resolve18(rep),
81050
- ...typeof inFlag === "string" && inFlag && inFlag !== "-" ? { in: resolve18(inFlag) } : {},
81831
+ report: rep === "-" ? rep : resolve19(rep),
81832
+ ...typeof inFlag === "string" && inFlag && inFlag !== "-" ? { in: resolve19(inFlag) } : {},
81051
81833
  conformities: trial.source,
81052
81834
  capped: { nc: droppedNc, c: droppedC }
81053
81835
  });
@@ -81081,14 +81863,14 @@ function conformityTrial(p, standard, lang) {
81081
81863
  if (typeof inFlag === "string" && inFlag && inFlag !== "-") {
81082
81864
  try {
81083
81865
  const audit2 = unwrapAudit(JSON.parse(readText(inFlag)));
81084
- if (Array.isArray(audit2.criteria)) return { claims: conformityClaimsFromAudit(audit2, standard), source: { source: "in", path: resolve18(inFlag) } };
81866
+ if (Array.isArray(audit2.criteria)) return { claims: conformityClaimsFromAudit(audit2, standard), source: { source: "in", path: resolve19(inFlag) } };
81085
81867
  } catch {
81086
81868
  }
81087
81869
  }
81088
81870
  }
81089
81871
  const path = named3 ?? ledgerPath(standard);
81090
- const source = { source: named3 ? "file" : "ledger", path: resolve18(path) };
81091
- if (!existsSync42(path)) {
81872
+ const source = { source: named3 ? "file" : "ledger", path: resolve19(path) };
81873
+ if (!existsSync44(path)) {
81092
81874
  if (named3) {
81093
81875
  console.error(
81094
81876
  lang === "fr" ? `ultra11y verify : fichier --conformities introuvable : ${named3}.` : `ultra11y verify: --conformities file not found: ${named3}.`
@@ -81169,7 +81951,7 @@ function replayLedgerFile(p, ledger, lang) {
81169
81951
  }
81170
81952
  const out2 = typeof p.flags.out === "string" ? p.flags.out : ".";
81171
81953
  mkdirSync20(out2, { recursive: true });
81172
- const auditPath = join55(out2, "audit-latest.json");
81954
+ const auditPath = join56(out2, "audit-latest.json");
81173
81955
  writeFileSync23(auditPath, `${JSON.stringify(auditDocumentFor(r.audit, standard, lang), null, 2)}
81174
81956
  `);
81175
81957
  if (p.flags.json)
@@ -81248,7 +82030,7 @@ function applyAdjudicationFile(p, adj, lang) {
81248
82030
  }
81249
82031
  const out2 = typeof p.flags.out === "string" ? p.flags.out : ".";
81250
82032
  mkdirSync20(out2, { recursive: true });
81251
- const auditPath = join55(out2, "audit-latest.json");
82033
+ const auditPath = join56(out2, "audit-latest.json");
81252
82034
  writeFileSync23(auditPath, JSON.stringify(auditDocumentFor(r.audit, adj.standard, lang), null, 2) + "\n");
81253
82035
  const ledgerOut = ledgerTarget(p, adj.standard);
81254
82036
  if (ledgerOut) {
@@ -81501,7 +82283,7 @@ async function cmdJudge(p) {
81501
82283
  { cwd }
81502
82284
  );
81503
82285
  if (partial.applied > 0)
81504
- writeFileSync23(join55(outDir, "audit-latest.json"), `${JSON.stringify(auditDocumentFor(partial.audit, standard, lang), null, 2)}
82286
+ writeFileSync23(join56(outDir, "audit-latest.json"), `${JSON.stringify(auditDocumentFor(partial.audit, standard, lang), null, 2)}
81505
82287
  `);
81506
82288
  } catch {
81507
82289
  }
@@ -81571,7 +82353,7 @@ async function cmdJudge(p) {
81571
82353
  if (r.issues.length > 40) console.error(` \u2026 +${r.issues.length - 40}`);
81572
82354
  }
81573
82355
  mkdirSync20(out2, { recursive: true });
81574
- const auditPath = join55(out2, "audit-latest.json");
82356
+ const auditPath = join56(out2, "audit-latest.json");
81575
82357
  writeFileSync23(auditPath, `${JSON.stringify(auditDocumentFor(r.audit, adj.standard, lang), null, 2)}
81576
82358
  `);
81577
82359
  const ledgerOut = ledgerTarget(p, adj.standard);
@@ -81650,7 +82432,7 @@ Iterated over ${rounds} round(s) to a fixpoint \u2014 ${totalWritten} file(s) wr
81650
82432
  }
81651
82433
  function scanSnapshotRoot(flags2) {
81652
82434
  if (flags2["no-snapshot"] === true) return void 0;
81653
- return typeof flags2.root === "string" && flags2.root ? resolve18(flags2.root) : process.cwd();
82435
+ return typeof flags2.root === "string" && flags2.root ? resolve19(flags2.root) : process.cwd();
81654
82436
  }
81655
82437
  async function cmdScan(p) {
81656
82438
  const standard = stdOf(p, "scan");
@@ -81665,7 +82447,7 @@ async function cmdScan(p) {
81665
82447
  return 0;
81666
82448
  }
81667
82449
  for (const target of p.positionals.filter((a) => a !== "-")) {
81668
- if (/^https?:\/\//i.test(target) || existsSync42(target)) continue;
82450
+ if (/^https?:\/\//i.test(target) || existsSync44(target)) continue;
81669
82451
  console.error(
81670
82452
  lang === "fr" ? `ultra11y scan : fichier introuvable (file not found) : ${target}. Passez une URL http(s):// ou un fichier HTML existant.` : `ultra11y scan: File not found: ${target}. Pass an http(s):// URL or an existing HTML file.`
81671
82453
  );
@@ -81840,7 +82622,7 @@ async function cmdScan(p) {
81840
82622
  }
81841
82623
  let merged = mergeDynamic(audit2, dynamic, lang);
81842
82624
  if (dynamic.snapshots?.length) {
81843
- const doms = dynamic.snapshots.map((id) => join55(snapshotRoot ?? ".", PAGES_DIR, id, "dom.html")).filter((f) => existsSync42(f));
82625
+ const doms = dynamic.snapshots.map((id) => join56(snapshotRoot ?? ".", PAGES_DIR, id, "dom.html")).filter((f) => existsSync44(f));
81844
82626
  if (doms.length) {
81845
82627
  const snapAudit = runAudit({ inputs: [...doms, ...documentFiles], onWarn: (m) => console.error(m) });
81846
82628
  merged = mergeSnapshotAudit(merged, snapAudit);
@@ -81853,7 +82635,7 @@ async function cmdScan(p) {
81853
82635
  }
81854
82636
  mkdirSync20(out2, { recursive: true });
81855
82637
  const mergedDocument = auditDocumentFor(merged, standard, lang);
81856
- writeFileSync23(join55(out2, "audit-latest.json"), JSON.stringify(mergedDocument, null, 2) + "\n");
82638
+ writeFileSync23(join56(out2, "audit-latest.json"), JSON.stringify(mergedDocument, null, 2) + "\n");
81857
82639
  if (p.flags.json)
81858
82640
  console.log(
81859
82641
  JSON.stringify(
@@ -81869,7 +82651,7 @@ async function cmdScan(p) {
81869
82651
  );
81870
82652
  else {
81871
82653
  console.log(
81872
- lang === "fr" ? `Audit statique + dynamique fusionn\xE9 \u2192 ${join55(out2, "audit-latest.json")} (${merged.conformancePct}% r\xE9ussite, ${merged.findings.length} findings).` : `Static + dynamic audit merged \u2192 ${join55(out2, "audit-latest.json")} (${merged.conformancePct}% pass rate, ${merged.findings.length} findings).`
82654
+ lang === "fr" ? `Audit statique + dynamique fusionn\xE9 \u2192 ${join56(out2, "audit-latest.json")} (${merged.conformancePct}% r\xE9ussite, ${merged.findings.length} findings).` : `Static + dynamic audit merged \u2192 ${join56(out2, "audit-latest.json")} (${merged.conformancePct}% pass rate, ${merged.findings.length} findings).`
81873
82655
  );
81874
82656
  if (dynamic.snapshots?.length)
81875
82657
  console.log(
@@ -82112,7 +82894,7 @@ async function cmdImport(p) {
82112
82894
  }
82113
82895
  if (outDir) {
82114
82896
  mkdirSync20(outDir, { recursive: true });
82115
- const rawFile = join55(outDir, `external-${adapterId}-${arg}.raw.json`);
82897
+ const rawFile = join56(outDir, `external-${adapterId}-${arg}.raw.json`);
82116
82898
  writeFileSync23(rawFile, rawText.endsWith("\n") ? rawText : `${rawText}
82117
82899
  `);
82118
82900
  if (!p.flags.json) console.log(rawFile);
@@ -82148,7 +82930,7 @@ async function cmdImport(p) {
82148
82930
  }
82149
82931
  if (outDir) {
82150
82932
  mkdirSync20(outDir, { recursive: true });
82151
- const file = join55(outDir, "external-latest.json");
82933
+ const file = join56(outDir, "external-latest.json");
82152
82934
  writeFileSync23(file, `${JSON.stringify(audit2, null, 2)}
82153
82935
  `);
82154
82936
  console.log(file);
@@ -82254,7 +83036,7 @@ function cmdOrchestrate(p) {
82254
83036
  }
82255
83037
  const engineAbs = realpathSync9(fileURLToPath6(import.meta.url));
82256
83038
  if (p.flags.list === true) {
82257
- if (!existsSync42(runFlag)) {
83039
+ if (!existsSync44(runFlag)) {
82258
83040
  console.error(`ultra11y orchestrate: run dir not found: ${runFlag}.`);
82259
83041
  return 2;
82260
83042
  }
@@ -82262,7 +83044,7 @@ function cmdOrchestrate(p) {
82262
83044
  return 0;
82263
83045
  }
82264
83046
  if (p.flags.manifest === true) {
82265
- if (!existsSync42(runFlag)) {
83047
+ if (!existsSync44(runFlag)) {
82266
83048
  console.error(`ultra11y orchestrate: run dir not found: ${runFlag}.`);
82267
83049
  return 2;
82268
83050
  }
@@ -82289,7 +83071,7 @@ function cmdOrchestrate(p) {
82289
83071
  );
82290
83072
  } else {
82291
83073
  console.log(
82292
- lang === "fr" ? `Suivez ${join55(runFlag, "orchestration", "RUNBOOK.md")} s\xE9quentiellement (chemin \xE9co).` : `Follow ${join55(runFlag, "orchestration", "RUNBOOK.md")} sequentially (the eco path).`
83074
+ lang === "fr" ? `Suivez ${join56(runFlag, "orchestration", "RUNBOOK.md")} s\xE9quentiellement (chemin \xE9co).` : `Follow ${join56(runFlag, "orchestration", "RUNBOOK.md")} sequentially (the eco path).`
82293
83075
  );
82294
83076
  }
82295
83077
  if (p.flags.phase === void 0 && workflows.length === 0 && p.flags.eco !== true) {
@@ -82345,7 +83127,7 @@ async function main(argv) {
82345
83127
  if (typeof v === "string" && v && !allowed.includes(v)) console.error(`ultra11y: --${flag} "${v}" is not one of ${allowed.join("|")} \u2014 using the default.`);
82346
83128
  }
82347
83129
  const packList = typeof p.flags.pack === "string" ? p.flags.pack.split(",").map((s) => s.trim()).filter(Boolean) : [];
82348
- const configRoot = p.command === "mcp" && typeof p.flags.cwd === "string" && p.flags.cwd ? resolve18(p.flags.cwd) : process.cwd();
83130
+ const configRoot = p.command === "mcp" && typeof p.flags.cwd === "string" && p.flags.cwd ? resolve19(p.flags.cwd) : process.cwd();
82349
83131
  const loaded2 = loadRuntimeStandards(configRoot, packList, (m) => console.error(m), p.flags.override === true);
82350
83132
  if (loaded2.errors.length) {
82351
83133
  for (const e of loaded2.errors) console.error(`ultra11y: ${e}`);