Module: Legion::Extensions::Agentic::Social::Conflict::Helpers::Severity
- Defined in:
- lib/legion/extensions/agentic/social/conflict/helpers/severity.rb
Constant Summary collapse
- LEVELS =
%i[low medium high critical].freeze
- POSTURES =
%i[speak_once persistent_engagement stubborn_presence].freeze
- PERSISTENT_THRESHOLD =
Posture selection thresholds
:high- STUBBORN_THRESHOLD =
:critical- LEVEL_ORDER =
{ low: 0, medium: 1, high: 2, critical: 3 }.freeze
- STALE_CONFLICT_TIMEOUT =
24 hours
86_400
Class Method Summary collapse
- .recommended_posture(severity) ⇒ Object
- .severity_gte?(left, right) ⇒ Boolean
- .valid_level?(level) ⇒ Boolean
- .valid_posture?(posture) ⇒ Boolean
Class Method Details
.recommended_posture(severity) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/legion/extensions/agentic/social/conflict/helpers/severity.rb', line 30 def recommended_posture(severity) case severity when :critical then :stubborn_presence when :high then :persistent_engagement else :speak_once end end |
.severity_gte?(left, right) ⇒ Boolean
38 39 40 |
# File 'lib/legion/extensions/agentic/social/conflict/helpers/severity.rb', line 38 def severity_gte?(left, right) LEVEL_ORDER.fetch(left, 0) >= LEVEL_ORDER.fetch(right, 0) end |
.valid_level?(level) ⇒ Boolean
22 23 24 |
# File 'lib/legion/extensions/agentic/social/conflict/helpers/severity.rb', line 22 def valid_level?(level) LEVELS.include?(level) end |
.valid_posture?(posture) ⇒ Boolean
26 27 28 |
# File 'lib/legion/extensions/agentic/social/conflict/helpers/severity.rb', line 26 def valid_posture?(posture) POSTURES.include?(posture) end |