Summary
Findings from remote (AI review) and local-rule (waste detector) that describe the same issue at the same location should dedupe to one finding, preferring the higher-confidence source.
Why
The two sources phrase the same issue differently. The current dedupe key in makeFindingDedupeKey includes the description text — so they don't collapse. Users see two findings for the same call.
Current state
src/intelligence/finding-dedupe.ts has two strategies:
makeFindingDedupeKey — includes description text. Used by default.
makeFindingContextDedupeKey — buckets by line + provider + method + library + originFile + originFunction. Better, but unclear if used at the AI/local merge point.
What to do
- Find the AI/local-rule merge point (likely in
webview-provider.ts).
- Replace with a structural key:
function findingMergeKey(f: FindingNode): string {
return [f.filePath, f.type, f.endpointId ?? "no-endpoint",
f.lineRange ?? lineFromSpan(f.span)].join("::");
}
- When duplicates collapse: preserve the higher-confidence finding, append the other's source as metadata.
- Confidence of merged finding =
max() of inputs.
- Description = prefer AI's (richer), fall back to local-rule.
Acceptance criteria
Depends on
Reference
Full design: https://github.com/recost-dev/extension/blob/main/docs/accuracy/findings.md#c2-proper-dedupe-of-ai--local-rule-findings
Summary
Findings from
remote(AI review) andlocal-rule(waste detector) that describe the same issue at the same location should dedupe to one finding, preferring the higher-confidence source.Why
The two sources phrase the same issue differently. The current dedupe key in
makeFindingDedupeKeyincludes the description text — so they don't collapse. Users see two findings for the same call.Current state
src/intelligence/finding-dedupe.tshas two strategies:makeFindingDedupeKey— includes description text. Used by default.makeFindingContextDedupeKey— buckets by line + provider + method + library + originFile + originFunction. Better, but unclear if used at the AI/local merge point.What to do
webview-provider.ts).max()of inputs.Acceptance criteria
sources: ["local-rule", "remote"])max(), not averagedDepends on
Reference
Full design: https://github.com/recost-dev/extension/blob/main/docs/accuracy/findings.md#c2-proper-dedupe-of-ai--local-rule-findings