🧪Lesson 08AI Engineer Loopcraft Workshop 2026
Shadow the next decision before you trust it
Use the same event file and check command while a small XState candidate machine says the next state and reason. The current checker still decides.
You do not hand the next decision to code you have never watched decide. By now the checker can read events, build the issue summary, show state, claim ready work, clean up after itself, and ask for review — but one path still owns the next state, and that ownership should be earned in the open. So we add a small candidate check and run it in shadow mode beside the current one: same input, same checks, its own answer, and a receipt that shows where the two agree or disagree. The current code stays in charge until the receipts keep matching. Only then does the candidate get to decide for real.
Your next move
You already have
- The current checker, event file, check command, status output, dispatch receipts, and read-only review path.
- Enough evidence to compare a new decision path without letting it drive the loop.
Add now
- A small XState candidate machine (or transition table on the way to one) that returns the next state and reason for one issue event.
- A compare command that runs the current checker and candidate check against the same input.
- One normal comparison receipt and one recovery drill receipt.
Stop before
- Replacing the current checker with the candidate check.
- Letting the candidate write to GitHub, APIs, product files, timers, or parallel worktrees.
- Moving past a mismatch without explaining it.
Tiny compare-only receipt shape
mode: compare-only
inputEvent: ISSUE-001 ready
currentDecision: ready -> dry-run claim allowed
candidateDecision: ready -> dry-run claim allowed
agreement: yes
currentCheckerStillInCharge: true
recoveryDrill: stale claim -> stopped with reasonStarter prompt
Starter prompt
Use the event file and check command from earlier lessons. Add a small XState candidate machine — explicit states and transitions, not scattered booleans — that returns the next state and reason for one issue; read .agent_sources/xstate for idiomatic setup and actor usage first. Run it beside the current checker as a compare-only check. Save a receipt with inputEvent, currentDecision, candidateDecision, agreement, reason, current checker still in charge, and one stale/failed/interrupted recovery case. Do not let the candidate machine write to GitHub, APIs, product files, timers, or parallel worktrees yet.Build checklist
0/4 done
Write the candidate check
Compare beside the current checker
Record agreement or mismatch
Drill recovery
Proof to save
Save proof that the candidate check matches one normal decision and one recovery case without taking over.
- A small XState machine (or a transition table on the way to one) returns the next state and reason from one issue event.
- The compare command runs the current checker and candidate check against the same input.
- A compare-only receipt shows inputEvent, currentDecision, candidateDecision, agreement, reason, and current checker still in charge.
- One recovery drill proves stale, running, failed, or interrupted work stops with a reason.
- mode: compare-only; current checker stays in charge
- inputEvent: event or issue inspected
- currentDecision: current checker result
- candidateDecision: candidate check result
- agreement: yes / no plus reason
- recoveryDrill: scenario and result
- nextAction: keep comparing, fix mismatch, or promote later
Done when
One compare-only receipt shows the current checker and candidate check agree for a normal issue, and one recovery receipt shows stale, failed, or interrupted work stops safely.
Why it matters
- Risk reduced: the candidate decision is visible before it can decide anything.
- Temptation avoided: swapping in a new controller before its answers match the current checker.
- Do not automate yet: parallel worktrees, timers, provider switching, or real reviewer launches.
Try this 🔨
For one issue, name the event read, the current checker decision, and the candidate check decision.
Exploration prompts
Use these when you want to ask an agent for a narrower pass instead of handing it the whole lesson.
Name the candidate check
List the events, checks, actions, command, and receipt path. Model it as a small XState machine — states, events, transitions — then say which current checker code remains in charge.Compare decisions
Run or simulate one issue through the current checker and the candidate check. Write a comparison table: input, currentDecision, candidateDecision, agreement, reason, and receipt path.Practice recovery
Pick one bad state: stale claim, failed check, interrupted run, or missing receipt. Describe the recovery event, next safe action, stop message, and proof that the checker stopped safely.