mempalace-dict-pickle-repairlisted
Install: claude install-skill williamblair333/Uncle-J-s-Refinery
## When to use
- `mempalace_search` throws `'dict' object has no attribute 'dimensionality'`
- Healthcheck shows `ok` but search fails (probe gap — healthcheck doesn't do a live query)
- Dict-format pickles keep reappearing after repair (segment UUID changes each time → repair pipeline is the source)
## Root cause pattern
The repair pipeline (`mempalace-repair-now.sh`) writes a new HNSW pickle during each run. If the pipeline uses a code path that serializes the HNSW index as a plain `dict` instead of a `PersistentData` object, every repair run regenerates the broken pickle at a new segment UUID. The healthcheck only checks `CHROMA_API_IMPL` path existence — it does not open the pickle or run a live query — so it passes green while search is broken.
## Step 1 — Manual migration (immediate fix)
# Find the broken segment
grep -r "dimensionality" ~/.local/share/mempalace/ # or wherever the palace data dir is
# Identify the pickle file
find <palace-data-dir>/chroma/chroma-collections -name "*.pkl" | \
xargs python3 -c "
import pickle, sys
for f in sys.argv[1:]:
with open(f, 'rb') as fh:
d = pickle.load(fh)
print(f, type(d).__name__)
" 2>&1 | grep dict
Once the file is identified:
import pickle, shutil
from chromadb.segment.impl.vector.local_persistent_hnsw import PersistentData
pkl_path = "/path/to/broken/segment.pkl"
shutil.copy(pkl_path, pkl_path + ".bak")
with open(pkl_path, "rb") as f:
d = pickle.load(f)
if isinstance(d, dict):
fixed = Pe