Module: Legion::Extensions::Agentic::Homeostasis::Core::Helpers::Constants

Defined in:
lib/legion/extensions/agentic/homeostasis/core/helpers/constants.rb

Constant Summary collapse

SETPOINTS =

Regulated subsystems and their ideal setpoints (0.0-1.0 scale)

{
  emotional_arousal:   { target: 0.4, tolerance: 0.2 },
  curiosity_intensity: { target: 0.5, tolerance: 0.25 },
  cognitive_load:      { target: 0.6, tolerance: 0.2 },
  memory_health:       { target: 0.7, tolerance: 0.15 },
  prediction_accuracy: { target: 0.6, tolerance: 0.2 },
  trust_stability:     { target: 0.7, tolerance: 0.15 },
  attention_breadth:   { target: 0.5, tolerance: 0.2 }
}.freeze
REGULATION_GAIN =

Regulation gains (how aggressively the system corrects) Higher gain = faster correction but more oscillation risk

{
  emotional_arousal:   0.3,
  curiosity_intensity: 0.2,
  cognitive_load:      0.4,
  memory_health:       0.1,
  prediction_accuracy: 0.15,
  trust_stability:     0.1,
  attention_breadth:   0.2
}.freeze
ALLOSTATIC_LOAD_HEALTHY =

Allostatic load thresholds

0.3
ALLOSTATIC_LOAD_ELEVATED =
0.6
ALLOSTATIC_LOAD_CRITICAL =
0.85
ALLOSTATIC_DECAY_RATE =

per tick when within tolerance

0.02
ALLOSTATIC_ACCUMULATION =

per tick when outside tolerance

0.05
MAX_DAMPEN =

Modulation signal bounds

-0.5  # maximum dampening signal
MAX_AMPLIFY =

maximum dampening signal

0.5
SETPOINT_ADAPTATION_ALPHA =

EMA alpha for setpoint adaptation

0.05
MAX_REGULATION_HISTORY =

History limits

100
MAX_ALLOSTATIC_HISTORY =
200
SIGNAL_TYPES =

Regulation signal types

%i[dampen amplify hold].freeze
REGULATION_HEALTH =

Health classification thresholds

{
  (0.8..)     => :stable,
  (0.6...0.8) => :compensating,
  (0.4...0.6) => :strained,
  (0.2...0.4) => :dysregulated,
  (..0.2)     => :critical
}.freeze