Merge, Dedupe, Rank

combining two sources of findings

Part of: AI Code Reviewer

You now have two sources of findings. The static pre-pass is fast and narrow. The model is slow and broad. They overlap, and the overlap chunks from lesson 4 can make the model report the same line twice. Show all of that raw and the user reads "eval is dangerous" three times. This lesson turns two noisy lists into one clean report. The dedupe key. Two findings are the same problem when they point at the same line and the same category . The messages will differ, because a regex rule and a model never phrase things alike, so the message can't be part of the key. When two findings collide, keep the higher severity and its message. If the static rule says medium and the model says high, the user should see high. Also keep track of every source that reported it. A finding both the rules and the model agree on is worth showing first, and the evaluation in lesson 7 can measure how often each source is right. Rank for the reader. People read the top of a review and stop. Sort by severity from high to low, then by line so findings of equal severity read top to bottom through the file, then by category so the order never changes between runs. Report how many duplicates you removed too. A s

Challenge: One Clean Report