Module: Legion::Extensions::Agentic::Attention::Blindspot::Runners::CognitiveBlindspot
- Includes:
- Helpers::Lex
- Included in:
- Client
- Defined in:
- lib/legion/extensions/agentic/attention/blindspot/runners/cognitive_blindspot.rb
Instance Method Summary collapse
- #acknowledge_blindspot(blindspot_id:) ⇒ Object
- #active_blindspots_report ⇒ Object
- #awareness_score_report ⇒ Object
- #blindspot_stats ⇒ Object
- #coverage_report ⇒ Object
- #detect_boundary_gap(domain:, error_occurred: false) ⇒ Object
- #johari_report ⇒ Object
- #mitigate_blindspot(blindspot_id:, boost: nil) ⇒ Object
- #mitigation_strategies_report(domain: nil) ⇒ Object
- #most_severe_report(limit: 5) ⇒ Object
- #register_blindspot(domain:, discovered_by:, description:, severity: nil) ⇒ Object
- #resolve_blindspot(blindspot_id:) ⇒ Object
- #set_knowledge_boundary(domain:, confidence: 0.5, coverage_estimate: 0.5) ⇒ Object
Instance Method Details
#acknowledge_blindspot(blindspot_id:) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/legion/extensions/agentic/attention/blindspot/runners/cognitive_blindspot.rb', line 24 def acknowledge_blindspot(blindspot_id:, **) result = engine.acknowledge_blindspot(blindspot_id: blindspot_id) return { success: false, error: 'blindspot not found' } unless result[:found] { success: true }.merge(result) end |
#active_blindspots_report ⇒ Object
60 61 62 63 |
# File 'lib/legion/extensions/agentic/attention/blindspot/runners/cognitive_blindspot.rb', line 60 def active_blindspots_report(**) spots = engine.active_blindspots { success: true, count: spots.size, blindspots: spots.map(&:to_h) } end |
#awareness_score_report ⇒ Object
84 85 86 87 88 89 90 91 92 |
# File 'lib/legion/extensions/agentic/attention/blindspot/runners/cognitive_blindspot.rb', line 84 def awareness_score_report(**) score = engine.awareness_score { success: true, awareness_score: score.round(10), awareness_label: engine.awareness_label, awareness_gap: engine.awareness_gap } end |
#blindspot_stats ⇒ Object
94 95 96 |
# File 'lib/legion/extensions/agentic/attention/blindspot/runners/cognitive_blindspot.rb', line 94 def blindspot_stats(**) engine.to_h end |
#coverage_report ⇒ Object
75 76 77 78 |
# File 'lib/legion/extensions/agentic/attention/blindspot/runners/cognitive_blindspot.rb', line 75 def coverage_report(**) boundaries = engine.coverage_report { success: true, count: boundaries.size, boundaries: boundaries } end |
#detect_boundary_gap(domain:, error_occurred: false) ⇒ Object
55 56 57 58 |
# File 'lib/legion/extensions/agentic/attention/blindspot/runners/cognitive_blindspot.rb', line 55 def detect_boundary_gap(domain:, error_occurred: false, **) result = engine.detect_boundary_gap(domain: domain, error_occurred: error_occurred) { success: true }.merge(result) end |
#johari_report ⇒ Object
80 81 82 |
# File 'lib/legion/extensions/agentic/attention/blindspot/runners/cognitive_blindspot.rb', line 80 def johari_report(**) engine.johari_report end |
#mitigate_blindspot(blindspot_id:, boost: nil) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/legion/extensions/agentic/attention/blindspot/runners/cognitive_blindspot.rb', line 31 def mitigate_blindspot(blindspot_id:, boost: nil, **) b = boost || Helpers::Constants::SEVERITY_BOOST result = engine.mitigate_blindspot(blindspot_id: blindspot_id, boost: b) return { success: false, error: 'blindspot not found' } unless result[:found] { success: true }.merge(result) end |
#mitigation_strategies_report(domain: nil) ⇒ Object
70 71 72 73 |
# File 'lib/legion/extensions/agentic/attention/blindspot/runners/cognitive_blindspot.rb', line 70 def mitigation_strategies_report(domain: nil, **) strategies = engine.mitigation_strategies(domain: domain) { success: true, count: strategies.size, strategies: strategies } end |
#most_severe_report(limit: 5) ⇒ Object
65 66 67 68 |
# File 'lib/legion/extensions/agentic/attention/blindspot/runners/cognitive_blindspot.rb', line 65 def most_severe_report(limit: 5, **) spots = engine.most_severe(limit: limit) { success: true, limit: limit, blindspots: spots.map(&:to_h) } end |
#register_blindspot(domain:, discovered_by:, description:, severity: nil) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/legion/extensions/agentic/attention/blindspot/runners/cognitive_blindspot.rb', line 12 def register_blindspot(domain:, discovered_by:, description:, severity: nil, **) sev = severity || Helpers::Constants::DEFAULT_SEVERITY spot = engine.register_blindspot( domain: domain, discovered_by: discovered_by, description: description, severity: sev ) { success: true }.merge(spot.to_h) end |
#resolve_blindspot(blindspot_id:) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/legion/extensions/agentic/attention/blindspot/runners/cognitive_blindspot.rb', line 39 def resolve_blindspot(blindspot_id:, **) result = engine.resolve_blindspot(blindspot_id: blindspot_id) return { success: false, error: 'blindspot not found' } unless result[:found] { success: true }.merge(result) end |
#set_knowledge_boundary(domain:, confidence: 0.5, coverage_estimate: 0.5) ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/legion/extensions/agentic/attention/blindspot/runners/cognitive_blindspot.rb', line 46 def set_knowledge_boundary(domain:, confidence: 0.5, coverage_estimate: 0.5, **) boundary = engine.set_boundary( domain: domain, confidence: confidence, coverage_estimate: coverage_estimate ) { success: true }.merge(boundary.to_h) end |