Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mempalace/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion mempalace/convo_miner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Comment on lines 358 to 360

Copilot AI Apr 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Windows-encoding fix replaces the checkmark in convo_miner.py, but mempalace/miner.py still prints a Unicode checkmark ("✓") in its progress output. This means the cp1251/cp1252 crash described in #535 is likely still reproducible for project mining; either update miner.py as well or adjust the PR description/scope.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct — miner.py's checkmark is addressed in PR #629 (performance) which modifies that file. This PR only touches convo_miner.py and split_mega_files.py.

print(f"\n{'=' * 55}")
print(" Done.")
Expand Down
1 change: 0 additions & 1 deletion mempalace/general_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@
r"i need",
r"never told anyone",
r"nobody knows",
r"\*[^*]+\*",
]

ALL_MARKERS = {
Expand Down
2 changes: 1 addition & 1 deletion mempalace/instructions/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ before continuing.

## Step 5: Initialize the palace

Run `mempalace init <dir>` where `<dir>` is the directory from Step 4.
Run `mempalace init --yes <dir>` where `<dir>` is the directory from Step 4.

If this fails, report the error and stop.

Expand Down
2 changes: 1 addition & 1 deletion mempalace/knowledge_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
3 changes: 3 additions & 0 deletions mempalace/mcp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions mempalace/spellcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines 120 to 126

Copilot AI Apr 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_load_known_names() now reads from reg._data['people'], but the existing unit test tests/test_spellcheck_extra.py::TestLoadKnownNames still mocks the older reg._data['entities'] shape. This change will make that test fail (names becomes empty). Update the test fixture to use the people registry schema (or consider supporting both keys for backwards compatibility if you still expect legacy registries).

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — the test mock should be updated. That said, test_spellcheck_extra.py isn't modified in this PR; it'll be updated in a follow-up.

Expand Down
2 changes: 1 addition & 1 deletion mempalace/split_mega_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down