code-graph-rag 0.0.187__tar.gz → 0.0.209__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.
- {code_graph_rag-0.0.187/code_graph_rag.egg-info → code_graph_rag-0.0.209}/PKG-INFO +3 -2
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/PYPI_README.md +1 -1
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/README.md +21 -15
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209/code_graph_rag.egg-info}/PKG-INFO +3 -2
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/code_graph_rag.egg-info/SOURCES.txt +4 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/code_graph_rag.egg-info/requires.txt +1 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/constants.py +193 -7
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/cypher_queries.py +49 -8
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/graph_updater.py +236 -11
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/logs.py +3 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/main.py +2 -2
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/mcp/tools.py +2 -2
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/call_processor.py +944 -43
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/call_resolver.py +283 -9
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/class_ingest/identity.py +12 -5
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/class_ingest/mixin.py +146 -6
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/class_ingest/relationships.py +18 -2
- code_graph_rag-0.0.209/codebase_rag/parsers/cpp/__init__.py +5 -0
- code_graph_rag-0.0.209/codebase_rag/parsers/cpp/type_inference.py +272 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/cpp_frontend/frontend.py +20 -3
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/definition_processor.py +26 -0
- code_graph_rag-0.0.209/codebase_rag/parsers/export_detection.py +160 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/factory.py +4 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/function_ingest.py +14 -6
- code_graph_rag-0.0.209/codebase_rag/parsers/go/__init__.py +13 -0
- code_graph_rag-0.0.209/codebase_rag/parsers/go/type_inference.py +101 -0
- code_graph_rag-0.0.209/codebase_rag/parsers/go/utils.py +63 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/import_processor.py +218 -5
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/java/method_resolver.py +33 -1
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/java/type_inference.py +14 -10
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/java/type_resolver.py +26 -1
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/py/ast_analyzer.py +0 -14
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/py/expression_analyzer.py +20 -4
- code_graph_rag-0.0.209/codebase_rag/parsers/python_source_roots.py +150 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/type_inference.py +78 -0
- code_graph_rag-0.0.209/codebase_rag/parsers/utils.py +706 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/services/protobuf_service.py +1 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/tools/health_checker.py +1 -1
- code_graph_rag-0.0.209/codebase_rag/tools/semantic_search.py +162 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/types_defs.py +10 -1
- code_graph_rag-0.0.209/codebase_rag/utils/path_utils.py +125 -0
- code_graph_rag-0.0.209/codec/schema_pb2.py +75 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codec/schema_pb2.pyi +82 -98
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/pyproject.toml +2 -1
- code_graph_rag-0.0.187/codebase_rag/parsers/go/__init__.py +0 -6
- code_graph_rag-0.0.187/codebase_rag/parsers/go/utils.py +0 -36
- code_graph_rag-0.0.187/codebase_rag/parsers/utils.py +0 -350
- code_graph_rag-0.0.187/codebase_rag/tools/semantic_search.py +0 -164
- code_graph_rag-0.0.187/codebase_rag/utils/path_utils.py +0 -87
- code_graph_rag-0.0.187/codec/__init__.py +0 -0
- code_graph_rag-0.0.187/codec/schema_pb2.py +0 -62
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/LICENSE +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/cgr/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/code_graph_rag.egg-info/dependency_links.txt +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/code_graph_rag.egg-info/entry_points.txt +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/code_graph_rag.egg-info/top_level.txt +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/cgr_state.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/cli.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/cli_help.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/config.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/decorators.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/docker-compose.yaml +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/embedder.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/exceptions.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/graph_loader.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/language_spec.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/mcp/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/mcp/client.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/mcp/server.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/models.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parser_loader.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/class_ingest/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/class_ingest/cpp_modules.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/class_ingest/method_override.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/class_ingest/node_type.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/class_ingest/parent_extraction.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/class_ingest/utils.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/cpp/utils.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/cpp_frontend/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/cpp_frontend/constants.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/cpp_frontend/qn.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/dependency_parser.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/handlers/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/handlers/base.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/handlers/cpp.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/handlers/java.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/handlers/js_ts.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/handlers/lua.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/handlers/php.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/handlers/protocol.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/handlers/python.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/handlers/registry.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/handlers/rust.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/java/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/java/utils.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/java/variable_analyzer.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/js_ts/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/js_ts/ingest.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/js_ts/module_system.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/js_ts/type_inference.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/js_ts/utils.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/lua/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/lua/type_inference.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/lua/utils.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/py/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/py/type_inference.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/py/utils.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/py/variable_analyzer.py +0 -0
- {code_graph_rag-0.0.187/codebase_rag/parsers/cpp → code_graph_rag-0.0.209/codebase_rag/parsers/rs}/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/rs/utils.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/stdlib_extractor.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/parsers/structure_processor.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/prompts.py +0 -0
- {code_graph_rag-0.0.187/codebase_rag/parsers/rs → code_graph_rag-0.0.209/codebase_rag/providers}/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/providers/base.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/providers/litellm.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/readme_sections.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/schema_builder.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/schemas.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/services/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/services/anthropic_token_counter.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/services/graph_service.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/services/llm.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/stack/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/stack/cli.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/stack/constants.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/stack/health.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/stack/manager.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/tool_errors.py +0 -0
- {code_graph_rag-0.0.187/codebase_rag/providers → code_graph_rag-0.0.209/codebase_rag/tools}/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/tools/code_retrieval.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/tools/codebase_query.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/tools/directory_lister.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/tools/file_editor.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/tools/file_reader.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/tools/file_writer.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/tools/language.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/tools/shell_command.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/tools/tool_descriptions.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/unixcoder.py +0 -0
- {code_graph_rag-0.0.187/codebase_rag/tools → code_graph_rag-0.0.209/codebase_rag/utils}/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/utils/dependencies.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/utils/fqn_resolver.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/utils/rich_markdown.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/utils/source_extraction.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/utils/token_utils.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/vector_store.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/workspaces/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/workspaces/cli.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/workspaces/constants.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/workspaces/models.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/codebase_rag/workspaces/storage.py +0 -0
- {code_graph_rag-0.0.187/codebase_rag/utils → code_graph_rag-0.0.209/codec}/__init__.py +0 -0
- {code_graph_rag-0.0.187 → code_graph_rag-0.0.209}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code-graph-rag
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.209
|
|
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
|
|
@@ -38,6 +38,7 @@ Requires-Dist: protobuf>=6.33.5
|
|
|
38
38
|
Requires-Dist: defusedxml>=0.7.1
|
|
39
39
|
Requires-Dist: huggingface-hub[hf-xet]>=1.7.2
|
|
40
40
|
Requires-Dist: griffe<2,>=1.0
|
|
41
|
+
Requires-Dist: pathspec>=1.0.4
|
|
41
42
|
Provides-Extra: test
|
|
42
43
|
Requires-Dist: pytest>=8.4.1; extra == "test"
|
|
43
44
|
Requires-Dist: pytest-asyncio>=1.0.0; extra == "test"
|
|
@@ -99,7 +100,7 @@ The package installs a `cgr` command.
|
|
|
99
100
|
**Start Memgraph, parse a repo, and query it:**
|
|
100
101
|
|
|
101
102
|
```bash
|
|
102
|
-
|
|
103
|
+
cgr daemon up # start Memgraph + Qdrant
|
|
103
104
|
cgr start --repo-path ./my-project \
|
|
104
105
|
--update-graph --clean # parse & launch interactive chat
|
|
105
106
|
```
|
|
@@ -34,7 +34,7 @@ The package installs a `cgr` command.
|
|
|
34
34
|
**Start Memgraph, parse a repo, and query it:**
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
|
|
37
|
+
cgr daemon up # start Memgraph + Qdrant
|
|
38
38
|
cgr start --repo-path ./my-project \
|
|
39
39
|
--update-graph --clean # parse & launch interactive chat
|
|
40
40
|
```
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<img src="https://img.shields.io/github/forks/vitali87/code-graph-rag?style=social" alt="GitHub forks" />
|
|
21
21
|
</a>
|
|
22
22
|
-->
|
|
23
|
-
<!-- Codecov, SonarCloud, and OpenSSF Scorecard badges
|
|
23
|
+
<!-- Codecov, SonarCloud, and OpenSSF Scorecard badges are fed by GitHub-side CI. Uncomment once that CI is confirmed to publish to these services again.
|
|
24
24
|
<a href="https://codecov.io/gh/vitali87/code-graph-rag">
|
|
25
25
|
<img src="https://codecov.io/gh/vitali87/code-graph-rag/graph/badge.svg" alt="Codecov" />
|
|
26
26
|
</a>
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
<a href="https://pepy.tech/projects/code-graph-rag">
|
|
40
40
|
<img src="https://static.pepy.tech/personalized-badge/code-graph-rag?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads" alt="PyPI Downloads" />
|
|
41
41
|
</a>
|
|
42
|
-
<!-- OpenSSF Scorecard only tracks GitHub-hosted repos.
|
|
42
|
+
<!-- OpenSSF Scorecard only tracks GitHub-hosted repos. Uncomment once the Scorecard workflow is confirmed running on the authoritative GitHub repo.
|
|
43
43
|
<a href="https://scorecard.dev/viewer/?uri=github.com/vitali87/code-graph-rag">
|
|
44
44
|
<img src="https://api.scorecard.dev/projects/github.com/vitali87/code-graph-rag/badge" alt="OpenSSF Scorecard" />
|
|
45
45
|
</a>
|
|
@@ -187,7 +187,7 @@ volumes (`memgraph_data`, `memgraph_log`, `qdrant_storage`).
|
|
|
187
187
|
### Local development install
|
|
188
188
|
|
|
189
189
|
```bash
|
|
190
|
-
git clone https://
|
|
190
|
+
git clone https://github.com/vitali87/code-graph-rag.git
|
|
191
191
|
cd code-graph-rag
|
|
192
192
|
```
|
|
193
193
|
|
|
@@ -292,7 +292,7 @@ ollama pull llama3.2
|
|
|
292
292
|
|
|
293
293
|
4. **Start Memgraph database**:
|
|
294
294
|
```bash
|
|
295
|
-
|
|
295
|
+
cgr daemon up
|
|
296
296
|
```
|
|
297
297
|
|
|
298
298
|
5. **Verify installation**:
|
|
@@ -331,6 +331,7 @@ Use the Makefile for common development tasks:
|
|
|
331
331
|
| `make format` | Run ruff format |
|
|
332
332
|
| `make typecheck` | Run type checking with ty |
|
|
333
333
|
| `make check` | Run all checks: lint, typecheck, test |
|
|
334
|
+
| `make release` | Build, verify, and publish the current pyproject version to PyPI, then tag and create a GitHub Release |
|
|
334
335
|
| `make pre-commit` | Run all pre-commit checks locally (comprehensive test before commit) |
|
|
335
336
|
<!-- /SECTION:makefile_commands -->
|
|
336
337
|
|
|
@@ -674,6 +675,7 @@ The knowledge graph uses the following node types and relationships:
|
|
|
674
675
|
| ModuleInterface | `{qualified_name: string, name: string, path: string, absolute_path: string}` |
|
|
675
676
|
| ModuleImplementation | `{qualified_name: string, name: string, path: string, absolute_path: string, implements_module: string}` |
|
|
676
677
|
| ExternalPackage | `{name: string, version_spec: string}` |
|
|
678
|
+
| ExternalModule | `{qualified_name: string, name: string, path: string}` |
|
|
677
679
|
<!-- /SECTION:node_schemas -->
|
|
678
680
|
|
|
679
681
|
### Language-Specific Mappings
|
|
@@ -703,7 +705,7 @@ The knowledge graph uses the following node types and relationships:
|
|
|
703
705
|
| Project, Package, Folder | CONTAINS_MODULE | Module |
|
|
704
706
|
| Module | DEFINES | Class, Function |
|
|
705
707
|
| Class | DEFINES_METHOD | Method |
|
|
706
|
-
| Module | IMPORTS | Module |
|
|
708
|
+
| Module | IMPORTS | Module, ExternalModule |
|
|
707
709
|
| Module | EXPORTS | Class, Function |
|
|
708
710
|
| Module | EXPORTS_MODULE | ModuleInterface |
|
|
709
711
|
| Module | IMPLEMENTS_MODULE | ModuleImplementation |
|
|
@@ -713,6 +715,8 @@ The knowledge graph uses the following node types and relationships:
|
|
|
713
715
|
| ModuleImplementation | IMPLEMENTS | ModuleInterface |
|
|
714
716
|
| Project | DEPENDS_ON_EXTERNAL | ExternalPackage |
|
|
715
717
|
| Function, Method | CALLS | Function, Method |
|
|
718
|
+
| Module, Function, Method | REFERENCES | Function, Method |
|
|
719
|
+
| Module, Function, Method | INSTANTIATES | Class |
|
|
716
720
|
<!-- /SECTION:relationship_schemas -->
|
|
717
721
|
|
|
718
722
|
## 🔧 Configuration
|
|
@@ -754,27 +758,28 @@ Configuration is managed through environment variables in `.env` file:
|
|
|
754
758
|
|
|
755
759
|
### Custom Ignore Patterns
|
|
756
760
|
|
|
757
|
-
You can specify additional directories to exclude by creating a `.cgrignore` file in your repository root:
|
|
761
|
+
You can specify additional files and directories to exclude by creating a `.cgrignore` file in your repository root. Patterns follow `.gitignore` conventions:
|
|
758
762
|
|
|
759
763
|
```
|
|
760
764
|
# Comments start with #
|
|
761
765
|
vendor
|
|
762
|
-
.
|
|
763
|
-
|
|
766
|
+
*.gen.ts
|
|
767
|
+
docs/*.md
|
|
768
|
+
/generated
|
|
769
|
+
!bin/keep.py
|
|
764
770
|
```
|
|
765
771
|
|
|
766
|
-
-
|
|
767
|
-
- Lines starting with
|
|
768
|
-
-
|
|
769
|
-
- Patterns are
|
|
770
|
-
- Patterns from `.cgrignore` are merged with `--exclude` flags and auto-detected directories
|
|
772
|
+
- Gitignore syntax: `*` matches within a segment, `**` crosses segments, bare names match at any depth, slash-containing patterns are anchored to the root, trailing slash matches directories only
|
|
773
|
+
- Lines starting with `!` un-ignore paths that a default exclusion would skip (explicit excludes always win)
|
|
774
|
+
- Lines starting with `#` are comments; blank lines are ignored
|
|
775
|
+
- Patterns from `.cgrignore` are merged with `--exclude` flags (same syntax) and auto-detected directories
|
|
771
776
|
|
|
772
777
|
### Key Dependencies
|
|
773
778
|
|
|
774
779
|
<!-- SECTION:dependencies -->
|
|
775
780
|
- **loguru**: Python logging made (stupidly) simple
|
|
776
781
|
- **mcp**: Model Context Protocol SDK
|
|
777
|
-
- **pydantic-ai**: Agent Framework
|
|
782
|
+
- **pydantic-ai**: AI Agent Framework, the Pydantic way
|
|
778
783
|
- **pydantic-settings**: Settings management using Pydantic
|
|
779
784
|
- **pymgclient**: Memgraph database adapter for Python language
|
|
780
785
|
- **python-dotenv**: Read key-value pairs from a .env file and set them as environment variables
|
|
@@ -792,6 +797,7 @@ my_build_output
|
|
|
792
797
|
- **defusedxml**: XML bomb protection for Python stdlib modules
|
|
793
798
|
- **huggingface-hub**: Client library to download and publish models, datasets and other repos on the huggingface.co hub
|
|
794
799
|
- **griffe**: Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API.
|
|
800
|
+
- **pathspec**: Utility library for gitignore style pattern matching of file paths.
|
|
795
801
|
<!-- /SECTION:dependencies -->
|
|
796
802
|
|
|
797
803
|
## 🤖 Agentic Workflow & Tools
|
|
@@ -835,7 +841,7 @@ Code-Graph-RAG makes it easy to add support for any language that has a Tree-sit
|
|
|
835
841
|
|
|
836
842
|
> **⚠️ Recommendation**: While you can add languages yourself, we recommend waiting for official full support to ensure optimal parsing quality, comprehensive feature coverage, and robust integration. The languages marked as "In Development" above will receive dedicated optimization and testing.
|
|
837
843
|
|
|
838
|
-
> **💡 Request Support**: If you want a specific language to be officially supported, please [submit an issue](https://
|
|
844
|
+
> **💡 Request Support**: If you want a specific language to be officially supported, please [submit an issue](https://github.com/vitali87/code-graph-rag/issues) with your language request.
|
|
839
845
|
|
|
840
846
|
#### Quick Start: Add a Language
|
|
841
847
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code-graph-rag
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.209
|
|
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
|
|
@@ -38,6 +38,7 @@ Requires-Dist: protobuf>=6.33.5
|
|
|
38
38
|
Requires-Dist: defusedxml>=0.7.1
|
|
39
39
|
Requires-Dist: huggingface-hub[hf-xet]>=1.7.2
|
|
40
40
|
Requires-Dist: griffe<2,>=1.0
|
|
41
|
+
Requires-Dist: pathspec>=1.0.4
|
|
41
42
|
Provides-Extra: test
|
|
42
43
|
Requires-Dist: pytest>=8.4.1; extra == "test"
|
|
43
44
|
Requires-Dist: pytest-asyncio>=1.0.0; extra == "test"
|
|
@@ -99,7 +100,7 @@ The package installs a `cgr` command.
|
|
|
99
100
|
**Start Memgraph, parse a repo, and query it:**
|
|
100
101
|
|
|
101
102
|
```bash
|
|
102
|
-
|
|
103
|
+
cgr daemon up # start Memgraph + Qdrant
|
|
103
104
|
cgr start --repo-path ./my-project \
|
|
104
105
|
--update-graph --clean # parse & launch interactive chat
|
|
105
106
|
```
|
|
@@ -44,9 +44,11 @@ codebase_rag/parsers/call_processor.py
|
|
|
44
44
|
codebase_rag/parsers/call_resolver.py
|
|
45
45
|
codebase_rag/parsers/definition_processor.py
|
|
46
46
|
codebase_rag/parsers/dependency_parser.py
|
|
47
|
+
codebase_rag/parsers/export_detection.py
|
|
47
48
|
codebase_rag/parsers/factory.py
|
|
48
49
|
codebase_rag/parsers/function_ingest.py
|
|
49
50
|
codebase_rag/parsers/import_processor.py
|
|
51
|
+
codebase_rag/parsers/python_source_roots.py
|
|
50
52
|
codebase_rag/parsers/stdlib_extractor.py
|
|
51
53
|
codebase_rag/parsers/structure_processor.py
|
|
52
54
|
codebase_rag/parsers/type_inference.py
|
|
@@ -61,12 +63,14 @@ codebase_rag/parsers/class_ingest/parent_extraction.py
|
|
|
61
63
|
codebase_rag/parsers/class_ingest/relationships.py
|
|
62
64
|
codebase_rag/parsers/class_ingest/utils.py
|
|
63
65
|
codebase_rag/parsers/cpp/__init__.py
|
|
66
|
+
codebase_rag/parsers/cpp/type_inference.py
|
|
64
67
|
codebase_rag/parsers/cpp/utils.py
|
|
65
68
|
codebase_rag/parsers/cpp_frontend/__init__.py
|
|
66
69
|
codebase_rag/parsers/cpp_frontend/constants.py
|
|
67
70
|
codebase_rag/parsers/cpp_frontend/frontend.py
|
|
68
71
|
codebase_rag/parsers/cpp_frontend/qn.py
|
|
69
72
|
codebase_rag/parsers/go/__init__.py
|
|
73
|
+
codebase_rag/parsers/go/type_inference.py
|
|
70
74
|
codebase_rag/parsers/go/utils.py
|
|
71
75
|
codebase_rag/parsers/handlers/__init__.py
|
|
72
76
|
codebase_rag/parsers/handlers/base.py
|
|
@@ -185,6 +185,7 @@ KEY_EXPORTED_AT = "exported_at"
|
|
|
185
185
|
KEY_PARSER = "parser"
|
|
186
186
|
KEY_NAME = "name"
|
|
187
187
|
KEY_QUALIFIED_NAME = "qualified_name"
|
|
188
|
+
KEY_IS_PROPERTY = "is_property"
|
|
188
189
|
KEY_QUERY = "query"
|
|
189
190
|
KEY_RESPONSE = "response"
|
|
190
191
|
KEY_START_LINE = "start_line"
|
|
@@ -201,7 +202,6 @@ KEY_TO_VAL = "to_val"
|
|
|
201
202
|
KEY_VERSION_SPEC = "version_spec"
|
|
202
203
|
KEY_PREFIX = "prefix"
|
|
203
204
|
KEY_PROJECT_NAME = "project_name"
|
|
204
|
-
KEY_IS_EXTERNAL = "is_external"
|
|
205
205
|
|
|
206
206
|
ERR_SUBSTR_ALREADY_EXISTS = "already exists"
|
|
207
207
|
ERR_SUBSTR_CONSTRAINT = "constraint"
|
|
@@ -227,6 +227,7 @@ ONEOF_FUNCTION = "function"
|
|
|
227
227
|
ONEOF_METHOD = "method"
|
|
228
228
|
ONEOF_FILE = "file"
|
|
229
229
|
ONEOF_EXTERNAL_PACKAGE = "external_package"
|
|
230
|
+
ONEOF_EXTERNAL_MODULE = "external_module"
|
|
230
231
|
ONEOF_MODULE_IMPLEMENTATION = "module_implementation"
|
|
231
232
|
ONEOF_MODULE_INTERFACE = "module_interface"
|
|
232
233
|
ONEOF_INTERFACE = "interface_node"
|
|
@@ -389,6 +390,34 @@ DUP_QN_MARKER = "@"
|
|
|
389
390
|
PATH_CURRENT_DIR = "."
|
|
390
391
|
PATH_PARENT_DIR = ".."
|
|
391
392
|
GLOB_ALL = "*"
|
|
393
|
+
# (H) JS/TS import specifier schemes that name genuinely external code (node
|
|
394
|
+
# (H) builtins, package registries, URLs). A specifier with any OTHER scheme
|
|
395
|
+
# (H) (`ext:` deno-runtime aliases, bundler virtual modules) points at first-party
|
|
396
|
+
# (H) code under a non-file-path name, so its unresolved calls defer to the trie.
|
|
397
|
+
JS_EXTERNAL_IMPORT_SCHEMES: frozenset[str] = frozenset(
|
|
398
|
+
{"node", "npm", "jsr", "bun", "http", "https", "data", "file", "blob"}
|
|
399
|
+
)
|
|
400
|
+
# (H) Module file extensions stripped when turning a tsconfig `paths` target into a
|
|
401
|
+
# (H) module qn (`src/util.ts` -> `src/util`), longest first so `.d.ts`-like
|
|
402
|
+
# (H) compound suffixes are handled before the bare `.ts`.
|
|
403
|
+
JS_TS_MODULE_EXTENSIONS: tuple[str, ...] = (
|
|
404
|
+
".d.ts",
|
|
405
|
+
".tsx",
|
|
406
|
+
".ts",
|
|
407
|
+
".jsx",
|
|
408
|
+
".mjs",
|
|
409
|
+
".cjs",
|
|
410
|
+
".js",
|
|
411
|
+
)
|
|
412
|
+
TSCONFIG_FILENAMES: tuple[str, ...] = (
|
|
413
|
+
"tsconfig.json",
|
|
414
|
+
"tsconfig.base.json",
|
|
415
|
+
"jsconfig.json",
|
|
416
|
+
)
|
|
417
|
+
JS_INDEX_STEM = "index"
|
|
418
|
+
TS_COMPILER_OPTIONS_KEY = "compilerOptions"
|
|
419
|
+
TS_PATHS_KEY = "paths"
|
|
420
|
+
TS_BASE_URL_KEY = "baseUrl"
|
|
392
421
|
PATH_RELATIVE_PREFIX = "./"
|
|
393
422
|
PATH_PARENT_PREFIX = "../"
|
|
394
423
|
CPP_IMPORT_PARTITION_PREFIX = "import :"
|
|
@@ -417,12 +446,14 @@ class QueryFormat(StrEnum):
|
|
|
417
446
|
|
|
418
447
|
|
|
419
448
|
# (H) Decorators whose presence marks a function/method as an implicit entry point
|
|
420
|
-
# (H) (web routes, task/flow handlers, fixtures, CLI commands, event listeners
|
|
449
|
+
# (H) (web routes, task/flow handlers, fixtures, CLI commands, event listeners, and
|
|
450
|
+
# (H) Pydantic validators/serializers the framework invokes by registration).
|
|
421
451
|
DEFAULT_ROOT_DECORATORS: frozenset[str] = frozenset(
|
|
422
452
|
{
|
|
423
453
|
"route",
|
|
424
454
|
"get",
|
|
425
455
|
"post",
|
|
456
|
+
"callback",
|
|
426
457
|
"put",
|
|
427
458
|
"delete",
|
|
428
459
|
"patch",
|
|
@@ -435,11 +466,37 @@ DEFAULT_ROOT_DECORATORS: frozenset[str] = frozenset(
|
|
|
435
466
|
"app",
|
|
436
467
|
"on_event",
|
|
437
468
|
"listener",
|
|
469
|
+
"validator",
|
|
470
|
+
"field_validator",
|
|
471
|
+
"model_validator",
|
|
472
|
+
"root_validator",
|
|
473
|
+
"field_serializer",
|
|
474
|
+
"model_serializer",
|
|
475
|
+
"abstractmethod",
|
|
438
476
|
}
|
|
439
477
|
)
|
|
440
478
|
|
|
441
|
-
# (H)
|
|
442
|
-
|
|
479
|
+
# (H) Base classes that mark a class as a structural interface: its method stubs
|
|
480
|
+
# (H) are never call targets themselves (callers resolve to the implementations),
|
|
481
|
+
# (H) so dead-code analysis roots every method the class defines.
|
|
482
|
+
# (H) ponytail: direct bases only; transitive Protocol subclassing is not chased.
|
|
483
|
+
PROTOCOL_BASE_QNS: tuple[str, ...] = ("typing.Protocol", "typing_extensions.Protocol")
|
|
484
|
+
|
|
485
|
+
# (H) Substrings in a node's file path that mark it as test code. Covers Python
|
|
486
|
+
# (H) (test_, _test, conftest, /tests/), the JS/TS filename convention
|
|
487
|
+
# (H) (foo.test.ts, foo.spec.tsx), and the Jest __tests__/ directory so those
|
|
488
|
+
# (H) files are not reported as dead. Singular /test/ and /spec/ directories are
|
|
489
|
+
# (H) intentionally excluded: they collide with product code (a domain "spec"
|
|
490
|
+
# (H) module), which would misclassify live code as test.
|
|
491
|
+
TEST_PATH_PATTERNS: tuple[str, ...] = (
|
|
492
|
+
"test_",
|
|
493
|
+
"_test",
|
|
494
|
+
"conftest",
|
|
495
|
+
"/tests/",
|
|
496
|
+
".test.",
|
|
497
|
+
".spec.",
|
|
498
|
+
"__tests__",
|
|
499
|
+
)
|
|
443
500
|
|
|
444
501
|
|
|
445
502
|
class NodeLabel(StrEnum):
|
|
@@ -458,6 +515,7 @@ class NodeLabel(StrEnum):
|
|
|
458
515
|
MODULE_INTERFACE = "ModuleInterface"
|
|
459
516
|
MODULE_IMPLEMENTATION = "ModuleImplementation"
|
|
460
517
|
EXTERNAL_PACKAGE = "ExternalPackage"
|
|
518
|
+
EXTERNAL_MODULE = "ExternalModule"
|
|
461
519
|
|
|
462
520
|
|
|
463
521
|
_NODE_LABEL_UNIQUE_KEYS: dict[NodeLabel, UniqueKeyType] = {
|
|
@@ -476,6 +534,7 @@ _NODE_LABEL_UNIQUE_KEYS: dict[NodeLabel, UniqueKeyType] = {
|
|
|
476
534
|
NodeLabel.MODULE_INTERFACE: UniqueKeyType.QUALIFIED_NAME,
|
|
477
535
|
NodeLabel.MODULE_IMPLEMENTATION: UniqueKeyType.QUALIFIED_NAME,
|
|
478
536
|
NodeLabel.EXTERNAL_PACKAGE: UniqueKeyType.NAME,
|
|
537
|
+
NodeLabel.EXTERNAL_MODULE: UniqueKeyType.QUALIFIED_NAME,
|
|
479
538
|
}
|
|
480
539
|
|
|
481
540
|
_missing_keys = set(NodeLabel) - set(_NODE_LABEL_UNIQUE_KEYS.keys())
|
|
@@ -501,6 +560,7 @@ class RelationshipType(StrEnum):
|
|
|
501
560
|
IMPLEMENTS = "IMPLEMENTS"
|
|
502
561
|
OVERRIDES = "OVERRIDES"
|
|
503
562
|
CALLS = "CALLS"
|
|
563
|
+
REFERENCES = "REFERENCES"
|
|
504
564
|
INSTANTIATES = "INSTANTIATES"
|
|
505
565
|
DEPENDS_ON_EXTERNAL = "DEPENDS_ON_EXTERNAL"
|
|
506
566
|
|
|
@@ -721,6 +781,7 @@ FIELD_DECLARATOR = "declarator"
|
|
|
721
781
|
FIELD_PARAMETERS = "parameters"
|
|
722
782
|
FIELD_RECEIVER = "receiver"
|
|
723
783
|
FIELD_TYPE = "type"
|
|
784
|
+
FIELD_RESULT = "result"
|
|
724
785
|
# (H) Rust impl `trait`/`type` fields and a trait's supertrait `bounds`.
|
|
725
786
|
FIELD_TRAIT = "trait"
|
|
726
787
|
FIELD_BOUNDS = "bounds"
|
|
@@ -1059,6 +1120,9 @@ IGNORE_SUFFIXES = frozenset(
|
|
|
1059
1120
|
{".tmp", "~", ".pyc", ".pyo", ".o", ".a", ".so", ".dll", ".class"}
|
|
1060
1121
|
)
|
|
1061
1122
|
|
|
1123
|
+
# (H) pathspec style for .cgrignore / --exclude patterns (#495).
|
|
1124
|
+
GITWILDMATCH_STYLE = "gitignore"
|
|
1125
|
+
|
|
1062
1126
|
PAYLOAD_NODE_ID = "node_id"
|
|
1063
1127
|
PAYLOAD_QUALIFIED_NAME = "qualified_name"
|
|
1064
1128
|
|
|
@@ -1080,7 +1144,7 @@ CYPHER_DELETE_CALLS = "MATCH ()-[r:CALLS]->() DELETE r"
|
|
|
1080
1144
|
# (H) Removes external import-target Module nodes that no module imports anymore
|
|
1081
1145
|
# (H) (e.g. an imported name that was renamed/removed on an incremental rebuild).
|
|
1082
1146
|
CYPHER_DELETE_ORPHAN_EXTERNAL_MODULES = (
|
|
1083
|
-
"MATCH (m:
|
|
1147
|
+
"MATCH (m:ExternalModule) WHERE NOT (m)<--() DETACH DELETE m"
|
|
1084
1148
|
)
|
|
1085
1149
|
|
|
1086
1150
|
# (H) Queries for orphan pruning — returns all paths stored in the graph
|
|
@@ -1088,13 +1152,62 @@ CYPHER_ALL_FILE_PATHS = (
|
|
|
1088
1152
|
"MATCH (f:File) RETURN f.path AS path, f.absolute_path AS absolute_path"
|
|
1089
1153
|
)
|
|
1090
1154
|
CYPHER_ALL_MODULE_PATHS_INTERNAL = (
|
|
1091
|
-
"MATCH (m:Module)
|
|
1092
|
-
"RETURN m.path AS path, m.qualified_name AS qualified_name"
|
|
1155
|
+
"MATCH (m:Module) RETURN m.path AS path, m.qualified_name AS qualified_name"
|
|
1093
1156
|
)
|
|
1094
1157
|
CYPHER_ALL_FOLDER_PATHS = (
|
|
1095
1158
|
"MATCH (f:Folder) RETURN f.path AS path, f.absolute_path AS absolute_path"
|
|
1096
1159
|
)
|
|
1097
1160
|
|
|
1161
|
+
# (H) Rehydrate the in-memory function registry on an incremental run: returns
|
|
1162
|
+
# (H) every definition node's qualified name and label so call/instantiation
|
|
1163
|
+
# (H) resolution can see symbols defined in files that were not re-parsed.
|
|
1164
|
+
CYPHER_ALL_DEFINITION_QNS = (
|
|
1165
|
+
"MATCH (n) WHERE n:Function OR n:Method OR n:Class OR n:Interface "
|
|
1166
|
+
"OR n:Enum OR n:Type OR n:Union "
|
|
1167
|
+
"RETURN n.qualified_name AS qualified_name, head(labels(n)) AS label, "
|
|
1168
|
+
"n.is_property AS is_property"
|
|
1169
|
+
)
|
|
1170
|
+
|
|
1171
|
+
# (H) Inbound reference edges (from unchanged files) into symbols defined in one
|
|
1172
|
+
# (H) of $paths. Captured BEFORE a changed file's subtree is deleted so the exact
|
|
1173
|
+
# (H) edges can be restored verbatim afterwards (issue #532, inbound half).
|
|
1174
|
+
# (H) Re-resolving the callers instead would diverge from a clean index, because
|
|
1175
|
+
# (H) cgr's call resolution is context-sensitive (protocol vs concrete receiver,
|
|
1176
|
+
# (H) import granularity); the original edges already match a clean re-index.
|
|
1177
|
+
CYPHER_INBOUND_EDGES = (
|
|
1178
|
+
"MATCH (caller)-[r:CALLS|REFERENCES|INSTANTIATES|IMPORTS|INHERITS|OVERRIDES]->(target) "
|
|
1179
|
+
"WHERE target.path IN $paths AND caller.qualified_name IS NOT NULL "
|
|
1180
|
+
"AND (caller.path IS NULL OR NOT caller.path IN $paths) "
|
|
1181
|
+
"RETURN head(labels(caller)) AS caller_label, "
|
|
1182
|
+
"caller.qualified_name AS caller_qn, type(r) AS rel, "
|
|
1183
|
+
"head(labels(target)) AS target_label, target.qualified_name AS target_qn"
|
|
1184
|
+
)
|
|
1185
|
+
# (H) Rehydrate class_inheritance on an incremental run: every INHERITS edge
|
|
1186
|
+
# (H) (child -> base) with resolved qns, so protocol dispatch and inherited-method
|
|
1187
|
+
# (H) resolution still see the hierarchy of classes defined in files that were not
|
|
1188
|
+
# (H) re-parsed. Without it, editing a caller drops the protocol/inheritance
|
|
1189
|
+
# (H) redirect (issue #532 residual): a call resolves to the Protocol stub instead
|
|
1190
|
+
# (H) of the concrete implementer because _protocol_classes() is empty. Ordered by
|
|
1191
|
+
# (H) base_index so multiple-inheritance base order matches the original source,
|
|
1192
|
+
# (H) which method resolution and override attribution depend on.
|
|
1193
|
+
CYPHER_ALL_INHERITS = (
|
|
1194
|
+
"MATCH (child)-[r:INHERITS]->(base) "
|
|
1195
|
+
"WHERE child.qualified_name IS NOT NULL AND base.qualified_name IS NOT NULL "
|
|
1196
|
+
"RETURN child.qualified_name AS child_qn, base.qualified_name AS base_qn, "
|
|
1197
|
+
"r.base_index AS base_index "
|
|
1198
|
+
"ORDER BY child_qn, base_index"
|
|
1199
|
+
)
|
|
1200
|
+
KEY_CHILD_QN = "child_qn"
|
|
1201
|
+
KEY_BASE_QN = "base_qn"
|
|
1202
|
+
KEY_BASE_INDEX = "base_index"
|
|
1203
|
+
|
|
1204
|
+
CYPHER_PARAM_PATHS = "paths"
|
|
1205
|
+
KEY_CALLER_LABEL = "caller_label"
|
|
1206
|
+
KEY_CALLER_QN = "caller_qn"
|
|
1207
|
+
KEY_REL = "rel"
|
|
1208
|
+
KEY_TARGET_LABEL = "target_label"
|
|
1209
|
+
KEY_TARGET_QN = "target_qn"
|
|
1210
|
+
|
|
1098
1211
|
REALTIME_LOGGER_FORMAT = (
|
|
1099
1212
|
"<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | "
|
|
1100
1213
|
"<level>{level: <8}</level> | "
|
|
@@ -1124,6 +1237,9 @@ DIST_DIR = "dist"
|
|
|
1124
1237
|
BYTES_PER_MB_FLOAT = 1024 * 1024
|
|
1125
1238
|
|
|
1126
1239
|
PYPROJECT_PATH = "pyproject.toml"
|
|
1240
|
+
PYPROJECT_KEY_TOOL = "tool"
|
|
1241
|
+
PYPROJECT_KEY_SETUPTOOLS = "setuptools"
|
|
1242
|
+
PYPROJECT_KEY_PACKAGE_DIR = "package-dir"
|
|
1127
1243
|
TREESITTER_EXTRA_KEY = "treesitter-full"
|
|
1128
1244
|
TREESITTER_PKG_PREFIX = "tree-sitter-"
|
|
1129
1245
|
|
|
@@ -1764,6 +1880,18 @@ class CppNodeType(StrEnum):
|
|
|
1764
1880
|
CONSTRUCTOR_OR_DESTRUCTOR_DECLARATION = "constructor_or_destructor_declaration"
|
|
1765
1881
|
INLINE_METHOD_DEFINITION = "inline_method_definition"
|
|
1766
1882
|
OPERATOR_CAST_DEFINITION = "operator_cast_definition"
|
|
1883
|
+
TYPE_IDENTIFIER = "type_identifier"
|
|
1884
|
+
PARAMETER_LIST = "parameter_list"
|
|
1885
|
+
PARAMETER_DECLARATION = "parameter_declaration"
|
|
1886
|
+
OPTIONAL_PARAMETER_DECLARATION = "optional_parameter_declaration"
|
|
1887
|
+
INIT_DECLARATOR = "init_declarator"
|
|
1888
|
+
TEMPLATE_TYPE = "template_type"
|
|
1889
|
+
FIELD_EXPRESSION = "field_expression"
|
|
1890
|
+
COMPOUND_STATEMENT = "compound_statement"
|
|
1891
|
+
THIS = "this"
|
|
1892
|
+
TYPE_DEFINITION = "type_definition"
|
|
1893
|
+
ALIAS_DECLARATION = "alias_declaration"
|
|
1894
|
+
TYPE_DESCRIPTOR = "type_descriptor"
|
|
1767
1895
|
|
|
1768
1896
|
|
|
1769
1897
|
CPP_MODULE_EXTENSIONS = (".ixx", ".cppm", ".ccm", ".mxx")
|
|
@@ -1796,6 +1924,13 @@ CPP_KEYWORD_CLASS = "class"
|
|
|
1796
1924
|
CPP_KEYWORD_STRUCT = "struct"
|
|
1797
1925
|
CPP_EXPORTED_CLASS_KEYWORDS = frozenset({CPP_KEYWORD_CLASS, CPP_KEYWORD_STRUCT})
|
|
1798
1926
|
|
|
1927
|
+
# (H) A C/C++ class/struct/union tag with no body is a forward declaration
|
|
1928
|
+
# (H) (`class Widget;`); it must not become its own node, or it collides with the
|
|
1929
|
+
# (H) real definition's qn and fragments one class into several same-named nodes.
|
|
1930
|
+
CPP_TYPE_SPECIFIER_NODE_TYPES = frozenset(
|
|
1931
|
+
{"class_specifier", "struct_specifier", "union_specifier"}
|
|
1932
|
+
)
|
|
1933
|
+
|
|
1799
1934
|
CPP_FALLBACK_OPERATOR = "operator_unknown"
|
|
1800
1935
|
CPP_FALLBACK_DESTRUCTOR = "~destructor"
|
|
1801
1936
|
CPP_OPERATOR_TEXT_PREFIX = "operator"
|
|
@@ -1916,6 +2051,10 @@ TS_VARIABLE_DECLARATOR = "variable_declarator"
|
|
|
1916
2051
|
TS_CALL_EXPRESSION = "call_expression"
|
|
1917
2052
|
TS_EXPORT_CLAUSE = "export_clause"
|
|
1918
2053
|
TS_EXPORT_SPECIFIER = "export_specifier"
|
|
2054
|
+
TS_EXPORT_DEFAULT = "default"
|
|
2055
|
+
TS_ACCESSIBILITY_MODIFIER = "accessibility_modifier"
|
|
2056
|
+
TS_PRIVATE = "private"
|
|
2057
|
+
TS_PRIVATE_PROPERTY_IDENTIFIER = "private_property_identifier"
|
|
1919
2058
|
|
|
1920
2059
|
# (H) Tree-sitter Java import node types
|
|
1921
2060
|
TS_IMPORT_DECLARATION = "import_declaration"
|
|
@@ -1989,11 +2128,27 @@ TS_GO_TYPE_ALIAS = "type_alias"
|
|
|
1989
2128
|
TS_GO_STRUCT_TYPE = "struct_type"
|
|
1990
2129
|
TS_GO_INTERFACE_TYPE = "interface_type"
|
|
1991
2130
|
TS_GO_PARAMETER_DECLARATION = "parameter_declaration"
|
|
2131
|
+
TS_GO_FUNC_LITERAL = "func_literal"
|
|
1992
2132
|
TS_GO_SOURCE_FILE = "source_file"
|
|
1993
2133
|
TS_GO_FUNCTION_DECLARATION = "function_declaration"
|
|
1994
2134
|
TS_GO_METHOD_DECLARATION = "method_declaration"
|
|
1995
2135
|
TS_GO_CALL_EXPRESSION = "call_expression"
|
|
1996
2136
|
TS_GO_IMPORT_DECLARATION = "import_declaration"
|
|
2137
|
+
TS_GO_PARAMETER_LIST = "parameter_list"
|
|
2138
|
+
TS_GO_VAR_DECLARATION = "var_declaration"
|
|
2139
|
+
TS_GO_VAR_SPEC = "var_spec"
|
|
2140
|
+
TS_GO_SHORT_VAR_DECLARATION = "short_var_declaration"
|
|
2141
|
+
TS_GO_EXPRESSION_LIST = "expression_list"
|
|
2142
|
+
TS_GO_COMPOSITE_LITERAL = "composite_literal"
|
|
2143
|
+
TS_GO_UNARY_EXPRESSION = "unary_expression"
|
|
2144
|
+
TS_GO_POINTER_TYPE = "pointer_type"
|
|
2145
|
+
# (H) Go composite types a method may return; a chained call lands on the CONTAINER,
|
|
2146
|
+
# (H) not its element, so return-type inference must not unwrap these to an element
|
|
2147
|
+
# (H) name (a `[]Command` return must not resolve `.Run()` to `Command.Run`).
|
|
2148
|
+
TS_GO_CONTAINER_TYPES: frozenset[str] = frozenset(
|
|
2149
|
+
{"slice_type", "array_type", "map_type", "channel_type", "function_type"}
|
|
2150
|
+
)
|
|
2151
|
+
FIELD_OPERAND = "operand"
|
|
1997
2152
|
|
|
1998
2153
|
# (H) Tree-sitter Scala node types
|
|
1999
2154
|
TS_SCALA_CLASS_DEFINITION = "class_definition"
|
|
@@ -2036,6 +2191,7 @@ TS_PHP_OBJECT_CREATION_EXPRESSION = "object_creation_expression"
|
|
|
2036
2191
|
TS_PHP_NAMESPACE_DEFINITION = "namespace_definition"
|
|
2037
2192
|
TS_PHP_NAMESPACE_USE_DECLARATION = "namespace_use_declaration"
|
|
2038
2193
|
TS_PHP_NAMESPACE_USE_CLAUSE = "namespace_use_clause"
|
|
2194
|
+
TS_PHP_FUNCTION = "function"
|
|
2039
2195
|
TS_PHP_INCLUDE_EXPRESSION = "include_expression"
|
|
2040
2196
|
TS_PHP_INCLUDE_ONCE_EXPRESSION = "include_once_expression"
|
|
2041
2197
|
TS_PHP_REQUIRE_EXPRESSION = "require_expression"
|
|
@@ -2070,6 +2226,10 @@ TS_CPP_BINARY_EXPRESSION = "binary_expression"
|
|
|
2070
2226
|
TS_CPP_UNARY_EXPRESSION = "unary_expression"
|
|
2071
2227
|
TS_CPP_UPDATE_EXPRESSION = "update_expression"
|
|
2072
2228
|
TS_CPP_FUNCTION_DECLARATOR = "function_declarator"
|
|
2229
|
+
# (H) Substring shared by C++ declarator node types (pointer_declarator,
|
|
2230
|
+
# (H) reference_declarator, parenthesized_declarator, ...), used to unwrap a
|
|
2231
|
+
# (H) parameter declarator down to its bound identifier.
|
|
2232
|
+
CPP_DECLARATOR_SUFFIX = "declarator"
|
|
2073
2233
|
|
|
2074
2234
|
# (H) Tree-sitter Java node types for language_spec
|
|
2075
2235
|
TS_JAVA_METHOD_INVOCATION = "method_invocation"
|
|
@@ -2085,6 +2245,7 @@ TS_CLASS_HERITAGE = "class_heritage"
|
|
|
2085
2245
|
TS_IMPLEMENTS_CLAUSE = "implements_clause"
|
|
2086
2246
|
TS_EXTENDS_CLAUSE = "extends_clause"
|
|
2087
2247
|
TS_MEMBER_EXPRESSION = "member_expression"
|
|
2248
|
+
TS_SELECTOR_EXPRESSION = "selector_expression"
|
|
2088
2249
|
TS_EXTENDS = "extends"
|
|
2089
2250
|
TS_ARGUMENTS = "arguments"
|
|
2090
2251
|
TS_EXTENDS_TYPE_CLAUSE = "extends_type_clause"
|
|
@@ -2103,6 +2264,16 @@ FIELD_OPERATOR = "operator"
|
|
|
2103
2264
|
# (H) Derived node type tuples for class ingestion
|
|
2104
2265
|
CPP_CLASS_TYPES = (CppNodeType.CLASS_SPECIFIER, TS_STRUCT_SPECIFIER)
|
|
2105
2266
|
CPP_COMPOUND_TYPES = (*CPP_CLASS_TYPES, TS_UNION_SPECIFIER, TS_ENUM_SPECIFIER)
|
|
2267
|
+
# (H) Node types that open their own variable scope; C++ local-variable inference must
|
|
2268
|
+
# (H) not descend into them, or a name declared inside a lambda / nested function /
|
|
2269
|
+
# (H) local class body would be attributed to the enclosing function's scope.
|
|
2270
|
+
CPP_NESTED_SCOPE_NODE_TYPES = frozenset(
|
|
2271
|
+
(
|
|
2272
|
+
TS_CPP_FUNCTION_DEFINITION,
|
|
2273
|
+
TS_CPP_LAMBDA_EXPRESSION,
|
|
2274
|
+
*CPP_COMPOUND_TYPES,
|
|
2275
|
+
)
|
|
2276
|
+
)
|
|
2106
2277
|
JS_TS_PARENT_REF_TYPES = (TS_IDENTIFIER, TS_MEMBER_EXPRESSION)
|
|
2107
2278
|
|
|
2108
2279
|
# (H) Import processor function names
|
|
@@ -2452,6 +2623,10 @@ TS_PY_TYPED_DEFAULT_PARAMETER = "typed_default_parameter"
|
|
|
2452
2623
|
TS_PY_ATTRIBUTE = "attribute"
|
|
2453
2624
|
TS_PY_CALL = "call"
|
|
2454
2625
|
TS_PY_LIST = "list"
|
|
2626
|
+
TS_PY_DICTIONARY = "dictionary"
|
|
2627
|
+
TS_PY_PAIR = "pair"
|
|
2628
|
+
TS_PY_SET = "set"
|
|
2629
|
+
TS_PY_TUPLE = "tuple"
|
|
2455
2630
|
TS_PY_LIST_COMPREHENSION = "list_comprehension"
|
|
2456
2631
|
TS_PY_FOR_STATEMENT = "for_statement"
|
|
2457
2632
|
TS_PY_FOR_IN_CLAUSE = "for_in_clause"
|
|
@@ -2461,6 +2636,7 @@ PY_RETURN_QUERY = "(return_statement) @return_stmt"
|
|
|
2461
2636
|
TS_PY_CLASS_DEFINITION = "class_definition"
|
|
2462
2637
|
TS_PY_BLOCK = "block"
|
|
2463
2638
|
TS_PY_FUNCTION_DEFINITION = "function_definition"
|
|
2639
|
+
TS_PY_LAMBDA = "lambda"
|
|
2464
2640
|
TS_PY_RETURN_STATEMENT = "return_statement"
|
|
2465
2641
|
TS_PY_RETURN = "return"
|
|
2466
2642
|
TS_PY_KEYWORD = "keyword"
|
|
@@ -2509,6 +2685,10 @@ PY_NONE = "None"
|
|
|
2509
2685
|
# (H) Python keyword identifiers
|
|
2510
2686
|
PY_KEYWORD_SELF = "self"
|
|
2511
2687
|
PY_KEYWORD_CLS = "cls"
|
|
2688
|
+
# (H) Visibility by naming convention: a leading underscore marks a private
|
|
2689
|
+
# (H) symbol, while a dunder (__x__) is public API invoked by the runtime.
|
|
2690
|
+
PY_NAME_UNDERSCORE = "_"
|
|
2691
|
+
PY_NAME_DUNDER = "__"
|
|
2512
2692
|
# (H) typing.Protocol base name and the conventional XxxProtocol class suffix
|
|
2513
2693
|
# (H) used to map a Protocol to its concrete implementer.
|
|
2514
2694
|
PY_PROTOCOL = "Protocol"
|
|
@@ -2526,6 +2706,7 @@ HIGHER_ORDER_BUILTINS: frozenset[str] = frozenset({"sorted", "min", "max", "redu
|
|
|
2526
2706
|
|
|
2527
2707
|
# (H) Python attribute prefixes
|
|
2528
2708
|
PY_SELF_PREFIX = "self."
|
|
2709
|
+
PY_CLS_PREFIX = "cls."
|
|
2529
2710
|
|
|
2530
2711
|
# (H) Python type inference patterns
|
|
2531
2712
|
PY_VAR_PATTERN_ALL = "all_"
|
|
@@ -2550,8 +2731,13 @@ GUARD_INHERITED_METHOD = "_inherited_method_guard"
|
|
|
2550
2731
|
# (H) JS/TS ingest node types
|
|
2551
2732
|
TS_PAIR = "pair"
|
|
2552
2733
|
TS_OBJECT = "object"
|
|
2734
|
+
TS_ARRAY = "array"
|
|
2553
2735
|
TS_FUNCTION_EXPRESSION = "function_expression"
|
|
2554
2736
|
TS_ARROW_FUNCTION = "arrow_function"
|
|
2737
|
+
TS_REQUIRED_PARAMETER = "required_parameter"
|
|
2738
|
+
TS_OPTIONAL_PARAMETER = "optional_parameter"
|
|
2739
|
+
TS_FIELD_PATTERN = "pattern"
|
|
2740
|
+
TS_FIELD_PARAMETER = "parameter"
|
|
2555
2741
|
TS_MODULE = "module"
|
|
2556
2742
|
TS_CLASS_BODY = "class_body"
|
|
2557
2743
|
TS_STATIC = "static"
|