Skip to content

bmad-loop resume requests rollback of already-committed work when orchestrator dies after successful dev session #99

Description

@guilherme-argentino

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

  1. Run bmad-loop and let it start a dev story session
  2. Dev session completes: commit pushed, sprint-status.yaml set to done
  3. Kill the orchestrator process before it processes the Stop event (e.g., machine crash,
    OOM, signal)
  4. Run bmad-loop resume
  5. 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:

  1. Read sprint-status.yaml (the source of truth for story state)
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions