code-graph-rag 0.0.421__tar.gz → 0.0.534__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.421/code_graph_rag.egg-info → code_graph_rag-0.0.534}/PKG-INFO +39 -8
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/PYPI_README.md +38 -7
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/README.md +13 -5
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534/code_graph_rag.egg-info}/PKG-INFO +39 -8
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/code_graph_rag.egg-info/SOURCES.txt +46 -0
- code_graph_rag-0.0.534/codebase_rag/__init__.py +1 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/analyzers/ast_grep_analyzer.py +1 -2
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/patterns/c.yaml +31 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/patterns/cpp.yaml +34 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/patterns/csharp.yaml +46 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/patterns/dart.yaml +28 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/patterns/go.yaml +25 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/patterns/java.yaml +37 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/patterns/lua.yaml +56 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/patterns/php.yaml +31 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/patterns/ruby.yaml +29 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/patterns/rust.yaml +27 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/patterns/scala.yaml +25 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/security/c.yaml +35 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/security/cpp.yaml +53 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/security/csharp.yaml +83 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/security/dart.yaml +45 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/security/go.yaml +127 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/security/java.yaml +57 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/security/lua.yaml +47 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/security/php.yaml +59 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/security/ruby.yaml +65 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/security/rust.yaml +78 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/security/scala.yaml +34 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/smells/c.yaml +20 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/smells/cpp.yaml +24 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/smells/csharp.yaml +27 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/smells/dart.yaml +29 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/smells/go.yaml +30 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/smells/java.yaml +32 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/smells/lua.yaml +35 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/smells/php.yaml +24 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/smells/ruby.yaml +40 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/smells/rust.yaml +23 -0
- code_graph_rag-0.0.534/codebase_rag/analyzers/ast_grep_rules/smells/scala.yaml +22 -0
- code_graph_rag-0.0.534/codebase_rag/ast_cache.py +92 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/capture.py +2 -3
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/cli.py +11 -7
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/cli_help.py +1 -1
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/config.py +16 -19
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/ast_cpp.py +23 -9
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/ast_csharp.py +15 -18
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/ast_dart.py +59 -27
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/ast_go.py +17 -10
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/ast_js.py +73 -20
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/ast_lua.py +0 -2
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/ast_nodes.py +27 -20
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/ast_php.py +1 -2
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/ast_python.py +8 -13
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/ast_rust.py +42 -31
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/ast_scala.py +1 -2
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/build.py +0 -3
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/cli.py +7 -21
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/core.py +11 -26
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/deadcode_roots.py +115 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/deps.py +4 -10
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/fqn_specs.py +26 -44
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/graph.py +59 -15
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/lang_tooling.py +7 -10
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/languages.py +68 -12
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/mcp.py +0 -6
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/providers.py +2 -3
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/security.py +1 -2
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/stdlib_types.py +18 -19
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/structural.py +5 -5
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/cypher_queries.py +55 -5
- code_graph_rag-0.0.534/codebase_rag/dead_code.py +823 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/embedder.py +3 -3
- code_graph_rag-0.0.534/codebase_rag/function_registry.py +264 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/graph_audit.py +5 -5
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/graph_updater.py +671 -430
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/language_spec.py +18 -12
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/logs.py +26 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/main.py +74 -19
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/mcp/server.py +15 -9
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/mcp/tools.py +32 -26
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/models.py +7 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parser_fingerprint.py +12 -13
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parser_loader.py +10 -11
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/ast_grep_tier.py +11 -8
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/call_processor.py +3275 -463
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/call_resolver.py +815 -113
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/class_ingest/method_override.py +10 -11
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/class_ingest/mixin.py +214 -31
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/class_ingest/parent_extraction.py +41 -0
- code_graph_rag-0.0.534/codebase_rag/parsers/contract_linking.py +256 -0
- code_graph_rag-0.0.534/codebase_rag/parsers/contracts.py +294 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/cpp/preproc_recovery.py +32 -38
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/cpp/type_inference.py +63 -64
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/cpp/utils.py +269 -29
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/cpp_frontend/constants.py +3 -3
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/cpp_frontend/frontend.py +113 -58
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/cpp_frontend/qn.py +5 -5
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/csharp/type_inference.py +38 -40
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/csharp/utils.py +2 -2
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/csharp_frontend/frontend.py +5 -6
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/dart/type_inference.py +7 -8
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/dart/utils.py +64 -12
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/definition_processor.py +50 -4
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/dependency_parser.py +6 -6
- code_graph_rag-0.0.534/codebase_rag/parsers/dispatch_registry.py +401 -0
- code_graph_rag-0.0.534/codebase_rag/parsers/endpoint_prefixes.py +490 -0
- code_graph_rag-0.0.534/codebase_rag/parsers/endpoint_routes.py +857 -0
- code_graph_rag-0.0.534/codebase_rag/parsers/endpoints.py +605 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/export_detection.py +13 -15
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/factory.py +6 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/flow_access/processor.py +13 -9
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/function_ingest.py +344 -209
- code_graph_rag-0.0.534/codebase_rag/parsers/go/module_paths.py +153 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/go/type_inference.py +23 -23
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/go/utils.py +23 -11
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/handlers/rust.py +19 -10
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/import_processor.py +1229 -130
- code_graph_rag-0.0.534/codebase_rag/parsers/io_access/constants.py +100 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/io_access/descriptor.py +78 -55
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/io_access/extract.py +206 -61
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/io_access/models.py +6 -3
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/io_access/processor.py +597 -129
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/io_access/registry.py +84 -70
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/java/method_resolver.py +26 -26
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/java/type_inference.py +6 -6
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/java/type_resolver.py +5 -5
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/java/utils.py +8 -8
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/java/variable_analyzer.py +13 -13
- code_graph_rag-0.0.534/codebase_rag/parsers/js_ts/__init__.py +11 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/js_ts/ingest.py +27 -26
- code_graph_rag-0.0.534/codebase_rag/parsers/js_ts/module_paths.py +316 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/js_ts/module_system.py +129 -6
- code_graph_rag-0.0.534/codebase_rag/parsers/js_ts/type_inference.py +619 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/js_ts/utils.py +65 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/py/ast_analyzer.py +17 -17
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/py/expression_analyzer.py +13 -17
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/py/type_inference.py +5 -6
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/py/variable_analyzer.py +12 -12
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/python_source_roots.py +18 -21
- code_graph_rag-0.0.534/codebase_rag/parsers/rpc_exposure.py +598 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/rs/type_inference.py +29 -30
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/rs/utils.py +164 -7
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/stdlib_extractor.py +5 -6
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/structure_processor.py +13 -3
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/type_inference.py +86 -63
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/utils.py +106 -57
- code_graph_rag-0.0.534/codebase_rag/path_filters.py +23 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/readme_sections.py +2 -2
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/services/filtering.py +3 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/services/graph_service.py +64 -3
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/services/protobuf_service.py +30 -20
- code_graph_rag-0.0.534/codebase_rag/services/resource_cleanup.py +44 -0
- code_graph_rag-0.0.534/codebase_rag/services/usage_cost.py +32 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/stack/constants.py +2 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/stack/health.py +3 -2
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/stack/manager.py +4 -8
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/tool_errors.py +5 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/tools/ast_grep_service.py +5 -6
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/tools/code_retrieval.py +41 -3
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/tools/file_editor.py +9 -3
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/tools/language.py +284 -54
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/tools/semantic_search.py +55 -6
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/tools/shell_command.py +19 -9
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/tools/structural_editor.py +2 -3
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/tools/tool_descriptions.py +2 -1
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/types_defs.py +25 -9
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/unixcoder.py +4 -4
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/utils/path_utils.py +39 -2
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/vector_store.py +151 -34
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codec/schema_pb2.py +29 -29
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codec/schema_pb2.pyi +43 -21
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/pyproject.toml +10 -10
- code_graph_rag-0.0.421/codebase_rag/dead_code.py +0 -460
- code_graph_rag-0.0.421/codebase_rag/parsers/go/module_paths.py +0 -65
- code_graph_rag-0.0.421/codebase_rag/parsers/io_access/constants.py +0 -72
- code_graph_rag-0.0.421/codebase_rag/parsers/js_ts/__init__.py +0 -5
- code_graph_rag-0.0.421/codebase_rag/parsers/js_ts/type_inference.py +0 -261
- code_graph_rag-0.0.421/codec/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/LICENSE +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/cgr/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/code_graph_rag.egg-info/dependency_links.txt +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/code_graph_rag.egg-info/entry_points.txt +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/code_graph_rag.egg-info/requires.txt +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/code_graph_rag.egg-info/top_level.txt +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/analyzers/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/analyzers/ast_grep_rules/patterns/javascript.yaml +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/analyzers/ast_grep_rules/patterns/python.yaml +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/analyzers/ast_grep_rules/patterns/tsx.yaml +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/analyzers/ast_grep_rules/patterns/typescript.yaml +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/analyzers/ast_grep_rules/security/javascript.yaml +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/analyzers/ast_grep_rules/security/python.yaml +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/analyzers/ast_grep_rules/security/tsx.yaml +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/analyzers/ast_grep_rules/security/typescript.yaml +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/analyzers/ast_grep_rules/smells/javascript.yaml +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/analyzers/ast_grep_rules/smells/python.yaml +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/analyzers/ast_grep_rules/smells/tsx.yaml +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/analyzers/ast_grep_rules/smells/typescript.yaml +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/cgr_state.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/ast_java.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/constants/health.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/decorators.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/docker-compose.yaml +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/exceptions.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/graph_loader.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/mcp/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/mcp/client.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/ast_grep_patterns/ruby.yaml +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/class_ingest/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/class_ingest/cpp_modules.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/class_ingest/identity.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/class_ingest/node_type.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/class_ingest/relationships.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/class_ingest/utils.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/cpp/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/cpp_frontend/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/csharp/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/csharp_frontend/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/csharp_frontend/roslyn/Frontend.cs +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/csharp_frontend/roslyn/Frontend.csproj +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/csharp_frontend/roslyn/Program.cs +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/dart/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/flow_access/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/flow_access/constants.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/go/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/handlers/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/handlers/base.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/handlers/cpp.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/handlers/java.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/handlers/js_ts.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/handlers/lua.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/handlers/php.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/handlers/protocol.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/handlers/python.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/handlers/registry.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/io_access/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/java/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/lua/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/lua/type_inference.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/lua/utils.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/py/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/py/utils.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/parsers/rs/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/prompts.py +0 -0
- {code_graph_rag-0.0.421/codebase_rag → code_graph_rag-0.0.534/codebase_rag/providers}/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/providers/base.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/providers/litellm.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/schema_builder.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/schemas.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/services/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/services/anthropic_token_counter.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/services/llm.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/stack/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/stack/cli.py +0 -0
- {code_graph_rag-0.0.421/codebase_rag/providers → code_graph_rag-0.0.534/codebase_rag/tools}/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/tools/codebase_query.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/tools/directory_lister.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/tools/file_reader.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/tools/file_writer.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/tools/health_checker.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/tools/structural_search.py +0 -0
- {code_graph_rag-0.0.421/codebase_rag/tools → code_graph_rag-0.0.534/codebase_rag/utils}/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/utils/dependencies.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/utils/fqn_resolver.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/utils/rich_markdown.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/utils/source_extraction.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/utils/token_utils.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/workspaces/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/workspaces/cli.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/workspaces/constants.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/workspaces/models.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/workspaces/storage.py +0 -0
- {code_graph_rag-0.0.421/codebase_rag/utils → code_graph_rag-0.0.534/codec}/__init__.py +0 -0
- {code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/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.534
|
|
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
|
|
@@ -76,7 +76,25 @@ Dynamic: license-file
|
|
|
76
76
|
|
|
77
77
|
# Code-Graph-RAG
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
Code-Graph-RAG parses a multi-language codebase with Tree-sitter, builds a knowledge graph of its structure in Memgraph, and lets you query, edit, and optimise that code in plain English. It works across a monorepo of mixed languages under one unified graph schema.
|
|
80
|
+
|
|
81
|
+
## What It Does
|
|
82
|
+
|
|
83
|
+
Point it at a repository and it reads every source file, extracts functions, classes, methods, and modules along with the relationships between them, and stores the result as an interconnected graph. Once the graph exists you can:
|
|
84
|
+
|
|
85
|
+
- Ask questions about the codebase in natural language and get answers grounded in the real structure.
|
|
86
|
+
- Retrieve the actual source of any function, class, or method by name or by intent.
|
|
87
|
+
- Edit code through the agent with AST-based surgical patching and a diff preview before anything changes.
|
|
88
|
+
- Search and rewrite code structurally by AST pattern with ast-grep, instead of text or regex.
|
|
89
|
+
- Trace data flow through assignments, calls, and I/O sinks via `FLOWS_TO` taint edges.
|
|
90
|
+
- Optimise code against language best practices or your own coding standards.
|
|
91
|
+
- Find dead code by walking call and reference edges from entry points.
|
|
92
|
+
- Group several repositories into a named workspace and query them as one graph.
|
|
93
|
+
- Trace calls between microservices: route decorators become endpoint templates, and HTTP client URLs resolve to the handlers that serve them, linking services across project boundaries.
|
|
94
|
+
|
|
95
|
+
## Supported Languages
|
|
96
|
+
|
|
97
|
+
Python, TypeScript, TSX, JavaScript, Rust, Go, Java, C, C++, C#, PHP, Lua, and Dart are fully supported. Scala is in development, and Ruby has structural support (modules, functions, classes, and imports) through the pluggable ast-grep tier, which requires the `ast-grep` extra (`pip install 'code-graph-rag[ast-grep]'`).
|
|
80
98
|
|
|
81
99
|
## Install
|
|
82
100
|
|
|
@@ -84,7 +102,7 @@ A graph-based RAG system that parses multi-language codebases with Tree-sitter,
|
|
|
84
102
|
pip install code-graph-rag
|
|
85
103
|
```
|
|
86
104
|
|
|
87
|
-
With all Tree-sitter grammars (Python, JS, TS, Rust, Go, Java, Scala, C++, Lua):
|
|
105
|
+
With all Tree-sitter grammars (Python, JS, TS, Rust, Go, Java, Scala, C, C++, C#, PHP, Lua, Dart):
|
|
88
106
|
|
|
89
107
|
```bash
|
|
90
108
|
pip install 'code-graph-rag[treesitter-full]'
|
|
@@ -154,18 +172,31 @@ cgr dead-code --format json --fail-on-found # CI-friendly report
|
|
|
154
172
|
Results are candidates for review, not a guaranteed delete list. See the
|
|
155
173
|
[Dead Code Detection guide](https://docs.code-graph-rag.com/guide/dead-code/).
|
|
156
174
|
|
|
157
|
-
**
|
|
175
|
+
**Group repositories into a workspace and query them together:**
|
|
158
176
|
|
|
159
177
|
```bash
|
|
160
|
-
cgr
|
|
178
|
+
cgr workspace create my-platform
|
|
179
|
+
cgr workspace add-repo my-platform ./service-a
|
|
180
|
+
cgr workspace add-repo my-platform ./service-b
|
|
181
|
+
cgr start --workspace my-platform
|
|
161
182
|
```
|
|
162
183
|
|
|
163
|
-
**
|
|
184
|
+
**Inspect the graph and the stack:**
|
|
164
185
|
|
|
165
186
|
```bash
|
|
166
|
-
cgr
|
|
187
|
+
cgr stats # node and relationship counts
|
|
188
|
+
cgr status # stack state and last sync per project
|
|
189
|
+
cgr doctor # check dependencies and configuration
|
|
167
190
|
```
|
|
168
191
|
|
|
192
|
+
## MCP Server
|
|
193
|
+
|
|
194
|
+
Run `cgr mcp-server` to serve the tools over stdio or HTTP for Claude Code and other MCP clients. The MCP surface registers:
|
|
195
|
+
|
|
196
|
+
- **Ask and retrieve:** `ask_agent`, `query_code_graph`, `get_code_snippet`, and `semantic_search` (needs the `semantic` extra)
|
|
197
|
+
- **Structural editing:** `surgical_replace_code`, plus `structural_search` and `structural_replace` (need the `ast-grep` extra)
|
|
198
|
+
- **Files and projects:** `read_file`, `write_file`, `list_directory`, `list_projects`, `index_repository`, `update_repository`, `delete_project`, `wipe_database`
|
|
199
|
+
|
|
169
200
|
## Python SDK
|
|
170
201
|
|
|
171
202
|
The `cgr` package provides short imports for programmatic use.
|
|
@@ -237,7 +268,7 @@ Configure via `.env` or environment variables:
|
|
|
237
268
|
|----------|---------|-------------|
|
|
238
269
|
| `MEMGRAPH_HOST` | `localhost` | Memgraph hostname |
|
|
239
270
|
| `MEMGRAPH_PORT` | `7687` | Memgraph port |
|
|
240
|
-
| `ORCHESTRATOR_PROVIDER` | | Provider: `google`, `openai`, `ollama` |
|
|
271
|
+
| `ORCHESTRATOR_PROVIDER` | | Provider: `google`, `openai`, `anthropic`, `azure`, `ollama`, `minimax`, `litellm_proxy` |
|
|
241
272
|
| `ORCHESTRATOR_MODEL` | | Model ID (e.g. `gpt-4o`, `gemini-2.5-pro`) |
|
|
242
273
|
| `ORCHESTRATOR_API_KEY` | | API key for the provider (not needed for `ollama`) |
|
|
243
274
|
| `CYPHER_PROVIDER` | | Provider for Cypher generation |
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
# Code-Graph-RAG
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Code-Graph-RAG parses a multi-language codebase with Tree-sitter, builds a knowledge graph of its structure in Memgraph, and lets you query, edit, and optimise that code in plain English. It works across a monorepo of mixed languages under one unified graph schema.
|
|
4
|
+
|
|
5
|
+
## What It Does
|
|
6
|
+
|
|
7
|
+
Point it at a repository and it reads every source file, extracts functions, classes, methods, and modules along with the relationships between them, and stores the result as an interconnected graph. Once the graph exists you can:
|
|
8
|
+
|
|
9
|
+
- Ask questions about the codebase in natural language and get answers grounded in the real structure.
|
|
10
|
+
- Retrieve the actual source of any function, class, or method by name or by intent.
|
|
11
|
+
- Edit code through the agent with AST-based surgical patching and a diff preview before anything changes.
|
|
12
|
+
- Search and rewrite code structurally by AST pattern with ast-grep, instead of text or regex.
|
|
13
|
+
- Trace data flow through assignments, calls, and I/O sinks via `FLOWS_TO` taint edges.
|
|
14
|
+
- Optimise code against language best practices or your own coding standards.
|
|
15
|
+
- Find dead code by walking call and reference edges from entry points.
|
|
16
|
+
- Group several repositories into a named workspace and query them as one graph.
|
|
17
|
+
- Trace calls between microservices: route decorators become endpoint templates, and HTTP client URLs resolve to the handlers that serve them, linking services across project boundaries.
|
|
18
|
+
|
|
19
|
+
## Supported Languages
|
|
20
|
+
|
|
21
|
+
Python, TypeScript, TSX, JavaScript, Rust, Go, Java, C, C++, C#, PHP, Lua, and Dart are fully supported. Scala is in development, and Ruby has structural support (modules, functions, classes, and imports) through the pluggable ast-grep tier, which requires the `ast-grep` extra (`pip install 'code-graph-rag[ast-grep]'`).
|
|
4
22
|
|
|
5
23
|
## Install
|
|
6
24
|
|
|
@@ -8,7 +26,7 @@ A graph-based RAG system that parses multi-language codebases with Tree-sitter,
|
|
|
8
26
|
pip install code-graph-rag
|
|
9
27
|
```
|
|
10
28
|
|
|
11
|
-
With all Tree-sitter grammars (Python, JS, TS, Rust, Go, Java, Scala, C++, Lua):
|
|
29
|
+
With all Tree-sitter grammars (Python, JS, TS, Rust, Go, Java, Scala, C, C++, C#, PHP, Lua, Dart):
|
|
12
30
|
|
|
13
31
|
```bash
|
|
14
32
|
pip install 'code-graph-rag[treesitter-full]'
|
|
@@ -78,18 +96,31 @@ cgr dead-code --format json --fail-on-found # CI-friendly report
|
|
|
78
96
|
Results are candidates for review, not a guaranteed delete list. See the
|
|
79
97
|
[Dead Code Detection guide](https://docs.code-graph-rag.com/guide/dead-code/).
|
|
80
98
|
|
|
81
|
-
**
|
|
99
|
+
**Group repositories into a workspace and query them together:**
|
|
82
100
|
|
|
83
101
|
```bash
|
|
84
|
-
cgr
|
|
102
|
+
cgr workspace create my-platform
|
|
103
|
+
cgr workspace add-repo my-platform ./service-a
|
|
104
|
+
cgr workspace add-repo my-platform ./service-b
|
|
105
|
+
cgr start --workspace my-platform
|
|
85
106
|
```
|
|
86
107
|
|
|
87
|
-
**
|
|
108
|
+
**Inspect the graph and the stack:**
|
|
88
109
|
|
|
89
110
|
```bash
|
|
90
|
-
cgr
|
|
111
|
+
cgr stats # node and relationship counts
|
|
112
|
+
cgr status # stack state and last sync per project
|
|
113
|
+
cgr doctor # check dependencies and configuration
|
|
91
114
|
```
|
|
92
115
|
|
|
116
|
+
## MCP Server
|
|
117
|
+
|
|
118
|
+
Run `cgr mcp-server` to serve the tools over stdio or HTTP for Claude Code and other MCP clients. The MCP surface registers:
|
|
119
|
+
|
|
120
|
+
- **Ask and retrieve:** `ask_agent`, `query_code_graph`, `get_code_snippet`, and `semantic_search` (needs the `semantic` extra)
|
|
121
|
+
- **Structural editing:** `surgical_replace_code`, plus `structural_search` and `structural_replace` (need the `ast-grep` extra)
|
|
122
|
+
- **Files and projects:** `read_file`, `write_file`, `list_directory`, `list_projects`, `index_repository`, `update_repository`, `delete_project`, `wipe_database`
|
|
123
|
+
|
|
93
124
|
## Python SDK
|
|
94
125
|
|
|
95
126
|
The `cgr` package provides short imports for programmatic use.
|
|
@@ -161,7 +192,7 @@ Configure via `.env` or environment variables:
|
|
|
161
192
|
|----------|---------|-------------|
|
|
162
193
|
| `MEMGRAPH_HOST` | `localhost` | Memgraph hostname |
|
|
163
194
|
| `MEMGRAPH_PORT` | `7687` | Memgraph port |
|
|
164
|
-
| `ORCHESTRATOR_PROVIDER` | | Provider: `google`, `openai`, `ollama` |
|
|
195
|
+
| `ORCHESTRATOR_PROVIDER` | | Provider: `google`, `openai`, `anthropic`, `azure`, `ollama`, `minimax`, `litellm_proxy` |
|
|
165
196
|
| `ORCHESTRATOR_MODEL` | | Model ID (e.g. `gpt-4o`, `gemini-2.5-pro`) |
|
|
166
197
|
| `ORCHESTRATOR_API_KEY` | | API key for the provider (not needed for `ollama`) |
|
|
167
198
|
| `CYPHER_PROVIDER` | | Provider for Cypher generation |
|
|
@@ -20,14 +20,15 @@
|
|
|
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
|
-
|
|
23
|
+
<a href="https://github.com/vitali87/code-graph-rag/actions/workflows/ci.yml">
|
|
24
|
+
<img src="https://img.shields.io/github/actions/workflow/status/vitali87/code-graph-rag/ci.yml?branch=main" alt="CI" />
|
|
25
|
+
</a>
|
|
24
26
|
<a href="https://codecov.io/gh/vitali87/code-graph-rag">
|
|
25
27
|
<img src="https://codecov.io/gh/vitali87/code-graph-rag/graph/badge.svg" alt="Codecov" />
|
|
26
28
|
</a>
|
|
27
29
|
<a href="https://sonarcloud.io/summary/overall?id=vitali87_code-graph-rag">
|
|
28
30
|
<img src="https://sonarcloud.io/api/project_badges/measure?project=vitali87_code-graph-rag&metric=alert_status" alt="Quality Gate Status" />
|
|
29
31
|
</a>
|
|
30
|
-
-->
|
|
31
32
|
<!--
|
|
32
33
|
<a href="https://mseep.ai/app/vitali87-code-graph-rag">
|
|
33
34
|
<img src="https://mseep.net/pr/vitali87-code-graph-rag-badge.png" alt="MseeP.ai Security Assessment" height="20" />
|
|
@@ -36,14 +37,21 @@
|
|
|
36
37
|
<a href="https://code-graph-rag.com">
|
|
37
38
|
<img src="https://img.shields.io/badge/Enterprise-Support%20%26%20Services-6366f1" alt="Enterprise Support" />
|
|
38
39
|
</a>
|
|
40
|
+
<a href="https://pypi.org/project/code-graph-rag/">
|
|
41
|
+
<img src="https://img.shields.io/pypi/v/code-graph-rag" alt="PyPI Version" />
|
|
42
|
+
</a>
|
|
39
43
|
<a href="https://pepy.tech/projects/code-graph-rag">
|
|
40
44
|
<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
45
|
</a>
|
|
42
|
-
|
|
46
|
+
<a href="https://skillsllm.com/security-check/DHsMGRb1Ysys">
|
|
47
|
+
<img src="https://skillsllm.com/security-check/badge.svg?owner=vitali87&repo=code-graph-rag" alt="SkillsLLM Security Check" />
|
|
48
|
+
</a>
|
|
43
49
|
<a href="https://scorecard.dev/viewer/?uri=github.com/vitali87/code-graph-rag">
|
|
44
50
|
<img src="https://api.scorecard.dev/projects/github.com/vitali87/code-graph-rag/badge" alt="OpenSSF Scorecard" />
|
|
45
51
|
</a>
|
|
46
|
-
|
|
52
|
+
<a href="https://www.bestpractices.dev/projects/13757">
|
|
53
|
+
<img src="https://www.bestpractices.dev/projects/13757/badge" alt="OpenSSF Best Practices" />
|
|
54
|
+
</a>
|
|
47
55
|
<!--
|
|
48
56
|
<a href="https://gitcgr.com/vitali87/code-graph-rag">
|
|
49
57
|
<img src="https://gitcgr.com/badge/vitali87/code-graph-rag.svg" alt="gitcgr" />
|
|
@@ -98,7 +106,7 @@ See the [Architecture Overview](docs/architecture/overview.md) and [Graph Schema
|
|
|
98
106
|
|
|
99
107
|
## Supported Languages
|
|
100
108
|
|
|
101
|
-
Python, TypeScript, TSX, JavaScript, Rust, Go, Java, C, C++, C#, PHP, Lua, and Dart are fully supported. Scala is in development. See the [Language Support](docs/architecture/language-support.md) matrix for per-language capabilities.
|
|
109
|
+
Python, TypeScript, TSX, JavaScript, Rust, Go, Java, C, C++, C#, PHP, Lua, and Dart are fully supported. Scala is in development, and Ruby has structural support (modules, functions, classes, and imports) through the pluggable ast-grep tier. See the [Language Support](docs/architecture/language-support.md) matrix for per-language capabilities.
|
|
102
110
|
|
|
103
111
|
## Installation
|
|
104
112
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code-graph-rag
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.534
|
|
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
|
|
@@ -76,7 +76,25 @@ Dynamic: license-file
|
|
|
76
76
|
|
|
77
77
|
# Code-Graph-RAG
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
Code-Graph-RAG parses a multi-language codebase with Tree-sitter, builds a knowledge graph of its structure in Memgraph, and lets you query, edit, and optimise that code in plain English. It works across a monorepo of mixed languages under one unified graph schema.
|
|
80
|
+
|
|
81
|
+
## What It Does
|
|
82
|
+
|
|
83
|
+
Point it at a repository and it reads every source file, extracts functions, classes, methods, and modules along with the relationships between them, and stores the result as an interconnected graph. Once the graph exists you can:
|
|
84
|
+
|
|
85
|
+
- Ask questions about the codebase in natural language and get answers grounded in the real structure.
|
|
86
|
+
- Retrieve the actual source of any function, class, or method by name or by intent.
|
|
87
|
+
- Edit code through the agent with AST-based surgical patching and a diff preview before anything changes.
|
|
88
|
+
- Search and rewrite code structurally by AST pattern with ast-grep, instead of text or regex.
|
|
89
|
+
- Trace data flow through assignments, calls, and I/O sinks via `FLOWS_TO` taint edges.
|
|
90
|
+
- Optimise code against language best practices or your own coding standards.
|
|
91
|
+
- Find dead code by walking call and reference edges from entry points.
|
|
92
|
+
- Group several repositories into a named workspace and query them as one graph.
|
|
93
|
+
- Trace calls between microservices: route decorators become endpoint templates, and HTTP client URLs resolve to the handlers that serve them, linking services across project boundaries.
|
|
94
|
+
|
|
95
|
+
## Supported Languages
|
|
96
|
+
|
|
97
|
+
Python, TypeScript, TSX, JavaScript, Rust, Go, Java, C, C++, C#, PHP, Lua, and Dart are fully supported. Scala is in development, and Ruby has structural support (modules, functions, classes, and imports) through the pluggable ast-grep tier, which requires the `ast-grep` extra (`pip install 'code-graph-rag[ast-grep]'`).
|
|
80
98
|
|
|
81
99
|
## Install
|
|
82
100
|
|
|
@@ -84,7 +102,7 @@ A graph-based RAG system that parses multi-language codebases with Tree-sitter,
|
|
|
84
102
|
pip install code-graph-rag
|
|
85
103
|
```
|
|
86
104
|
|
|
87
|
-
With all Tree-sitter grammars (Python, JS, TS, Rust, Go, Java, Scala, C++, Lua):
|
|
105
|
+
With all Tree-sitter grammars (Python, JS, TS, Rust, Go, Java, Scala, C, C++, C#, PHP, Lua, Dart):
|
|
88
106
|
|
|
89
107
|
```bash
|
|
90
108
|
pip install 'code-graph-rag[treesitter-full]'
|
|
@@ -154,18 +172,31 @@ cgr dead-code --format json --fail-on-found # CI-friendly report
|
|
|
154
172
|
Results are candidates for review, not a guaranteed delete list. See the
|
|
155
173
|
[Dead Code Detection guide](https://docs.code-graph-rag.com/guide/dead-code/).
|
|
156
174
|
|
|
157
|
-
**
|
|
175
|
+
**Group repositories into a workspace and query them together:**
|
|
158
176
|
|
|
159
177
|
```bash
|
|
160
|
-
cgr
|
|
178
|
+
cgr workspace create my-platform
|
|
179
|
+
cgr workspace add-repo my-platform ./service-a
|
|
180
|
+
cgr workspace add-repo my-platform ./service-b
|
|
181
|
+
cgr start --workspace my-platform
|
|
161
182
|
```
|
|
162
183
|
|
|
163
|
-
**
|
|
184
|
+
**Inspect the graph and the stack:**
|
|
164
185
|
|
|
165
186
|
```bash
|
|
166
|
-
cgr
|
|
187
|
+
cgr stats # node and relationship counts
|
|
188
|
+
cgr status # stack state and last sync per project
|
|
189
|
+
cgr doctor # check dependencies and configuration
|
|
167
190
|
```
|
|
168
191
|
|
|
192
|
+
## MCP Server
|
|
193
|
+
|
|
194
|
+
Run `cgr mcp-server` to serve the tools over stdio or HTTP for Claude Code and other MCP clients. The MCP surface registers:
|
|
195
|
+
|
|
196
|
+
- **Ask and retrieve:** `ask_agent`, `query_code_graph`, `get_code_snippet`, and `semantic_search` (needs the `semantic` extra)
|
|
197
|
+
- **Structural editing:** `surgical_replace_code`, plus `structural_search` and `structural_replace` (need the `ast-grep` extra)
|
|
198
|
+
- **Files and projects:** `read_file`, `write_file`, `list_directory`, `list_projects`, `index_repository`, `update_repository`, `delete_project`, `wipe_database`
|
|
199
|
+
|
|
169
200
|
## Python SDK
|
|
170
201
|
|
|
171
202
|
The `cgr` package provides short imports for programmatic use.
|
|
@@ -237,7 +268,7 @@ Configure via `.env` or environment variables:
|
|
|
237
268
|
|----------|---------|-------------|
|
|
238
269
|
| `MEMGRAPH_HOST` | `localhost` | Memgraph hostname |
|
|
239
270
|
| `MEMGRAPH_PORT` | `7687` | Memgraph port |
|
|
240
|
-
| `ORCHESTRATOR_PROVIDER` | | Provider: `google`, `openai`, `ollama` |
|
|
271
|
+
| `ORCHESTRATOR_PROVIDER` | | Provider: `google`, `openai`, `anthropic`, `azure`, `ollama`, `minimax`, `litellm_proxy` |
|
|
241
272
|
| `ORCHESTRATOR_MODEL` | | Model ID (e.g. `gpt-4o`, `gemini-2.5-pro`) |
|
|
242
273
|
| `ORCHESTRATOR_API_KEY` | | API key for the provider (not needed for `ollama`) |
|
|
243
274
|
| `CYPHER_PROVIDER` | | Provider for Cypher generation |
|
|
@@ -10,6 +10,7 @@ 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/ast_cache.py
|
|
13
14
|
codebase_rag/capture.py
|
|
14
15
|
codebase_rag/cgr_state.py
|
|
15
16
|
codebase_rag/cli.py
|
|
@@ -21,6 +22,7 @@ codebase_rag/decorators.py
|
|
|
21
22
|
codebase_rag/docker-compose.yaml
|
|
22
23
|
codebase_rag/embedder.py
|
|
23
24
|
codebase_rag/exceptions.py
|
|
25
|
+
codebase_rag/function_registry.py
|
|
24
26
|
codebase_rag/graph_audit.py
|
|
25
27
|
codebase_rag/graph_loader.py
|
|
26
28
|
codebase_rag/graph_updater.py
|
|
@@ -30,6 +32,7 @@ codebase_rag/main.py
|
|
|
30
32
|
codebase_rag/models.py
|
|
31
33
|
codebase_rag/parser_fingerprint.py
|
|
32
34
|
codebase_rag/parser_loader.py
|
|
35
|
+
codebase_rag/path_filters.py
|
|
33
36
|
codebase_rag/prompts.py
|
|
34
37
|
codebase_rag/readme_sections.py
|
|
35
38
|
codebase_rag/schema_builder.py
|
|
@@ -40,16 +43,49 @@ codebase_rag/unixcoder.py
|
|
|
40
43
|
codebase_rag/vector_store.py
|
|
41
44
|
codebase_rag/analyzers/__init__.py
|
|
42
45
|
codebase_rag/analyzers/ast_grep_analyzer.py
|
|
46
|
+
codebase_rag/analyzers/ast_grep_rules/patterns/c.yaml
|
|
47
|
+
codebase_rag/analyzers/ast_grep_rules/patterns/cpp.yaml
|
|
48
|
+
codebase_rag/analyzers/ast_grep_rules/patterns/csharp.yaml
|
|
49
|
+
codebase_rag/analyzers/ast_grep_rules/patterns/dart.yaml
|
|
50
|
+
codebase_rag/analyzers/ast_grep_rules/patterns/go.yaml
|
|
51
|
+
codebase_rag/analyzers/ast_grep_rules/patterns/java.yaml
|
|
43
52
|
codebase_rag/analyzers/ast_grep_rules/patterns/javascript.yaml
|
|
53
|
+
codebase_rag/analyzers/ast_grep_rules/patterns/lua.yaml
|
|
54
|
+
codebase_rag/analyzers/ast_grep_rules/patterns/php.yaml
|
|
44
55
|
codebase_rag/analyzers/ast_grep_rules/patterns/python.yaml
|
|
56
|
+
codebase_rag/analyzers/ast_grep_rules/patterns/ruby.yaml
|
|
57
|
+
codebase_rag/analyzers/ast_grep_rules/patterns/rust.yaml
|
|
58
|
+
codebase_rag/analyzers/ast_grep_rules/patterns/scala.yaml
|
|
45
59
|
codebase_rag/analyzers/ast_grep_rules/patterns/tsx.yaml
|
|
46
60
|
codebase_rag/analyzers/ast_grep_rules/patterns/typescript.yaml
|
|
61
|
+
codebase_rag/analyzers/ast_grep_rules/security/c.yaml
|
|
62
|
+
codebase_rag/analyzers/ast_grep_rules/security/cpp.yaml
|
|
63
|
+
codebase_rag/analyzers/ast_grep_rules/security/csharp.yaml
|
|
64
|
+
codebase_rag/analyzers/ast_grep_rules/security/dart.yaml
|
|
65
|
+
codebase_rag/analyzers/ast_grep_rules/security/go.yaml
|
|
66
|
+
codebase_rag/analyzers/ast_grep_rules/security/java.yaml
|
|
47
67
|
codebase_rag/analyzers/ast_grep_rules/security/javascript.yaml
|
|
68
|
+
codebase_rag/analyzers/ast_grep_rules/security/lua.yaml
|
|
69
|
+
codebase_rag/analyzers/ast_grep_rules/security/php.yaml
|
|
48
70
|
codebase_rag/analyzers/ast_grep_rules/security/python.yaml
|
|
71
|
+
codebase_rag/analyzers/ast_grep_rules/security/ruby.yaml
|
|
72
|
+
codebase_rag/analyzers/ast_grep_rules/security/rust.yaml
|
|
73
|
+
codebase_rag/analyzers/ast_grep_rules/security/scala.yaml
|
|
49
74
|
codebase_rag/analyzers/ast_grep_rules/security/tsx.yaml
|
|
50
75
|
codebase_rag/analyzers/ast_grep_rules/security/typescript.yaml
|
|
76
|
+
codebase_rag/analyzers/ast_grep_rules/smells/c.yaml
|
|
77
|
+
codebase_rag/analyzers/ast_grep_rules/smells/cpp.yaml
|
|
78
|
+
codebase_rag/analyzers/ast_grep_rules/smells/csharp.yaml
|
|
79
|
+
codebase_rag/analyzers/ast_grep_rules/smells/dart.yaml
|
|
80
|
+
codebase_rag/analyzers/ast_grep_rules/smells/go.yaml
|
|
81
|
+
codebase_rag/analyzers/ast_grep_rules/smells/java.yaml
|
|
51
82
|
codebase_rag/analyzers/ast_grep_rules/smells/javascript.yaml
|
|
83
|
+
codebase_rag/analyzers/ast_grep_rules/smells/lua.yaml
|
|
84
|
+
codebase_rag/analyzers/ast_grep_rules/smells/php.yaml
|
|
52
85
|
codebase_rag/analyzers/ast_grep_rules/smells/python.yaml
|
|
86
|
+
codebase_rag/analyzers/ast_grep_rules/smells/ruby.yaml
|
|
87
|
+
codebase_rag/analyzers/ast_grep_rules/smells/rust.yaml
|
|
88
|
+
codebase_rag/analyzers/ast_grep_rules/smells/scala.yaml
|
|
53
89
|
codebase_rag/analyzers/ast_grep_rules/smells/tsx.yaml
|
|
54
90
|
codebase_rag/analyzers/ast_grep_rules/smells/typescript.yaml
|
|
55
91
|
codebase_rag/constants/__init__.py
|
|
@@ -88,13 +124,20 @@ codebase_rag/parsers/__init__.py
|
|
|
88
124
|
codebase_rag/parsers/ast_grep_tier.py
|
|
89
125
|
codebase_rag/parsers/call_processor.py
|
|
90
126
|
codebase_rag/parsers/call_resolver.py
|
|
127
|
+
codebase_rag/parsers/contract_linking.py
|
|
128
|
+
codebase_rag/parsers/contracts.py
|
|
91
129
|
codebase_rag/parsers/definition_processor.py
|
|
92
130
|
codebase_rag/parsers/dependency_parser.py
|
|
131
|
+
codebase_rag/parsers/dispatch_registry.py
|
|
132
|
+
codebase_rag/parsers/endpoint_prefixes.py
|
|
133
|
+
codebase_rag/parsers/endpoint_routes.py
|
|
134
|
+
codebase_rag/parsers/endpoints.py
|
|
93
135
|
codebase_rag/parsers/export_detection.py
|
|
94
136
|
codebase_rag/parsers/factory.py
|
|
95
137
|
codebase_rag/parsers/function_ingest.py
|
|
96
138
|
codebase_rag/parsers/import_processor.py
|
|
97
139
|
codebase_rag/parsers/python_source_roots.py
|
|
140
|
+
codebase_rag/parsers/rpc_exposure.py
|
|
98
141
|
codebase_rag/parsers/stdlib_extractor.py
|
|
99
142
|
codebase_rag/parsers/structure_processor.py
|
|
100
143
|
codebase_rag/parsers/type_inference.py
|
|
@@ -161,6 +204,7 @@ codebase_rag/parsers/java/utils.py
|
|
|
161
204
|
codebase_rag/parsers/java/variable_analyzer.py
|
|
162
205
|
codebase_rag/parsers/js_ts/__init__.py
|
|
163
206
|
codebase_rag/parsers/js_ts/ingest.py
|
|
207
|
+
codebase_rag/parsers/js_ts/module_paths.py
|
|
164
208
|
codebase_rag/parsers/js_ts/module_system.py
|
|
165
209
|
codebase_rag/parsers/js_ts/type_inference.py
|
|
166
210
|
codebase_rag/parsers/js_ts/utils.py
|
|
@@ -185,6 +229,8 @@ codebase_rag/services/filtering.py
|
|
|
185
229
|
codebase_rag/services/graph_service.py
|
|
186
230
|
codebase_rag/services/llm.py
|
|
187
231
|
codebase_rag/services/protobuf_service.py
|
|
232
|
+
codebase_rag/services/resource_cleanup.py
|
|
233
|
+
codebase_rag/services/usage_cost.py
|
|
188
234
|
codebase_rag/stack/__init__.py
|
|
189
235
|
codebase_rag/stack/cli.py
|
|
190
236
|
codebase_rag/stack/constants.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Code Graph RAG: build a queryable graph of a codebase and reason over it."""
|
{code_graph_rag-0.0.421 → code_graph_rag-0.0.534}/codebase_rag/analyzers/ast_grep_analyzer.py
RENAMED
|
@@ -174,8 +174,7 @@ class FindingAnalyzer:
|
|
|
174
174
|
start_line = node_range.start.line + 1
|
|
175
175
|
end_line = node_range.end.line + 1
|
|
176
176
|
# qn scopes the finding to file+line+column+rule so two matches of one
|
|
177
|
-
# rule on
|
|
178
|
-
# same site idempotently.
|
|
177
|
+
# rule on one line stay distinct, while re-indexing merges the site.
|
|
179
178
|
qualified_name = cs.SEPARATOR_DOT.join(
|
|
180
179
|
[module_qn, str(start_line), str(node_range.start.column), rule.rule_id]
|
|
181
180
|
)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# ast-grep design-pattern rules for C (issue #413).
|
|
2
|
+
# Each match becomes a Pattern node linked to the file's Module via
|
|
3
|
+
# IMPLEMENTS_PATTERN. C has no classic OO patterns, so these are heuristic
|
|
4
|
+
# function-name idioms recognised via the declarator identifier.
|
|
5
|
+
ast_grep_id: c
|
|
6
|
+
extensions: [.c, .h]
|
|
7
|
+
rules:
|
|
8
|
+
- id: constructor_like
|
|
9
|
+
message: "Constructor idiom: function name starts with create/make/new/alloc"
|
|
10
|
+
rule:
|
|
11
|
+
kind: function_definition
|
|
12
|
+
has:
|
|
13
|
+
kind: function_declarator
|
|
14
|
+
stopBy: end
|
|
15
|
+
has: { field: declarator, kind: identifier, regex: '^(create|make|new|alloc)' }
|
|
16
|
+
- id: initializer_like
|
|
17
|
+
message: "Initializer idiom: function name starts with init"
|
|
18
|
+
rule:
|
|
19
|
+
kind: function_definition
|
|
20
|
+
has:
|
|
21
|
+
kind: function_declarator
|
|
22
|
+
stopBy: end
|
|
23
|
+
has: { field: declarator, kind: identifier, regex: '^init' }
|
|
24
|
+
- id: destructor_like
|
|
25
|
+
message: "Destructor idiom: function name starts with free/destroy/release"
|
|
26
|
+
rule:
|
|
27
|
+
kind: function_definition
|
|
28
|
+
has:
|
|
29
|
+
kind: function_declarator
|
|
30
|
+
stopBy: end
|
|
31
|
+
has: { field: declarator, kind: identifier, regex: '^(free|destroy|release)' }
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# ast-grep design-pattern rules for C++ (issue #413).
|
|
2
|
+
# Each match becomes a Pattern node linked to the file's Module via
|
|
3
|
+
# IMPLEMENTS_PATTERN. Rules are heuristic and syntactic.
|
|
4
|
+
ast_grep_id: cpp
|
|
5
|
+
extensions: [.cpp, .cc, .cxx, .hpp, .hh]
|
|
6
|
+
rules:
|
|
7
|
+
- id: singleton
|
|
8
|
+
message: "Singleton: class exposes a static getInstance accessor"
|
|
9
|
+
rule:
|
|
10
|
+
kind: function_definition
|
|
11
|
+
all:
|
|
12
|
+
- has: { kind: storage_class_specifier, regex: '^static$', stopBy: end }
|
|
13
|
+
- has:
|
|
14
|
+
kind: function_declarator
|
|
15
|
+
has: { field: declarator, regex: '^getInstance$' }
|
|
16
|
+
stopBy: end
|
|
17
|
+
- id: factory_function
|
|
18
|
+
message: "Factory function: name starts with create/make/build"
|
|
19
|
+
rule:
|
|
20
|
+
kind: function_definition
|
|
21
|
+
has:
|
|
22
|
+
kind: function_declarator
|
|
23
|
+
has: { field: declarator, regex: '^(create|make|build)' }
|
|
24
|
+
stopBy: end
|
|
25
|
+
- id: abstract_class
|
|
26
|
+
message: "Abstract class: declares a pure virtual method (= 0)"
|
|
27
|
+
rule:
|
|
28
|
+
kind: class_specifier
|
|
29
|
+
has:
|
|
30
|
+
kind: field_declaration
|
|
31
|
+
all:
|
|
32
|
+
- has: { regex: '^virtual$', stopBy: end }
|
|
33
|
+
- regex: '=\s*0\s*;'
|
|
34
|
+
stopBy: end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# ast-grep design-pattern rules for C# (issue #413).
|
|
2
|
+
# Each match becomes a Pattern node linked to the file's Module via
|
|
3
|
+
# IMPLEMENTS_PATTERN. Rules are heuristic and syntactic.
|
|
4
|
+
ast_grep_id: csharp
|
|
5
|
+
extensions: [.cs]
|
|
6
|
+
rules:
|
|
7
|
+
- id: singleton
|
|
8
|
+
message: "Singleton: class exposes a static Instance member"
|
|
9
|
+
rule:
|
|
10
|
+
kind: class_declaration
|
|
11
|
+
has:
|
|
12
|
+
stopBy: end
|
|
13
|
+
any:
|
|
14
|
+
# static property named Instance / _instance
|
|
15
|
+
- kind: property_declaration
|
|
16
|
+
all:
|
|
17
|
+
- has: { kind: modifier, regex: '^static$', stopBy: end }
|
|
18
|
+
- has: { kind: identifier, regex: '^_?[Ii]nstance$', stopBy: end }
|
|
19
|
+
# static backing field named Instance / _instance
|
|
20
|
+
- kind: field_declaration
|
|
21
|
+
all:
|
|
22
|
+
- has: { kind: modifier, regex: '^static$', stopBy: end }
|
|
23
|
+
- has: { kind: identifier, regex: '^_?[Ii]nstance$', stopBy: end }
|
|
24
|
+
- id: factory_method
|
|
25
|
+
message: "Factory method: name starts with Create/Make/Build"
|
|
26
|
+
rule:
|
|
27
|
+
kind: method_declaration
|
|
28
|
+
has: { field: name, regex: '^(Create|Make|Build)' }
|
|
29
|
+
- id: builder
|
|
30
|
+
message: "Builder: class name ends with Builder"
|
|
31
|
+
rule:
|
|
32
|
+
kind: class_declaration
|
|
33
|
+
has: { field: name, regex: 'Builder$' }
|
|
34
|
+
- id: abstract_class
|
|
35
|
+
message: "Abstract base class: declared with the abstract modifier"
|
|
36
|
+
rule:
|
|
37
|
+
kind: class_declaration
|
|
38
|
+
has: { kind: modifier, regex: '^abstract$' }
|
|
39
|
+
- id: disposable
|
|
40
|
+
message: "Disposable: class defines a Dispose method"
|
|
41
|
+
rule:
|
|
42
|
+
kind: class_declaration
|
|
43
|
+
has:
|
|
44
|
+
stopBy: end
|
|
45
|
+
kind: method_declaration
|
|
46
|
+
has: { field: name, regex: '^Dispose$' }
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# ast-grep design-pattern rules for Dart (issue #413).
|
|
2
|
+
# Each match becomes a Pattern node linked to the file's Module via
|
|
3
|
+
# IMPLEMENTS_PATTERN. Rules are heuristic and syntactic.
|
|
4
|
+
ast_grep_id: dart
|
|
5
|
+
extensions: [.dart]
|
|
6
|
+
rules:
|
|
7
|
+
- id: factory_constructor
|
|
8
|
+
message: "Factory: class exposes a factory constructor"
|
|
9
|
+
rule:
|
|
10
|
+
kind: factory_constructor_signature
|
|
11
|
+
- id: singleton
|
|
12
|
+
message: "Singleton: class holds a static instance field"
|
|
13
|
+
rule:
|
|
14
|
+
kind: class_declaration
|
|
15
|
+
has:
|
|
16
|
+
kind: static_final_declaration
|
|
17
|
+
stopBy: end
|
|
18
|
+
has: { kind: identifier, regex: '(?i)instance' }
|
|
19
|
+
- id: builder
|
|
20
|
+
message: "Builder: class name ends in Builder"
|
|
21
|
+
rule:
|
|
22
|
+
kind: class_declaration
|
|
23
|
+
has: { field: name, regex: 'Builder$' }
|
|
24
|
+
- id: abstract_class
|
|
25
|
+
message: "Abstract class declares an interface for subclasses"
|
|
26
|
+
rule:
|
|
27
|
+
kind: class_declaration
|
|
28
|
+
regex: '^abstract\s'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# ast-grep design-pattern rules for Go (issue #413).
|
|
2
|
+
# Each match becomes a Pattern node linked to the file's Module via
|
|
3
|
+
# IMPLEMENTS_PATTERN. Rules are heuristic and syntactic.
|
|
4
|
+
ast_grep_id: go
|
|
5
|
+
extensions: [.go]
|
|
6
|
+
rules:
|
|
7
|
+
- id: constructor
|
|
8
|
+
message: "Constructor: function name starts with New"
|
|
9
|
+
rule:
|
|
10
|
+
kind: function_declaration
|
|
11
|
+
has: { field: name, regex: '^New' }
|
|
12
|
+
- id: factory_function
|
|
13
|
+
message: "Factory function: name starts with New/Make/Build/Create"
|
|
14
|
+
rule:
|
|
15
|
+
kind: function_declaration
|
|
16
|
+
has: { field: name, regex: '^(New|Make|Build|Create)' }
|
|
17
|
+
- id: singleton
|
|
18
|
+
message: "Singleton: struct embeds sync.Once to guard one-time init"
|
|
19
|
+
rule:
|
|
20
|
+
kind: struct_type
|
|
21
|
+
has: { kind: qualified_type, regex: 'sync\.Once', stopBy: end }
|
|
22
|
+
- id: interface_declaration
|
|
23
|
+
message: "Interface: a behavioural contract declared for satisfaction"
|
|
24
|
+
rule:
|
|
25
|
+
kind: interface_type
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# ast-grep design-pattern rules for Java (issue #413).
|
|
2
|
+
# Each match becomes a Pattern node linked to the file's Module via
|
|
3
|
+
# IMPLEMENTS_PATTERN. Rules are heuristic and syntactic.
|
|
4
|
+
ast_grep_id: java
|
|
5
|
+
extensions: [.java]
|
|
6
|
+
rules:
|
|
7
|
+
- id: singleton
|
|
8
|
+
message: "Singleton: class exposes a static getInstance accessor"
|
|
9
|
+
rule:
|
|
10
|
+
kind: class_declaration
|
|
11
|
+
has:
|
|
12
|
+
kind: method_declaration
|
|
13
|
+
stopBy: end
|
|
14
|
+
all:
|
|
15
|
+
- has: { kind: modifiers, has: { regex: '^static$' } }
|
|
16
|
+
- has: { field: name, regex: '^getInstance$' }
|
|
17
|
+
- id: factory_method
|
|
18
|
+
message: "Factory method: name starts with create/make/build/newInstance"
|
|
19
|
+
rule:
|
|
20
|
+
kind: method_declaration
|
|
21
|
+
has: { field: name, regex: '^(create|make|build|newInstance)' }
|
|
22
|
+
- id: builder
|
|
23
|
+
message: "Builder: class name ends with Builder"
|
|
24
|
+
rule:
|
|
25
|
+
kind: class_declaration
|
|
26
|
+
has: { field: name, regex: 'Builder$' }
|
|
27
|
+
- id: fluent_builder
|
|
28
|
+
message: "Fluent builder: instance method returns this"
|
|
29
|
+
rule:
|
|
30
|
+
kind: method_declaration
|
|
31
|
+
has:
|
|
32
|
+
kind: block
|
|
33
|
+
has:
|
|
34
|
+
kind: return_statement
|
|
35
|
+
has: { kind: this }
|
|
36
|
+
stopBy: end
|
|
37
|
+
stopBy: end
|