trailmem 0.1.12 — cwd isolation (complete)
Completes the -P anti-shadow fix that 0.1.11 only half-shipped. First PyPI release since 0.1.9 — it also carries the 0.1.10 Kiro hook fix.
The bug
Every host launches the server as <python> -u -m trailmem.mcp_server and every hook as <python> -m trailmem hook .... python -m puts the launching process cwd at sys.path[0], so any agent whose workspace was a checkout of this project imported the working tree instead of the installed package — silently running uncommitted code. Because content_hash covers absolute paths, memories written that way never deduped against the installed copy. Live-hit: every registered host on the maintainer machine had been running the source tree, not 0.1.9, for days.
The fix
- New
trailmem/hosts/_util.pyhelpers:safe_path_flag()returns-Pon Python 3.11+ and-Ion 3.10 (where-Pdoes not exist and would abort startup);hook_python()applies the same flag to every hook command line. integrate.mcp_command()now returns[flag, "-u", "-m", "trailmem.mcp_server"].- All four hook-emitting hosts (claude, codex, kiro, antigravity) build command lines via
hook_python()instead of hardcodingsys.executable. test_phase0asserts the exact arg list,safe_path_flag(), and thathook_python()ends with the flag — the flag cannot silently regress.
Upgrading
uv tool install --force trailmem
Then re-run trailmem integrate in a real terminal and restart your agents, so the registered command lines pick up the flag.
Docs updated: README, docs/cli.md, docs/mcp.md, docs/host-integration.md. All 10 tests pass.