Under the hood
We don’t code every card.
We read them.
There are tens of thousands of cards, and hundreds more arrive every few months. Hand-scripting each one doesn’t scale — and worse, hand-scripted cards drift out of date and disagree with each other. So this engine is built differently.
Two layers
The rules core knows the game — priority, the stack, combat math, replacement effects, state-based actions — but knows nothing about any individual card. The synthesis layer reads each card’s official rules text and composes its behavior out of small, verified building blocks: triggers, costs, filters, effects. A new card that’s made of known pieces just works, the day its text is available.
The strict part: exact-or-nothing
A card is only playable with rules enforcement when every clause of its text is modeled. If the engine understands three of a card’s four abilities, it claims none of them — a card that mostly works is worse than a card that honestly says “not yet.” Every claim names the exact rule it implements, and anything the engine can’t claim precisely is deferred, visibly:
How we keep ourselves honest
- Recorded games replay byte-for-byte. Whole four-player games are pinned; any rules change that alters a single decision in a recorded game must be explained and justified, or it doesn’t land.
- Every claim is attacked before it’s trusted. A separate adversarial pass tries to refute each new card model — wrong-claim hunting, not just testing the happy path. It regularly finds real bugs.
- The comprehensive rules are the spec. Each building block cites the exact rule it implements, and simulated games run continuous invariant checks against them.
- Coverage is measured, never estimated. The whole catalog is re-verified continuously; the number on the dashboard is computed, not typed.
Then we found out the official client works the same way
After settling on this architecture, we read an engineering post by the team behind the game’s official digital client — “On Whiteboards, Naps, and Living Breakthrough” (Alex Werner, 2023). Their rules engine, too, knows nothing about individual cards; a parser turns card text into rules, and roughly 80% of new cards work automatically. The line that stuck with us: “almost none of the work we ever do is just for one card.” That’s exactly how we build — every new capability is a reusable piece, and whole families of cards light up at once. Where our approach differs: they finish the last stretch by hand; we hold the exact-or-nothing line and defer instead.
Inspiration & provenance
The engine is a clean-room implementation built from the publicly published comprehensive rules. Long-running open-source rules engines were studied as behavioral references for tricky edge cases — never as source. Card data and imagery are served via Scryfall. The engine plays thousands of full four-player games against itself as its own regression net.