feat(review-pr): request reviewer from stakeholders for spec PRs#417
Draft
captainsafia wants to merge 1 commit intomainfrom
Draft
feat(review-pr): request reviewer from stakeholders for spec PRs#417captainsafia wants to merge 1 commit intomainfrom
captainsafia wants to merge 1 commit intomainfrom
Conversation
For spec-only PRs (all changed files under specs/), load .github/STAKEHOLDERS and include a prompt section instructing the agent to extract code paths mentioned in the spec content (e.g. 'Relevant code' sections in tech specs) and match them against the stakeholder roster to recommend a single reviewer. On APPROVE verdict, apply_review_result() calls pr.create_review_request() with the resolved reviewer, mirroring the existing non-member flow. On REJECT, no reviewer is requested (spec PRs always use COMMENT, not REQUEST_CHANGES). The deterministic STAKEHOLDERS fallback is used when the agent returns an empty or invalid recommended_reviewers list. Co-Authored-By: Oz <oz-agent@warp.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Spec-only PRs (all files under
specs/) previously skipped reviewer selection entirely. This PR adds stakeholder-based reviewer requests to the spec PR review flow, so the right maintainer is automatically tagged when a spec is approved.Changes
core/workflows/review_pr.py_format_spec_reviewer_section(): Builds a prompt section for spec PRs telling the agent to extract code paths mentioned in the spec content (e.g. "Relevant code" or "Proposed changes" sections in tech specs) and match them against.github/STAKEHOLDERSto recommend a single reviewer.gather_review_context(): Added anelif spec_only:branch that loads.github/STAKEHOLDERSfrom the repo and builds thespec_reviewer_section. A newspec_reviewer_sectionfield is added toReviewContext.build_review_prompt_for_dispatch(): Appendsspec_reviewer_sectionto the cloud-mode prompt, after the existing non-member section.apply_review_result(): Expanded the reviewer-request condition fromis_non_membertois_non_member or spec_only. OnAPPROVE, the resolved reviewer is requested viapr.create_review_request(). OnREJECT, no reviewer is requested (spec PRs useCOMMENT, notREQUEST_CHANGES).tests/test_review_pr_reviewer_sampling.pySpecReviewerSectionTestcovering prompt content.ApplyReviewResultVerdictTest:COMMENTeventrecommended_reviewers→ deterministic STAKEHOLDERS fallbackBehavior
Conversation: https://staging.warp.dev/conversation/c732efab-ad5f-4b1a-ad6c-4f9a0283ee30
Run: https://oz.staging.warp.dev/runs/019de183-0edf-7549-adf5-b89008d15c3e
This PR was generated with Oz.