code-memory 1.0.2__tar.gz → 1.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {code_memory-1.0.2 → code_memory-1.0.4}/PKG-INFO +1 -1
  2. {code_memory-1.0.2 → code_memory-1.0.4}/db.py +1 -2
  3. {code_memory-1.0.2 → code_memory-1.0.4}/doc_parser.py +0 -2
  4. {code_memory-1.0.2 → code_memory-1.0.4}/git_search.py +4 -5
  5. {code_memory-1.0.2 → code_memory-1.0.4}/logging_config.py +1 -1
  6. {code_memory-1.0.2 → code_memory-1.0.4}/parser.py +1 -5
  7. code_memory-1.0.4/prompts/milestone_6.xml +756 -0
  8. {code_memory-1.0.2 → code_memory-1.0.4}/pyproject.toml +1 -1
  9. {code_memory-1.0.2 → code_memory-1.0.4}/queries.py +99 -2
  10. {code_memory-1.0.2 → code_memory-1.0.4}/server.py +195 -64
  11. {code_memory-1.0.2 → code_memory-1.0.4}/tests/test_errors.py +2 -4
  12. {code_memory-1.0.2 → code_memory-1.0.4}/tests/test_logging.py +1 -3
  13. {code_memory-1.0.2 → code_memory-1.0.4}/tests/test_tools.py +0 -3
  14. {code_memory-1.0.2 → code_memory-1.0.4}/uv.lock +1 -1
  15. {code_memory-1.0.2 → code_memory-1.0.4}/validation.py +0 -1
  16. {code_memory-1.0.2 → code_memory-1.0.4}/.github/workflows/ci.yml +0 -0
  17. {code_memory-1.0.2 → code_memory-1.0.4}/.github/workflows/publish.yml +0 -0
  18. {code_memory-1.0.2 → code_memory-1.0.4}/.gitignore +0 -0
  19. {code_memory-1.0.2 → code_memory-1.0.4}/.python-version +0 -0
  20. {code_memory-1.0.2 → code_memory-1.0.4}/CHANGELOG.md +0 -0
  21. {code_memory-1.0.2 → code_memory-1.0.4}/CONTRIBUTING.md +0 -0
  22. {code_memory-1.0.2 → code_memory-1.0.4}/LICENSE +0 -0
  23. {code_memory-1.0.2 → code_memory-1.0.4}/Makefile +0 -0
  24. {code_memory-1.0.2 → code_memory-1.0.4}/README.md +0 -0
  25. {code_memory-1.0.2 → code_memory-1.0.4}/errors.py +0 -0
  26. {code_memory-1.0.2 → code_memory-1.0.4}/prompts/milestone_1.xml +0 -0
  27. {code_memory-1.0.2 → code_memory-1.0.4}/prompts/milestone_2.xml +0 -0
  28. {code_memory-1.0.2 → code_memory-1.0.4}/prompts/milestone_3.xml +0 -0
  29. {code_memory-1.0.2 → code_memory-1.0.4}/prompts/milestone_4.xml +0 -0
  30. {code_memory-1.0.2 → code_memory-1.0.4}/prompts/milestone_5.xml +0 -0
  31. {code_memory-1.0.2 → code_memory-1.0.4}/tests/__init__.py +0 -0
  32. {code_memory-1.0.2 → code_memory-1.0.4}/tests/conftest.py +1 -1
  33. {code_memory-1.0.2 → code_memory-1.0.4}/tests/test_validation.py +1 -1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-memory
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: A deterministic, high-precision code intelligence MCP server
5
5
  Project-URL: Homepage, https://github.com/kapillamba4/code-memory
6
6
  Project-URL: Documentation, https://github.com/kapillamba4/code-memory#readme
@@ -13,7 +13,6 @@ from __future__ import annotations
13
13
 
14
14
  import hashlib
15
15
  import sqlite3
16
- from pathlib import Path
17
16
  from typing import TYPE_CHECKING
18
17
 
19
18
  import sqlite_vec
@@ -220,7 +219,7 @@ def file_hash(filepath: str) -> str:
220
219
 
221
220
  def upsert_file(db: sqlite3.Connection, path: str, last_modified: float, fhash: str) -> int:
222
221
  """Insert or update a file record. Returns the file_id."""
223
- cur = db.execute(
222
+ db.execute(
224
223
  """
225
224
  INSERT INTO files (path, last_modified, file_hash)
226
225
  VALUES (?, ?, ?)
@@ -7,10 +7,8 @@ and indexes them for hybrid retrieval (BM25 + vector search).
7
7
 
8
8
  from __future__ import annotations
9
9
 
10
- import hashlib
11
10
  import os
12
11
  import re
13
- from pathlib import Path
14
12
 
15
13
  from markdown_it import MarkdownIt
16
14
 
@@ -15,14 +15,13 @@ Design rules
15
15
 
16
16
  from __future__ import annotations
17
17
 
18
- from datetime import datetime, timezone
18
+ from datetime import UTC, datetime
19
19
  from pathlib import Path
20
20
  from typing import Any
21
21
 
22
22
  import git
23
23
  from git.exc import InvalidGitRepositoryError, NoSuchPathError
24
24
 
25
-
26
25
  # ---------------------------------------------------------------------------
27
26
  # Helpers
28
27
  # ---------------------------------------------------------------------------
@@ -34,7 +33,7 @@ def _commit_to_dict(commit: git.Commit, *, include_files_changed_count: bool = F
34
33
  include_files_changed_count: If True, compute the number of files
35
34
  changed (triggers a diff — slow for bulk iteration).
36
35
  """
37
- dt = datetime.fromtimestamp(commit.committed_date, tz=timezone.utc)
36
+ dt = datetime.fromtimestamp(commit.committed_date, tz=UTC)
38
37
  result: dict[str, Any] = {
39
38
  "hash": commit.hexsha[:7],
40
39
  "full_hash": commit.hexsha,
@@ -143,7 +142,7 @@ def get_commit_detail(
143
142
  return {"error": f"Could not resolve commit '{commit_hash}': {exc}"}
144
143
 
145
144
  try:
146
- dt = datetime.fromtimestamp(commit.committed_date, tz=timezone.utc)
145
+ dt = datetime.fromtimestamp(commit.committed_date, tz=UTC)
147
146
 
148
147
  parent_hashes = [p.hexsha[:7] for p in commit.parents]
149
148
 
@@ -271,7 +270,7 @@ def get_blame(
271
270
  "full_hash": commit.hexsha,
272
271
  "author": str(commit.author),
273
272
  "date": datetime.fromtimestamp(
274
- commit.committed_date, tz=timezone.utc
273
+ commit.committed_date, tz=UTC
275
274
  ).isoformat(),
276
275
  "line_content": line_text,
277
276
  "commit_message": commit.message.strip().split("\n")[0],
@@ -96,7 +96,7 @@ class ToolLogger:
96
96
  self.result_count: int | None = None
97
97
  self.error: str | None = None
98
98
 
99
- def __enter__(self) -> "ToolLogger":
99
+ def __enter__(self) -> ToolLogger:
100
100
  self.start_time = datetime.now()
101
101
  # Sanitize params for logging (don't log sensitive data)
102
102
  safe_params = {k: v for k, v in self.params.items() if v is not None}
@@ -14,7 +14,7 @@ import os
14
14
  from pathlib import Path
15
15
  from typing import Any
16
16
 
17
- from tree_sitter import Language, Parser, Node
17
+ from tree_sitter import Language, Node, Parser
18
18
 
19
19
  import db as db_mod
20
20
 
@@ -110,7 +110,6 @@ _NODE_KIND_MAP: dict[str, tuple[str, bool]] = {
110
110
  "constructor_declaration": ("method", False),
111
111
  "interface_declaration": ("class", True),
112
112
  # Go (function_declaration already mapped above for JS/TS/Kotlin)
113
- "method_declaration": ("method", False),
114
113
  "type_spec": ("class", False),
115
114
  # Rust
116
115
  "function_item": ("function", False),
@@ -119,12 +118,9 @@ _NODE_KIND_MAP: dict[str, tuple[str, bool]] = {
119
118
  "enum_item": ("class", False),
120
119
  "trait_item": ("class", True),
121
120
  # C / C++
122
- "function_definition": ("function", False),
123
121
  "struct_specifier": ("class", False),
124
122
  "class_specifier": ("class", True),
125
123
  # Kotlin
126
- "function_declaration": ("function", False),
127
- "class_declaration": ("class", True),
128
124
  "object_declaration": ("class", True),
129
125
  "companion_object": ("class", True),
130
126
  # Ruby