From 541e9bd1ee880318b50237eaead1a4818052948b Mon Sep 17 00:00:00 2001 From: Igor Lins e Silva <4753812+igorls@users.noreply.github.com> Date: Tue, 7 Apr 2026 17:31:06 -0300 Subject: [PATCH 1/2] chore: tighten chromadb version range and add py.typed marker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Tighten chromadb dependency from >=0.4.0,<1 to >=0.5.0,<0.7 (the collection API changed significantly across majors; this pins to the tested range) - Add optional 'spellcheck' extras for the undeclared autocorrect dependency used in spellcheck.py - Add PEP 561 py.typed marker for type checker support Findings: #10 (HIGH — chromadb range too wide), #30 (LOW — undeclared autocorrect), #32 (LOW — missing py.typed) Includes test infrastructure from PR #131. 92 tests pass. --- mempalace/py.typed | 0 pyproject.toml | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 mempalace/py.typed diff --git a/mempalace/py.typed b/mempalace/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml index 773e87b..4862873 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ "Topic :: Utilities", ] dependencies = [ - "chromadb>=0.4.0,<1", + "chromadb>=0.5.0,<0.7", "pyyaml>=6.0", ] @@ -39,6 +39,7 @@ mempalace = "mempalace:main" [project.optional-dependencies] dev = ["pytest>=7.0", "ruff>=0.4.0"] +spellcheck = ["autocorrect>=2.0"] [dependency-groups] dev = ["pytest>=7.0", "ruff>=0.4.0"] From e5b3434e9b147ecc44a4a8429a98a5559b7aff74 Mon Sep 17 00:00:00 2001 From: Igor Lins e Silva <4753812+igorls@users.noreply.github.com> Date: Tue, 7 Apr 2026 18:58:28 -0300 Subject: [PATCH 2/2] fix: update dialect tests for PR #147 stats API and remove unused fixture param --- tests/conftest.py | 2 +- tests/test_dialect.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index d0c30c2..22b5e42 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -35,7 +35,7 @@ from mempalace.knowledge_graph import KnowledgeGraph # noqa: E402 @pytest.fixture(scope="session", autouse=True) -def _isolate_home(tmp_path_factory): +def _isolate_home(): """Ensure HOME points to a temp dir for the entire test session. The env vars were already set at module level (above) so that diff --git a/tests/test_dialect.py b/tests/test_dialect.py index 2ef1df6..8edc7ec 100644 --- a/tests/test_dialect.py +++ b/tests/test_dialect.py @@ -109,11 +109,11 @@ class TestCompressionStats: original = "We decided to use GraphQL instead of REST. " * 10 compressed = d.compress(original) stats = d.compression_stats(original, compressed) - assert stats["ratio"] > 1 - assert stats["original_chars"] > stats["compressed_chars"] + assert stats["size_ratio"] > 1 + assert stats["original_chars"] > stats["summary_chars"] def test_count_tokens(self): - assert Dialect.count_tokens("hello world") == len("hello world") // 3 + assert Dialect.count_tokens("hello world") == 2 class TestZettelEncoding: