Class: Woods::Feedback::GapDetector

Inherits:
Object
  • Object
show all
Defined in:
lib/woods/feedback/gap_detector.rb

Overview

Detects patterns in retrieval feedback that suggest coverage gaps.

Analyzes ratings and gap reports to find:

  • Repeated low-score queries with common keywords

  • Frequently reported missing units

Examples:

detector = GapDetector.new(feedback_store: store)
issues = detector.detect
issues.each { |i| puts "#{i[:type]}: #{i[:description]}" }

Constant Summary collapse

LOW_SCORE_THRESHOLD =
2
MIN_PATTERN_COUNT =
2
MIN_GAP_COUNT =
2

Instance Method Summary collapse

Constructor Details

#initialize(feedback_store:) ⇒ GapDetector

Returns a new instance of GapDetector.

Parameters:



22
23
24
# File 'lib/woods/feedback/gap_detector.rb', line 22

def initialize(feedback_store:)
  @feedback_store = feedback_store
end

Instance Method Details

#detectArray<Hash>

Detect coverage gaps from accumulated feedback.

Returns:

  • (Array<Hash>)

    List of detected issues with :type, :description, and details



29
30
31
32
33
34
# File 'lib/woods/feedback/gap_detector.rb', line 29

def detect
  issues = []
  issues.concat(detect_low_score_patterns)
  issues.concat(detect_frequently_missing)
  issues
end