Repository navigation
fix(review): deduplicate failure modes before the output cap - #4671
Conversation
|
Failed to generate code suggestions for PR |
IsmaelMartinez
left a comment
There was a problem hiding this comment.
Thanks: exact duplicates crowding the cap is real, though it needs chunks to repeat a case byte for byte. if mode in modes: continue before the append does the same with three fewer lines, and your tests pass with it. This also flips the duplicate assertions #4012 added, so please update the failure_modes row in docs/docs/tools/review.md ("Concatenate valid cases ... at most three") to say duplicates are dropped.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
Run locally: pr-agent e673a02, Claude Opus 5.5 as the model, published by @IsmaelMartinez. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
⚙️ Agent run details
|
PR Code Suggestions ✨No code suggestions found for the PR. ⚙️ Agent run details
|
Replace the fingerprint set with `if mode in modes: continue` and document the dedupe in the chunk-merge table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IsmaelMartinez
left a comment
There was a problem hiding this comment.
Thanks for the PR. We pushed the shorter version ourselves: duplicates are dropped with a plain if mode in modes: continue before the append, so the fingerprint set is gone. Your tests are kept, and the chunk-merge row in docs/docs/commands/review.md now says exact duplicates are dropped. Near-duplicates that differ in whitespace or case are still kept, and the cap stays at three.
User description
Repeated failure-mode cases across review chunks currently consume the three-case output allowance and can crowd out a distinct failure mode from a later chunk. Deduplicate exact validated cases before applying that cap, preserving first occurrence order and meaningful differences such as coverage status.
The legacy renderer/consumer fixtures now use four distinct cases to verify the three-case cap, mixed invalid/duplicate cases to verify strict filtering, and assertions that the first three distinct cases reach every output consumer. Explicit duplicate expectations follow the new unique-case contract; source behavior is unchanged by those fixture corrections.
Validation:
--fileschecks across all 43 changed Python files. Hooks with no applicable files report normal skips.PR Type
Bug fix, Tests
Description
Deduplicate validated failure modes before three-case cap.
Preserve first occurrence and distinct coverage values.
Verify chunk merging, rendering, and output consumers.
Diagram Walkthrough
File Walkthrough
output_models.py
Deduplicate validated failure modes before output cappr_agent/algo/output_models.py
applying the three-case limit.
coverage values.
test_convert_to_markdown.py
Verify rendering caps three distinct failure modestests/unittest/test_convert_to_markdown.py
renderer cap test.
test_failure_mode_chunk_dedup.py
Add failure mode deduplication regression teststests/unittest/test_failure_mode_chunk_dedup.py
test_pr_reviewer_core.py
Verify distinct failure modes reach output consumerstests/unittest/test_pr_reviewer_core.py
consumer fixtures.
cases.
test_review_merge_field_shapes.py
Align merge expectations with unique failure modestests/unittest/test_review_merge_field_shapes.py
one case.
⚙️ Agent run details