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:
curo1305
2026-05-17 18:09:45 +02:00
parent 18b2b94194
commit bbe9bcfe0a
4 changed files with 9 additions and 9 deletions
+3
View File
@@ -0,0 +1,3 @@
from pyra.utils.paths import pyra_home
_MEMORY_ROOT = pyra_home() / "memory"