fix(reviewer): surface author rationale to reviewer agents - #62
Merged
Conversation
Reviewers produced findings that contradicted explicit design rationale
from the PR description because the rationale never reached them.
- Intake gate / intake fallback / anatomy were truncating the description
to 500 / 1000 / 500 chars. Thoughtful PR bodies with rationale past those
cutoffs were silently chopped before any model saw them.
- review_dimension only received digested summaries (pr_narrative,
risk_surfaces, intake_summary) — never the raw description, so the
author's voice was laundered through two summarization layers before
the reviewer looked at code.
- The anatomy prompt also tells the model to discount the description
("what the CODE says, not what the PR description says"), which is
correct for divergence detection but leaves the reviewer with no
channel for author intent.
Bump description truncation in intake/anatomy to 4000 chars uniformly,
add a pr_description param to review_dimension with a dedicated
"Author's Stated Intent" section near the top of the prompt, and wire
self.pr_data.description through _run_parallel_review.
The new section is explicitly NOT "trust the author" — it tells the
reviewer to verify the code regardless, but to rebut the author's
stated reasoning on its merits when a finding contradicts an
explicitly-justified design choice, rather than flagging as if the
rationale wasn't given. Findings on points the description is silent
about are unaffected.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
Contributor
Author
|
Follow-up pass to make this merge-ready (merged current main + four commits):
Gates: ruff clean, pytest 78 passed, go build/vet/test/gofmt clean. |
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
Supersedes #25 — same fix, re-applied onto current
main. The old branch predated a history rewrite, so GitHub showed a phantom ±40k-line diff; the actual change is this single commit (+33/−3), cherry-picked from935e4c1with one trivial conflict resolved.Reviewer agents were producing findings that contradicted explicit design rationale stated in PR descriptions, because the rationale never reached them:
pr_narrative,risk_surfaces,intake_summary).Changes
intake_phase(gate + fallback) andanatomy_phase: bump description truncation 500/1000/500 → 4000 chars uniformly.review_dimension: newpr_descriptionparameter with a dedicated "Author's Stated Intent" section near the top of the prompt. Framing tells the reviewer not to defer to the description — but a finding that contradicts an explicitly-justified design choice must rebut the stated rationale on its merits. Findings on points the description is silent about are unaffected.ReviewOrchestrator._run_parallel_review: wireself.pr_data.descriptionthrough toreview_dimension.Conflict resolution vs. old #25:
mainhas since addedfeedback_section(human HITL guidance) at the same prompt-assembly insertion point — both sections are kept, human guidance first.Test plan
router.app: with a 5000-char description carrying a rationale marker at char ~2400, the marker now reaches the intake gate, intake fallback, anatomy, and reviewer prompts; the reviewer prompt contains the "Author's Stated Intent" section capped at 4000 chars; empty description produces no section; human-guidance section still renders and precedes it. Same harness onmainfails exactly these checks (10/10 pass on this branch, 4 relevant failures onmain).ruff check src/ scripts/cleanpytest tests/— 73 passedgo build ./... && go vet ./... && go test ./...+ gofmt cleandocker buildsucceeds🤖 Generated with Claude Code