From 9d5e27db2e89f51eb7ea197017322092241eb1e6 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Sat, 28 Feb 2026 00:03:13 -0600 Subject: [PATCH] store: Fix: Partial UUID prefix matching in cognitive memory client (git-style) --- ...ching-in-cognitive-memory-client-89f32e.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 graph/fixes/fix-partial-uuid-prefix-matching-in-cognitive-memory-client-89f32e.md diff --git a/graph/fixes/fix-partial-uuid-prefix-matching-in-cognitive-memory-client-89f32e.md b/graph/fixes/fix-partial-uuid-prefix-matching-in-cognitive-memory-client-89f32e.md new file mode 100644 index 00000000000..94fe91b6b18 --- /dev/null +++ b/graph/fixes/fix-partial-uuid-prefix-matching-in-cognitive-memory-client-89f32e.md @@ -0,0 +1,38 @@ +--- +id: 89f32ef3-2d87-4b8c-aa6e-ce5a7f60566c +type: fix +title: "Fix: Partial UUID prefix matching in cognitive memory client (git-style)" +tags: [cognitive-memory, fix, uuid, mcp, client.py, claude-configs] +importance: 0.8 +confidence: 0.8 +created: "2026-02-28T06:03:13.780326+00:00" +updated: "2026-02-28T06:03:13.780326+00:00" +--- + +# Partial UUID Prefix Matching in CognitiveMemoryClient + +## Problem +Users had to type full UUIDs when referencing memories or edges via the client. This was inconvenient — git-style short prefix matching was missing. + +## Solution +Added a `_resolve_prefix()` static method to `CognitiveMemoryClient` that resolves partial UUID prefixes to full IDs. + +### Resolution logic: +1. Check for an **exact match** first (pass-through if full UUID provided) +2. Scan all IDs with `startswith(prefix)` for partial matches +3. **Single match** → returns the full ID +4. **Multiple matches** → raises `ValueError` with the list of candidate IDs +5. **No matches** → returns `None` (falls through to existing behavior) + +### Applied to 4 functions: +- `_resolve_memory_path` +- `_resolve_edge_path` +- `edge_search` (both `from_id` and `to_id` params) +- `related()` + +## Commit & Issue +- Committed as `471d870` on `cal/claude-configs` main branch +- Closes `cal/claude-memory#3` + +## Important Note +The MCP server process must be **restarted** to pick up changes since it is long-running and does not hot-reload source files.