🧪Lesson 06AI Engineer Loopcraft Workshop 2026
Let cleanup propose one follow-up
Let the checker propose one maintenance event, then prove it stops when the repo or queue is not safe to touch.
The cleanup command may inspect a short list of maintenance facts and create at most one issue event. If the repo is dirty, the checker is running, or a matching follow-up already exists, it prints the reason and exits without editing product files.
Your next move
You already have
- A local queue, stop reasons, claim receipts, and proof that dry-runs can avoid product edits.
- A need for boring maintenance without turning cleanup into an unbounded agent.
Add now
- Pass 1: dry-run one allowed maintenance event and print the exact event it would write.
- Pass 2: apply one event only after every stop check passes.
- A second run that refuses the duplicate follow-up and records the stop message.
Stop before
- Scanning broadly or proposing more than one maintenance event.
- Applying when jj status is dirty, the checker is running, the follow-up already exists, or any event needs approval/input.
- Editing product files as part of cleanup.
Tiny two-pass cleanup shape
pass: dry-run
candidate: stale receipt link
wouldWrite: MAINT-001 update receipt link
writtenEvents: []
pass: apply
stopChecks: clean repo, checker idle, no duplicate, no approval/input blockers
writtenEvents: [MAINT-001]
duplicateCheck: refused — matching follow-up already existsStarter prompt
Starter prompt
Add a cleanup command that can propose at most one maintenance issue event. Keep it as two passes: first dry-run one allowed maintenance event and print the exact event it would write; then allow apply to write one event only after every stop check passes. Refuse to apply when jj status is dirty, the checker process is running, the queue already has a matching follow-up, an event needs approval, or an event needs more input. Save a receipt with inspected files, proposed event id, written event id if any, duplicate check result, and the exact printed stop message.Build checklist
0/4 done
Define allowed maintenance
Pass 1: dry-run one event
Pass 2: guarded apply
Prove duplicate protection
Proof to save
Save proof that the cleanup command can propose one event, write at most one event, and refuse unsafe runs.
- A dry-run cleanup command prints the issue event it would write without changing files.
- Apply mode can write one fully formed maintenance event when every stop check passes.
- Dirty repo, duplicate follow-up, running checker process, approval-required work, and input-required work stop the command visibly.
- A receipt records what it saw, what it proposed, and why it stopped.
- mode: dry-run or apply
- inputsSeen: files/events inspected
- proposedEvents: event ids or summaries
- writtenEvents: event ids, if any
- stopMessages: exact messages printed when the command refused to run
- duplicateCheck: result of second run
- nextAction: approve, fix input, or leave it alone
Done when
Dry-run prints one proposed event, apply writes at most one event, and a second run refuses the duplicate with a saved receipt.
Why it matters
- Risk reduced: cleanup cannot touch the repo freely or create duplicate work.
- Temptation avoided: turning cleanup into a catch-all agent.
- Do not automate yet: broad file edits, unbounded scanning, or automatic product changes.
Try this 🔨
Read one printed stop message and say what you would do next: approve, fix the input, or leave it alone.
Exploration prompts
Use these when you want to ask an agent for a narrower pass instead of handing it the whole lesson.
Find boring maintenance
Scan the repo for maintenance facts the cleanup command may notice: stale receipt, missing link, outdated status, duplicate follow-up, or incomplete event. Return candidates only; do not edit.Define boundaries
Write the allowed maintenance types and exact stop messages for the cleanup command. Include dirty repo, running checker process, duplicate follow-up, approval-required work, and missing input.Dry-run one event
Take one maintenance candidate and show the exact event the cleanup command would write in dry-run mode. Explain why apply should or should not be allowed.