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
Statistics have the size of 1, 2, 3 or 4 grid fields, so a chart's bars are whole text linesMB 14, 58–59
A title is set in its own face, on whole slots of the register; eight canonical placementsMB 46–47, 87
Empty spaces around titles are whole lines; the rest zone gives a title its importanceMB 69–70
A paragraph announces itself by an empty line, an indented first line, or an initialMB 34, 36
The centred axis is one of the six settings of textMB 79
A cut-out is tied down by a tint beneath, a field border, bracketing rules, or an overprintMB 98
The type area may stand in a 1:2 relation to the paper area; wide spines for thick booksMB 51
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 stay out of the repository; buy them, they are worth it. The compiled specification lives in research/foundations.md.