superlocalmemory icon indicating copy to clipboard operation
superlocalmemory copied to clipboard

feat: add scope and shared_with columns for multi-scope memory (PR 1/3)

Open kenyonxu opened this issue 5 months ago • 0 comments

Summary

PR 1/3 of the multi-scope memory feature (RFC #20).

Adds scope and shared_with columns to 5 core tables for multi-scope memory support (personal / shared / global). Pure schema change — no retrieval or interface modifications.

Changes

File Change
storage/schema.py Add scope TEXT NOT NULL DEFAULT 'personal' and shared_with TEXT to 5 tables + 10 composite indexes
storage/models.py Add scope / shared_with fields to 5 dataclasses (MemoryRecord, AtomicFact, CanonicalEntity, GraphEdge, TemporalEvent)
storage/migrations/M016_add_scope_support.py Deferred migration for existing databases
storage/migration_runner.py Register M016

Design

  • Backward compatible: all existing data retains scope='personal'
  • Follows upstream pattern: deferred migration like M006/M011/M013
  • Tables: memories, atomic_facts, canonical_entities, graph_edges, temporal_events

Dependencies

  • PR 2/3 (retrieval layer) builds on this
  • PR 3/3 (external interface) builds on PR 2/3

Test Results

  • 755 passed on Ubuntu (all 3 Python versions)
  • 75 passed on macOS (all 3 Python versions)
  • The 1 failure per platform (test_cache_exact_replay_all_byte_identical on Ubuntu, test_vscode_user_dir_darwin on macOS) are pre-existing upstream issues — reproducible on the upstream main branch CI.

Ref: #20

kenyonxu avatar Jun 15 '26 10:06 kenyonxu