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.
- {codespine-0.4.0 → codespine-0.4.1}/PKG-INFO +1 -1
- {codespine-0.4.0 → codespine-0.4.1}/codespine/__init__.py +1 -1
- {codespine-0.4.0 → codespine-0.4.1}/codespine/indexer/engine.py +4 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/mcp/server.py +18 -6
- {codespine-0.4.0 → codespine-0.4.1}/codespine/search/vector.py +16 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine.egg-info/PKG-INFO +1 -1
- {codespine-0.4.0 → codespine-0.4.1}/pyproject.toml +1 -1
- {codespine-0.4.0 → codespine-0.4.1}/LICENSE +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/README.md +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/analysis/__init__.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/analysis/community.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/analysis/context.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/analysis/coupling.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/analysis/deadcode.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/analysis/flow.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/analysis/impact.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/cli.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/config.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/db/__init__.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/db/schema.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/db/store.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/diff/__init__.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/diff/branch_diff.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/indexer/__init__.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/indexer/call_resolver.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/indexer/java_parser.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/indexer/symbol_builder.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/mcp/__init__.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/noise/__init__.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/noise/blocklist.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/search/__init__.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/search/bm25.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/search/fuzzy.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/search/hybrid.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/search/rrf.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/watch/__init__.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine/watch/watcher.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine.egg-info/SOURCES.txt +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine.egg-info/dependency_links.txt +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine.egg-info/entry_points.txt +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine.egg-info/requires.txt +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/codespine.egg-info/top_level.txt +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/gindex.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/setup.cfg +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/tests/test_branch_diff_normalize.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/tests/test_call_resolver.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/tests/test_index_and_hybrid.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/tests/test_java_parser.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/tests/test_multimodule_index.py +0 -0
- {codespine-0.4.0 → codespine-0.4.1}/tests/test_search_ranking.py +0 -0
|
@@ -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
|
-
|
|
75
|
-
|
|
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
|
-
|
|
175
|
-
|
|
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:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|