repograph-codeintel 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.
- repograph_codeintel-0.1.0/LICENSE +202 -0
- repograph_codeintel-0.1.0/PKG-INFO +295 -0
- repograph_codeintel-0.1.0/README.md +266 -0
- repograph_codeintel-0.1.0/pyproject.toml +51 -0
- repograph_codeintel-0.1.0/setup.cfg +4 -0
- repograph_codeintel-0.1.0/src/repograph/__init__.py +3 -0
- repograph_codeintel-0.1.0/src/repograph/__main__.py +3 -0
- repograph_codeintel-0.1.0/src/repograph/agent_setup.py +224 -0
- repograph_codeintel-0.1.0/src/repograph/cli.py +476 -0
- repograph_codeintel-0.1.0/src/repograph/config.py +145 -0
- repograph_codeintel-0.1.0/src/repograph/extract.py +616 -0
- repograph_codeintel-0.1.0/src/repograph/impact.py +558 -0
- repograph_codeintel-0.1.0/src/repograph/indexer.py +184 -0
- repograph_codeintel-0.1.0/src/repograph/mcp_server.py +130 -0
- repograph_codeintel-0.1.0/src/repograph/query.py +485 -0
- repograph_codeintel-0.1.0/src/repograph/resolve.py +755 -0
- repograph_codeintel-0.1.0/src/repograph/scanner.py +107 -0
- repograph_codeintel-0.1.0/src/repograph/store.py +287 -0
- repograph_codeintel-0.1.0/src/repograph/test_gate.py +169 -0
- repograph_codeintel-0.1.0/src/repograph_codeintel.egg-info/PKG-INFO +295 -0
- repograph_codeintel-0.1.0/src/repograph_codeintel.egg-info/SOURCES.txt +23 -0
- repograph_codeintel-0.1.0/src/repograph_codeintel.egg-info/dependency_links.txt +1 -0
- repograph_codeintel-0.1.0/src/repograph_codeintel.egg-info/entry_points.txt +2 -0
- repograph_codeintel-0.1.0/src/repograph_codeintel.egg-info/requires.txt +10 -0
- repograph_codeintel-0.1.0/src/repograph_codeintel.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: repograph-codeintel
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Evidence-backed codebase intelligence and change-impact analysis for AI coding agents
|
|
5
|
+
Author: RepoGraph contributors
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/INDEX0-RESEARCH-LABS/repograph
|
|
8
|
+
Project-URL: Documentation, https://github.com/INDEX0-RESEARCH-LABS/repograph/tree/main/docs
|
|
9
|
+
Keywords: code-intelligence,code-graph,mcp,change-impact,dependency-graph,static-analysis,tree-sitter,ai-agents
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: typer>=0.12
|
|
20
|
+
Requires-Dist: mcp<3,>=2.0
|
|
21
|
+
Requires-Dist: tree-sitter>=0.23
|
|
22
|
+
Requires-Dist: tree-sitter-python>=0.23
|
|
23
|
+
Requires-Dist: tree-sitter-javascript>=0.23
|
|
24
|
+
Requires-Dist: tree-sitter-typescript>=0.23
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
27
|
+
Requires-Dist: pytest-cov>=5; extra == "dev"
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
<h1 align="center">
|
|
31
|
+
<picture>
|
|
32
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/hero-dark.svg">
|
|
33
|
+
<img src="docs/assets/hero.svg" alt="RepoGraph — local code graph and change impact analysis for AI coding agents" width="620">
|
|
34
|
+
</picture>
|
|
35
|
+
</h1>
|
|
36
|
+
|
|
37
|
+
<p align="center">
|
|
38
|
+
<a href="https://github.com/INDEX0-RESEARCH-LABS/repograph/actions/workflows/ci.yml"><img src="https://github.com/INDEX0-RESEARCH-LABS/repograph/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
39
|
+
<a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.10%2B-3776AB" alt="Python 3.10+"></a>
|
|
40
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="Apache-2.0"></a>
|
|
41
|
+
<a href="STATUS.md"><img src="https://img.shields.io/badge/status-alpha-orange" alt="alpha"></a>
|
|
42
|
+
</p>
|
|
43
|
+
|
|
44
|
+
<p align="center">
|
|
45
|
+
<b>See what a code change touches — before you ship it.</b><br>
|
|
46
|
+
Local. No account, no API key, no code execution.
|
|
47
|
+
</p>
|
|
48
|
+
|
|
49
|
+
**RepoGraph is a local code graph and change impact analysis tool for AI coding agents.** It reads your repository, records what imports what, and answers one question:
|
|
50
|
+
|
|
51
|
+
> **"If I change this file, what else might break?"**
|
|
52
|
+
|
|
53
|
+
You get the files, tests and routes that depend on it. Every item carries its evidence (file and line) and a confidence label. It also tells you what it **could not see**.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
repograph index .
|
|
57
|
+
repograph impact src/payments/refund.py
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Real output from the test fixture, with the route and documentation-mention lines removed for length:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
changed files (1): src/shop/services/subscription.py
|
|
64
|
+
changed symbols: 1
|
|
65
|
+
function cancel src/shop/services/subscription.py:6
|
|
66
|
+
|
|
67
|
+
direct dependents (4):
|
|
68
|
+
[confirmed] src/shop/__init__.py (imports-changed-file at line 1)
|
|
69
|
+
[confirmed] src/shop/api/routes.py (imports-changed-file at line 3)
|
|
70
|
+
[confirmed] src/shop/services/billing.py (imports-changed-file at line 1)
|
|
71
|
+
[confirmed] tests/test_subscription.py (imports-changed-file at line 1)
|
|
72
|
+
transitive dependents: 1
|
|
73
|
+
[confirmed] depth 2 src/shop/app.py
|
|
74
|
+
|
|
75
|
+
related tests (1):
|
|
76
|
+
[inferred] tests/test_subscription.py (test-imports-changed-file, test-name-matches-changed-file, test-name-matches-dependent)
|
|
77
|
+
|
|
78
|
+
blind spots:
|
|
79
|
+
- repo-dynamic-imports (2): Dynamic imports exist in the repository; their runtime targets may include the changed files.
|
|
80
|
+
- repo-parse-errors (1): Files with parse errors contribute no symbols or edges anywhere in the index.
|
|
81
|
+
|
|
82
|
+
note: absence of static evidence is not evidence of safety.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Python, TypeScript, JavaScript, JSX and TSX. Static analysis only. **Alpha.**
|
|
86
|
+
|
|
87
|
+
## Install
|
|
88
|
+
|
|
89
|
+
Python 3.10 or newer. Nothing else — no database server, no Docker, no cloud.
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
git clone https://github.com/INDEX0-RESEARCH-LABS/repograph.git
|
|
93
|
+
cd repograph && python -m venv .venv && .venv/bin/pip install -e .
|
|
94
|
+
.venv/bin/repograph version
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Not on PyPI yet. `pipx install --editable .` works too. Linux is tested in CI; macOS and Windows should work but are untested.
|
|
98
|
+
|
|
99
|
+
## Use
|
|
100
|
+
|
|
101
|
+
Run this inside **your** project:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
repograph init . # create .repograph/
|
|
105
|
+
repograph index . # build the map
|
|
106
|
+
repograph status . # check what was found
|
|
107
|
+
repograph impact src/app.py # ask what depends on it
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
That is the loop. Re-index after you edit: `repograph index . && repograph impact --diff`.
|
|
111
|
+
|
|
112
|
+
If `repograph` is not found, activate the venv (`source .venv/bin/activate`). These commands only read files.
|
|
113
|
+
|
|
114
|
+
## Find the tests a change reaches
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
repograph tests --diff
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
On `pallets/click` (44 test files), changing `src/click/core.py`:
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
run these (6, 14% of 44):
|
|
124
|
+
[inferred] tests/test_context.py (test-imports-changed-file, test-name-matches-dependent)
|
|
125
|
+
[inferred] tests/test_defaults.py (test-imports-changed-file, test-name-matches-dependent)
|
|
126
|
+
[inferred] tests/test_deprecations.py (test-imports-changed-file, test-name-matches-dependent)
|
|
127
|
+
[inferred] tests/test_parser.py (test-name-matches-dependent)
|
|
128
|
+
[inferred] tests/test_shell_completion.py (test-imports-changed-file, test-name-matches-dependent)
|
|
129
|
+
[inferred] tests/test_testing.py (test-name-matches-dependent)
|
|
130
|
+
|
|
131
|
+
cannot rule out (0):
|
|
132
|
+
|
|
133
|
+
reachable but not selected (37):
|
|
134
|
+
tests/conftest.py
|
|
135
|
+
tests/test_abort_interrupt.py
|
|
136
|
+
tests/test_arguments.py
|
|
137
|
+
...
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
`--command` prints only the pytest line, for CI. `--strict` exits `3` when a test cannot be ruled out or nothing was selected.
|
|
141
|
+
|
|
142
|
+
**Measured, and the number is bad.** On 22 one-function mutations across click, Flask and packaging, the selected set caught **41 of 180 failing test files (pooled recall 0.23, median 0.38)** while selecting a median 6.7% of test files. Adding every disclosed "reachable but not selected" file catches 179/180 — but that is 98.9% of the suite, i.e. no saving. Details: `research/TEST_SELECTION_GATE_RESULTS.md`.
|
|
143
|
+
|
|
144
|
+
So treat this command as **a disclosure aid, not a gate**: it tells you some files a change reaches, and it names the ones it cannot justify selecting. It does not know which tests exercise which behaviour, and it will omit files that fail. **Run the suite before trusting it.**
|
|
145
|
+
|
|
146
|
+
## Give it to your agent
|
|
147
|
+
|
|
148
|
+
One command registers the server **and** installs the instructions that make the agent actually use it:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
repograph setup .
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
It writes a project `.mcp.json` plus a Claude Code skill (and a Cursor rule when `.cursor/` exists), shows the diff first, and backs up any file it changes. Add `--client codex` to register it in `~/.codex/config.toml`; `--dry-run` writes nothing.
|
|
155
|
+
|
|
156
|
+
Restart your agent, then ask:
|
|
157
|
+
|
|
158
|
+
> What breaks if I change the refund calculation?
|
|
159
|
+
|
|
160
|
+
Without the instructions an agent tends to keep grepping — a measured failure mode, not a guess. The skill tells it when the graph is the cheaper answer, in what order to call the tools, and to read `blind_spots` before acting.
|
|
161
|
+
|
|
162
|
+
<details>
|
|
163
|
+
<summary><b>Manual MCP config</b></summary>
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
repograph serve --root /path/to/your/project
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"mcpServers": {
|
|
172
|
+
"repograph": {
|
|
173
|
+
"command": "repograph",
|
|
174
|
+
"args": ["serve", "--root", "/absolute/path/to/your/project"]
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Claude Code and Cursor accept this JSON shape. Use an absolute `--root` and put `repograph` on the client's `PATH`.
|
|
181
|
+
|
|
182
|
+
</details>
|
|
183
|
+
|
|
184
|
+
| Tool | What it returns |
|
|
185
|
+
| --- | --- |
|
|
186
|
+
| `analyze_change_impact` | Dependents, tests, routes, models and blind spots. |
|
|
187
|
+
| `find_related_tests` | Candidate tests. Heuristic — always run the suite. |
|
|
188
|
+
| `find_references` | Definition and resolved reference sites. |
|
|
189
|
+
| `get_dependency_graph` | What a file imports and what imports it. |
|
|
190
|
+
| `search_symbols` | Names with file and line. |
|
|
191
|
+
| `get_architecture_summary` | Languages, layers, hubs, entry points, routes, models. |
|
|
192
|
+
|
|
193
|
+
> **Security:** `serve --http` has **no authentication** and binds to `127.0.0.1` by default. Do not expose it to an untrusted network.
|
|
194
|
+
|
|
195
|
+
## What the labels mean
|
|
196
|
+
|
|
197
|
+
| Label | Plain meaning |
|
|
198
|
+
| --- | --- |
|
|
199
|
+
| `confirmed` | The code says it directly: a real import, or a call in the same file. |
|
|
200
|
+
| `inferred` | Worked out from project setup: a TypeScript alias or workspace package. |
|
|
201
|
+
| `heuristic` | A guess from patterns: route decorators, model base classes, test names. |
|
|
202
|
+
| `unresolved` | Seen in the code, but the target could not be found. Kept and reported. |
|
|
203
|
+
|
|
204
|
+
## How accurate is it?
|
|
205
|
+
|
|
206
|
+
Measured in October 2026 with a pre-registered protocol and two independent AI labelers, on three repositories never used to build the tool.
|
|
207
|
+
|
|
208
|
+
| Repository | Correct links (precision) | Links found (recall) |
|
|
209
|
+
| --- | ---: | ---: |
|
|
210
|
+
| [httpx](https://github.com/encode/httpx) (Python) | 100% (30/30) | 100% (30/30) |
|
|
211
|
+
| [zustand](https://github.com/pmndrs/zustand) (TypeScript) | 96.7% (58/60) | 100% (58/58) |
|
|
212
|
+
| [mocha](https://github.com/mochajs/mocha) (JavaScript) | 100% (30/30) | 78.9% (30/38) |
|
|
213
|
+
| **Overall** | **98.3%** (118/120) | **93.7%** (118/126) |
|
|
214
|
+
|
|
215
|
+
- 95% intervals: precision 94.1%–99.5%, recall 88.0%–96.8%.
|
|
216
|
+
- Both mistakes were one bug (a config alias leaking into example apps). Fixed and rechecked; the measured figure stays 118/120.
|
|
217
|
+
- All eight missed links were JSON files in mocha, which is why mocha's recall is shown on its own.
|
|
218
|
+
- Recall is an estimate, not a census. JSON/config imports, some Node aliases and non-code assets (`.css`, images, `.vue`) are not mapped.
|
|
219
|
+
|
|
220
|
+
Method, raw samples and threats to validity: [research/EDGE_ACCURACY_RESULTS.md](research/EDGE_ACCURACY_RESULTS.md).
|
|
221
|
+
|
|
222
|
+
## How fast is it?
|
|
223
|
+
|
|
224
|
+
One Linux machine, one run per project (Python 3.14.8, October 2026). Index step only.
|
|
225
|
+
|
|
226
|
+
| Repository | Files | Symbols | First index | Update (no changes) | Impact query |
|
|
227
|
+
| --- | ---: | ---: | ---: | ---: | ---: |
|
|
228
|
+
| [express](https://github.com/expressjs/express) | 142 | 63 | 0.28 s | 0.08 s | 2.1 ms |
|
|
229
|
+
| [click](https://github.com/pallets/click) | 91 | 2,077 | 0.57 s | 0.06 s | 18.4 ms |
|
|
230
|
+
| [vue-core](https://github.com/vuejs/core) | 528 | 2,273 | 1.79 s | 0.24 s | 22.4 ms |
|
|
231
|
+
| [fastapi](https://github.com/fastapi/fastapi) | 1,223 | 7,125 | 5.26 s | 1.10 s | 82.1 ms |
|
|
232
|
+
|
|
233
|
+
Express is a known weak spot: its CommonJS export style yields few symbols from many files. The report says so instead of hiding it.
|
|
234
|
+
|
|
235
|
+
## What it cannot do
|
|
236
|
+
|
|
237
|
+
- **No execution.** Reflection, computed imports and runtime wiring are invisible.
|
|
238
|
+
- **Two language families.** Python and JavaScript/TypeScript. Others are ignored.
|
|
239
|
+
- **No type checking or data flow.** It follows imports and names, not values.
|
|
240
|
+
- **Tests are heuristic.** A measured run on Flask found **24% of failing test files** (60% counting indirect dependents). Run the suite.
|
|
241
|
+
- **Routes and models are partial.** Common frameworks only.
|
|
242
|
+
- **An empty result is not proof.** It says "no dependents found", not "safe".
|
|
243
|
+
|
|
244
|
+
It is not a compiler, a type checker, a semantic search engine, or a replacement for tests.
|
|
245
|
+
|
|
246
|
+
<details>
|
|
247
|
+
<summary><b>All commands</b></summary>
|
|
248
|
+
|
|
249
|
+
| Command | What it does |
|
|
250
|
+
| --- | --- |
|
|
251
|
+
| `repograph init [path]` | Create `.repograph/` with a config file. |
|
|
252
|
+
| `repograph index [path]` | Build or update the map. `--force`, `--reset`, `--json`. |
|
|
253
|
+
| `repograph status [path]` | Counts, parse errors, whether an update is needed. |
|
|
254
|
+
| `repograph search <text>` | Find symbols and source text. `--kind`, `--limit`. |
|
|
255
|
+
| `repograph refs <name>` | Definition and the places that use it. |
|
|
256
|
+
| `repograph graph [path]` | Imports in, out or both. `--depth 1-5`, `--format dot`, `--cycles`. |
|
|
257
|
+
| `repograph arch` | Languages, layers, hubs, entry points, routes, models. |
|
|
258
|
+
| `repograph impact <paths>` | Dependents, tests, routes, blind spots. `--symbol`, `--diff`, `--depth`, `--tests/--no-tests`. |
|
|
259
|
+
| `repograph tests [paths]` | Test files a change reaches, files that cannot be ruled out, and reachable files not selected (heuristic; measured recall 0.23). `--diff`, `--base`, `--strict`, `--command`. |
|
|
260
|
+
| `repograph setup [path]` | Register the MCP server and install agent instructions. `--client`, `--yes`, `--dry-run`, `--no-skill`. |
|
|
261
|
+
| `repograph serve` | MCP server. `--http`, `--host`, `--port`. |
|
|
262
|
+
|
|
263
|
+
Every read command accepts `--json`.
|
|
264
|
+
|
|
265
|
+
</details>
|
|
266
|
+
|
|
267
|
+
<details>
|
|
268
|
+
<summary><b>Common problems</b></summary>
|
|
269
|
+
|
|
270
|
+
| Problem | Fix |
|
|
271
|
+
| --- | --- |
|
|
272
|
+
| `impact --diff` finds nothing | The edit is not indexed. Run `repograph index .` first. |
|
|
273
|
+
| Fewer symbols than expected | The code may use a pattern the parser does not cover. Check `status` and `arch` for parse errors. |
|
|
274
|
+
| A dependency is missing | It may be dynamic, unresolved, or in another language. Check the blind spots block. |
|
|
275
|
+
| MCP client cannot connect | Use an absolute `--root`, and put `repograph` on the client's `PATH`. |
|
|
276
|
+
| Agent never calls the tools | Re-run `repograph setup .`, restart the agent, and confirm the skill landed in `.claude/skills/repograph/SKILL.md`. |
|
|
277
|
+
|
|
278
|
+
</details>
|
|
279
|
+
|
|
280
|
+
## Project
|
|
281
|
+
|
|
282
|
+
- [STATUS.md](STATUS.md) — what is tested, measured and still missing.
|
|
283
|
+
- [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) — modules, schema, algorithms.
|
|
284
|
+
- [docs/LIMITATIONS.md](docs/LIMITATIONS.md) — analysis gaps and security model.
|
|
285
|
+
- [research/](research/) — accuracy protocols, raw results, decision log.
|
|
286
|
+
- [CONTRIBUTING.md](CONTRIBUTING.md) · [SECURITY.md](SECURITY.md)
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
.venv/bin/pip install -e '.[dev]'
|
|
290
|
+
.venv/bin/python -m pytest
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
75 tests, 69% direct coverage, CI on Python 3.10, 3.12 and 3.13. The CLI and MCP server are tested through subprocesses, so coverage does not attribute those runs to their modules.
|
|
294
|
+
|
|
295
|
+
Apache-2.0. See [LICENSE](LICENSE).
|