Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
260 lines (239 loc) · 7.09 KB
/
Copy pathpyproject.toml
File metadata and controls
260 lines (239 loc) · 7.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/cgis"]
[project]
name = "codegraph-brain"
version = "0.38.0"
description = "Semantic code graph for AI agents — deterministic FQN resolution, impact analysis and architectural drift gates, exposed over MCP."
readme = "README.md"
requires-python = ">=3.12"
license = "MIT"
license-files = ["LICENSE"]
authors = [
{ name = "Andrey G", email = "zaebuntu@gmail.com" },
]
keywords = [
"mcp",
"model-context-protocol",
"code-graph",
"static-analysis",
"tree-sitter",
"ai-agents",
"llm",
"code-review",
"architecture",
"call-graph",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Documentation",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Typing :: Typed",
"Environment :: Console",
"Operating System :: OS Independent",
]
dependencies = [
"httpx>=0.27",
"mcp[cli]>=2",
"pydantic>=2.13.4",
"pyyaml>=6.0.2",
"rich>=15.0.0",
"structlog>=25.5.0",
"tree-sitter>=0.25.2",
"tree-sitter-go>=0.25.0",
"tree-sitter-python>=0.25.0",
"tree-sitter-typescript>=0.23.2",
"typer>=0.26.7",
]
[project.urls]
Homepage = "https://github.com/zaebee/codegraph-brain"
Repository = "https://github.com/zaebee/codegraph-brain"
Documentation = "https://github.com/zaebee/codegraph-brain#readme"
Changelog = "https://github.com/zaebee/codegraph-brain/blob/main/CHANGELOG.md"
Issues = "https://github.com/zaebee/codegraph-brain/issues"
[project.optional-dependencies]
analytics = [
"duckdb>=1.1.0",
]
guardian = [
"google-genai>=0.8.0",
"mistralai>=1.0.0",
"anthropic>=1.0.0",
"cohere>=5.0.0",
"ollama>=0.3.0",
]
all = [
"codegraph-brain[analytics,guardian]",
]
[dependency-groups]
dev = [
# Also in the guardian extra: the provider tests exercise the SDK's own schema transform.
"anthropic>=1.0.0",
"duckdb>=1.1.0",
"interrogate>=1.7.0",
"ipdb>=0.13.13",
"mypy>=2.1.0",
"networkx>=3.3",
"pre-commit>=4.6.0",
"pytest>=9.0.3",
"pytest-asyncio>=0.24.0",
"pytest-cov>=7.1.0",
"ruff>=0.15.16",
"types-pyyaml>=6.0.12.20260518",
]
[project.scripts]
cgis = "cgis.cli:app"
cgis-mcp = "cgis.api.mcp_server:mcp.run"
# Same server under the package name, so `uvx codegraph-brain` starts it — what the
# MCP Registry entry (server.json, runtimeHint uvx) runs.
codegraph-brain = "cgis.api.mcp_server:mcp.run"
[tool.ruff]
# Target Python 3.12+
target-version = "py312"
line-length = 100
# Fixture corpora are inputs, not code: reformatting one changes what the
# graph-identity snapshot measures (docs/plans/2026-10-14-language-packs.md).
# benchmarks/agent_ab/analysis holds experiment gate scripts kept byte-identical to what produced
# the published lab-note numbers; reformatting them would change the code of record.
extend-exclude = ["tests/fixtures", "benchmarks/agent_ab/analysis"]
[tool.ruff.lint]
# Enable many plugins:
# E/W (pycodestyle), F (Pyflakes), I (isort), B (bugbear), UP (pyupgrade),
# SIM (flake8-simplicity), ARG (flake8-unused-arguments)
select = [
# pycodestyle
"E", # Error
"W", # Warning
# Pyflakes
"F", # pyflakes
# pyupgrade
"UP", # pyupgrade
# flake8-bugbear
"B", # flake8-bugbear
# flake8-simplify
"SIM", # flake8-simplify
# isort
"I", # isort
# mccabe
"C90", # mccabe
# pep8-naming
"N", # pep8-naming
# flake8-comprehensions
"C4", # flake8-comprehensions
# flake8-annotations
"ANN", # flake8-annotations
# flake8-async
"ASYNC", # flake8-async
# flake8-bandit
# "S", # flake8-bandit
# flake8-boolean-trap
# "FBT", # flake8-boolean-trap
# flake8-builtins
"A", # flake8-builtins
# flake8-errmsg
"EM", # flake8-errmsg
# flake8-implicit-str-concat
"ISC", # flake8-implicit-str-concat
# flake8-logging-format
"G", # flake8-logging-format
# flake8-pie
"PIE", # flake8-pie
# flake8-pytest-style
"PT", # flake8-pytest-style
# flake8-quotes
"Q", # flake8-quotes
# flake8-raise
"RSE", # flake8-raise
# flake8-return
"RET", # flake8-return
# flake8-self
"SLF", # flake8-self
# flake8-type-checking
"TCH", # flake8-type-checking
# flake8-unused-arguments
"ARG", # flake8-unused-arguments
# flake8-use-pathlib
"PTH", # flake8-use-pathlib
# Pylint
"PLC", # pylint convention
"PLE", # pylint error
# "PLR", # pylint refactor
"PLW", # pylint warning
# tryceratops
"TRY", # tryceratops
# Perflint
"PERF", # perflint
# Ruff-specific rules
"RUF", # Ruff-specific rules
]
ignore = []
[tool.ruff.lint.flake8-bugbear]
# typer.Option/Argument are safe as default values — standard Typer pattern
extend-immutable-calls = ["typer.Option", "typer.Argument"]
[tool.ruff.lint.isort]
known-first-party = ["cgis"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.mypy]
# Strict mode is mandatory for a graph engine
strict = true
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
# Critical: Pydantic needs this plugin to understand its own magic
plugins = ["pydantic.mypy"]
[[tool.mypy.overrides]]
module = "pydantic.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "google.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "mistralai.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "ollama.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "duckdb.*"
ignore_missing_imports = true
[tool.interrogate]
ignore-init-method = true
ignore-init-module = true
ignore-magic = true
ignore-semiprivate = false
ignore-private = false
ignore-property-decorators = false
ignore-module = false
fail-under = 90
exclude = ["setup.py", "docs", "tests", "ui", ".venv", "build", "scripts"]
verbose = 1
quiet = false
color = true
[tool.pytest.ini_options]
testpaths = ["tests"]
# pytest's defaults plus `fixtures`: the identity corpus holds a test file of its own.
norecursedirs = [".*", "*.egg", "_darcs", "build", "CVS", "dist", "node_modules", "venv", "{arch}", "fixtures"]
asyncio_mode = "auto"
markers = [
"slow: marks tests as slow — run with '-m slow' or skip with '-m \"not slow\"'",
]
[tool.coverage.report]
# A script's `if __name__ == "__main__":` block is entry-point glue — argv parsing,
# `cgis.log_to_stderr()`, `sys.exit(main())` — that tests drive through `main()`, not
# by running the file. Counting it made every new line there "uncovered" (#622).
exclude_also = ['if __name__ == "__main__":']