codesteward-graph 0.1.0__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.
- codesteward_graph-0.1.0/.gitignore +134 -0
- codesteward_graph-0.1.0/PKG-INFO +122 -0
- codesteward_graph-0.1.0/README.md +51 -0
- codesteward_graph-0.1.0/pyproject.toml +71 -0
- codesteward_graph-0.1.0/src/codesteward/engine/__init__.py +0 -0
- codesteward_graph-0.1.0/src/codesteward/engine/graph_builder.py +675 -0
- codesteward_graph-0.1.0/src/codesteward/engine/parsers/__init__.py +142 -0
- codesteward_graph-0.1.0/src/codesteward/engine/parsers/_ast_utils.py +562 -0
- codesteward_graph-0.1.0/src/codesteward/engine/parsers/base.py +180 -0
- codesteward_graph-0.1.0/src/codesteward/engine/parsers/c.py +183 -0
- codesteward_graph-0.1.0/src/codesteward/engine/parsers/cobol.py +201 -0
- codesteward_graph-0.1.0/src/codesteward/engine/parsers/cpp.py +237 -0
- codesteward_graph-0.1.0/src/codesteward/engine/parsers/csharp.py +521 -0
- codesteward_graph-0.1.0/src/codesteward/engine/parsers/go.py +331 -0
- codesteward_graph-0.1.0/src/codesteward/engine/parsers/java.py +456 -0
- codesteward_graph-0.1.0/src/codesteward/engine/parsers/kotlin.py +348 -0
- codesteward_graph-0.1.0/src/codesteward/engine/parsers/php.py +619 -0
- codesteward_graph-0.1.0/src/codesteward/engine/parsers/python.py +758 -0
- codesteward_graph-0.1.0/src/codesteward/engine/parsers/rust.py +454 -0
- codesteward_graph-0.1.0/src/codesteward/engine/parsers/scala.py +319 -0
- codesteward_graph-0.1.0/src/codesteward/engine/parsers/typescript.py +877 -0
- codesteward_graph-0.1.0/src/codesteward/engine/tree_sitter_parser.py +57 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
.vscode/*
|
|
2
|
+
!.vscode/settings.json
|
|
3
|
+
!.vscode/tasks.json
|
|
4
|
+
!.vscode/launch.json
|
|
5
|
+
!.vscode/extensions.json
|
|
6
|
+
!.vscode/*.code-snippets
|
|
7
|
+
.history/
|
|
8
|
+
*.vsix
|
|
9
|
+
.idea/**/workspace.xml
|
|
10
|
+
.idea/**/tasks.xml
|
|
11
|
+
.idea/**/usage.statistics.xml
|
|
12
|
+
.idea/**/dictionaries
|
|
13
|
+
.idea/**/shelf
|
|
14
|
+
.idea/**/aws.xml
|
|
15
|
+
.idea/**/contentModel.xml
|
|
16
|
+
.idea/**/dataSources/
|
|
17
|
+
.idea/**/dataSources.ids
|
|
18
|
+
.idea/**/dataSources.local.xml
|
|
19
|
+
.idea/**/sqlDataSources.xml
|
|
20
|
+
.idea/**/dynamic.xml
|
|
21
|
+
.idea/**/uiDesigner.xml
|
|
22
|
+
.idea/**/dbnavigator.xml
|
|
23
|
+
.idea/**/gradle.xml
|
|
24
|
+
.idea/**/libraries
|
|
25
|
+
cmake-build-*/
|
|
26
|
+
.idea/**/mongoSettings.xml
|
|
27
|
+
*.iws
|
|
28
|
+
out/
|
|
29
|
+
.idea_modules/
|
|
30
|
+
atlassian-ide-plugin.xml
|
|
31
|
+
.idea/replstate.xml
|
|
32
|
+
.idea/sonarlint/
|
|
33
|
+
com_crashlytics_export_strings.xml
|
|
34
|
+
crashlytics.properties
|
|
35
|
+
crashlytics-build.properties
|
|
36
|
+
fabric.properties
|
|
37
|
+
.idea/httpRequests
|
|
38
|
+
.idea/caches/build_file_checksums.ser
|
|
39
|
+
.DS_Store
|
|
40
|
+
.AppleDouble
|
|
41
|
+
.LSOverride
|
|
42
|
+
Icon
|
|
43
|
+
._*
|
|
44
|
+
.DocumentRevisions-V100
|
|
45
|
+
.fseventsd
|
|
46
|
+
.Spotlight-V100
|
|
47
|
+
.TemporaryItems
|
|
48
|
+
.Trashes
|
|
49
|
+
.VolumeIcon.icns
|
|
50
|
+
.com.apple.timemachine.donotpresent
|
|
51
|
+
.AppleDB
|
|
52
|
+
.AppleDesktop
|
|
53
|
+
Network Trash Folder
|
|
54
|
+
Temporary Items
|
|
55
|
+
.apdisk
|
|
56
|
+
__pycache__/
|
|
57
|
+
*.py[cod]
|
|
58
|
+
*$py.class
|
|
59
|
+
*.so
|
|
60
|
+
.Python
|
|
61
|
+
build/
|
|
62
|
+
develop-eggs/
|
|
63
|
+
dist/
|
|
64
|
+
downloads/
|
|
65
|
+
eggs/
|
|
66
|
+
.eggs/
|
|
67
|
+
lib/
|
|
68
|
+
lib64/
|
|
69
|
+
parts/
|
|
70
|
+
sdist/
|
|
71
|
+
var/
|
|
72
|
+
wheels/
|
|
73
|
+
share/python-wheels/
|
|
74
|
+
*.egg-info/
|
|
75
|
+
.installed.cfg
|
|
76
|
+
*.egg
|
|
77
|
+
MANIFEST
|
|
78
|
+
*.manifest
|
|
79
|
+
*.spec
|
|
80
|
+
pip-log.txt
|
|
81
|
+
pip-delete-this-directory.txt
|
|
82
|
+
htmlcov/
|
|
83
|
+
.tox/
|
|
84
|
+
.nox/
|
|
85
|
+
.coverage
|
|
86
|
+
.coverage.*
|
|
87
|
+
.cache
|
|
88
|
+
nosetests.xml
|
|
89
|
+
coverage.xml
|
|
90
|
+
*.cover
|
|
91
|
+
*.py,cover
|
|
92
|
+
.hypothesis/
|
|
93
|
+
.pytest_cache/
|
|
94
|
+
cover/
|
|
95
|
+
*.mo
|
|
96
|
+
*.pot
|
|
97
|
+
*.log
|
|
98
|
+
local_settings.py
|
|
99
|
+
db.sqlite3
|
|
100
|
+
db.sqlite3-journal
|
|
101
|
+
instance/
|
|
102
|
+
.webassets-cache
|
|
103
|
+
.scrapy
|
|
104
|
+
docs/_build/
|
|
105
|
+
.pybuilder/
|
|
106
|
+
target/
|
|
107
|
+
.ipynb_checkpoints
|
|
108
|
+
profile_default/
|
|
109
|
+
ipython_config.py
|
|
110
|
+
.pdm.toml
|
|
111
|
+
.pdm-python
|
|
112
|
+
.pdm-build/
|
|
113
|
+
__pypackages__/
|
|
114
|
+
celerybeat-schedule
|
|
115
|
+
celerybeat.pid
|
|
116
|
+
*.sage.py
|
|
117
|
+
.env
|
|
118
|
+
.venv
|
|
119
|
+
env/
|
|
120
|
+
venv/
|
|
121
|
+
ENV/
|
|
122
|
+
env.bak/
|
|
123
|
+
venv.bak/
|
|
124
|
+
.spyderproject
|
|
125
|
+
.spyproject
|
|
126
|
+
.ropeproject
|
|
127
|
+
/site
|
|
128
|
+
.mypy_cache/
|
|
129
|
+
.dmypy.json
|
|
130
|
+
dmypy.json
|
|
131
|
+
.pyre/
|
|
132
|
+
.pytype/
|
|
133
|
+
cython_debug/
|
|
134
|
+
.idea/
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: codesteward-graph
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Multi-language structural code graph builder — 13 tree-sitter parsers + Neo4j writer
|
|
5
|
+
Project-URL: Homepage, https://github.com/bitkaio/codesteward-mcp
|
|
6
|
+
Project-URL: Repository, https://github.com/bitkaio/codesteward-mcp
|
|
7
|
+
Project-URL: Issues, https://github.com/bitkaio/codesteward-mcp/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/bitkaio/codesteward-mcp/blob/main/CHANGELOG.md
|
|
9
|
+
Author: bitkaio LLC
|
|
10
|
+
License: BSD-3-Clause
|
|
11
|
+
Keywords: ast,code-graph,code-intelligence,neo4j,static-analysis,tree-sitter
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
19
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Python: >=3.12
|
|
22
|
+
Requires-Dist: neo4j>=5.0
|
|
23
|
+
Requires-Dist: pyyaml>=6.0
|
|
24
|
+
Requires-Dist: structlog>=24.0
|
|
25
|
+
Provides-Extra: graph
|
|
26
|
+
Requires-Dist: tree-sitter-java>=0.23; extra == 'graph'
|
|
27
|
+
Requires-Dist: tree-sitter-javascript>=0.23; extra == 'graph'
|
|
28
|
+
Requires-Dist: tree-sitter-python>=0.23; extra == 'graph'
|
|
29
|
+
Requires-Dist: tree-sitter-typescript>=0.23; extra == 'graph'
|
|
30
|
+
Requires-Dist: tree-sitter>=0.24; extra == 'graph'
|
|
31
|
+
Provides-Extra: graph-all
|
|
32
|
+
Requires-Dist: tree-sitter-c-sharp>=0.21; extra == 'graph-all'
|
|
33
|
+
Requires-Dist: tree-sitter-c>=0.21; extra == 'graph-all'
|
|
34
|
+
Requires-Dist: tree-sitter-cpp>=0.21; extra == 'graph-all'
|
|
35
|
+
Requires-Dist: tree-sitter-go>=0.21; extra == 'graph-all'
|
|
36
|
+
Requires-Dist: tree-sitter-java>=0.23; extra == 'graph-all'
|
|
37
|
+
Requires-Dist: tree-sitter-javascript>=0.23; extra == 'graph-all'
|
|
38
|
+
Requires-Dist: tree-sitter-kotlin>=0.21; extra == 'graph-all'
|
|
39
|
+
Requires-Dist: tree-sitter-php>=0.21; extra == 'graph-all'
|
|
40
|
+
Requires-Dist: tree-sitter-python>=0.23; extra == 'graph-all'
|
|
41
|
+
Requires-Dist: tree-sitter-rust>=0.21; extra == 'graph-all'
|
|
42
|
+
Requires-Dist: tree-sitter-scala>=0.21; extra == 'graph-all'
|
|
43
|
+
Requires-Dist: tree-sitter-typescript>=0.23; extra == 'graph-all'
|
|
44
|
+
Requires-Dist: tree-sitter>=0.21; extra == 'graph-all'
|
|
45
|
+
Requires-Dist: tree-sitter>=0.24; extra == 'graph-all'
|
|
46
|
+
Provides-Extra: graph-c
|
|
47
|
+
Requires-Dist: tree-sitter-c>=0.21; extra == 'graph-c'
|
|
48
|
+
Requires-Dist: tree-sitter>=0.21; extra == 'graph-c'
|
|
49
|
+
Provides-Extra: graph-cpp
|
|
50
|
+
Requires-Dist: tree-sitter-cpp>=0.21; extra == 'graph-cpp'
|
|
51
|
+
Requires-Dist: tree-sitter>=0.21; extra == 'graph-cpp'
|
|
52
|
+
Provides-Extra: graph-csharp
|
|
53
|
+
Requires-Dist: tree-sitter-c-sharp>=0.21; extra == 'graph-csharp'
|
|
54
|
+
Requires-Dist: tree-sitter>=0.21; extra == 'graph-csharp'
|
|
55
|
+
Provides-Extra: graph-go
|
|
56
|
+
Requires-Dist: tree-sitter-go>=0.21; extra == 'graph-go'
|
|
57
|
+
Requires-Dist: tree-sitter>=0.21; extra == 'graph-go'
|
|
58
|
+
Provides-Extra: graph-kotlin
|
|
59
|
+
Requires-Dist: tree-sitter-kotlin>=0.21; extra == 'graph-kotlin'
|
|
60
|
+
Requires-Dist: tree-sitter>=0.21; extra == 'graph-kotlin'
|
|
61
|
+
Provides-Extra: graph-php
|
|
62
|
+
Requires-Dist: tree-sitter-php>=0.21; extra == 'graph-php'
|
|
63
|
+
Requires-Dist: tree-sitter>=0.21; extra == 'graph-php'
|
|
64
|
+
Provides-Extra: graph-rust
|
|
65
|
+
Requires-Dist: tree-sitter-rust>=0.21; extra == 'graph-rust'
|
|
66
|
+
Requires-Dist: tree-sitter>=0.21; extra == 'graph-rust'
|
|
67
|
+
Provides-Extra: graph-scala
|
|
68
|
+
Requires-Dist: tree-sitter-scala>=0.21; extra == 'graph-scala'
|
|
69
|
+
Requires-Dist: tree-sitter>=0.21; extra == 'graph-scala'
|
|
70
|
+
Description-Content-Type: text/markdown
|
|
71
|
+
|
|
72
|
+
# codesteward-graph
|
|
73
|
+
|
|
74
|
+
Multi-language structural code graph builder — parses source repositories into
|
|
75
|
+
`LexicalNode` + edge data and writes to Neo4j.
|
|
76
|
+
|
|
77
|
+
Part of the [Codesteward MCP](https://github.com/bitkaio/codesteward-mcp) project.
|
|
78
|
+
For full documentation, setup guides, and the MCP server, see the main repository.
|
|
79
|
+
|
|
80
|
+
## What it does
|
|
81
|
+
|
|
82
|
+
- Parses 13 languages via tree-sitter AST (TypeScript, JavaScript, Python, Java, Go,
|
|
83
|
+
Rust, PHP, C#, Kotlin, Scala, C, C++); COBOL via regex
|
|
84
|
+
- Extracts functions, classes, imports, call graphs, inheritance chains, and auth guard
|
|
85
|
+
annotations (`GUARDED_BY` / `PROTECTED_BY` edges)
|
|
86
|
+
- Resolves cross-file call relationships in a single post-parse pass
|
|
87
|
+
- Writes to Neo4j with tenant + repo namespacing; operates in stub mode without Neo4j
|
|
88
|
+
|
|
89
|
+
## Install
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Core languages (TypeScript, JavaScript, Python, Java)
|
|
93
|
+
uv add "codesteward-graph[graph]"
|
|
94
|
+
|
|
95
|
+
# All 14 languages
|
|
96
|
+
uv add "codesteward-graph[graph-all]"
|
|
97
|
+
|
|
98
|
+
# Without tree-sitter (COBOL only; all other parsers will raise ImportError)
|
|
99
|
+
uv add codesteward-graph
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Quick usage
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
import asyncio
|
|
106
|
+
from codesteward.engine.graph_builder import GraphBuilder
|
|
107
|
+
|
|
108
|
+
async def main():
|
|
109
|
+
builder = GraphBuilder() # stub mode — no Neo4j
|
|
110
|
+
summary = await builder.build_graph(
|
|
111
|
+
repo_path="/path/to/repo",
|
|
112
|
+
tenant_id="local",
|
|
113
|
+
repo_id="my-repo",
|
|
114
|
+
)
|
|
115
|
+
print(summary)
|
|
116
|
+
|
|
117
|
+
asyncio.run(main())
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## License
|
|
121
|
+
|
|
122
|
+
BSD 3-Clause — Copyright (c) 2026, bitkaio LLC
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# codesteward-graph
|
|
2
|
+
|
|
3
|
+
Multi-language structural code graph builder — parses source repositories into
|
|
4
|
+
`LexicalNode` + edge data and writes to Neo4j.
|
|
5
|
+
|
|
6
|
+
Part of the [Codesteward MCP](https://github.com/bitkaio/codesteward-mcp) project.
|
|
7
|
+
For full documentation, setup guides, and the MCP server, see the main repository.
|
|
8
|
+
|
|
9
|
+
## What it does
|
|
10
|
+
|
|
11
|
+
- Parses 13 languages via tree-sitter AST (TypeScript, JavaScript, Python, Java, Go,
|
|
12
|
+
Rust, PHP, C#, Kotlin, Scala, C, C++); COBOL via regex
|
|
13
|
+
- Extracts functions, classes, imports, call graphs, inheritance chains, and auth guard
|
|
14
|
+
annotations (`GUARDED_BY` / `PROTECTED_BY` edges)
|
|
15
|
+
- Resolves cross-file call relationships in a single post-parse pass
|
|
16
|
+
- Writes to Neo4j with tenant + repo namespacing; operates in stub mode without Neo4j
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Core languages (TypeScript, JavaScript, Python, Java)
|
|
22
|
+
uv add "codesteward-graph[graph]"
|
|
23
|
+
|
|
24
|
+
# All 14 languages
|
|
25
|
+
uv add "codesteward-graph[graph-all]"
|
|
26
|
+
|
|
27
|
+
# Without tree-sitter (COBOL only; all other parsers will raise ImportError)
|
|
28
|
+
uv add codesteward-graph
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Quick usage
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
import asyncio
|
|
35
|
+
from codesteward.engine.graph_builder import GraphBuilder
|
|
36
|
+
|
|
37
|
+
async def main():
|
|
38
|
+
builder = GraphBuilder() # stub mode — no Neo4j
|
|
39
|
+
summary = await builder.build_graph(
|
|
40
|
+
repo_path="/path/to/repo",
|
|
41
|
+
tenant_id="local",
|
|
42
|
+
repo_id="my-repo",
|
|
43
|
+
)
|
|
44
|
+
print(summary)
|
|
45
|
+
|
|
46
|
+
asyncio.run(main())
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
BSD 3-Clause — Copyright (c) 2026, bitkaio LLC
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "codesteward-graph"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Multi-language structural code graph builder — 13 tree-sitter parsers + Neo4j writer"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
license = {text = "BSD-3-Clause"}
|
|
8
|
+
authors = [
|
|
9
|
+
{name = "bitkaio LLC"},
|
|
10
|
+
]
|
|
11
|
+
keywords = ["code-graph", "tree-sitter", "ast", "static-analysis", "neo4j", "code-intelligence"]
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 4 - Beta",
|
|
14
|
+
"Intended Audience :: Developers",
|
|
15
|
+
"License :: OSI Approved :: BSD License",
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Programming Language :: Python :: 3.12",
|
|
18
|
+
"Programming Language :: Python :: 3.13",
|
|
19
|
+
"Topic :: Software Development :: Libraries",
|
|
20
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
21
|
+
"Typing :: Typed",
|
|
22
|
+
]
|
|
23
|
+
dependencies = [
|
|
24
|
+
"structlog>=24.0",
|
|
25
|
+
"pyyaml>=6.0",
|
|
26
|
+
"neo4j>=5.0",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Homepage = "https://github.com/bitkaio/codesteward-mcp"
|
|
31
|
+
Repository = "https://github.com/bitkaio/codesteward-mcp"
|
|
32
|
+
Issues = "https://github.com/bitkaio/codesteward-mcp/issues"
|
|
33
|
+
Changelog = "https://github.com/bitkaio/codesteward-mcp/blob/main/CHANGELOG.md"
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
# Core tree-sitter grammars (TypeScript / JS / Python / Java)
|
|
37
|
+
graph = [
|
|
38
|
+
"tree-sitter>=0.24",
|
|
39
|
+
"tree-sitter-typescript>=0.23",
|
|
40
|
+
"tree-sitter-javascript>=0.23",
|
|
41
|
+
"tree-sitter-python>=0.23",
|
|
42
|
+
"tree-sitter-java>=0.23",
|
|
43
|
+
]
|
|
44
|
+
graph-csharp = ["tree-sitter>=0.21", "tree-sitter-c-sharp>=0.21"]
|
|
45
|
+
graph-kotlin = ["tree-sitter>=0.21", "tree-sitter-kotlin>=0.21"]
|
|
46
|
+
graph-scala = ["tree-sitter>=0.21", "tree-sitter-scala>=0.21"]
|
|
47
|
+
graph-go = ["tree-sitter>=0.21", "tree-sitter-go>=0.21"]
|
|
48
|
+
graph-c = ["tree-sitter>=0.21", "tree-sitter-c>=0.21"]
|
|
49
|
+
graph-cpp = ["tree-sitter>=0.21", "tree-sitter-cpp>=0.21"]
|
|
50
|
+
graph-rust = ["tree-sitter>=0.21", "tree-sitter-rust>=0.21"]
|
|
51
|
+
graph-php = ["tree-sitter>=0.21", "tree-sitter-php>=0.21"]
|
|
52
|
+
# All 14 languages at once
|
|
53
|
+
graph-all = [
|
|
54
|
+
"codesteward-graph[graph]",
|
|
55
|
+
"codesteward-graph[graph-csharp]",
|
|
56
|
+
"codesteward-graph[graph-kotlin]",
|
|
57
|
+
"codesteward-graph[graph-scala]",
|
|
58
|
+
"codesteward-graph[graph-go]",
|
|
59
|
+
"codesteward-graph[graph-c]",
|
|
60
|
+
"codesteward-graph[graph-cpp]",
|
|
61
|
+
"codesteward-graph[graph-rust]",
|
|
62
|
+
"codesteward-graph[graph-php]",
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
[build-system]
|
|
66
|
+
requires = ["hatchling"]
|
|
67
|
+
build-backend = "hatchling.build"
|
|
68
|
+
|
|
69
|
+
[tool.hatch.build.targets.wheel]
|
|
70
|
+
# codesteward.engine — namespace package, no __init__.py at codesteward/ level
|
|
71
|
+
packages = ["src/codesteward"]
|
|
File without changes
|