fix: use correct registry key in spellcheck entity lookup#570
fix: use correct registry key in spellcheck entity lookup#570arnoldwender wants to merge 1 commit intoMemPalace:developfrom
Conversation
web3guru888
left a comment
There was a problem hiding this comment.
Simple but impactful fix — _load_known_names() has been silently returning an empty set since it was written, so the spellchecker has never protected registered entity names from over-correction.
The diagnosis is correct:
reg._datauses"people"as the key, not"entities"- Each entry's canonical name is the dict key itself, not a
"canonical"field
The fix handles both cases: canonical names from .items() and aliases from the "aliases" list. That matches how EntityRegistry actually stores data.
We hit a variant of this in our own integration — entity names that were close to common words (e.g. "Comet", "Iris") were getting "corrected" away in spell-check passes because the protection list was empty. This fix would have caught it.
Approved.
…compress keys - Default new collections to cosine distance (hnsw:space=cosine) instead of L2 — fixes negative similarity scores (MemPalace#568) - Filter unexpected MCP tool args before dispatch — prevents TypeError crash from extra params like top_k (MemPalace#572) - Rotate WAL at 10 MB with one backup to prevent unbounded growth (MemPalace#573) - Fix cmd_compress KeyError: align dict keys with compression_stats() return values (MemPalace#569) - Fix spellcheck _load_known_names: read from "people" key, use dict keys as canonical names (MemPalace#570) - Repair command uses cosine distance for rebuilt collection Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Incorporated into #562 — reads from |
web3guru888
left a comment
There was a problem hiding this comment.
Correct, narrow fix. LGTM.
[MemPalace-AGI integration — 215 tests, 710 KG entities]
…, MCP args, spellcheck, init docs - Remove overly broad \*[^*]+\* from EMOTION_MARKERS (MemPalace#536) - Replace Unicode checkmark with ASCII + for Windows cp1251/cp1252 (MemPalace#535) - Fix spellcheck reading from wrong entity registry key (MemPalace#570) - Add --yes flag to init instructions for non-interactive use (MemPalace#534) - Default KG query direction to 'both' instead of 'outgoing' - Fix KG path mismatch in MCP server (MemPalace#538) - Filter unexpected MCP tool args before dispatch (MemPalace#572) Co-Authored-By: Claude Opus 4.6 <[email protected]>
Summary
_load_known_names()inspellcheck.pyto read from"people"key instead of non-existent"entities"key"canonical"fieldProblem
spellcheck.py:122reads entity data with:But
EntityRegistryuses"people"as the key (not"entities"), and each person entry has no"canonical"field — the canonical name is the dict key itself:{"people": {"Riley": {"source": "onboarding", "aliases": [...], ...}}}This means
_load_known_names()always returns an empty set, so the spellchecker never protects registered entity names from over-correction.Fix
Test plan