codegraphcontext 0.6.10__py3-none-any.whl → 0.6.11__py3-none-any.whl

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.
@@ -23,6 +23,40 @@ from codegraphcontext.core.graph_query import GraphQueryInterface
23
23
  from ..utils.cypher_ddl import is_schema_ddl
24
24
  from codegraphcontext.utils.debug_log import debug_log, info_logger, error_logger, warning_logger
25
25
 
26
+ # Default cap for ladybug/kuzu buffer pools (bytes). Both libraries otherwise
27
+ # default to ~80% of system RAM, which lets long-running gateways grow huge.
28
+ DEFAULT_EMBEDDED_BUFFER_POOL_BYTES = 4 * 1024**3
29
+
30
+
31
+ def resolve_embedded_buffer_pool_size() -> int:
32
+ """
33
+ Resolve ``buffer_pool_size`` for embedded ``Database(...)`` constructors.
34
+
35
+ Reads ``CGC_EMBEDDED_BUFFER_POOL_MB`` (integer MiB). Unset uses a 4 GiB
36
+ default. ``0`` opts back into the library default (~80% of system memory).
37
+ Invalid values log a warning and fall back to 4 GiB.
38
+ """
39
+ raw = os.getenv("CGC_EMBEDDED_BUFFER_POOL_MB")
40
+ if raw is None or str(raw).strip() == "":
41
+ return DEFAULT_EMBEDDED_BUFFER_POOL_BYTES
42
+ try:
43
+ mb = int(str(raw).strip())
44
+ except ValueError:
45
+ warning_logger(
46
+ f"Invalid CGC_EMBEDDED_BUFFER_POOL_MB={raw!r}; "
47
+ f"using default {DEFAULT_EMBEDDED_BUFFER_POOL_BYTES} bytes"
48
+ )
49
+ return DEFAULT_EMBEDDED_BUFFER_POOL_BYTES
50
+ if mb < 0:
51
+ warning_logger(
52
+ f"Invalid CGC_EMBEDDED_BUFFER_POOL_MB={raw!r}; "
53
+ f"using default {DEFAULT_EMBEDDED_BUFFER_POOL_BYTES} bytes"
54
+ )
55
+ return DEFAULT_EMBEDDED_BUFFER_POOL_BYTES
56
+ if mb == 0:
57
+ return 0
58
+ return mb * 1024**2
59
+
26
60
 
27
61
  @dataclass(frozen=True)
28
62
  class EmbeddedBackendSpec:
@@ -117,8 +151,18 @@ class EmbeddedGraphManager(GraphQueryInterface):
117
151
  max_retries = 5
118
152
  for attempt in range(max_retries):
119
153
  try:
120
- info_logger(f"Initializing {spec.display_name} at {self.db_path}")
121
- self._db = backend.Database(self.db_path)
154
+ buffer_pool_size = resolve_embedded_buffer_pool_size()
155
+ if buffer_pool_size == 0:
156
+ pool_msg = "library default (~80% of system memory)"
157
+ else:
158
+ pool_msg = f"{buffer_pool_size} bytes"
159
+ info_logger(
160
+ f"Initializing {spec.display_name} at {self.db_path} "
161
+ f"(buffer_pool_size={pool_msg})"
162
+ )
163
+ self._db = backend.Database(
164
+ self.db_path, buffer_pool_size=buffer_pool_size
165
+ )
122
166
 
123
167
  # Initialise connection pool
124
168
  self._pool = queue.Queue()
@@ -242,11 +242,26 @@ class ElispTreeSitterParser:
242
242
  return None
243
243
 
244
244
  def _first_symbol_in_quote(self, node: Any) -> Optional[str]:
245
- if node.type != "quote":
245
+ # (quote symbol) -> symbol
246
+ if node.type == "quote":
247
+ for child in self._named_children(node):
248
+ if child.type == "symbol":
249
+ return self._get_node_text(child)
246
250
  return None
247
- for child in self._named_children(node):
248
- if child.type == "symbol":
249
- return self._get_node_text(child)
251
+ # #'symbol (function quote): tree-sitter-elisp parses `(funcall #'fn ...)`
252
+ # as (special_form (symbol "function") (symbol "fn")). Without this branch
253
+ # funcall/apply targets are dropped, so function_calls never records them
254
+ # and elisp call tests fail (KeyError / missing call edges).
255
+ if node.type == "special_form" and self._form_head(node) == "function":
256
+ named = self._named_children(node)
257
+ if len(named) >= 2 and named[1].type == "symbol":
258
+ return self._get_node_text(named[1])
259
+ return None
260
+ # Some grammar builds expose #'/quote as a `quoted_symbol` node wrapping a
261
+ # single symbol child; cover that variant too.
262
+ named = self._named_children(node)
263
+ if len(named) == 1 and named[0].type == "symbol":
264
+ return self._get_node_text(named[0])
250
265
  return None
251
266
 
252
267
  def _quoted_symbol_argument(self, node: Any, index: int = 1) -> Optional[str]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codegraphcontext
3
- Version: 0.6.10
3
+ Version: 0.6.11
4
4
  Summary: An MCP server that indexes local code into a graph database to provide context to AI assistants.
5
5
  Author-email: Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
6
6
  License: MIT License
@@ -388,6 +388,8 @@ CodeGraphContext supports multiple graph database backends to suit your environm
388
388
  | **Speed** | ⚡ Extremely Fast | ⚡ Fast | 🚀 Scalable | 🌐 Network-dependent |
389
389
  | **Persistence**| Yes (to disk) | Yes (to disk) | Yes (to disk) | Yes (server-side) |
390
390
 
391
+ Embedded KuzuDB/LadybugDB default to a **4 GiB** buffer pool (`CGC_EMBEDDED_BUFFER_POOL_MB`). Set that env var to another MiB value, or `0` for the library default (~80% of system RAM).
392
+
391
393
  ---
392
394
 
393
395
  ## SCIP indexing (optional)
@@ -26,7 +26,7 @@ codegraphcontext/core/bundle_registry.py,sha256=xlVBe-fmvEOLY9xDq7w0vXFlTPzeFVIw
26
26
  codegraphcontext/core/cgc_bundle.py,sha256=tgcsfIzHxPTr2ktioN43mzS1JyYHeqFjnHXj9fKapY8,77146
27
27
  codegraphcontext/core/cgcignore.py,sha256=yJeRaPlDyOaSGGdXB5kwBlSqpEXtrqsSzo0UNMoqef8,12236
28
28
  codegraphcontext/core/database.py,sha256=ZLOHXv46hVxWiPYQala0Co7_Z8vqj5juaenudwq6DTU,14893
29
- codegraphcontext/core/database_embedded_kuzu.py,sha256=0MgfAN-3mH8saXqUysE42Kz30HTmyWGCOI3LwyGF9ww,82566
29
+ codegraphcontext/core/database_embedded_kuzu.py,sha256=6fMwfbiMx0RpYZn2CiJU5ZRUAn3ZzioPTzsFjldX_AQ,84400
30
30
  codegraphcontext/core/database_falkordb.py,sha256=8TSFfgKoaNdTzSx7P4qXMMs2kTNBzrcW5tZxR8JV4bY,35834
31
31
  codegraphcontext/core/database_falkordb_remote.py,sha256=HdkcmwgUxPy1bwiFqqcU8yMQYib7B3JarYQ1LlTwfJ8,7957
32
32
  codegraphcontext/core/database_kuzu.py,sha256=5I31dGm7wRo3YjIWeWGRVcX1eYRXYc7fPWnT7zHFjf0,1123
@@ -80,7 +80,7 @@ codegraphcontext/tools/languages/cpp.py,sha256=s6dZsb2uiW2Spe0TVs37A8GzDeiLQG-yR
80
80
  codegraphcontext/tools/languages/csharp.py,sha256=LmI_h09G-CkLq3wqNPKgqumdqYtAc2oqWE_4XtPu13A,29609
81
81
  codegraphcontext/tools/languages/css.py,sha256=aN1Nm8vHmfV0J0jQ-_q5x0YDTOtLV2IW-5lp7WtGG5o,3789
82
82
  codegraphcontext/tools/languages/dart.py,sha256=gtYO9R7Z4sqMs1XmZoxhRXHwmmbUo2NSH_9qVrlSW9w,27598
83
- codegraphcontext/tools/languages/elisp.py,sha256=QVxJq328bR4DsQK8Vs8b9oxthx1Wm_BS1dsCSjD_P8I,22717
83
+ codegraphcontext/tools/languages/elisp.py,sha256=6WXRjQx_av1ZBTN52VDCm47qK0dZ-_L7SYS5kEqqtWE,23635
84
84
  codegraphcontext/tools/languages/elixir.py,sha256=UKWjtx6KSC6d8xsDa7KMeHSGL2fAwzd4cKgj1VfIm10,23069
85
85
  codegraphcontext/tools/languages/go.py,sha256=FnL44N4VhneaDBd_Kg6qwOQDV07zwLdRhqS2gA0gr90,26972
86
86
  codegraphcontext/tools/languages/gradle.py,sha256=P1NPMhHGsqgObGjqy17InFxzgE6IO4a5lFEx531gN9I,9396
@@ -175,9 +175,9 @@ codegraphcontext/viz/dist/wasm/tree-sitter-typescript.wasm,sha256=hRVATc7tOOHthq
175
175
  codegraphcontext/viz/dist/wasm/tree-sitter.wasm,sha256=CCeVuI_hXktkBD-DW01xYPv5XoAYVRIqzJUJI5te-RY,196763
176
176
  codegraphcontext/viz/dist/wasm/web-tree-sitter.js,sha256=DIaCNqRylrT_PBVw8g4ImeSnhP9uXNe_ycOlUiVGPko,153666
177
177
  codegraphcontext/viz/dist/wasm/web-tree-sitter.wasm,sha256=CCeVuI_hXktkBD-DW01xYPv5XoAYVRIqzJUJI5te-RY,196763
178
- codegraphcontext-0.6.10.dist-info/licenses/LICENSE,sha256=rh8M-bJpQYJnw2vtRVgt0t7piMZXh5QzaKeNEI0vqqA,1061
179
- codegraphcontext-0.6.10.dist-info/METADATA,sha256=TJEhvZPGUUe_yum4O_V_7NfI86R8DiObkUVNeeMw6Tw,34016
180
- codegraphcontext-0.6.10.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
181
- codegraphcontext-0.6.10.dist-info/entry_points.txt,sha256=LCxWCWMshdvYGoHBPuQZ8C-e4CiNSHCLXofrNSGHkoE,103
182
- codegraphcontext-0.6.10.dist-info/top_level.txt,sha256=CBgc6LAPZIO5FS0nSYYkylDifHsZTIqw3Gf5UwDxeGI,17
183
- codegraphcontext-0.6.10.dist-info/RECORD,,
178
+ codegraphcontext-0.6.11.dist-info/licenses/LICENSE,sha256=rh8M-bJpQYJnw2vtRVgt0t7piMZXh5QzaKeNEI0vqqA,1061
179
+ codegraphcontext-0.6.11.dist-info/METADATA,sha256=o8-BUROXkXJ63Ed6K0fQZ4zVTLAhVolgXLiVNNDwYLw,34203
180
+ codegraphcontext-0.6.11.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
181
+ codegraphcontext-0.6.11.dist-info/entry_points.txt,sha256=LCxWCWMshdvYGoHBPuQZ8C-e4CiNSHCLXofrNSGHkoE,103
182
+ codegraphcontext-0.6.11.dist-info/top_level.txt,sha256=CBgc6LAPZIO5FS0nSYYkylDifHsZTIqw3Gf5UwDxeGI,17
183
+ codegraphcontext-0.6.11.dist-info/RECORD,,