// THE PER-PAGE REPORT — the deliverable an accessibility auditor actually hands over. // // `renderPageGrid` (src/pages.ts) answers "which criteria fail, across the pages?" as one // matrix. That is the right shape for a diff and the wrong shape for a page owner: with 106 // RGAA criteria over N pages nobody reads a column. What an audit is asked for is a DOSSIER // PER PAGE — this page, its screenshot, every criterion of the standard with its status, and // the non-conformities written out in full. // // Two invariants hold the file together, and they are why it is not simply "group findings // by page and print them": // // 1. NOTHING IS RE-DECIDED HERE. Every status comes from `derivePages` and, for a country // standard, from `derivePackResults(pageView(...))` — the very projection `report` and // the grid already use. A second implementation would drift, and the first symptom of // drift in an accessibility report is a criterion silently declared conforming. // 2. THE NON-CONFORMITIES ARE RENDERED BY `renderAuditorUnit`. The auditor conformance // block is the central deliverable of this tool; a per-page variant of it would be a // second format to keep in sync, and its occurrence lines would stop being parseable by // `verify` (AUDITOR_OCCURRENCE, src/verify.ts). // // The screenshot is the one thing the page report has that no other output does. It is // passed in as an href, never resolved here: `.ultra11y/pages//screen.png` is already // on disk, and the caller decides whether to reference it relatively or copy it beside the // report (it does copy, so an uploaded `audits/` artefact keeps its images), which keeps // this module pure and testable. import { prdUnits } from "./prd.js"; import { renderAuditorUnit, type AuditorCropLookup } from "./auditor.js"; import { agentMarkNote, basisLabel, formatRate, pageView, unattributedFindings } from "./pages.js"; import { CORE, type StandardId, derivePackResults, isCore, isProvisionalJudgmentInapplicable, loadPack, packTestIds, themeName, titlePlain, } from "./standards/index.js"; import type { AuditResult, Lang, PageResult, Status } from "./types.js"; import { compareSC, scTitle } from "./wcag.js"; /** Marks a file as a PER-PAGE report rather than a conformance report. `check` keys on it to * apply the gates that mean something here (no invented criterion, sane rate) instead of * demanding the §1–5 structure of a conformance document. Without the marker the file would * fail with five misleading "missing section" errors — a confusing refusal, not an explicit * one. */ export const PAGES_REPORT_MARKER = "ultra11y:pages-report"; export function pagesReportMarker(standard: StandardId): string { return ``; } export function isPagesReport(md: string): boolean { return md.slice(0, 400).includes(`