Skip to main content
A scenario is a markdown file in your repository that describes what should happen during a session and how to tell if it worked. Scenarios replace the usual test-suite grammar (arrange-act-assert in code) with a grammar that both humans and coding agents can read, write, and reason about.

The shape

Every scenario has five sections. Three are required, two are optional.

A complete example

Run it:

check vs judge

Every success criterion is tagged either check: or judge:.

check — deterministic

Programmatic assertion against mirror state. Instant, free, exact. Used for anything you can count, compare, or pattern-match.

judge — probabilistic

LLM judgment from the trace and final state. Bounded cost, used for subjective calls like tone, appropriateness, or “does error handling exist” (beyond just counting).
A good scenario leans on check: for everything verifiable and uses judge: sparingly for the subjective things only.

When Mirra infers the tag

If a criterion has no explicit check: or judge: prefix, Mirra infers one based on the wording:
  • Has numbers or concrete state (“exactly 3”, “was delivered”, “the from address is”) → check.
  • Vague or subjective (“appropriate”, “clear”, “polite”, “handles gracefully”) → judge.
You can always override:
See Evaluation reference for the full rules.

Seeds — starting state

A scenario starts from a seeded state. Three ways to supply it:
The plain-English ## Setup section is parsed by a small LLM that emits the seed state directly to the mirror. Zero configuration. Best for “any reasonable scenario” tests.

Statistical satisfaction

Set runs: N in ## Config to execute the scenario N times. Each run resets to fresh state between iterations (via mirra reset).
The output is a satisfaction score — a mean percentage of criteria passed across runs.
This is the shape of output that handles agent-generated code gracefully — one flaky run doesn’t fail your CI, but two flaky criteria across five runs is a signal worth acting on.

Where scenarios live

Scenarios are plain markdown files in your repo. Put them wherever you keep tests:
Mirra doesn’t care about the path — mirra run takes an explicit path. Teams usually put them in scenarios/ to keep them separate from unit tests.

Where to go next

Write your first scenario

End-to-end walkthrough: scenario file → mirra run → CI gate.

Scenario format reference

Every valid section, every valid config key, every edge case.

check vs judge deep dive

Exactly how Mirra grades criteria. Cost model. Failure modes.

mirra run

The CLI command that executes scenarios.