fix: add consumer propagation check to bmad-quick-dev workflow#2123
fix: add consumer propagation check to bmad-quick-dev workflow#2123gabadi wants to merge 5 commits intobmad-code-org:mainfrom
Conversation
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>
🤖 Augment PR SummarySummary: Tightens the bmad-quick-dev workflow to ensure “consumer propagation” is considered when introducing new type variants/error codes/DB values. Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
|
|
||
| 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. |
There was a problem hiding this comment.
“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
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
📝 WalkthroughWalkthroughDocumentation 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
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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>
There was a problem hiding this comment.
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 requiredorconsumer — 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
📒 Files selected for processing (2)
src/bmm-skills/4-implementation/bmad-quick-dev/step-02-plan.mdsrc/bmm-skills/4-implementation/bmad-quick-dev/step-03-implement.md
| 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. | ||
|
|
There was a problem hiding this comment.
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:
- Consumer tracing was skipped (violation)
- 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.
| 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.
- 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>
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
consumer — update requiredorconsumer — excluded (reason).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