ultra11y 5.51.2 → 5.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,8 +6,11 @@ import { join as join53, relative as relative6, resolve as resolve18, sep as sep
6
6
  import { fileURLToPath as fileURLToPath5, pathToFileURL as pathToFileURL3 } from "url";
7
7
 
8
8
  // src/types.ts
9
- var VERSION = "5.51.2";
9
+ var VERSION = "5.53.0";
10
10
  var SCHEMA_VERSION = 2;
11
+ function isAdjudicated(by) {
12
+ return by === "agent" || by === "human";
13
+ }
11
14
  var INAPPLICABLE_STATUS = "C";
12
15
 
13
16
  // src/audit.ts
@@ -59478,8 +59481,11 @@ import { mkdirSync as mkdirSync6, writeFileSync as writeFileSync7 } from "fs";
59478
59481
  import { join as join30 } from "path";
59479
59482
 
59480
59483
  // src/standards/derive.ts
59484
+ function ruler(decided) {
59485
+ return decided.decidedBy === "human" && decided.auditor ? { decidedBy: "human", auditor: decided.auditor } : { decidedBy: "agent" };
59486
+ }
59481
59487
  function isProvisionalJudgmentInapplicable(result, criterion) {
59482
- if (result.status !== INAPPLICABLE_STATUS || result.inapplicable !== true || result.decidedBy === "agent") return false;
59488
+ if (result.status !== INAPPLICABLE_STATUS || result.inapplicable !== true || isAdjudicated(result.decidedBy)) return false;
59483
59489
  return result.judgment === true || Object.values(criterion?.automation?.tests ?? {}).includes("judgment");
59484
59490
  }
59485
59491
  function aggregate2(results) {
@@ -59505,7 +59511,7 @@ function packCriteriaForFinding(pack, finding) {
59505
59511
  }).map((pc) => pc.id);
59506
59512
  }
59507
59513
  function packConformancePct(derived) {
59508
- const c2 = derived.filter((d) => d.status === "C" && d.decidedBy !== "agent" && !isProvisionalJudgmentInapplicable(d)).length;
59514
+ const c2 = derived.filter((d) => d.status === "C" && !isAdjudicated(d.decidedBy) && !isProvisionalJudgmentInapplicable(d)).length;
59509
59515
  const nc = derived.filter((d) => d.status === "NC").length;
59510
59516
  return c2 + nc === 0 ? 100 : Math.round(c2 / (c2 + nc) * 100);
59511
59517
  }
@@ -59635,7 +59641,7 @@ function derivePackResults(audit2, packKey, pageId) {
59635
59641
  ...open,
59636
59642
  status: measured2.status === "NC" ? "NC" : "manual",
59637
59643
  ...decided.justification ? { justification: decided.justification } : {},
59638
- decidedBy: "agent"
59644
+ ...ruler(decided)
59639
59645
  };
59640
59646
  }
59641
59647
  if (decided) {
@@ -59648,7 +59654,7 @@ function derivePackResults(audit2, packKey, pageId) {
59648
59654
  findings: decided.findings,
59649
59655
  scs: pc.wcag,
59650
59656
  ...decided.justification ? { justification: decided.justification } : {},
59651
- decidedBy: "agent"
59657
+ ...ruler(decided)
59652
59658
  };
59653
59659
  }
59654
59660
  return isProvisionalJudgmentInapplicable(measured2, pc) ? { ...measured2, judgment: true } : measured2;
@@ -60071,7 +60077,7 @@ function pageStatus(c2, pageFindings, basis, coverage) {
60071
60077
  if (c2.status === "manual") return "manual";
60072
60078
  if (c2.status === "NA") return "NA";
60073
60079
  if (c2.inapplicable) return c2.status;
60074
- if (c2.decidedBy === "agent" || c2.decidedBy === "scan") return c2.status;
60080
+ if (c2.decidedBy === "agent" || c2.decidedBy === "human" || c2.decidedBy === "scan") return c2.status;
60075
60081
  if (automatability(c2.id) !== "static") return "manual";
60076
60082
  return basis === "snapshot" ? "C" : "manual";
60077
60083
  }
@@ -60146,6 +60152,7 @@ var L = {
60146
60152
  notAudited: "non audit\xE9",
60147
60153
  notAuditedNote: "Une page marqu\xE9e \xAB non audit\xE9 \xBB a bien un instantan\xE9, mais CET audit ne l'a pas lu (il ne portait que sur les sources). L'absence de constat n'y vaut donc PAS conformit\xE9 \u2014 relancez l'audit en incluant `.ultra11y/pages`.",
60148
60154
  agentMark: "`C*` : conformit\xE9 tranch\xE9e par l'agent IA \xE0 partir des \xE9vidences cit\xE9es (gat\xE9), et non prouv\xE9e par le moteur d\xE9terministe.",
60155
+ humanMark: "`C\u2020` : conformit\xE9 tranch\xE9e par un auditeur humain nomm\xE9 \xE0 partir des \xE9vidences cit\xE9es (m\xEAme gate que l'agent), et non prouv\xE9e par le moteur d\xE9terministe.",
60149
60156
  originNote: (o) => `Les colonnes sont les URL des pages, relatives \xE0 \`${o}\`.`
60150
60157
  },
60151
60158
  en: {
@@ -60162,6 +60169,7 @@ var L = {
60162
60169
  notAudited: "not audited",
60163
60170
  notAuditedNote: 'A page marked "not audited" does have a snapshot, but THIS audit never read it (it covered sources only). Absence of a finding there does NOT mean conforming \u2014 re-run the audit with `.ultra11y/pages` in scope.',
60164
60171
  agentMark: "`C*`: conformity ruled by the AI agent from the evidence it cited (gated), not proven by the deterministic engine.",
60172
+ humanMark: "`C\u2020`: conformity ruled by a named human auditor from the evidence they cited (the agent's gate), not proven by the deterministic engine.",
60165
60173
  originNote: (o) => `Columns are the pages' URLs, relative to \`${o}\`.`
60166
60174
  }
60167
60175
  };
@@ -60171,6 +60179,13 @@ function formatRate(rate, decided, total) {
60171
60179
  function agentMarkNote(lang) {
60172
60180
  return L[lang].agentMark;
60173
60181
  }
60182
+ function humanMarkNote(lang) {
60183
+ return L[lang].humanMark;
60184
+ }
60185
+ function ruledMark(decidedBy, status) {
60186
+ if (status !== "C") return "";
60187
+ return decidedBy === "agent" ? "*" : decidedBy === "human" ? "\u2020" : "";
60188
+ }
60174
60189
  function pageBasisWarning(basis, lang) {
60175
60190
  if (basis === "snapshot") return void 0;
60176
60191
  return basis === "not-audited" ? L[lang].notAuditedNote : L[lang].basisNote;
@@ -60220,6 +60235,7 @@ function pageView(result, page) {
60220
60235
  }
60221
60236
  function pageGridModel(result, derived, standard, lang) {
60222
60237
  const status = /* @__PURE__ */ new Map();
60238
+ const human = /* @__PURE__ */ new Set();
60223
60239
  const put = (rowId, pageId, s) => {
60224
60240
  const m = status.get(rowId) ?? /* @__PURE__ */ new Map();
60225
60241
  m.set(pageId, s);
@@ -60227,8 +60243,12 @@ function pageGridModel(result, derived, standard, lang) {
60227
60243
  };
60228
60244
  if (isCore(standard)) {
60229
60245
  const rows2 = [...result.criteria].sort((a, b) => compareSC(a.id, b.id)).map((c2) => ({ id: c2.id, label: `${c2.id} ${scTitle(c2.id, lang) ?? ""}`.trim(), group: c2.guideline }));
60230
- for (const p of derived) for (const c2 of p.criteria) put(c2.id, p.id, c2.status);
60231
- return { rows: rows2, status };
60246
+ for (const p of derived)
60247
+ for (const c2 of p.criteria) {
60248
+ put(c2.id, p.id, c2.status);
60249
+ if (c2.decidedBy === "human") human.add(`${c2.id}|${p.id}`);
60250
+ }
60251
+ return { rows: rows2, status, human };
60232
60252
  }
60233
60253
  const pack = loadPack(standard);
60234
60254
  const rows = pack.criteria.map((pc) => ({ id: pc.id, label: pc.id, group: `${pc.theme}. ${themeName(pack, pc.theme, lang) ?? ""}`.trim() }));
@@ -60236,9 +60256,10 @@ function pageGridModel(result, derived, standard, lang) {
60236
60256
  for (const pc of derivePackResults(pageView(result, p), standard, p.id)) {
60237
60257
  const criterion = pack.criteria.find((row) => row.id === pc.id);
60238
60258
  put(pc.id, p.id, isProvisionalJudgmentInapplicable(pc, criterion) ? "manual" : pc.status);
60259
+ if (pc.decidedBy === "human") human.add(`${pc.id}|${p.id}`);
60239
60260
  }
60240
60261
  }
60241
- return { rows, status };
60262
+ return { rows, status, human };
60242
60263
  }
60243
60264
  function renderRedirected(redirected, lang = "en") {
60244
60265
  const fr = lang === "fr";
@@ -60281,19 +60302,26 @@ function renderPageGrid(result, pages, standard = CORE2, lang = "en") {
60281
60302
  if (originNote) out2.push(`> ${originNote}`, "");
60282
60303
  const head = [s.criterion, ...derived.map((p) => pageColumnLabel(p, origin))];
60283
60304
  out2.push(`| ${head.join(" | ")} |`, `| ${head.map(() => "---").join(" | ")} |`);
60284
- const { rows, status } = pageGridModel(result, derived, standard, lang);
60305
+ const { rows, status, human } = pageGridModel(result, derived, standard, lang);
60285
60306
  out2.push(`| **${s.rate}** | ${derived.map((p) => `**${formatRate(...gridRate(rows, status, p.id))}**`).join(" | ")} |`);
60286
60307
  out2.push(`| _${s.snapshot}?_ | ${derived.map((p) => `_${basisLabel(p.basis, lang)}_`).join(" | ")} |`);
60287
60308
  let group = "";
60309
+ let humanRuled = false;
60288
60310
  for (const row of rows) {
60289
60311
  if (row.group !== group) {
60290
60312
  group = row.group;
60291
60313
  out2.push(`| **${group}** | ${derived.map(() => "").join(" | ")} |`);
60292
60314
  }
60293
- const cells = derived.map((p) => MARK[status.get(row.id)?.get(p.id) ?? "manual"]);
60315
+ const cells = derived.map((p) => {
60316
+ const st = status.get(row.id)?.get(p.id) ?? "manual";
60317
+ const mark = human.has(`${row.id}|${p.id}`) ? ruledMark("human", st) : "";
60318
+ if (mark) humanRuled = true;
60319
+ return `${MARK[st]}${mark}`;
60320
+ });
60294
60321
  out2.push(`| ${row.label} | ${cells.join(" | ")} |`);
60295
60322
  }
60296
60323
  out2.push("");
60324
+ if (humanRuled) out2.push(`> ${humanMarkNote(lang)}`, "");
60297
60325
  const orphans = unattributedFindings(result);
60298
60326
  if (orphans.length) out2.push(`> ${s.unattributed(orphans.length)}`, "");
60299
60327
  return out2.join("\n");
@@ -61211,12 +61239,13 @@ function renderPageReport(result, page, opts = {}) {
61211
61239
  group = row.group;
61212
61240
  out2.push(withTests ? `| **${group}** | | |` : `| **${group}** | |`);
61213
61241
  }
61214
- const mark = row.decidedBy === "agent" && row.status === "C" ? `${MARK2[row.status]}*` : MARK2[row.status];
61242
+ const mark = `${MARK2[row.status]}${ruledMark(row.decidedBy, row.status)}`;
61215
61243
  if (withTests) out2.push(`| ${row.label} | ${row.tests.map((t4) => `\`${t4}\``).join(" ")} | ${mark} |`);
61216
61244
  else out2.push(`| ${row.label} | ${mark} |`);
61217
61245
  }
61218
61246
  out2.push("", `> ${s.manualWarn}`, "");
61219
61247
  if (rows.some((r) => r.decidedBy === "agent" && r.status === "C")) out2.push(`> ${agentMarkNote(lang)}`, "");
61248
+ if (rows.some((r) => r.decidedBy === "human" && r.status === "C")) out2.push(`> ${humanMarkNote(lang)}`, "");
61220
61249
  const units = prdUnits(pageView(result, page), standard, lang);
61221
61250
  const ncUnits = units.filter((u) => !u.advisory);
61222
61251
  const advUnits = units.filter((u) => u.advisory);
@@ -61319,7 +61348,7 @@ var L5 = {
61319
61348
  decidedLine: "D\xE9cid\xE9s",
61320
61349
  decidedNote: (c2, nc, na, open) => `${c2} conforme(s), ${nc} non conforme(s), ${na} conforme(s) faute de sujet, ${open} \xE0 \xE9valuer`,
61321
61350
  provenance: "Provenance des d\xE9cisions",
61322
- provenanceNote: (engine, scan2, agent) => `${engine} moteur \xB7 ${scan2} navigateur \xB7 ${agent} adjudication`,
61351
+ provenanceNote: (engine, scan2, agent, human = 0) => `${engine} moteur \xB7 ${scan2} navigateur \xB7 ${agent} adjudication${human ? ` \xB7 ${human} auditeur humain` : ""}`,
61323
61352
  autoRateNote: (c2, d) => `crit\xE8res valid\xE9s par le moteur seul \xF7 crit\xE8res d\xE9cid\xE9s sans l'agent (${c2} \xF7 ${d})`,
61324
61353
  warn: "Ce rapport couvre le sous-ensemble de crit\xE8res v\xE9rifiables automatiquement. Les crit\xE8res \xAB \xE0 \xE9valuer \xBB (rendu / jugement) sont adjug\xE9s par l'agent IA (`verify --manual`, de fa\xE7on gat\xE9e) ; le rendu passe par `scan` (voir la section 5).",
61325
61354
  derived: (std) => `Rapport ${std}. Chaque crit\xE8re est jug\xE9 sur ses propres tests ; la v\xE9rification d'int\xE9grit\xE9 (\`check\`/\`verify\`) op\xE8re sur le m\xEAme p\xE9rim\xE8tre.`,
@@ -61338,6 +61367,8 @@ var L5 = {
61338
61367
  cTitle: "3. Crit\xE8res conformes (C)",
61339
61368
  cAgentTitle: "Conformes par adjudication de l'agent (jugement, non prouv\xE9 par le moteur)",
61340
61369
  cAgentNote: "Ces crit\xE8res ont \xE9t\xE9 tranch\xE9s par l'agent IA \xE0 partir des \xE9vidences cit\xE9es, non d\xE9cid\xE9s par le moteur d\xE9terministe. Ils sont gat\xE9s (chaque verdict cite une \xE9vidence r\xE9solvable) mais restent un jugement : ils ne sont pas compt\xE9s dans le taux de r\xE9ussite automatique ci-dessus.",
61370
+ cHumanTitle: "Conformes par d\xE9cision de l'auditeur (jugement humain, non prouv\xE9 par le moteur)",
61371
+ cHumanNote: "Ces crit\xE8res ont \xE9t\xE9 tranch\xE9s par un auditeur humain nomm\xE9, \xE0 partir des \xE9vidences cit\xE9es et sous le m\xEAme gate que l'agent (chaque verdict cite une \xE9vidence r\xE9solvable). L'auditeur est le second lecteur : ces verdicts ne passent pas par la contre-expertise automatique (`verify --report`), et ne sont pas compt\xE9s dans le taux de r\xE9ussite automatique.",
61341
61372
  pageRatesTitle: "Taux par page",
61342
61373
  pageRatesNote: "Une ligne par page : la base sur laquelle elle a \xE9t\xE9 jug\xE9e, et son taux avec le d\xE9nominateur sur lequel il est calcul\xE9.",
61343
61374
  pageCol: "Page",
@@ -61400,7 +61431,7 @@ var L5 = {
61400
61431
  statusCol: "Statut",
61401
61432
  automationCol: "Tests S / R / J",
61402
61433
  decidedByCol: "D\xE9cid\xE9 par",
61403
- owner: { engine: "moteur", scan: "scan", agent: "IA", pending: "\xE0 adjuger" },
61434
+ owner: { engine: "moteur", scan: "scan", agent: "IA", human: "auditeur", pending: "\xE0 adjuger" },
61404
61435
  // THE SUMMARY — what a reader who stops after one screen must take away: the level, what to
61405
61436
  // fix, and what separates the site from the next level.
61406
61437
  methodTitle: "M\xE9thode, couverture et avertissements",
@@ -61523,7 +61554,7 @@ var L5 = {
61523
61554
  decidedLine: "Decided",
61524
61555
  decidedNote: (c2, nc, na, open) => `${c2} conforming, ${nc} non-conforming, ${na} conforming for want of a subject, ${open} to assess`,
61525
61556
  provenance: "Where the decisions came from",
61526
- provenanceNote: (engine, scan2, agent) => `${engine} engine \xB7 ${scan2} browser \xB7 ${agent} adjudication`,
61557
+ provenanceNote: (engine, scan2, agent, human = 0) => `${engine} engine \xB7 ${scan2} browser \xB7 ${agent} adjudication${human ? ` \xB7 ${human} human auditor` : ""}`,
61527
61558
  autoRateNote: (c2, d) => `criteria validated by the engine alone \xF7 criteria decided without the agent (${c2} \xF7 ${d})`,
61528
61559
  warn: "This report covers the subset of criteria checkable automatically. The \u201Cto assess\u201D criteria (rendering / judgment) are adjudicated by the AI agent (`verify --manual`, gated); rendering goes through `scan` (see section 5).",
61529
61560
  derived: (std) => `${std} report. Every criterion is judged on its own tests; the integrity gates (\`check\`/\`verify\`) operate on the same scope.`,
@@ -61542,6 +61573,8 @@ var L5 = {
61542
61573
  cTitle: "3. Conforming criteria (C)",
61543
61574
  cAgentTitle: "Conforming by agent adjudication (judgement, not proven by the engine)",
61544
61575
  cAgentNote: "These criteria were ruled on by the AI agent from the evidence it cited, not decided by the deterministic engine. They are gated (every verdict cites resolvable evidence) but remain a judgement: they are not counted in the automatic pass rate above.",
61576
+ cHumanTitle: "Conforming by auditor decision (human judgement, not proven by the engine)",
61577
+ cHumanNote: "These criteria were ruled on by a named human auditor from the evidence they cited, under the agent's gate (every verdict cites resolvable evidence). The auditor is the second reader: these verdicts are not sent to the automatic refutation trial (`verify --report`), and are not counted in the automatic pass rate.",
61545
61578
  pageRatesTitle: "Per-page rate",
61546
61579
  pageRatesNote: "One row per page: the basis it was judged on, and its rate with the denominator it was computed over.",
61547
61580
  pageCol: "Page",
@@ -61597,7 +61630,7 @@ var L5 = {
61597
61630
  statusCol: "Status",
61598
61631
  automationCol: "S / R / J tests",
61599
61632
  decidedByCol: "Decided by",
61600
- owner: { engine: "engine", scan: "scan", agent: "AI", pending: "to adjudicate" },
61633
+ owner: { engine: "engine", scan: "scan", agent: "AI", human: "auditor", pending: "to adjudicate" },
61601
61634
  methodTitle: "Method, coverage and caveats",
61602
61635
  conformanceShort: (v, a) => `validated criteria \xF7 applicable criteria (${v} \xF7 ${a})`,
61603
61636
  denominatorLine: "How the rate is computed",
@@ -61711,7 +61744,7 @@ function untestedNeedsRendering(r, established = /* @__PURE__ */ new Set()) {
61711
61744
  function establishedScs(derived) {
61712
61745
  const out2 = /* @__PURE__ */ new Set();
61713
61746
  for (const d of derived) {
61714
- if (d.status !== "NC" && d.decidedBy !== "agent") continue;
61747
+ if (d.status !== "NC" && !isAdjudicated(d.decidedBy)) continue;
61715
61748
  const carried = new Set(d.findings.map((f) => f.criteriaId).filter((id) => d.scs.includes(id)));
61716
61749
  if (carried.size === 0 && d.scs.length === 1) carried.add(d.scs[0]);
61717
61750
  for (const sc of carried) out2.add(sc);
@@ -61793,9 +61826,17 @@ function decisionProvenance(rows) {
61793
61826
  return {
61794
61827
  engine: decided.filter((r) => !r.decidedBy || r.decidedBy === "engine").length,
61795
61828
  scan: decided.filter((r) => r.decidedBy === "scan").length,
61796
- agent: decided.filter((r) => r.decidedBy === "agent").length
61829
+ agent: decided.filter((r) => r.decidedBy === "agent").length,
61830
+ human: decided.filter((r) => r.decidedBy === "human").length
61797
61831
  };
61798
61832
  }
61833
+ function ownerLabel(row, owner) {
61834
+ if (row.status === "manual") return owner.pending;
61835
+ const by = row.decidedBy ?? "engine";
61836
+ if (by !== "human" || !row.auditor) return owner[by];
61837
+ const who = [row.auditor.name, row.auditor.organisation].filter(Boolean).join(", ");
61838
+ return `${owner.human} (${who})`;
61839
+ }
61799
61840
  function conformityScale(standard, lang) {
61800
61841
  if (isCore(standard)) return [];
61801
61842
  const pack = loadPack(standard);
@@ -61866,7 +61907,7 @@ function exhaustiveGrid(groups, standard, lang, title) {
61866
61907
  "| --- | :---: | :---: | --- |"
61867
61908
  ];
61868
61909
  for (const row of rows) {
61869
- const owner = row.status === "manual" ? s.owner.pending : s.owner[row.decidedBy ?? "engine"];
61910
+ const owner = cell(ownerLabel(row, s.owner));
61870
61911
  out2.push(`| ${row.label} | ${row.inapplicable ? "NA" : row.status === "manual" ? "?" : row.status} | ${automationCell(standard, row.id)} | ${owner} |`);
61871
61912
  }
61872
61913
  out2.push("", "</details>", "");
@@ -62254,8 +62295,9 @@ function render(r, lang, opts) {
62254
62295
  }
62255
62296
  out2.push('<a id="conforming"></a>', `## ${s.cTitle}`, "");
62256
62297
  const conform = rows.filter((x) => x.status === "C" && !x.inapplicable);
62257
- const byEngine = conform.filter((x) => x.decidedBy !== "agent");
62298
+ const byEngine = conform.filter((x) => !isAdjudicated(x.decidedBy));
62258
62299
  const byAgent = conform.filter((x) => x.decidedBy === "agent");
62300
+ const byHuman = conform.filter((x) => x.decidedBy === "human");
62259
62301
  if (!conform.length) out2.push(s.nothing, "");
62260
62302
  else {
62261
62303
  if (byEngine.length)
@@ -62274,6 +62316,15 @@ function render(r, lang, opts) {
62274
62316
  )
62275
62317
  );
62276
62318
  }
62319
+ if (byHuman.length) {
62320
+ out2.push(`### ${s.cHumanTitle}`, "", `> ${s.cHumanNote}`, "");
62321
+ out2.push(
62322
+ ...folded(
62323
+ s.showCriteria(byHuman.length),
62324
+ byHuman.map((x) => `- ${x.label} \u2014 ${mdText(ownerLabel(x, s.owner))}${x.justification ? ` \u2014 _${x.justification}_` : ""}`)
62325
+ )
62326
+ );
62327
+ }
62277
62328
  }
62278
62329
  out2.push('<a id="not-applicable"></a>', `## ${s.naTitle}`, "");
62279
62330
  const na = rows.filter((x) => x.status === "C" && x.inapplicable);
@@ -62316,7 +62367,7 @@ function render(r, lang, opts) {
62316
62367
  ax.push(
62317
62368
  `- **${s.decidedLine}** : ${rate.decided}/${rate.total} \u2014 ${s.decidedNote(rate.validated, rate.total - rate.validated - rate.na - rate.open, rate.na, rate.open)}`
62318
62369
  );
62319
- ax.push(`- **${s.provenance}** : ${s.provenanceNote(provenance.engine, provenance.scan, provenance.agent)}`);
62370
+ ax.push(`- **${s.provenance}** : ${s.provenanceNote(provenance.engine, provenance.scan, provenance.agent, provenance.human)}`);
62320
62371
  ax.push(`- **${s.rate}** : ${opts.headerRatePct ?? r.conformancePct}% \u2014 ${s.autoRateNote(autoValidated, autoDecided)}`);
62321
62372
  }
62322
62373
  ax.push(`- **${s.renderedPages(pagesRead)}**${pagesRead === 0 ? ` \u2014 ${s.noRenderedPages}` : ""}`);
@@ -62429,6 +62480,7 @@ function reportGroups(r, lang = "en") {
62429
62480
  findings: c2.findings,
62430
62481
  justification: c2.justification,
62431
62482
  decidedBy: c2.decidedBy,
62483
+ ...c2.auditor ? { auditor: c2.auditor } : {},
62432
62484
  ...c2.inapplicable ? { inapplicable: true } : {}
62433
62485
  };
62434
62486
  (byGuideline.get(c2.guideline) ?? byGuideline.set(c2.guideline, []).get(c2.guideline)).push(row);
@@ -62456,6 +62508,7 @@ function packReportGroups(r, pack, lang = "en") {
62456
62508
  status: provisionalNa ? "manual" : pr.status,
62457
62509
  findings: pr.findings,
62458
62510
  ...pr.decidedBy ? { decidedBy: pr.decidedBy } : {},
62511
+ ...pr.auditor ? { auditor: pr.auditor } : {},
62459
62512
  ...pr.inapplicable && !provisionalNa ? { inapplicable: true } : {},
62460
62513
  // outOfScope / scopedOut criteria are "manual" with their own dedicated justification —
62461
62514
  // never mixed with the "nothing of that kind here" reason (see the manual section above).
@@ -62475,7 +62528,7 @@ function renderPackReportDocuments(r, pack, lang = "en", outDir, cropFor) {
62475
62528
  const groups = packReportGroups(r, pack, lang);
62476
62529
  const rows = groups.flatMap((g) => g.rows);
62477
62530
  const tally = reportTotals(groups);
62478
- const autoValidated = derived.filter((d) => d.status === "C" && d.decidedBy !== "agent" && !isProvisionalJudgmentInapplicable(d)).length;
62531
+ const autoValidated = derived.filter((d) => d.status === "C" && !isAdjudicated(d.decidedBy) && !isProvisionalJudgmentInapplicable(d)).length;
62479
62532
  const autoDecided = autoValidated + derived.filter((d) => d.status === "NC").length;
62480
62533
  return render(r, lang, {
62481
62534
  std,
@@ -64435,7 +64488,8 @@ function agentConformities(md) {
64435
64488
  for (const line of md.split("\n")) {
64436
64489
  if (!line.startsWith("|")) continue;
64437
64490
  const cells = line.slice(1, line.endsWith("|") ? -1 : void 0).split("|").map((cell3) => cell3.trim());
64438
- if (cells.length === 4 && (cells[1] === "C" || cells[1] === "NA") && (cells[3] === "AI" || cells[3] === "IA")) count++;
64491
+ if (cells.length === 4 && (cells[1] === "C" || cells[1] === "NA") && (cells[3] === "AI" || cells[3] === "IA" || /^audit(?:eur|or)\b/.test(cells[3])))
64492
+ count++;
64439
64493
  }
64440
64494
  return count;
64441
64495
  }
@@ -64590,6 +64644,7 @@ function checkDecided(audit2, standard = CORE2, lang = "en", opts = {}) {
64590
64644
  engine: settled.filter((r) => r.decidedBy === void 0 || r.decidedBy === "engine").length,
64591
64645
  scan: settled.filter((r) => r.decidedBy === "scan").length,
64592
64646
  agent: settled.filter((r) => r.decidedBy === "agent").length,
64647
+ human: settled.filter((r) => r.decidedBy === "human").length,
64593
64648
  declared: allowed.length,
64594
64649
  undecided: undecided.length
64595
64650
  };
@@ -65452,7 +65507,8 @@ function adjudicationContract() {
65452
65507
  C: "a non-empty justification AND citations[] naming the harvested evidence it cleared (each anchor resolvable and drawn from this criterion's own evidence, and about the same kind of element the harvest recorded there \u2014 copy the evidence's own `snippet` rather than retyping the element); a criterion with no harvested evidence cannot be C at all",
65453
65508
  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",
65454
65509
  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",
65455
- manual: `a reason \u2208 {${MANUAL_REASON_VALUES.join(", ")}}`
65510
+ manual: `a reason \u2208 {${MANUAL_REASON_VALUES.join(", ")}}`,
65511
+ 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`
65456
65512
  }
65457
65513
  };
65458
65514
  }
@@ -65933,6 +65989,12 @@ function applyAdjudication(audit2, adj, opts = {}) {
65933
65989
  };
65934
65990
  for (const it of adj.items) {
65935
65991
  if (!open.has(it.criteriaId)) continue;
65992
+ const by = it.decidedBy;
65993
+ if (by !== void 0 && by !== "agent" && by !== "human") {
65994
+ blame(it.criteriaId, `criterion ${it.criteriaId}: decidedBy must be "agent" or "human" (got ${JSON.stringify(by)})`);
65995
+ } else if (by === "human" && !auditorOf(it)) {
65996
+ blame(it.criteriaId, `criterion ${it.criteriaId}: a decidedBy "human" verdict must name its auditor \u2014 auditor: { name, organisation? }`);
65997
+ }
65936
65998
  const v = it.verdict;
65937
65999
  if (v === null) {
65938
66000
  blame(it.criteriaId, `criterion ${it.criteriaId}: unadjudicated (verdict is null)`);
@@ -66100,7 +66162,7 @@ function applyAdjudication(audit2, adj, opts = {}) {
66100
66162
  reason: it.reason === "needs-rendered-dom" ? "needs-rendered-dom" : "undecidable",
66101
66163
  justification: it.reason === "needs-rendered-dom" ? residualScanReason() : residualUndecidableReason(),
66102
66164
  findings: [],
66103
- decidedBy: "agent"
66165
+ ...ruledBy(it)
66104
66166
  });
66105
66167
  continue;
66106
66168
  }
@@ -66113,7 +66175,7 @@ function applyAdjudication(audit2, adj, opts = {}) {
66113
66175
  status: it.verdict,
66114
66176
  ...it.verdict === "C" || it.verdict === "NA" ? { justification: it.justification.trim(), ...citationsOf(it) } : {},
66115
66177
  findings: [...fs2, ...recs],
66116
- decidedBy: "agent"
66178
+ ...ruledBy(it)
66117
66179
  });
66118
66180
  }
66119
66181
  const alreadyDecided = new Set(
@@ -66140,14 +66202,14 @@ function applyAdjudication(audit2, adj, opts = {}) {
66140
66202
  if (rejectedSet.has(it.criteriaId)) continue;
66141
66203
  if (it.verdict === "manual") {
66142
66204
  c2.status = "manual";
66143
- c2.decidedBy = "agent";
66205
+ stampRuledBy(c2, it);
66144
66206
  c2.justification = it.reason === "needs-rendered-dom" ? residualScanReason() : residualUndecidableReason();
66145
66207
  stillManual++;
66146
66208
  continue;
66147
66209
  }
66148
66210
  applied++;
66149
66211
  c2.status = it.verdict === "NA" ? INAPPLICABLE_STATUS : it.verdict;
66150
- c2.decidedBy = "agent";
66212
+ stampRuledBy(c2, it);
66151
66213
  delete c2.inapplicable;
66152
66214
  if (it.verdict === "C" || it.verdict === "NA") {
66153
66215
  c2.justification = it.justification.trim();
@@ -66191,6 +66253,23 @@ function citationsOf(it) {
66191
66253
  const cites = (it.citations ?? []).map((c2) => typeof c2 === "string" ? readCitation(c2) : c2).filter((c2) => c2 !== null && c2 !== void 0).map(({ file, line, selector, snippet: snippet2, note }) => ({ file, line, selector, snippet: snippet2, ...note ? { note } : {} }));
66192
66254
  return cites.length ? { citations: cites } : {};
66193
66255
  }
66256
+ function auditorOf(it) {
66257
+ const a = it.auditor;
66258
+ const name2 = typeof a?.name === "string" ? a.name.trim() : "";
66259
+ if (!name2) return void 0;
66260
+ const organisation = typeof a?.organisation === "string" ? a.organisation.trim() : "";
66261
+ return { name: name2, ...organisation ? { organisation } : {} };
66262
+ }
66263
+ function ruledBy(it) {
66264
+ const auditor = it.decidedBy === "human" ? auditorOf(it) : void 0;
66265
+ return auditor ? { decidedBy: "human", auditor } : { decidedBy: "agent" };
66266
+ }
66267
+ function stampRuledBy(c2, it) {
66268
+ const r = ruledBy(it);
66269
+ c2.decidedBy = r.decidedBy;
66270
+ if (r.auditor) c2.auditor = r.auditor;
66271
+ else delete c2.auditor;
66272
+ }
66194
66273
  function agentFinding(criteriaId, f, advisory = false) {
66195
66274
  return {
66196
66275
  ruleId: `agent:${criteriaId}`,
@@ -66219,7 +66298,7 @@ function recomputeTallies(a) {
66219
66298
  g.na = inG.filter((c2) => c2.status === "NA").length;
66220
66299
  g.manual = inG.filter((c2) => c2.status === "manual").length;
66221
66300
  }
66222
- const decided = a.criteria.filter((c2) => c2.status === "NC" || c2.status === "C" && c2.decidedBy !== "agent");
66301
+ const decided = a.criteria.filter((c2) => c2.status === "NC" || c2.status === "C" && !isAdjudicated(c2.decidedBy));
66223
66302
  const conform = decided.filter((c2) => c2.status === "C").length;
66224
66303
  a.conformancePct = decided.length === 0 ? 100 : Math.round(conform / decided.length * 100);
66225
66304
  }
@@ -66638,8 +66717,10 @@ function pruneRefuted(audit2, standard, items, lang = "en", untried = []) {
66638
66717
  let removedFindings = 0;
66639
66718
  const deleted = /* @__PURE__ */ new Set();
66640
66719
  const acted = /* @__PURE__ */ new Set();
66720
+ const human = /* @__PURE__ */ new Set();
66641
66721
  const prune = (rec, setOpen) => {
66642
66722
  const isAgent = rec.decidedBy === "agent";
66723
+ if (rec.decidedBy === "human") human.add(rec.id);
66643
66724
  const drop = removedNc.get(rec.id);
66644
66725
  if (drop?.size) {
66645
66726
  if (isAgent) {
@@ -66691,11 +66772,23 @@ function pruneRefuted(audit2, standard, items, lang = "en", untried = []) {
66691
66772
  });
66692
66773
  }
66693
66774
  }
66694
- const skippedEngineClaims = withdrawn.filter((it) => !acted.has(it.criteriaId));
66775
+ const skippedHumanClaims = withdrawn.filter((it) => human.has(it.criteriaId));
66776
+ const skippedHuman = skippedHumanClaims.length;
66777
+ const skippedEngineClaims = withdrawn.filter((it) => !acted.has(it.criteriaId) && !human.has(it.criteriaId));
66695
66778
  const skippedEngine = skippedEngineClaims.length;
66696
66779
  if (deleted.size) next.findings = next.findings.filter((f) => !deleted.has(`${f.criteriaId}|${findingKey(f)}`));
66697
66780
  if (isCore(standard)) recomputeTallies(next);
66698
- return { audit: next, removedFindings, reopenedCriteria, clearedConformities, untriedConformities, skippedEngine, skippedEngineClaims };
66781
+ return {
66782
+ audit: next,
66783
+ removedFindings,
66784
+ reopenedCriteria,
66785
+ clearedConformities,
66786
+ untriedConformities,
66787
+ skippedEngine,
66788
+ skippedEngineClaims,
66789
+ skippedHuman,
66790
+ skippedHumanClaims
66791
+ };
66699
66792
  }
66700
66793
 
66701
66794
  // src/ledger.ts
@@ -66851,11 +66944,15 @@ function entriesFrom(adj, accepted, date, root) {
66851
66944
  evidenceFiles: evidenceFilesOf(it.evidence, root),
66852
66945
  evidenceCount: it.evidence.length,
66853
66946
  date,
66854
- decidedBy: "agent"
66947
+ ...whoRuled(it)
66855
66948
  });
66856
66949
  }
66857
66950
  return out2;
66858
66951
  }
66952
+ function whoRuled(x) {
66953
+ const auditor = x.decidedBy === "human" ? auditorOf(x) : void 0;
66954
+ return auditor ? { decidedBy: "human", auditor } : { decidedBy: "agent" };
66955
+ }
66859
66956
  function mergeLedger(existing, standard, fresh) {
66860
66957
  const base = existing && existing.standard === standard ? existing : emptyLedger(standard);
66861
66958
  const byId2 = new Map(base.entries.map((e) => [e.criteriaId, e]));
@@ -66946,7 +67043,8 @@ function replayLedger(audit2, ledger, opts = {}) {
66946
67043
  findings: reanchor(e.findings, it.evidence, currentFiles, root) ?? [],
66947
67044
  ...e.citations ? { citations: reanchor(e.citations, it.evidence, currentFiles, root) ?? [] } : {},
66948
67045
  ...e.recommendations ? { recommendations: reanchor(e.recommendations, it.evidence, currentFiles, root) ?? [] } : {},
66949
- decidedBy: "agent"
67046
+ // Who ruled travels with the decision; the fold re-checks the auditor's name.
67047
+ ...whoRuled(e)
66950
67048
  });
66951
67049
  }
66952
67050
  return {
@@ -68438,7 +68536,7 @@ function recomputeTallies2(merged) {
68438
68536
  manual: inG.filter((c2) => c2.status === "manual").length
68439
68537
  };
68440
68538
  });
68441
- const decided = merged.criteria.filter((c2) => c2.status === "NC" || c2.status === "C" && c2.decidedBy !== "agent");
68539
+ const decided = merged.criteria.filter((c2) => c2.status === "NC" || c2.status === "C" && !isAdjudicated(c2.decidedBy));
68442
68540
  const conform = decided.filter((c2) => c2.status === "C").length;
68443
68541
  merged.conformancePct = decided.length === 0 ? 100 : Math.round(conform / decided.length * 100);
68444
68542
  merged.findings.sort((a, b) => sevRank[b.severity] - sevRank[a.severity]);
@@ -70407,6 +70505,7 @@ function packAuditDocument(input, packKey, lang) {
70407
70505
  findings: d.findings.map((f) => packFinding(f, [d.id])),
70408
70506
  ...provisionalNa ? { justification: provisionalNaReason } : d.justification ? { justification: d.justification } : {},
70409
70507
  ...d.decidedBy && !provisionalNa ? { decidedBy: d.decidedBy } : {},
70508
+ ...d.auditor && !provisionalNa ? { auditor: d.auditor } : {},
70410
70509
  ...d.inapplicable && !provisionalNa ? { inapplicable: true } : {},
70411
70510
  ...pc?.automation ? { automation: pc.automation } : {}
70412
70511
  };
@@ -70714,7 +70813,7 @@ var S = {
70714
70813
  files: "fichiers",
70715
70814
  coverage: (decided, total) => `${decided}/${total} crit\xE8res tranch\xE9s dans ce run`,
70716
70815
  remaining: (n) => `${n} \xE0 compl\xE9ter par scan ou adjudication`,
70717
- provenance: { engine: "moteur", scan: "scan", agent: "agent" },
70816
+ provenance: { engine: "moteur", scan: "scan", agent: "agent", human: "auditeur" },
70718
70817
  none: "\u2705 Aucune non-conformit\xE9 d\xE9tect\xE9e par le moteur statique.",
70719
70818
  findings: "Non-conformit\xE9s",
70720
70819
  severity: "S\xE9v\xE9rit\xE9",
@@ -70792,7 +70891,7 @@ var S = {
70792
70891
  files: "files",
70793
70892
  coverage: (decided, total) => `${decided}/${total} criteria decided in this run`,
70794
70893
  remaining: (n) => `${n} still to complete by scan or adjudication`,
70795
- provenance: { engine: "engine", scan: "scan", agent: "agent" },
70894
+ provenance: { engine: "engine", scan: "scan", agent: "agent", human: "auditor" },
70796
70895
  none: "\u2705 No non-conformity detected by the static engine.",
70797
70896
  findings: "Non-conformities",
70798
70897
  severity: "Severity",
@@ -70929,10 +71028,11 @@ function runCoverage(result, standard, lang) {
70929
71028
  const by = {
70930
71029
  engine: decidedRows.filter((r) => !r.decidedBy || r.decidedBy === "engine").length,
70931
71030
  scan: decidedRows.filter((r) => r.decidedBy === "scan").length,
70932
- agent: decidedRows.filter((r) => r.decidedBy === "agent").length
71031
+ agent: decidedRows.filter((r) => r.decidedBy === "agent").length,
71032
+ human: decidedRows.filter((r) => r.decidedBy === "human").length
70933
71033
  };
70934
71034
  const s = S[lang];
70935
- const provenance = ["engine", "scan", "agent"].filter((key2) => by[key2] > 0).map((key2) => `${by[key2]} ${s.provenance[key2]}`);
71035
+ const provenance = ["engine", "scan", "agent", "human"].filter((key2) => by[key2] > 0).map((key2) => `${by[key2]} ${s.provenance[key2]}`);
70936
71036
  const remaining = Math.max(0, total - decided);
70937
71037
  const agentRuled = groups.some((g) => g.rows.some((r) => r.decidedBy === "agent" && r.status === "C"));
70938
71038
  return {
@@ -71783,7 +71883,7 @@ var T4 = {
71783
71883
  exhaustiveCaption: "Une ligne par crit\xE8re ; S/R/J indique le nombre de tests static, rendered et judgment.",
71784
71884
  automationCol: "Tests S / R / J",
71785
71885
  decidedBy: "D\xE9cid\xE9 par",
71786
- owner: { engine: "moteur", scan: "scan", agent: "IA", pending: "\xE0 adjuger" }
71886
+ owner: { engine: "moteur", scan: "scan", agent: "IA", human: "auditeur", pending: "\xE0 adjuger" }
71787
71887
  },
71788
71888
  en: {
71789
71889
  contents: "Contents",
@@ -71844,7 +71944,7 @@ var T4 = {
71844
71944
  exhaustiveCaption: "One row per criterion; S/R/J is the number of static, rendered and judgment tests.",
71845
71945
  automationCol: "S / R / J tests",
71846
71946
  decidedBy: "Decided by",
71847
- owner: { engine: "engine", scan: "scan", agent: "AI", pending: "to adjudicate" }
71947
+ owner: { engine: "engine", scan: "scan", agent: "AI", human: "auditor", pending: "to adjudicate" }
71848
71948
  }
71849
71949
  };
71850
71950
  function ticks(text) {
@@ -72056,7 +72156,7 @@ function criteriaGridBlocks(result, standard, lang) {
72056
72156
  const tiers = Object.values(criterion?.automation?.tests ?? {});
72057
72157
  const n = (tier) => tiers.filter((value) => value === tier).length;
72058
72158
  const status = row.inapplicable ? "NA" : row.status;
72059
- const owner = row.status === "manual" ? t3.owner.pending : t3.owner[row.decidedBy ?? "engine"];
72159
+ const owner = ownerLabel(row, t3.owner);
72060
72160
  rows.push([
72061
72161
  { text: pack && criterion ? `${pack.name} ${row.id} \u2014 ${titlePlain(pack, criterion, lang)}` : row.label },
72062
72162
  { status, text: "" },
@@ -72147,7 +72247,7 @@ function pageGridBlocks(result, page, standard, lang) {
72147
72247
  group = row.group;
72148
72248
  table.rows.push([{ text: group, colspan: 2 }]);
72149
72249
  }
72150
- table.rows.push([{ text: row.label }, { status: row.status, text: row.decidedBy === "agent" && row.status === "C" ? "*" : "" }]);
72250
+ table.rows.push([{ text: row.label }, { status: row.status, text: ruledMark(row.decidedBy, row.status) }]);
72151
72251
  }
72152
72252
  const out2 = [
72153
72253
  { kind: "heading", level: 2, text: t3.grid },
@@ -72163,6 +72263,7 @@ function pageGridBlocks(result, page, standard, lang) {
72163
72263
  table
72164
72264
  ];
72165
72265
  if (rows.some((r) => r.decidedBy === "agent" && r.status === "C")) out2.push({ kind: "note", tone: "warn", runs: ticks(agentMarkNote(lang)) });
72266
+ if (rows.some((r) => r.decidedBy === "human" && r.status === "C")) out2.push({ kind: "note", tone: "info", runs: ticks(humanMarkNote(lang)) });
72166
72267
  return out2;
72167
72268
  }
72168
72269
  function indexDoc(result, opts = {}) {
@@ -72689,11 +72790,12 @@ function foldRecordedAdjudication(root, fresh) {
72689
72790
  if (prior.adjudicated) fresh.adjudicated = prior.adjudicated;
72690
72791
  const byId2 = new Map(fresh.criteria.map((c2) => [c2.id, c2]));
72691
72792
  for (const c2 of prior.criteria) {
72692
- if (c2.decidedBy !== "agent") continue;
72793
+ if (c2.decidedBy !== "agent" && c2.decidedBy !== "human") continue;
72693
72794
  const target = byId2.get(c2.id);
72694
72795
  if (target?.status !== "manual") continue;
72695
72796
  target.status = c2.status;
72696
- target.decidedBy = "agent";
72797
+ target.decidedBy = c2.decidedBy;
72798
+ if (c2.auditor) target.auditor = c2.auditor;
72697
72799
  if (c2.justification) target.justification = c2.justification;
72698
72800
  }
72699
72801
  fresh.residualRisks = fresh.residualRisks.filter((r) => byId2.get(r.criteriaId)?.status === "manual");
@@ -73351,13 +73453,11 @@ Return (structured output): \`{ "verdicts": [{ "n", "verdict", "note" }] }\` \u2
73351
73453
  ${footer}`
73352
73454
  };
73353
73455
  }
73354
- function runbookMd(phases, runAbs, engineAbs, unrendered = [], verify = { report: "<report.md>", flags: `--in ${join49(runAbs, "audit-latest.json")}` }) {
73456
+ function runbookMd(manifest, unrendered = []) {
73457
+ const { phases, run: runAbs } = manifest;
73355
73458
  const status = phases.map((p) => `| ${p.name} | \`${p.worklist}\` | ${p.ready ? `ready (${p.items} item(s))` : "not ready"} | \`${p.prerequisite}\` |`).join("\n");
73356
- const engine = `node ${engineAbs}`;
73357
- const vr = phases.find((p) => p.name === "verify-report");
73358
- const verifyGen = vr?.prerequisite ?? `${engine} verify --report ${verify.report} ${verify.flags} --out ${runAbs}`;
73359
- const verifyApply = vr?.apply ?? `${engine} verify --apply ${join49(runAbs, "VERIFY.todo.json")} --report ${verify.report} ${verify.flags}`;
73360
- const std = verify.standard ? ` --standard ${verify.standard}` : "";
73459
+ const engine = `node ${manifest.engine}`;
73460
+ const cmd = (id) => manifest.steps.find((st) => st.id === id)?.command ?? "";
73361
73461
  const renderFirst = unrendered.length ? `
73362
73462
  > \u26A0\uFE0F **Render before you adjudicate.** ${unrendered.length} criterion(ia) in this run need a rendered page and
73363
73463
  > nothing has been snapshotted: no reading of the source can settle them, and every pass over them
@@ -73388,12 +73488,12 @@ ${status}
73388
73488
 
73389
73489
  ## The loop (play every role yourself, one item at a time)
73390
73490
 
73391
- 1. **Audit** (if not done): \`${engine} audit "<globs>" --graph --out ${runAbs}\` \u2192 \`${join49(runAbs, "audit-latest.json")}\`.
73392
- 2. **Adjudicate the residual criteria** \u2014 \`${engine} verify --manual --in ${join49(runAbs, "audit-latest.json")} --out ${runAbs}\` writes \`${join49(runAbs, "ADJUDICATE.todo.json")}\`. For EVERY item, apply \`${join49(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: \`${engine} verify --apply ${join49(runAbs, "ADJUDICATE.todo.json")} --in ${join49(runAbs, "audit-latest.json")} --out ${runAbs}\`. 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.
73393
- 3. **Report**: \`${engine} report --in ${join49(runAbs, "audit-latest.json")} --out ${runAbs}\`.
73394
- 4. **Verify the report's claims** \u2014 \`${verifyGen}\` writes \`${join49(runAbs, "VERIFY.todo.json")}\` (and \`${join49(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 \`${join49(runAbs, "orchestration", "agents", "refuter.md")}\` yourself (open file:line, verdict supported/partial/refuted/unsupported + note IN the todo file). Then: \`${verifyApply}\`. 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.
73395
- 5. **Gate**: \`${engine} check --report ${verify.report}${std} --semantic --verdicts ${join49(runAbs, "VERIFY.todo.json")}\` must exit 0 before presenting anything.
73396
- 6. **Fix & re-audit**: \`${engine} fix <globs> --write --iterate\`, hand-apply the judgment fixes, then loop from step 1 until the gate stays green.
73491
+ 1. **Audit** (if not done): \`${cmd("audit")}\` \u2192 \`${join49(runAbs, "audit-latest.json")}\`.
73492
+ 2. **Adjudicate the residual criteria** \u2014 \`${cmd("adjudicate-worklist")}\` writes \`${join49(runAbs, "ADJUDICATE.todo.json")}\`. For EVERY item, apply \`${join49(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.
73493
+ 3. **Report**: \`${cmd("report")}\`.
73494
+ 4. **Verify the report's claims** \u2014 \`${cmd("verify-worklist")}\` writes \`${join49(runAbs, "VERIFY.todo.json")}\` (and \`${join49(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 \`${join49(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.
73495
+ 5. **Gate**: \`${cmd("gate")}\` must exit 0 before presenting anything.
73496
+ 6. **Fix & re-audit**: \`${cmd("fix")}\`, hand-apply the judgment fixes, then loop from step 1 until the gate stays green.
73397
73497
 
73398
73498
  With subagents available, prefer the emitted workflows instead: \`orchestrate --run ${runAbs} --phase <p>\` then \`Workflow({ scriptPath: "${join49(runAbs, "orchestration", "<p>.workflow.mjs")}" })\` \u2014 you stay the sole writer either way.
73399
73499
  `;
@@ -73419,11 +73519,35 @@ function verifyRunContext(runDir) {
73419
73519
  const run2 = resolve15(runDir);
73420
73520
  const ctx = readVerifyContext(run2);
73421
73521
  const standard = runStandard(run2);
73422
- const flags2 = [`--in ${ctx?.in ?? join50(run2, "audit-latest.json")}`];
73423
- if (standard) flags2.push(`--standard ${standard}`);
73424
- if (ctx?.conformities.source === "file") flags2.push(`--conformities ${ctx.conformities.path}`);
73425
- if (ctx?.conformities.source === "disabled") flags2.push("--no-conformities");
73426
- return { report: ctx && ctx.report !== "-" ? ctx.report : "<report.md>", flags: flags2.join(" "), ...standard ? { standard } : {} };
73522
+ const flagArgs = ["--in", ctx?.in ?? join50(run2, "audit-latest.json")];
73523
+ if (standard) flagArgs.push("--standard", standard);
73524
+ if (ctx?.conformities.source === "file") flagArgs.push("--conformities", ctx.conformities.path);
73525
+ if (ctx?.conformities.source === "disabled") flagArgs.push("--no-conformities");
73526
+ return {
73527
+ report: ctx && ctx.report !== "-" ? ctx.report : REPORT_PLACEHOLDER,
73528
+ flags: flagArgs.join(" "),
73529
+ flagArgs,
73530
+ ...standard ? { standard } : {}
73531
+ };
73532
+ }
73533
+ var GLOBS_PLACEHOLDER = "<globs>";
73534
+ var REPORT_PLACEHOLDER = "<report.md>";
73535
+ function engineArgs(run2) {
73536
+ const audit2 = join50(run2, "audit-latest.json");
73537
+ const v = verifyRunContext(run2);
73538
+ return {
73539
+ audit: ["audit", GLOBS_PLACEHOLDER, "--graph", "--out", run2],
73540
+ "adjudicate-worklist": ["verify", "--manual", "--in", audit2, "--out", run2],
73541
+ "adjudicate-fold": ["verify", "--apply", join50(run2, "ADJUDICATE.todo.json"), "--in", audit2, "--out", run2],
73542
+ report: ["report", "--in", audit2, "--out", run2],
73543
+ "verify-worklist": ["verify", "--report", v.report, ...v.flagArgs, "--out", run2],
73544
+ "verify-fold": ["verify", "--apply", join50(run2, "VERIFY.todo.json"), "--report", v.report, ...v.flagArgs],
73545
+ gate: ["check", "--report", v.report, ...v.standard ? ["--standard", v.standard] : [], "--semantic", "--verdicts", join50(run2, "VERIFY.todo.json")],
73546
+ fix: ["fix", GLOBS_PLACEHOLDER, "--write", "--iterate"]
73547
+ };
73548
+ }
73549
+ function renderCommand(engineAbs, args2) {
73550
+ return `node ${engineAbs} ${args2.map((a) => a === GLOBS_PLACEHOLDER ? `"${a}"` : a).join(" ")}`;
73427
73551
  }
73428
73552
  function listPhases(runDir, engineAbs) {
73429
73553
  const run2 = resolve15(runDir);
@@ -73453,7 +73577,7 @@ function listPhases(runDir, engineAbs) {
73453
73577
  } catch {
73454
73578
  }
73455
73579
  }
73456
- const vctx = verifyRunContext(run2);
73580
+ const args2 = engineArgs(run2);
73457
73581
  return [
73458
73582
  {
73459
73583
  name: "adjudicate",
@@ -73461,8 +73585,8 @@ function listPhases(runDir, engineAbs) {
73461
73585
  worklist: adjPath,
73462
73586
  items: adjIds.length,
73463
73587
  ids: adjIds,
73464
- prerequisite: `node ${engineAbs} verify --manual --in ${join50(run2, "audit-latest.json")} --out ${run2}`,
73465
- apply: `node ${engineAbs} verify --apply ${adjPath} --in ${join50(run2, "audit-latest.json")} --out ${run2}`
73588
+ prerequisite: renderCommand(engineAbs, args2["adjudicate-worklist"]),
73589
+ apply: renderCommand(engineAbs, args2["adjudicate-fold"])
73466
73590
  },
73467
73591
  {
73468
73592
  name: "verify-report",
@@ -73470,11 +73594,143 @@ function listPhases(runDir, engineAbs) {
73470
73594
  worklist: verPath,
73471
73595
  items: verIds.length,
73472
73596
  ids: verIds,
73473
- prerequisite: `node ${engineAbs} verify --report ${vctx.report} ${vctx.flags} --out ${run2}`,
73474
- apply: `node ${engineAbs} verify --apply ${verPath} --report ${vctx.report} ${vctx.flags}`
73597
+ prerequisite: renderCommand(engineAbs, args2["verify-worklist"]),
73598
+ apply: renderCommand(engineAbs, args2["verify-fold"])
73475
73599
  }
73476
73600
  ];
73477
73601
  }
73602
+ var EXIT_USAGE = "usage / bad input (missing or unreadable file, unknown flag value)";
73603
+ function buildManifest(runDir, engineAbs, batchSize = BATCH_SIZE2) {
73604
+ const run2 = resolve15(runDir);
73605
+ const args2 = engineArgs(run2);
73606
+ const phases = listPhases(run2, engineAbs);
73607
+ const v = verifyRunContext(run2);
73608
+ const audit2 = join50(run2, "audit-latest.json");
73609
+ const adjTodo = join50(run2, "ADJUDICATE.todo.json");
73610
+ const verTodo = join50(run2, "VERIFY.todo.json");
73611
+ const placeholder = (f) => f === GLOBS_PLACEHOLDER || f === REPORT_PLACEHOLDER;
73612
+ const ready = (inputs) => inputs.every((f) => placeholder(f) || existsSync37(f));
73613
+ const engine = (id, title, inputs, outputs, exit, next) => ({
73614
+ id,
73615
+ kind: "engine",
73616
+ title,
73617
+ command: renderCommand(engineAbs, args2[id]),
73618
+ argv: ["node", engineAbs, ...args2[id]],
73619
+ inputs,
73620
+ outputs,
73621
+ exit,
73622
+ ready: ready(inputs),
73623
+ next
73624
+ });
73625
+ const judgment = (id, ph, role, title, inputs, next) => ({
73626
+ id,
73627
+ kind: "judgment",
73628
+ title,
73629
+ role,
73630
+ contract: join50(run2, "orchestration", "agents", `${role}.md`),
73631
+ worklist: ph.worklist,
73632
+ items: ph.items,
73633
+ batches: toBatches(ph.ids, batchSize),
73634
+ schema: phaseSpec(ph.name).schema,
73635
+ inputs,
73636
+ outputs: [ph.worklist],
73637
+ ready: ph.ready && ph.items > 0,
73638
+ next
73639
+ });
73640
+ const [adj, ver] = phases;
73641
+ const verAudit = v.flagArgs[v.flagArgs.indexOf("--in") + 1];
73642
+ return {
73643
+ kind: "ultra11y-orchestration-manifest",
73644
+ schemaVersion: 1,
73645
+ run: run2,
73646
+ engine: engineAbs,
73647
+ ...v.standard ? { standard: v.standard } : {},
73648
+ placeholders: [
73649
+ { token: GLOBS_PLACEHOLDER, meaning: "the files to audit \u2014 a glob the shell must not expand, or explicit paths" },
73650
+ { token: REPORT_PLACEHOLDER, meaning: `the Markdown report the \`report\` step writes into ${run2} (<standard>-<date>.md)` }
73651
+ ].filter((p) => p.token === GLOBS_PLACEHOLDER || v.report === REPORT_PLACEHOLDER),
73652
+ phases,
73653
+ steps: [
73654
+ engine(
73655
+ "audit",
73656
+ "Audit \u2014 the deterministic finding set",
73657
+ [GLOBS_PLACEHOLDER],
73658
+ [audit2],
73659
+ { "0": "audit written (no --fail-on, or clean)", "1": "findings at or above --fail-on", "2": EXIT_USAGE },
73660
+ "adjudicate-worklist"
73661
+ ),
73662
+ engine(
73663
+ "adjudicate-worklist",
73664
+ "Adjudication worklist \u2014 the criteria the engine could not decide",
73665
+ [audit2],
73666
+ [adjTodo, join50(run2, "ADJUDICATE.md"), join50(run2, "ADJUDICATE.verdicts.json"), join50(run2, "adjudicate")],
73667
+ { "0": "worklist written (possibly empty: nothing to adjudicate)", "2": EXIT_USAGE },
73668
+ "adjudicate"
73669
+ ),
73670
+ judgment(
73671
+ "adjudicate",
73672
+ adj,
73673
+ "adjudicator",
73674
+ "Adjudicate \u2014 fill every item's verdict (C/NC/NA/manual)",
73675
+ [adjTodo, join50(run2, "adjudicate")],
73676
+ "adjudicate-fold"
73677
+ ),
73678
+ engine(
73679
+ "adjudicate-fold",
73680
+ "Fold \u2014 the fail-closed gate on the adjudication",
73681
+ [adjTodo, audit2],
73682
+ [audit2],
73683
+ {
73684
+ "0": "at least one verdict landed (refusals, if any, named in rejectedCriteria[] / issues[])",
73685
+ "1": "nothing landed, or --strict and a refusal",
73686
+ "2": EXIT_USAGE
73687
+ },
73688
+ "report"
73689
+ ),
73690
+ engine(
73691
+ "report",
73692
+ "Report \u2014 deterministic rendering of the adjudicated audit",
73693
+ [audit2],
73694
+ [REPORT_PLACEHOLDER],
73695
+ { "0": "report written", "2": EXIT_USAGE },
73696
+ "verify-worklist"
73697
+ ),
73698
+ engine(
73699
+ "verify-worklist",
73700
+ "Trial worklist \u2014 the report's non-conformities and the audit's claimed conformities",
73701
+ [v.report, verAudit],
73702
+ [verTodo, join50(run2, "VERIFY.md"), join50(run2, "VERIFY.context.json")],
73703
+ { "0": "worklist written", "2": EXIT_USAGE },
73704
+ "verify"
73705
+ ),
73706
+ judgment("verify", ver, "refuter", "Verify \u2014 rule every claim supported/partial/refuted/unsupported", [verTodo], "verify-fold"),
73707
+ engine(
73708
+ "verify-fold",
73709
+ "Apply the trial \u2014 coverage and grounding gate",
73710
+ [verTodo, v.report, verAudit],
73711
+ [],
73712
+ {
73713
+ "0": "every claim on trial supported or partial, and grounded in source",
73714
+ "1": "a claim refuted, unsupported, unadjudicated, missing or ungrounded",
73715
+ "2": EXIT_USAGE
73716
+ },
73717
+ "gate"
73718
+ ),
73719
+ {
73720
+ ...engine(
73721
+ "gate",
73722
+ "Gate \u2014 structural and semantic check of the report",
73723
+ [v.report, verTodo],
73724
+ [],
73725
+ { "0": "report sound and semantic gate green \u2014 it may be presented", "1": "integrity or semantic failure \u2014 do not present it", "2": EXIT_USAGE },
73726
+ null
73727
+ ),
73728
+ onFailure: "fix"
73729
+ },
73730
+ engine("fix", "Fix & re-audit \u2014 then loop", [GLOBS_PLACEHOLDER], [], { "0": "fixes applied (or nothing to fix)", "2": EXIT_USAGE }, "audit")
73731
+ ]
73732
+ };
73733
+ }
73478
73734
  function unrenderedInRun(run2) {
73479
73735
  try {
73480
73736
  const audit2 = JSON.parse(readFileSync32(join50(run2, "audit-latest.json"), "utf8"));
@@ -73548,7 +73804,7 @@ function orchestrateRun(runDir, engineAbs, opts = {}) {
73548
73804
  }
73549
73805
  }
73550
73806
  const rb = join50(orchDir, "RUNBOOK.md");
73551
- writeFileSync20(rb, runbookMd(phases, run2, engineAbs, unrenderedInRun(run2), verifyRunContext(run2)));
73807
+ writeFileSync20(rb, runbookMd(buildManifest(run2, engineAbs), unrenderedInRun(run2)));
73552
73808
  written.push(rb);
73553
73809
  return { exitCode: 0, written, notices, errors: [], phases };
73554
73810
  }
@@ -73600,7 +73856,7 @@ function buildTrialSummary(input) {
73600
73856
  for (const it of missingItems) (it.kind === "c" ? claims.c : claims.nc).missing++;
73601
73857
  const untriedForPrune = r.failures.filter((f) => !["refuted", "unsupported"].includes(norm5(f.verdict) ?? ""));
73602
73858
  const dry = pruneRefuted(audit2, standard, verdicts, input.lang, untriedForPrune);
73603
- const contested = new Set(dry.skippedEngineClaims);
73859
+ const contested = /* @__PURE__ */ new Set([...dry.skippedEngineClaims, ...dry.skippedHumanClaims]);
73604
73860
  const foreign = new Set(foreignItems);
73605
73861
  const withdrawnAgent = verdicts.filter((it) => !foreign.has(it) && !contested.has(it) && ["refuted", "unsupported"].includes(norm5(it.verdict) ?? ""));
73606
73862
  const applied = [];
@@ -76016,6 +76272,7 @@ Usage:
76016
76272
  ultra11y verify --apply <VERIFY.todo.json> --report <md> --in <audit.json> --out <dir> --prune (APPLY the trial: delete refuted non-conformities, send refuted conformities back to \xAB \xE0 \xE9valuer \xBB)
76017
76273
  ultra11y verify --summary --verdicts <VERIFY.todo.json> --report <md> --in <audit.json> [--pruned <audit.json>] [--out <dir>] [--json] (read-only bilan of the trial \u2192 TRIAL.md: confirmed, withdrawn/applied, contested engine decisions, coverage, gate)
76018
76274
  ultra11y orchestrate --run <dir> [--phase adjudicate|verify-report] [--eco] [--list] [--lang auto|en|fr]
76275
+ ultra11y orchestrate --run <dir> --manifest [--json] (the loop as data: each step's command/argv, inputs, outputs, exit contract, next step \u2014 for any orchestrator)
76019
76276
  ultra11y fix <globs\u2026 | -> [--write] [--iterate] [--changed | --since <ref> | --staged] [--safe] [--include <glob>] [--exclude <glob>] [--ext <list>] [--only <ids>] [--jsx] [--json] [--lang auto|en|fr]
76020
76277
  ultra11y init [--hook] [--ci] [--baseline] [--fail-on blocking|major|minor]
76021
76278
  ultra11y judge --in <audit.json> [--standard <pack>] [--runner api|claude|codex] [--grain batch|criterion] [--max <n>] [--model <id>] [--effort <level>] [--max-budget-usd <n>] [--timeout <s>] [--out <dir>] [--apply] (adjudicate manual criteria \u2014 api needs ANTHROPIC_API_KEY; claude/codex reuse their CLI login; cli aliases claude)
@@ -76623,6 +76880,8 @@ var BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
76623
76880
  "clean",
76624
76881
  "sample",
76625
76882
  "eco",
76883
+ // `orchestrate --manifest`: print the loop's step graph as JSON (src/orchestrate.ts buildManifest).
76884
+ "manifest",
76626
76885
  "help",
76627
76886
  "version",
76628
76887
  "allow-remote",
@@ -78135,7 +78394,7 @@ function cmdCheck(p) {
78135
78394
  );
78136
78395
  const pv = decided.provenance;
78137
78396
  console.log(
78138
- lang === "fr" ? ` ${pv.total} crit\xE8res \u2014 ${pv.engine} moteur, ${pv.scan} mesure (scan), ${pv.agent} agent, ${pv.declared} d\xE9clar\xE9(s) ind\xE9cidable(s), ${pv.undecided} sans verdict.` : ` ${pv.total} criteria \u2014 ${pv.engine} engine, ${pv.scan} measured (scan), ${pv.agent} agent, ${pv.declared} declared undecidable, ${pv.undecided} with no verdict.`
78397
+ lang === "fr" ? ` ${pv.total} crit\xE8res \u2014 ${pv.engine} moteur, ${pv.scan} mesure (scan), ${pv.agent} agent, ${pv.human ? `${pv.human} auditeur humain, ` : ""}${pv.declared} d\xE9clar\xE9(s) ind\xE9cidable(s), ${pv.undecided} sans verdict.` : ` ${pv.total} criteria \u2014 ${pv.engine} engine, ${pv.scan} measured (scan), ${pv.agent} agent, ${pv.human ? `${pv.human} human auditor, ` : ""}${pv.declared} declared undecidable, ${pv.undecided} with no verdict.`
78139
78398
  );
78140
78399
  }
78141
78400
  if (covered?.ok) {
@@ -78384,6 +78643,10 @@ function applyPrune(p, standard, items, lang, untried = []) {
78384
78643
  console.error(
78385
78644
  lang === "fr" ? `\u26A0 ${pruned.skippedEngine} verdict(s) r\xE9fut\xE9(s) visent une d\xE9cision du moteur \u2014 non modifi\xE9s : un crit\xE8re que le moteur tranche est recalcul\xE9 \xE0 chaque run, et un faux positif se corrige dans la r\xE8gle.` : `\u26A0 ${pruned.skippedEngine} refuted verdict(s) name an ENGINE decision \u2014 left untouched: a criterion the engine decides is recomputed every run, and a false positive is fixed in the rule.`
78386
78645
  );
78646
+ if (pruned.skippedHuman)
78647
+ console.error(
78648
+ lang === "fr" ? `\u26A0 ${pruned.skippedHuman} verdict(s) r\xE9fut\xE9(s) visent une d\xE9cision d'un auditeur humain nomm\xE9 \u2014 non modifi\xE9s : l'auditeur est le second lecteur ; soumettez-lui la contre-expertise.` : `\u26A0 ${pruned.skippedHuman} refuted verdict(s) name a named human auditor's decision \u2014 left untouched: the auditor is the second reader; put the refutation to them.`
78649
+ );
78387
78650
  }
78388
78651
  return pruned;
78389
78652
  }
@@ -79675,6 +79938,14 @@ function cmdOrchestrate(p) {
79675
79938
  console.log(JSON.stringify({ phases: listPhases(runFlag, engineAbs) }, null, 2));
79676
79939
  return 0;
79677
79940
  }
79941
+ if (p.flags.manifest === true) {
79942
+ if (!existsSync40(runFlag)) {
79943
+ console.error(`ultra11y orchestrate: run dir not found: ${runFlag}.`);
79944
+ return 2;
79945
+ }
79946
+ console.log(JSON.stringify(buildManifest(runFlag, engineAbs), null, 2));
79947
+ return 0;
79948
+ }
79678
79949
  const res = orchestrateRun(runFlag, engineAbs, {
79679
79950
  phase: typeof p.flags.phase === "string" && p.flags.phase ? p.flags.phase : void 0,
79680
79951
  eco: p.flags.eco === true