// Planu — Finding Merger (SPEC-483)
// Merges findings from multiple analyzers, deduplicating by (ruleId, file, line).
/**
 * Builds a unique deduplication key for a finding.
 * Two findings with the same ruleId + file + line are considered identical.
 */
function dedupeKey(f) {
    return `${f.ruleId}::${f.file}::${String(f.line)}`;
}
/**
 * Merges findings from all analyzer results into a single deduplicated list.
 * When duplicates exist the first occurrence (in analyzer order) wins.
 */
export function mergeFindings(results) {
    const seen = new Set();
    const merged = [];
    for (const result of results) {
        for (const finding of result.findings) {
            const key = dedupeKey(finding);
            if (!seen.has(key)) {
                seen.add(key);
                merged.push(finding);
            }
        }
    }
    return merged;
}
//# sourceMappingURL=finding-merger.js.map