Class: RosettAi::Quorum::Comparator
- Inherits:
-
Object
- Object
- RosettAi::Quorum::Comparator
- Defined in:
- lib/rosett_ai/quorum/comparator.rb
Overview
Aggregates findings from multiple engines.
Cross-engine findings (same category + file + rule_id from 2+ engines) are promoted by severity. Unique findings are annotated with their source engine for transparency.
Constant Summary collapse
- FAIL_SEVERITIES =
['high', 'critical'].freeze
- SEVERITY_RANK =
{ 'low' => 0, 'medium' => 1, 'high' => 2, 'critical' => 3 }.freeze
Instance Method Summary collapse
-
#compare(collected) ⇒ Hash
Compare and aggregate collected engine results.
Instance Method Details
#compare(collected) ⇒ Hash
Compare and aggregate collected engine results.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rosett_ai/quorum/comparator.rb', line 21 def compare(collected) all_findings = collected.values.flat_map { |r| r['findings'] } grouped = group_findings(all_findings) merged = grouped.map { |_key, group| merge_group(group) } { 'findings' => merged, 'overall_status' => determine_status(merged), 'summary' => build_summary(merged, collected.keys) } end |