Story
As a PR reviewer,
I want the assembled DOWNSTREAM_IMPACT context fed to the cascade and reflected in the posted review,
so that I see which consumer repos a reusable-workflow change affects, right in the review, before it reaches ring-0.
Acceptance Criteria
scripts/review-one-pr.sh inlines the DOWNSTREAM_IMPACT block into TRIAGE_PROMPT_FILE (alongside the existing ADVISORY_BOT_FEEDBACK inlining) and exports DOWNSTREAM_IMPACT_FILE for the deep tier, when the feature flag is on.
prompts/triage.md and prompts/deep-review.md document the new input and instruct the model to treat downstream impact as a signal to weigh (annotate impacted consumers; escalate only per existing risk criteria — downstream impact alone is informational, not an auto-escalation trigger).
- The posted review body surfaces an impacted-consumers note when impact is non-empty (e.g. "This change to
<reusable> is consumed by N downstream repos: ..."), via the deep/synthesize prompt body field.
- When the block is
(none), no downstream note appears in the verdict and triage behavior is unchanged.
- A bats/integration-style test asserts the prompt file contains the block when impact is present and omits the note when
(none); shellcheck passes.
Tasks / Subtasks
Dev Notes
- Triage has NO tools — every field must be inlined into
TRIAGE_PROMPT_FILE (see the { cat prompts/triage.md; printf ... } > TRIAGE_PROMPT_FILE block at scripts/review-one-pr.sh:539). Add the DOWNSTREAM_IMPACT section there, next to ADVISORY_BOT_FEEDBACK.
- The deep tier reads enrichment from env-passed file paths (it lists e.g.
$ADVISORY_BOT_FEEDBACK_FILE in prompts/deep-review.md Inputs and reads it in step 2). Add $DOWNSTREAM_IMPACT_FILE the same way.
- Do NOT make downstream impact an auto-escalation trigger — the triage decision criteria in
prompts/triage.md are explicit and risk-based; downstream impact is an annotation/signal the model weighs, consistent with how ADVISORY_BOT_FEEDBACK is weighed. (Keeps AC free of a contested escalation-policy decision.)
- The verdict body is authored by the model in the
body field consumed by scripts/post-pr-review.sh — surface the note via prompt instruction, not by post-processing the body in shell.
Project Structure Notes
Touches scripts/review-one-pr.sh and the prompts/ cascade files. Behavior remains gated by the Story 5 flag, so merging this story alone changes nothing until the flag is enabled.
References
- scripts/review-one-pr.sh#TRIAGE_PROMPT_FILE
- prompts/triage.md#decision-criteria
- prompts/deep-review.md#inputs
- scripts/post-pr-review.sh#body
Likely target surface
scripts/review-one-pr.sh
prompts/triage.md
prompts/deep-review.md
prompts/synthesize.md
Story prepared by the BMAD Scrum Master (Bob) for epic #748. Status: ready-for-dev.
Story
As a PR reviewer,
I want the assembled DOWNSTREAM_IMPACT context fed to the cascade and reflected in the posted review,
so that I see which consumer repos a reusable-workflow change affects, right in the review, before it reaches ring-0.
Acceptance Criteria
scripts/review-one-pr.shinlines theDOWNSTREAM_IMPACTblock intoTRIAGE_PROMPT_FILE(alongside the existingADVISORY_BOT_FEEDBACKinlining) and exportsDOWNSTREAM_IMPACT_FILEfor the deep tier, when the feature flag is on.prompts/triage.mdandprompts/deep-review.mddocument the new input and instruct the model to treat downstream impact as a signal to weigh (annotate impacted consumers; escalate only per existing risk criteria — downstream impact alone is informational, not an auto-escalation trigger).<reusable>is consumed by N downstream repos: ..."), via the deep/synthesize promptbodyfield.(none), no downstream note appears in the verdict and triage behavior is unchanged.(none);shellcheckpasses.Tasks / Subtasks
scripts/review-one-pr.sh, call the Story 3 assembler before buildingTRIAGE_PROMPT_FILE, inline the block into the triage prompt, and exportDOWNSTREAM_IMPACT_FILEfor tiers 2/3 — all gated on the Story 5 feature flag. (AC: test issue from agent #1, Optimize review: small-PR and incremental fast paths #4)prompts/triage.mdandprompts/deep-review.md: add the new input under their inputs sections and add guidance that downstream impact is informational (annotate, do not auto-escalate). (AC: Go-live improvements for PR review agent #2)bodyincludes the impacted-consumers note when present. (AC: Add @claude delegation, auto-merge, and rebase handling #3)(none); register any new bats file inlint.yml. (AC: feat: add Copilot engine support via REVIEW_ENGINE toggle #5)Dev Notes
TRIAGE_PROMPT_FILE(see the{ cat prompts/triage.md; printf ... } > TRIAGE_PROMPT_FILEblock atscripts/review-one-pr.sh:539). Add theDOWNSTREAM_IMPACTsection there, next toADVISORY_BOT_FEEDBACK.$ADVISORY_BOT_FEEDBACK_FILEinprompts/deep-review.mdInputs and reads it in step 2). Add$DOWNSTREAM_IMPACT_FILEthe same way.prompts/triage.mdare explicit and risk-based; downstream impact is an annotation/signal the model weighs, consistent with howADVISORY_BOT_FEEDBACKis weighed. (Keeps AC free of a contested escalation-policy decision.)bodyfield consumed byscripts/post-pr-review.sh— surface the note via prompt instruction, not by post-processing the body in shell.Project Structure Notes
Touches
scripts/review-one-pr.shand theprompts/cascade files. Behavior remains gated by the Story 5 flag, so merging this story alone changes nothing until the flag is enabled.References
Likely target surface
scripts/review-one-pr.shprompts/triage.mdprompts/deep-review.mdprompts/synthesize.mdStory prepared by the BMAD Scrum Master (Bob) for epic #748. Status: ready-for-dev.