Skip to content

fix: add consumer propagation check to bmad-quick-dev workflow#2123

Open
gabadi wants to merge 5 commits intobmad-code-org:mainfrom
gabadi:fix/quick-dev-consumer-propagation
Open

fix: add consumer propagation check to bmad-quick-dev workflow#2123
gabadi wants to merge 5 commits intobmad-code-org:mainfrom
gabadi:fix/quick-dev-consumer-propagation

Conversation

@gabadi
Copy link
Copy Markdown
Contributor

@gabadi gabadi commented Mar 25, 2026

What

Adds consumer propagation tracing to the bmad-quick-dev workflow. Two additions (~388 chars) across step-02 and step-03.

Why

When introducing new type variants, error codes, or DB values, the workflow's Code Map only covers files being directly modified. Consumers of the parent type/column in other modules are missed during planning, leading to regressions that the review step misclassifies as pre-existing issues. Discovered during a real bugfix where a new error variant (FETCH_NOT_PRINTABLE) broke an untraced consumer's error mapping.

How

  • step-02-plan.md: Consumer tracing instruction — grep all consumers of new types/columns during investigation, annotate in Code Map as consumer — update required or consumer — excluded (reason).
  • step-03-implement.md: Precondition gate — HALT if spec introduces new values but Code Map has no consumer annotations (catches missed step-02 tracing).

Testing

Validated against the incident that exposed the gap. With these changes, step-02 would have enumerated 4 missing consumers, and step-03 would have HALTed if step-02 was skipped.

Fixes #2122

When introducing new type variants, error codes, or DB values, the
workflow now requires enumerating all consumers in the Code Map during
planning (step-02) and HALTs implementation (step-03) if consumer
tracing was missed.

Fixes bmad-code-org#2122

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 25, 2026

🤖 Augment PR Summary

Summary: Tightens the bmad-quick-dev workflow to ensure “consumer propagation” is considered when introducing new type variants/error codes/DB values.

Changes:

  • Step 2 planning now instructs grepping and annotating downstream consumers in the Code Map.
  • Step 3 implementation adds a precondition to HALT when new values are specified but consumer annotations are missing.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.


Verify `{spec_file}` resolves to a non-empty path and the file exists on disk. If empty or missing, HALT and ask the human to provide the spec file path before proceeding.

If the spec introduces new type variants, error codes, or DB values and the Code Map has no consumer annotations, HALT — consumer tracing was missed in planning.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“Code Map has no consumer annotations” is a bit ambiguous; consider explicitly referencing the exact annotation strings introduced in step-02 (e.g., consumer — update required / consumer — excluded (reason)) so the HALT gate can be applied consistently (and optionally mirror that convention in the spec template’s Code Map guidance).

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

📝 Walkthrough

Walkthrough

Documentation updates to the bmad-quick-dev workflow add consumer tracing requirements in Step 2 and a precondition check in Step 3 to ensure complete Code Maps when new type variants, error codes, or database values are introduced.

Changes

Cohort / File(s) Summary
bmad-quick-dev Workflow Steps
src/bmm-skills/4-implementation/bmad-quick-dev/step-02-plan.md, src/bmm-skills/4-implementation/bmad-quick-dev/step-03-implement.md
Added consumer tracing instruction to Step 2 requiring enumeration of all consumers when new type variants/error codes/DB values are introduced; added precondition check to Step 3 to halt execution if consumer annotations are missing from Code Map.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • bmadcode
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a consumer propagation check to the bmad-quick-dev workflow, which is precisely what the PR implements.
Description check ✅ Passed The description is well-structured and directly related to the changeset, explaining the what, why, how, and testing of the consumer propagation check additions.
Linked Issues check ✅ Passed The PR fully addresses the requirements in issue #2122 by adding consumer tracing instruction to step-02 and a precondition check to step-03 to prevent regressions from missed consumer enumeration.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the stated objective of adding consumer propagation tracing; no out-of-scope modifications to unrelated files or features are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

Use backtick-quoted `consumer —` prefix to match the step-02
convention, making the precondition check unambiguous and grepable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/bmm-skills/4-implementation/bmad-quick-dev/step-03-implement.md (1)

17-18: Clarify the pattern for detecting "consumer annotations."

The precondition checks whether "the Code Map has no consumer annotations" but doesn't specify what pattern or format qualifies as a consumer annotation. Step-02 (line 15 of step-02-plan.md) prescribes specific annotation formats: consumer — update required or consumer — excluded (reason). However, this precondition doesn't reference those formats, leaving detection criteria implicit.

This ambiguity could lead to false positives if:

  • Annotations are present but use slightly different wording
  • The agent executing step-03 doesn't recognize the annotation pattern from step-02
🔍 Suggested refinement

Make the detection pattern explicit to align with step-02:

-If the spec introduces new type variants, error codes, or DB values and the Code Map has no consumer annotations, HALT — consumer tracing was missed in planning.
+If the spec introduces new type variants, error codes, or DB values and the Code Map contains no entries labeled `consumer — update required`, `consumer — excluded (...)`, or consumer-search notes, HALT — consumer tracing was missed in planning.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm-skills/4-implementation/bmad-quick-dev/step-03-implement.md` around
lines 17 - 18, The precondition in step-03-implement.md is ambiguous about what
counts as a "consumer annotation"; update the precondition to explicitly detect
the annotation formats defined in step-02 (e.g., the literal strings "consumer —
update required" and "consumer — excluded (reason)") and any acceptable variants
(case-insensitive, normalized dashes/em-dash, and optional parentheses for
reasons). Reference the spec from step-02-plan.md when describing the check, and
add a short note that the agent should treat matching annotations as present
only if they match those normalized patterns to avoid false positives.
src/bmm-skills/4-implementation/bmad-quick-dev/step-02-plan.md (1)

15-15: Consider the edge case where no consumers exist yet.

The instruction requires annotating consumers when introducing new type variants, error codes, or DB values. However, it doesn't explicitly address the scenario where grep legitimately finds zero consumers (e.g., introducing a new feature with no existing call sites). In this case, the step-03 precondition gate will HALT because "the Code Map has no consumer annotations," even though the tracing was correctly performed.

💡 Suggested clarification

Consider adding explicit guidance for the zero-consumers case:

-1. Investigate codebase. _Isolate deep exploration in sub-agents/tasks where available. To prevent context snowballing, instruct subagents to give you distilled summaries only._ If the approach introduces new type variants, error codes, or DB values: grep all consumers of the parent type/column and annotate each in the Code Map as `consumer — update required` or `consumer — excluded (reason)`.
+1. Investigate codebase. _Isolate deep exploration in sub-agents/tasks where available. To prevent context snowballing, instruct subagents to give you distilled summaries only._ If the approach introduces new type variants, error codes, or DB values: grep all consumers of the parent type/column and annotate each in the Code Map as `consumer — update required` or `consumer — excluded (reason)`. If zero consumers exist, add a note: `consumer search complete — no existing consumers`.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm-skills/4-implementation/bmad-quick-dev/step-02-plan.md` at line 15,
Update the "Investigate codebase" guidance to handle the zero-consumers edge
case by instructing users to explicitly annotate the Code Map when grep returns
no consumers (for example: "no consumers — verified") and to record the grep
command/output and rationale; also update the step-03 precondition gate text to
accept a Code Map that contains only "no consumers" annotations as a valid trace
result. Refer to the existing symbols "Investigate codebase" instruction, "Code
Map", and "step-03 precondition gate" when making these edits so reviewers know
where to add the new acceptance rule and the explicit annotation format.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/bmm-skills/4-implementation/bmad-quick-dev/step-03-implement.md`:
- Around line 17-18: Update the HALT check in step-03-implement.md so it
distinguishes between "no consumer annotations because tracing was not
performed" and "tracing was performed and legitimately found zero consumers";
specifically, change the logic and the HALT message "HALT — consumer tracing was
missed in planning" to first consult the step-02 plan metadata (step-02-plan.md)
for an explicit "no-consumers" note or flag, and only HALT with that message
when that flag is absent (meaning tracing was skipped); when the flag is present
and indicates zero consumers, allow continuation and replace the HALT with a
non-blocking informational note explaining that tracing ran and found no call
sites.

---

Nitpick comments:
In `@src/bmm-skills/4-implementation/bmad-quick-dev/step-02-plan.md`:
- Line 15: Update the "Investigate codebase" guidance to handle the
zero-consumers edge case by instructing users to explicitly annotate the Code
Map when grep returns no consumers (for example: "no consumers — verified") and
to record the grep command/output and rationale; also update the step-03
precondition gate text to accept a Code Map that contains only "no consumers"
annotations as a valid trace result. Refer to the existing symbols "Investigate
codebase" instruction, "Code Map", and "step-03 precondition gate" when making
these edits so reviewers know where to add the new acceptance rule and the
explicit annotation format.

In `@src/bmm-skills/4-implementation/bmad-quick-dev/step-03-implement.md`:
- Around line 17-18: The precondition in step-03-implement.md is ambiguous about
what counts as a "consumer annotation"; update the precondition to explicitly
detect the annotation formats defined in step-02 (e.g., the literal strings
"consumer — update required" and "consumer — excluded (reason)") and any
acceptable variants (case-insensitive, normalized dashes/em-dash, and optional
parentheses for reasons). Reference the spec from step-02-plan.md when
describing the check, and add a short note that the agent should treat matching
annotations as present only if they match those normalized patterns to avoid
false positives.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1cc114d2-7f09-4398-ab67-f31b84ed6890

📥 Commits

Reviewing files that changed from the base of the PR and between cfe40fc and 17e87f8.

📒 Files selected for processing (2)
  • src/bmm-skills/4-implementation/bmad-quick-dev/step-02-plan.md
  • src/bmm-skills/4-implementation/bmad-quick-dev/step-03-implement.md

Comment on lines +17 to +18
If the spec introduces new type variants, error codes, or DB values and the Code Map has no consumer annotations, HALT — consumer tracing was missed in planning.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

The HALT will incorrectly fire when there are legitimately no consumers.

This precondition will HALT when "the Code Map has no consumer annotations," but this condition doesn't distinguish between:

  1. Consumer tracing was skipped (violation)
  2. Consumer tracing was performed but found zero consumers (valid scenario for new features)

In case #2, the step-02 instruction doesn't currently require adding a note when no consumers exist, so this gate will incorrectly block implementation of new features with no existing call sites.

This issue is already flagged in the step-02-plan.md review, but the impact surfaces here: the HALT message "consumer tracing was missed in planning" will be misleading when tracing was correctly performed but found nothing.

🛡️ Suggested fix

Coordinate with the step-02 refinement to recognize the zero-consumers note:

-If the spec introduces new type variants, error codes, or DB values and the Code Map has no consumer annotations, HALT — consumer tracing was missed in planning.
+If the spec introduces new type variants, error codes, or DB values and the Code Map contains no consumer annotations or consumer-search notes, HALT — consumer tracing was missed in planning. If you performed consumer tracing but found zero consumers, document that in the Code Map before proceeding.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
If the spec introduces new type variants, error codes, or DB values and the Code Map has no consumer annotations, HALT — consumer tracing was missed in planning.
If the spec introduces new type variants, error codes, or DB values and the Code Map contains no consumer annotations or consumer-search notes, HALT — consumer tracing was missed in planning. If you performed consumer tracing but found zero consumers, document that in the Code Map before proceeding.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm-skills/4-implementation/bmad-quick-dev/step-03-implement.md` around
lines 17 - 18, Update the HALT check in step-03-implement.md so it distinguishes
between "no consumer annotations because tracing was not performed" and "tracing
was performed and legitimately found zero consumers"; specifically, change the
logic and the HALT message "HALT — consumer tracing was missed in planning" to
first consult the step-02 plan metadata (step-02-plan.md) for an explicit
"no-consumers" note or flag, and only HALT with that message when that flag is
absent (meaning tracing was skipped); when the flag is present and indicates
zero consumers, allow continuation and replace the HALT with a non-blocking
informational note explaining that tracing ran and found no call sites.

gabadi and others added 3 commits March 25, 2026 03:37
- step-02: add `consumer — none found` annotation for empty grep results
- step-03: replace dead-end HALT with actionable recovery (perform
  tracing now) so the agent isn't stuck if step-02 was skipped

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The step-03 consumer tracing instruction duplicated step-02 without
adding validation. Keep only the step-02 planning instruction.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

fix: bmad-quick-dev workflow misses consumer propagation for new type variants

2 participants