code-graph-rag 0.0.245__tar.gz → 0.0.345__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 (208) hide show
  1. {code_graph_rag-0.0.245/code_graph_rag.egg-info → code_graph_rag-0.0.345}/PKG-INFO +15 -1
  2. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/PYPI_README.md +11 -0
  3. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/README.md +80 -23
  4. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345/code_graph_rag.egg-info}/PKG-INFO +15 -1
  5. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/code_graph_rag.egg-info/SOURCES.txt +48 -1
  6. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/code_graph_rag.egg-info/requires.txt +3 -0
  7. code_graph_rag-0.0.345/codebase_rag/capture.py +137 -0
  8. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/cli.py +67 -23
  9. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/cli_help.py +9 -0
  10. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/config.py +16 -1
  11. code_graph_rag-0.0.345/codebase_rag/constants/__init__.py +29 -0
  12. code_graph_rag-0.0.345/codebase_rag/constants/ast_cpp.py +236 -0
  13. code_graph_rag-0.0.345/codebase_rag/constants/ast_csharp.py +243 -0
  14. code_graph_rag-0.0.345/codebase_rag/constants/ast_dart.py +68 -0
  15. code_graph_rag-0.0.345/codebase_rag/constants/ast_go.py +63 -0
  16. code_graph_rag-0.0.345/codebase_rag/constants/ast_java.py +230 -0
  17. code_graph_rag-0.0.345/codebase_rag/constants/ast_js.py +275 -0
  18. code_graph_rag-0.0.345/codebase_rag/constants/ast_lua.py +31 -0
  19. code_graph_rag-0.0.345/codebase_rag/constants/ast_nodes.py +273 -0
  20. code_graph_rag-0.0.345/codebase_rag/constants/ast_php.py +36 -0
  21. code_graph_rag-0.0.345/codebase_rag/constants/ast_python.py +124 -0
  22. code_graph_rag-0.0.345/codebase_rag/constants/ast_rust.py +172 -0
  23. code_graph_rag-0.0.345/codebase_rag/constants/ast_scala.py +18 -0
  24. code_graph_rag-0.0.345/codebase_rag/constants/build.py +70 -0
  25. code_graph_rag-0.0.345/codebase_rag/constants/cli.py +410 -0
  26. code_graph_rag-0.0.345/codebase_rag/constants/core.py +175 -0
  27. code_graph_rag-0.0.345/codebase_rag/constants/deadcode_roots.py +217 -0
  28. code_graph_rag-0.0.345/codebase_rag/constants/deps.py +79 -0
  29. code_graph_rag-0.0.345/codebase_rag/constants/fqn_specs.py +638 -0
  30. code_graph_rag-0.0.345/codebase_rag/constants/graph.py +418 -0
  31. code_graph_rag-0.0.345/codebase_rag/constants/health.py +62 -0
  32. code_graph_rag-0.0.345/codebase_rag/constants/lang_tooling.py +166 -0
  33. code_graph_rag-0.0.345/codebase_rag/constants/languages.py +328 -0
  34. code_graph_rag-0.0.345/codebase_rag/constants/mcp.py +105 -0
  35. code_graph_rag-0.0.345/codebase_rag/constants/providers.py +115 -0
  36. code_graph_rag-0.0.345/codebase_rag/constants/security.py +177 -0
  37. code_graph_rag-0.0.345/codebase_rag/constants/stdlib_types.py +398 -0
  38. code_graph_rag-0.0.345/codebase_rag/cypher_queries.py +238 -0
  39. code_graph_rag-0.0.345/codebase_rag/dead_code.py +460 -0
  40. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/embedder.py +38 -8
  41. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/exceptions.py +4 -0
  42. code_graph_rag-0.0.345/codebase_rag/graph_audit.py +281 -0
  43. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/graph_updater.py +392 -37
  44. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/language_spec.py +120 -1
  45. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/logs.py +35 -2
  46. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/mcp/tools.py +8 -1
  47. code_graph_rag-0.0.345/codebase_rag/parser_fingerprint.py +44 -0
  48. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parser_loader.py +55 -0
  49. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/call_processor.py +1023 -111
  50. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/call_resolver.py +369 -40
  51. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/class_ingest/cpp_modules.py +23 -7
  52. code_graph_rag-0.0.345/codebase_rag/parsers/class_ingest/method_override.py +301 -0
  53. code_graph_rag-0.0.345/codebase_rag/parsers/class_ingest/mixin.py +1228 -0
  54. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/class_ingest/parent_extraction.py +167 -8
  55. code_graph_rag-0.0.345/codebase_rag/parsers/class_ingest/relationships.py +185 -0
  56. code_graph_rag-0.0.345/codebase_rag/parsers/class_ingest/utils.py +27 -0
  57. code_graph_rag-0.0.345/codebase_rag/parsers/cpp/preproc_recovery.py +129 -0
  58. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/cpp/utils.py +29 -5
  59. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/cpp_frontend/__init__.py +2 -0
  60. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/cpp_frontend/constants.py +5 -0
  61. code_graph_rag-0.0.345/codebase_rag/parsers/cpp_frontend/frontend.py +830 -0
  62. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/cpp_frontend/qn.py +5 -0
  63. code_graph_rag-0.0.345/codebase_rag/parsers/csharp/__init__.py +1 -0
  64. code_graph_rag-0.0.345/codebase_rag/parsers/csharp/type_inference.py +579 -0
  65. code_graph_rag-0.0.345/codebase_rag/parsers/csharp/utils.py +205 -0
  66. code_graph_rag-0.0.345/codebase_rag/parsers/dart/__init__.py +15 -0
  67. code_graph_rag-0.0.345/codebase_rag/parsers/dart/utils.py +81 -0
  68. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/definition_processor.py +85 -2
  69. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/dependency_parser.py +45 -0
  70. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/export_detection.py +134 -1
  71. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/factory.py +11 -0
  72. code_graph_rag-0.0.345/codebase_rag/parsers/flow_access/__init__.py +9 -0
  73. code_graph_rag-0.0.345/codebase_rag/parsers/flow_access/constants.py +17 -0
  74. code_graph_rag-0.0.345/codebase_rag/parsers/flow_access/processor.py +1247 -0
  75. code_graph_rag-0.0.345/codebase_rag/parsers/function_ingest.py +1642 -0
  76. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/go/type_inference.py +6 -0
  77. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/import_processor.py +439 -75
  78. code_graph_rag-0.0.345/codebase_rag/parsers/io_access/__init__.py +58 -0
  79. code_graph_rag-0.0.345/codebase_rag/parsers/io_access/constants.py +72 -0
  80. code_graph_rag-0.0.345/codebase_rag/parsers/io_access/descriptor.py +289 -0
  81. code_graph_rag-0.0.345/codebase_rag/parsers/io_access/extract.py +203 -0
  82. code_graph_rag-0.0.345/codebase_rag/parsers/io_access/models.py +53 -0
  83. code_graph_rag-0.0.345/codebase_rag/parsers/io_access/processor.py +1038 -0
  84. code_graph_rag-0.0.345/codebase_rag/parsers/io_access/registry.py +410 -0
  85. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/java/method_resolver.py +292 -36
  86. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/java/type_inference.py +6 -2
  87. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/java/type_resolver.py +20 -2
  88. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/java/utils.py +55 -2
  89. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/java/variable_analyzer.py +2 -2
  90. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/js_ts/ingest.py +198 -39
  91. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/js_ts/module_system.py +57 -36
  92. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/py/__init__.py +2 -1
  93. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/py/ast_analyzer.py +132 -26
  94. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/py/expression_analyzer.py +81 -6
  95. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/py/type_inference.py +7 -2
  96. code_graph_rag-0.0.345/codebase_rag/parsers/py/utils.py +96 -0
  97. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/rs/type_inference.py +32 -16
  98. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/rs/utils.py +17 -2
  99. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/stdlib_extractor.py +29 -0
  100. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/type_inference.py +88 -8
  101. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/utils.py +298 -35
  102. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/providers/base.py +38 -1
  103. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/services/__init__.py +5 -0
  104. code_graph_rag-0.0.345/codebase_rag/services/filtering.py +50 -0
  105. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/services/graph_service.py +32 -8
  106. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/services/protobuf_service.py +1 -0
  107. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/tools/health_checker.py +59 -0
  108. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/types_defs.py +258 -23
  109. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/unixcoder.py +13 -8
  110. code_graph_rag-0.0.345/codec/schema_pb2.py +77 -0
  111. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/pyproject.toml +19 -1
  112. code_graph_rag-0.0.245/codebase_rag/constants.py +0 -3695
  113. code_graph_rag-0.0.245/codebase_rag/cypher_queries.py +0 -333
  114. code_graph_rag-0.0.245/codebase_rag/parsers/class_ingest/method_override.py +0 -79
  115. code_graph_rag-0.0.245/codebase_rag/parsers/class_ingest/mixin.py +0 -679
  116. code_graph_rag-0.0.245/codebase_rag/parsers/class_ingest/relationships.py +0 -114
  117. code_graph_rag-0.0.245/codebase_rag/parsers/class_ingest/utils.py +0 -13
  118. code_graph_rag-0.0.245/codebase_rag/parsers/cpp_frontend/frontend.py +0 -381
  119. code_graph_rag-0.0.245/codebase_rag/parsers/function_ingest.py +0 -809
  120. code_graph_rag-0.0.245/codebase_rag/parsers/py/utils.py +0 -38
  121. code_graph_rag-0.0.245/codec/schema_pb2.py +0 -75
  122. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/LICENSE +0 -0
  123. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/cgr/__init__.py +0 -0
  124. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/code_graph_rag.egg-info/dependency_links.txt +0 -0
  125. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/code_graph_rag.egg-info/entry_points.txt +0 -0
  126. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/code_graph_rag.egg-info/top_level.txt +0 -0
  127. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/__init__.py +0 -0
  128. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/cgr_state.py +0 -0
  129. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/decorators.py +0 -0
  130. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/docker-compose.yaml +0 -0
  131. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/graph_loader.py +0 -0
  132. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/main.py +0 -0
  133. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/mcp/__init__.py +0 -0
  134. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/mcp/client.py +0 -0
  135. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/mcp/server.py +0 -0
  136. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/models.py +0 -0
  137. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/__init__.py +0 -0
  138. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/class_ingest/__init__.py +0 -0
  139. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/class_ingest/identity.py +0 -0
  140. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/class_ingest/node_type.py +0 -0
  141. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/cpp/__init__.py +0 -0
  142. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/cpp/type_inference.py +0 -0
  143. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/go/__init__.py +0 -0
  144. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/go/module_paths.py +0 -0
  145. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/go/utils.py +0 -0
  146. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/handlers/__init__.py +0 -0
  147. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/handlers/base.py +0 -0
  148. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/handlers/cpp.py +0 -0
  149. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/handlers/java.py +0 -0
  150. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/handlers/js_ts.py +0 -0
  151. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/handlers/lua.py +0 -0
  152. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/handlers/php.py +0 -0
  153. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/handlers/protocol.py +0 -0
  154. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/handlers/python.py +0 -0
  155. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/handlers/registry.py +0 -0
  156. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/handlers/rust.py +0 -0
  157. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/java/__init__.py +0 -0
  158. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/js_ts/__init__.py +0 -0
  159. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/js_ts/type_inference.py +0 -0
  160. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/js_ts/utils.py +0 -0
  161. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/lua/__init__.py +0 -0
  162. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/lua/type_inference.py +0 -0
  163. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/lua/utils.py +0 -0
  164. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/py/variable_analyzer.py +0 -0
  165. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/python_source_roots.py +0 -0
  166. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/rs/__init__.py +0 -0
  167. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/parsers/structure_processor.py +0 -0
  168. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/prompts.py +0 -0
  169. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/providers/__init__.py +0 -0
  170. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/providers/litellm.py +0 -0
  171. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/readme_sections.py +0 -0
  172. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/schema_builder.py +0 -0
  173. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/schemas.py +0 -0
  174. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/services/anthropic_token_counter.py +0 -0
  175. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/services/llm.py +0 -0
  176. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/stack/__init__.py +0 -0
  177. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/stack/cli.py +0 -0
  178. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/stack/constants.py +0 -0
  179. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/stack/health.py +0 -0
  180. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/stack/manager.py +0 -0
  181. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/tool_errors.py +0 -0
  182. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/tools/__init__.py +0 -0
  183. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/tools/code_retrieval.py +0 -0
  184. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/tools/codebase_query.py +0 -0
  185. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/tools/directory_lister.py +0 -0
  186. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/tools/file_editor.py +0 -0
  187. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/tools/file_reader.py +0 -0
  188. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/tools/file_writer.py +0 -0
  189. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/tools/language.py +0 -0
  190. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/tools/semantic_search.py +0 -0
  191. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/tools/shell_command.py +0 -0
  192. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/tools/tool_descriptions.py +0 -0
  193. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/utils/__init__.py +0 -0
  194. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/utils/dependencies.py +0 -0
  195. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/utils/fqn_resolver.py +0 -0
  196. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/utils/path_utils.py +0 -0
  197. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/utils/rich_markdown.py +0 -0
  198. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/utils/source_extraction.py +0 -0
  199. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/utils/token_utils.py +0 -0
  200. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/vector_store.py +0 -0
  201. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/workspaces/__init__.py +0 -0
  202. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/workspaces/cli.py +0 -0
  203. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/workspaces/constants.py +0 -0
  204. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/workspaces/models.py +0 -0
  205. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codebase_rag/workspaces/storage.py +0 -0
  206. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codec/__init__.py +0 -0
  207. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/codec/schema_pb2.pyi +0 -0
  208. {code_graph_rag-0.0.245 → code_graph_rag-0.0.345}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-graph-rag
3
- Version: 0.0.245
3
+ Version: 0.0.345
4
4
  Summary: The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs
5
5
  License-Expression: MIT
6
6
  Keywords: rag,retrieval-augmented-generation,knowledge-graph,code-analysis,tree-sitter,mcp,mcp-server,llm,graph-database,semantic-search,codebase,memgraph,developer-tools,monorepo
@@ -46,6 +46,7 @@ Requires-Dist: pytest-cov>=4.0.0; extra == "test"
46
46
  Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
47
47
  Requires-Dist: testcontainers>=4.9.0; extra == "test"
48
48
  Requires-Dist: libclang>=18.1.1; extra == "test"
49
+ Requires-Dist: filelock>=3.12; extra == "test"
49
50
  Provides-Extra: treesitter-full
50
51
  Requires-Dist: tree-sitter-python>=0.23.6; extra == "treesitter-full"
51
52
  Requires-Dist: tree-sitter-javascript>=0.23.1; extra == "treesitter-full"
@@ -58,6 +59,8 @@ Requires-Dist: tree-sitter-c>=0.24.1; extra == "treesitter-full"
58
59
  Requires-Dist: tree-sitter-cpp>=0.23.0; extra == "treesitter-full"
59
60
  Requires-Dist: tree-sitter-lua>=0.0.19; extra == "treesitter-full"
60
61
  Requires-Dist: tree-sitter-php>=0.24.1; extra == "treesitter-full"
62
+ Requires-Dist: tree-sitter-c-sharp>=0.23.5; extra == "treesitter-full"
63
+ Requires-Dist: tree-sitter-dart>=0.1.0; extra == "treesitter-full"
61
64
  Provides-Extra: semantic
62
65
  Requires-Dist: qdrant-client>=1.9.0; extra == "semantic"
63
66
  Requires-Dist: torch>=2.6.0; extra == "semantic"
@@ -123,6 +126,17 @@ cgr export -o graph.json
123
126
  cgr optimize python --repo-path ./my-project
124
127
  ```
125
128
 
129
+ **Find dead code (functions unreachable from any entry point):**
130
+
131
+ ```bash
132
+ cgr dead-code # scan the indexed project
133
+ cgr dead-code -e main --exclude '*.gen.*' # add roots, skip generated code
134
+ cgr dead-code --format json --fail-on-found # CI-friendly report
135
+ ```
136
+
137
+ Results are candidates for review, not a guaranteed delete list. See the
138
+ [Dead Code Detection guide](https://docs.code-graph-rag.com/guide/dead-code/).
139
+
126
140
  **Run as an MCP server (for Claude Code):**
127
141
 
128
142
  ```bash
@@ -57,6 +57,17 @@ cgr export -o graph.json
57
57
  cgr optimize python --repo-path ./my-project
58
58
  ```
59
59
 
60
+ **Find dead code (functions unreachable from any entry point):**
61
+
62
+ ```bash
63
+ cgr dead-code # scan the indexed project
64
+ cgr dead-code -e main --exclude '*.gen.*' # add roots, skip generated code
65
+ cgr dead-code --format json --fail-on-found # CI-friendly report
66
+ ```
67
+
68
+ Results are candidates for review, not a guaranteed delete list. See the
69
+ [Dead Code Detection guide](https://docs.code-graph-rag.com/guide/dead-code/).
70
+
60
71
  **Run as an MCP server (for Claude Code):**
61
72
 
62
73
  ```bash
@@ -75,16 +75,18 @@ An accurate Retrieval-Augmented Generation (RAG) system that analyzes multi-lang
75
75
  | Language | Status | Extensions | Functions | Classes/Structs | Modules | Package Detection | Additional Features |
76
76
  |--------|------|----------|---------|---------------|-------|-----------------|-------------------|
77
77
  | C | Fully Supported | .c | ✓ | ✓ | ✓ | ✓ | Functions, structs, unions, enums, preprocessor includes |
78
- | C++ | Fully Supported | .cpp, .h, .hpp, .cc, .cxx, .hxx, .hh, .ixx, .cppm, .ccm | ✓ | ✓ | ✓ | | Constructors, destructors, operator overloading, templates, lambdas, C++20 modules, namespaces |
78
+ | C# | Fully Supported | .cs | ✓ | ✓ | ✓ | - | Namespaces (block and file-scoped), classes/structs/records/interfaces/enums, generics, inheritance/interfaces/overrides, typed call resolution with overloads, using directives |
79
+ | C++ | Fully Supported | .cpp, .h, .hpp, .cc, .cxx, .hxx, .hh, .ixx, .cppm, .ccm | ✓ | ✓ | ✓ | ✓ | Constructors, destructors, operator overloading, templates, lambdas, C++20 modules, namespaces, preprocessor macros |
80
+ | Dart | Fully Supported | .dart | ✓ | ✓ | ✓ | - | Classes, mixins, extensions, enhanced enums, factory/named constructors, Flutter widgets, package/relative/dart: imports, part directives, pubspec dependencies |
81
+ | Go | Fully Supported | .go | ✓ | ✓ | ✓ | - | Receiver methods with cross-file binding, structs, interfaces, type declarations, function-local types |
79
82
  | Java | Fully Supported | .java | ✓ | ✓ | ✓ | - | Generics, annotations, modern features (records/sealed classes), concurrency, reflection |
80
83
  | JavaScript | Fully Supported | .js, .jsx | ✓ | ✓ | ✓ | - | ES6 modules, CommonJS, prototype methods, object methods, arrow functions |
81
84
  | Lua | Fully Supported | .lua | ✓ | - | ✓ | - | Local/global functions, metatables, closures, coroutines |
82
85
  | PHP | Fully Supported | .php | ✓ | ✓ | ✓ | - | Classes, interfaces, traits, enums, namespaces, PHP 8 attributes |
83
86
  | Python | Fully Supported | .py | ✓ | ✓ | ✓ | ✓ | Type inference, decorators, nested functions |
84
- | Rust | Fully Supported | .rs | ✓ | ✓ | ✓ | ✓ | impl blocks, associated functions |
87
+ | Rust | Fully Supported | .rs | ✓ | ✓ | ✓ | ✓ | impl blocks, associated functions, macro_rules! macros |
85
88
  | TypeScript (TSX) | Fully Supported | .tsx | ✓ | ✓ | ✓ | - | All TypeScript features plus JSX elements and components |
86
89
  | TypeScript | Fully Supported | .ts | ✓ | ✓ | ✓ | - | Interfaces, type aliases, enums, namespaces, ES6/CommonJS modules |
87
- | Go | In Development | .go | ✓ | ✓ | ✓ | - | Methods, type declarations |
88
90
  | Scala | In Development | .scala, .sc | ✓ | ✓ | ✓ | - | Case classes, objects |
89
91
  <!-- /SECTION:supported_languages -->
90
92
  - **🌳 Tree-sitter Parsing**: Uses Tree-sitter for robust, language-agnostic AST parsing
@@ -97,6 +99,7 @@ An accurate Retrieval-Augmented Generation (RAG) system that analyzes multi-lang
97
99
  - **⚡️ Shell Command Execution**: Can execute terminal commands for tasks like running tests or using CLI tools.
98
100
  - **🚀 Interactive Code Optimization**: AI-powered codebase optimization with language-specific best practices and interactive approval workflow
99
101
  - **📚 Reference-Guided Optimization**: Use your own coding standards and architectural documents to guide optimization suggestions
102
+ - **🧹 Dead Code Detection**: Report functions and methods unreachable from any entry point by walking `CALLS`/`REFERENCES` edges from roots (with a CI-friendly `--fail-on-found`)
100
103
  - **🔗 Dependency Analysis**: Parses `pyproject.toml` to understand external dependencies
101
104
  - **🎯 Nested Function Support**: Handles complex nested functions and class hierarchies
102
105
  - **🔄 Language-Agnostic Design**: Unified graph schema across all supported languages
@@ -607,6 +610,54 @@ The agent will incorporate the guidance from your reference documents when sugge
607
610
  - `--batch-size`: Override Memgraph flush batch size (defaults to `MEMGRAPH_BATCH_SIZE` in settings)
608
611
  - `--reference-document`: Path to reference documentation (optimization only)
609
612
 
613
+ ### Step 5: Dead Code Detection
614
+
615
+ Once a repository is indexed, report functions and methods that are unreachable
616
+ from any entry point. The walk starts from roots (exported/public symbols,
617
+ tests, decorated handlers like routes/tasks/commands, dunder/lifecycle methods)
618
+ and follows `CALLS` and `REFERENCES` edges; anything it never reaches is listed.
619
+
620
+ ```bash
621
+ # Scan the indexed project (auto-selected when only one exists)
622
+ cgr dead-code
623
+
624
+ # Pick a project when several are indexed
625
+ cgr dead-code --project-name my-project
626
+ ```
627
+
628
+ **Declare framework/external entry points** so the code they reach is not flagged:
629
+
630
+ ```bash
631
+ cgr dead-code -e main -e cli.run --decorator-root celery_app.task
632
+ ```
633
+
634
+ **Exclude generated or vendored code** (noisy with library-invoked callbacks):
635
+
636
+ ```bash
637
+ cgr dead-code --exclude '*client/core*' --exclude '*.gen.*'
638
+ ```
639
+
640
+ **Fail CI when new unreachable code appears**, writing a JSON report:
641
+
642
+ ```bash
643
+ cgr dead-code --format json --output dead-code.json --fail-on-found
644
+ ```
645
+
646
+ > Results are candidates for review, not a guaranteed delete list: code reached
647
+ > only via dynamic dispatch, reflection, or an external framework may still be
648
+ > reported. See the [Dead Code Detection guide](https://docs.code-graph-rag.com/guide/dead-code/) for details.
649
+
650
+ **Dead Code CLI Arguments:**
651
+ - `--project-name`, `-n`: Project to scan (defaults to the sole indexed project)
652
+ - `--entry-point`, `-e`: Treat symbols ending with this qualified name as reachable roots (repeatable)
653
+ - `--decorator-root`: Treat symbols carrying this decorator as roots (repeatable)
654
+ - `--exclude`: Glob matched against a symbol's file path to exclude (repeatable)
655
+ - `--include-tests` / `--no-include-tests`: Treat test code as roots (on by default)
656
+ - `--classes` / `--no-classes`: Also report unreachable classes (off by default)
657
+ - `--format`: `table` (default) or `json`
658
+ - `--output`, `-o`: Write the report to a file instead of stdout
659
+ - `--fail-on-found`: Exit with code 1 when any candidate is found
660
+
610
661
  ## 🔌 MCP Server (Claude Code Integration)
611
662
 
612
663
  Code-Graph-RAG can run as an MCP (Model Context Protocol) server, enabling seamless integration with Claude Code and other MCP clients.
@@ -664,35 +715,38 @@ The knowledge graph uses the following node types and relationships:
664
715
  | Project | `{name: string}` |
665
716
  | Package | `{qualified_name: string, name: string, path: string, absolute_path: string}` |
666
717
  | Folder | `{path: string, name: string, absolute_path: string}` |
667
- | File | `{path: string, name: string, extension: string, absolute_path: string}` |
668
- | Module | `{qualified_name: string, name: string, path: string, absolute_path: string}` |
669
- | Class | `{qualified_name: string, name: string, decorators: list[string], path: string, absolute_path: string}` |
670
- | Function | `{qualified_name: string, name: string, decorators: list[string], path: string, absolute_path: string}` |
671
- | Method | `{qualified_name: string, name: string, decorators: list[string], path: string, absolute_path: string}` |
672
- | Interface | `{qualified_name: string, name: string, path: string, absolute_path: string}` |
673
- | Enum | `{qualified_name: string, name: string, path: string, absolute_path: string}` |
674
- | Type | `{qualified_name: string, name: string}` |
675
- | Union | `{qualified_name: string, name: string}` |
676
- | ModuleInterface | `{qualified_name: string, name: string, path: string, absolute_path: string}` |
677
- | ModuleImplementation | `{qualified_name: string, name: string, path: string, absolute_path: string, implements_module: string}` |
678
- | ExternalPackage | `{name: string, version_spec: string}` |
718
+ | File | `{path: string, name: string, extension: string?, absolute_path: string}` |
719
+ | Module | `{qualified_name: string, name: string, path: string, absolute_path: string, start_line: int?, end_line: int?}` |
720
+ | Class | `{qualified_name: string, name: string, modifiers: list[string], decorators: list[string], path: string, absolute_path: string, start_line: int?, end_line: int?, docstring: string?, is_exported: boolean?}` |
721
+ | Function | `{qualified_name: string, name: string, modifiers: list[string], decorators: list[string], path: string, absolute_path: string, start_line: int?, end_line: int?, docstring: string?, is_exported: boolean?, is_macro: boolean?}` |
722
+ | Method | `{qualified_name: string, name: string, modifiers: list[string], decorators: list[string], path: string, absolute_path: string, start_line: int?, end_line: int?, docstring: string?, is_exported: boolean?, is_property: boolean?, overrides_external: boolean?}` |
723
+ | Interface | `{qualified_name: string, name: string, path: string, absolute_path: string, modifiers: list[string]?, decorators: list[string]?, start_line: int?, end_line: int?, docstring: string?, is_exported: boolean?}` |
724
+ | Enum | `{qualified_name: string, name: string, path: string, absolute_path: string, modifiers: list[string]?, decorators: list[string]?, start_line: int?, end_line: int?, docstring: string?, is_exported: boolean?}` |
725
+ | Type | `{qualified_name: string, name: string, path: string?, absolute_path: string?, modifiers: list[string]?, decorators: list[string]?, start_line: int?, end_line: int?, docstring: string?, is_exported: boolean?}` |
726
+ | Union | `{qualified_name: string, name: string, path: string?, absolute_path: string?, modifiers: list[string]?, decorators: list[string]?, start_line: int?, end_line: int?, docstring: string?, is_exported: boolean?}` |
727
+ | ModuleInterface | `{qualified_name: string, name: string, path: string, absolute_path: string, module_type: string}` |
728
+ | ModuleImplementation | `{qualified_name: string, name: string, path: string, absolute_path: string, implements_module: string, module_type: string}` |
729
+ | ExternalPackage | `{name: string}` |
679
730
  | ExternalModule | `{qualified_name: string, name: string, path: string}` |
731
+ | Resource | `{qualified_name: string, name: string, kind: string}` |
680
732
  <!-- /SECTION:node_schemas -->
681
733
 
682
734
  ### Language-Specific Mappings
683
735
 
684
736
  <!-- SECTION:language_mappings -->
685
737
  - **C**: `enum_specifier`, `function_definition`, `struct_specifier`, `union_specifier`
738
+ - **C#**: `class_declaration`, `constructor_declaration`, `conversion_operator_declaration`, `destructor_declaration`, `enum_declaration`, `interface_declaration`, `local_function_statement`, `method_declaration`, `operator_declaration`, `property_declaration`, `record_declaration`, `struct_declaration`
686
739
  - **C++**: `class_specifier`, `declaration`, `enum_specifier`, `field_declaration`, `function_definition`, `lambda_expression`, `struct_specifier`, `template_declaration`, `union_specifier`
740
+ - **Dart**: `class_definition`, `constant_constructor_signature`, `constructor_signature`, `enum_declaration`, `extension_declaration`, `extension_type_declaration`, `factory_constructor_signature`, `function_signature`, `getter_signature`, `mixin_declaration`, `setter_signature`
741
+ - **Go**: `function_declaration`, `method_declaration`, `type_alias`, `type_spec`
687
742
  - **Java**: `annotation_type_declaration`, `class_declaration`, `constructor_declaration`, `enum_declaration`, `interface_declaration`, `method_declaration`, `record_declaration`
688
743
  - **JavaScript**: `arrow_function`, `class`, `class_declaration`, `function_declaration`, `function_expression`, `generator_function_declaration`, `method_definition`
689
744
  - **Lua**: `function_declaration`, `function_definition`
690
745
  - **PHP**: `anonymous_function`, `arrow_function`, `class_declaration`, `enum_declaration`, `function_definition`, `interface_declaration`, `method_declaration`, `trait_declaration`
691
746
  - **Python**: `class_definition`, `function_definition`
692
- - **Rust**: `closure_expression`, `enum_item`, `function_item`, `function_signature_item`, `impl_item`, `struct_item`, `trait_item`, `type_item`, `union_item`
747
+ - **Rust**: `closure_expression`, `enum_item`, `function_item`, `function_signature_item`, `impl_item`, `macro_definition`, `struct_item`, `trait_item`, `type_item`, `union_item`
693
748
  - **TypeScript (TSX)**: `abstract_class_declaration`, `arrow_function`, `class`, `class_declaration`, `enum_declaration`, `function_declaration`, `function_expression`, `function_signature`, `generator_function_declaration`, `interface_declaration`, `internal_module`, `method_definition`, `type_alias_declaration`
694
749
  - **TypeScript**: `abstract_class_declaration`, `arrow_function`, `class`, `class_declaration`, `enum_declaration`, `function_declaration`, `function_expression`, `function_signature`, `generator_function_declaration`, `interface_declaration`, `internal_module`, `method_definition`, `type_alias_declaration`
695
- - **Go**: `function_declaration`, `method_declaration`, `type_alias`, `type_spec`
696
750
  - **Scala**: `class_definition`, `function_declaration`, `function_definition`, `object_definition`, `trait_definition`
697
751
  <!-- /SECTION:language_mappings -->
698
752
 
@@ -705,20 +759,23 @@ The knowledge graph uses the following node types and relationships:
705
759
  | Project, Package, Folder | CONTAINS_FOLDER | Folder |
706
760
  | Project, Package, Folder | CONTAINS_FILE | File |
707
761
  | Project, Package, Folder | CONTAINS_MODULE | Module |
708
- | Module | DEFINES | Class, Function |
709
- | Class | DEFINES_METHOD | Method |
762
+ | Module, Function, Method, Class | DEFINES | Class, Function, Method, Enum, Interface, Type, Union, Module |
763
+ | Class, Interface, Enum, Type, Union | DEFINES_METHOD | Method |
710
764
  | Module | IMPORTS | Module, ExternalModule |
711
765
  | Module | EXPORTS | Class, Function |
712
766
  | Module | EXPORTS_MODULE | ModuleInterface |
713
767
  | Module | IMPLEMENTS_MODULE | ModuleImplementation |
714
- | Class | INHERITS | Class |
715
- | Class | IMPLEMENTS | Interface |
716
- | Method | OVERRIDES | Method |
768
+ | Class, Interface, Function | INHERITS | Class, Interface, Function, ExternalModule |
769
+ | Class, Enum | IMPLEMENTS | Interface, Class, Enum, ExternalModule |
770
+ | Method, Function | OVERRIDES | Method |
717
771
  | ModuleImplementation | IMPLEMENTS | ModuleInterface |
718
772
  | Project | DEPENDS_ON_EXTERNAL | ExternalPackage |
719
- | Function, Method | CALLS | Function, Method |
773
+ | Module, Function, Method | CALLS | Function, Method, Enum, Type |
720
774
  | Module, Function, Method | REFERENCES | Function, Method, Class |
721
775
  | Module, Function, Method | INSTANTIATES | Class |
776
+ | Module, Function, Method | READS_FROM | Resource |
777
+ | Module, Function, Method | WRITES_TO | Resource |
778
+ | Module, Function, Method, Resource | FLOWS_TO | Module, Function, Method, Resource |
722
779
  <!-- /SECTION:relationship_schemas -->
723
780
 
724
781
  ## 🔧 Configuration
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-graph-rag
3
- Version: 0.0.245
3
+ Version: 0.0.345
4
4
  Summary: The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs
5
5
  License-Expression: MIT
6
6
  Keywords: rag,retrieval-augmented-generation,knowledge-graph,code-analysis,tree-sitter,mcp,mcp-server,llm,graph-database,semantic-search,codebase,memgraph,developer-tools,monorepo
@@ -46,6 +46,7 @@ Requires-Dist: pytest-cov>=4.0.0; extra == "test"
46
46
  Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
47
47
  Requires-Dist: testcontainers>=4.9.0; extra == "test"
48
48
  Requires-Dist: libclang>=18.1.1; extra == "test"
49
+ Requires-Dist: filelock>=3.12; extra == "test"
49
50
  Provides-Extra: treesitter-full
50
51
  Requires-Dist: tree-sitter-python>=0.23.6; extra == "treesitter-full"
51
52
  Requires-Dist: tree-sitter-javascript>=0.23.1; extra == "treesitter-full"
@@ -58,6 +59,8 @@ Requires-Dist: tree-sitter-c>=0.24.1; extra == "treesitter-full"
58
59
  Requires-Dist: tree-sitter-cpp>=0.23.0; extra == "treesitter-full"
59
60
  Requires-Dist: tree-sitter-lua>=0.0.19; extra == "treesitter-full"
60
61
  Requires-Dist: tree-sitter-php>=0.24.1; extra == "treesitter-full"
62
+ Requires-Dist: tree-sitter-c-sharp>=0.23.5; extra == "treesitter-full"
63
+ Requires-Dist: tree-sitter-dart>=0.1.0; extra == "treesitter-full"
61
64
  Provides-Extra: semantic
62
65
  Requires-Dist: qdrant-client>=1.9.0; extra == "semantic"
63
66
  Requires-Dist: torch>=2.6.0; extra == "semantic"
@@ -123,6 +126,17 @@ cgr export -o graph.json
123
126
  cgr optimize python --repo-path ./my-project
124
127
  ```
125
128
 
129
+ **Find dead code (functions unreachable from any entry point):**
130
+
131
+ ```bash
132
+ cgr dead-code # scan the indexed project
133
+ cgr dead-code -e main --exclude '*.gen.*' # add roots, skip generated code
134
+ cgr dead-code --format json --fail-on-found # CI-friendly report
135
+ ```
136
+
137
+ Results are candidates for review, not a guaranteed delete list. See the
138
+ [Dead Code Detection guide](https://docs.code-graph-rag.com/guide/dead-code/).
139
+
126
140
  **Run as an MCP server (for Claude Code):**
127
141
 
128
142
  ```bash
@@ -10,22 +10,25 @@ code_graph_rag.egg-info/entry_points.txt
10
10
  code_graph_rag.egg-info/requires.txt
11
11
  code_graph_rag.egg-info/top_level.txt
12
12
  codebase_rag/__init__.py
13
+ codebase_rag/capture.py
13
14
  codebase_rag/cgr_state.py
14
15
  codebase_rag/cli.py
15
16
  codebase_rag/cli_help.py
16
17
  codebase_rag/config.py
17
- codebase_rag/constants.py
18
18
  codebase_rag/cypher_queries.py
19
+ codebase_rag/dead_code.py
19
20
  codebase_rag/decorators.py
20
21
  codebase_rag/docker-compose.yaml
21
22
  codebase_rag/embedder.py
22
23
  codebase_rag/exceptions.py
24
+ codebase_rag/graph_audit.py
23
25
  codebase_rag/graph_loader.py
24
26
  codebase_rag/graph_updater.py
25
27
  codebase_rag/language_spec.py
26
28
  codebase_rag/logs.py
27
29
  codebase_rag/main.py
28
30
  codebase_rag/models.py
31
+ codebase_rag/parser_fingerprint.py
29
32
  codebase_rag/parser_loader.py
30
33
  codebase_rag/prompts.py
31
34
  codebase_rag/readme_sections.py
@@ -35,6 +38,33 @@ codebase_rag/tool_errors.py
35
38
  codebase_rag/types_defs.py
36
39
  codebase_rag/unixcoder.py
37
40
  codebase_rag/vector_store.py
41
+ codebase_rag/constants/__init__.py
42
+ codebase_rag/constants/ast_cpp.py
43
+ codebase_rag/constants/ast_csharp.py
44
+ codebase_rag/constants/ast_dart.py
45
+ codebase_rag/constants/ast_go.py
46
+ codebase_rag/constants/ast_java.py
47
+ codebase_rag/constants/ast_js.py
48
+ codebase_rag/constants/ast_lua.py
49
+ codebase_rag/constants/ast_nodes.py
50
+ codebase_rag/constants/ast_php.py
51
+ codebase_rag/constants/ast_python.py
52
+ codebase_rag/constants/ast_rust.py
53
+ codebase_rag/constants/ast_scala.py
54
+ codebase_rag/constants/build.py
55
+ codebase_rag/constants/cli.py
56
+ codebase_rag/constants/core.py
57
+ codebase_rag/constants/deadcode_roots.py
58
+ codebase_rag/constants/deps.py
59
+ codebase_rag/constants/fqn_specs.py
60
+ codebase_rag/constants/graph.py
61
+ codebase_rag/constants/health.py
62
+ codebase_rag/constants/lang_tooling.py
63
+ codebase_rag/constants/languages.py
64
+ codebase_rag/constants/mcp.py
65
+ codebase_rag/constants/providers.py
66
+ codebase_rag/constants/security.py
67
+ codebase_rag/constants/stdlib_types.py
38
68
  codebase_rag/mcp/__init__.py
39
69
  codebase_rag/mcp/client.py
40
70
  codebase_rag/mcp/server.py
@@ -63,12 +93,21 @@ codebase_rag/parsers/class_ingest/parent_extraction.py
63
93
  codebase_rag/parsers/class_ingest/relationships.py
64
94
  codebase_rag/parsers/class_ingest/utils.py
65
95
  codebase_rag/parsers/cpp/__init__.py
96
+ codebase_rag/parsers/cpp/preproc_recovery.py
66
97
  codebase_rag/parsers/cpp/type_inference.py
67
98
  codebase_rag/parsers/cpp/utils.py
68
99
  codebase_rag/parsers/cpp_frontend/__init__.py
69
100
  codebase_rag/parsers/cpp_frontend/constants.py
70
101
  codebase_rag/parsers/cpp_frontend/frontend.py
71
102
  codebase_rag/parsers/cpp_frontend/qn.py
103
+ codebase_rag/parsers/csharp/__init__.py
104
+ codebase_rag/parsers/csharp/type_inference.py
105
+ codebase_rag/parsers/csharp/utils.py
106
+ codebase_rag/parsers/dart/__init__.py
107
+ codebase_rag/parsers/dart/utils.py
108
+ codebase_rag/parsers/flow_access/__init__.py
109
+ codebase_rag/parsers/flow_access/constants.py
110
+ codebase_rag/parsers/flow_access/processor.py
72
111
  codebase_rag/parsers/go/__init__.py
73
112
  codebase_rag/parsers/go/module_paths.py
74
113
  codebase_rag/parsers/go/type_inference.py
@@ -84,6 +123,13 @@ codebase_rag/parsers/handlers/protocol.py
84
123
  codebase_rag/parsers/handlers/python.py
85
124
  codebase_rag/parsers/handlers/registry.py
86
125
  codebase_rag/parsers/handlers/rust.py
126
+ codebase_rag/parsers/io_access/__init__.py
127
+ codebase_rag/parsers/io_access/constants.py
128
+ codebase_rag/parsers/io_access/descriptor.py
129
+ codebase_rag/parsers/io_access/extract.py
130
+ codebase_rag/parsers/io_access/models.py
131
+ codebase_rag/parsers/io_access/processor.py
132
+ codebase_rag/parsers/io_access/registry.py
87
133
  codebase_rag/parsers/java/__init__.py
88
134
  codebase_rag/parsers/java/method_resolver.py
89
135
  codebase_rag/parsers/java/type_inference.py
@@ -112,6 +158,7 @@ codebase_rag/providers/base.py
112
158
  codebase_rag/providers/litellm.py
113
159
  codebase_rag/services/__init__.py
114
160
  codebase_rag/services/anthropic_token_counter.py
161
+ codebase_rag/services/filtering.py
115
162
  codebase_rag/services/graph_service.py
116
163
  codebase_rag/services/llm.py
117
164
  codebase_rag/services/protobuf_service.py
@@ -32,6 +32,7 @@ pytest-cov>=4.0.0
32
32
  pytest-xdist>=3.8.0
33
33
  testcontainers>=4.9.0
34
34
  libclang>=18.1.1
35
+ filelock>=3.12
35
36
 
36
37
  [treesitter-full]
37
38
  tree-sitter-python>=0.23.6
@@ -45,3 +46,5 @@ tree-sitter-c>=0.24.1
45
46
  tree-sitter-cpp>=0.23.0
46
47
  tree-sitter-lua>=0.0.19
47
48
  tree-sitter-php>=0.24.1
49
+ tree-sitter-c-sharp>=0.23.5
50
+ tree-sitter-dart>=0.1.0
@@ -0,0 +1,137 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Iterable
4
+ from dataclasses import dataclass
5
+
6
+ from loguru import logger
7
+
8
+ from . import constants as cs
9
+ from . import logs as ls
10
+
11
+ # (H) Relationships that are usually meaningless without a companion still
12
+ # (H) enabled. Dropping the companion is obeyed, but warned about.
13
+ _SOFT_DEPENDENCIES: dict[cs.RelationshipType, cs.RelationshipType] = {
14
+ cs.RelationshipType.OVERRIDES: cs.RelationshipType.INHERITS,
15
+ }
16
+
17
+
18
+ @dataclass(frozen=True)
19
+ class CaptureSelection:
20
+ enabled_rels: frozenset[cs.RelationshipType]
21
+ enabled_node_labels: frozenset[cs.NodeLabel]
22
+
23
+ def rel_enabled(self, rel: cs.RelationshipType) -> bool:
24
+ return rel in self.enabled_rels
25
+
26
+ def node_enabled(self, label: cs.NodeLabel) -> bool:
27
+ return label in self.enabled_node_labels
28
+
29
+ @property
30
+ def io_enabled(self) -> bool:
31
+ return (
32
+ cs.RelationshipType.READS_FROM in self.enabled_rels
33
+ or cs.RelationshipType.WRITES_TO in self.enabled_rels
34
+ )
35
+
36
+
37
+ def _node_labels_for(
38
+ enabled_rels: frozenset[cs.RelationshipType],
39
+ ) -> frozenset[cs.NodeLabel]:
40
+ owner_of: dict[cs.NodeLabel, cs.CaptureGroup] = {
41
+ label: group
42
+ for group, labels in cs.CAPTURE_GROUP_NODE_LABELS.items()
43
+ for label in labels
44
+ }
45
+ enabled: set[cs.NodeLabel] = set()
46
+ for label in cs.NodeLabel:
47
+ owner = owner_of.get(label)
48
+ if owner is None or cs.CAPTURE_GROUP_RELS[owner] & enabled_rels:
49
+ enabled.add(label)
50
+ return frozenset(enabled)
51
+
52
+
53
+ def _selection_for(
54
+ enabled_rels: frozenset[cs.RelationshipType],
55
+ ) -> CaptureSelection:
56
+ for rel, companion in _SOFT_DEPENDENCIES.items():
57
+ if rel in enabled_rels and companion not in enabled_rels:
58
+ logger.warning(ls.CAPTURE_DEPENDENCY_GAP.format(rel=rel, missing=companion))
59
+ return CaptureSelection(
60
+ enabled_rels=enabled_rels,
61
+ enabled_node_labels=_node_labels_for(enabled_rels),
62
+ )
63
+
64
+
65
+ _ALL_RELS: frozenset[cs.RelationshipType] = frozenset(cs.RelationshipType)
66
+
67
+ ALL_ENABLED = _selection_for(_ALL_RELS)
68
+
69
+
70
+ def _resolve_token(token: str) -> frozenset[cs.RelationshipType] | None:
71
+ try:
72
+ return cs.CAPTURE_GROUP_RELS[cs.CaptureGroup(token.lower())]
73
+ except ValueError:
74
+ pass
75
+ try:
76
+ return frozenset({cs.RelationshipType(token.upper())})
77
+ except ValueError:
78
+ return None
79
+
80
+
81
+ def _base_rels(groups: Iterable[cs.CaptureGroup]) -> set[cs.RelationshipType]:
82
+ enabled: set[cs.RelationshipType] = set()
83
+ for group in groups:
84
+ enabled |= cs.CAPTURE_GROUP_RELS[group]
85
+ return enabled
86
+
87
+
88
+ def resolve_capture(tokens: Iterable[str]) -> CaptureSelection:
89
+ # (H) Tokens apply left-to-right so later ones win: a `none`/`all` base
90
+ # (H) clears everything before it, and group/rel add-drops after a base
91
+ # (H) survive. This makes `--capture none` override an inherited
92
+ # (H) `CGR_CAPTURE=io`, not just re-add whichever groups the set held.
93
+ enabled = _base_rels(cs.DEFAULT_CAPTURE_GROUPS)
94
+ for token in tokens:
95
+ token = token.strip()
96
+ if not token:
97
+ continue
98
+ low = token.lower()
99
+ if low == cs.CAPTURE_TOKEN_NONE:
100
+ enabled = set()
101
+ continue
102
+ if low == cs.CAPTURE_TOKEN_ALL:
103
+ enabled = set(_ALL_RELS)
104
+ continue
105
+ drop = token.startswith(cs.CAPTURE_DROP_PREFIX)
106
+ name = token.lstrip(cs.CAPTURE_DROP_PREFIX + cs.CAPTURE_ADD_PREFIX)
107
+ rels = _resolve_token(name)
108
+ if rels is None:
109
+ logger.warning(ls.CAPTURE_UNKNOWN_TOKEN.format(token=token))
110
+ continue
111
+ if drop:
112
+ enabled -= rels
113
+ else:
114
+ enabled |= rels
115
+
116
+ return _selection_for(frozenset(enabled))
117
+
118
+
119
+ def split_spec(spec: str) -> list[str]:
120
+ out: list[str] = []
121
+ token = ""
122
+ for ch in spec:
123
+ if ch in cs.CAPTURE_TOKEN_SEPARATORS:
124
+ if token:
125
+ out.append(token)
126
+ token = ""
127
+ else:
128
+ token += ch
129
+ if token:
130
+ out.append(token)
131
+ return out
132
+
133
+
134
+ def default_capture() -> CaptureSelection:
135
+ from .config import settings
136
+
137
+ return resolve_capture(split_spec(settings.CGR_CAPTURE))