lex-agentic-memory 0.1.6 → 0.1.9

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.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/LICENSE +201 -21
  4. data/lib/legion/extensions/agentic/memory/archaeology/actors/decay.rb +22 -0
  5. data/lib/legion/extensions/agentic/memory/archaeology/runners/cognitive_archaeology.rb +6 -0
  6. data/lib/legion/extensions/agentic/memory/compression/actors/maintenance.rb +22 -0
  7. data/lib/legion/extensions/agentic/memory/echo/actors/decay.rb +22 -0
  8. data/lib/legion/extensions/agentic/memory/echo_chamber/actors/decay.rb +22 -0
  9. data/lib/legion/extensions/agentic/memory/echo_chamber/runners/cognitive_echo_chamber.rb +6 -0
  10. data/lib/legion/extensions/agentic/memory/hologram/helpers/constants.rb +4 -4
  11. data/lib/legion/extensions/agentic/memory/immune_memory/actors/decay.rb +22 -0
  12. data/lib/legion/extensions/agentic/memory/nostalgia/actors/maintenance.rb +22 -0
  13. data/lib/legion/extensions/agentic/memory/palimpsest/actors/decay.rb +22 -0
  14. data/lib/legion/extensions/agentic/memory/reserve/actors/maintenance.rb +22 -0
  15. data/lib/legion/extensions/agentic/memory/semantic_priming/actors/decay.rb +22 -0
  16. data/lib/legion/extensions/agentic/memory/semantic_satiation/actors/recovery.rb +22 -0
  17. data/lib/legion/extensions/agentic/memory/trace/actors/quota.rb +22 -0
  18. data/lib/legion/extensions/agentic/memory/trace/helpers/cache_store.rb +51 -34
  19. data/lib/legion/extensions/agentic/memory/trace/helpers/store.rb +32 -25
  20. data/lib/legion/extensions/agentic/memory/trace/runners/consolidation.rb +7 -0
  21. data/lib/legion/extensions/agentic/memory/version.rb +1 -1
  22. data/spec/legion/extensions/agentic/memory/archaeology/actors/decay_spec.rb +24 -0
  23. data/spec/legion/extensions/agentic/memory/compression/actors/maintenance_spec.rb +24 -0
  24. data/spec/legion/extensions/agentic/memory/echo/actors/decay_spec.rb +24 -0
  25. data/spec/legion/extensions/agentic/memory/echo_chamber/actors/decay_spec.rb +24 -0
  26. data/spec/legion/extensions/agentic/memory/immune_memory/actors/decay_spec.rb +24 -0
  27. data/spec/legion/extensions/agentic/memory/nostalgia/actors/maintenance_spec.rb +24 -0
  28. data/spec/legion/extensions/agentic/memory/palimpsest/actors/decay_spec.rb +24 -0
  29. data/spec/legion/extensions/agentic/memory/reserve/actors/maintenance_spec.rb +24 -0
  30. data/spec/legion/extensions/agentic/memory/semantic_priming/actors/decay_spec.rb +24 -0
  31. data/spec/legion/extensions/agentic/memory/semantic_satiation/actors/recovery_spec.rb +24 -0
  32. data/spec/legion/extensions/agentic/memory/trace/actors/quota_spec.rb +24 -0
  33. metadata +23 -1
@@ -21,6 +21,7 @@ module Legion
21
21
 
22
22
  def initialize
23
23
  Legion::Logging.info '[memory] CacheStore initialized (memcached-backed, per-key)'
24
+ @mutex = Mutex.new
24
25
  @traces = {}
25
26
  @associations = {}
26
27
  @dirty_ids = Set.new
@@ -31,8 +32,10 @@ module Legion
31
32
  end
32
33
 
33
34
  def store(trace)
34
- @traces[trace[:trace_id]] = trace
35
- @dirty_ids << trace[:trace_id]
35
+ @mutex.synchronize do
36
+ @traces[trace[:trace_id]] = trace
37
+ @dirty_ids << trace[:trace_id]
38
+ end
36
39
  trace[:trace_id]
37
40
  end
38
41
 
@@ -41,26 +44,28 @@ module Legion
41
44
  end
42
45
 
43
46
  def delete(trace_id)
44
- @traces.delete(trace_id)
45
- @associations.delete(trace_id)
46
- @associations.each_value { |links| links.delete(trace_id) }
47
- @dirty_ids.delete(trace_id)
48
- @deleted_ids << trace_id
49
- @assoc_dirty = true
47
+ @mutex.synchronize do
48
+ @traces.delete(trace_id)
49
+ @associations.delete(trace_id)
50
+ @associations.each_value { |links| links.delete(trace_id) }
51
+ @dirty_ids.delete(trace_id)
52
+ @deleted_ids << trace_id
53
+ @assoc_dirty = true
54
+ end
50
55
  end
51
56
 
52
57
  def retrieve_by_type(type, min_strength: 0.0, limit: 100)
53
- @traces.values
54
- .select { |t| t[:trace_type] == type && t[:strength] >= min_strength }
55
- .sort_by { |t| -t[:strength] }
56
- .first(limit)
58
+ snapshot = @mutex.synchronize { @traces.values }
59
+ snapshot.select { |t| t[:trace_type] == type && t[:strength] >= min_strength }
60
+ .sort_by { |t| -t[:strength] }
61
+ .first(limit)
57
62
  end
58
63
 
59
64
  def retrieve_by_domain(domain_tag, min_strength: 0.0, limit: 100)
60
- @traces.values
61
- .select { |t| t[:domain_tags].include?(domain_tag) && t[:strength] >= min_strength }
62
- .sort_by { |t| -t[:strength] }
63
- .first(limit)
65
+ snapshot = @mutex.synchronize { @traces.values }
66
+ snapshot.select { |t| t[:domain_tags].include?(domain_tag) && t[:strength] >= min_strength }
67
+ .sort_by { |t| -t[:strength] }
68
+ .first(limit)
64
69
  end
65
70
 
66
71
  def retrieve_associated(trace_id, min_strength: 0.0, limit: 20)
@@ -77,30 +82,36 @@ module Legion
77
82
  def record_coactivation(trace_id_a, trace_id_b)
78
83
  return if trace_id_a == trace_id_b
79
84
 
80
- @associations[trace_id_a] ||= {}
81
- @associations[trace_id_b] ||= {}
82
- @associations[trace_id_a][trace_id_b] = (@associations[trace_id_a][trace_id_b] || 0) + 1
83
- @associations[trace_id_b][trace_id_a] = (@associations[trace_id_b][trace_id_a] || 0) + 1
85
+ @mutex.synchronize do
86
+ @associations[trace_id_a] ||= {}
87
+ @associations[trace_id_b] ||= {}
88
+ @associations[trace_id_a][trace_id_b] = (@associations[trace_id_a][trace_id_b] || 0) + 1
89
+ @associations[trace_id_b][trace_id_a] = (@associations[trace_id_b][trace_id_a] || 0) + 1
84
90
 
85
- threshold = Helpers::Trace::COACTIVATION_THRESHOLD
86
- link_traces(trace_id_a, trace_id_b) if @associations[trace_id_a][trace_id_b] >= threshold
87
- @assoc_dirty = true
91
+ threshold = Helpers::Trace::COACTIVATION_THRESHOLD
92
+ link_traces(trace_id_a, trace_id_b) if @associations[trace_id_a][trace_id_b] >= threshold
93
+ @assoc_dirty = true
94
+ end
88
95
  end
89
96
 
90
97
  def all_traces(min_strength: 0.0)
91
- @traces.values.select { |t| t[:strength] >= min_strength }
98
+ snapshot = @mutex.synchronize { @traces.values }
99
+ snapshot.select { |t| t[:strength] >= min_strength }
92
100
  end
93
101
 
94
102
  def count
95
103
  @traces.size
96
104
  end
97
105
 
106
+ def synchronize(&) = @mutex.synchronize(&)
107
+
98
108
  def firmware_traces
99
109
  retrieve_by_type(:firmware)
100
110
  end
101
111
 
102
112
  def walk_associations(start_id:, max_hops: 12, min_strength: 0.1)
103
- return [] unless @traces.key?(start_id)
113
+ snapshot = @mutex.synchronize { @traces.dup }
114
+ return [] unless snapshot.key?(start_id)
104
115
 
105
116
  results = []
106
117
  visited = Set.new([start_id])
@@ -108,13 +119,13 @@ module Legion
108
119
 
109
120
  until queue.empty?
110
121
  current_id, depth, path = queue.shift
111
- current = @traces[current_id]
122
+ current = snapshot[current_id]
112
123
  next unless current
113
124
 
114
125
  current[:associated_traces].each do |neighbor_id|
115
126
  next if visited.include?(neighbor_id)
116
127
 
117
- neighbor = @traces[neighbor_id]
128
+ neighbor = snapshot[neighbor_id]
118
129
  next unless neighbor
119
130
  next unless neighbor[:strength] >= min_strength
120
131
 
@@ -130,13 +141,15 @@ module Legion
130
141
 
131
142
  # Write dirty traces to cache as individual keys
132
143
  def flush
133
- flush_deleted
134
- flush_traces
135
- flush_associations
136
- flush_index
137
- Legion::Logging.debug "[memory] CacheStore flushed #{@dirty_ids.size} dirty traces (#{@traces.size} total)"
138
- @dirty_ids.clear
139
- @deleted_ids.clear
144
+ @mutex.synchronize do
145
+ flush_deleted
146
+ flush_traces
147
+ flush_associations
148
+ flush_index
149
+ Legion::Logging.debug "[memory] CacheStore flushed #{@dirty_ids.size} dirty traces (#{@traces.size} total)"
150
+ @dirty_ids.clear
151
+ @deleted_ids.clear
152
+ end
140
153
  end
141
154
 
142
155
  # Pull latest state from cache
@@ -195,12 +208,16 @@ module Legion
195
208
 
196
209
  Legion::Cache.set(ASSOC_KEY, strip_default_procs(@associations), TTL)
197
210
  @assoc_dirty = false
211
+ rescue StandardError => e
212
+ Legion::Logging.warn "[memory] CacheStore flush_associations failed (#{@associations.size} entries): #{e.message}" if defined?(Legion::Logging)
198
213
  end
199
214
 
200
215
  def flush_index
201
216
  return if @dirty_ids.empty? && @deleted_ids.empty?
202
217
 
203
218
  Legion::Cache.set(INDEX_KEY, @traces.keys, TTL)
219
+ rescue StandardError => e
220
+ Legion::Logging.warn "[memory] CacheStore flush_index failed (#{@traces.size} traces): #{e.message}" if defined?(Legion::Logging)
204
221
  end
205
222
 
206
223
  def strip_default_procs(hash)
@@ -14,13 +14,14 @@ module Legion
14
14
  attr_reader :traces, :associations
15
15
 
16
16
  def initialize
17
+ @mutex = Mutex.new
17
18
  @traces = {}
18
19
  @associations = Hash.new { |h, k| h[k] = Hash.new(0) }
19
20
  load_from_local
20
21
  end
21
22
 
22
23
  def store(trace)
23
- @traces[trace[:trace_id]] = trace
24
+ @mutex.synchronize { @traces[trace[:trace_id]] = trace }
24
25
  trace[:trace_id]
25
26
  end
26
27
 
@@ -29,23 +30,25 @@ module Legion
29
30
  end
30
31
 
31
32
  def delete(trace_id)
32
- @traces.delete(trace_id)
33
- @associations.delete(trace_id)
34
- @associations.each_value { |links| links.delete(trace_id) }
33
+ @mutex.synchronize do
34
+ @traces.delete(trace_id)
35
+ @associations.delete(trace_id)
36
+ @associations.each_value { |links| links.delete(trace_id) }
37
+ end
35
38
  end
36
39
 
37
40
  def retrieve_by_type(type, min_strength: 0.0, limit: 100)
38
- @traces.values
39
- .select { |t| t[:trace_type] == type && t[:strength] >= min_strength }
40
- .sort_by { |t| -t[:strength] }
41
- .first(limit)
41
+ snapshot = @mutex.synchronize { @traces.values }
42
+ snapshot.select { |t| t[:trace_type] == type && t[:strength] >= min_strength }
43
+ .sort_by { |t| -t[:strength] }
44
+ .first(limit)
42
45
  end
43
46
 
44
47
  def retrieve_by_domain(domain_tag, min_strength: 0.0, limit: 100)
45
- @traces.values
46
- .select { |t| t[:domain_tags].include?(domain_tag) && t[:strength] >= min_strength }
47
- .sort_by { |t| -t[:strength] }
48
- .first(limit)
48
+ snapshot = @mutex.synchronize { @traces.values }
49
+ snapshot.select { |t| t[:domain_tags].include?(domain_tag) && t[:strength] >= min_strength }
50
+ .sort_by { |t| -t[:strength] }
51
+ .first(limit)
49
52
  end
50
53
 
51
54
  def retrieve_associated(trace_id, min_strength: 0.0, limit: 20)
@@ -62,30 +65,33 @@ module Legion
62
65
  def record_coactivation(trace_id_a, trace_id_b)
63
66
  return if trace_id_a == trace_id_b
64
67
 
65
- @associations[trace_id_a][trace_id_b] += 1
66
- @associations[trace_id_b][trace_id_a] += 1
67
-
68
- threshold = Helpers::Trace::COACTIVATION_THRESHOLD
69
-
70
- return unless @associations[trace_id_a][trace_id_b] >= threshold
68
+ @mutex.synchronize do
69
+ @associations[trace_id_a][trace_id_b] += 1
70
+ @associations[trace_id_b][trace_id_a] += 1
71
71
 
72
- link_traces(trace_id_a, trace_id_b)
72
+ threshold = Helpers::Trace::COACTIVATION_THRESHOLD
73
+ link_traces(trace_id_a, trace_id_b) if @associations[trace_id_a][trace_id_b] >= threshold
74
+ end
73
75
  end
74
76
 
75
77
  def all_traces(min_strength: 0.0)
76
- @traces.values.select { |t| t[:strength] >= min_strength }
78
+ snapshot = @mutex.synchronize { @traces.values }
79
+ snapshot.select { |t| t[:strength] >= min_strength }
77
80
  end
78
81
 
79
82
  def count
80
83
  @traces.size
81
84
  end
82
85
 
86
+ def synchronize(&) = @mutex.synchronize(&)
87
+
83
88
  def firmware_traces
84
89
  retrieve_by_type(:firmware)
85
90
  end
86
91
 
87
92
  def walk_associations(start_id:, max_hops: 12, min_strength: 0.1)
88
- return [] unless @traces.key?(start_id)
93
+ snapshot = @mutex.synchronize { @traces.dup }
94
+ return [] unless snapshot.key?(start_id)
89
95
 
90
96
  results = []
91
97
  visited = Set.new([start_id])
@@ -93,12 +99,12 @@ module Legion
93
99
 
94
100
  until queue.empty?
95
101
  current_id, depth, path = queue.shift
96
- next unless (current = @traces[current_id])
102
+ next unless (current = snapshot[current_id])
97
103
 
98
104
  current[:associated_traces].each do |neighbor_id|
99
105
  next if visited.include?(neighbor_id)
100
106
 
101
- neighbor = @traces[neighbor_id]
107
+ neighbor = snapshot[neighbor_id]
102
108
  next unless neighbor
103
109
  next unless neighbor[:strength] >= min_strength
104
110
 
@@ -117,8 +123,9 @@ module Legion
117
123
  return unless Legion::Data::Local.connection.table_exists?(:memory_traces)
118
124
 
119
125
  db = Legion::Data::Local.connection
126
+ traces_snapshot = @mutex.synchronize { @traces.dup }
120
127
 
121
- @traces.each_value do |trace|
128
+ traces_snapshot.each_value do |trace|
122
129
  row = serialize_trace_for_db(trace)
123
130
  existing = db[:memory_traces].where(trace_id: trace[:trace_id]).first
124
131
  if existing
@@ -129,7 +136,7 @@ module Legion
129
136
  end
130
137
 
131
138
  db_trace_ids = db[:memory_traces].select_map(:trace_id)
132
- memory_trace_ids = @traces.keys
139
+ memory_trace_ids = traces_snapshot.keys
133
140
  stale_ids = db_trace_ids - memory_trace_ids
134
141
  db[:memory_traces].where(trace_id: stale_ids).delete unless stale_ids.empty?
135
142
 
@@ -86,6 +86,13 @@ module Legion
86
86
  { linked: true }
87
87
  end
88
88
 
89
+ def enforce_quota(store: nil, **)
90
+ store ||= default_store
91
+ quota = Quota.new
92
+ quota.enforce!(store)
93
+ { success: true, within_limits: quota.within_limits?(store) }
94
+ end
95
+
89
96
  def erase_by_type(type:, store: nil, **)
90
97
  store ||= default_store
91
98
  type = type.to_sym
@@ -4,7 +4,7 @@ module Legion
4
4
  module Extensions
5
5
  module Agentic
6
6
  module Memory
7
- VERSION = '0.1.6'
7
+ VERSION = '0.1.9'
8
8
  end
9
9
  end
10
10
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Legion
4
+ module Extensions
5
+ module Actors
6
+ class Every # rubocop:disable Lint/EmptyClass
7
+ end
8
+ end
9
+ end
10
+ end
11
+ $LOADED_FEATURES << 'legion/extensions/actors/every'
12
+
13
+ require 'legion/extensions/agentic/memory/archaeology/actors/decay'
14
+
15
+ RSpec.describe Legion::Extensions::Agentic::Memory::Archaeology::Actors::Decay do
16
+ subject(:actor) { described_class.new }
17
+
18
+ it { expect(actor.runner_class).to eq(Legion::Extensions::Agentic::Memory::Archaeology::Runners::CognitiveArchaeology) }
19
+ it { expect(actor.runner_function).to eq('decay_all') }
20
+ it { expect(actor.time).to eq(120) }
21
+ it { expect(actor.use_runner?).to be false }
22
+ it { expect(actor.check_subtask?).to be false }
23
+ it { expect(actor.generate_task?).to be false }
24
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Legion
4
+ module Extensions
5
+ module Actors
6
+ class Every # rubocop:disable Lint/EmptyClass
7
+ end
8
+ end
9
+ end
10
+ end
11
+ $LOADED_FEATURES << 'legion/extensions/actors/every'
12
+
13
+ require 'legion/extensions/agentic/memory/compression/actors/maintenance'
14
+
15
+ RSpec.describe Legion::Extensions::Agentic::Memory::Compression::Actors::Maintenance do
16
+ subject(:actor) { described_class.new }
17
+
18
+ it { expect(actor.runner_class).to eq(Legion::Extensions::Agentic::Memory::Compression::Runners::CognitiveCompression) }
19
+ it { expect(actor.runner_function).to eq('compress_all') }
20
+ it { expect(actor.time).to eq(300) }
21
+ it { expect(actor.use_runner?).to be false }
22
+ it { expect(actor.check_subtask?).to be false }
23
+ it { expect(actor.generate_task?).to be false }
24
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Legion
4
+ module Extensions
5
+ module Actors
6
+ class Every # rubocop:disable Lint/EmptyClass
7
+ end
8
+ end
9
+ end
10
+ end
11
+ $LOADED_FEATURES << 'legion/extensions/actors/every'
12
+
13
+ require 'legion/extensions/agentic/memory/echo/actors/decay'
14
+
15
+ RSpec.describe Legion::Extensions::Agentic::Memory::Echo::Actors::Decay do
16
+ subject(:actor) { described_class.new }
17
+
18
+ it { expect(actor.runner_class).to eq(Legion::Extensions::Agentic::Memory::Echo::Runners::CognitiveEcho) }
19
+ it { expect(actor.runner_function).to eq('decay_all') }
20
+ it { expect(actor.time).to eq(60) }
21
+ it { expect(actor.use_runner?).to be false }
22
+ it { expect(actor.check_subtask?).to be false }
23
+ it { expect(actor.generate_task?).to be false }
24
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Legion
4
+ module Extensions
5
+ module Actors
6
+ class Every # rubocop:disable Lint/EmptyClass
7
+ end
8
+ end
9
+ end
10
+ end
11
+ $LOADED_FEATURES << 'legion/extensions/actors/every'
12
+
13
+ require 'legion/extensions/agentic/memory/echo_chamber/actors/decay'
14
+
15
+ RSpec.describe Legion::Extensions::Agentic::Memory::EchoChamber::Actors::Decay do
16
+ subject(:actor) { described_class.new }
17
+
18
+ it { expect(actor.runner_class).to eq(Legion::Extensions::Agentic::Memory::EchoChamber::Runners::CognitiveEchoChamber) }
19
+ it { expect(actor.runner_function).to eq('decay_all') }
20
+ it { expect(actor.time).to eq(60) }
21
+ it { expect(actor.use_runner?).to be false }
22
+ it { expect(actor.check_subtask?).to be false }
23
+ it { expect(actor.generate_task?).to be false }
24
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Legion
4
+ module Extensions
5
+ module Actors
6
+ class Every # rubocop:disable Lint/EmptyClass
7
+ end
8
+ end
9
+ end
10
+ end
11
+ $LOADED_FEATURES << 'legion/extensions/actors/every'
12
+
13
+ require 'legion/extensions/agentic/memory/immune_memory/actors/decay'
14
+
15
+ RSpec.describe Legion::Extensions::Agentic::Memory::ImmuneMemory::Actors::Decay do
16
+ subject(:actor) { described_class.new }
17
+
18
+ it { expect(actor.runner_class).to eq(Legion::Extensions::Agentic::Memory::ImmuneMemory::Runners::CognitiveImmuneMemory) }
19
+ it { expect(actor.runner_function).to eq('decay_all') }
20
+ it { expect(actor.time).to eq(60) }
21
+ it { expect(actor.use_runner?).to be false }
22
+ it { expect(actor.check_subtask?).to be false }
23
+ it { expect(actor.generate_task?).to be false }
24
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Legion
4
+ module Extensions
5
+ module Actors
6
+ class Every # rubocop:disable Lint/EmptyClass
7
+ end
8
+ end
9
+ end
10
+ end
11
+ $LOADED_FEATURES << 'legion/extensions/actors/every'
12
+
13
+ require 'legion/extensions/agentic/memory/nostalgia/actors/maintenance'
14
+
15
+ RSpec.describe Legion::Extensions::Agentic::Memory::Nostalgia::Actors::Maintenance do
16
+ subject(:actor) { described_class.new }
17
+
18
+ it { expect(actor.runner_class).to eq(Legion::Extensions::Agentic::Memory::Nostalgia::Runners::Recall) }
19
+ it { expect(actor.runner_function).to eq('age_memories') }
20
+ it { expect(actor.time).to eq(120) }
21
+ it { expect(actor.use_runner?).to be false }
22
+ it { expect(actor.check_subtask?).to be false }
23
+ it { expect(actor.generate_task?).to be false }
24
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Legion
4
+ module Extensions
5
+ module Actors
6
+ class Every # rubocop:disable Lint/EmptyClass
7
+ end
8
+ end
9
+ end
10
+ end
11
+ $LOADED_FEATURES << 'legion/extensions/actors/every'
12
+
13
+ require 'legion/extensions/agentic/memory/palimpsest/actors/decay'
14
+
15
+ RSpec.describe Legion::Extensions::Agentic::Memory::Palimpsest::Actors::Decay do
16
+ subject(:actor) { described_class.new }
17
+
18
+ it { expect(actor.runner_class).to eq(Legion::Extensions::Agentic::Memory::Palimpsest::Runners::CognitivePalimpsest) }
19
+ it { expect(actor.runner_function).to eq('decay_all_ghosts') }
20
+ it { expect(actor.time).to eq(60) }
21
+ it { expect(actor.use_runner?).to be false }
22
+ it { expect(actor.check_subtask?).to be false }
23
+ it { expect(actor.generate_task?).to be false }
24
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Legion
4
+ module Extensions
5
+ module Actors
6
+ class Every # rubocop:disable Lint/EmptyClass
7
+ end
8
+ end
9
+ end
10
+ end
11
+ $LOADED_FEATURES << 'legion/extensions/actors/every'
12
+
13
+ require 'legion/extensions/agentic/memory/reserve/actors/maintenance'
14
+
15
+ RSpec.describe Legion::Extensions::Agentic::Memory::Reserve::Actors::Maintenance do
16
+ subject(:actor) { described_class.new }
17
+
18
+ it { expect(actor.runner_class).to eq(Legion::Extensions::Agentic::Memory::Reserve::Runners::CognitiveReserve) }
19
+ it { expect(actor.runner_function).to eq('update_cognitive_reserve') }
20
+ it { expect(actor.time).to eq(60) }
21
+ it { expect(actor.use_runner?).to be false }
22
+ it { expect(actor.check_subtask?).to be false }
23
+ it { expect(actor.generate_task?).to be false }
24
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Legion
4
+ module Extensions
5
+ module Actors
6
+ class Every # rubocop:disable Lint/EmptyClass
7
+ end
8
+ end
9
+ end
10
+ end
11
+ $LOADED_FEATURES << 'legion/extensions/actors/every'
12
+
13
+ require 'legion/extensions/agentic/memory/semantic_priming/actors/decay'
14
+
15
+ RSpec.describe Legion::Extensions::Agentic::Memory::SemanticPriming::Actors::Decay do
16
+ subject(:actor) { described_class.new }
17
+
18
+ it { expect(actor.runner_class).to eq(Legion::Extensions::Agentic::Memory::SemanticPriming::Runners::SemanticPriming) }
19
+ it { expect(actor.runner_function).to eq('decay') }
20
+ it { expect(actor.time).to eq(30) }
21
+ it { expect(actor.use_runner?).to be false }
22
+ it { expect(actor.check_subtask?).to be false }
23
+ it { expect(actor.generate_task?).to be false }
24
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Legion
4
+ module Extensions
5
+ module Actors
6
+ class Every # rubocop:disable Lint/EmptyClass
7
+ end
8
+ end
9
+ end
10
+ end
11
+ $LOADED_FEATURES << 'legion/extensions/actors/every'
12
+
13
+ require 'legion/extensions/agentic/memory/semantic_satiation/actors/recovery'
14
+
15
+ RSpec.describe Legion::Extensions::Agentic::Memory::SemanticSatiation::Actors::Recovery do
16
+ subject(:actor) { described_class.new }
17
+
18
+ it { expect(actor.runner_class).to eq(Legion::Extensions::Agentic::Memory::SemanticSatiation::Runners::SemanticSatiation) }
19
+ it { expect(actor.runner_function).to eq('recover') }
20
+ it { expect(actor.time).to eq(60) }
21
+ it { expect(actor.use_runner?).to be false }
22
+ it { expect(actor.check_subtask?).to be false }
23
+ it { expect(actor.generate_task?).to be false }
24
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Legion
4
+ module Extensions
5
+ module Actors
6
+ class Every # rubocop:disable Lint/EmptyClass
7
+ end
8
+ end
9
+ end
10
+ end
11
+ $LOADED_FEATURES << 'legion/extensions/actors/every'
12
+
13
+ require 'legion/extensions/agentic/memory/trace/actors/quota'
14
+
15
+ RSpec.describe Legion::Extensions::Agentic::Memory::Trace::Actor::Quota do
16
+ subject(:actor) { described_class.new }
17
+
18
+ it { expect(actor.runner_class).to eq(Legion::Extensions::Agentic::Memory::Trace::Runners::Consolidation) }
19
+ it { expect(actor.runner_function).to eq('enforce_quota') }
20
+ it { expect(actor.time).to eq(300) }
21
+ it { expect(actor.use_runner?).to be false }
22
+ it { expect(actor.check_subtask?).to be false }
23
+ it { expect(actor.generate_task?).to be false }
24
+ end