Skip to content
brainNotFound

AI Automations/Quality

A minimal evaluation harness for content automation

Fifty fixtures, three assertions each, and a CI gate — enough to catch a prompt regression before it publishes.

advanced40 min

// read first

Prompt changes are code changes with none of the safety. Without fixtures you find out a prompt regressed when someone reads the output — which, in a publishing pipeline, is after it is live.

This harness is deliberately small. Fifty fixtures is enough signal to catch the regressions that matter and few enough that the suite runs in under a minute.

Structure

evals/
evals/
├── fixtures/
│   ├── 001-simple-doc.md
│   ├── 002-tabbed-code.md
│   ├── 003-steps-and-callouts.md
│   └── ...
├── expected/
│   └── 001-simple-doc.json        # golden Portable Text
├── assertions.ts
└── run.ts

The three assertions

  1. Structural — the output parses as valid Portable Text and every block has a _key.
  2. Semantic — heading levels are monotonic, every image has alt text, every internal reference resolves.
  3. Golden — for a fixed input, the output matches the committed snapshot, ignoring generated keys.

The third catches drift. The first two catch the failures that would corrupt a document even when the shape is stable.

Running the suite
# whole suite
npx tsx evals/run.ts

# one fixture, verbose
npx tsx evals/run.ts --only 002 --verbose

# accept new snapshots after an intentional change
npx tsx evals/run.ts --update