Fix: ruff format config, hooks_cli, and test file

This commit is contained in:
sha2fiddy
2026-05-23 12:05:34 -04:00
parent 8fc06b96e2
commit e51cfb3630
+2 -6
View File
@@ -41,9 +41,7 @@ def sanitize_name(value: str, field_name: str = "name") -> str:
value = value.strip()
if len(value) > MAX_NAME_LENGTH:
raise ValueError(
f"{field_name} exceeds maximum length of {MAX_NAME_LENGTH} characters"
)
raise ValueError(f"{field_name} exceeds maximum length of {MAX_NAME_LENGTH} characters")
# Block path traversal
if ".." in value or "/" in value or "\\" in value:
@@ -298,9 +296,7 @@ class MempalaceConfig:
@property
def palace_path(self):
"""Path to the memory palace data directory."""
env_val = os.environ.get("MEMPALACE_PALACE_PATH") or os.environ.get(
"MEMPAL_PALACE_PATH"
)
env_val = os.environ.get("MEMPALACE_PALACE_PATH") or os.environ.get("MEMPAL_PALACE_PATH")
if env_val:
# Normalize: expand ~ and collapse .. to match the CLI --palace
# code path (mcp_server.py:62) and prevent surprise redirection