lex-agentic-memory 0.1.23 → 0.1.24
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5c02b5c5fc14dfba427fc4a6c321eab9abc4aa12218671c132f747da6af2de92
|
|
4
|
+
data.tar.gz: 1e7b698497e270656372bb2f47eb4dc3b93d16e64faf9d4d95ea466bcf6071c7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b02c36cc24ffb379cc41988398b8d69588ee5bddddd008bdc4eaedfdd062d44d3fe4fc8e5981b58e2d1d7b014863aa24a49e55a490ada138727e3f9ac9132e6d
|
|
7
|
+
data.tar.gz: 0dc565499fac89a69ddf26b3a83465e699205ad32a9a5b10deb83ed5818ef9c9babd2d421a8fdf78f7b90ff1dc19e06fecd94cde8b3a01652082b40f85e72c1a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.24] - 2026-04-03
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- Wrap `save_to_local` persist in a single SQLite transaction — 32K individual lock acquisitions become 1
|
|
7
|
+
- Use `insert_conflict(:replace)` instead of SELECT-then-INSERT/UPDATE per trace
|
|
8
|
+
|
|
3
9
|
## [0.1.23] - 2026-04-03
|
|
4
10
|
|
|
5
11
|
### Fixed
|
|
@@ -165,10 +165,12 @@ module Legion
|
|
|
165
165
|
return unless snapshots
|
|
166
166
|
|
|
167
167
|
traces_snapshot, associations_snapshot, trace_rows_snapshot, traces_dirty, associations_dirty = snapshots
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
db.transaction do
|
|
169
|
+
scoped_trace_ids = db[:memory_traces].where(partition_id: @partition_id).select_map(:trace_id)
|
|
170
|
+
memory_trace_ids = traces_snapshot.keys
|
|
171
|
+
stale_ids = persist_dirty_traces(db, trace_rows_snapshot, scoped_trace_ids, memory_trace_ids, traces_dirty)
|
|
172
|
+
persist_dirty_associations(db, associations_snapshot, scoped_trace_ids, memory_trace_ids, stale_ids, associations_dirty)
|
|
173
|
+
end
|
|
172
174
|
clear_dirty_flags(trace_rows_snapshot)
|
|
173
175
|
end
|
|
174
176
|
|
|
@@ -187,12 +189,9 @@ module Legion
|
|
|
187
189
|
def persist_dirty_traces(db, trace_rows_snapshot, scoped_trace_ids, memory_trace_ids, traces_dirty)
|
|
188
190
|
return [] unless traces_dirty
|
|
189
191
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
else
|
|
194
|
-
db[:memory_traces].insert(row)
|
|
195
|
-
end
|
|
192
|
+
ds = db[:memory_traces]
|
|
193
|
+
trace_rows_snapshot.each_value do |row|
|
|
194
|
+
ds.insert_conflict(:replace).insert(row)
|
|
196
195
|
end
|
|
197
196
|
stale_ids = scoped_trace_ids - memory_trace_ids
|
|
198
197
|
db[:memory_traces].where(trace_id: stale_ids).delete unless stale_ids.empty?
|