ultra11y 5.55.4 → 5.55.5

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.
@@ -10,7 +10,7 @@
10
10
  "name": "ultra11y",
11
11
  "source": "./",
12
12
  "description": "RGAA 4.1.2 accessibility audits on a WCAG 2.2 AA core: automatic review before commit, push and pull request, plus dated, evidenced Markdown, HTML and per-page conformance reports in Claude Code.",
13
- "version": "5.55.4",
13
+ "version": "5.55.5",
14
14
  "author": { "name": "maxgfr" },
15
15
  "homepage": "https://github.com/SocialGouv/ultra11y",
16
16
  "repository": "https://github.com/SocialGouv/ultra11y",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ultra11y",
3
3
  "description": "RGAA 4.1.2 accessibility audits, the French State's standard, on a WCAG 2.2 AA core: automatic review before commit, push and pull request, plus dated, evidenced Markdown, HTML and per-page conformance reports. Never declares conforming what it has not verified.",
4
- "version": "5.55.4",
4
+ "version": "5.55.5",
5
5
  "author": { "name": "maxgfr" },
6
6
  "homepage": "https://github.com/SocialGouv/ultra11y",
7
7
  "repository": "https://github.com/SocialGouv/ultra11y",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ultra11y",
3
3
  "description": "RGAA 4.1.2 accessibility audits, the French State's standard, on a WCAG 2.2 AA core: automatic review before commit, push and pull request, plus dated, evidenced Markdown, HTML and per-page conformance reports. Never declares conforming what it has not verified.",
4
- "version": "5.55.4",
4
+ "version": "5.55.5",
5
5
  "author": { "name": "maxgfr", "url": "https://github.com/maxgfr" },
6
6
  "homepage": "https://github.com/SocialGouv/ultra11y",
7
7
  "repository": "https://github.com/SocialGouv/ultra11y",
@@ -27,7 +27,7 @@ import { fileURLToPath } from "node:url";
27
27
  // Ownership marker: `ultra11y install --opencode` refuses to overwrite a plugin file that
28
28
  // does not carry it, so a user's own ultra11y.js is never clobbered.
29
29
  const ULTRA11Y_OPENCODE_PLUGIN = "ULTRA11Y_OPENCODE_PLUGIN";
30
- const ULTRA11Y_PLUGIN_VERSION = "5.55.4";
30
+ const ULTRA11Y_PLUGIN_VERSION = "5.55.5";
31
31
 
32
32
  const here = dirname(fileURLToPath(import.meta.url));
33
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultra11y",
3
- "version": "5.55.4",
3
+ "version": "5.55.5",
4
4
  "description": "Audit d'accessibilité RGAA 4.1.2, le référentiel de l'État : rapport daté, grille des 106 critères, backlog et tickets. Moteur statique, navigateur et jugement IA contre-vérifié. Il ne déclare jamais conforme ce qu'il n'a pas vérifié. Socle WCAG 2.2 AA.",
5
5
  "homepage": "https://socialgouv.github.io/ultra11y/",
6
6
  "type": "module",
@@ -2,11 +2,11 @@
2
2
 
3
3
  // src/cli.ts
4
4
  import { realpathSync as realpathSync8, writeFileSync as writeFileSync23, mkdirSync as mkdirSync20, existsSync as existsSync41, readFileSync as readFileSync37, appendFileSync, copyFileSync as copyFileSync4 } from "fs";
5
- import { join as join54, relative as relative6, resolve as resolve18, sep as sep7, dirname as dirname21 } from "path";
5
+ import { join as join54, relative as relative6, resolve as resolve18, 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.55.4";
9
+ var VERSION = "5.55.5";
10
10
  var SCHEMA_VERSION = 2;
11
11
  function isAdjudicated(by) {
12
12
  return by === "agent" || by === "human";
@@ -64223,14 +64223,20 @@ function renderPackReport(r, pack, lang = "en", outDir, cropFor) {
64223
64223
  const docs = renderPackReportDocuments(r, pack, lang, outDir, cropFor);
64224
64224
  return joinReportDocuments(docs.report, docs.annex);
64225
64225
  }
64226
+ function automaticRate(derived) {
64227
+ const validated = derived.filter((d) => d.status === "C" && !isAdjudicated(d.decidedBy) && !isProvisionalJudgmentInapplicable(d)).length;
64228
+ return { pct: packConformancePct(derived), validated, decided: validated + derived.filter((d) => d.status === "NC").length };
64229
+ }
64230
+ function packReportRates(r, pack) {
64231
+ return { conformance: conformanceRate(reportTotals(packReportGroups(r, pack))), automatic: automaticRate(derivePackResults(r, pack.key)) };
64232
+ }
64226
64233
  function renderPackReportDocuments(r, pack, lang = "en", outDir, cropFor) {
64227
64234
  const derived = derivePackResults(r, pack.key);
64228
64235
  const std = `${pack.name} ${pack.baseVersion}`;
64229
64236
  const groups = packReportGroups(r, pack, lang);
64230
64237
  const rows = groups.flatMap((g) => g.rows);
64231
64238
  const tally = reportTotals(groups);
64232
- const autoValidated = derived.filter((d) => d.status === "C" && !isAdjudicated(d.decidedBy) && !isProvisionalJudgmentInapplicable(d)).length;
64233
- const autoDecided = autoValidated + derived.filter((d) => d.status === "NC").length;
64239
+ const auto = automaticRate(derived);
64234
64240
  return render(r, lang, {
64235
64241
  std,
64236
64242
  groupHead: L5[lang].byTheme,
@@ -64238,8 +64244,8 @@ function renderPackReportDocuments(r, pack, lang = "en", outDir, cropFor) {
64238
64244
  derivedOf: std,
64239
64245
  standard: pack.key,
64240
64246
  partialAudit: untestedNeedsRendering(r, establishedScs(derived)),
64241
- headerRatePct: packConformancePct(derived),
64242
- conformance: { rate: conformanceRate(tally), provenance: decisionProvenance(rows), autoDecided, autoValidated },
64247
+ headerRatePct: auto.pct,
64248
+ conformance: { rate: conformanceRate(tally), provenance: decisionProvenance(rows), autoDecided: auto.decided, autoValidated: auto.validated },
64243
64249
  // Forwarded, unlike before: without it the per-page screenshots resolved against the
64244
64250
  // CWD instead of the report's own directory, so a pack report written to `audits/`
64245
64251
  // carried links that only worked when read from the repo root.
@@ -75787,8 +75793,8 @@ ${xs.map(line).join("\n")}` : t3.none;
75787
75793
  import { createInterface as createInterface2 } from "readline";
75788
75794
 
75789
75795
  // src/mcp/handlers.ts
75790
- import { existsSync as existsSync39, mkdirSync as mkdirSync19, readFileSync as readFileSync35, realpathSync as realpathSync6, statSync as statSync19, writeFileSync as writeFileSync22 } from "fs";
75791
- import { isAbsolute as isAbsolute5, join as join52, resolve as resolve16, sep as sep5 } from "path";
75796
+ import { existsSync as existsSync39, lstatSync as lstatSync2, mkdirSync as mkdirSync19, readFileSync as readFileSync35, realpathSync as realpathSync6, statSync as statSync19, writeFileSync as writeFileSync22 } from "fs";
75797
+ import { basename as basename4, dirname as dirname20, isAbsolute as isAbsolute5, join as join52, resolve as resolve16, sep as sep5 } from "path";
75792
75798
 
75793
75799
  // src/criteria-view.ts
75794
75800
  var CriteriaLookupError = class extends Error {
@@ -76596,7 +76602,9 @@ function handleFix(args2, cwd) {
76596
76602
  }
76597
76603
  }
76598
76604
  function handleFold(args2, cwd) {
76599
- const adj = adjudicationArg(args2);
76605
+ const outArg = str2(args2.out);
76606
+ const outDir = outArg === void 0 ? cwd : containedPath(outArg, cwd, "out");
76607
+ const adj = adjudicationArg(args2, cwd);
76600
76608
  standardOf({ standard: adj.standard });
76601
76609
  const asked = str2(args2.standard);
76602
76610
  if (asked !== void 0 && standardOf(args2) !== adj.standard) {
@@ -76606,7 +76614,7 @@ function handleFold(args2, cwd) {
76606
76614
  const auditFile = str2(args2.audit_file);
76607
76615
  let base;
76608
76616
  if (auditFile) {
76609
- const path = resolve16(cwd, auditFile);
76617
+ const path = containedPath(auditFile, cwd, "audit_file");
76610
76618
  try {
76611
76619
  base = unwrapAudit(JSON.parse(readFileSync35(path, "utf8")));
76612
76620
  } catch {
@@ -76636,7 +76644,6 @@ function handleFold(args2, cwd) {
76636
76644
  next: landed ? "Dry run: nothing was written. Re-call with write:true (and ledger:true to record the accepted verdicts) to land them." : "Nothing landed. Fix the refused verdicts listed in issues \u2014 cite the evidence a C cleared, ground every NC finding \u2014 and fold again."
76637
76645
  };
76638
76646
  }
76639
- const outDir = resolve16(cwd, str2(args2.out) ?? ".");
76640
76647
  mkdirSync19(outDir, { recursive: true });
76641
76648
  const auditPath = join52(outDir, "audit-latest.json");
76642
76649
  writeFileSync22(auditPath, `${JSON.stringify(auditDocumentFor(r.audit, adj.standard, lang), null, 2)}
@@ -76657,15 +76664,44 @@ function handleFold(args2, cwd) {
76657
76664
  }
76658
76665
  return { ...summary, written: true, auditPath, ...ledger ? { ledger } : {} };
76659
76666
  }
76660
- function adjudicationArg(args2) {
76667
+ function containedPath(raw, cwd, field) {
76668
+ const refuse = () => {
76669
+ throw new ToolError(`\`${field}\` is outside the project: ${raw}. The fold reads and writes inside its cwd only.`);
76670
+ };
76671
+ const target = resolve16(cwd, raw);
76672
+ let existing = target;
76673
+ const rest = [];
76674
+ for (; ; ) {
76675
+ try {
76676
+ lstatSync2(existing);
76677
+ break;
76678
+ } catch {
76679
+ const parent = dirname20(existing);
76680
+ if (parent === existing) break;
76681
+ rest.unshift(basename4(existing));
76682
+ existing = parent;
76683
+ }
76684
+ }
76685
+ let real;
76686
+ try {
76687
+ real = join52(realpathSync6(existing), ...rest);
76688
+ } catch {
76689
+ return refuse();
76690
+ }
76691
+ const root = realpathSync6(cwd);
76692
+ if (real !== root && !real.startsWith(root + sep5)) refuse();
76693
+ return target;
76694
+ }
76695
+ function adjudicationArg(args2, cwd) {
76661
76696
  const inline = args2.adjudication;
76662
76697
  const file = str2(args2.adjudication_file);
76663
76698
  if (inline !== void 0 && file) throw new ToolError("pass `adjudication` or `adjudication_file`, not both.");
76664
76699
  let v = inline;
76665
76700
  if (file) {
76666
76701
  if (!isAbsolute5(file)) throw new ToolError("`adjudication_file` must be an absolute path.");
76702
+ const path = containedPath(file, cwd, "adjudication_file");
76667
76703
  try {
76668
- v = JSON.parse(readFileSync35(file, "utf8"));
76704
+ v = JSON.parse(readFileSync35(path, "utf8"));
76669
76705
  } catch {
76670
76706
  throw new ToolError(`\`adjudication_file\` not found or not valid JSON: ${file}`);
76671
76707
  }
@@ -77141,16 +77177,19 @@ var WRITE_TOOLS = [
77141
77177
  type: "object",
77142
77178
  description: "The filled adjudication: { kind: 'adjudication', standard, items: [...] }, as ultra11y_adjudicate's worklist with your verdicts."
77143
77179
  },
77144
- adjudication_file: { type: "string", description: "Absolute path to an adjudication JSON file to fold instead." },
77180
+ adjudication_file: { type: "string", description: "Absolute path, inside cwd, to an adjudication JSON file to fold instead." },
77145
77181
  audit_file: {
77146
77182
  type: "string",
77147
- description: "Absolute path (or relative to cwd) to the audit JSON to fold into, like `--in`. Default: audit the project now, as ultra11y_adjudicate did."
77183
+ description: "Absolute path (or relative to cwd), inside cwd, to the audit JSON to fold into, like `--in`. Default: audit the project now, as ultra11y_adjudicate did."
77148
77184
  },
77149
77185
  globs: globsProp,
77150
77186
  standard: { type: "string", description: "Must match the adjudication's own standard when given." },
77151
77187
  strict: { type: "boolean", description: "All-or-nothing: a single refused verdict discards the whole fold." },
77152
77188
  write: { type: "boolean", description: "Actually write the folded audit (default: dry-run, returns the gate's verdict)." },
77153
- out: { type: "string", description: "Directory, relative to cwd, for audit-latest.json. Default: the project root, as `verify --apply`." },
77189
+ out: {
77190
+ type: "string",
77191
+ description: "Directory, relative to cwd and inside it, for audit-latest.json. Default: the project root, as `verify --apply`."
77192
+ },
77154
77193
  ledger: { type: "boolean", description: "With write:true, also record the accepted verdicts in .ultra11y/verdicts/<standard>.json." },
77155
77194
  lang: langProp
77156
77195
  },
@@ -77487,12 +77526,12 @@ var DECLARED = new Set([...TOOLS2, ...WRITE_TOOLS].map((t3) => t3.name));
77487
77526
 
77488
77527
  // src/mcp/resources.ts
77489
77528
  import { existsSync as existsSync40, readdirSync as readdirSync8, readFileSync as readFileSync36, realpathSync as realpathSync7, statSync as statSync20 } from "fs";
77490
- import { basename as basename4, dirname as dirname20, join as join53, resolve as resolve17, sep as sep6 } from "path";
77529
+ import { basename as basename5, dirname as dirname21, join as join53, resolve as resolve17, sep as sep6 } from "path";
77491
77530
  import { fileURLToPath as fileURLToPath5 } from "url";
77492
77531
  var SKILL_NAME = "ultra11y";
77493
77532
  var URI_SCHEME = "skill://";
77494
77533
  function resolveSkillRoot(moduleDir) {
77495
- const here = moduleDir ?? dirname20(fileURLToPath5(import.meta.url));
77534
+ const here = moduleDir ?? dirname21(fileURLToPath5(import.meta.url));
77496
77535
  const candidates2 = [resolve17(here, ".."), resolve17(here, "..", "skills", SKILL_NAME), resolve17(here, "..", "..", "skills", SKILL_NAME)];
77497
77536
  return candidates2.find((dir) => existsSync40(join53(dir, "SKILL.md")));
77498
77537
  }
@@ -77504,7 +77543,7 @@ function listResources(moduleDir) {
77504
77543
  if (!existsSync40(refDir)) return out2;
77505
77544
  for (const file of readdirSync8(refDir).sort()) {
77506
77545
  if (!file.endsWith(".md")) continue;
77507
- out2.push(describe(root, join53("references", file), `${SKILL_NAME} reference: ${basename4(file, ".md")}`));
77546
+ out2.push(describe(root, join53("references", file), `${SKILL_NAME} reference: ${basename5(file, ".md")}`));
77508
77547
  }
77509
77548
  return out2;
77510
77549
  }
@@ -79024,7 +79063,7 @@ async function cmdAudit(p) {
79024
79063
  const asFile = out2.toLowerCase().endsWith(".json");
79025
79064
  const target = asFile ? out2 : join54(out2, "audit-latest.json");
79026
79065
  try {
79027
- mkdirSync20(asFile ? dirname21(out2) : out2, { recursive: true });
79066
+ mkdirSync20(asFile ? dirname22(out2) : out2, { recursive: true });
79028
79067
  writeFileSync23(target, JSON.stringify(document, null, 2) + "\n");
79029
79068
  console.error(lang === "fr" ? `\u2192 audit \xE9crit dans ${target}` : `\u2192 audit written to ${target}`);
79030
79069
  } catch {
@@ -79705,15 +79744,18 @@ async function cmdReport(p) {
79705
79744
  const untested = isCore(standard) ? [] : packPartialAudit(result, standard);
79706
79745
  const partial = untested.length > 0;
79707
79746
  if (partial && !p.flags.json) console.error(`\u{1F6A8} ${partialAuditBanner(lang, untested, { scanned: ranBrowser(result) })}`);
79747
+ const rates = isCore(standard) ? void 0 : packReportRates(result, loadPack(standard));
79708
79748
  if (p.flags.json)
79709
79749
  console.log(
79710
79750
  JSON.stringify(
79711
79751
  {
79712
79752
  path,
79713
79753
  annexPath,
79714
- conformancePct: result.conformancePct,
79754
+ conformancePct: rates ? rates.conformance.applicable === 0 ? null : rates.conformance.pct : result.conformancePct,
79755
+ ...rates ? { conformance: rates.conformance, automaticPct: rates.automatic.pct, automatic: rates.automatic } : {},
79715
79756
  date: result.date,
79716
- standard: typeof p.flags.standard === "string" ? p.flags.standard : "wcag",
79757
+ // The resolved key (`--standard RGAA` → "rgaa"), never the raw flag.
79758
+ standard,
79717
79759
  ...html ? { htmlPath: html.index, htmlSinglePath: html.composite } : {},
79718
79760
  ...partial ? { partialAudit: true, untestedCriteria: untested } : {}
79719
79761
  },
@@ -80031,7 +80073,7 @@ Fill in COMPONENTS, run it (e.g. npx tsx ${out2}), then: node scripts/ultra11y.m
80031
80073
  const rel2 = ".ultra11y/capture-setup.mjs";
80032
80074
  const out2 = join54(root, rel2);
80033
80075
  try {
80034
- mkdirSync20(dirname21(out2), { recursive: true });
80076
+ mkdirSync20(dirname22(out2), { recursive: true });
80035
80077
  writeFileSync23(out2, captureSetup());
80036
80078
  } catch (e) {
80037
80079
  console.error(`ultra11y render: could not write ${out2}: ${e instanceof Error ? e.message : String(e)}`);
@@ -80316,7 +80358,7 @@ function cmdVerify(p) {
80316
80358
  const trial = conformityTrial(p, standard, lang);
80317
80359
  const expected = [...expectedNc, ...buildConformityWorklist(trial.claims, expectedNc.length, Number.POSITIVE_INFINITY)];
80318
80360
  const r = applyVerdicts(items, expected);
80319
- const ctx = readVerifyContext(dirname21(resolve18(apply)));
80361
+ const ctx = readVerifyContext(dirname22(resolve18(apply)));
80320
80362
  const absentItems = r.failures.filter((f) => !items.includes(f));
80321
80363
  const absentC = absentItems.filter((f) => f.kind === "c").length;
80322
80364
  const sourceDiffers = ctx ? !sameConformitySource(ctx.conformities, trial.source) : absentC > 0 && !items.some((it) => it.kind === "c");
@@ -3,7 +3,7 @@ name: review-a11y
3
3
  description: "Use to REVIEW changed frontend code for accessibility: staged files, a working diff, branch, or PR; prompts such as 'review a11y', 'is this accessible?', or 'anything to fix before merge?'; and hook or CI findings on a change. Run the bundled install-free engine with cross-file JSX/TSX analysis, then adjudicate candidates and return a severity-ranked WCAG 2.2 AA review with file:line fixes, residual rendering risks, and a verdict. Use `ultra11y` instead for whole-repo audits, dated conformance reports, country standards, PRD backlogs, or authoring accessible markup."
4
4
  license: MIT
5
5
  metadata:
6
- version: 5.55.4
6
+ version: 5.55.5
7
7
  ---
8
8
 
9
9
  # review-a11y — accessibility review of changed code
@@ -2,11 +2,11 @@
2
2
 
3
3
  // src/cli.ts
4
4
  import { realpathSync as realpathSync8, writeFileSync as writeFileSync23, mkdirSync as mkdirSync20, existsSync as existsSync41, readFileSync as readFileSync37, appendFileSync, copyFileSync as copyFileSync4 } from "fs";
5
- import { join as join54, relative as relative6, resolve as resolve18, sep as sep7, dirname as dirname21 } from "path";
5
+ import { join as join54, relative as relative6, resolve as resolve18, 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.55.4";
9
+ var VERSION = "5.55.5";
10
10
  var SCHEMA_VERSION = 2;
11
11
  function isAdjudicated(by) {
12
12
  return by === "agent" || by === "human";
@@ -64223,14 +64223,20 @@ function renderPackReport(r, pack, lang = "en", outDir, cropFor) {
64223
64223
  const docs = renderPackReportDocuments(r, pack, lang, outDir, cropFor);
64224
64224
  return joinReportDocuments(docs.report, docs.annex);
64225
64225
  }
64226
+ function automaticRate(derived) {
64227
+ const validated = derived.filter((d) => d.status === "C" && !isAdjudicated(d.decidedBy) && !isProvisionalJudgmentInapplicable(d)).length;
64228
+ return { pct: packConformancePct(derived), validated, decided: validated + derived.filter((d) => d.status === "NC").length };
64229
+ }
64230
+ function packReportRates(r, pack) {
64231
+ return { conformance: conformanceRate(reportTotals(packReportGroups(r, pack))), automatic: automaticRate(derivePackResults(r, pack.key)) };
64232
+ }
64226
64233
  function renderPackReportDocuments(r, pack, lang = "en", outDir, cropFor) {
64227
64234
  const derived = derivePackResults(r, pack.key);
64228
64235
  const std = `${pack.name} ${pack.baseVersion}`;
64229
64236
  const groups = packReportGroups(r, pack, lang);
64230
64237
  const rows = groups.flatMap((g) => g.rows);
64231
64238
  const tally = reportTotals(groups);
64232
- const autoValidated = derived.filter((d) => d.status === "C" && !isAdjudicated(d.decidedBy) && !isProvisionalJudgmentInapplicable(d)).length;
64233
- const autoDecided = autoValidated + derived.filter((d) => d.status === "NC").length;
64239
+ const auto = automaticRate(derived);
64234
64240
  return render(r, lang, {
64235
64241
  std,
64236
64242
  groupHead: L5[lang].byTheme,
@@ -64238,8 +64244,8 @@ function renderPackReportDocuments(r, pack, lang = "en", outDir, cropFor) {
64238
64244
  derivedOf: std,
64239
64245
  standard: pack.key,
64240
64246
  partialAudit: untestedNeedsRendering(r, establishedScs(derived)),
64241
- headerRatePct: packConformancePct(derived),
64242
- conformance: { rate: conformanceRate(tally), provenance: decisionProvenance(rows), autoDecided, autoValidated },
64247
+ headerRatePct: auto.pct,
64248
+ conformance: { rate: conformanceRate(tally), provenance: decisionProvenance(rows), autoDecided: auto.decided, autoValidated: auto.validated },
64243
64249
  // Forwarded, unlike before: without it the per-page screenshots resolved against the
64244
64250
  // CWD instead of the report's own directory, so a pack report written to `audits/`
64245
64251
  // carried links that only worked when read from the repo root.
@@ -75787,8 +75793,8 @@ ${xs.map(line).join("\n")}` : t3.none;
75787
75793
  import { createInterface as createInterface2 } from "readline";
75788
75794
 
75789
75795
  // src/mcp/handlers.ts
75790
- import { existsSync as existsSync39, mkdirSync as mkdirSync19, readFileSync as readFileSync35, realpathSync as realpathSync6, statSync as statSync19, writeFileSync as writeFileSync22 } from "fs";
75791
- import { isAbsolute as isAbsolute5, join as join52, resolve as resolve16, sep as sep5 } from "path";
75796
+ import { existsSync as existsSync39, lstatSync as lstatSync2, mkdirSync as mkdirSync19, readFileSync as readFileSync35, realpathSync as realpathSync6, statSync as statSync19, writeFileSync as writeFileSync22 } from "fs";
75797
+ import { basename as basename4, dirname as dirname20, isAbsolute as isAbsolute5, join as join52, resolve as resolve16, sep as sep5 } from "path";
75792
75798
 
75793
75799
  // src/criteria-view.ts
75794
75800
  var CriteriaLookupError = class extends Error {
@@ -76596,7 +76602,9 @@ function handleFix(args2, cwd) {
76596
76602
  }
76597
76603
  }
76598
76604
  function handleFold(args2, cwd) {
76599
- const adj = adjudicationArg(args2);
76605
+ const outArg = str2(args2.out);
76606
+ const outDir = outArg === void 0 ? cwd : containedPath(outArg, cwd, "out");
76607
+ const adj = adjudicationArg(args2, cwd);
76600
76608
  standardOf({ standard: adj.standard });
76601
76609
  const asked = str2(args2.standard);
76602
76610
  if (asked !== void 0 && standardOf(args2) !== adj.standard) {
@@ -76606,7 +76614,7 @@ function handleFold(args2, cwd) {
76606
76614
  const auditFile = str2(args2.audit_file);
76607
76615
  let base;
76608
76616
  if (auditFile) {
76609
- const path = resolve16(cwd, auditFile);
76617
+ const path = containedPath(auditFile, cwd, "audit_file");
76610
76618
  try {
76611
76619
  base = unwrapAudit(JSON.parse(readFileSync35(path, "utf8")));
76612
76620
  } catch {
@@ -76636,7 +76644,6 @@ function handleFold(args2, cwd) {
76636
76644
  next: landed ? "Dry run: nothing was written. Re-call with write:true (and ledger:true to record the accepted verdicts) to land them." : "Nothing landed. Fix the refused verdicts listed in issues \u2014 cite the evidence a C cleared, ground every NC finding \u2014 and fold again."
76637
76645
  };
76638
76646
  }
76639
- const outDir = resolve16(cwd, str2(args2.out) ?? ".");
76640
76647
  mkdirSync19(outDir, { recursive: true });
76641
76648
  const auditPath = join52(outDir, "audit-latest.json");
76642
76649
  writeFileSync22(auditPath, `${JSON.stringify(auditDocumentFor(r.audit, adj.standard, lang), null, 2)}
@@ -76657,15 +76664,44 @@ function handleFold(args2, cwd) {
76657
76664
  }
76658
76665
  return { ...summary, written: true, auditPath, ...ledger ? { ledger } : {} };
76659
76666
  }
76660
- function adjudicationArg(args2) {
76667
+ function containedPath(raw, cwd, field) {
76668
+ const refuse = () => {
76669
+ throw new ToolError(`\`${field}\` is outside the project: ${raw}. The fold reads and writes inside its cwd only.`);
76670
+ };
76671
+ const target = resolve16(cwd, raw);
76672
+ let existing = target;
76673
+ const rest = [];
76674
+ for (; ; ) {
76675
+ try {
76676
+ lstatSync2(existing);
76677
+ break;
76678
+ } catch {
76679
+ const parent = dirname20(existing);
76680
+ if (parent === existing) break;
76681
+ rest.unshift(basename4(existing));
76682
+ existing = parent;
76683
+ }
76684
+ }
76685
+ let real;
76686
+ try {
76687
+ real = join52(realpathSync6(existing), ...rest);
76688
+ } catch {
76689
+ return refuse();
76690
+ }
76691
+ const root = realpathSync6(cwd);
76692
+ if (real !== root && !real.startsWith(root + sep5)) refuse();
76693
+ return target;
76694
+ }
76695
+ function adjudicationArg(args2, cwd) {
76661
76696
  const inline = args2.adjudication;
76662
76697
  const file = str2(args2.adjudication_file);
76663
76698
  if (inline !== void 0 && file) throw new ToolError("pass `adjudication` or `adjudication_file`, not both.");
76664
76699
  let v = inline;
76665
76700
  if (file) {
76666
76701
  if (!isAbsolute5(file)) throw new ToolError("`adjudication_file` must be an absolute path.");
76702
+ const path = containedPath(file, cwd, "adjudication_file");
76667
76703
  try {
76668
- v = JSON.parse(readFileSync35(file, "utf8"));
76704
+ v = JSON.parse(readFileSync35(path, "utf8"));
76669
76705
  } catch {
76670
76706
  throw new ToolError(`\`adjudication_file\` not found or not valid JSON: ${file}`);
76671
76707
  }
@@ -77141,16 +77177,19 @@ var WRITE_TOOLS = [
77141
77177
  type: "object",
77142
77178
  description: "The filled adjudication: { kind: 'adjudication', standard, items: [...] }, as ultra11y_adjudicate's worklist with your verdicts."
77143
77179
  },
77144
- adjudication_file: { type: "string", description: "Absolute path to an adjudication JSON file to fold instead." },
77180
+ adjudication_file: { type: "string", description: "Absolute path, inside cwd, to an adjudication JSON file to fold instead." },
77145
77181
  audit_file: {
77146
77182
  type: "string",
77147
- description: "Absolute path (or relative to cwd) to the audit JSON to fold into, like `--in`. Default: audit the project now, as ultra11y_adjudicate did."
77183
+ description: "Absolute path (or relative to cwd), inside cwd, to the audit JSON to fold into, like `--in`. Default: audit the project now, as ultra11y_adjudicate did."
77148
77184
  },
77149
77185
  globs: globsProp,
77150
77186
  standard: { type: "string", description: "Must match the adjudication's own standard when given." },
77151
77187
  strict: { type: "boolean", description: "All-or-nothing: a single refused verdict discards the whole fold." },
77152
77188
  write: { type: "boolean", description: "Actually write the folded audit (default: dry-run, returns the gate's verdict)." },
77153
- out: { type: "string", description: "Directory, relative to cwd, for audit-latest.json. Default: the project root, as `verify --apply`." },
77189
+ out: {
77190
+ type: "string",
77191
+ description: "Directory, relative to cwd and inside it, for audit-latest.json. Default: the project root, as `verify --apply`."
77192
+ },
77154
77193
  ledger: { type: "boolean", description: "With write:true, also record the accepted verdicts in .ultra11y/verdicts/<standard>.json." },
77155
77194
  lang: langProp
77156
77195
  },
@@ -77487,12 +77526,12 @@ var DECLARED = new Set([...TOOLS2, ...WRITE_TOOLS].map((t3) => t3.name));
77487
77526
 
77488
77527
  // src/mcp/resources.ts
77489
77528
  import { existsSync as existsSync40, readdirSync as readdirSync8, readFileSync as readFileSync36, realpathSync as realpathSync7, statSync as statSync20 } from "fs";
77490
- import { basename as basename4, dirname as dirname20, join as join53, resolve as resolve17, sep as sep6 } from "path";
77529
+ import { basename as basename5, dirname as dirname21, join as join53, resolve as resolve17, sep as sep6 } from "path";
77491
77530
  import { fileURLToPath as fileURLToPath5 } from "url";
77492
77531
  var SKILL_NAME = "ultra11y";
77493
77532
  var URI_SCHEME = "skill://";
77494
77533
  function resolveSkillRoot(moduleDir) {
77495
- const here = moduleDir ?? dirname20(fileURLToPath5(import.meta.url));
77534
+ const here = moduleDir ?? dirname21(fileURLToPath5(import.meta.url));
77496
77535
  const candidates2 = [resolve17(here, ".."), resolve17(here, "..", "skills", SKILL_NAME), resolve17(here, "..", "..", "skills", SKILL_NAME)];
77497
77536
  return candidates2.find((dir) => existsSync40(join53(dir, "SKILL.md")));
77498
77537
  }
@@ -77504,7 +77543,7 @@ function listResources(moduleDir) {
77504
77543
  if (!existsSync40(refDir)) return out2;
77505
77544
  for (const file of readdirSync8(refDir).sort()) {
77506
77545
  if (!file.endsWith(".md")) continue;
77507
- out2.push(describe(root, join53("references", file), `${SKILL_NAME} reference: ${basename4(file, ".md")}`));
77546
+ out2.push(describe(root, join53("references", file), `${SKILL_NAME} reference: ${basename5(file, ".md")}`));
77508
77547
  }
77509
77548
  return out2;
77510
77549
  }
@@ -79024,7 +79063,7 @@ async function cmdAudit(p) {
79024
79063
  const asFile = out2.toLowerCase().endsWith(".json");
79025
79064
  const target = asFile ? out2 : join54(out2, "audit-latest.json");
79026
79065
  try {
79027
- mkdirSync20(asFile ? dirname21(out2) : out2, { recursive: true });
79066
+ mkdirSync20(asFile ? dirname22(out2) : out2, { recursive: true });
79028
79067
  writeFileSync23(target, JSON.stringify(document, null, 2) + "\n");
79029
79068
  console.error(lang === "fr" ? `\u2192 audit \xE9crit dans ${target}` : `\u2192 audit written to ${target}`);
79030
79069
  } catch {
@@ -79705,15 +79744,18 @@ async function cmdReport(p) {
79705
79744
  const untested = isCore(standard) ? [] : packPartialAudit(result, standard);
79706
79745
  const partial = untested.length > 0;
79707
79746
  if (partial && !p.flags.json) console.error(`\u{1F6A8} ${partialAuditBanner(lang, untested, { scanned: ranBrowser(result) })}`);
79747
+ const rates = isCore(standard) ? void 0 : packReportRates(result, loadPack(standard));
79708
79748
  if (p.flags.json)
79709
79749
  console.log(
79710
79750
  JSON.stringify(
79711
79751
  {
79712
79752
  path,
79713
79753
  annexPath,
79714
- conformancePct: result.conformancePct,
79754
+ conformancePct: rates ? rates.conformance.applicable === 0 ? null : rates.conformance.pct : result.conformancePct,
79755
+ ...rates ? { conformance: rates.conformance, automaticPct: rates.automatic.pct, automatic: rates.automatic } : {},
79715
79756
  date: result.date,
79716
- standard: typeof p.flags.standard === "string" ? p.flags.standard : "wcag",
79757
+ // The resolved key (`--standard RGAA` → "rgaa"), never the raw flag.
79758
+ standard,
79717
79759
  ...html ? { htmlPath: html.index, htmlSinglePath: html.composite } : {},
79718
79760
  ...partial ? { partialAudit: true, untestedCriteria: untested } : {}
79719
79761
  },
@@ -80031,7 +80073,7 @@ Fill in COMPONENTS, run it (e.g. npx tsx ${out2}), then: node scripts/ultra11y.m
80031
80073
  const rel2 = ".ultra11y/capture-setup.mjs";
80032
80074
  const out2 = join54(root, rel2);
80033
80075
  try {
80034
- mkdirSync20(dirname21(out2), { recursive: true });
80076
+ mkdirSync20(dirname22(out2), { recursive: true });
80035
80077
  writeFileSync23(out2, captureSetup());
80036
80078
  } catch (e) {
80037
80079
  console.error(`ultra11y render: could not write ${out2}: ${e instanceof Error ? e.message : String(e)}`);
@@ -80316,7 +80358,7 @@ function cmdVerify(p) {
80316
80358
  const trial = conformityTrial(p, standard, lang);
80317
80359
  const expected = [...expectedNc, ...buildConformityWorklist(trial.claims, expectedNc.length, Number.POSITIVE_INFINITY)];
80318
80360
  const r = applyVerdicts(items, expected);
80319
- const ctx = readVerifyContext(dirname21(resolve18(apply)));
80361
+ const ctx = readVerifyContext(dirname22(resolve18(apply)));
80320
80362
  const absentItems = r.failures.filter((f) => !items.includes(f));
80321
80363
  const absentC = absentItems.filter((f) => f.kind === "c").length;
80322
80364
  const sourceDiffers = ctx ? !sameConformitySource(ctx.conformities, trial.source) : absentC > 0 && !items.some((it) => it.kind === "c");
@@ -3,7 +3,7 @@ name: ultra11y
3
3
  description: "Use to AUDIT a site, repository, or page against RGAA 4.1.2, the French State's accessibility standard (référentiel de l'État), on a WCAG 2.2 AA core (other country standards as packs); produce a dated conformance report, criterion grid, PRD backlog, or tickets; AUTHOR accessible markup; fix accessibility; or wire a repo gate and rendered-DOM capture pipeline. The bundled install-free engine runs 102 static checks tied to success criteria, while the agent adjudicates judgment criteria and routes rendering criteria to browser scans; check/verify reject invented non-conformities and never declare conforming what was not verified. Use `review-a11y` instead for a review scoped only to a diff, branch, or PR."
4
4
  license: MIT
5
5
  metadata:
6
- version: 5.55.4
6
+ version: 5.55.5
7
7
  ---
8
8
 
9
9
  # ultra11y — audit WCAG 2.2 AA and write accessible markup
@@ -235,9 +235,11 @@ Read exit codes from the process, **not** from a pipeline — `cmd --json | head
235
235
  counted as `failed`.
236
236
  - Under a pack standard (`--standard rgaa`), `audit-latest.json` is a `pack-audit` document:
237
237
  its root `conformancePct` is the automatic pass rate for that standard, `core` is the WCAG
238
- audit, and `report --json` and `verify --apply --json` echo the **core** rate. The
239
- standard's own conformance rate (validated ÷ validated + NC + à évaluer, NA excluded) is
240
- printed by the report; derive it from `criteria[]` if a number is needed in a pipeline.
238
+ audit, and `verify --apply --json` echoes the **core** rate. `report --json` says what the
239
+ report says: `conformancePct` is the standard's own conformance rate (validated ÷ validated
240
+ + NC + à évaluer, NA excluded; `null` when nothing is applicable), `conformance` its operands
241
+ (`validated`, `applicable`, `na`, `open`, `decided`, `total`), `automaticPct` / `automatic`
242
+ the annex's automatic rate, and `standard` the resolved key (`--standard RGAA` → `rgaa`).
241
243
  - `check --json` → `{ ok, issues[] }`.
242
244
  - `scan --merge --json` → the merged audit document, opened by a top-level `pages` summary:
243
245
  `{ sample, recorded[], refused: [{id, reason}] }` — the declared sample's size (`--sample`),
@@ -2,11 +2,11 @@
2
2
 
3
3
  // src/cli.ts
4
4
  import { realpathSync as realpathSync8, writeFileSync as writeFileSync23, mkdirSync as mkdirSync20, existsSync as existsSync41, readFileSync as readFileSync37, appendFileSync, copyFileSync as copyFileSync4 } from "fs";
5
- import { join as join54, relative as relative6, resolve as resolve18, sep as sep7, dirname as dirname21 } from "path";
5
+ import { join as join54, relative as relative6, resolve as resolve18, 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.55.4";
9
+ var VERSION = "5.55.5";
10
10
  var SCHEMA_VERSION = 2;
11
11
  function isAdjudicated(by) {
12
12
  return by === "agent" || by === "human";
@@ -64223,14 +64223,20 @@ function renderPackReport(r, pack, lang = "en", outDir, cropFor) {
64223
64223
  const docs = renderPackReportDocuments(r, pack, lang, outDir, cropFor);
64224
64224
  return joinReportDocuments(docs.report, docs.annex);
64225
64225
  }
64226
+ function automaticRate(derived) {
64227
+ const validated = derived.filter((d) => d.status === "C" && !isAdjudicated(d.decidedBy) && !isProvisionalJudgmentInapplicable(d)).length;
64228
+ return { pct: packConformancePct(derived), validated, decided: validated + derived.filter((d) => d.status === "NC").length };
64229
+ }
64230
+ function packReportRates(r, pack) {
64231
+ return { conformance: conformanceRate(reportTotals(packReportGroups(r, pack))), automatic: automaticRate(derivePackResults(r, pack.key)) };
64232
+ }
64226
64233
  function renderPackReportDocuments(r, pack, lang = "en", outDir, cropFor) {
64227
64234
  const derived = derivePackResults(r, pack.key);
64228
64235
  const std = `${pack.name} ${pack.baseVersion}`;
64229
64236
  const groups = packReportGroups(r, pack, lang);
64230
64237
  const rows = groups.flatMap((g) => g.rows);
64231
64238
  const tally = reportTotals(groups);
64232
- const autoValidated = derived.filter((d) => d.status === "C" && !isAdjudicated(d.decidedBy) && !isProvisionalJudgmentInapplicable(d)).length;
64233
- const autoDecided = autoValidated + derived.filter((d) => d.status === "NC").length;
64239
+ const auto = automaticRate(derived);
64234
64240
  return render(r, lang, {
64235
64241
  std,
64236
64242
  groupHead: L5[lang].byTheme,
@@ -64238,8 +64244,8 @@ function renderPackReportDocuments(r, pack, lang = "en", outDir, cropFor) {
64238
64244
  derivedOf: std,
64239
64245
  standard: pack.key,
64240
64246
  partialAudit: untestedNeedsRendering(r, establishedScs(derived)),
64241
- headerRatePct: packConformancePct(derived),
64242
- conformance: { rate: conformanceRate(tally), provenance: decisionProvenance(rows), autoDecided, autoValidated },
64247
+ headerRatePct: auto.pct,
64248
+ conformance: { rate: conformanceRate(tally), provenance: decisionProvenance(rows), autoDecided: auto.decided, autoValidated: auto.validated },
64243
64249
  // Forwarded, unlike before: without it the per-page screenshots resolved against the
64244
64250
  // CWD instead of the report's own directory, so a pack report written to `audits/`
64245
64251
  // carried links that only worked when read from the repo root.
@@ -75787,8 +75793,8 @@ ${xs.map(line).join("\n")}` : t3.none;
75787
75793
  import { createInterface as createInterface2 } from "readline";
75788
75794
 
75789
75795
  // src/mcp/handlers.ts
75790
- import { existsSync as existsSync39, mkdirSync as mkdirSync19, readFileSync as readFileSync35, realpathSync as realpathSync6, statSync as statSync19, writeFileSync as writeFileSync22 } from "fs";
75791
- import { isAbsolute as isAbsolute5, join as join52, resolve as resolve16, sep as sep5 } from "path";
75796
+ import { existsSync as existsSync39, lstatSync as lstatSync2, mkdirSync as mkdirSync19, readFileSync as readFileSync35, realpathSync as realpathSync6, statSync as statSync19, writeFileSync as writeFileSync22 } from "fs";
75797
+ import { basename as basename4, dirname as dirname20, isAbsolute as isAbsolute5, join as join52, resolve as resolve16, sep as sep5 } from "path";
75792
75798
 
75793
75799
  // src/criteria-view.ts
75794
75800
  var CriteriaLookupError = class extends Error {
@@ -76596,7 +76602,9 @@ function handleFix(args2, cwd) {
76596
76602
  }
76597
76603
  }
76598
76604
  function handleFold(args2, cwd) {
76599
- const adj = adjudicationArg(args2);
76605
+ const outArg = str2(args2.out);
76606
+ const outDir = outArg === void 0 ? cwd : containedPath(outArg, cwd, "out");
76607
+ const adj = adjudicationArg(args2, cwd);
76600
76608
  standardOf({ standard: adj.standard });
76601
76609
  const asked = str2(args2.standard);
76602
76610
  if (asked !== void 0 && standardOf(args2) !== adj.standard) {
@@ -76606,7 +76614,7 @@ function handleFold(args2, cwd) {
76606
76614
  const auditFile = str2(args2.audit_file);
76607
76615
  let base;
76608
76616
  if (auditFile) {
76609
- const path = resolve16(cwd, auditFile);
76617
+ const path = containedPath(auditFile, cwd, "audit_file");
76610
76618
  try {
76611
76619
  base = unwrapAudit(JSON.parse(readFileSync35(path, "utf8")));
76612
76620
  } catch {
@@ -76636,7 +76644,6 @@ function handleFold(args2, cwd) {
76636
76644
  next: landed ? "Dry run: nothing was written. Re-call with write:true (and ledger:true to record the accepted verdicts) to land them." : "Nothing landed. Fix the refused verdicts listed in issues \u2014 cite the evidence a C cleared, ground every NC finding \u2014 and fold again."
76637
76645
  };
76638
76646
  }
76639
- const outDir = resolve16(cwd, str2(args2.out) ?? ".");
76640
76647
  mkdirSync19(outDir, { recursive: true });
76641
76648
  const auditPath = join52(outDir, "audit-latest.json");
76642
76649
  writeFileSync22(auditPath, `${JSON.stringify(auditDocumentFor(r.audit, adj.standard, lang), null, 2)}
@@ -76657,15 +76664,44 @@ function handleFold(args2, cwd) {
76657
76664
  }
76658
76665
  return { ...summary, written: true, auditPath, ...ledger ? { ledger } : {} };
76659
76666
  }
76660
- function adjudicationArg(args2) {
76667
+ function containedPath(raw, cwd, field) {
76668
+ const refuse = () => {
76669
+ throw new ToolError(`\`${field}\` is outside the project: ${raw}. The fold reads and writes inside its cwd only.`);
76670
+ };
76671
+ const target = resolve16(cwd, raw);
76672
+ let existing = target;
76673
+ const rest = [];
76674
+ for (; ; ) {
76675
+ try {
76676
+ lstatSync2(existing);
76677
+ break;
76678
+ } catch {
76679
+ const parent = dirname20(existing);
76680
+ if (parent === existing) break;
76681
+ rest.unshift(basename4(existing));
76682
+ existing = parent;
76683
+ }
76684
+ }
76685
+ let real;
76686
+ try {
76687
+ real = join52(realpathSync6(existing), ...rest);
76688
+ } catch {
76689
+ return refuse();
76690
+ }
76691
+ const root = realpathSync6(cwd);
76692
+ if (real !== root && !real.startsWith(root + sep5)) refuse();
76693
+ return target;
76694
+ }
76695
+ function adjudicationArg(args2, cwd) {
76661
76696
  const inline = args2.adjudication;
76662
76697
  const file = str2(args2.adjudication_file);
76663
76698
  if (inline !== void 0 && file) throw new ToolError("pass `adjudication` or `adjudication_file`, not both.");
76664
76699
  let v = inline;
76665
76700
  if (file) {
76666
76701
  if (!isAbsolute5(file)) throw new ToolError("`adjudication_file` must be an absolute path.");
76702
+ const path = containedPath(file, cwd, "adjudication_file");
76667
76703
  try {
76668
- v = JSON.parse(readFileSync35(file, "utf8"));
76704
+ v = JSON.parse(readFileSync35(path, "utf8"));
76669
76705
  } catch {
76670
76706
  throw new ToolError(`\`adjudication_file\` not found or not valid JSON: ${file}`);
76671
76707
  }
@@ -77141,16 +77177,19 @@ var WRITE_TOOLS = [
77141
77177
  type: "object",
77142
77178
  description: "The filled adjudication: { kind: 'adjudication', standard, items: [...] }, as ultra11y_adjudicate's worklist with your verdicts."
77143
77179
  },
77144
- adjudication_file: { type: "string", description: "Absolute path to an adjudication JSON file to fold instead." },
77180
+ adjudication_file: { type: "string", description: "Absolute path, inside cwd, to an adjudication JSON file to fold instead." },
77145
77181
  audit_file: {
77146
77182
  type: "string",
77147
- description: "Absolute path (or relative to cwd) to the audit JSON to fold into, like `--in`. Default: audit the project now, as ultra11y_adjudicate did."
77183
+ description: "Absolute path (or relative to cwd), inside cwd, to the audit JSON to fold into, like `--in`. Default: audit the project now, as ultra11y_adjudicate did."
77148
77184
  },
77149
77185
  globs: globsProp,
77150
77186
  standard: { type: "string", description: "Must match the adjudication's own standard when given." },
77151
77187
  strict: { type: "boolean", description: "All-or-nothing: a single refused verdict discards the whole fold." },
77152
77188
  write: { type: "boolean", description: "Actually write the folded audit (default: dry-run, returns the gate's verdict)." },
77153
- out: { type: "string", description: "Directory, relative to cwd, for audit-latest.json. Default: the project root, as `verify --apply`." },
77189
+ out: {
77190
+ type: "string",
77191
+ description: "Directory, relative to cwd and inside it, for audit-latest.json. Default: the project root, as `verify --apply`."
77192
+ },
77154
77193
  ledger: { type: "boolean", description: "With write:true, also record the accepted verdicts in .ultra11y/verdicts/<standard>.json." },
77155
77194
  lang: langProp
77156
77195
  },
@@ -77487,12 +77526,12 @@ var DECLARED = new Set([...TOOLS2, ...WRITE_TOOLS].map((t3) => t3.name));
77487
77526
 
77488
77527
  // src/mcp/resources.ts
77489
77528
  import { existsSync as existsSync40, readdirSync as readdirSync8, readFileSync as readFileSync36, realpathSync as realpathSync7, statSync as statSync20 } from "fs";
77490
- import { basename as basename4, dirname as dirname20, join as join53, resolve as resolve17, sep as sep6 } from "path";
77529
+ import { basename as basename5, dirname as dirname21, join as join53, resolve as resolve17, sep as sep6 } from "path";
77491
77530
  import { fileURLToPath as fileURLToPath5 } from "url";
77492
77531
  var SKILL_NAME = "ultra11y";
77493
77532
  var URI_SCHEME = "skill://";
77494
77533
  function resolveSkillRoot(moduleDir) {
77495
- const here = moduleDir ?? dirname20(fileURLToPath5(import.meta.url));
77534
+ const here = moduleDir ?? dirname21(fileURLToPath5(import.meta.url));
77496
77535
  const candidates2 = [resolve17(here, ".."), resolve17(here, "..", "skills", SKILL_NAME), resolve17(here, "..", "..", "skills", SKILL_NAME)];
77497
77536
  return candidates2.find((dir) => existsSync40(join53(dir, "SKILL.md")));
77498
77537
  }
@@ -77504,7 +77543,7 @@ function listResources(moduleDir) {
77504
77543
  if (!existsSync40(refDir)) return out2;
77505
77544
  for (const file of readdirSync8(refDir).sort()) {
77506
77545
  if (!file.endsWith(".md")) continue;
77507
- out2.push(describe(root, join53("references", file), `${SKILL_NAME} reference: ${basename4(file, ".md")}`));
77546
+ out2.push(describe(root, join53("references", file), `${SKILL_NAME} reference: ${basename5(file, ".md")}`));
77508
77547
  }
77509
77548
  return out2;
77510
77549
  }
@@ -79024,7 +79063,7 @@ async function cmdAudit(p) {
79024
79063
  const asFile = out2.toLowerCase().endsWith(".json");
79025
79064
  const target = asFile ? out2 : join54(out2, "audit-latest.json");
79026
79065
  try {
79027
- mkdirSync20(asFile ? dirname21(out2) : out2, { recursive: true });
79066
+ mkdirSync20(asFile ? dirname22(out2) : out2, { recursive: true });
79028
79067
  writeFileSync23(target, JSON.stringify(document, null, 2) + "\n");
79029
79068
  console.error(lang === "fr" ? `\u2192 audit \xE9crit dans ${target}` : `\u2192 audit written to ${target}`);
79030
79069
  } catch {
@@ -79705,15 +79744,18 @@ async function cmdReport(p) {
79705
79744
  const untested = isCore(standard) ? [] : packPartialAudit(result, standard);
79706
79745
  const partial = untested.length > 0;
79707
79746
  if (partial && !p.flags.json) console.error(`\u{1F6A8} ${partialAuditBanner(lang, untested, { scanned: ranBrowser(result) })}`);
79747
+ const rates = isCore(standard) ? void 0 : packReportRates(result, loadPack(standard));
79708
79748
  if (p.flags.json)
79709
79749
  console.log(
79710
79750
  JSON.stringify(
79711
79751
  {
79712
79752
  path,
79713
79753
  annexPath,
79714
- conformancePct: result.conformancePct,
79754
+ conformancePct: rates ? rates.conformance.applicable === 0 ? null : rates.conformance.pct : result.conformancePct,
79755
+ ...rates ? { conformance: rates.conformance, automaticPct: rates.automatic.pct, automatic: rates.automatic } : {},
79715
79756
  date: result.date,
79716
- standard: typeof p.flags.standard === "string" ? p.flags.standard : "wcag",
79757
+ // The resolved key (`--standard RGAA` → "rgaa"), never the raw flag.
79758
+ standard,
79717
79759
  ...html ? { htmlPath: html.index, htmlSinglePath: html.composite } : {},
79718
79760
  ...partial ? { partialAudit: true, untestedCriteria: untested } : {}
79719
79761
  },
@@ -80031,7 +80073,7 @@ Fill in COMPONENTS, run it (e.g. npx tsx ${out2}), then: node scripts/ultra11y.m
80031
80073
  const rel2 = ".ultra11y/capture-setup.mjs";
80032
80074
  const out2 = join54(root, rel2);
80033
80075
  try {
80034
- mkdirSync20(dirname21(out2), { recursive: true });
80076
+ mkdirSync20(dirname22(out2), { recursive: true });
80035
80077
  writeFileSync23(out2, captureSetup());
80036
80078
  } catch (e) {
80037
80079
  console.error(`ultra11y render: could not write ${out2}: ${e instanceof Error ? e.message : String(e)}`);
@@ -80316,7 +80358,7 @@ function cmdVerify(p) {
80316
80358
  const trial = conformityTrial(p, standard, lang);
80317
80359
  const expected = [...expectedNc, ...buildConformityWorklist(trial.claims, expectedNc.length, Number.POSITIVE_INFINITY)];
80318
80360
  const r = applyVerdicts(items, expected);
80319
- const ctx = readVerifyContext(dirname21(resolve18(apply)));
80361
+ const ctx = readVerifyContext(dirname22(resolve18(apply)));
80320
80362
  const absentItems = r.failures.filter((f) => !items.includes(f));
80321
80363
  const absentC = absentItems.filter((f) => f.kind === "c").length;
80322
80364
  const sourceDiffers = ctx ? !sameConformitySource(ctx.conformities, trial.source) : absentC > 0 && !items.some((it) => it.kind === "c");
@@ -27,7 +27,7 @@ variables:
27
27
  ULTRA11Y_LANG: en
28
28
  # Exact by default: a CI report must say which engine produced it. The release script keeps
29
29
  # this pin aligned with the package version; override only for a deliberate upgrade test.
30
- ULTRA11Y_VERSION: '5.55.4'
30
+ ULTRA11Y_VERSION: '5.55.5'
31
31
  # Batches of 8 amortise the prompt; each accepted verdict is checkpointed before the next
32
32
  # batch, and later passes receive only the residue.
33
33
  ULTRA11Y_GRAIN: batch
package/src/cli.ts CHANGED
@@ -23,6 +23,7 @@ import {
23
23
  pageConformanceCell,
24
24
  writeReportFiles,
25
25
  packPartialAudit,
26
+ packReportRates,
26
27
  partialAuditBanner,
27
28
  ranBrowser,
28
29
  withReportAnnexes,
@@ -128,7 +129,7 @@ import { pageCriterionRows, pagesForStandard, renderPageDocument, renderPagesDoc
128
129
  import { crawlBound, crawlUrls, extractTitle, parseSitemapUrls } from "./crawl.js";
129
130
  import { DEV_DEFAULT_PORT, nextOverlayComponent, startDevServer, type DevServer } from "./dev.js";
130
131
  import { cypressCommands, cypressPlugin, detectE2eRunner, e2eSetupPlan, playwrightFixture, type E2ePaths, type E2eRunner } from "./e2e.js";
131
- import { resolveStandard, getPack, isCore, findingsForStandard, type StandardId } from "./standards/index.js";
132
+ import { resolveStandard, getPack, isCore, loadPack, findingsForStandard, type StandardId } from "./standards/index.js";
132
133
  import { auditDocumentFor, packAuditDocument, unwrapAudit } from "./standards/document.js";
133
134
  import { loadRuntimeStandards, loadConfig, type Ultra11yConfig } from "./config.js";
134
135
  import { runPackCheck, packScaffold } from "./pack.js";
@@ -2234,15 +2235,22 @@ async function cmdReport(p: ParsedArgs): Promise<number> {
2234
2235
  const untested = isCore(standard) ? [] : packPartialAudit(result, standard);
2235
2236
  const partial = untested.length > 0;
2236
2237
  if (partial && !p.flags.json) console.error(`🚨 ${partialAuditBanner(lang, untested, { scanned: ranBrowser(result) })}`);
2238
+ // The rate the document headlines, never another one (#116): a pack report prints its own
2239
+ // conformity rate (validated ÷ applicable) over its own grid, not the WCAG core's
2240
+ // `conformancePct`. Its operands travel with it — and `null`, not 100, when nothing is
2241
+ // applicable, as the report itself refuses to print « 100 % (0 ÷ 0) ».
2242
+ const rates = isCore(standard) ? undefined : packReportRates(result, loadPack(standard));
2237
2243
  if (p.flags.json)
2238
2244
  console.log(
2239
2245
  JSON.stringify(
2240
2246
  {
2241
2247
  path,
2242
2248
  annexPath,
2243
- conformancePct: result.conformancePct,
2249
+ conformancePct: rates ? (rates.conformance.applicable === 0 ? null : rates.conformance.pct) : result.conformancePct,
2250
+ ...(rates ? { conformance: rates.conformance, automaticPct: rates.automatic.pct, automatic: rates.automatic } : {}),
2244
2251
  date: result.date,
2245
- standard: typeof p.flags.standard === "string" ? p.flags.standard : "wcag",
2252
+ // The resolved key (`--standard RGAA` → "rgaa"), never the raw flag.
2253
+ standard,
2246
2254
  ...(html ? { htmlPath: html.index, htmlSinglePath: html.composite } : {}),
2247
2255
  ...(partial ? { partialAudit: true, untestedCriteria: untested } : {}),
2248
2256
  },
@@ -1,5 +1,5 @@
1
- import { existsSync, mkdirSync, readFileSync, realpathSync, statSync, writeFileSync } from "node:fs";
2
- import { isAbsolute, join, resolve, sep } from "node:path";
1
+ import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, statSync, writeFileSync } from "node:fs";
2
+ import { basename, dirname, isAbsolute, join, resolve, sep } from "node:path";
3
3
  import { runAudit } from "../audit.js";
4
4
  import { type AdjudicationFile, applyAdjudication, buildAdjudicationWorklist, formatAdjudication, hydrateAdjudication } from "../adjudicate.js";
5
5
  import { entriesFrom, ledgerPath, mergeLedger, readLedger, unreadableCaptures, writeLedger } from "../ledger.js";
@@ -515,7 +515,11 @@ function handleFix(args: Record<string, unknown>, cwd: string): unknown {
515
515
  * audit and, on `ledger`, merge the ACCEPTED verdicts into the ledger. A refused verdict never
516
516
  * reaches the ledger: the next replay would launder it back in. */
517
517
  function handleFold(args: Record<string, unknown>, cwd: string): unknown {
518
- const adj = adjudicationArg(args);
518
+ // Every path the fold reads or writes stays inside the project, as ultra11y_read's does
519
+ // (#116) — checked before anything is read, so a dry run refuses it as a write would.
520
+ const outArg = str(args.out);
521
+ const outDir = outArg === undefined ? cwd : containedPath(outArg, cwd, "out");
522
+ const adj = adjudicationArg(args, cwd);
519
523
  // The adjudication names its standard; it must be one this project knows.
520
524
  standardOf({ standard: adj.standard });
521
525
  const asked = str(args.standard);
@@ -526,7 +530,7 @@ function handleFold(args: Record<string, unknown>, cwd: string): unknown {
526
530
  const auditFile = str(args.audit_file);
527
531
  let base: AuditResult;
528
532
  if (auditFile) {
529
- const path = resolve(cwd, auditFile);
533
+ const path = containedPath(auditFile, cwd, "audit_file");
530
534
  try {
531
535
  base = unwrapAudit(JSON.parse(readFileSync(path, "utf8"))) as AuditResult;
532
536
  } catch {
@@ -560,7 +564,6 @@ function handleFold(args: Record<string, unknown>, cwd: string): unknown {
560
564
  : "Nothing landed. Fix the refused verdicts listed in issues — cite the evidence a C cleared, ground every NC finding — and fold again.",
561
565
  };
562
566
  }
563
- const outDir = resolve(cwd, str(args.out) ?? ".");
564
567
  mkdirSync(outDir, { recursive: true });
565
568
  const auditPath = join(outDir, "audit-latest.json");
566
569
  writeFileSync(auditPath, `${JSON.stringify(auditDocumentFor(r.audit, adj.standard, lang), null, 2)}\n`);
@@ -584,17 +587,52 @@ function handleFold(args: Record<string, unknown>, cwd: string): unknown {
584
587
  return { ...summary, written: true, auditPath, ...(ledger ? { ledger } : {}) };
585
588
  }
586
589
 
590
+ /** `raw`, resolved against the project root, refused unless it lands inside it. Containment
591
+ * on the REALPATH, as ultra11y_read's: a symlink inside the project normalises cleanly as a
592
+ * string and only escapes once the filesystem resolves it. A path that does not exist yet (an
593
+ * `out` directory the fold will create) is held by its nearest existing ancestor; a dangling
594
+ * symlink resolves to nowhere and is refused. Returns the path as the caller wrote it, resolved. */
595
+ function containedPath(raw: string, cwd: string, field: string): string {
596
+ const refuse = (): never => {
597
+ throw new ToolError(`\`${field}\` is outside the project: ${raw}. The fold reads and writes inside its cwd only.`);
598
+ };
599
+ const target = resolve(cwd, raw);
600
+ let existing = target;
601
+ const rest: string[] = [];
602
+ for (;;) {
603
+ try {
604
+ lstatSync(existing);
605
+ break;
606
+ } catch {
607
+ const parent = dirname(existing);
608
+ if (parent === existing) break;
609
+ rest.unshift(basename(existing));
610
+ existing = parent;
611
+ }
612
+ }
613
+ let real: string;
614
+ try {
615
+ real = join(realpathSync(existing), ...rest);
616
+ } catch {
617
+ return refuse();
618
+ }
619
+ const root = realpathSync(cwd);
620
+ if (real !== root && !real.startsWith(root + sep)) refuse();
621
+ return target;
622
+ }
623
+
587
624
  /** The adjudication to fold: inline, or a file the caller named. Only `kind: "adjudication"`
588
625
  * is a fold — a ledger is replayed, not folded, and an array is the NC-verdicts worklist. */
589
- function adjudicationArg(args: Record<string, unknown>): AdjudicationFile {
626
+ function adjudicationArg(args: Record<string, unknown>, cwd: string): AdjudicationFile {
590
627
  const inline = args.adjudication;
591
628
  const file = str(args.adjudication_file);
592
629
  if (inline !== undefined && file) throw new ToolError("pass `adjudication` or `adjudication_file`, not both.");
593
630
  let v: unknown = inline;
594
631
  if (file) {
595
632
  if (!isAbsolute(file)) throw new ToolError("`adjudication_file` must be an absolute path.");
633
+ const path = containedPath(file, cwd, "adjudication_file");
596
634
  try {
597
- v = JSON.parse(readFileSync(file, "utf8"));
635
+ v = JSON.parse(readFileSync(path, "utf8"));
598
636
  } catch {
599
637
  throw new ToolError(`\`adjudication_file\` not found or not valid JSON: ${file}`);
600
638
  }
package/src/mcp/tools.ts CHANGED
@@ -303,17 +303,20 @@ export const WRITE_TOOLS: ToolDecl[] = [
303
303
  type: "object",
304
304
  description: "The filled adjudication: { kind: 'adjudication', standard, items: [...] }, as ultra11y_adjudicate's worklist with your verdicts.",
305
305
  },
306
- adjudication_file: { type: "string", description: "Absolute path to an adjudication JSON file to fold instead." },
306
+ adjudication_file: { type: "string", description: "Absolute path, inside cwd, to an adjudication JSON file to fold instead." },
307
307
  audit_file: {
308
308
  type: "string",
309
309
  description:
310
- "Absolute path (or relative to cwd) to the audit JSON to fold into, like `--in`. Default: audit the project now, as ultra11y_adjudicate did.",
310
+ "Absolute path (or relative to cwd), inside cwd, to the audit JSON to fold into, like `--in`. Default: audit the project now, as ultra11y_adjudicate did.",
311
311
  },
312
312
  globs: globsProp,
313
313
  standard: { type: "string", description: "Must match the adjudication's own standard when given." },
314
314
  strict: { type: "boolean", description: "All-or-nothing: a single refused verdict discards the whole fold." },
315
315
  write: { type: "boolean", description: "Actually write the folded audit (default: dry-run, returns the gate's verdict)." },
316
- out: { type: "string", description: "Directory, relative to cwd, for audit-latest.json. Default: the project root, as `verify --apply`." },
316
+ out: {
317
+ type: "string",
318
+ description: "Directory, relative to cwd and inside it, for audit-latest.json. Default: the project root, as `verify --apply`.",
319
+ },
317
320
  ledger: { type: "boolean", description: "With write:true, also record the accepted verdicts in .ultra11y/verdicts/<standard>.json." },
318
321
  lang: langProp,
319
322
  },
package/src/report.ts CHANGED
@@ -2029,6 +2029,24 @@ export function renderPackReport(r: AuditResult, pack: StandardPack, lang: Lang
2029
2029
  return joinReportDocuments(docs.report, docs.annex);
2030
2030
  }
2031
2031
 
2032
+ /** The automatic rate's own two operands, computed exactly as `packConformancePct` computes
2033
+ * its ratio — one formula, published with its numerator and its denominator so a reader can
2034
+ * tell it apart from the conformity rate above it at a glance. */
2035
+ function automaticRate(derived: ReturnType<typeof derivePackResults>): { pct: number; validated: number; decided: number } {
2036
+ const validated = derived.filter((d) => d.status === "C" && !isAdjudicated(d.decidedBy) && !isProvisionalJudgmentInapplicable(d)).length;
2037
+ return { pct: packConformancePct(derived), validated, decided: validated + derived.filter((d) => d.status === "NC").length };
2038
+ }
2039
+
2040
+ /** The two rates a pack report prints, with their operands, from the same grid the document
2041
+ * renders: the conformity rate it headlines (validated ÷ applicable) and the automatic rate of
2042
+ * its annex. `report --json` carries these, never the WCAG core's `conformancePct` (#116). */
2043
+ export function packReportRates(
2044
+ r: AuditResult,
2045
+ pack: StandardPack,
2046
+ ): { conformance: ConformanceRate; automatic: { pct: number; validated: number; decided: number } } {
2047
+ return { conformance: conformanceRate(reportTotals(packReportGroups(r, pack))), automatic: automaticRate(derivePackResults(r, pack.key)) };
2048
+ }
2049
+
2032
2050
  /** A derived report for a country standards pack (RGAA, …), projected from the WCAG audit — both
2033
2051
  * documents. */
2034
2052
  export function renderPackReportDocuments(
@@ -2047,11 +2065,7 @@ export function renderPackReportDocuments(
2047
2065
  const groups = packReportGroups(r, pack, lang);
2048
2066
  const rows = groups.flatMap((g) => g.rows);
2049
2067
  const tally = reportTotals(groups);
2050
- // The automatic rate's own two operands, computed exactly as `packConformancePct` computes
2051
- // its ratio — one formula, published with its numerator and its denominator so a reader can
2052
- // tell it apart from the conformity rate above it at a glance.
2053
- const autoValidated = derived.filter((d) => d.status === "C" && !isAdjudicated(d.decidedBy) && !isProvisionalJudgmentInapplicable(d)).length;
2054
- const autoDecided = autoValidated + derived.filter((d) => d.status === "NC").length;
2068
+ const auto = automaticRate(derived);
2055
2069
  return render(r, lang, {
2056
2070
  std,
2057
2071
  groupHead: L[lang].byTheme,
@@ -2059,8 +2073,8 @@ export function renderPackReportDocuments(
2059
2073
  derivedOf: std,
2060
2074
  standard: pack.key,
2061
2075
  partialAudit: untestedNeedsRendering(r, establishedScs(derived)),
2062
- headerRatePct: packConformancePct(derived),
2063
- conformance: { rate: conformanceRate(tally), provenance: decisionProvenance(rows), autoDecided, autoValidated },
2076
+ headerRatePct: auto.pct,
2077
+ conformance: { rate: conformanceRate(tally), provenance: decisionProvenance(rows), autoDecided: auto.decided, autoValidated: auto.validated },
2064
2078
  // Forwarded, unlike before: without it the per-page screenshots resolved against the
2065
2079
  // CWD instead of the report's own directory, so a pack report written to `audits/`
2066
2080
  // carried links that only worked when read from the repo root.
package/src/types.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // Single source of truth for shared types + the embedded version. sync-version.mjs
2
2
  // rewrites VERSION at release time (kept in lockstep with package.json + SKILL.md).
3
- export const VERSION = "5.55.4";
3
+ export const VERSION = "5.55.5";
4
4
  export const SCHEMA_VERSION = 2;
5
5
 
6
6
  // Lang = the UI FRAME's language — the `L` localization tables each module (report,