impact-core 1.0.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.
- impact_core-1.0.0/LICENSE +201 -0
- impact_core-1.0.0/MANIFEST.in +18 -0
- impact_core-1.0.0/PKG-INFO +366 -0
- impact_core-1.0.0/README.md +320 -0
- impact_core-1.0.0/adapters/java/extractor.py +332 -0
- impact_core-1.0.0/adapters/java/static_analyzer.py +69 -0
- impact_core-1.0.0/core/agents/coordinator.py +88 -0
- impact_core-1.0.0/core/agents/diff_agent.py +30 -0
- impact_core-1.0.0/core/agents/graph_agent.py +24 -0
- impact_core-1.0.0/core/agents/llm_agent.py +153 -0
- impact_core-1.0.0/core/agents/metrics_agent.py +28 -0
- impact_core-1.0.0/core/crawler/__init__.py +8 -0
- impact_core-1.0.0/core/crawler/crawler.py +60 -0
- impact_core-1.0.0/core/crawler/database.py +320 -0
- impact_core-1.0.0/core/crawler/discovery.py +46 -0
- impact_core-1.0.0/core/crawler/downloader.py +54 -0
- impact_core-1.0.0/core/crawler/network.py +26 -0
- impact_core-1.0.0/core/crawler/processor.py +100 -0
- impact_core-1.0.0/core/ecosystem_crawler.py +70 -0
- impact_core-1.0.0/core/github_collector.py +221 -0
- impact_core-1.0.0/core/graph_utils.py +57 -0
- impact_core-1.0.0/core/mcp_server.py +196 -0
- impact_core-1.0.0/core/schema/schema.json +89 -0
- impact_core-1.0.0/core/shacl_validator.py +74 -0
- impact_core-1.0.0/impact_core.egg-info/PKG-INFO +366 -0
- impact_core-1.0.0/impact_core.egg-info/SOURCES.txt +48 -0
- impact_core-1.0.0/impact_core.egg-info/dependency_links.txt +1 -0
- impact_core-1.0.0/impact_core.egg-info/entry_points.txt +5 -0
- impact_core-1.0.0/impact_core.egg-info/requires.txt +26 -0
- impact_core-1.0.0/impact_core.egg-info/top_level.txt +2 -0
- impact_core-1.0.0/k8s/configmap.yaml +18 -0
- impact_core-1.0.0/k8s/crawler-deployment.yaml +83 -0
- impact_core-1.0.0/k8s/discovery-job.yaml +51 -0
- impact_core-1.0.0/k8s/kustomization.yaml +21 -0
- impact_core-1.0.0/k8s/namespace.yaml +8 -0
- impact_core-1.0.0/k8s/postgres.yaml +86 -0
- impact_core-1.0.0/k8s/secret.yaml.example +21 -0
- impact_core-1.0.0/pyproject.toml +112 -0
- impact_core-1.0.0/requirements.txt +12 -0
- impact_core-1.0.0/setup.cfg +4 -0
- impact_core-1.0.0/test_projects/pmd_report_v2.json +18 -0
- impact_core-1.0.0/test_projects/telemetry_service_v1/src/com/telemetry/DataCollector.java +13 -0
- impact_core-1.0.0/test_projects/telemetry_service_v1/src/com/telemetry/Database.java +7 -0
- impact_core-1.0.0/test_projects/telemetry_service_v1/src/com/telemetry/Service.java +9 -0
- impact_core-1.0.0/test_projects/telemetry_service_v2/src/com/telemetry/DataCollector.java +13 -0
- impact_core-1.0.0/test_projects/telemetry_service_v2/src/com/telemetry/Database.java +12 -0
- impact_core-1.0.0/test_projects/telemetry_service_v2/src/com/telemetry/NewUtility.java +7 -0
- impact_core-1.0.0/test_projects/telemetry_service_v2/src/com/telemetry/Service.java +13 -0
- impact_core-1.0.0/test_projects/v1_graph.json +78 -0
- impact_core-1.0.0/test_projects/v2_graph.json +113 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# MANIFEST.in
|
|
2
|
+
# Controls which non-Python files are included in the source distribution (sdist).
|
|
3
|
+
|
|
4
|
+
# Documentation and metadata
|
|
5
|
+
include README.md
|
|
6
|
+
include LICENSE
|
|
7
|
+
include requirements.txt
|
|
8
|
+
include pyproject.toml
|
|
9
|
+
|
|
10
|
+
# JSON schema files
|
|
11
|
+
recursive-include core/schema *.json
|
|
12
|
+
|
|
13
|
+
# Kubernetes deployment manifests
|
|
14
|
+
recursive-include k8s *.yaml *.example
|
|
15
|
+
|
|
16
|
+
# Test datasets (small, deterministic fixtures — not the large benchmark cache)
|
|
17
|
+
recursive-include test_projects *.json *.java
|
|
18
|
+
prune test_projects/github_benchmarks
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: impact-core
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Intent-based Multi-agent Platform for Architectural Change Tracking
|
|
5
|
+
Author: IMPACT Project
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/IMPACT-Project/IMPACT
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/IMPACT-Project/IMPACT/issues
|
|
9
|
+
Keywords: software-architecture,dependency-graph,multi-agent,ast-parser,intent-based,software-evolution
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
22
|
+
Requires-Python: >=3.8
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: networkx>=2.5
|
|
26
|
+
Provides-Extra: java
|
|
27
|
+
Requires-Dist: javalang>=0.13.0; extra == "java"
|
|
28
|
+
Provides-Extra: shacl
|
|
29
|
+
Requires-Dist: pyshacl>=0.20.0; extra == "shacl"
|
|
30
|
+
Requires-Dist: rdflib>=6.0.0; extra == "shacl"
|
|
31
|
+
Provides-Extra: crawler
|
|
32
|
+
Requires-Dist: javalang>=0.13.0; extra == "crawler"
|
|
33
|
+
Requires-Dist: pyshacl>=0.20.0; extra == "crawler"
|
|
34
|
+
Requires-Dist: rdflib>=6.0.0; extra == "crawler"
|
|
35
|
+
Provides-Extra: crawler-distributed
|
|
36
|
+
Requires-Dist: impact-core[crawler]; extra == "crawler-distributed"
|
|
37
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == "crawler-distributed"
|
|
38
|
+
Provides-Extra: all
|
|
39
|
+
Requires-Dist: impact-core[crawler-distributed,java,shacl]; extra == "all"
|
|
40
|
+
Provides-Extra: dev
|
|
41
|
+
Requires-Dist: impact-core[all]; extra == "dev"
|
|
42
|
+
Requires-Dist: build>=0.10; extra == "dev"
|
|
43
|
+
Requires-Dist: twine>=4.0; extra == "dev"
|
|
44
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
45
|
+
Dynamic: license-file
|
|
46
|
+
|
|
47
|
+
# IMPACT: Intent-based Multi-agent Platform for Architectural Change Tracking
|
|
48
|
+
|
|
49
|
+
IMPACT is a language-agnostic multi-agent framework designed to monitor and manage the structural evolution of software systems. Drawing inspiration from Intent-Based Networking (IBN) in autonomic computing, IMPACT enables human software architects to specify high-level structural intents, such as preventing cyclic dependencies or limiting complexity growth. A swarm of cooperative agents then evaluates codebase transitions, detects violations, and provides explainable, natural-language refactoring advice.
|
|
50
|
+
|
|
51
|
+
This project is built to align with the paradigm of Human-AI Collaboration, establishing a structured feedback loop where human expertise guides agentic analysis and governance.
|
|
52
|
+
|
|
53
|
+
## Repository Structure
|
|
54
|
+
|
|
55
|
+
The repository is organized as follows:
|
|
56
|
+
|
|
57
|
+
* **`core/`**: The core Python package of the IMPACT framework:
|
|
58
|
+
* `schema/`: Standardized JSON schema for software dependency graphs.
|
|
59
|
+
* `agents/`: Specialized agent implementations including the Coordinator, Graph, Diff, Metrics, and LLM agents.
|
|
60
|
+
* `graph_utils.py`: Utility functions for loading graphs and computing structural diffs.
|
|
61
|
+
* **`adapters/`**: Pluggable source code extraction layers:
|
|
62
|
+
* `java/`: Python-based parser that walks Java project directories, extracts FQCNs, resolves dependency call-graphs, and exports JSON graphs.
|
|
63
|
+
* **`test_projects/`**: Datasets and source folders simulating software evolution:
|
|
64
|
+
* `telemetry_service_v1/`: Version 1.0.0 Java source code of TelemetryService.
|
|
65
|
+
* `telemetry_service_v2/`: Version 2.0.0 Java source code of TelemetryService.
|
|
66
|
+
* `v1_graph.json`: Extracted dependency graph for Version 1.0.0.
|
|
67
|
+
* `v2_graph.json`: Extracted dependency graph for Version 2.0.0.
|
|
68
|
+
* **`run_demo.py`**: Execution script to run the multi-agent evolution tracker.
|
|
69
|
+
* **`test_impact.py`**: Automated unit test suite to verify graph loading, diff calculations, and coordinator orchestration.
|
|
70
|
+
|
|
71
|
+
## Installation & Setup
|
|
72
|
+
|
|
73
|
+
IMPACT targets Python 3.8 or higher. The package (`impact-core`) will be published to PyPI — for now, install from source.
|
|
74
|
+
|
|
75
|
+
> **PyPI status:** automated publishing is configured via GitHub Actions (see `.github/workflows/publish.yml`) and will trigger on the first version tag push. Until then, use the source install below.
|
|
76
|
+
|
|
77
|
+
### Install from source (recommended while in active development)
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
git clone https://github.com/IMPACT-Project/IMPACT.git
|
|
81
|
+
cd IMPACT
|
|
82
|
+
pip install -e ".[dev]" # editable install with all deps + build/test tools
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Or install only what you need:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pip install -e . # core only
|
|
89
|
+
pip install -e ".[java]" # + Java AST extractor
|
|
90
|
+
pip install -e ".[crawler]" # + full crawler stack (SQLite)
|
|
91
|
+
pip install -e ".[crawler-distributed]" # + PostgreSQL distributed crawler
|
|
92
|
+
pip install -e ".[all]" # everything
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Install from PyPI (once published)
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Core only — graph loading, diff, coordinator, SHACL validator
|
|
99
|
+
pip install impact-core
|
|
100
|
+
|
|
101
|
+
# + Java AST extractor (recommended for local extraction)
|
|
102
|
+
pip install impact-core[java]
|
|
103
|
+
|
|
104
|
+
# + Full crawler stack (javalang, pyshacl, rdflib) — single-node SQLite
|
|
105
|
+
pip install impact-core[crawler]
|
|
106
|
+
|
|
107
|
+
# + Distributed crawler (PostgreSQL backend)
|
|
108
|
+
pip install impact-core[crawler-distributed]
|
|
109
|
+
|
|
110
|
+
# Everything
|
|
111
|
+
pip install impact-core[all]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Releasing a new version to PyPI
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
git tag v1.x.y && git push origin v1.x.y # GitHub Actions does the rest
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
See [DEPLOY.md](DEPLOY.md) for the full release workflow, one-time PyPI Trusted
|
|
121
|
+
Publisher setup, Docker, and Kubernetes deployment instructions.
|
|
122
|
+
|
|
123
|
+
### Console scripts
|
|
124
|
+
|
|
125
|
+
After installation the following commands are available on your `PATH`:
|
|
126
|
+
|
|
127
|
+
| Command | Description |
|
|
128
|
+
|---------|-------------|
|
|
129
|
+
| `impact-crawl` | GitHub ecosystem crawler CLI |
|
|
130
|
+
| `impact-extract` | Java AST dependency graph extractor |
|
|
131
|
+
| `impact-demo` | Run the built-in TelemetryService evolution demo |
|
|
132
|
+
| `impact-dashboard` | Launch the interactive architect dashboard |
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
## Running the Project
|
|
136
|
+
|
|
137
|
+
### Running Graph Extraction (Java Adapter)
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Via installed console script (after pip install impact-core[java])
|
|
141
|
+
impact-extract <projectName> <version> <srcDirectory> <outputJsonPath>
|
|
142
|
+
|
|
143
|
+
# Or directly
|
|
144
|
+
python3 adapters/java/extractor.py <projectName> <version> <srcDirectory> <outputJsonPath>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
For example, to extract graphs for the mock `TelemetryService` project:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
impact-extract TelemetryService 1.0.0 test_projects/telemetry_service_v1/src test_projects/v1_graph.json
|
|
151
|
+
impact-extract TelemetryService 2.0.0 test_projects/telemetry_service_v2/src test_projects/v2_graph.json
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Running the Demo
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Via installed console script
|
|
158
|
+
impact-demo
|
|
159
|
+
|
|
160
|
+
# Or directly
|
|
161
|
+
python3 run_demo.py
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
This runs the Coordinator agent, orchestrates the swarm, evaluates intents against the graph diffs, and generates the compliance report.
|
|
165
|
+
|
|
166
|
+
### Running the Architect Dashboard (UI)
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# Via installed console script
|
|
170
|
+
impact-dashboard
|
|
171
|
+
|
|
172
|
+
# Or directly
|
|
173
|
+
python3 run_dashboard.py
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
This starts a local development server and automatically opens the dashboard interface at `http://localhost:8080/dashboard/index.html`. In the dashboard, you can visually explore the dependency graphs (with cycles highlighted in red), add new intents, trigger evolution analyses, and view tabular diff metrics.
|
|
177
|
+
|
|
178
|
+

|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
### Running Unit Tests
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
python3 -m unittest discover -p "test_*.py"
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
### Running the Model Context Protocol (MCP) Server
|
|
189
|
+
|
|
190
|
+
To run the stdio-compliant Model Context Protocol server:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
python3 -m core.mcp_server
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
This starts the server on stdio. Any MCP-compatible client (such as Claude Desktop) can connect to it and invoke the `run_evolution_analysis` and `extract_java_graph` tools.
|
|
197
|
+
|
|
198
|
+
### Running PMD Static Analysis Merger
|
|
199
|
+
|
|
200
|
+
To integrate PMD static analysis reports into the extracted dependency graph, run:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
python3 adapters/java/static_analyzer.py <graphJsonPath> <pmdJsonPath>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
For example, to merge our mock PMD report into the Version 2 graph:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
python3 adapters/java/static_analyzer.py test_projects/v2_graph.json test_projects/pmd_report_v2.json
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Running the SHACL Structural Validator
|
|
213
|
+
|
|
214
|
+
To validate your JSON-LD software graphs against our SHACL structural shapes, execute:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
python3 core/shacl_validator.py <graphJsonPath>
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
## How It Works
|
|
223
|
+
|
|
224
|
+
1. **Codebase Extraction**: Pluggable language adapters parse a codebase and export its structural dependency network and metrics conforming to the standardized JSON schema.
|
|
225
|
+
2. **Orchestration**: The Coordinator agent manages the evaluation loop.
|
|
226
|
+
3. **Graph Analysis**: The Graph agent loads the JSON-LD files, and the Metrics agent calculates network centralities to identify coupling hubs.
|
|
227
|
+
4. **Version Comparison**: The Diff agent compares adjacent versions to discover added, removed, or modified nodes and edges, as well as newly introduced cycles.
|
|
228
|
+
5. **Intent Conformance**: The LLM agent evaluates the diff metrics against the user-specified architectural intents, outputting a compliance report and refactoring recommendations.
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Distributed Ecosystem Crawler
|
|
233
|
+
|
|
234
|
+
IMPACT ships a GitHub ecosystem crawler that discovers, downloads, and analyses large numbers of open-source Java projects at scale. It can run as a single local process (backed by SQLite) or as a distributed multi-node cluster (backed by PostgreSQL).
|
|
235
|
+
|
|
236
|
+
### Running Locally (SQLite, single process)
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
# 1. Populate the queue with the most-starred Java repositories
|
|
240
|
+
python3 -m core.ecosystem_crawler discover --min-stars 1000
|
|
241
|
+
|
|
242
|
+
# 2. Process queued repositories
|
|
243
|
+
python3 -m core.ecosystem_crawler crawl --limit 50
|
|
244
|
+
|
|
245
|
+
# 3. Check queue status and recent transitions
|
|
246
|
+
python3 -m core.ecosystem_crawler status
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
### Running with Docker (single node)
|
|
252
|
+
|
|
253
|
+
Build the crawler image:
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
docker build -t impact-crawler:latest .
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Run discovery then crawl with a local SQLite database:
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
docker run --rm \
|
|
263
|
+
-v "$(pwd)/test_projects:/app/test_projects" \
|
|
264
|
+
impact-crawler:latest discover --min-stars 1000
|
|
265
|
+
|
|
266
|
+
docker run --rm \
|
|
267
|
+
-v "$(pwd)/test_projects:/app/test_projects" \
|
|
268
|
+
impact-crawler:latest crawl --limit 50
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
To use a GitHub token (recommended to avoid rate limits):
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
docker run --rm \
|
|
275
|
+
-e GITHUB_TOKEN=ghp_yourtoken \
|
|
276
|
+
-v "$(pwd)/test_projects:/app/test_projects" \
|
|
277
|
+
impact-crawler:latest discover --min-stars 1000
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
### Running on Kubernetes (multi-node distributed)
|
|
283
|
+
|
|
284
|
+
The `k8s/` directory contains all Kubernetes manifests. Multiple crawler worker pods coordinate on a shared PostgreSQL queue using `SELECT FOR UPDATE SKIP LOCKED` — each pod atomically claims a repository and no two pods process the same one.
|
|
285
|
+
|
|
286
|
+
#### Prerequisites
|
|
287
|
+
|
|
288
|
+
- A running Kubernetes cluster (local: [minikube](https://minikube.sigs.k8s.io/) or [kind](https://kind.sigs.k8s.io/))
|
|
289
|
+
- `kubectl` configured to point at it
|
|
290
|
+
- The `impact-crawler:latest` image built and available in the cluster
|
|
291
|
+
|
|
292
|
+
#### Step 1 — Create the namespace
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
kubectl apply -f k8s/namespace.yaml
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
#### Step 2 — Create the database secret (not committed to git)
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
# Option A: imperative (nothing touches disk — recommended)
|
|
302
|
+
kubectl create secret generic postgres-secret \
|
|
303
|
+
--from-literal=username=impact \
|
|
304
|
+
--from-literal=password=yourpassword \
|
|
305
|
+
-n impact-crawler
|
|
306
|
+
|
|
307
|
+
# Option B: file-based (stays local, already gitignored)
|
|
308
|
+
cp k8s/secret.yaml.example k8s/secret.yaml
|
|
309
|
+
# Edit k8s/secret.yaml — replace REPLACE_WITH_BASE64_* with real values:
|
|
310
|
+
# echo -n 'impact' | base64
|
|
311
|
+
# echo -n 'yourpassword' | base64
|
|
312
|
+
kubectl apply -f k8s/secret.yaml
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
> **Security note:** `k8s/secret.yaml` is listed in `.gitignore` and must never be committed.
|
|
316
|
+
> Only `k8s/secret.yaml.example` (with placeholder values) is tracked in git.
|
|
317
|
+
|
|
318
|
+
#### Step 3 — Deploy PostgreSQL and configuration
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
kubectl apply -f k8s/configmap.yaml
|
|
322
|
+
kubectl apply -f k8s/postgres.yaml
|
|
323
|
+
|
|
324
|
+
# Wait for PostgreSQL to be ready
|
|
325
|
+
kubectl wait --for=condition=ready pod -l app=postgres \
|
|
326
|
+
-n impact-crawler --timeout=60s
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
#### Step 4 — Run the discovery Job (populates the queue)
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
kubectl apply -f k8s/discovery-job.yaml
|
|
333
|
+
kubectl wait --for=condition=complete job/crawler-discovery \
|
|
334
|
+
-n impact-crawler --timeout=300s
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
#### Step 5 — Start the distributed crawler workers
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
kubectl apply -f k8s/crawler-deployment.yaml
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
This starts **4 parallel worker pods** by default. Watch them drain the queue:
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
kubectl logs -l role=worker -n impact-crawler --follow
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
#### Scaling workers up or down
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
kubectl scale deployment crawler-worker --replicas=8 -n impact-crawler
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
#### Applying everything at once (after the secret exists)
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
kubectl apply -k k8s/
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
#### Removing the deployment
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
kubectl delete namespace impact-crawler
|
|
365
|
+
```
|
|
366
|
+
|