diff --git a/mempalace/config.py b/mempalace/config.py index fcfb2c8afe..91851b1112 100644 --- a/mempalace/config.py +++ b/mempalace/config.py @@ -16,7 +16,7 @@ # in file paths, SQLite, or ChromaDB metadata. MAX_NAME_LENGTH = 128 -_SAFE_NAME_RE = re.compile(r"^[a-zA-Z0-9][a-zA-Z0-9_ .'-]{0,126}[a-zA-Z0-9]?$") +_SAFE_NAME_RE = re.compile(r"^[\w][\w .'-]{0,126}[\w]?$") def sanitize_name(value: str, field_name: str = "name") -> str: diff --git a/mempalace/convo_miner.py b/mempalace/convo_miner.py index 3bb4a895bf..aca8f3a3a0 100644 --- a/mempalace/convo_miner.py +++ b/mempalace/convo_miner.py @@ -356,7 +356,7 @@ def mine_convos( raise total_drawers += drawers_added - print(f" ✓ [{i:4}/{len(files)}] {filepath.name[:50]:50} +{drawers_added}") + print(f" + [{i:4}/{len(files)}] {filepath.name[:50]:50} +{drawers_added}") print(f"\n{'=' * 55}") print(" Done.") diff --git a/mempalace/general_extractor.py b/mempalace/general_extractor.py index e849d7cf13..0a05cf46ca 100644 --- a/mempalace/general_extractor.py +++ b/mempalace/general_extractor.py @@ -157,7 +157,6 @@ r"i need", r"never told anyone", r"nobody knows", - r"\*[^*]+\*", ] ALL_MARKERS = { diff --git a/mempalace/instructions/init.md b/mempalace/instructions/init.md index 40fe8fcaaa..40f0c20dd7 100644 --- a/mempalace/instructions/init.md +++ b/mempalace/instructions/init.md @@ -41,7 +41,7 @@ before continuing. ## Step 5: Initialize the palace -Run `mempalace init ` where `` is the directory from Step 4. +Run `mempalace init --yes ` where `` is the directory from Step 4. If this fails, report the error and stop. diff --git a/mempalace/knowledge_graph.py b/mempalace/knowledge_graph.py index b094f06f7c..2199628823 100644 --- a/mempalace/knowledge_graph.py +++ b/mempalace/knowledge_graph.py @@ -193,7 +193,7 @@ def invalidate(self, subject: str, predicate: str, obj: str, ended: str = None): # ── Query operations ────────────────────────────────────────────────── - def query_entity(self, name: str, as_of: str = None, direction: str = "outgoing"): + def query_entity(self, name: str, as_of: str = None, direction: str = "both"): """ Get all relationships for an entity. diff --git a/mempalace/mcp_server.py b/mempalace/mcp_server.py index 09203b6b58..2d46ae41c1 100644 --- a/mempalace/mcp_server.py +++ b/mempalace/mcp_server.py @@ -984,6 +984,9 @@ def handle_request(request): tool_args[key] = int(value) elif declared_type == "number" and not isinstance(value, (int, float)): tool_args[key] = float(value) + # Strip unexpected kwargs — some MCP clients send extra params + # like top_k that the handler doesn't accept (#572). + tool_args = {k: v for k, v in tool_args.items() if k in schema_props} try: result = TOOLS[tool_name]["handler"](**tool_args) return { diff --git a/mempalace/spellcheck.py b/mempalace/spellcheck.py index fe8da38cdb..0368d33e8a 100644 --- a/mempalace/spellcheck.py +++ b/mempalace/spellcheck.py @@ -119,8 +119,8 @@ def _load_known_names() -> set: reg = EntityRegistry.load() names = set() - for entity in reg._data.get("entities", {}).values(): - names.add(entity.get("canonical", "").lower()) + for name, entity in reg._data.get("people", {}).items(): + names.add(name.lower()) for alias in entity.get("aliases", []): names.add(alias.lower()) return names diff --git a/mempalace/split_mega_files.py b/mempalace/split_mega_files.py index 24b59569c8..8552627a8e 100644 --- a/mempalace/split_mega_files.py +++ b/mempalace/split_mega_files.py @@ -224,7 +224,7 @@ def split_file(filepath, output_dir, dry_run=False): print(f" [{i + 1}/{len(boundaries) - 1}] {name} ({len(chunk)} lines)") else: out_path.write_text("".join(chunk), encoding="utf-8") - print(f" ✓ {name} ({len(chunk)} lines)") + print(f" + {name} ({len(chunk)} lines)") written.append(out_path)