lex-agentic-memory 0.1.11 → 0.1.12
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 +5 -0
- data/lib/legion/extensions/agentic/memory/trace/helpers/postgres_store.rb +5 -4
- data/lib/legion/extensions/agentic/memory/version.rb +1 -1
- data/spec/legion/extensions/agentic/memory/hologram/helpers/hologram_spec.rb +3 -1
- data/spec/legion/extensions/agentic/memory/trace/helpers/postgres_store_spec.rb +17 -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: 6f9d21093f342adfd656a2775f74aa1e53a397c16c484b4826bfa076d06799d7
|
|
4
|
+
data.tar.gz: 917b0430e8fe409bbe1e857d9e3989fe722405fc7a0c746de463663552aea51c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: baa0bf1ac1b2e8b49af95680e021643df0c85fd1e9eed423fc41327d7aae4e52c93b951eed9662754469e9d2ed3df63be17d22793b91d7678e2cbf61a69aa841
|
|
7
|
+
data.tar.gz: 6463bbc07b183c771179ce3447b0846fb5b6b48065c16931c439ef5124e2e81091e13079a5c50ab6189acf5646c7fba010ae869949ef053de3612485aa21ec4c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.12] - 2026-03-26
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- `PostgresStore#store` used SQLite-specific `insert_conflict(:replace)` which fails on PostgreSQL with `TypeError: no implicit conversion of Symbol into Integer`. Replaced with proper `insert_conflict(target: :trace_id, update: ...)` syntax that generates correct `ON CONFLICT` SQL
|
|
7
|
+
|
|
3
8
|
## [0.1.11] - 2026-03-25
|
|
4
9
|
|
|
5
10
|
### Added
|
|
@@ -25,10 +25,11 @@ module Legion
|
|
|
25
25
|
return nil unless db_ready?
|
|
26
26
|
|
|
27
27
|
row = serialize_trace(trace)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
ds = db[TRACES_TABLE]
|
|
29
|
+
if db.adapter_scheme == :mysql2
|
|
30
|
+
ds.insert_conflict(update: row.except(:trace_id)).insert(row)
|
|
31
|
+
else
|
|
32
|
+
ds.insert_conflict(target: :trace_id, update: row.except(:trace_id)).insert(row)
|
|
32
33
|
end
|
|
33
34
|
HotTier.cache_trace(trace, tenant_id: @tenant_id) if HotTier.available?
|
|
34
35
|
trace[:trace_id]
|
|
@@ -99,7 +99,9 @@ RSpec.describe Legion::Extensions::Agentic::Memory::Hologram::Helpers::Hologram
|
|
|
99
99
|
|
|
100
100
|
describe '#reconstruct' do
|
|
101
101
|
context 'with sufficient fragments' do
|
|
102
|
-
|
|
102
|
+
# Force completeness above RECONSTRUCTION_THRESHOLD (0.3) so the context
|
|
103
|
+
# is deterministic — fragment!(4) uses rand and can produce all-insufficient sets.
|
|
104
|
+
let(:fragments) { hologram.fragment!(4).each { |f| f.completeness = 1.0 } }
|
|
103
105
|
|
|
104
106
|
it 'returns success: true' do
|
|
105
107
|
expect(hologram.reconstruct(fragments)[:success]).to be true
|
|
@@ -110,6 +110,23 @@ RSpec.describe Legion::Extensions::Agentic::Memory::Trace::Helpers::PostgresStor
|
|
|
110
110
|
end
|
|
111
111
|
end
|
|
112
112
|
|
|
113
|
+
# --- store insert_conflict syntax ---
|
|
114
|
+
|
|
115
|
+
describe '#store insert_conflict syntax' do
|
|
116
|
+
it 'calls insert_conflict with target: :trace_id (not :replace symbol)' do
|
|
117
|
+
ds = double('dataset')
|
|
118
|
+
allow(db).to receive(:[]).with(:memory_traces).and_return(ds)
|
|
119
|
+
allow(ds).to receive(:where).and_return(ds)
|
|
120
|
+
allow(ds).to receive(:insert_conflict).and_return(ds)
|
|
121
|
+
allow(ds).to receive(:insert)
|
|
122
|
+
|
|
123
|
+
store.store(semantic_trace)
|
|
124
|
+
|
|
125
|
+
expect(ds).to have_received(:insert_conflict)
|
|
126
|
+
.with(hash_including(target: :trace_id))
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
|
|
113
130
|
# --- store + retrieve ---
|
|
114
131
|
|
|
115
132
|
describe '#store and #retrieve' do
|