Skip to content

[Phase 3] Wire the DOWNSTREAM_IMPACT block into the triage + deep prompts and surface it in the verdict #752

Description

@github-actions

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

  1. 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.
  2. 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).
  3. 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.
  4. When the block is (none), no downstream note appears in the verdict and triage behavior is unchanged.
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev-leadFor dev-lead agent pickupinitiativeEpic / initiative tracking issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions