diff --git a/.github/actions/run-gates/action.yml b/.github/actions/run-gates/action.yml index d64069df..f09bc791 100644 --- a/.github/actions/run-gates/action.yml +++ b/.github/actions/run-gates/action.yml @@ -160,6 +160,23 @@ runs: - name: Verify the command-line parser and the tools' cases (check_cli.mjs) shell: bash run: node scripts/check_cli.mjs + # The book's pdf-lib shims replace pdf-lib's parser, object classes and + # writer, and nothing else compares what they write with what pdf-lib + # writes. This saves one document with each, in child processes, and + # compares the two object by object with streams inflated; a shim that + # never runs fails it too. No browser, no built tree. + - name: Verify the book's pdf-lib shims against stock (check_pdf_shims_equiv.mjs) + shell: bash + run: node scripts/check_pdf_shims_equiv.mjs + # impexp.mjs and impexp.py are one published tool in two languages, and + # Tools.md promises the same output and the same bytes. Both built-in test + # suites, then one sequence of commands through each edition, comparing + # exit codes, output and written files. The runner's own python3 serves; + # without one the gate fails here, because GitHub sets CI=true, where + # test.bat on a machine without Python reports it skipped. + - name: Verify the two impexp editions agree (check_impexp_parity.mjs) + shell: bash + run: node scripts/check_impexp_parity.mjs # Graphviz sizes each node box from a width table; the browser paints the # label with a real font. Nothing in the build compares the two, so a # mismatch ships as text hanging outside its box on a green build -- which diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 85a28b39..e779c1e2 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -95,8 +95,8 @@ jobs: # links the offline rewrite missed), and _site-pdf/book.html # (informational). A failing check never aborts the build -- a # broken link still produces a site worth inspecting -- so the - # step fails on the exit code: 1 for link failures, 2 for - # integrity failures, 3 for both. + # step fails on the exit code: 1 when the check found a problem, + # 2 when the build could not run. run: node builder/tbdocs.mjs --src docs --no-fetch-assets --check-audit-index # The gates both workflows run, in one list: see # .github/actions/run-gates/action.yml, which check_ci_workflows.mjs diff --git a/WIP.Build.md b/WIP.Build.md index 6e34b590..86aad956 100644 --- a/WIP.Build.md +++ b/WIP.Build.md @@ -154,7 +154,7 @@ Older notes under `builder/PLAN-*.md` still place `check_publish_policy.mjs` and **The link and integrity check runs inside the build.** `build.bat` passes `--check-audit-index`, which implies `--check`, and the check walks the HTML on the worker lanes that produced it -- both trees' final strings are already decoded and in memory at `flush()`, so the ~270 MB the two trees weigh is never written out only to be read back. It also audits the tree index the build derives from its own records against what landed on disk -- the one direction the two-checker comparison structurally cannot see, since a spurious entry makes the oracle answer "exists" for a path that 404s in production. It catches broken intra-site links, missing pages, malformed `redirect_from` entries (the most common breakage when adding new pages or moving content between sections), duplicate ids, remote ``, badly nested tags, sitemap and search-index gaps, canonical mismatches, and (via a forbidden-prefix rule on the offline tree) any extracted link that still points at the live docs site after the offlinify rewrite. A clean `build.bat && check.bat` is the bar for "ready to commit". -A failing check never aborts the build: a broken link still produces a site you want on disk to inspect. It sets the exit code instead, using the same scheme `check_links.mjs` has always used -- 1 for link failures, 2 for integrity failures, 3 for both -- so CI can tell them apart. +A failing check never aborts the build: a broken link still produces a site you want on disk to inspect. It sets the exit code to 1 instead, whether the check found link failures, integrity failures or both (the summary lines say which), and keeps 2 for a build that could not do its job: the same scheme `check_links.mjs` uses. A 2 means a refused command line, a stall or a crash. The remote-asset rule fails the run on any `` resolving off-box (`http://`, `https://`, or protocol-relative `//host`). In the build it is unconditional -- `checkRemoteAssets: true` on both trees in `builder/check.mjs`'s `TREES` -- and is *not* reachable by a flag: `tbdocs` rejects `--check-remote-assets` as an unknown argument. That name belongs to the standalone `scripts/check_links.mjs`, where it is opt-in. The PDF pass over `book.html` is informational, so enforcement comes from the `_site/` pass -- every page in the book is also in `_site/`, making it a superset. The check is deliberately scoped to `` only; `