check-corollary-sources.yml
Diff-scoped, warn-only check for the lab’s rule (Ezra, 2026-11-16; psw’s Using theorem environments in Quarto section) that a corollary follows directly from one earlier result and names that result. A corollary that names nothing leaves the reader to guess what it follows from, and is usually a proposition typed as a corollary.
The check flags a #cor- div whose statement and proof name no earlier result. A result is named by either:
- a cross-reference such as
@thm-id,@lem-id,@cor-id, or@prp-id; or - a Markdown link whose target ends in such an anchor, on this site or another one.
The check reads the corollary’s proof in any of three places:
- a
.proofdiv nested in the corollary; - a
.proofdiv that follows the corollary with only blank lines between; - a
.proofdiv inside a wrapper div with no id, such as.content-hidden, that follows the corollary.
The corollary’s own id does not count, and neither does a citation inside a comment or a code fence. A corollary that follows from a definition or an axiom alone is exempt with <!-- check-corollary-sources: allow: reason --> in the div or its proof; a pragma with no reason does not exempt it.
Whether a result is central, smaller, or a proof step is a judgment that no pattern can make, so the rest of the rule is a review item.
A corollary is checked when the pull request adds a line inside it or its proof. With no base to diff against, the check skips instead of scanning the whole tree. It only warns by default; set fail: true after a measured corpus shows no false positive.
Inputs
| Input | Default | Meaning |
|---|---|---|
globs |
*.qmd |
Git pathspecs of tracked files to check (recursive) |
paths-ignore |
none | Comma or newline separated globs to skip |
fail |
false |
Fail on a finding; false warns |
whole-tree |
false |
Check every corollary, to measure a corpus |
python-version |
3.x |
Python version |
runs-on |
empty (CI_RUNNER variable, else ubuntu-latest) |
Runner label; a self-hosted label only for a private repository |
Usage
Copy examples/check-corollary-sources.yml to .github/workflows/check-corollary-sources.yml.