Skip to content

Latest commit

 

History

History
153 lines (104 loc) · 43.7 KB

checking.md

File metadata and controls

153 lines (104 loc) · 43.7 KB

Checking the output

Every run ends by checking what it wrote: each page of the run, and each EPUB and PDF built from them, and in a slides run each PowerPoint file it wrote, a deck's copy or a pptx target's file, checked as a deck is (Slides), and each reveal.js presentation, as a page is. The findings go to output-check.csv beside the other reports, in the findings format every check in this project shares (Where, Check, Detail first, then the file, its kind, a severity, the standard, the tool, and where the fix lives), and a summary goes to the terminal. The check never stops the run: the output exists, and the report is the list to work through. For the same checks on files that didn't come from a run, and for Word, Markdown, PowerPoint, and PDF as well, see Auditing.

python3 bin/check-output.py *.html --epub epub/book.epub --report output-check.csv

runs the same check by hand, on whatever you point it at. --pdf and --pptx add a PDF or a PowerPoint file the same way, each as often as you like, --quick leaves the validators out, --wcag adds the checks of WCAG's criteria a machine can make, axe-core's on each page, presentation, and EPUB's content document (below) and veraPDF's on each PDF (below), as convert.py --wcag does to a run's, and --documents names a JSON file giving each page's document ({"html/deck.html": "deck"}), within which one alt text on different images is looked for.

What it looks for

The checks are the class of defect that has reached this project's output before: structure that's well-formed and wrong, which nobody notices by looking at a page.

Check What it means
link-to-missing-file A link names a page or file that isn't in the set being checked.
link-to-missing-fragment A link's #fragment matches no id in the page it points at, as written or decoded, as a browser looks for it. In a reveal.js presentation, #/id, reveal.js's route to the slide holding the id, is read as #id.
link-to-file-dropped An EPUB's link to a local file, a PDF or a Word file a page offers, which an EPUB can't carry, so its text stays without the link.
link-label-without-text A link whose aria-label doesn't contain its visible text, which fails WCAG 2.5.3 (Label in Name): a speech-input user follows a link by saying the words on it. Text used as a symbol, with no letter or digit in it, isn't a visible label to the criterion, so a note's way back, ↩︎ labeled "Back to reference 3", isn't reported.
image-without-alt An img has no alt attribute, so a screen reader announces the file name.
image-empty-alt-not-decorative alt="" without aria-hidden="true": the image was neither described nor declared decorative. In an EPUB this is the usual form of a missing description, since Pandoc's writer gives every image an alt.
image-alt-is-file-name The alt is the image's file name (db locked for db-locked.png, as Asciidoctor writes one the author didn't give), or holds a file name or extension.
image-alt-placeholder, image-alt-auto-generated, image-alt-page-title, image-alt-credit The alt says nothing about the image (a word such as "image", an editor's placeholder ("Alt Text Placeholder"), a camera's or tool's name for a file, a shape's default name, a clip-art id, punctuation alone), is a description Office generated, looks copied from a web page with the picture, or is only a credit (who made the picture, its license, or where it's from), by the rules a deck's pictures are judged by (Slides). The project's own images.alt_placeholders are read for a book's image-alt-missing.csv, not here.
image-alt-shared A note: one alt on different images of a book's pages, a deck's in a run of decks (its pieces and its presentation), or an EPUB, case and closing punctuation aside, that no other check names (check-output.py on its own takes the pages it's given as one document, as a book's run does, unless --documents names each one's, as a run of decks does). Images are told apart by their files' content, so the same picture in two files isn't named. It may be a description copied to a picture it doesn't fit, or the same picture in two files of different sizes (Slides says how often each was so in OpenStax's books).
heading-skips-level A heading is more than one level below the one before it. The run lifts such a heading in the pages it writes, unless heading_levels is source (Configuration), so it's found in a hand-written page, in pages check-output.py reads on its own, or with source.
formula-lost A formula a saved page held only as MathJax drew it, with nothing left to read it from, marked [formula] (HTML sources).
formula-shown-as-tex A formula Pandoc couldn't convert to MathML, so the page shows its TeX ($r_{s} = \left( …$) and a screen reader reads that out. Pandoc says so only in a warning among the run's output; the detail is the formula, to find it in the source. A page with a script is skipped, since a script there may be what renders the TeX.
formula-kept-as-text A formula Pandoc couldn't read from its MathML, which its HTML reader keeps as its text in a span of class math, the parts of a fraction or a script run together (x2 for x²), and says nothing of, not even in a warning: texmath rejects a script or a fraction of the wrong number of parts, and an element it doesn't know, such as content MathML's apply (the Pandoc notes). The detail is the text, to find it in the source. A page with a script is skipped, as for formula-shown-as-tex.
empty-heading A heading with no text.
invalid-id An id containing whitespace, which no id may.
duplicate-id An id used more than once in one document, so links to it are ambiguous.
vnu:error, vnu:warning, epubcheck:<ID> What the full validators reported, when installed; see below.
table-not-in-scroll-region A data table on an HTML page outside the focusable wrapper the filter puts around every data table (WCAG 1.4.10). The filter's own invariant, checked on the output. A layout table, role="presentation" or role="none", has none: its cells stack on a narrow screen instead.
table-without-headers-or-caption A table with no th and no caption, and not marked as a layout table, role="presentation" or role="none". A data grid with no relationships to encode conforms with a caption alone; without one it's unidentifiable.
table-without-data-cells A data table whose every cell is a header (th), none of them data (td), so the table has no body, which an accessibility checker reports as a table missing its body. A page's <thead> holding every row made such tables until the repaired copy gave them a body (HTML sources).
table-header-is-formula A note: a header cell (th) holding only a formula. The table is right as it stands, but NVDA reads the formula in the header row and announces no header on moving into its column, since it takes a header from the cell's text in its buffer, where a formula is a single space (its browser support, the header's text). Words beside the formula it announces ("Quantity demanded, q_d" is announced as its words). Heard so with NVDA in Chrome or Firefox and in Acrobat. The detail is the table's number on the page and the formula's TeX.
no-lang, no-title The html element declares no language, or the page has no title.
title-is-file-name The page's title is its file's name (ch_intro_to_data), as a page with no heading of its own gets: a name with an underscore, a hyphen, a dot, or a capital inside a word.
not-well-formed An EPUB content document that isn't XML.

For an EPUB it also checks the container: mimetype first and uncompressed, a package document the container points at, every manifest item present in the archive and every file in the archive present in the manifest, spine entries that exist, a navigation document, the dc:title, dc:identifier, and dc:language every EPUB needs, and the accessibility metadata this project writes.

Each finding says where (the page or archive member), which check, and what (the link, the image path, the heading text), so output-check.csv sorts and filters into work lists: every image without alt text goes to image-alt.csv, every table without headers to the table sidecars.

Contrast

The built-in checks don't measure color contrast on the rendered page; --wcag does, with axe-core, in light mode and, on a page that has colors for it, in dark mode too (below). What the pipeline controls is its own stylesheet and the colors it highlights code in, and those are checked where they're decided. A unit test computes the ratio of every text color page.css sets against Pandoc's page background and against white, and fails below 4.5:1 (the caption color is held to 7:1), and the ratio of each color it gives dark mode against a page's background there, #1a1a1a, and an EPUB's, #232629. Code is highlighted in bin/highlighting.theme, which every writer is given: Pandoc's pygments style, each of its colors under 4.5:1 darkened to 4.6:1 or more (a comment's #60a0b0 was 2.89:1, and is #3c7c8c), so a page, an EPUB, a PDF, a Word file, a PowerPoint file, and a reveal.js presentation have the same colors. The unit suite holds the theme to 4.5:1 on Pandoc's background and on white, and page.css's light colors for code to the theme's; the convert suite holds page.css's colors to the backgrounds the stylesheets Pandoc writes give, light and dark, so a Pandoc that changes them fails there. A PowerPoint reference document of your own with a dark background (slides.reference_doc) would put the code's colors on it, which isn't checked.

The full validators

The checks above are what the standard library can do. epubcheck and the Nu HTML checker know their specifications in full, and when they're installed the run uses them too: epubcheck on each EPUB, the Nu checker on every page. Their findings land in the same report in the same shape, with the tool's own message as the check (epubcheck:RSC-012, vnu:error, vnu:warning), and the run says which ran. The Nu checker's informational messages (Pandoc's trailing slashes on void elements, mostly) are counted and not listed, since they change nothing for a reader.

A PDF gets what the audit reports about one: what the file claims, whether it's tagged, and, from its structure tree, each figure whose alternative text is a file name (pdf-figure-alt-is-file-name), which is what LaTeX writes for an image with none and a validator accepts, and each whose alternative text is the placeholder LaTeX writes for a drawing with none, picture environment or Alternative text missing!, or says nothing otherwise, as a page's alt text can (pdf-figure-alt-is-placeholder), and as warnings, each whose alternative text Office generated (pdf-figure-alt-auto-generated), looks copied from a web page with the picture (pdf-figure-alt-page-title), or is only a credit (pdf-figure-alt-credit); and, as a note, each header cell holding only a formula (pdf-table-header-is-formula), which NVDA in Acrobat doesn't announce as a column's header, as on a page (its Acrobat support), whatever alternative text the formula has. The detail is the cell's page, its table's number, and its own among the table's header cells, in the structure tree's order. Content beside a formula counts if it shows anything at all, a space glyph included. When veraPDF is installed, each rule it finds failed is a finding (verapdf:<clause>-<test>, with the standard's clause in the Standard column), and once it has run and found nothing, the note that the file's claims are unverified is dropped.

All three are Java, which is why they're optional. Installation says how to set up the first two, and veraPDF the third; the run finds them through EPUBCHECK_JAR, VNU_JAR, and VERAPDF, or as epubcheck, vnu, and verapdf commands on the path. When a fast turn is wanted, convert.py --quick checks the run's output without them, as check-output.py --quick does on its own; the checks above still run, and the summary says the validators didn't.

The first thing the Nu checker found in this project's own output was a rule the built-in check couldn't know: an img with alt="" already has the presentation role and may not carry a role attribute, which the filter had been adding to every decorative image. It now uses aria-hidden="true", which the checker accepts and which does the same job. That's the argument for running the real thing.

A PDF/UA-2 file this pipeline makes also claims the PDF Association's Well-Tagged PDF, at both its levels (accessibility and reuse; LaTeX writes the declarations), and veraPDF validates what a file claims: its WTPDF 1.0 profiles run on every such PDF, beside PDF/UA-2 and Tagged PDF, and a finding names the profile. A PDF/UA-1 file, PDF 1.7, is outside WTPDF, which is PDF 2.0. A PDF's validators and readers have their own limits. When a screen reader says something a tagged PDF doesn't, the viewer may be at fault rather than the file: the PDF Association's technical notes say that a viewer which announces a figure for an image tagged with the text it shows (TN-PDFUA1-001), or announces "link" twice for a contents entry, whose Reference encloses a Link as it should (TN-PDFUA1-002), has a defect to report to the viewer's publisher. Few checkers know PDF 2.0, and one that applies PDF 1.7's rules to a PDF/UA-2 file reports problems a valid file doesn't have; the LaTeX tagging project keeps a list of such false reports to check a finding against. PDFix runs veraPDF's checks but shows where in the page each problem is, which veraPDF's paths into the structure tree don't. veraPDF's other profiles can be run on the same file, but its WCAG 2.2 profiles' own checks, the ones PDF4WCAG reports (a span with nothing in it, spaces used for layout, a link described only by its address), need veraPDF's WCAG modules (wcag-validation and veraPDF-wcag-algs), which its release doesn't include: given such a profile with -p, veraPDF 1.30.3 checks the PDF/UA rules in it and passes the rest without checking them. --wcag runs one with them (below). Blackboard Ally, in many learning management systems, checks against PDF 1.7: it wants alt text on every formula, which a PDF/UA-1 build has and a PDF/UA-2 build doesn't (pdf.standard), and headings in anything over two pages. For hearing a tagged PDF 2.0 file, Acrobat, Foxit, and Firefox expose its tags, to NVDA or JAWS on Windows and Orca on Linux. Only NVDA, mostly in Acrobat, has been tried here.

DAISY's Ace applies the accessibility rules to an EPUB the way a reading system would: axe-core on its content documents, as --wcag does here (below), and checks of its own on the package, its accessibility metadata among them. With --wcag, the run uses it too when it's installed (below).

axe-core's WCAG checks

--wcag, given to convert.py, check-output.py, or audit.py, checks each HTML page against axe-core's rules for WCAG's criteria as well, in Playwright's Chromium: every page a run wrote, in every target, hand-written pages and a deck's page among them; each reveal.js presentation TextbookImprover wrote, slide by slide (below); and each EPUB's content documents, its navigation document (the contents) among them. axe-core is Deque's, the engine Ace and Lighthouse run, and it aims to report only what it's sure of: what it can't decide, it says so. It needs Python's Playwright and its Chromium, optional (Installation); axe-core itself is in the repository (vendor/axe-core, 4.14.0), and AXE_CORE_DIR can name the folder of another copy's axe.min.js, which the summary notes. Without Playwright, a line says so, and everything else runs as before.

What's checked against is a version of WCAG and a level: WCAG 2.1 AA unless --wcag-version (2.0, 2.1, or 2.2) and --wcag-level (AA or AAA) say otherwise, a version with the criteria of those before it and a level with the levels below it. The DOJ's rule for state and local governments names 2.1 AA, and the Section 508 standards 2.0 AA (below). A rule runs when one of its criteria, from its tags (wcag143 is 1.4.3), is within them: in axe-core 4.14.0, 60 rules for 2.0, 63 for 2.1, and 64 for 2.2 at AA, and three more at AAA, contrast at 7:1 (color-contrast-enhanced, 1.4.6), links with one name and different addresses (identical-links-same-purpose, 2.4.9), and a refresh at all (meta-refresh-no-exceptions, 2.2.4 and 3.2.5). --best-practice adds axe-core's 27 best practices, which no criterion requires: landmarks, a page's one H1, the heading order. --experimental adds, among those chosen, the rules axe-core is still trying, which it leaves out unless asked: in 4.14.0, a large table's cells without headers (td-has-header), a caption written in a table's first cell (table-fake-caption), and a paragraph styled as a heading (p-as-heading), all for 1.3.1, and from 2.1 a stylesheet that locks the orientation (css-orientation-lock, 1.3.4); with --best-practice, two more (focus-order-semantics, hidden-content). What such a rule finds says it's by a rule axe-core is still trying, and its line in the summary that it's an experimental rule. On a page with no stylesheet at all, css-orientation-lock is undecided, since it has nothing to read; TextbookImprover's own pages each have one. Its deprecated rules never run. The unit suite holds the rules chosen so to the ones axe-core's own level tags (wcag21aa) choose, so a release that retags a rule is noticed. The same version and level choose veraPDF's rules on a PDF.

What it finds is a note, never an error, as veraPDF's findings are: --wcag is information, and what's installed doesn't decide a run's verdict. A rule a page fails is axe:<rule> (axe:color-contrast), and what axe-core can't decide is axe-review:<rule>, for a person to judge. There's one finding for each rule on each page, or each slide (deck.html#/a-slide, reveal.js's route to it, which opens the presentation there); its detail is axe-core's account of the rule, its impact, how many elements and the first three by their CSS selectors (in a frame, the frame's after), why it couldn't decide when it couldn't, by axe-core's reason, the criteria named and linked, and axe-core's page on the rule. The Standard column names each criterion (WCAG 2.0 SC 2.4.4 (A); WCAG 2.0 SC 4.1.2 (A)), or axe-core best practice; the tool is axe. Where a rule covers what a built-in check does, image-alt image-without-alt's, document-title no-title's, html-has-lang no-lang's, label-content-name-mismatch link-label-without-text's, and th-has-data-cells table-without-data-cells's, both are reported, since their disagreeing is worth seeing, the fix is the built-in check's, and the summary says so; the check suite holds them to agreeing on its pages. With --verbose, each element is a note of its own, with axe-core's summary of what failed and the first 120 characters of its markup, and the summary lists the first twenty under the rule's line.

Two kinds of element axe-core can't decide are left out. A symbol in a formula, a minus sign or a bar over a letter, isn't text, so axe-core doesn't measure its contrast ("only non-text characters", "too short"). On a page whose formulas take the colors of the text around them, as TextbookImprover's do, a symbol's contrast is that text's, so it's left out, and a line counts them: in Introductory Business Statistics 2e (OpenStax), they were 1,993 of the 2,083 elements axe-core couldn't decide on its 169 pages, and the other 90 were in its tables: 63 cells another cell overlaps, so their background couldn't be told, and 27 cells holding a digit or a symbol alone (1, ≠). A page whose formulas have colors of their own, by MathML's mathcolor or a stylesheet, keeps them, for a person to judge. And in dark mode, an element axe-core couldn't decide in light mode, for the same reason, isn't said again.

The summary, after the verdict and before veraPDF's lines (illustrative):

  axe-core 4.14.0 ran its 63 rules for WCAG 2.1 AA on 34 page(s) and 41 slide(s) of 1 presentation(s), in Playwright 1.63.0's Chromium 153, sandboxed and off the network, with each page's own scripts blocked, but in a presentation TextbookImprover's own: what it finds is a note, never a failure.
  axe:image-alt, 1.1.1 Non-text Content (A), as image-without-alt checks too: 2 element(s) on 1 page(s), the first in html/ch03.html at p:nth-child(5) > img: Images must have alternative text. https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html
  1993 symbol(s) in formulas on 112 page(s), whose contrast axe-core doesn't measure since they aren't text, are left out: each takes the colors of the text around its formula.
  axe-review:color-contrast, 1.4.3 Contrast (Minimum) (AA): 90 element(s) on 2 page(s) axe-core couldn't decide, for a person to judge, the first in html/a-statistical-tables.html at #eip-802 > tbody > tr:nth-child(2) > td[rowspan="5"]; 54 because Element's background color could not be determined because it is overlapped by another element, 25 because Element content is too short to determine if it is actual text content, 9 because Element's background color could not be determined because it partially overlaps other elements, 2 because Element content contains only non-text characters: Elements must meet minimum color contrast ratio thresholds. https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html
  Each rule's elements are counted, not listed: run again with --verbose for each one, with its markup.

What axe-core couldn't decide is where noise comes from. On a page built the way TextbookImprover builds them, it left a formula's operators and a note's way back (↩︎) for a person to judge, every one for the same reason, that its text is only symbols, whose contrast it doesn't measure; the summary counts each rule's by its reason, so a book's thousands of operators are one line. Contrast is checked twice on a page that has colors for dark mode, a color-scheme with dark in it or a stylesheet for prefers-color-scheme, as Pandoc 3.12's and page.css have: once as a reader sees it in light mode, and again in dark, which those findings say ("In dark mode:"). Measured with two processors: 40 pages of 29 KB, each with three tables and six formulas, took 12 seconds, a second of it starting the browser and checking the probe, and the pages two at a time after that; a presentation of 41 slides took about three seconds more than the start.

Each page is locked down, so that a check of pages from anywhere, as a web front end would make on pages strangers upload, can't be used against the machine (lib/lockedbrowser.py):

  • The check runs in a process of its own, which takes itself off the network before Chromium starts: a user namespace that maps its user to itself, with a network namespace in it, whose only interface is a loopback that's down. No name resolves either, and no proxy is used.
  • Chromium's renderers run in Chromium's own sandbox, which Playwright leaves off unless asked. It can't start for root, and Ubuntu 24.04 may refuse it to a Chromium AppArmor doesn't cover (Chromium's notes on it); the check reads /proc to say whether its renderers are in it.
  • Each page is opened in a context of its own at a made-up address, https://textbookimprover.invalid/, and every request is answered from the folder the pages are in (or the EPUB) or refused, files outside it and links that lead out of it among them. The page can't navigate away: a refresh, or a form, gets an empty answer that leaves it where it is, where a refusal would put Chromium's error page in its place for axe-core to check. A WebSocket is taken and never connected, and service workers, downloads, and permissions are refused.
  • A Content Security Policy on every response blocks the page's own scripts, inline, in a handler, or in a frame, and anything from elsewhere. What Playwright evaluates, axe-core, isn't held to it; turning JavaScript off doesn't work, since then no timer reaches axe-core, which never finishes.

So each page is checked as it's delivered, before any script of its own runs. TextbookImprover's pages have none, but a hand-written page or a site kept whole may, and a note names a page whose scripts were blocked. Scripting itself stays on, so a page's <noscript> content isn't shown, or checked. A frame of the same folder's is checked, and one from elsewhere is refused, and named as not checked. A stylesheet or a font from elsewhere is named in a note, since the page's colors and sizes may then differ from what a reader sees. A run on your own machine uses the sandbox and the network's namespace where the system allows them and says which it couldn't; the summary's first line says sandboxed and off the network when it had both. A page gets 30 seconds to load, as each step of opening it does, and axe-core 60 to check it, and all told, three minutes, or eleven for a presentation, whose every slide is checked; past any of those, the page is named as not checked and the rest go on. The check ends with the run that started it, interrupted or not.

Before the pages, each run checks a probe page of its own: no language, a picture without alt text, a script that would change its title, a picture from elsewhere and a file outside its own, and a refresh to elsewhere. axe-core must find the first two, the title must stay, the pictures be refused, and the refresh canceled; if any of that fails, a warning says what, and nothing axe-core found is reported. With nothing to check, check-output.py --wcag runs the probe alone, and a probe presentation, which checks the setup (Installation).

Presentations

A reveal.js presentation can't be checked without its scripts: reveal.css keeps every slide hidden until reveal.js shows it, and with its scripts blocked, axe-core found nothing on a deck, not even a picture without alt text. So a presentation TextbookImprover wrote is checked with TextbookImprover's own scripts, and no others:

  • reveal.js and the notes, search, and zoom plugins Pandoc's template loads, byte for byte the repository's (vendor/reveal.js), or in a local run REVEALJS_DIR's;
  • oer-reveal.js, as the repository has it once each line's indent is set aside, since Pandoc's template indents it;
  • the start of reveal.js, Reveal.initialize({...}), when it holds settings and nothing else (Slides).

Those two inline scripts are allowed by their hashes and the files by their bytes, and everything else stays blocked: a script of the presentation's own, inline, in a handler, or a file, which a note names. Every script that runs is code the repository ships, which the presentation's markup can only steer, and what that code loads still goes through the route and the policy. A presentation from another version of TextbookImprover, or one whose scripts aren't these, isn't checked, and a line says why; its deck's page, when the run writes one, is checked as any page is. Each slide is then shown with all its steps, at its own size, with motion reduced and what's still moving brought to its end, and checked: caught partway through a change, a color isn't the one a reader sees, as a gray slide's background was nearly white partway through fading in, before oer-reveal.css's reduced motion stopped reveal.js fading it. reveal.js makes the slides not shown inert, so each slide's elements are checked once, and what every slide has, the controls, is reported on the first. A slide is checked at its own size, as reveal.js lays it out in a window wider than 1000 pixels; the page oer-reveal.js shows a narrow window isn't checked. The window is no more than 4,096 pixels across or down, whatever size a presentation's settings give its slides, since Chromium stalled or crashed opening one 104,000 pixels square; reveal.js shows a larger slide smaller in it, as in a reader's window. A presentation's first 500 slides are checked, and a line counts any past them.

DAISY's Ace

With --wcag, given to convert.py, check-output.py, or audit.py, each EPUB is checked with DAISY's Ace as well when it's installed (Installation), found through ACE or as ace-puppeteer, ace-cli, or ace on the path, in that order. Ace runs axe-core on each content document, with two rules of its own added to its copy, and checks the package: its language and its accessibility metadata (schema:accessMode, schema:accessibilityFeature, schema:accessibilityHazard, schema:accessibilitySummary, schema:accessModeSufficient), which EPUB Accessibility 1.1 asks for. Its own checks are what's reported, each a note, as axe-core's are, never an error: ace:<rule>, filed under the package document or the content document (ace:metadata-accessmode under EPUB/content.opf), its detail Ace's words, the rule's impact, the first elements by their CSS selectors, and Ace's page on the rule, and its standard EPUB Accessibility 1.1 for a check of the EPUB, or Ace best practice for its rules in content documents, an epub:type without the ARIA role it maps to (epub-type-has-matching-role), and a page break without a label (pagebreak-label). Its axe-core results are left out and counted, since they're the rules --wcag runs itself, in a browser locked down as Ace's isn't. The summary's lines come between axe-core's and veraPDF's (illustrative):

  Ace by DAISY 1.4.6 checked 1 EPUB(s): 2 finding(s) of its own, a note each, as axe-core's are; its axe-core results, 53 element(s) failing 1 rule(s) (empty-table-header), are left out, since --wcag runs axe-core's rules itself.
  ace:metadata-accessmode, EPUB Accessibility 1.1: 1 finding(s), the first in EPUB/content.opf: Publications must declare the 'schema:accessMode' metadata (serious): Ensures a 'schema:accessMode' metadata is present. Ace's rule: http://kb.daisy.org/publishing/docs/metadata/schema.org/index.html.

With nothing to check, check-output.py --wcag runs Ace on a probe EPUB of its own, without its accessibility metadata, and says whether Ace found what it lacks, which checks the setup. A run Ace couldn't finish is a warning naming the EPUB and what Ace said; --quick leaves Ace out, as it leaves out the other validators. An audit keeps each EPUB's result in its cache, by where the EPUB is, with its SHA-256 and Ace's version, so an EPUB made again replaces its own, and runs Ace again only on an EPUB that has changed, or with another Ace (Auditing): it took 2 minutes 30 seconds on the 218 content documents of Introductory Business Statistics 2e's EPUB, with Ace 1.4.6 and Playwright's Chromium.

Ace isn't locked down: it runs a book's scripts in a browser without its sandbox, and reads the EPUB unpacked in a folder of its own. So it's for books you made, not for one a stranger sent, and a web front end that checks uploads would leave it out (Roadmap).

Nor is its unpacking. Ace 1.4.6 unpacks an EPUB with node-stream-zip, and when that fails, with extract-zip 2.0.1, which can be led to write outside its folder by a symbolic link in the ZIP (GHSA-7pqw-9j4j-h8q3, GHSA-jmr9-qjv8-65gv) and has no release that fixes it. So before Ace runs, each EPUB's ZIP directory is read, nothing extracted, and an EPUB isn't given to Ace when it holds a symbolic link, a name given twice (compared after case folding and Unicode normalization, as EPUB 3.3 compares an EPUB's names), or a name that's absolute, starts with a drive, holds a backslash, or has a .. segment, or when the directory can't be read. A warning names the EPUB and the first of what it holds, and the rest of the check goes on. An EPUB holds only files and folders, each name once, so none TextbookImprover writes is refused; for one you trust, --ace-unsafe-zip, given to check-output.py or audit.py with --wcag, gives it to Ace all the same, and a line says it did. An audit's report with an EPUB that wasn't given to Ace is never taken for current.

veraPDF's WCAG 2.2 checks

--wcag, given to convert.py, check-output.py, or audit.py, checks each PDF against veraPDF's WCAG 2.2 machine profile as well, with the WCAG modules veraPDF's release doesn't include (Installation): WCAG-2-2-Machine-PDF20.xml for a file whose header says PDF 2.0, as a PDF/UA-2 build's does, and WCAG-2-2-Machine.xml for any other. The PDF 2.0 profile is 86 of PDF/UA-2's 92 rules and eleven of its own (veraPDF 1.30), and the other has the same eleven: text with five or more of one character in a row, or three or more spaces (1.3.1); text outside a figure whose contrast with what's behind it is under 4.5:1, or 3:1 for large text (1.4.3); text outside a figure under 4.5 points (1.4.4); a figure on one page with no bounding box (1.4.10); a link described by nothing, or by nothing but its address (2.4.9); and a paragraph, span, heading, or numbered heading with nothing in it (veraPDF's "redundant", PDF4WCAG's "empty"), and a contents entry with no line of text (4.1.2). Only those eleven are reported, PDF/UA's rules being veraPDF's usual run's, and of them, only the rules for criteria within the version and level --wcag-version and --wcag-level choose, WCAG 2.1 AA unless they say otherwise (above): at 2.1 AA, 2.4.9's rule is left out, and a line counts what it found, which --wcag-level AAA reports; at 2.0, 1.4.10's is left out too. The profiles repository's Complete profiles add 47 rules tagged human, the algorithms' guesses at what the structure should be (a paragraph that should be a heading, a table whose rows don't match what's drawn), each for a person to judge; they aren't run.

What the profile finds is information, not a verdict. Its rules are heuristics, and some misread a book: in Instrumental Analysis (LibreTexts), it reads the first four cells of Table 25.7.1's Groups row, I, II, III, and IV, as one run of seven I's. Others are judgments a book has made: in Introduction to Sociology 3e (OpenStax), it fails every link whose text is its own address, as a reference list's are (2.4.9-1, 789), which conform at AA by their citations (Bare links). A book's fill-in blanks, runs of underscores, were another: built before a build drew a blank as a line, Introduction to Sociology 3e failed 106 of the 107 in its quizzes, each a run of five or more underscores (1.3.1-1; the other has four), as it did with each a Span whose ActualText is "blank", since the rule reads the characters (measured). A build of a tagged PDF now draws each blank as a line, with no character in the text, so the rule has nothing of it to read (PDF): PDF4WCAG, run on Introductory Business Statistics 2e's PDF built so, found none of its blanks, nor anything else but its reference lists' bare links (2.4.9-1). A blank in a face loaded from TeX's own metrics keeps its underscores, which the build warns of. And WCAG 2.2 isn't what everyone is held to. The U.S. Department of Justice's rule for state and local governments names WCAG 2.1 AA, and the Section 508 standards name 2.0 AA; 2.4.9 is beyond both, at AAA, and 1.4.10, which came with 2.1, beyond 2.0's, which is why 2.1 AA is the default. So what the profile finds is a note, never an error. The run's summary counts the other findings as it always has, saying "nothing found" when there are none, and lists the profile's after them, under a line saying they're experimental and may be wrong; an audit's exit status stays its other findings'.

Each finding is one rule a PDF failed. Its check is verapdf-wcag:<clause>-<test> (verapdf-wcag:2.4.9-1); its where, the PDF; and its detail, the rule, how many of its checks failed and on which pages, where veraPDF gives them (the first 20, and how many more), the criterion's number, name, and level, its Understanding document, and the caveat. The Standard column names the criterion as the output check's own findings do (WCAG 2.0 SC 2.4.9 (AAA)), and the summary marks one WCAG 2.0 didn't have with the version that brought it (1.4.10 Reflow (AA, WCAG 2.1)). The summary has a line for each rule a PDF failed, then one saying --verbose lists the checks, and one counting what the version and level left out:

  veraPDF 1.30.4's WCAG 2.2 machine checks ran on 1 PDF(s) for WCAG 2.1 AA, with its WCAG modules from /home/you/tools/verapdf-wcag: veraPDF's WCAG checks are experimental and may be wrong, so what they find is a note, never a failure.
  book.pdf: verapdf-wcag:1.3.1-1, 1.3.1 Info and Relationships (A): 1 failed check(s), page 653: Text should not contain repeated non space characters. https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html
  Each rule's failed checks are counted, not listed: run again with --verbose for each one, with what the PDF has there (a link's address, the line repeated characters are on), or check one PDF so with check-output.py --wcag --verbose --pdf.
  Left out at WCAG 2.1 AA, which --wcag-version and --wcag-level choose: verapdf-wcag:2.4.9-1, 2.4.9 Link Purpose (Link Only) (AAA), 1 failed check(s) in book.pdf.

With --verbose, given to convert.py, check-output.py, or audit.py beside --wcag (without it, --verbose changes nothing, and says so), each failed check is a finding instead, at its page (book.pdf#page=66; a span with nothing in it has none), and its detail says what veraPDF found (its message, with the text it was about and the structure element when it names them) and what the PDF has there that veraPDF's report doesn't say: for a link, its address, and its description when that isn't the address; for repeated characters, the line of text they're on, read with pypdf. The summary lists each under its rule's line, as the audit's report does under its rule's item. On Introduction to Sociology 3e, built before blanks were drawn as lines, at AAA:

  book.pdf: verapdf-wcag:1.3.1-1, 1.3.1 Info and Relationships (A): 106 failed check(s), pages 66, 106, 107, 149, 150, 151, 186, 187, and 41 more: Text should not contain repeated non space characters. https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html
    book.pdf#page=66: Text contains 10 repeated non space characters (on the line "__________ to study how society affects individuals.")
    book.pdf#page=106: Text contains 8 repeated non space characters (on the line "2. A measurement is considered ________ if it actually measures what it is")
  ...
  book.pdf: verapdf-wcag:2.4.9-1, 2.4.9 Link Purpose (Link Only) (AAA): 789 failed check(s), pages 70, 71, 72, 73, 74, 110, 111, 112, and 113 more: Links shall contain an alternate description via their Contents or Alt keys or in the text value. https://www.w3.org/WAI/WCAG22/Understanding/link-purpose-link-only.html
    book.pdf#page=70: A link annotation does not include an alternate description in the Contents or Alt Keys or in the text value (the link to https://www.flickr.com/photos/mariachily/3334450816/in/photostream/#/photos/mariachily/3334450816/in/photostream/lightbox/)
  ...

veraPDF is asked to list a rule's first 10,000 failed checks (it lists 100 unless told). It lists about 10,000 of a PDF's failed checks in all, though, PDF/UA's rules' among them, and past that only a rule's first (veraPDF 1.30.3, measured), so a rule's pages are those of the checks veraPDF listed, which its finding and its line say when it listed fewer than failed, and with --verbose one more finding says how many it didn't list. A book stays well under that: Introduction to Sociology 3e failed 895, built before blanks were drawn as lines.

Without the modules, veraPDF passes the profile's own rules unchecked and says nothing of it. So --wcag looks for them first, then checks a probe in the same run, a one-page PDF of its own made to fail rule 1.3.1-1. When the folder or a module's jar is missing, or the probe passes because the modules didn't load, a warning in the summary says so, and nothing from the profile is reported. When the profile a PDF needs is missing, the warning names the PDFs the checks didn't run on, and the others are checked; so it is with a profile without the rule the probe fails (veraPDF's 1.30 profiles have it), since the probe would pass it whether the modules loaded or not. veraPDF leaves other things unsaid that a warning says too: a wcag-validation of another version than veraPDF's, or two versions of a module in the folder; a run that ended without a report, with the exception veraPDF printed or the signal that stopped it; a PDF it left out of its report, as it does one it can't open by its name (a name outside ASCII where the locale isn't UTF-8, say); and an error it printed as it went, as its contrast check does when PDFBox can't draw a page, which may have left some checks undone. With nothing to check, check-output.py --wcag runs the probe alone, which checks the setup, and says which PDFs the checks run on: a PDF 2.0 file, a PDF 1.x file, or both, as the folder has their profiles; a check given pages and no PDF says there's no PDF to check, and --quick leaves the profile out with the other validators, saying so.

An audit keeps each PDF's findings from the profile in its cache, by where the PDF is and its SHA-256, and gives a PDF the profile again only when it has changed, or when veraPDF, the Java it runs, the folder VERAPDF_WCAG names, or TextbookImprover's check has (Auditing). The output check, which checks what a run has just made, keeps nothing.