codespine 0.4.0__tar.gz → 0.4.1__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 (50) hide show
  1. {codespine-0.4.0 → codespine-0.4.1}/PKG-INFO +1 -1
  2. {codespine-0.4.0 → codespine-0.4.1}/codespine/__init__.py +1 -1
  3. {codespine-0.4.0 → codespine-0.4.1}/codespine/indexer/engine.py +4 -0
  4. {codespine-0.4.0 → codespine-0.4.1}/codespine/mcp/server.py +18 -6
  5. {codespine-0.4.0 → codespine-0.4.1}/codespine/search/vector.py +16 -0
  6. {codespine-0.4.0 → codespine-0.4.1}/codespine.egg-info/PKG-INFO +1 -1
  7. {codespine-0.4.0 → codespine-0.4.1}/pyproject.toml +1 -1
  8. {codespine-0.4.0 → codespine-0.4.1}/LICENSE +0 -0
  9. {codespine-0.4.0 → codespine-0.4.1}/README.md +0 -0
  10. {codespine-0.4.0 → codespine-0.4.1}/codespine/analysis/__init__.py +0 -0
  11. {codespine-0.4.0 → codespine-0.4.1}/codespine/analysis/community.py +0 -0
  12. {codespine-0.4.0 → codespine-0.4.1}/codespine/analysis/context.py +0 -0
  13. {codespine-0.4.0 → codespine-0.4.1}/codespine/analysis/coupling.py +0 -0
  14. {codespine-0.4.0 → codespine-0.4.1}/codespine/analysis/deadcode.py +0 -0
  15. {codespine-0.4.0 → codespine-0.4.1}/codespine/analysis/flow.py +0 -0
  16. {codespine-0.4.0 → codespine-0.4.1}/codespine/analysis/impact.py +0 -0
  17. {codespine-0.4.0 → codespine-0.4.1}/codespine/cli.py +0 -0
  18. {codespine-0.4.0 → codespine-0.4.1}/codespine/config.py +0 -0
  19. {codespine-0.4.0 → codespine-0.4.1}/codespine/db/__init__.py +0 -0
  20. {codespine-0.4.0 → codespine-0.4.1}/codespine/db/schema.py +0 -0
  21. {codespine-0.4.0 → codespine-0.4.1}/codespine/db/store.py +0 -0
  22. {codespine-0.4.0 → codespine-0.4.1}/codespine/diff/__init__.py +0 -0
  23. {codespine-0.4.0 → codespine-0.4.1}/codespine/diff/branch_diff.py +0 -0
  24. {codespine-0.4.0 → codespine-0.4.1}/codespine/indexer/__init__.py +0 -0
  25. {codespine-0.4.0 → codespine-0.4.1}/codespine/indexer/call_resolver.py +0 -0
  26. {codespine-0.4.0 → codespine-0.4.1}/codespine/indexer/java_parser.py +0 -0
  27. {codespine-0.4.0 → codespine-0.4.1}/codespine/indexer/symbol_builder.py +0 -0
  28. {codespine-0.4.0 → codespine-0.4.1}/codespine/mcp/__init__.py +0 -0
  29. {codespine-0.4.0 → codespine-0.4.1}/codespine/noise/__init__.py +0 -0
  30. {codespine-0.4.0 → codespine-0.4.1}/codespine/noise/blocklist.py +0 -0
  31. {codespine-0.4.0 → codespine-0.4.1}/codespine/search/__init__.py +0 -0
  32. {codespine-0.4.0 → codespine-0.4.1}/codespine/search/bm25.py +0 -0
  33. {codespine-0.4.0 → codespine-0.4.1}/codespine/search/fuzzy.py +0 -0
  34. {codespine-0.4.0 → codespine-0.4.1}/codespine/search/hybrid.py +0 -0
  35. {codespine-0.4.0 → codespine-0.4.1}/codespine/search/rrf.py +0 -0
  36. {codespine-0.4.0 → codespine-0.4.1}/codespine/watch/__init__.py +0 -0
  37. {codespine-0.4.0 → codespine-0.4.1}/codespine/watch/watcher.py +0 -0
  38. {codespine-0.4.0 → codespine-0.4.1}/codespine.egg-info/SOURCES.txt +0 -0
  39. {codespine-0.4.0 → codespine-0.4.1}/codespine.egg-info/dependency_links.txt +0 -0
  40. {codespine-0.4.0 → codespine-0.4.1}/codespine.egg-info/entry_points.txt +0 -0
  41. {codespine-0.4.0 → codespine-0.4.1}/codespine.egg-info/requires.txt +0 -0
  42. {codespine-0.4.0 → codespine-0.4.1}/codespine.egg-info/top_level.txt +0 -0
  43. {codespine-0.4.0 → codespine-0.4.1}/gindex.py +0 -0
  44. {codespine-0.4.0 → codespine-0.4.1}/setup.cfg +0 -0
  45. {codespine-0.4.0 → codespine-0.4.1}/tests/test_branch_diff_normalize.py +0 -0
  46. {codespine-0.4.0 → codespine-0.4.1}/tests/test_call_resolver.py +0 -0
  47. {codespine-0.4.0 → codespine-0.4.1}/tests/test_index_and_hybrid.py +0 -0
  48. {codespine-0.4.0 → codespine-0.4.1}/tests/test_java_parser.py +0 -0
  49. {codespine-0.4.0 → codespine-0.4.1}/tests/test_multimodule_index.py +0 -0
  50. {codespine-0.4.0 → codespine-0.4.1}/tests/test_search_ranking.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codespine
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: Local Java code intelligence indexer backed by a graph database
5
5
  Author: CodeSpine contributors
6
6
  License: MIT License
@@ -1,4 +1,4 @@
1
1
  """CodeSpine package."""
2
2
 
3
3
  __all__ = ["__version__"]
4
- __version__ = "0.4.0"
4
+ __version__ = "0.4.1"
@@ -167,6 +167,10 @@ class JavaIndexer:
167
167
  to_reindex = current_files
168
168
  deleted_file_ids = []
169
169
  meta_cache = {}
170
+ # Wipe the embedding cache on a full re-index so stale embeddings
171
+ # (including those from the old SQLite format) are not carried over.
172
+ from codespine.search.vector import _CACHE as _embed_cache
173
+ _embed_cache.clear()
170
174
  else:
171
175
  to_reindex, deleted_file_ids, meta_cache = self._plan_incremental(
172
176
  project_id,
@@ -71,9 +71,16 @@ def build_mcp_server(store, repo_path_provider):
71
71
  Call this before other tools so you know what's ready without trial-and-error.
72
72
  Features marked false may need 'codespine analyse --deep' or optional dependencies.
73
73
  """
74
- projects = store.query_records(
75
- "MATCH (p:Project) RETURN p.id as id, p.path as path, p.indexed_at as indexed_at"
76
- )
74
+ try:
75
+ projects = store.query_records(
76
+ "MATCH (p:Project) RETURN p.id as id, p.path as path, p.indexed_at as indexed_at"
77
+ )
78
+ except Exception:
79
+ # Old DB schema (pre-0.4.0) doesn't have indexed_at column yet.
80
+ # Falls back gracefully; column is added next time 'analyse' runs.
81
+ projects = store.query_records(
82
+ "MATCH (p:Project) RETURN p.id as id, p.path as path"
83
+ )
77
84
  sym_q = store.query_records("MATCH (s:Symbol) RETURN count(s) as count")
78
85
  comm_q = store.query_records("MATCH (c:Community) RETURN count(c) as count")
79
86
  flow_q = store.query_records("MATCH (f:Flow) RETURN count(f) as count")
@@ -171,9 +178,14 @@ def build_mcp_server(store, repo_path_provider):
171
178
  @mcp.tool()
172
179
  def list_projects():
173
180
  """List all indexed projects with their symbol and file counts."""
174
- projects = store.query_records(
175
- "MATCH (p:Project) RETURN p.id as id, p.path as path, p.indexed_at as indexed_at"
176
- )
181
+ try:
182
+ projects = store.query_records(
183
+ "MATCH (p:Project) RETURN p.id as id, p.path as path, p.indexed_at as indexed_at"
184
+ )
185
+ except Exception:
186
+ projects = store.query_records(
187
+ "MATCH (p:Project) RETURN p.id as id, p.path as path"
188
+ )
177
189
  if not projects:
178
190
  return {"available": False, "note": "No projects indexed yet. Run 'codespine analyse <path>'."}
179
191
  now = int(time.time())
@@ -51,6 +51,13 @@ class _EmbeddingCache:
51
51
  """Load cache from disk. Must be called with _lock held."""
52
52
  if self._data is not None:
53
53
  return
54
+ # Delete the old SQLite cache file left by versions < 0.4.0.
55
+ old_sqlite = self._path.replace(".json", ".sqlite3")
56
+ if os.path.isfile(old_sqlite):
57
+ try:
58
+ os.remove(old_sqlite)
59
+ except OSError:
60
+ pass
54
61
  if os.path.isfile(self._path):
55
62
  try:
56
63
  with open(self._path, "r", encoding="utf-8") as f:
@@ -62,6 +69,15 @@ class _EmbeddingCache:
62
69
  pass
63
70
  self._data = {}
64
71
 
72
+ def clear(self) -> None:
73
+ """Wipe the in-memory cache and delete the backing file."""
74
+ with self._lock:
75
+ self._data = {}
76
+ try:
77
+ os.remove(self._path)
78
+ except OSError:
79
+ pass
80
+
65
81
  def _flush(self) -> None:
66
82
  """Persist cache to disk atomically. Must be called with _lock held."""
67
83
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codespine
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: Local Java code intelligence indexer backed by a graph database
5
5
  Author: CodeSpine contributors
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "codespine"
7
- version = "0.4.0"
7
+ version = "0.4.1"
8
8
  description = "Local Java code intelligence indexer backed by a graph database"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes