You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bm doctor fails when BASIC_MEMORY_PROJECT_ROOT equals the project directory #1323
bm doctor cannot run when BASIC_MEMORY_PROJECT_ROOT points at the project directory itself. It tries to create a temporary project inside the project root, which the nesting guard then rejects.
Running Basic Memory doctor checks...
Doctor failed: Cannot create project at '/app/data/benjamin/doctor-d86fb537':
path is nested within existing project 'benjamin' at '/app/data/benjamin'.
Projects cannot share directory trees.
Expected
doctor runs its consistency checks, or at minimum degrades gracefully instead of failing outright.
Analysis
doctor creates a scratch project (doctor-<random>) to run its checks. That scratch project is created under BASIC_MEMORY_PROJECT_ROOT. When PROJECT_ROOT is the same path as the project's own directory, the scratch project lands inside the existing project, and the "projects cannot share directory trees" guard correctly refuses.
The two settings are independently valid on their own, so the combination is easy to end up with: HOME naming the project directory and PROJECT_ROOT constraining where projects may live.
Possible fixes
Create the scratch project in a real temporary directory (for example tempfile.mkdtemp()) rather than under PROJECT_ROOT.
Or exempt the doctor scratch project from the nesting guard.
Or detect the PROJECT_ROOT == project path case and skip the scratch project, running the checks against the existing project directly.
Workaround
Setting BASIC_MEMORY_PROJECT_ROOT to the parent directory (/app/data) should avoid it, but that changes how project paths resolve for an existing installation, so it is not a free change for anyone already running this layout.
Activity
test(core): cover doctor project creation paths