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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1451732e09f9aaebe3c833f3e9edf5923d0081c262d5fa3f1d0ad1392bbf660
4
- data.tar.gz: deaa140090d9630d0ca749ed5a180e278f5ae8a0fe76b1bd840d1d949051990b
3
+ metadata.gz: afb08e9dbea89d478465201df4b9ec6eaabe05a99ed91949eb18198044e1db86
4
+ data.tar.gz: 0b7a792ff85eac9b765207e70e6e27dfcfc6c29763015f0ab6c9aa7af0c41592
5
5
  SHA512:
6
- metadata.gz: 5a25e9fb7182dbeecc0c9e290ac6f3f7ba8f2be0b1d16d777b4502f63e98fe827b4ec0af60d303bbd83b10c22baabaec3df015e236bce4aa2c0b042a6cf710ed
7
- data.tar.gz: d0c7d9f674583d01790199fa0750b036b64457b7a1a37900cabbad600be4a7e3c01bca43d254466ad848cdfd5a0d6c07aabdf43328d1b083263f59ef52e04e63
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
- @domain_counts[domain] += 1
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 = @domain_counts&.fetch(domain, 0) || 0
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
@@ -4,7 +4,7 @@ module Legion
4
4
  module Extensions
5
5
  module Agentic
6
6
  module Affect
7
- VERSION = '0.1.12'
7
+ VERSION = '0.1.13'
8
8
  end
9
9
  end
10
10
  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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-agentic-affect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity