check-exercise-background.yml
Diff-scoped, warn-only heuristic check that flags an exercise whose title names an object that its body never mentions. The lab’s rule (Ezra, 2026-10-29) is that an exercise body gives the background its title implies: for “Maximizing a gamma-family kernel”, the body says what a gamma distribution and its kernel are, links them, and says why anyone maximizes one.
The check looks at each exercise div (#exr-...) with a heading title. A content word of the title counts as present when a word in the body shares its first five letters, so “Maximizing” matches “maximum”. Generic task verbs such as find, compute and classify, math in the title, code fences and HTML comments are ignored.
It is a heuristic. A title word that the body expresses with a synonym is reported too, which is why the check warns by default.
An untouched exercise is never reflagged. With no base ref the check skips instead of scanning the whole tree; whole-tree measures a corpus.
Usage
Copy examples/check-exercise-background.yml to .github/workflows/ in your repository.
Inputs
| Input | Default | Meaning |
|---|---|---|
globs |
*.qmd |
Space-separated git pathspecs of tracked files to check |
fail |
false |
Fail the workflow on a finding instead of warning |
whole-tree |
false |
Scan every exercise, not only a PR’s additions |
runs-on |
empty (CI_RUNNER variable, else ubuntu-latest) |
Runner label; self-hosted only for a private repository |
python-version |
3.x |
Python version to set up |