lex-agentic-affect 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/legion/extensions/agentic/affect/emotion/client.rb +1 -2
- data/lib/legion/extensions/agentic/affect/emotion/runners/valence.rb +12 -1
- data/lib/legion/extensions/agentic/affect/version.rb +1 -1
- data/spec/legion/extensions/agentic/affect/emotion/runners/valence_spec.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: afb08e9dbea89d478465201df4b9ec6eaabe05a99ed91949eb18198044e1db86
|
|
4
|
+
data.tar.gz: 0b7a792ff85eac9b765207e70e6e27dfcfc6c29763015f0ab6c9aa7af0c41592
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d9f786f6426c888d6b47665316c1c9cf9c8078717ebcda9cb16dce37dab32ea9219d5e5a99d5a2723fbfa8bf6de8491d69f41e284860de326c070f2531add661
|
|
7
|
+
data.tar.gz: 688c8e690240a35ed1019261d61ce85c917c361731ee973d4205646c85903ba166b5fd01a5f37df4525d998306199398bc8a9a100298b6b15686c91cf6fa385c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.13] - 2026-05-07
|
|
4
|
+
### Fixed
|
|
5
|
+
- Valence evaluation now lazily initializes and updates domain signal counts so familiarity scoring works in runner-host usage.
|
|
6
|
+
|
|
3
7
|
## [0.1.12] - 2026-04-22
|
|
4
8
|
### Added
|
|
5
9
|
- 6 new maintenance actors: Mood::Actor::UpdateMood (60s), Flow::Actor::UpdateFlow (30s), Fatigue::Actor::UpdateFatigue (60s), Resilience::Actor::UpdateResilience (120s), Regulation::Actor::RegulateEmotion (60s), Empathy::Actor::DecayModels (300s)
|
|
@@ -19,11 +19,10 @@ module Legion
|
|
|
19
19
|
def initialize(**)
|
|
20
20
|
@emotion_baseline = Helpers::Baseline.new
|
|
21
21
|
@emotion_momentum = Helpers::Momentum.new
|
|
22
|
-
@domain_counts = Hash.new(0)
|
|
23
22
|
end
|
|
24
23
|
|
|
25
24
|
def track_domain(domain)
|
|
26
|
-
|
|
25
|
+
domain_counts[domain] += 1
|
|
27
26
|
end
|
|
28
27
|
|
|
29
28
|
private
|
|
@@ -31,6 +31,7 @@ module Legion
|
|
|
31
31
|
novelty: novelty_raw, familiarity: familiarity_raw }[dim]
|
|
32
32
|
baseline.update(dim, raw)
|
|
33
33
|
end
|
|
34
|
+
record_domain_signal(domain)
|
|
34
35
|
|
|
35
36
|
magnitude = Helpers::Valence.magnitude(valence)
|
|
36
37
|
dominant = Helpers::Valence.dominant_dimension(valence)
|
|
@@ -111,6 +112,16 @@ module Legion
|
|
|
111
112
|
@emotion_baseline ||= Helpers::Baseline.new
|
|
112
113
|
end
|
|
113
114
|
|
|
115
|
+
def domain_counts
|
|
116
|
+
@domain_counts ||= Hash.new(0)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def record_domain_signal(domain)
|
|
120
|
+
return unless domain
|
|
121
|
+
|
|
122
|
+
domain_counts[domain] += 1
|
|
123
|
+
end
|
|
124
|
+
|
|
114
125
|
def compute_urgency(signal, source_type, deadline)
|
|
115
126
|
deadline_urgency = 0.0
|
|
116
127
|
if deadline
|
|
@@ -141,7 +152,7 @@ module Legion
|
|
|
141
152
|
end
|
|
142
153
|
|
|
143
154
|
def compute_familiarity(domain)
|
|
144
|
-
signal_count =
|
|
155
|
+
signal_count = domain_counts.fetch(domain, 0)
|
|
145
156
|
Helpers::Valence.clamp(signal_count.to_f / Helpers::Valence::FAMILIARITY_SATURATION)
|
|
146
157
|
end
|
|
147
158
|
end
|
|
@@ -32,6 +32,14 @@ RSpec.describe Legion::Extensions::Agentic::Affect::Emotion::Runners::Valence do
|
|
|
32
32
|
with_deadline = client.evaluate_valence(signal: {}, deadline: Time.now.utc + 60)
|
|
33
33
|
expect(with_deadline[:valence][:urgency]).to be >= no_deadline[:valence][:urgency]
|
|
34
34
|
end
|
|
35
|
+
|
|
36
|
+
it 'initializes and updates domain counts in runner-host usage' do
|
|
37
|
+
expect(client.instance_variable_get(:@domain_counts)).to be_nil
|
|
38
|
+
|
|
39
|
+
client.evaluate_valence(signal: {}, domain: :ops)
|
|
40
|
+
|
|
41
|
+
expect(client.instance_variable_get(:@domain_counts)[:ops]).to eq(1)
|
|
42
|
+
end
|
|
35
43
|
end
|
|
36
44
|
|
|
37
45
|
describe '#aggregate_valences' do
|