Skip to content

feat(dev-auto): preserve the attempted change on intent-gap halts - #2564

Merged
alexeyv merged 1 commit into
mainfrom
feat/dev-auto-stop-and-ask
Jul 6, 2026
Merged

feat(dev-auto): preserve the attempted change on intent-gap halts#2564
alexeyv merged 1 commit into
mainfrom
feat/dev-auto-stop-and-ask

Conversation

@alexeyv

@alexeyv alexeyv commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

What

When review hits an intent gap, bmad-dev-auto currently reverts the attempted code changes before halting — destroying information. This PR:

  1. Preserves the attempt as an artifact, not tree state (step-04): before the usual revert, the attempted change is saved as a patch file in {implementation_artifacts}, referenced from the triage log, with its path included in the halt output. The working tree still ends reverted, so blocked keeps its discard-and-restart semantics and the common recovery path (repair the intent, run fresh) stays default-clean.
  2. Unifies the blocking-condition vocabulary: intent gaps (step-02) and intent gap in intent contract (step-04) both become intent gap — one condition, one meaning (the captured intent cannot answer a question the run hit); the artifact shows which phase raised it.
  3. Documents the integration boundary (docs/reference/dev-auto.md): the unified condition, the new patch artifact, and the recovery affordance.

Why

Two uses for the preserved attempt, observed in live runs:

  • Evidence for intent repair. The patch shows the human exactly which reading of the intent the run implemented — "it read it as X, here's what that produces" — which is better input for writing the clarification than the questions alone.
  • The guessed reading is occasionally right. A recent run rendered Optional[str] where the intent's example showed a : str; the implemented reading was arguably the correct one (and matches what upstream later shipped). When that happens, git apply the patch + set spec status in-review resumes review on the preserved diff against the amended intent, instead of paying for a full re-run. The existing in-review resume routing already supports this — no new status or machinery.

Design note: preserving as a patch file rather than leaving the tree dirty was deliberate. Dirty-tree preservation would optimize the rare case (lucky guess) while taxing the common one — every discard-and-restart would need a manual reset first, and a forgotten reset blocks the next run's clean-tree check.

🤖 Generated with Claude Code

The intent_gap branch reverted code changes before halting, destroying
information: the attempted diff shows the human exactly which reading
the agent implemented, which is concrete evidence for repairing the
intent — and occasionally the guessed reading is simply right.

Save the attempt as a patch file in {implementation_artifacts} before
reverting, reference it from the triage log, and include its path in
the halt output. Restart stays default-clean (blocked keeps discard
semantics; the tree is reverted as before); if the human decides the
attempted reading was correct, git apply + status in-review resumes
review on it instead of paying for a full re-run.

Also unify the blocking-condition vocabulary: 'intent gaps' (step-02)
and 'intent gap in intent contract' (step-04) both become 'intent gap'
— one condition, one meaning; the artifact shows which phase raised it.

Document the artifact, the recovery affordance, and the unified
condition in the integration reference (docs/reference/dev-auto.md).
@alexeyv
alexeyv marked this pull request as ready for review July 6, 2026 14:59
@alexeyv
alexeyv merged commit ac25b2c into main Jul 6, 2026
8 checks passed
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai review

@alexeyv
alexeyv deleted the feat/dev-auto-stop-and-ask branch July 6, 2026 15:00
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ec216cf0-ecd6-4841-acb0-b9b3c054732e

📥 Commits

Reviewing files that changed from the base of the PR and between cf54155 and c98b24b.

📒 Files selected for processing (3)
  • docs/reference/dev-auto.md
  • src/bmm-skills/4-implementation/bmad-dev-auto/step-02-plan.md
  • src/bmm-skills/4-implementation/bmad-dev-auto/step-04-review.md

📝 Walkthrough

Walkthrough

Documentation and workflow spec files for bmad-dev-auto are updated to rename the "intent gaps" blocking condition to "intent gap." Step-04 review behavior now saves a patch file and triage-log entry on intent gap halt, and reference docs describe this new patch artifact and resume flow.

Changes

Intent gap handling update

Layer / File(s) Summary
Workflow spec updates for intent gap blocking
src/bmm-skills/4-implementation/bmad-dev-auto/step-02-plan.md, src/bmm-skills/4-implementation/bmad-dev-auto/step-04-review.md
Step 2 HALT instruction and Step 4 intent_gap branch now use the "intent gap" blocking condition string; Step 4 additionally saves a patch file in implementation artifacts, records a triage-log entry with addressed_findings: none, and outputs unresolved questions plus the patch path.
Reference documentation for intent gap and patch artifact
docs/reference/dev-auto.md
The "On blocked" section replaces "intent gaps" with "intent gap" and adds an explanation of the saved patch file and resume-to-in-review flow; the Additional Artifacts section documents the new patch file bullet.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: bmadcode

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dev-auto-stop-and-ask

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

thecontstruct pushed a commit to thecontstruct/BMAD-METHOD that referenced this pull request Aug 1, 2026
bmad-code-org#2564 unified the blocking-condition vocabulary ('intent gaps' +
'intent gap in intent contract' both become 'intent gap') and added a
patch-file artifact preserved on intent-gap halts.

bmad-code-org#2549 introduced the folder+id dispatch contract; the doc gained the
Folder+ID Dispatch section, ready-for-dev halt outcome on a directive,
slug-fallback table for pre-planning halts, and updated orchestrator
responsibilities. core-tools.md gained the new 'break a spec into
stories' use case and the Story Breakdown step.

Source already matched upstream across all six batch-1 commits
(bmad-code-org#2549, bmad-code-org#2560, bmad-code-org#2561, bmad-code-org#2563, bmad-code-org#2564, bmad-code-org#2565).
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.

1 participant