Test discipline

How this project decides what "worked" means. Two rules — one about which failure modes get named, one about how substrate-quality claims are validated. Both rules are cheap; both were expensive to learn.

Rule 1 · Name the failure, twice

Rule For any property the system claims, name it with two tests — one guarding against death, one guarding against absence of the property. If only one exists, the other failure mode is silent.

The pattern: anti-collapse test + toward-target test. Both must be green. Each red points at a different defect class.

TestWhat it guards againstFails when
Anti-collapse Death — network collapses to uniform firing Trained L1 < 30% of baseline L1
Toward-target (null discriminator) Absence of learning — decay-with-bias reads as steering Real training doesn't beat shuffled-label null across 10 seeds

The anti-collapse test alone passes when nothing is learned. It will keep passing when the topology work lands and does nothing. That's why it needs a companion. The pattern generalizes: any claim of the form "X works" needs both "not-X hasn't happened" AND "X specifically has happened, not something that resembles it from outside."

Rule 2 · Substrate claims need a null control

Rule Every substrate-quality claim needs (a) distribution across ≥10 seeds, not one; (b) a null-hypothesis control that shares everything except the thing being tested; (c) normalization against total activity so decay-with-bias can't disguise itself as steering.

Origin story: an earlier version of the toward-target test XPASSed on seed 29 with +0.65 signed movement. That was updated in the moment as "the loop is steering." A 10-seed sweep with a shuffled-label null retracted the claim — the null won by a factor of 90×. See The substrate finding.

The rule has three parts because each part catches a distinct failure mode:

Baking all three into the test itself — not into an analysis notebook — is what keeps the discipline enforceable after the writer leaves.

The 16-test suite

Grouped by what they guard:

Substrate mechanics (5)

Router (3)

Training + stability (5)

Persistence (1)

Substrate claims (2)

Total: 15 pass 1 xfail(strict). Runtime under 20 seconds including the 10-seed sweep.

On xfail(strict=True)

Why strict @pytest.mark.xfail(strict=True) means the test is expected to fail AND an unexpected pass hard-fails CI. This is the right shape for an open commitment.

A test marked xfail without strict=True silently accepts either outcome. That is worse than no test at all — it encodes "we don't care about this property" while looking like caring. strict=True says: "when this passes, that IS the event, and CI must fail so the human notices and either removes the xfail marker (locking in the new invariant) or investigates the false pass."

The toward-target test uses this. When curated topology is added and real training genuinely beats the shuffled-label null, the test will XPASS, CI will fail red, and the next commit removes the xfail marker and turns it into an ordinary assert. The invariant is now enforced going forward.

This is how the promise stays enforceable across sessions, contributors, and quarters — the test itself carries the commitment, and pytest's strict mode makes silent drift impossible.