Summary
When a dev session completes successfully (code committed and pushed, sprint-status.yaml
updated to done) but the orchestrator process dies before processing the Stop event,
bmad-loop resume treats the story as a failed attempt and emits a rollback instruction
(git reset --hard <baseline>). This is incorrect: the work is already integrated into the
remote branch.
Steps to Reproduce
- Run
bmad-loop and let it start a dev story session
- Dev session completes: commit pushed,
sprint-status.yaml set to done
- Kill the orchestrator process before it processes the
Stop event (e.g., machine crash,
OOM, signal)
- Run
bmad-loop resume
- Observe: resume emits a rollback instruction and marks the session as a failed attempt
Expected Behavior
Before emitting any rollback instruction, bmad-loop resume should:
- Read
sprint-status.yaml (the source of truth for story state)
- If the story's status is
done, treat the session as successfully completed and advance —
no rollback
Actual Behavior
Resume reads only its internal state.json, which does not reflect the committed work. It
issues git reset --hard <baseline>, which would destroy already-pushed commits.
Root Cause
bmad-loop resume does not reconcile state.json with sprint-status.yaml. The ATTENTION
file also does not clarify that the rollback is only safe when work has not been
committed.
Proposed Fix
In the resume path, before issuing rollback:
if sprint-status.yaml[current_story].status == "done":
mark session complete, advance to next story
skip rollback entirely
Also update the ATTENTION file to make explicit: "Rollback is only appropriate if the work
was NOT committed. If already pushed, accept the session as done instead."
Severity
High — following the rollback instruction would undo already-pushed commits.
Summary
When a dev session completes successfully (code committed and pushed,
sprint-status.yamlupdated to
done) but the orchestrator process dies before processing theStopevent,bmad-loop resumetreats the story as a failed attempt and emits a rollback instruction(
git reset --hard <baseline>). This is incorrect: the work is already integrated into theremote branch.
Steps to Reproduce
bmad-loopand let it start a dev story sessionsprint-status.yamlset todoneStopevent (e.g., machine crash,OOM, signal)
bmad-loop resumeExpected Behavior
Before emitting any rollback instruction,
bmad-loop resumeshould:sprint-status.yaml(the source of truth for story state)done, treat the session as successfully completed and advance —no rollback
Actual Behavior
Resume reads only its internal
state.json, which does not reflect the committed work. Itissues
git reset --hard <baseline>, which would destroy already-pushed commits.Root Cause
bmad-loop resumedoes not reconcilestate.jsonwithsprint-status.yaml. The ATTENTIONfile also does not clarify that the rollback is only safe when work has not been
committed.
Proposed Fix
In the resume path, before issuing rollback:
if sprint-status.yaml[current_story].status == "done":
mark session complete, advance to next story
skip rollback entirely
Also update the ATTENTION file to make explicit: "Rollback is only appropriate if the work
was NOT committed. If already pushed, accept the session as done instead."
Severity
High — following the rollback instruction would undo already-pushed commits.