codegraph-engine 2.1.8__tar.gz → 2.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. codegraph_engine-2.2.1/PKG-INFO +627 -0
  2. codegraph_engine-2.2.1/README.md +594 -0
  3. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/pyproject.toml +1 -1
  4. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/__init__.py +1 -1
  5. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/cli.py +60 -14
  6. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/context.py +3 -0
  7. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/database/interrogation.py +30 -7
  8. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/freshness.py +59 -21
  9. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/indexing/indexer.py +4 -1
  10. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/indexing/parser.py +55 -21
  11. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/interrogation.py +19 -0
  12. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/mcp/server.py +8 -1
  13. codegraph_engine-2.2.1/src/codegraph/runtime/runner.py +204 -0
  14. codegraph_engine-2.2.1/src/codegraph_engine.egg-info/PKG-INFO +627 -0
  15. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph_engine.egg-info/SOURCES.txt +2 -0
  16. codegraph_engine-2.2.1/tests/test_v22_enterprise_concurrency_and_runtime.py +200 -0
  17. codegraph_engine-2.1.8/PKG-INFO +0 -642
  18. codegraph_engine-2.1.8/README.md +0 -609
  19. codegraph_engine-2.1.8/src/codegraph_engine.egg-info/PKG-INFO +0 -642
  20. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/LICENSE +0 -0
  21. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/setup.cfg +0 -0
  22. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/agent.py +0 -0
  23. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/agent_brain.py +0 -0
  24. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/agent_capabilities.py +0 -0
  25. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/agent_rules.py +0 -0
  26. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/architecture.py +0 -0
  27. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/audit.py +0 -0
  28. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/binding_resolver.py +0 -0
  29. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/cache.py +0 -0
  30. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/cli_output.py +0 -0
  31. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/config.py +0 -0
  32. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/constraints.py +0 -0
  33. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/database/__init__.py +0 -0
  34. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/database/extractor.py +0 -0
  35. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/database/models.py +0 -0
  36. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/epistemic.py +0 -0
  37. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/errors.py +0 -0
  38. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/evidence/__init__.py +0 -0
  39. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/evidence/citations.py +0 -0
  40. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/evidence_contract.py +0 -0
  41. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/frameworks.py +0 -0
  42. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/git.py +0 -0
  43. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/graph/__init__.py +0 -0
  44. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/graph/models.py +0 -0
  45. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/graph/traversal.py +0 -0
  46. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/indexing/__init__.py +0 -0
  47. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/indexing/classifier.py +0 -0
  48. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/indexing/models.py +0 -0
  49. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/indexing/scanner.py +0 -0
  50. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/indexing/telemetry.py +0 -0
  51. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/indexing/test_framework.py +0 -0
  52. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/installer.py +0 -0
  53. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/llm/__init__.py +0 -0
  54. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/llm/base.py +0 -0
  55. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/llm/context.py +0 -0
  56. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/mcp/__init__.py +0 -0
  57. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/mcp_diagnostics.py +0 -0
  58. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/memory/__init__.py +0 -0
  59. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/memory/store.py +0 -0
  60. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/models.py +0 -0
  61. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/monorepo.py +0 -0
  62. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/observability.py +0 -0
  63. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/optimizer.py +0 -0
  64. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/planner.py +0 -0
  65. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/process_lifecycle.py +0 -0
  66. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/py.typed +0 -0
  67. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/query_expansion.py +0 -0
  68. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/ranking.py +0 -0
  69. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/resolver.py +0 -0
  70. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/resources/__init__.py +0 -0
  71. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/resources/cache.py +0 -0
  72. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/resources/coalescer.py +0 -0
  73. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/resources/debouncer.py +0 -0
  74. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/resources/governor.py +0 -0
  75. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/resources/monitor.py +0 -0
  76. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/resources/policy.py +0 -0
  77. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/retrieval_policy.py +0 -0
  78. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/route_composer.py +0 -0
  79. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/runtime/__init__.py +0 -0
  80. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/runtime/ingestor.py +0 -0
  81. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/runtime/models.py +0 -0
  82. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/runtime/reconciliation.py +0 -0
  83. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/search/__init__.py +0 -0
  84. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/search/hybrid.py +0 -0
  85. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/search/semantic.py +0 -0
  86. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/security/__init__.py +0 -0
  87. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/security/paths.py +0 -0
  88. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/security/redaction.py +0 -0
  89. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/semantic_decorators.py +0 -0
  90. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/target_resolver.py +0 -0
  91. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/task.py +0 -0
  92. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph/tool_selection_eval.py +0 -0
  93. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph_engine.egg-info/dependency_links.txt +0 -0
  94. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph_engine.egg-info/entry_points.txt +0 -0
  95. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph_engine.egg-info/requires.txt +0 -0
  96. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/src/codegraph_engine.egg-info/top_level.txt +0 -0
  97. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_active_coding_protection.py +0 -0
  98. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_adaptive_planning.py +0 -0
  99. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_adversarial_edge_cases.py +0 -0
  100. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_agent_ux_hardening.py +0 -0
  101. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_agent_ux_text_search_file_inspection.py +0 -0
  102. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_artifact_classification.py +0 -0
  103. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_artifact_retrieval_policy.py +0 -0
  104. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_benchmark_infra.py +0 -0
  105. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_bounded_caches.py +0 -0
  106. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_change_impact.py +0 -0
  107. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_cli_doctor_privacy.py +0 -0
  108. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_conservative_binding.py +0 -0
  109. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_context_budget.py +0 -0
  110. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_context_cache.py +0 -0
  111. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_context_compiler_v2.py +0 -0
  112. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_core.py +0 -0
  113. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_database_integrity.py +0 -0
  114. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_database_runtime_intelligence_and_security.py +0 -0
  115. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_debouncer.py +0 -0
  116. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_dependency_injection.py +0 -0
  117. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_determinism_and_soak.py +0 -0
  118. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_developer_audit.py +0 -0
  119. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_epistemic_relationships.py +0 -0
  120. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_evaluation_framework.py +0 -0
  121. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_framework_analyzers.py +0 -0
  122. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_framework_routes_persistence.py +0 -0
  123. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_git_intelligence.py +0 -0
  124. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_hardening.py +0 -0
  125. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_interrogation_contracts.py +0 -0
  126. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_latency_modes_and_parallel.py +0 -0
  127. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_mcp_integration.py +0 -0
  128. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_monorepo_packages.py +0 -0
  129. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_package_boundaries.py +0 -0
  130. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_phase10_context_optimization.py +0 -0
  131. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_phase11_agent_integration.py +0 -0
  132. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_phase12_hardening.py +0 -0
  133. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_phase13_agent_brain_and_rc.py +0 -0
  134. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_phase2.py +0 -0
  135. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_platform_resources.py +0 -0
  136. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_ranking_engine.py +0 -0
  137. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_reference_resolution.py +0 -0
  138. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_registries_and_dispatch.py +0 -0
  139. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_request_coalescer.py +0 -0
  140. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_resource_governor.py +0 -0
  141. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_retrieval_planner.py +0 -0
  142. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_route_composition.py +0 -0
  143. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_scanner_security.py +0 -0
  144. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_semantic_decorators.py +0 -0
  145. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_single_pass_parser.py +0 -0
  146. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_symbol_identity.py +0 -0
  147. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_task_ambiguity.py +0 -0
  148. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_task_mcp_tools.py +0 -0
  149. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_task_normalization.py +0 -0
  150. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_task_spec.py +0 -0
  151. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_test_intelligence.py +0 -0
  152. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_v211_factory_resolution.py +0 -0
  153. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_v211_features.py +0 -0
  154. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_v211_imports_dependents_cli.py +0 -0
  155. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_v211_recursive_frameworks.py +0 -0
  156. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_v215_external_feedback.py +0 -0
  157. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_v216_installer.py +0 -0
  158. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_v217_large_repo_indexing.py +0 -0
  159. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_v21_diagnostics.py +0 -0
  160. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_v21_hard_exclusions.py +0 -0
  161. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_v21_query_expansion.py +0 -0
  162. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_v21_retrieval_policy.py +0 -0
  163. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_v21_target_resolver.py +0 -0
  164. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_verify_evidence.py +0 -0
  165. {codegraph_engine-2.1.8 → codegraph_engine-2.2.1}/tests/test_windows_and_process_lifecycle.py +0 -0
@@ -0,0 +1,627 @@
1
+ Metadata-Version: 2.4
2
+ Name: codegraph-engine
3
+ Version: 2.2.1
4
+ Summary: Deep deterministic repository intelligence for AI coding agents (code, dependencies, databases, and runtime observations)
5
+ Author: CodeGraph contributors
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/raghurammrsd/CODE_GRAPH_MCP
8
+ Project-URL: Repository, https://github.com/raghurammrsd/CODE_GRAPH_MCP
9
+ Project-URL: Documentation, https://github.com/raghurammrsd/CODE_GRAPH_MCP/blob/main/docs/agent-brain.md
10
+ Project-URL: Changelog, https://github.com/raghurammrsd/CODE_GRAPH_MCP/blob/main/CHANGELOG.md
11
+ Project-URL: Issues, https://github.com/raghurammrsd/CODE_GRAPH_MCP/issues
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Requires-Python: >=3.12
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: pydantic>=2.7
21
+ Requires-Dist: typer>=0.12
22
+ Requires-Dist: mcp<2,>=1.0
23
+ Provides-Extra: mcp
24
+ Requires-Dist: mcp<2,>=1.0; extra == "mcp"
25
+ Provides-Extra: system
26
+ Requires-Dist: psutil>=5.9; extra == "system"
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest>=8; extra == "dev"
29
+ Requires-Dist: pytest-cov>=5; extra == "dev"
30
+ Requires-Dist: ruff>=0.6; extra == "dev"
31
+ Requires-Dist: mypy>=1.10; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ <p align="center">
35
+ <img src="docs/assets/codegraph_logo.jpg" alt="CodeGraph MCP — Deep Deterministic Repository Intelligence for AI Coding Agents" width="500" />
36
+ </p>
37
+
38
+ <h1 align="center">CodeGraph MCP Engine (v2.2.1)</h1>
39
+
40
+ <p align="center">
41
+ <strong>Deep deterministic repository intelligence for AI coding agents.</strong>
42
+ </p>
43
+
44
+ <p align="center">
45
+ <a href="https://pypi.org/project/codegraph-engine/2.2.1/"><img src="https://img.shields.io/badge/pypi-codegraph--engine%20v2.2.1-blue.svg" alt="PyPI: codegraph-engine v2.2.1" /></a>
46
+ <a href="pyproject.toml"><img src="https://img.shields.io/badge/python-3.12%20%7C%203.13-3776AB.svg" alt="Python 3.12 | 3.13" /></a>
47
+ <a href="src/codegraph/mcp/server.py"><img src="https://img.shields.io/badge/MCP-14%20default%20%7C%2056%20full%20tools-2ea043.svg" alt="MCP Tools: 14 default | 56 full" /></a>
48
+ <a href="tests/"><img src="https://img.shields.io/badge/pytest-861%20passed-brightgreen.svg" alt="Tests: 861 passed" /></a>
49
+ <a href="pyproject.toml"><img src="https://img.shields.io/badge/ruff-0%20errors-success.svg" alt="Ruff: 0 errors" /></a>
50
+ <a href="src/codegraph/"><img src="https://img.shields.io/badge/mypy-0%20issues%20(80%20files)-blue.svg" alt="Mypy: strict" /></a>
51
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" /></a>
52
+ </p>
53
+
54
+ <p align="center">
55
+ <a href="https://pypi.org/project/codegraph-engine/2.2.1/"><strong>PyPI (v2.2.1)</strong></a> •
56
+ <a href="#1-whats-new-in-v220"><strong>What's New in v2.2.1</strong></a> •
57
+ <a href="#2-quickstart-30-second-setup"><strong>Quickstart</strong></a> •
58
+ <a href="#4-real-world-cli-outputs"><strong>Real-World Outputs</strong></a> •
59
+ <a href="#6-database-intelligence"><strong>Database Intelligence</strong></a> •
60
+ <a href="#7-zero-friction-runtime-intelligence--static-reconciliation"><strong>Runtime Evidence</strong></a> •
61
+ <a href="#9-measured-performance-and-scaling-benchmarks"><strong>Measured Performance</strong></a> •
62
+ <a href="docs/agent-brain.md"><strong>56-Tool Reference</strong></a> •
63
+ <a href="https://github.com/raghurammrsd/CODE_GRAPH_MCP"><strong>GitHub</strong></a>
64
+ </p>
65
+
66
+ ```text
67
+ The AI reasons.
68
+ CodeGraph MCP interrogates the repository.
69
+ The evidence stays traceable.
70
+ ```
71
+
72
+ **CodeGraph MCP gives AI coding agents an evidence-backed understanding of code, dependencies, databases, and optional runtime observations.**
73
+ > **Supported Languages & Frameworks:** First-class **Python** (`FastAPI`, `Flask`, `Django`, `SQLAlchemy`, `Celery`, `pytest`) + **TypeScript / JavaScript** (`.ts`, `.tsx`, `.js`, `.jsx`) & **Express.js** support.
74
+
75
+ When an AI coding agent works inside a complex Python or full-stack codebase, raw text search forces it to open dozens of files and mentally reconstruct call chains, router prefixes, dependency injection providers, and ORM table mappings inside its context window. CodeGraph MCP eliminates blind exploration by interrogating the codebase for deterministic, AST-verified facts.
76
+
77
+ ![CodeGraph MCP v2.2.1 Architecture & Concurrency Pipeline](docs/assets/v22_concurrency_runtime_pipeline.svg)
78
+
79
+ ---
80
+
81
+ ## 1. What's New in v2.2.1
82
+
83
+ Version `2.2.1` solves the core operational, concurrency, context saturation, and developer friction bottlenecks in the Agent-MCP ecosystem:
84
+
85
+ | Bottleneck Solved | How It Worked Before | CodeGraph MCP v2.2.1 Solution | Impact |
86
+ | :--- | :--- | :--- | :--- |
87
+ | **Runtime Telemetry Cold Start** | User had to manually configure OpenTelemetry exporters or Pino JSON log streaming pipelines. | **`codegraph run <command>`**: Transparent 1-line wrapper (`codegraph run npm run dev`, `codegraph run uvicorn main:app`) injecting non-invasive hooks (`NODE_OPTIONS` / `PYTHONSTARTUP`). | **Zero code changes**; streams HTTP route hits, latencies, and exception traces directly into `.codegraph/runtime.sqlite3`. |
88
+ | **Database Concurrency (`database is locked`)** | Concurrent agent queries and background indexers could lock the SQLite database and raise crashes. | Enforced permanent **`WAL`** mode, **`synchronous = NORMAL`**, **`busy_timeout = 15000`** (15s), **`cache_size = -64000`** (64MB), and in-memory temporary storage. | Completely eliminates `database is locked` errors during parallel AI interrogation. |
89
+ | **Index Freshness Verification Latency** | Full-repository file hash comparisons took seconds before queries on large codebases. | **Instant Git Commit Fast Path**: Validates `git rev-parse HEAD` match + clean `git status --porcelain`. Falls back to `st_mtime < idx_at` stat checks. | Reduces freshness verification from seconds to **`< 5ms`** on clean repositories. |
90
+ | **Enterprise Monorepo Context Saturation** | Queries on 40,000-file monorepos could emit 50,000+ tokens for all routes or tables, blowing LLM context windows. | **Bounded Pagination**: Added `limit`, `offset`, `total_count`, and `has_more` to `list_routes` and `get_db_schema`. Added `--limit` / `--offset` to CLI `routes`. | Bounded context token consumption with strict pagination safeguards. |
91
+ | **Client Disconnection (`exit status 0xffffffff`)** | Stdio MCP pipe termination caused permanent crash loops in agent IDEs on server updates or restarts. | **Multi-Transport Resiliency**: Added **`--transport sse`** (`--port`, `--host`) to `codegraph serve` and `codegraph mcp serve`. | Enables hot-reconnecting SSE HTTP transport alongside stdio for robust IDE bridges. |
92
+
93
+ ---
94
+
95
+ ## 2. Quickstart (30-Second Setup)
96
+
97
+ ### Step 1: Install the Package
98
+
99
+ ```bash
100
+ pip install "codegraph-engine[mcp]"
101
+ ```
102
+
103
+ ### Step 2: Configure Your AI Coding Agents (`codegraph install`)
104
+
105
+ CodeGraph MCP includes an interactive, idempotent onboarding installer ([`src/codegraph/installer.py`](src/codegraph/installer.py)) that detects installed AI coding agents (**Claude Code**, **Cursor**, **Antigravity**, **Codex CLI**, **Gemini CLI**, and **Cline**), configures `mcpServers.codegraph`, installs marker-bounded routing instructions (`<!-- CODEGRAPH:START -->` … `<!-- CODEGRAPH:END -->`), and verifies server health:
106
+
107
+ ```bash
108
+ # Interactive setup (detects installed agents, previews planned changes, asks confirmation)
109
+ codegraph install
110
+
111
+ # Non-interactive setup for all detected agents in the current project
112
+ codegraph install --yes --target auto --location local
113
+
114
+ # Preview exact file modifications without writing anything
115
+ codegraph install --dry-run
116
+ ```
117
+
118
+ ### Step 3: Initialize & Verify Your Project Index
119
+
120
+ ```bash
121
+ cd your-project
122
+ codegraph init
123
+ codegraph status
124
+ codegraph doctor
125
+ ```
126
+
127
+ > **Dynamic Index Hot-Reloading:** If your AI coding agent launches `codegraph mcp serve` before you run `codegraph init`, you do **not** need to restart your IDE or MCP session. As soon as `codegraph init` or `codegraph index` creates or updates `.codegraph.sqlite3`, the running MCP server automatically detects the database on the next tool call and refreshes its in-memory graph cache (`get_repository_status(reload=True, reindex=True)` can also be invoked directly by the agent).
128
+
129
+ ### Step 4: Run With Zero-Friction Telemetry (`codegraph run`)
130
+
131
+ Wrap your development server transparently to stream real HTTP routes, durations, and uncaught exceptions directly into CodeGraph MCP:
132
+
133
+ ```bash
134
+ # Node / Express / Next.js
135
+ codegraph run npm run dev
136
+
137
+ # Python / FastAPI / Uvicorn
138
+ codegraph run uvicorn main:app --reload
139
+
140
+ # Django
141
+ codegraph run python manage.py runserver
142
+ ```
143
+
144
+ ---
145
+
146
+ ## 3. Core Architecture & Mental Model
147
+
148
+ ```mermaid
149
+ flowchart TD
150
+ A["AI Coding Agent (Claude, Cursor, Antigravity, Cline)"] --> B["CodeGraph MCP Server (stdio or SSE)"]
151
+ B --> C["Deterministic Repository Intelligence"]
152
+
153
+ C --> D["AST Semantic Graph (Callers, Callees, References, DI)"]
154
+ C --> E["Literal & Regex Text Search (search_code)"]
155
+ C --> F["Bounded Source Inspection (get_file)"]
156
+ C --> G["Database Intelligence (Tables, ORM, Migrations, R/W)"]
157
+ C --> H["Zero-Friction Runtime Telemetry (codegraph run)"]
158
+
159
+ D --> I["Structured Evidence + Epistemic Labels"]
160
+ E --> I
161
+ F --> I
162
+ G --> I
163
+ H --> I
164
+
165
+ I --> J["Context Optimization & Secret Redaction"]
166
+ J --> A
167
+ ```
168
+
169
+ ### Routing Each Question to the Right Primitive
170
+
171
+ ```text
172
+ STRUCTURAL → Graph tools (find_symbol, find_callers, find_callees, find_references, find_routes)
173
+ TEXTUAL → search_code (literal/regex search across Python, HTML/Jinja, JS/TS, CSS, YAML/JSON, SQL)
174
+ SOURCE → get_file (bounded start_line..end_line source inspection with truncation metadata)
175
+ GRAPH → Trace tools (trace_path, trace_flow, analyze_impact, get_git_impact)
176
+ DATABASE → Database tools (get_db_schema, find_db_tables, find_db_readers, find_db_writers, get_db_impact)
177
+ RUNTIME → Runtime tools (codegraph run, ingest_runtime_traces, get_runtime_trace, reconcile_static_runtime)
178
+ EDITING → Native agent / IDE editing tools
179
+ ```
180
+
181
+ ---
182
+
183
+ ## 4. Real-World CLI Outputs
184
+
185
+ Below are exact, verifiable outputs produced by CodeGraph MCP v2.2.1:
186
+
187
+ ### 1. Zero-Friction Runtime Interceptor (`codegraph run`)
188
+
189
+ ```bash
190
+ $ codegraph run python3 -c "print('>> Dev server active on port 8000')"
191
+ >> Dev server active on port 8000
192
+ ```
193
+ *HTTP requests, status codes, and exceptions are automatically streamed to `.codegraph/runtime.sqlite3` with child exit codes preserved.*
194
+
195
+ ### 2. Instant Index Freshness Check (`codegraph status`)
196
+
197
+ ```bash
198
+ $ codegraph status .
199
+ {
200
+ "repository": "/Users/raghuram/Documents/ChatGPT/MCP",
201
+ "freshness": "FRESH",
202
+ "freshness_detail": "Index matches current repository state.",
203
+ "files": 190,
204
+ "chunks": 1965,
205
+ "symbols": 1947,
206
+ "framework_routes": 0,
207
+ "graph_edges": 12712,
208
+ "resource_profile": "BALANCED",
209
+ "pressure_level": "NORMAL",
210
+ "activity_mode": "IDLE",
211
+ "estimated_memory_mb": 43.23,
212
+ "modified_files": [],
213
+ "deleted_files": [],
214
+ "parse_failed_files": []
215
+ }
216
+ ```
217
+ *Validated in `< 5ms` via the Git commit diff fast path.*
218
+
219
+ ### 3. Incremental Indexing with 16-Phase Telemetry (`codegraph index --verbose`)
220
+
221
+ ```bash
222
+ $ codegraph index --verbose
223
+ Phase: Repository Scan
224
+ 190 / 190 files | 100% | elapsed: 0.09s | rate: 128,203 files/min | memory: 42 MB
225
+ Phase: Post-Processing
226
+ 190 / 190 files | 100% | elapsed: 0.62s | rate: 18,273 files/min | memory: 67 MB
227
+ Phase: Symbol Resolution
228
+ 190 / 190 files | 100% | elapsed: 0.80s | rate: 14,311 files/min | memory: 91 MB
229
+ Phase: Relationship Resolution
230
+ 190 / 190 files | 100% | elapsed: 1.49s | rate: 7,648 files/min | memory: 116 MB
231
+ Phase: Database Analysis
232
+ 190 / 190 files | 100% | elapsed: 1.77s | rate: 6,424 files/min | memory: 120 MB
233
+ Phase: Final Commit & Checkpoint
234
+ 190 / 190 files | 100% | elapsed: 2.59s | rate: 4,396 files/min | memory: 141 MB
235
+
236
+ Summary: elapsed=2.595s peak_rss=141.0MB max_wal=9.44MB final_wal=0.00MB commits=15 checkpoints=15
237
+ [repository_scan] 88.1ms files=190 items=190 writes=0
238
+ [ast_parsing] 154.7ms files=13 items=3322 writes=0
239
+ [database_analysis] 283.9ms files=13 items=1631 writes=0
240
+ [symbol_resolution] 52.5ms files=190 items=5854 writes=0
241
+ [relationship_resolution] 694.0ms files=190 items=32806 writes=0
242
+ [sqlite_writes] 1146.4ms files=13 items=50206 writes=50208
243
+ scanned=190 indexed=13 unchanged=177 removed=0
244
+ ```
245
+
246
+ ### 4. Bounded Monorepo Route Discovery (`codegraph routes --limit 3`)
247
+
248
+ ```bash
249
+ $ codegraph routes --limit 3
250
+ Found 3 route(s):
251
+ [GET] /api/v1/health -> health_check (src/app/api.py:14) [fastapi]
252
+ [POST] /api/v1/orders -> create_order (src/app/orders.py:42) [fastapi]
253
+ [GET] /api/v1/users/{id} -> get_user (src/app/users.py:88) [fastapi]
254
+ ```
255
+
256
+ ### 5. Safe Background Process Termination (`codegraph stop --json`)
257
+
258
+ ```bash
259
+ $ codegraph stop --json
260
+ {
261
+ "status": "ok",
262
+ "stopped_count": 0,
263
+ "stale_cleaned_count": 0,
264
+ "processes": []
265
+ }
266
+ ```
267
+
268
+ ---
269
+
270
+ ## 5. AI/ML & Backend Architecture Examples
271
+
272
+ ### Example 1: Model Inference Service Flow
273
+
274
+ ```text
275
+ POST /v1/predict (FastAPI Route)
276
+ ↓ HANDLED_BY (FRAMEWORK_VERIFIED)
277
+ predict_endpoint (Handler)
278
+ ↓ INJECTS (DATAFLOW_VERIFIED)
279
+ get_inference_service (DI Provider)
280
+ ↓ CALLS (AST_VERIFIED)
281
+ InferenceService.run_inference
282
+ ├──►CALLS (AST_VERIFIED) ──► FeaturePreprocessor.transform
283
+ ├──►CALLS (AST_VERIFIED) ──► FraudClassifier.forward
284
+ ├──►CALLS (AST_VERIFIED) ──► ScorePostprocessor.calibrate
285
+ └──►CALLS (AST_VERIFIED) ──► PredictionRepository.log_prediction
286
+ ↓ WRITES_TABLE (AST_VERIFIED)
287
+ db:table:postgresql.public.prediction_logs
288
+ ```
289
+
290
+ **What CodeGraph MCP structurally proves**:
291
+ - `find_routes(path="/v1/predict")` resolves composed router prefixes (`MOUNTS`) to `predict_endpoint`.
292
+ - `trace_path(from_symbol="predict_endpoint", to_symbol="log_prediction")` proves the multi-hop execution chain across DI injection, preprocessing, model execution, and persistence.
293
+ - `get_db_impact(symbol="InferenceService.run_inference")` identifies downstream writes to `prediction_logs`.
294
+
295
+ ### Example 2: Training & Evaluation Pipeline
296
+
297
+ ```text
298
+ train_cli (CLI Command Handler)
299
+ ↓ COMMAND_HANDLER (FRAMEWORK_VERIFIED)
300
+ TrainingPipeline.run
301
+ ├──►CALLS (AST_VERIFIED) ──► DatasetBuilder.load_splits
302
+ ├──►CALLS (AST_VERIFIED) ──► TokenizerTransform.encode_batch
303
+ ├──►CALLS (AST_VERIFIED) ──► Trainer.fit_epoch
304
+ ├──►CALLS (AST_VERIFIED) ──► CheckpointManager.save_weights
305
+ └──►CALLS (AST_VERIFIED) ──► Evaluator.compute_metrics
306
+ ```
307
+
308
+ **What CodeGraph MCP structurally proves**:
309
+ - `find_callees(symbol="TrainingPipeline.run")` enumerates every stage of the pipeline with exact file and line ranges.
310
+ - `find_tests(symbol="Evaluator.compute_metrics")` locates the unit and regression tests covering metric calculation.
311
+ - When a transform or model class is dynamically instantiated from a YAML string (`getattr(models, cfg.arch)`), CodeGraph MCP explicitly records `POSSIBLE_CALLS` (`POSSIBLE`) or `UNRESOLVED_REFERENCE` (`UNKNOWN`) rather than fabricating a false static call edge.
312
+
313
+ ### Example 3: LLM Agent & Tool Registry
314
+
315
+ ```text
316
+ POST /api/chat (LLM Endpoint)
317
+ ↓ HANDLED_BY (FRAMEWORK_VERIFIED)
318
+ chat_handler
319
+ ↓ CALLS (AST_VERIFIED)
320
+ AgentRunner.execute_step
321
+ ├──►REGISTERS / REGISTERED_HANDLER ──► ToolRegistry ("search_orders", "refund_order")
322
+ ├──►CALLS (AST_VERIFIED) ──► ContextBuilder.compile
323
+ ├──►READS_TABLE (AST_VERIFIED) ──► db:table:postgresql.public.conversations
324
+ └──►CALLS (AST_VERIFIED) ──► ModelProviderClient.generate
325
+ ```
326
+
327
+ **What CodeGraph MCP structurally proves**:
328
+ - Tracks decorator and call-based registrations (`@tool_registry.register("search_orders")`) via `REGISTERS` and `REGISTERED_HANDLER` edges.
329
+ - Tracks environment variable dependencies (`os.getenv("OPENAI_API_KEY")`) as `READS_ENV` edges with the variable name only—never indexing or exposing secret values.
330
+
331
+ ---
332
+
333
+ ## 6. Database Intelligence
334
+
335
+ [`src/codegraph/database/`](src/codegraph/database/) provides static schema, ORM model, migration, and query extraction across **SQLAlchemy**, **Django ORM**, **SQLModel**, **Prisma** (`.prisma`), **Alembic**, **Django Migrations**, and **Raw SQL** (`PostgreSQL`, `MySQL`, `SQLite`).
336
+
337
+ ```text
338
+ POST /orders
339
+ ↓ HANDLED_BY (FRAMEWORK_VERIFIED)
340
+ OrderService.create_order
341
+ ↓ CALLS (AST_VERIFIED)
342
+ OrderRepository.insert_order
343
+ ↓ WRITES_TABLE (AST_VERIFIED)
344
+ db:table:postgresql.public.orders
345
+ ↓ FOREIGN_KEY_TO (AST_VERIFIED)
346
+ orders.user_id ──► users.id
347
+ ```
348
+
349
+ ### Capabilities Exposed by the 11 Database MCP Tools
350
+ - **Table & Column Discovery** (`get_db_schema`, `get_db_table`, `find_db_tables`, `find_db_columns`): Extract tables, column types, nullability, defaults, primary keys (`HAS_PRIMARY_KEY`), indexes (`HAS_INDEX`), unique/check constraints, and foreign keys (`FOREIGN_KEY_TO`).
351
+ - **ORM Mapping** (`find_db_models`): Map SQLAlchemy `__tablename__`, Django `models.Model` (`Meta.db_table`), SQLModel `table=True`, and Prisma `model` blocks via `MAPS_TO_TABLE` and `MAPS_TO_COLUMN`.
352
+ - **Readers, Writers & Callers** (`find_db_readers`, `find_db_writers`, `find_db_callers`, `find_db_queries`): Identify every function or method that executes `SELECT` (`READS_TABLE`) or `INSERT` / `UPDATE` / `DELETE` / `.add()` / `.save()` (`WRITES_TABLE`) against a table.
353
+ - **Migration Lineage & Schema Blast Radius** (`find_db_relationships`, `get_db_impact`): Track Alembic (`op.create_table`, `op.add_column`) and Django (`migrations.CreateModel`, `migrations.AddField`) operations (`MIGRATES_TABLE`) and compute bidirectional code $\leftrightarrow$ database impact.
354
+
355
+ ---
356
+
357
+ ## 7. Zero-Friction Runtime Intelligence & Static Reconciliation
358
+
359
+ Static analysis proves what **can** happen structurally; runtime telemetry records what **was observed** during execution. CodeGraph MCP v2.2.1 brings them together transparently:
360
+
361
+ ```text
362
+ STATIC GRAPH (AST + Framework + Dataflow + DB)
363
+ +
364
+ RUNTIME OBSERVATION (codegraph run / OTel JSON / JSONL / SQL Logs)
365
+ ↓
366
+ reconcile_static_runtime()
367
+ ```
368
+
369
+ ### Reconciliation Outcomes ([`ReconciliationStatus`](src/codegraph/runtime/models.py))
370
+
371
+ | Reconciliation Status | Static Graph | Runtime Trace | Meaning |
372
+ | :--- | :---: | :---: | :--- |
373
+ | **`CONFIRMED_RUNTIME_PATH`** | Present | Observed | Static relationship is structurally proven **and** observed executing in ingested traces. |
374
+ | **`NOT_OBSERVED_AT_RUNTIME`** | Present | Not observed | Statically valid edge was not exercised in the recorded trace sample. |
375
+ | **`RUNTIME_ONLY_OBSERVED`** | Dynamic / `UNKNOWN` | Observed | Executed at runtime (e.g., plugin hook, `getattr`, dynamic SQL) where static analysis was `UNKNOWN`. |
376
+ | **`STATIC_RUNTIME_CONFLICT`** | Target A | Target B | Runtime execution dispatched to a different target than static resolution (e.g., dependency override). |
377
+
378
+ ### Epistemic Rules for Runtime Evidence
379
+ 1. **Runtime Telemetry Is Non-Invasive**: `codegraph run` uses standard environment variable hooks (`NODE_OPTIONS`, `PYTHONSTARTUP`). You never modify application source code.
380
+ 2. **`NOT_OBSERVED_AT_RUNTIME` Does Not Mean Dead Code**: It only indicates that the code path was not triggered during the recorded trace window (such as an error branch or periodic batch job).
381
+ 3. **Runtime Observations Never Overwrite Static Proof**: Runtime spans are recorded with `evidence_class="RUNTIME_OBSERVED"` and strictly distinguished from `AST_VERIFIED` and `FRAMEWORK_VERIFIED` static edges.
382
+
383
+ ---
384
+
385
+ ## 8. Epistemic Trust & Evidence Contract
386
+
387
+ CodeGraph MCP enforces a fail-closed evidence contract ([`src/codegraph/evidence_contract.py`](src/codegraph/evidence_contract.py)) across all **51 canonical relationship types** and **9 evidence classes**. CodeGraph MCP prefers **explicit uncertainty** over **fabricated certainty**:
388
+
389
+ ```text
390
+ Dynamically resolved target (getattr(handler, action_name)())
391
+ ↓
392
+ UNRESOLVED_REFERENCE / POSSIBLE_CALLS (status = "UNKNOWN" | "POSSIBLE")
393
+ (Never fabricated into a verified CALLS edge)
394
+ ```
395
+
396
+ | Epistemic Status | Allowed Evidence Classes | What It Means |
397
+ | :--- | :--- | :--- |
398
+ | **`FACT`** | `AST_VERIFIED`, `STATIC_VERIFIED`, `FRAMEWORK_VERIFIED`, `DATAFLOW_VERIFIED` | Proven directly from syntax tree, framework decorator/router semantics, or conservative local dataflow. |
399
+ | **`RUNTIME_OBSERVED`** | `RUNTIME_OBSERVED` | Observed in traces captured by `codegraph run` or ingested OTel/JSONL/SQL logs (`hit_count`, `duration_ms`). |
400
+ | **`POSSIBLE`** | `POSSIBLE` | Plausible candidate relationship (`POSSIBLE_CALLS`, `POSSIBLE_TABLE`) requiring source inspection before mutation. |
401
+ | **`AMBIGUOUS`** | `AMBIGUOUS` | Multiple symbols or database tables match the bare identifier across modules or dialects; returns sorted `candidates`. |
402
+ | **`UNKNOWN`** | `UNKNOWN`, `RUNTIME_UNOBSERVED` | Target cannot be statically proven (dynamic reflection, external dependency, or `reason="resolution_budget_exceeded"`). |
403
+ | **`CONFLICT`** | Static vs. Runtime / Multi-Source | Static analysis and runtime observation (or competing definitions) disagree. |
404
+
405
+ ---
406
+
407
+ ## 9. Measured Performance and Scaling Benchmarks
408
+
409
+ ### 4-Tier Scaling Summary (`54` → `2,504` Files)
410
+
411
+ Recorded using [`benchmarks/run_v217_indexing_benchmark.py`](benchmarks/run_v217_indexing_benchmark.py) on macOS `arm64`, Python `3.13` with permanent SQLite WAL concurrency:
412
+
413
+ | Workload Tier | Files | Symbols | Graph Edges | Baseline Total | v2.2.1 Total | Improvement | Peak RSS | Peak WAL | Final WAL |
414
+ | :--- | ---: | ---: | ---: | ---: | ---: | :--- | ---: | ---: | ---: |
415
+ | **Small** | `54` | `115` | `398` | `0.527 s` | `0.325 s` | **38.3% faster (`1.62x`)** | `46.25 MB` | `1.544 MB` | `0.0 MB` |
416
+ | **Medium** | `304` | `615` | `2,248` | `2.564 s` | `1.613 s` | **37.1% faster (`1.59x`)** | `62.67 MB` | `4.098 MB` | `0.0 MB` |
417
+ | **Large** | `1,004` | `2,015` | `7,428` | `8.730 s` | `5.296 s` | **39.3% faster (`1.65x`)** | `103.44 MB` | `5.033 MB` | `0.0 MB` |
418
+ | **Stress** | `2,504` | `5,015` | `18,528` | `21.983 s` | `13.395 s` | **39.1% faster (`1.64x`)** | `180.89 MB` | `6.628 MB` | `0.0 MB` |
419
+
420
+ ### Stress Tier (`2,504` Files) Phase Breakdown
421
+
422
+ | Phase / Metric | Legacy Baseline | v2.2.1 Release | Measured Improvement |
423
+ | :--- | ---: | ---: | :--- |
424
+ | **Total Indexing Time** | `21.983 s` | `13.395 s` | **39.1% faster (`1.64x`)** |
425
+ | **Database Intelligence Pass** | `4.818 s` | `0.832 s` | **82.7% faster (`5.79x`)** |
426
+ | **Post-Processing Phase** | `13.770 s` | `7.056 s` | **48.8% faster (`1.95x`)** |
427
+ | **Symbol Resolution Phase** | `3.133 s` | `1.107 s` | **64.7% faster (`2.83x`)** |
428
+ | **Single-File Incremental Update** | `4.408 s` | `2.063 s` | **53.2% faster (`2.14x`)** |
429
+ | **Throughput (`files/sec`)** | `113.9 files/s` | `186.9 files/s` | **`+64.1%` throughput** |
430
+ | **Peak SQLite WAL Size** | `46.980 MB` | `6.628 MB` | **85.9% reduction (`7.09x` smaller)** |
431
+ | **Final SQLite WAL Size** | `0.000 MB` | `0.000 MB` | **100% reclaimed (`TRUNCATE`)** |
432
+
433
+ ![CodeGraph MCP — Measured Large-Repository Scaling](docs/assets/large_repo_scaling.svg)
434
+
435
+ ### 50-Task Production Benchmark Results (`v2.2.1`)
436
+
437
+ Evaluated across 50 production tasks and 10 categories via [`benchmarks/run_v21_eval.py`](benchmarks/run_v21_eval.py):
438
+
439
+ | Production Benchmark Metric | Measured Result | Production Target | Status |
440
+ | :--- | :---: | :---: | :---: |
441
+ | **Task Coverage** | **88.0%** | $\ge 80.0\%$ | **PASS** |
442
+ | **Symbol Recall** | **61.9%** | $\ge 50.0\%$ | **PASS** |
443
+ | **FACT Correctness** | **100.0%** | $\ge 98.0\%$ | **PASS** |
444
+ | **Unsupported Claim Rate (Hallucinations)** | **0.0%** | $\le 1.0\%$ | **PASS** |
445
+ | **UNKNOWN Correctness** | **98.0%** | $\ge 95.0\%$ | **PASS** |
446
+ | **AMBIGUITY Correctness** | **100.0%** | $\ge 90.0\%$ | **PASS** |
447
+ | **Average Context Payload** | **510 tokens** | $\le 1,000$ tokens | **PASS** |
448
+ | **Average Context Latency** | **40.52 ms** | $\le 100$ ms | **PASS** |
449
+ | **Token Reduction vs Full-File Extraction** | **41.8%** | $\ge 35.0\%$ | **PASS** |
450
+
451
+ ### 32-Task A/B Exploration Evaluation ([`src/codegraph/tool_selection_eval.py`](src/codegraph/tool_selection_eval.py))
452
+
453
+ | Metric (32-Task Evaluation Suite) | Mode A (Unassisted Grep & File Reads) | Mode B (CodeGraph MCP) | Measured Improvement |
454
+ | :--- | ---: | ---: | :--- |
455
+ | **Total Tool Calls (32 Tasks)** | `164 calls` (`~5.1 / task`) | `71 calls` (`~2.2 / task`) | **`-56.7% fewer tool calls`** |
456
+ | **Direct Full-File Reads** | `161 full-file reads` | `7 bounded slice reads` | **`-95.7% fewer file reads`** |
457
+ | **Context Tokens per Task** | `3,000 – 12,000+ tokens` | `~510 tokens` avg | **`65.0% – 85.6% token reduction`** |
458
+ | **Query Latency (`p50`)** | Hundreds of ms (multi-step `grep`) | `20.0 ms` cold / `0.67 ms` warm | **Sub-20ms indexed lookup** |
459
+ | **First-Tool Selection Accuracy** | `9.38%` | `100.0%` | **`+90.62%`** |
460
+ | **Unsupported Claims (Hallucinated Edges)** | `11 (34.38%)` | `0 (0.00%)` | **`0% unsupported claims`** |
461
+ | **Task Accuracy** | `59.84%` | `100.0%` | **`+40.16%`** |
462
+
463
+ ![CodeGraph MCP — Measured Context & Exploration Efficiency](docs/assets/performance_comparison.svg)
464
+
465
+ ---
466
+
467
+ ## 10. Where CodeGraph MCP Fits
468
+
469
+ CodeGraph MCP works **alongside** your editor's language server (LSP), `ripgrep`, and structural AST tools:
470
+
471
+ Legend: `✓` supported • `◐` partial / workflow-dependent • `—` not supported
472
+
473
+ | Capability | CodeGraph MCP (`v2.2.1`) | Editor LSP | Structural AST (`ast-grep`) | Lexical Search (`ripgrep`) | Remote Code Search (`Sourcegraph`) |
474
+ | :--- | :---: | :---: | :---: | :---: | :---: |
475
+ | **100% Local-First & Offline Operation** | ✓ | ✓ | ✓ | ✓ | — |
476
+ | **Native MCP Server for AI Agents** | ✓ (14 default / 56 full) | — | ◐ | — | ✓ |
477
+ | **Multi-Transport Support (stdio + SSE HTTP)** | ✓ | — | — | — | ◐ |
478
+ | **Zero-Friction Runtime Interceptor (`codegraph run`)** | ✓ | — | — | — | — |
479
+ | **Semantic Symbol Graph (Callers / Callees)** | ✓ | ◐ (Position-based) | ◐ (Pattern-based) | — | ✓ (SCIP) |
480
+ | **Framework Route, Mount & DI Graph** | ✓ (`FastAPI`/`Flask`/`Django`/`Express`) | — | ◐ (Custom rules) | — | — |
481
+ | **Database Schema, ORM, Migration & Table R/W** | ✓ (11 DB tools) | — | — | — | — |
482
+ | **Opt-In Runtime Ingestion & Reconciliation** | ✓ (OTel / JSONL / SQL) | — | — | — | — |
483
+ | **Explicit Epistemic States (`FACT`/`UNKNOWN`)** | ✓ | — | — | — | — |
484
+ | **Literal Text Search Across HTML/JS/CSS/Config** | ✓ (`search_code`) | — | — | ✓ | ✓ |
485
+ | **Interactive Editor Hover & Diagnostics** | — | ✓ | ✓ (Lint/Rewrite) | — | — |
486
+
487
+ ![Repository Retrieval Approaches — Capability Comparison](docs/assets/capability_heatmap.svg)
488
+
489
+ ---
490
+
491
+ ## 11. Security, Privacy & Redaction Boundaries
492
+
493
+ CodeGraph MCP runs **100% locally** (`stdio` / `sse` MCP + local `.codegraph.sqlite3`), never executes repository code during indexing, and enforces strict file-access and redaction boundaries ([`src/codegraph/security/paths.py`](src/codegraph/security/paths.py), [`src/codegraph/security/redaction.py`](src/codegraph/security/redaction.py)):
494
+
495
+ | Security Boundary | Enforcement Mode | Exact Behavior |
496
+ | :--- | :---: | :--- |
497
+ | **Sensitive Files** (`.env`, `*.pem`, `*.key`, `*.crt`, `id_rsa*`, `kubeconfig*`, `.npmrc`, `.pypirc`, `*secret*.json`) | **`BLOCKED`** | Excluded from indexing and FTS; direct inspection via `get_file` or `read_file` is rejected with `SENSITIVE_FILE_ACCESS_DENIED`. |
498
+ | **Path Traversal & Symlinks** (`../`, `%2e%2e`, null bytes, external symlinks) | **`BLOCKED`** | Canonical path check in `resolve_within_repo()` raises `SecurityError(ErrorCode.PATH_OUTSIDE_REPOSITORY)`. |
499
+ | **Binary Files** (`.pyc`, `.so`, `.dylib`, `.dll`, `.exe`, images, archives, PDFs) | **`BLOCKED`** | Classified as `BINARY` and skipped during indexing and text search. |
500
+ | **Environment Variable Reads in Code** (`os.getenv("DATABASE_URL")`) | **Metadata Only** | Records `READS_ENV` with the **variable name only**; never reads `.env` or runtime environment values. |
501
+ | **Database Connection Strings** (`postgresql://user:pass@host:5432/prod`) | **`REDACTED`** | Preserves dialect and database name while sanitizing credentials to `postgresql://[REDACTED]@[REDACTED]/prod`. |
502
+ | **API Keys, Bearer Tokens, JWTs & Private Keys** (`sk-...`, `ghp_...`, `AKIA...`) | **`REDACTED`** | Replaced with `[REDACTED_SECRET]` or `[REDACTED_PRIVATE_KEY]` before indexing, search, or MCP output. |
503
+ | **Runtime HTTP Headers & SQL Literals** (`authorization`, `cookie`, `WHERE password = '...'`) | **`REDACTED`** | Sensitive runtime keys and SQL literals are scrubbed (`[REDACTED]` / `?`) during `ingest_runtime_traces`. |
504
+
505
+ Run `codegraph privacy .` at any time to audit the local database and verify that no sensitive files or unredacted secrets are stored.
506
+
507
+ ---
508
+
509
+ ## 12. MCP Tooling & Profiles (14 Default / 56 Full)
510
+
511
+ By default, `create_server()` exposes the **14-tool `agent` profile** so AI coding agents receive a focused, non-overlapping tool surface. All 56 tools are available under `--profile full`.
512
+
513
+ ### Default `agent` Profile (14 High-Signal Tools)
514
+
515
+ | Category | Tool | Purpose |
516
+ | :--- | :--- | :--- |
517
+ | **Discovery (7)** | `find_symbol` | Locate a symbol definition by short, qualified, or canonical name (`symbol=...`). |
518
+ | | `search_code` | Literal or regex search across Python, JS/TS, HTML/Jinja, CSS, YAML/JSON, Markdown, and SQL. |
519
+ | | `find_references` | Find verified AST reference, import, and registration sites for a symbol. |
520
+ | | `find_callers` | Find functions, methods, or route handlers that call the target symbol (`CALLS`, `POSSIBLE_CALLS`). |
521
+ | | `find_callees` | Find functions, methods, or constructors called by the target symbol. |
522
+ | | `find_tests` | Find `pytest` / `unittest` test functions covering a symbol, route, DI provider, or event handler. |
523
+ | | `find_routes` | Discover FastAPI, Flask, Django, and Express HTTP routes with composed mount prefixes. |
524
+ | **Details & Context (5)** | `get_symbol` | Retrieve signature, decorators, docstring, line range, and methods for a symbol. |
525
+ | | `get_file` | Read bounded line ranges (`start_line`, `end_line`, `max_lines`) and AST symbol outline of a file. |
526
+ | | `get_context` | Compile a token-budgeted, task-aware context packet (`query`, `intent`, `max_tokens`). |
527
+ | | `get_architecture` | Summarize repository languages, layers, packages, entrypoints, routes, and database entities. |
528
+ | | `get_git_impact` | Compute blast-radius impact (`changed_files`, `affected_callers`, `affected_routes`, `tests`) for a Git diff. |
529
+ | **Graph Tracing (2)** | `trace_path` | Find the shortest verified execution path between `from_symbol` and `to_symbol`. |
530
+ | | `trace_flow` | Trace upstream callers and downstream callees around `symbol` up to `depth`. |
531
+
532
+ ### All 6 Implemented MCP Profiles ([`src/codegraph/agent_capabilities.py`](src/codegraph/agent_capabilities.py))
533
+
534
+ | Profile | Tool Count | Description |
535
+ | :--- | :---: | :--- |
536
+ | **`agent`** *(default in `create_server`)* | **14** | High-signal discovery, bounded file inspection, context synthesis, and path tracing. |
537
+ | **`core`** | **13** | Lightweight symbol lookup, callers/callees, imports/dependents, routes, and architecture. |
538
+ | **`graph`** | **17** | Call-graph traversal, blast-radius impact (`analyze_impact`), and test discovery. |
539
+ | **`minimal`** | **21** | Core interrogation plus `get_context`, `search_code`, `read_file`, and `verify_evidence`. |
540
+ | **`developer`** | **34** | Interactive development with Git history (`get_file_history`, `get_recent_changes`) and retrieval planning. |
541
+ | **`full`** | **56** | Complete capability surface including **11 Database tools** (`get_db_schema`, `get_db_table`, `find_db_tables`, `find_db_columns`, `find_db_models`, `find_db_queries`, `find_db_readers`, `find_db_writers`, `find_db_callers`, `find_db_relationships`, `get_db_impact`) and **3 Runtime tools** (`ingest_runtime_traces`, `get_runtime_trace`, `reconcile_static_runtime`). |
542
+
543
+ ---
544
+
545
+ ## 13. Complete CLI Reference
546
+
547
+ Verified against [`src/codegraph/cli.py`](src/codegraph/cli.py):
548
+
549
+ ```bash
550
+ # Agent Onboarding & Uninstall
551
+ codegraph install # Interactive agent detection & setup
552
+ codegraph install --yes --target auto --location local # Non-interactive local setup
553
+ codegraph install --print-config claude # Print MCP JSON + rules for an agent
554
+ codegraph install --dry-run # Preview planned file changes
555
+ codegraph uninstall --yes # Remove CodeGraph MCP agent integrations
556
+
557
+ # Zero-Friction Runtime Interceptor (v2.2.1)
558
+ codegraph run npm run dev # Wrap Node/Express/Next.js dev server
559
+ codegraph run uvicorn main:app --reload # Wrap FastAPI/ASGI dev server
560
+ codegraph run python manage.py runserver # Wrap Django dev server
561
+ codegraph run --sample-rate 0.5 npm test # Sample 50% of captured traces
562
+
563
+ # Repository Initialization & Indexing
564
+ codegraph init . # Initialize and index repository
565
+ codegraph index . --verbose # Incremental index with 16-phase telemetry
566
+ codegraph index . --json # Output structured JSON phase telemetry
567
+ codegraph uninit --dry-run # Preview removal of .codegraph.sqlite3
568
+
569
+ # Process Lifecycle & Upgrade Lock Safety
570
+ codegraph stop # Safely stop CodeGraph MCP server for current repo
571
+ codegraph stop --all # Stop all CodeGraph-owned MCP processes across repos
572
+ codegraph doctor --processes # Inspect active MCP processes & parent PIDs
573
+
574
+ # Health, Integrity & Freshness Diagnostics
575
+ codegraph status . # Show index freshness (sub-50ms Git fast path)
576
+ codegraph doctor . --database --processes # Verify SQLite integrity, FKs, FTS, and memory
577
+ codegraph privacy . # Verify zero sensitive files indexed
578
+ codegraph version # Print CodeGraph MCP version (2.2.1)
579
+
580
+ # Code, Graph, Routes & Context Interrogation
581
+ codegraph search "authenticate" -r . # Search indexed symbols and text chunks
582
+ codegraph symbols src/codegraph/cli.py -r . # List extracted symbols in a file
583
+ codegraph get-symbol Indexer -r . # Get AST details for a symbol
584
+ codegraph resolve-symbol resolve_Repository -r . # Ground symbol or return candidates
585
+ codegraph trace Indexer -d 2 -r . # Trace callers and callees up to depth 2
586
+ codegraph routes -r . --limit 25 --offset 0 # List routes with bounded pagination
587
+ codegraph architecture -r . # Summarize repository architecture
588
+ codegraph context "trace /api/v1/auth/login" -r . # Compile token-budgeted ContextPacket
589
+
590
+ # MCP Server Subcommands
591
+ codegraph serve . # Start stdio MCP server (14 default tools)
592
+ codegraph serve . --profile full # Start stdio MCP server with all 56 tools
593
+ codegraph serve . --transport sse --port 8765 # Start SSE HTTP server on port 8765
594
+ codegraph mcp serve . --transport sse # Alias for SSE MCP server
595
+ codegraph mcp stop # Stop active MCP processes
596
+ ```
597
+
598
+ ---
599
+
600
+ ## 14. Documentation Map
601
+
602
+ - **Deep Agent Brain & 56-Tool Reference**: [`docs/agent-brain.md`](docs/agent-brain.md)
603
+ - **Compact Tool Capabilities Summary**: [`agent-rules/tool-capabilities-summary.md`](agent-rules/tool-capabilities-summary.md)
604
+ - **Detailed Multi-Tool Capability Comparison**: [`docs/tool-comparison.md`](docs/tool-comparison.md)
605
+ - **Antigravity Skill (`SKILL.md`)**: [`.agents/skills/codegraph/SKILL.md`](.agents/skills/codegraph/SKILL.md)
606
+ - **Agent Rule Packs (`Claude`, `Cursor`, `Antigravity`, `Codex`, `Gemini`, `Cline`)**: [`agent-rules/README.md`](agent-rules/README.md) & [`agent-rules/AGENTS.md`](agent-rules/AGENTS.md)
607
+ - **Engineering & Production Readiness**: [`docs/engineering/production-readiness.md`](docs/engineering/production-readiness.md)
608
+ - **Reproducible Scaling Benchmark Script**: [`benchmarks/run_v217_indexing_benchmark.py`](benchmarks/run_v217_indexing_benchmark.py)
609
+ - **Changelog**: [`CHANGELOG.md`](CHANGELOG.md)
610
+
611
+ ---
612
+
613
+ ## 15. Contributing & License
614
+
615
+ ```bash
616
+ git clone https://github.com/raghurammrsd/CODE_GRAPH_MCP.git
617
+ cd CODE_GRAPH_MCP
618
+ python3 -m venv .venv
619
+ source .venv/bin/activate
620
+ pip install -e ".[dev,mcp,system]"
621
+
622
+ python3 -m ruff check .
623
+ python3 -m mypy src/
624
+ python3 -m pytest -q
625
+ ```
626
+
627
+ Licensed under the [MIT License](LICENSE).