Summary
MCP tools/resources have two inconsistent failure contracts, and one path leaks a host filesystem path.
Details
- When no
.project-memory/ exists, _require_memory raises FileNotFoundError (surfaced to the client as a generic tool error). memory_search, memory_guard_before_action, memory_validate, memory_scan_secrets, memory_build_resume_packet all take this path.
memory_record / memory_mark_status instead return a structured { "ok": false, "error": ... }.
- Same failure mode, two different client contracts.
- The raising path's message embeds the absolute filesystem path of the project parent (
f"no .project-memory/ found at {memory_dir.parent}") — a minor host-path leak to the MCP client.
Proposed direction
Pick one contract (likely the structured {ok: false, error} form for all tools, raising only for genuinely exceptional cases), and make the "no memory" message project-relative rather than absolute.
Context: deferred from the bug review (#4). Severity: low. Design call.
Summary
MCP tools/resources have two inconsistent failure contracts, and one path leaks a host filesystem path.
Details
.project-memory/exists,_require_memoryraisesFileNotFoundError(surfaced to the client as a generic tool error).memory_search,memory_guard_before_action,memory_validate,memory_scan_secrets,memory_build_resume_packetall take this path.memory_record/memory_mark_statusinstead return a structured{ "ok": false, "error": ... }.f"no .project-memory/ found at {memory_dir.parent}") — a minor host-path leak to the MCP client.Proposed direction
Pick one contract (likely the structured
{ok: false, error}form for all tools, raising only for genuinely exceptional cases), and make the "no memory" message project-relative rather than absolute.Context: deferred from the bug review (#4). Severity: low. Design call.