pub struct MemoryMirror { /* private fields */ }Expand description
Mirrors a coding tool’s memory folder into Lore’s database.
The base directory (the tool’s per-project root) is injectable so tests can
point the mirror at a temporary folder instead of the real ~/.claude.
Implementations§
Source§impl MemoryMirror
impl MemoryMirror
Sourcepub fn memory_dir(&self, project_path: &Path) -> PathBuf
pub fn memory_dir(&self, project_path: &Path) -> PathBuf
Resolves the memory folder for a project.
This is <base_dir>/<slug>/memory where <slug> is the project’s
absolute path with separators replaced by -.
Sourcepub fn refresh(&self, db: &Database, project_path: &Path) -> Result<MirrorStats>
pub fn refresh(&self, db: &Database, project_path: &Path) -> Result<MirrorStats>
Refreshes the mirror for a project to match the current folder state.
Adds new memories, updates changed ones, and removes memories whose source file no longer exists. If the memory folder does not exist the project simply has no memories and any previously mirrored ones are removed; this is not an error.
This is a read-only operation with respect to the tool’s memory folder: it only reads the folder and writes to Lore’s database.