The canon, as code

Every rule cites its page.

The books were read cover to cover and encoded as assertions; the test suite reproduces the books' own dimensioned grids — the 8-field, 20-field and 32-field A4 reference grids exactly as printed. When the library and the book disagree, the book is right. A sample of the rules in force:

The ruleSource
No half lines in typography: every vertical distance is whole linesMB 58–59
Field height is a whole number of text lines; gutters are empty linesMB 64, 134
The narrower the column, the smaller the typefaceMB 57
Seven to ten words a line; 8–12 pt for the text of booksMB 18, 30–31
Cross‑size register: every style's line height meets one moduleMB 59, 66
A picture's width matches the width of a column of textMB 63
The band under a captioned picture grows in whole body linesMB 64
Captions belong in the caption column, beside their pictureMB 63, 87, 120
The margin column sits at the outer edge, and mirrorsMB 55
Few graded picture sizes; one picture may dominateMB 11, 70
The type area floats high: mass may not sinkMB 51
Lines may be set flush right and left — but never the lastMB 80
The mobile grid: one unit count, many simultaneous divisionsGerstner 58–61
The morphological box: the parameter space, enumeratedGerstner 59

Sources: Josef Müller-Brockmann, Grid Systems in Graphic Design (Niggli, 1981); Karl Gerstner, Designing Programmes (Niggli, 1964). The books are not in the repository — buy them, they are worth it. The compiled specification lives in research/foundations.md.