lex-agentic-memory 0.1.17 → 0.1.19
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 +12 -0
- data/lib/legion/extensions/agentic/memory/trace/helpers/error_tracer.rb +1 -1
- data/lib/legion/extensions/agentic/memory/trace/helpers/postgres_store.rb +6 -3
- data/lib/legion/extensions/agentic/memory/version.rb +1 -1
- data/spec/legion/extensions/agentic/memory/trace/helpers/error_tracer_spec.rb +46 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 440d04008d2af919b940d155b035cf4d1cac9d8e67361792008b166504ed9a2a
|
|
4
|
+
data.tar.gz: 0f0d8fade5d070d635b707e792501d9b88624205940b32b9babf194c33970620
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d6695c59a99700fb47490bafbf29e9749fca9f9b523d38ec67ee31f3a522f633fc0c5a36d0cdbd6f362e6bbb78ac35a896a2bcf9023f16a3c3d6d9cb25ea6279
|
|
7
|
+
data.tar.gz: 7e79c8329c3de95c22a832144d729c5430586048727a88762698df887fb8b9a06689391f9539ac081375082b19e76b8805dcb807554d7f30df342cd3b1eb00f1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.19] - 2026-03-31
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- `postgres_store.retrieve_by_domain` now accepts `min_strength:` keyword to match in-memory store interface
|
|
7
|
+
- `postgres_store.all_traces` now accepts `min_strength:` keyword to match in-memory store interface
|
|
8
|
+
- Both methods now filter by strength in the SQL query for consistency with Store and CacheStore
|
|
9
|
+
|
|
10
|
+
## [0.1.18] - 2026-03-30
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- fix `NameError: undefined local variable or method 'log'` in ErrorTracer.setup by replacing `log.info` with `Legion::Logging.info` — singleton module context has no `Legion::Logging::Helper` mixin
|
|
14
|
+
|
|
3
15
|
## [0.1.17] - 2026-03-30
|
|
4
16
|
|
|
5
17
|
### Changed
|
|
@@ -21,7 +21,7 @@ module Legion
|
|
|
21
21
|
@runner = Object.new.extend(Legion::Extensions::Agentic::Memory::Trace::Runners::Traces)
|
|
22
22
|
wrap_logging_methods
|
|
23
23
|
@active = true
|
|
24
|
-
|
|
24
|
+
Legion::Logging.info '[memory] ErrorTracer active — errors/fatals will become episodic traces'
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def active?
|
|
@@ -76,11 +76,12 @@ module Legion
|
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
# Retrieve traces whose domain_tags column contains the given tag string.
|
|
79
|
-
def retrieve_by_domain(tag, limit: 50)
|
|
79
|
+
def retrieve_by_domain(tag, min_strength: 0.0, limit: 50)
|
|
80
80
|
return [] unless db_ready?
|
|
81
81
|
|
|
82
82
|
rows = traces_ds
|
|
83
83
|
.where(Sequel.like(:domain_tags, "%#{tag}%"))
|
|
84
|
+
.where { strength >= min_strength }
|
|
84
85
|
.order(Sequel.desc(:strength))
|
|
85
86
|
.limit(limit)
|
|
86
87
|
.all
|
|
@@ -91,10 +92,12 @@ module Legion
|
|
|
91
92
|
end
|
|
92
93
|
|
|
93
94
|
# Return all traces for this tenant.
|
|
94
|
-
def all_traces
|
|
95
|
+
def all_traces(min_strength: 0.0)
|
|
95
96
|
return [] unless db_ready?
|
|
96
97
|
|
|
97
|
-
|
|
98
|
+
ds = traces_ds
|
|
99
|
+
ds = ds.where { strength >= min_strength } if min_strength > 0.0
|
|
100
|
+
ds.all.map { |r| deserialize_trace(r) }
|
|
98
101
|
rescue StandardError => e
|
|
99
102
|
log_warn("all_traces failed: #{e.message}")
|
|
100
103
|
[]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'spec_helper'
|
|
4
|
+
|
|
5
|
+
RSpec.describe Legion::Extensions::Agentic::Memory::Trace::Helpers::ErrorTracer do
|
|
6
|
+
# Capture originals before any example runs so we can restore after each
|
|
7
|
+
original_error = Legion::Logging.method(:error)
|
|
8
|
+
original_fatal = Legion::Logging.method(:fatal)
|
|
9
|
+
|
|
10
|
+
before do
|
|
11
|
+
# Reset state between examples
|
|
12
|
+
described_class.instance_variable_set(:@active, nil)
|
|
13
|
+
described_class.instance_variable_set(:@recent, nil)
|
|
14
|
+
described_class.instance_variable_set(:@runner, nil)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
after do
|
|
18
|
+
# Restore logging singleton methods to prevent cross-test side effects
|
|
19
|
+
Legion::Logging.define_singleton_method(:error, &original_error)
|
|
20
|
+
Legion::Logging.define_singleton_method(:fatal, &original_fatal)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
describe '.setup' do
|
|
24
|
+
it 'activates without raising' do
|
|
25
|
+
expect { described_class.setup }.not_to raise_error
|
|
26
|
+
expect(described_class.active?).to be true
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it 'is idempotent' do
|
|
30
|
+
described_class.setup
|
|
31
|
+
described_class.setup
|
|
32
|
+
expect(described_class.active?).to be true
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe '.active?' do
|
|
37
|
+
it 'returns false before setup' do
|
|
38
|
+
expect(described_class.active?).to be false
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
it 'returns true after setup' do
|
|
42
|
+
described_class.setup
|
|
43
|
+
expect(described_class.active?).to be true
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lex-agentic-memory
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.19
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Esity
|
|
@@ -461,6 +461,7 @@ files:
|
|
|
461
461
|
- spec/legion/extensions/agentic/memory/trace/batch_decay_spec.rb
|
|
462
462
|
- spec/legion/extensions/agentic/memory/trace/client_spec.rb
|
|
463
463
|
- spec/legion/extensions/agentic/memory/trace/helpers/decay_spec.rb
|
|
464
|
+
- spec/legion/extensions/agentic/memory/trace/helpers/error_tracer_spec.rb
|
|
464
465
|
- spec/legion/extensions/agentic/memory/trace/helpers/hot_tier_spec.rb
|
|
465
466
|
- spec/legion/extensions/agentic/memory/trace/helpers/postgres_store_spec.rb
|
|
466
467
|
- spec/legion/extensions/agentic/memory/trace/helpers/snapshot_spec.rb
|