Skip to content

starts: the loop's inbox read takes only step 3's MAILBOX line, settled before any Resume or loop jump (#109) - #156

Merged
deanbot merged 2 commits into
mainfrom
109-mailbox-before-resume
Nov 2, 2026
Merged

deanbot merged 2 commits into
mainfrom
109-mailbox-before-resume

Conversation

@deanbot

@deanbot deanbot commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

What changed and why

In a resume start, the executor's step 4 sends the session to Resume, and Resume ends by entering the loop, whose step 0 reads the inbox. When the mailbox check was a later step of its own (step 5, inbox.mjs --check), a model that followed the arrow literally read the inbox before the check. That check exists to refuse an inbox inside the clone, where PR code could write it.

#128 moved the mailbox check into the start check (step 3, start-check.mjs), which runs before step 4. Its MAILBOX <inbox> or NO_MAILBOX line decides the mailbox. So the order is already safe; what was missing is the link in the text and a test that keeps the order:

  • The loop's step 0 in all three Claude Code starts (executor, reviewer, QA) reads only the <inbox> from this start's step 3 MAILBOX <inbox> line, which the start check settles before any later step can send the session there.
  • The executor's Resume jump in step 4 says the mailbox is already settled. Each start's step 5 says the mailbox was decided before step 4 could send the session anywhere, and that no inbox is read on any other word.
  • Generic and Kiro have no mailbox: their start check always prints NO_MAILBOX, and no text of theirs reads an inbox. No change there.

Also: the superseded stop. In all three Claude Code roles, "stop the running waiter with TaskStop" becomes "stop the waiter with TaskStop if one still runs; a waiter that exited 4 has already ended". A live check showed a superseded reviewer's TaskStop failing on a waiter that had already exited 4 (TAKEN_OVER): a takeover usually ends the old session's waiter before the old session learns it was superseded. Test: "superseded stop: every Claude Code role stops the waiter only if one still runs".

Done, and the checks that show it

  • No path from the start to the loop's inbox.mjs --dir passes outside the mailbox step, in any of the three adapters.
  • The contract test asserts that the mailbox step comes before the first Resume or loop jump, and that the executor's Resume jump names it. It is the first test above.

Mutation-checked, each failing the first test:

  • step 0 back to its old wording;
  • a loop jump placed before step 3.

Calls a reviewer might push back on

Restart note

All three Claude Code roles (executor, reviewer, QA) need a fresh session to pick up the text. Generic and Kiro: none. Setup doesn't need re-running.

Closes #109

@deanbot
deanbot marked this pull request as ready for review November 2, 2026 03:31
@deanbot
deanbot merged commit 540fac1 into main Nov 2, 2026
8 checks passed
@deanbot
deanbot deleted the 109-mailbox-before-resume branch November 2, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Executor start: the Resume jump in step 4 can skip the mailbox check

1 participant