Skip to content

ci: build the book in a docs job, failing on the errors mdbook build lets through - #206

Merged
aRustyDev merged 5 commits into
mainfrom
ci/docs-job
Nov 16, 2026
Merged

aRustyDev merged 5 commits into
mainfrom
ci/docs-job

Conversation

@aRustyDev

Copy link
Copy Markdown
Owner

The fourth of the review's smaller CI fixes (.agents/plans/cicd-review/PLAN.md): build the book in CI.

Why

The book (docs/, mdBook) wasn't built in CI. mdbook build exits 0 on a broken {{#include}} and on a mistyped book.toml key, and it silently leaves out a page that SUMMARY.md doesn't list. So a green build alone proves little.

What

  • scripts/check-book.sh builds the book into a temp directory. It fails on any log line starting ERROR, and on any page under docs/src/ that SUMMARY.md doesn't list.

  • --self-test is the check's own control. It copies everything the book reads (docs/, AGENTS.md, .config/branding/) and breaks the copy four ways; each must be refused:

    • a broken include;
    • a mistyped [output.html] key;
    • the mermaid preprocessor missing;
    • a page not in SUMMARY.md.

    The restored copy must then pass again.

  • A new docs job in ci.yml runs both.

    • mdBook 0.5.4 and mdbook-mermaid 0.17.1 come from taiki-e/install-action. The workflow already uses it, pinned, for nextest and cargo-deny, and its manifest has SHA-256 hashes for both versions.
    • mdbook-mermaid 0.17.1 is the release that targets mdBook 0.5.
    • The preprocessor is not marked optional: an optional one would let the build go green with the diagrams shipped as raw code blocks.
  • The gate: plan-ci.py and assert-gate.sh gain a tenth job, docs, and the gate now needs it.

  • What runs the job: changes to docs/, AGENTS.md (the book includes its testing rules), .config/branding/ (its palette) or the check itself, plus every full run. Nothing else does.

  • Docs: cicd.md, running.md, standards.md (the book's gate now runs in CI, with its controls), book-theme.md.

Tests

  • The book as it stands: no ERROR lines; 36 of 36 pages are listed in SUMMARY.md.
    • This was run locally with a pass-through stand-in for mdbook-mermaid, which isn't installed on my machine; installing it there is your call. The real preprocessor runs in CI.
  • The self-test, locally: each of the four broken copies is refused, and the restored copy passes.
  • 5 hand mutants of check-book.sh, each caught by its own self-test.
  • test_plan_ci.py: 4,898 checks, with the new rules and the book's cases.
  • test-ci-scripts.sh: 109 checks, covering the gate over ten jobs.
  • The 34 mutants of the planner and the gate are all still caught.
  • Every ci-scripts test and deps guard passes under dash (37/37).

Not verified until CI runs it

The real mdbook-mermaid (0.17.1) against this book, and the install-action download. This PR changes ci.yml, so its own run is a full one and includes docs.

Overlap

This PR touches the same files as #202, #204 and #205: ci.yml, plan-ci.py, test_plan_ci.py and cicd.md. Whichever merges later will need main merged in, and I'll do that.

Refs: #49

🤖 Generated with Claude Code

aRustyDev and others added 5 commits November 15, 2026 23:27
…d lets through

The book (docs/, mdBook) was not built in CI. A broken {{#include}}, a
mistyped book.toml key or a page SUMMARY.md does not list reached main
unseen. `mdbook build` exits 0 on all three.

- scripts/check-book.sh builds the book into a temporary directory.
  It fails on any line of the log starting ERROR, and on a page under
  docs/src/ that SUMMARY.md does not list.
- Its --self-test breaks a copy of what the book reads (docs/,
  AGENTS.md, .config/branding/) four ways, and each must be refused:
  - a broken include;
  - a mistyped [output.html] key;
  - the mermaid preprocessor missing;
  - a page not in SUMMARY.md.
  The restored copy must then pass again.
- ci.yml: a `docs` job runs both. mdBook 0.5.4 and mdbook-mermaid
  0.17.1 (which targets mdBook 0.5) come from taiki-e/install-action,
  already pinned for nextest and cargo-deny; its manifest carries
  SHA-256 hashes for both versions.
- The gate needs the job.
- plan-ci.py and assert-gate.sh know a tenth job, `docs`. docs/,
  AGENTS.md (the book includes its testing rules), .config/branding/
  (its palette) and the check itself run it. Nothing else does, and
  everything that runs everything runs it too.
- Docs: cicd.md, running.md, standards.md (the book's gate now runs in
  CI, with its controls), book-theme.md.

Tests:
- The book as it is: no ERROR, 36 of 36 pages listed. Run locally with
  a pass-through stand-in for mdbook-mermaid, which is not installed
  here; the real one runs in CI.
- The self-test, locally: all four broken copies refused, the restored
  copy passes.
- 5 hand mutants of check-book.sh, each caught by its self-test.
- test_plan_ci.py: 4898 checks, with the new rules and the book's
  cases.
- test-ci-scripts.sh: 109 checks, the gate over ten jobs.
- The 34 mutants of the planner and the gate, each still caught.
- Every ci-scripts test and deps guard under dash: 37/37.

Refs: #49
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	.github/scripts/plan-ci.py
# Conflicts:
#	.github/scripts/plan-ci.py
# Conflicts:
#	docs/src/architecture/cicd.md
# Conflicts:
#	.github/scripts/plan-ci.py
#	.github/scripts/tests/test_plan_ci.py
@aRustyDev
aRustyDev merged commit 95bc954 into main Nov 16, 2026
72 of 74 checks passed
@aRustyDev
aRustyDev deleted the ci/docs-job branch November 16, 2026 15:51
aRustyDev added a commit that referenced this pull request Nov 16, 2026
…it (stage 0.5) (#230)

* docs(plans): record the owner's answers on Phase 0 of the CI split

The callee's final job is `verdict`; the mutant driver runs in ci-scripts;
actionlint is added as a pinned check; Prof is in the Low group. PLAN.md and
phases/0001-foundation.md say so where each applies (stages 0.1, 0.3 and 0.4,
invariant 6, the status table) and no question is left open.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* docs(plans): measure what ci costs today, the baseline for the CI split

Stage 0.5 of Phase 0: scripts/ci-baseline.py reads GitHub's run and job records
of ci.yml and prints the cost per job and per run; research/0017-ci-baseline.md
holds the result (18 full and 5 affected-only runs since the job set last
changed, in #206) and how it was measured. A full run takes a median 766 s of
wall clock and 4552 runner-seconds, 70% of them in the 25 contract cells.

Probing the API changed the method three times, each recorded in the script's
header and covered by its self-test (38 checks; 11 planted bugs, all caught):

- GitHub lists a job that passed in attempt 1 again under each later attempt,
  with a new id and its original timestamps, so an execution is a job name and
  its start time; counting entries double-counted the carried-over jobs.
- A push to main queues behind the previous main run, so a run's wall clock is
  split into the wait before its first job and the execution span. It matches
  GitHub's run_duration_ms within a second on three runs.
- A run with three attempts (108 jobs) makes the jobs endpoint answer 502 at
  per_page=100, so the pages are 30.

Docs and a plan script only: plan-ci.py plans no job for this diff.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant