Skip to content

Tighten PR review prompt: validate findings before posting#2

Merged
jordancardwell merged 3 commits into
mainfrom
review-prompt/validate-before-posting
May 21, 2026
Merged

Tighten PR review prompt: validate findings before posting#2
jordancardwell merged 3 commits into
mainfrom
review-prompt/validate-before-posting

Conversation

@jordancardwell
Copy link
Copy Markdown
Contributor

Summary

Adds an explicit draft → validate → filter → post loop to the inline review prompt used by the org-wide PR review bot. The validator forces a second pass on every drafted finding before anything gets posted to a PR.

The validator drops:

  • Findings that can't be tied to a specific token in the diff
  • Findings that depend on context outside the diff (caller behavior, runtime state, config not shown)
  • Anything CI already enforces (lint, types, formatting)
  • Style/opinion calls and senior-engineer-level nitpicks
  • Pre-existing issues not introduced by the diff

Only high-signal survivors make it into the posted comment:

  • Code that fails to compile/parse
  • Definite logic errors (wrong regardless of inputs)
  • Concrete security or data-loss risk traceable to a specific line
  • Unambiguous, quotable violations of REVIEW.md / CLAUDE.md

If validation drops everything, the comment says `No high-signal issues found.` instead of forcing a low-quality review.

Why

The current single-pass prompt produces too many low-signal comments — style notes, hypothetical concerns, things the linter already catches. Reviewers start tuning the bot out. This mirrors the validation step from the local `code-review` slash-command pipeline, but keeps the existing single-action CI flow (no timeout bump, no extra tools needed).

Scope

This is a prompt-only change to `claude-code-review-reusable.yml`. Every consumer workflow (`churnkey-api`, `monorepo`, `churnkey-embed`, etc.) references this via `@main`, so the new prompt goes live on every repo's next PR event after merge.

Test plan

  • Open a small follow-up PR in `churnkey-api` after merge and confirm the review comment posts and follows the new format
  • Open a deliberately noisy PR (style nits, hypothetical-only concerns) and confirm those findings get filtered out
  • Open a PR with a real bug (e.g. missing await, wrong comparator) and confirm it still gets flagged
  • Verify the `No high-signal issues found.` fallback fires when there's nothing real to report

Add an explicit draft -> validate -> filter -> post loop to the inline
review prompt so findings get a second-pass check against the diff
before being posted. The validator drops anything that can't be tied to
a specific token in the diff, anything that depends on context outside
the diff, anything CI already enforces, and style/opinion calls.

Only high-signal survivors (compile/parse failures, definite logic
errors, concrete security or data-loss risks, or quotable convention
violations) make it into the posted comment. Output adds a 'No
high-signal issues found.' fallback when validation drops everything.

Goal: cut false-positive noise from the org-wide PR review bot.
Validation was forced to drop any finding that needed context beyond
the diff to confirm, which kept too much noise out but also killed
real bugs whose proof lives one file over (e.g. an awaited-but-not-
async function defined elsewhere, a misnamed import).

Grant the validator Read/Grep/Glob and gh-api/git-log/show/blame/diff
Bash patterns so it can actually investigate. Update the prompt to
encourage purposeful look-outside-the-diff checks (specific question
in mind) and to use git blame/log to confirm whether a problem was
introduced by the PR vs pre-existing.
Validator now reads outside the diff (grep/read, gh api, git blame),
which takes longer on bigger PRs. 5 min was already tight for the
single-pass review; with investigation it'll be tighter. 8 gives a
comfortable margin without letting a runaway review burn budget.
@jordancardwell jordancardwell merged commit 09c200b into main May 21, 2026
0 of 2 checks passed
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.

2 participants