superlocalmemory 3.0.2 → 3.0.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superlocalmemory",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "description": "Information-geometric agent memory with mathematical guarantees. 4-channel retrieval, Fisher-Rao similarity, zero-LLM mode, EU AI Act compliant. Works with Claude, Cursor, Windsurf, and 17+ AI tools.",
5
5
  "keywords": [
6
6
  "ai-memory",
@@ -240,8 +240,28 @@ class V2Migrator:
240
240
  shutil.copy2(str(self._v2_db), str(self._v3_db))
241
241
  stats["steps"].append("Copied database to V3 location")
242
242
 
243
- # Step 4: Extend schema
243
+ # Step 4: Extend schema + alter V2 tables for V3 compatibility
244
244
  conn = sqlite3.connect(str(self._v3_db))
245
+
246
+ # Add missing V3 columns to V2 memories table
247
+ existing_cols = {r[1] for r in conn.execute("PRAGMA table_info(memories)").fetchall()}
248
+ v3_columns = [
249
+ ("profile_id", 'TEXT DEFAULT "default"'),
250
+ ("memory_id", "TEXT"),
251
+ ("session_id", 'TEXT DEFAULT ""'),
252
+ ("speaker", 'TEXT DEFAULT ""'),
253
+ ("role", 'TEXT DEFAULT "user"'),
254
+ ("session_date", "TEXT"),
255
+ ("metadata_json", 'TEXT DEFAULT "{}"'),
256
+ ]
257
+ for col, coltype in v3_columns:
258
+ if col not in existing_cols:
259
+ conn.execute(f"ALTER TABLE memories ADD COLUMN {col} {coltype}")
260
+ # Backfill V3 columns from V2 data
261
+ conn.execute('UPDATE memories SET profile_id = COALESCE(profile, "default") WHERE profile_id IS NULL')
262
+ conn.execute("UPDATE memories SET memory_id = 'v2_' || CAST(id AS TEXT) WHERE memory_id IS NULL")
263
+ conn.commit()
264
+
245
265
  for sql in V3_TABLES_SQL:
246
266
  conn.execute(sql)
247
267
  for sql in V3_INDEXES_SQL: