Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The Commandments now run against the code they govern

Last edited: 2026-08-21 · #103, #166

The architecture rules are the standing law for everything under src/xmris/ — and the law had quietly stopped describing the land. Commandment 3 bans descriptive strings from .attrs, yet the vocabulary itself blesses baseline_method="als". The module map files processing/ under core/, where it does not live. The page’s teaching template stacks two decorators no real function combines and records a lineage attr that does not exist in config.py. Each drift was invisible for the same reason: the page is prose, hand-copied from code that kept moving, and nothing could ever fail (#72).

What makes it drift-proof

The page stops carrying hand-copies. Each numbered rule states its law in a few lines plus one line naming its enforcer — the test class that guards it, or “reviewer checks” where none does. Three rules the tests already enforce but no Commandment stated join as 9–11: thin accessor delegators, errors that end with a copy-pasteable fix, and the # xmris-diagnostic-dim escape hatch. Ordinals 1–8 stay stable, because code and tooling cite them by number.

The exemplars are {literalinclude}s of the real apodize_exp and to_ppm — but an unmatched anchor only warns in mystmd, so a hidden cell pins both slices with inspect.getsource asserts (which do return the decorated source, decorators included) and runs the pipeline the page preaches:

fid = xmris.simulate_fid(...)  # reference_frequency and carrier_ppm set
spectrum = fid.xmr.apodize_exp(lb=5.0).xmr.to_spectrum().xmr.to_ppm()
assert spectrum.attrs["apodization_lb"] == 5.0  # lineage — Commandment 3, live

Commandment 3 itself is rewritten to the law the code actually follows: preserve, then append the parameters applied — scalars, config-blessed strings, lists — and never a state flag. The open provenance question (xmr_history, #64) stays open; the page links it rather than pre-empting it.

Why not keep patching the page in place?

It preserves the “System Instructions for the LLM” framing on a public site page, and the ~60–70% of content duplicated from CLAUDE.md, the skills, and the explainers — the very sync burden that produced this drift. Patching buys one accurate snapshot; the next drift starts immediately.

Why not dissolve the page entirely?

The numbered Commandments are cited by ordinal from code comments and tooling, and the skills this branch just shipped route to “the one canonical doc” per concept. Dissolving removes the citeable home everything was just pointed at, for the price of re-homing every rule anyway.

What changed from the plan