Repository navigation
Description
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_factsrule 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.patchfor.md(as inbmad-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
- feat(dev-auto): preserve the attempted change on intent-gap halts #2564: the patch that
bmad-build-autosaves on an intent gap, reused here. - Feature: human-gated intent reconciliation after implementation discoveries #2649 (closed) asked for human-gated reconciliation more broadly; this one only keeps work that is already verified.
- bmad-build: let bad_plan halt for approval instead of amending the plan (on_bad_plan = amend | halt) #2999 proposes a halt on
bad_planin the same triage step. - Lines are cited at v7.2.0 (
c978bf85); our run used v7.1.0, where the step text is the same.
Activity