MAKER = Maximal Agentic decomposition + ahead-by-K voting + Error correction + Red-flagging
Implementation of the MAKER framework applied to Dominion. MAKER solved Towers of Hanoi with 20 disks (>1M steps) with zero errors. This applies the same approach to a deck-building card game with 200-400 decisions, hidden information, and strategic depth.
Non-commercial research — Dominion © Donald X. Vaccarino / Rio Grande Games.
LLMs make mistakes on long sequential tasks. MAKER fixes this with multi-model voting on atomic steps:
- 8 LLMs (Claude, GPT, Gemini, Mistral) receive game state
- Each votes for an action in parallel
- Invalid actions filtered (red-flagging)
- First action k votes ahead wins (early termination)
- Engine executes, repeats
Event-driven with full undo — designed for consensus research.
The engine emits immutable events (CARD_PLAYED, TURN_STARTED). State derives from events. Every event tracks causality (causedBy links effects to cause). This enables:
- Rewind to any decision, replay with different models
- Atomic undo — action + all its effects in one operation
- Deterministic replay — shuffles stored for perfect fidelity
- A/B test consensus — same game state, different voter configs
Cards describe what happens next. One runner handles the order, pauses for choices, and saves unfinished work.
flowchart TD
Command[Player or AI command] --> Validate[Validate the command]
Validate --> Runner[Run the next stack frame]
Runner --> Card[Card program]
Card --> Done[Finish with events]
Card --> Choice[Ask a player and save local memory]
Card --> Children[Schedule child work]
Done --> Next{Work remains?}
Children --> Next
Next -->|Yes| Runner
Next -->|No| Finished[Command finishes]
Choice --> Save[Record choice and execution checkpoint]
Save --> Answer[Player answers, possibly after reload]
Answer --> Validate
When no work remains, the command finishes. For example, Throne Room → Remodel moves one Remodel into play, then completes its trash-and-gain choices twice. The second play waits until the first finishes; both survive save/load.
See the visual engine walkthrough for stack snapshots, reaction flow, and the contract for adding cards.
Real-time visualization of multi-model voting with 4 tabbed panes:
- Voting — vote breakdown bars, color-coded model dots, valid/invalid badges per action
- Performance — timing waterfall (ms per model), fastest/slowest highlighting, aborted calls
- Reasoning — each model's reasoning grouped by action voted for
- State — game snapshot at decision time (phase, resources, hand, cards in play)
bun install
echo "AI_GATEWAY_API_KEY=your-key" > .env
bun run devhttp://localhost:5173 — configure models, voter count (1-16), k-value.
Preact, TypeScript 7, Bun, Vite 8, Vercel AI SDK 7
Type checking uses TypeScript 7 through the @typescript/native alias. The
typescript dependency aliases @typescript/typescript6 to provide the compiler
API required by typescript-eslint.
- Validation:
bun run checkruns tests, build, type checking, lint, formatting, dependency checks, and circular-import checks - Bundle: 134 KB gzipped (72% compression), smart preloading, AVIF/WebP images
- Multiplayer: Real-time via PartyKit (WebSocket + edge)
- Dev tools: Event scrubber for time-travel debugging
MIT (LICENSE) — MAKER framework: Cognizant AI Labs