refactor(memory): centralize _MEMORY_ROOT; fix mkdir order in append_memory
_MEMORY_ROOT was defined independently in reader.py, writer.py, and index.py. Moved to memory/__init__.py; all three import from there. Also fixes a bug in append_memory where path.write_text() was called before path.parent.mkdir(), which would crash when creating a file in a new subdirectory. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import datetime
|
||||
from pathlib import Path
|
||||
|
||||
from pyra.utils.paths import pyra_home, safe_chmod
|
||||
from pyra.memory import _MEMORY_ROOT
|
||||
from pyra.utils.paths import safe_chmod
|
||||
|
||||
_MEMORY_ROOT = pyra_home() / "memory"
|
||||
_INDEX_FILE = _MEMORY_ROOT / "MEMORY_INDEX.md"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user