Skip to content

bmad-build: an intent gap reverts a verified implementation; save the attempt as a patch, as bmad-build-auto does #3394

Backlog

Description

@peterstarbek

Describe your idea
When review routes a finding to intent_gap, interactive bmad-build should save the attempted change as a patch beside the plan before it reverts, as bmad-build-auto already does. After the person answers, step 3 should start from that patch and change only what the answer requires.

Why is this needed?
Context: we moved a v6.12 project to v7.1.0 on a copy and built one medium-sized story end to end with interactive bmad-build.

Implementation and the first review were green: 42 files, about 3,100 lines, all tests passing. One finding was an intent gap about a single sentence, the wording of a confirmation message that the intent did not specify. The person answered in one line.

The intent_gap branch then says "Revert code changes. Loop back to the human to resolve." and re-runs steps 2–4 (bmad-build/step-04-review.md:85). Patch findings from the same pass are moot, because the code will be re-derived (:84), so the next review has to find them again. Followed as written, the run throws away a verified implementation because of one open sentence and builds it again. In our run, the implementation and first review took about half of the story's model cost.

The agent avoided this on its own: before the revert it kept the work on a side branch, and after the answer it restored the work and changed only the message. We would like that to be the rule, not luck.

bmad-build-auto already does this for the same route. It saves the attempt as a .patch beside the plan, references it in the triage log, reverts and halts blocked (bmad-build-auto/step-04-review.md:108). The interactive skill has the person in the session, so it can keep at least as much.

A smaller point from the same run: after the answer, step 2 runs again and stops at checkpoint 1 for a second plan approval (step-02-plan.md:46). The only change is the answer the person just gave, written into the frozen block (:10, :44).

Alternatives considered:

  • A persistent_facts rule that tells the agent to keep the code. We use one now. It works, but it contradicts the step text, and the workflow says to follow each step exactly.
  • Routing such gaps to bad_plan: wrong, because the root cause is in the intent.

How should it work?

  • bmad-build/step-04-review.md, intent_gap: "Save the attempted change as a patch file beside {plan_file}, named after it with .patch for .md (as in bmad-build-auto), then revert code changes. Loop back to the human to resolve. Once resolved, re-run steps 2–4. Step 3 applies the saved patch first and changes only what the resolution requires, and step 4 reviews the whole change again."
  • If the answer changes the design or the Code Map, the run drops the patch and re-derives from the plan, as today. That keeps today's guarantee where it matters.
  • The patch holds untracked files too, excludes the plan file, and is never committed. It is deleted once it is applied.
  • Optional: when the only plan change since approval is the written-in answer, step 2 shows that change and asks for one confirmation, instead of the full checkpoint 1.

PR
Happy to contribute a PR against main if a maintainer confirms the shape; I won't open one without that.

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions