Merge pull request #1614 from MemPalace/fix/release-3.3.6-ruff-pin-align

fix(release): align ruff pin to 0.15.14 + hoist COCA imports out of hot paths
This commit is contained in:
Igor Lins e Silva
2026-05-24 19:22:14 -03:00
committed by GitHub
3 changed files with 4 additions and 6 deletions
+1 -1
View File
@@ -53,6 +53,6 @@ jobs:
# Keep this pin identical to the `ruff==` pin in pyproject.toml
# ([project.optional-dependencies].dev and [dependency-groups].dev)
# so CI and `pip install -e ".[dev]"` format/lint identically.
- run: pip install "ruff==0.15.9"
- run: pip install "ruff==0.15.14"
- run: ruff check .
- run: ruff format --check .
+2 -3
View File
@@ -19,10 +19,12 @@ from datetime import datetime
from collections import defaultdict
from typing import Optional
from .entity_detector import _get_coca_filter
from .palace import (
NORMALIZE_VERSION,
SKIP_DIRS,
MineValidationError,
_candidate_entity_words,
_open_collection_or_explain,
_validate_palace_fts5_after_mine,
build_closet_lines,
@@ -867,9 +869,6 @@ def _extract_entities_for_metadata(content: str) -> str:
if re.search(r"(?<!\w)" + re.escape(name) + r"(?!\w)", content, re.IGNORECASE):
matched.add(name)
from .entity_detector import _get_coca_filter
from .palace import _candidate_entity_words
coca_filter = _get_coca_filter()
window = content[:_ENTITY_EXTRACT_WINDOW]
words = _candidate_entity_words(window)
+1 -2
View File
@@ -15,6 +15,7 @@ from typing import Optional
from .backends import BackendClosedError, CollectionNotInitializedError, PalaceNotFoundError
from .backends.chroma import ChromaBackend
from .entity_detector import _get_coca_filter
logger = logging.getLogger("mempalace_mcp")
@@ -264,8 +265,6 @@ def build_closet_lines(source_file, drawer_ids, content, wing, room, drawer_meta
# Extract proper nouns (2+ occurrences). Uses i18n-aware patterns so
# non-Latin names (Cyrillic, accented Latin, etc.) are also detected.
from .entity_detector import _get_coca_filter
coca_filter = _get_coca_filter()
words = _candidate_entity_words(window)
word_freq = {}