Severity: π‘ Medium (UX footgun; silent wrong-workspace)
agora.py:8β14:
def _memory_workspace(args, cfg) -> Path:
...
cwd = Path.cwd().resolve()
if (cwd / ".perseus").exists():
return cwd
return Path.home().resolve()
Running perseus memory show from /tmp (or any non-Perseus directory) silently displays the home workspace's narrative β no warning, no log.
Suggested fix
def _memory_workspace(args, cfg) -> Path:
raw = getattr(args, "workspace", None)
if raw:
return Path(raw).expanduser().resolve()
cwd = Path.cwd().resolve()
if (cwd / ".perseus").exists():
return cwd
for parent in cwd.parents:
if (parent / ".perseus").exists():
return parent
home = Path.home().resolve()
if (home / ".perseus").exists():
print(f"β No .perseus/ in {cwd}; using $HOME workspace ({home}).",
file=sys.stderr)
return home
raise SystemExit(
f"Not in a Perseus workspace and $HOME has no .perseus/. "
f"Run with --workspace <path> or `cd` to a workspace."
)
Acceptance criteria
- Test from
tmp_path with no .perseus/: command exits non-zero.
- Test from a subdirectory of a workspace: walks up and finds the workspace.
Severity: π‘ Medium (UX footgun; silent wrong-workspace)
agora.py:8β14:Running
perseus memory showfrom/tmp(or any non-Perseus directory) silently displays the home workspace's narrative β no warning, no log.Suggested fix
Acceptance criteria
tmp_pathwith no.perseus/: command exits non-zero.