trailmem 0.1.8 — hosts/ modularisation, doctor host checks, required file params
What's new
Hosts modularised
integrate.py (one 588-line file, all 9 hosts' knowledge tangled + hand-synced uninstall lists) split into trailmem/hosts/ — one module per host (claude, codex, kiro, kilo, opencode, antigravity, zed, cursor, windsurf). Every Artifact pairs install() with remove(), and run/uninstall iterate the same registry — install/uninstall drift is structurally impossible. Adding a host = one file + one registry entry. Shared plumbing in hosts/_util.py.
Narrow-write / wide-detect policy
integrate now auto-writes config only for verified hosts (Claude via claude mcp add, Codex TOML, Kiro, Kilo). OpenCode/Antigravity/Zed/Cursor/Windsurf stay detected but get the exact entry printed for manual add (flip write=True once verified). Detection stays broad and grows — stores are always attributed to the right agent_type.
trailmem doctor — host capability + drift + stale servers
- Per-host artifact status (registered / not installed / stale launcher / missing agent pin).
- Flags running stale
trailmem.mcp_serverprocesses — the recurring "old server kept writing" incident is now visible. - Caught and fixed a real gap live: Kiro SessionStart hook was missing.
code_files / doc_files now REQUIRED on store
Empty was indistinguishable from "no files touched". Missing/empty → ValidationError; literal 'none' → NULL. Enforced in store.store() so all paths (MCP/CLI/dashboard) apply it.
Other
- Canonical identity via
session_context(versioned object, authoritative; legacysession_id/agent_typeparams deprecated through 1.0). - Threat-model docs added.
.gitignorehardened (root scratch scripts caught by sdist leak-grep in the first 0.1.8 build).
Upgrade
uv tool install trailmem@latest --force
trailmem doctor # check host artifacts + stale serversThen restart every agent so running MCP servers pick up the new code.
Full diff: v0.1.7...v0.1.8