codespine 0.6.1__tar.gz → 0.6.3__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.6.1 → codespine-0.6.3}/PKG-INFO +1 -1
- {codespine-0.6.1 → codespine-0.6.3}/codespine/__init__.py +1 -1
- {codespine-0.6.1 → codespine-0.6.3}/codespine/cli.py +5 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/db/store.py +25 -1
- {codespine-0.6.1 → codespine-0.6.3}/codespine.egg-info/PKG-INFO +1 -1
- {codespine-0.6.1 → codespine-0.6.3}/pyproject.toml +1 -1
- {codespine-0.6.1 → codespine-0.6.3}/LICENSE +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/README.md +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/analysis/__init__.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/analysis/community.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/analysis/context.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/analysis/coupling.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/analysis/crossmodule.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/analysis/deadcode.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/analysis/flow.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/analysis/impact.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/config.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/db/__init__.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/db/schema.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/diff/__init__.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/diff/branch_diff.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/indexer/__init__.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/indexer/call_resolver.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/indexer/engine.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/indexer/java_parser.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/indexer/symbol_builder.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/mcp/__init__.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/mcp/server.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/noise/__init__.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/noise/blocklist.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/overlay/__init__.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/overlay/git_state.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/overlay/merge.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/overlay/store.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/search/__init__.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/search/bm25.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/search/fuzzy.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/search/hybrid.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/search/rrf.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/search/vector.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/watch/__init__.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine/watch/watcher.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine.egg-info/SOURCES.txt +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine.egg-info/dependency_links.txt +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine.egg-info/entry_points.txt +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine.egg-info/requires.txt +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/codespine.egg-info/top_level.txt +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/gindex.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/setup.cfg +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/tests/test_branch_diff_normalize.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/tests/test_call_resolver.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/tests/test_community_detection.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/tests/test_deadcode.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/tests/test_index_and_hybrid.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/tests/test_java_parser.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/tests/test_multimodule_index.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/tests/test_overlay.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/tests/test_search_ranking.py +0 -0
- {codespine-0.6.1 → codespine-0.6.3}/tests/test_store_recovery.py +0 -0
|
@@ -777,6 +777,8 @@ def clear_project_cmd(project_id: str, allow_running: bool) -> None:
|
|
|
777
777
|
os.remove(meta_path)
|
|
778
778
|
except OSError:
|
|
779
779
|
pass
|
|
780
|
+
# Update the read replica so read-only callers (stats, MCP) see the change.
|
|
781
|
+
GraphStore.snapshot_to_read_replica()
|
|
780
782
|
click.secho(f"Cleared project '{project_id}' (was at {project_path}).", fg="green")
|
|
781
783
|
|
|
782
784
|
|
|
@@ -817,6 +819,9 @@ def clear_index_cmd(allow_running: bool) -> None:
|
|
|
817
819
|
os.remove(meta_path)
|
|
818
820
|
except OSError:
|
|
819
821
|
pass
|
|
822
|
+
# Publish an empty read replica so that read-only callers (stats, MCP)
|
|
823
|
+
# immediately see the cleared state and the MCP daemon hot-reloads.
|
|
824
|
+
GraphStore.snapshot_to_read_replica()
|
|
820
825
|
click.secho(f"Cleared {len(projects)} project(s). Index is now empty.", fg="green")
|
|
821
826
|
|
|
822
827
|
|
|
@@ -560,6 +560,15 @@ class GraphStore:
|
|
|
560
560
|
except OSError:
|
|
561
561
|
pass
|
|
562
562
|
|
|
563
|
+
# Also remove the read replica so that read-only callers (stats, MCP)
|
|
564
|
+
# don't continue to see stale data from before the wipe.
|
|
565
|
+
for stale in [
|
|
566
|
+
SETTINGS.db_snapshot_path,
|
|
567
|
+
SETTINGS.db_snapshot_path + ".tmp",
|
|
568
|
+
SETTINGS.db_snapshot_path + ".updated",
|
|
569
|
+
]:
|
|
570
|
+
self._remove_db_path(stale)
|
|
571
|
+
|
|
563
572
|
# Kuzu may retain stale internal state from a previous failed open of
|
|
564
573
|
# this path (e.g. after Ctrl+C mid-write). The in-process C++ state
|
|
565
574
|
# is poisoned and will raise "unordered_map::at: key not found" on any
|
|
@@ -595,6 +604,13 @@ class GraphStore:
|
|
|
595
604
|
self.db = kuzu.Database(path)
|
|
596
605
|
self._tls = threading.local()
|
|
597
606
|
ensure_schema(self._conn())
|
|
607
|
+
# Force Kuzu to flush the WAL to the main data files so that a
|
|
608
|
+
# subsequent read-only open (stats, MCP snapshot) can see the schema
|
|
609
|
+
# without needing WAL replay (which read-only mode cannot do).
|
|
610
|
+
try:
|
|
611
|
+
self._conn().execute("CHECKPOINT")
|
|
612
|
+
except Exception:
|
|
613
|
+
pass
|
|
598
614
|
|
|
599
615
|
def set_community(self, community_id: str, label: str, cohesion: float, symbol_ids: list[str]) -> None:
|
|
600
616
|
self.execute(
|
|
@@ -683,7 +699,15 @@ class GraphStore:
|
|
|
683
699
|
return False
|
|
684
700
|
|
|
685
701
|
def query_records(self, query: str, params: dict[str, Any] | None = None) -> list[dict[str, Any]]:
|
|
686
|
-
|
|
702
|
+
try:
|
|
703
|
+
frame = self.execute(query, params or {}).get_as_df()
|
|
704
|
+
except RuntimeError as exc:
|
|
705
|
+
# In read-only mode the DB may have been cleared but the schema
|
|
706
|
+
# hasn't been flushed from WAL, or the DB is brand-new. Return
|
|
707
|
+
# an empty result instead of crashing callers (stats, MCP, etc.).
|
|
708
|
+
if self.read_only and "does not exist" in str(exc).lower():
|
|
709
|
+
return []
|
|
710
|
+
raise
|
|
687
711
|
if frame.empty:
|
|
688
712
|
return []
|
|
689
713
|
return json.loads(frame.to_json(orient="records"))
|
|
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
|
|
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
|