Pattern
Test cases
One folder per case, with one CASE.md: an id kept forever and a one-line claim, carried into the test’s name.
When to use it
When a claim about the code needs a test to prove it, and you want an agent to get from the claim to its test, and back, without reading the suite.
Steps
- Make one folder per case, with one
CASE.mdin it. - Its frontmatter says
memex: casesand gives the case itsid, which is kept forever. The body’s first line is the claim. - Put the id in the test’s name, so
rgfinds it:it("NAME-001 class names are stable", …). - Writing a case before its test exists is fine; say so in the claim, “(planned)”.
A case
# tests/cases/NAME-001/CASE.md
---
memex: cases
id: NAME-001
---
Class names are stable across runs and platforms.
Evidence: `tests/namer.test.ts`Find the tests for X
# the claims
memex search stable class names --in cases
# the claim and who cites it
memex show NAME-001
# the test itself
rg NAME-001The id field is required: without it every CASE.md would take the id CASE from its file stem. memex search --in cases with no words prints the roster, and <-0 marks cases nothing cites.