agentedit 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.
Files changed (148) hide show
  1. agentedit-1.0.0/.dockerignore +18 -0
  2. agentedit-1.0.0/.github/workflows/ci.yml +37 -0
  3. agentedit-1.0.0/.github/workflows/release.yml +40 -0
  4. agentedit-1.0.0/.gitignore +33 -0
  5. agentedit-1.0.0/AGENTS.md +65 -0
  6. agentedit-1.0.0/CHANGELOG.md +38 -0
  7. agentedit-1.0.0/CONTRIBUTING.md +43 -0
  8. agentedit-1.0.0/Dockerfile +17 -0
  9. agentedit-1.0.0/LICENSE +186 -0
  10. agentedit-1.0.0/NOTICE +19 -0
  11. agentedit-1.0.0/PKG-INFO +86 -0
  12. agentedit-1.0.0/README.md +46 -0
  13. agentedit-1.0.0/THIRD_PARTY.md +42 -0
  14. agentedit-1.0.0/docs/ARCHITECTURE.md +72 -0
  15. agentedit-1.0.0/docs/EVALS.md +51 -0
  16. agentedit-1.0.0/eval/__init__.py +0 -0
  17. agentedit-1.0.0/eval/go_mutate.py +77 -0
  18. agentedit-1.0.0/eval/harness.py +165 -0
  19. agentedit-1.0.0/eval/java_mutate.py +73 -0
  20. agentedit-1.0.0/eval/mutations.py +84 -0
  21. agentedit-1.0.0/eval/oracle.py +233 -0
  22. agentedit-1.0.0/eval/probe_dispatch.py +166 -0
  23. agentedit-1.0.0/eval/probe_multiroot.py +97 -0
  24. agentedit-1.0.0/eval/py_mutate.py +83 -0
  25. agentedit-1.0.0/eval/results/go.json +478 -0
  26. agentedit-1.0.0/eval/results/java.json +626 -0
  27. agentedit-1.0.0/eval/results/py.json +508 -0
  28. agentedit-1.0.0/eval/results/rust.json +478 -0
  29. agentedit-1.0.0/eval/results/ts.json +504 -0
  30. agentedit-1.0.0/eval/run_eval.py +68 -0
  31. agentedit-1.0.0/eval/rust_mutate.py +70 -0
  32. agentedit-1.0.0/eval/ts_mutate.py +110 -0
  33. agentedit-1.0.0/pyproject.toml +75 -0
  34. agentedit-1.0.0/src/agentedit/__init__.py +5 -0
  35. agentedit-1.0.0/src/agentedit/analyze/__init__.py +3 -0
  36. agentedit-1.0.0/src/agentedit/analyze/changes.py +110 -0
  37. agentedit-1.0.0/src/agentedit/analyze/impact.py +355 -0
  38. agentedit-1.0.0/src/agentedit/audit.py +189 -0
  39. agentedit-1.0.0/src/agentedit/backends/__init__.py +56 -0
  40. agentedit-1.0.0/src/agentedit/backends/base.py +72 -0
  41. agentedit-1.0.0/src/agentedit/backends/go.py +354 -0
  42. agentedit-1.0.0/src/agentedit/backends/java.py +239 -0
  43. agentedit-1.0.0/src/agentedit/backends/python.py +703 -0
  44. agentedit-1.0.0/src/agentedit/backends/rust.py +302 -0
  45. agentedit-1.0.0/src/agentedit/backends/typescript.py +603 -0
  46. agentedit-1.0.0/src/agentedit/cli.py +567 -0
  47. agentedit-1.0.0/src/agentedit/defaults.py +19 -0
  48. agentedit-1.0.0/src/agentedit/graphs.py +273 -0
  49. agentedit-1.0.0/src/agentedit/index/__init__.py +3 -0
  50. agentedit-1.0.0/src/agentedit/index/indexer.py +471 -0
  51. agentedit-1.0.0/src/agentedit/index/resolver.py +522 -0
  52. agentedit-1.0.0/src/agentedit/mcp_server.py +450 -0
  53. agentedit-1.0.0/src/agentedit/model.py +175 -0
  54. agentedit-1.0.0/src/agentedit/multirepo.py +160 -0
  55. agentedit-1.0.0/src/agentedit/store/__init__.py +3 -0
  56. agentedit-1.0.0/src/agentedit/store/sqlite.py +453 -0
  57. agentedit-1.0.0/src/agentedit/watch.py +95 -0
  58. agentedit-1.0.0/src/agentedit/workspace/__init__.py +3 -0
  59. agentedit-1.0.0/src/agentedit/workspace/git.py +45 -0
  60. agentedit-1.0.0/tests/conftest.py +17 -0
  61. agentedit-1.0.0/tests/fixtures/eval_go/go.mod +3 -0
  62. agentedit-1.0.0/tests/fixtures/eval_go/pkg/api/api.go +18 -0
  63. agentedit-1.0.0/tests/fixtures/eval_go/pkg/format/format.go +12 -0
  64. agentedit-1.0.0/tests/fixtures/eval_go/pkg/metrics/metrics.go +6 -0
  65. agentedit-1.0.0/tests/fixtures/eval_go/pkg/queue/queue.go +9 -0
  66. agentedit-1.0.0/tests/fixtures/eval_go/pkg/service/service.go +32 -0
  67. agentedit-1.0.0/tests/fixtures/eval_go/pkg/unused/unused.go +5 -0
  68. agentedit-1.0.0/tests/fixtures/eval_java/app/api/Api.java +20 -0
  69. agentedit-1.0.0/tests/fixtures/eval_java/app/format/MoneyFormatter.java +14 -0
  70. agentedit-1.0.0/tests/fixtures/eval_java/app/metrics/Metrics.java +7 -0
  71. agentedit-1.0.0/tests/fixtures/eval_java/app/queue/QueueOps.java +14 -0
  72. agentedit-1.0.0/tests/fixtures/eval_java/app/service/PaymentService.java +24 -0
  73. agentedit-1.0.0/tests/fixtures/eval_java/app/unused/Unused.java +7 -0
  74. agentedit-1.0.0/tests/fixtures/eval_py/pkg/__init__.py +0 -0
  75. agentedit-1.0.0/tests/fixtures/eval_py/pkg/api.py +17 -0
  76. agentedit-1.0.0/tests/fixtures/eval_py/pkg/format.py +5 -0
  77. agentedit-1.0.0/tests/fixtures/eval_py/pkg/metrics.py +2 -0
  78. agentedit-1.0.0/tests/fixtures/eval_py/pkg/queue.py +24 -0
  79. agentedit-1.0.0/tests/fixtures/eval_py/pkg/services.py +18 -0
  80. agentedit-1.0.0/tests/fixtures/eval_py/pkg/types.py +4 -0
  81. agentedit-1.0.0/tests/fixtures/eval_py/pkg/unused.py +2 -0
  82. agentedit-1.0.0/tests/fixtures/eval_py/pyrightconfig.json +5 -0
  83. agentedit-1.0.0/tests/fixtures/eval_py_multiroot/svc/__init__.py +0 -0
  84. agentedit-1.0.0/tests/fixtures/eval_py_multiroot/svc/api.py +9 -0
  85. agentedit-1.0.0/tests/fixtures/eval_py_multiroot/svc/gym.py +7 -0
  86. agentedit-1.0.0/tests/fixtures/eval_py_multiroot/svc/services/__init__.py +0 -0
  87. agentedit-1.0.0/tests/fixtures/eval_py_multiroot/svc/services/brain.py +16 -0
  88. agentedit-1.0.0/tests/fixtures/eval_py_multiroot/web/__init__.py +0 -0
  89. agentedit-1.0.0/tests/fixtures/eval_py_multiroot/web/main.py +7 -0
  90. agentedit-1.0.0/tests/fixtures/eval_rust/Cargo.lock +7 -0
  91. agentedit-1.0.0/tests/fixtures/eval_rust/Cargo.toml +4 -0
  92. agentedit-1.0.0/tests/fixtures/eval_rust/src/api.rs +18 -0
  93. agentedit-1.0.0/tests/fixtures/eval_rust/src/format.rs +17 -0
  94. agentedit-1.0.0/tests/fixtures/eval_rust/src/lib.rs +6 -0
  95. agentedit-1.0.0/tests/fixtures/eval_rust/src/metrics.rs +3 -0
  96. agentedit-1.0.0/tests/fixtures/eval_rust/src/queue.rs +7 -0
  97. agentedit-1.0.0/tests/fixtures/eval_rust/src/service.rs +19 -0
  98. agentedit-1.0.0/tests/fixtures/eval_rust/src/unused.rs +3 -0
  99. agentedit-1.0.0/tests/fixtures/eval_ts/package.json +8 -0
  100. agentedit-1.0.0/tests/fixtures/eval_ts/src/api/handlers.ts +19 -0
  101. agentedit-1.0.0/tests/fixtures/eval_ts/src/lib/metrics.ts +3 -0
  102. agentedit-1.0.0/tests/fixtures/eval_ts/src/lib/queue.ts +30 -0
  103. agentedit-1.0.0/tests/fixtures/eval_ts/src/services/payments.ts +17 -0
  104. agentedit-1.0.0/tests/fixtures/eval_ts/src/utils/format.ts +7 -0
  105. agentedit-1.0.0/tests/fixtures/eval_ts/src/utils/unused.ts +3 -0
  106. agentedit-1.0.0/tests/fixtures/eval_ts/tsconfig.json +12 -0
  107. agentedit-1.0.0/tests/fixtures/eval_ts_dispatch/src/main.ts +13 -0
  108. agentedit-1.0.0/tests/fixtures/eval_ts_dispatch/tsconfig.json +1 -0
  109. agentedit-1.0.0/tests/fixtures/sample_go/go.mod +3 -0
  110. agentedit-1.0.0/tests/fixtures/sample_go/pkg/api/api.go +21 -0
  111. agentedit-1.0.0/tests/fixtures/sample_go/pkg/auth/auth.go +17 -0
  112. agentedit-1.0.0/tests/fixtures/sample_py/auth.py +14 -0
  113. agentedit-1.0.0/tests/fixtures/sample_py/controller.py +13 -0
  114. agentedit-1.0.0/tests/fixtures/sample_py/routes.py +11 -0
  115. agentedit-1.0.0/tests/fixtures/sample_py_attr/svc/__init__.py +0 -0
  116. agentedit-1.0.0/tests/fixtures/sample_py_attr/svc/gate.py +17 -0
  117. agentedit-1.0.0/tests/fixtures/sample_py_attr/svc/services/__init__.py +0 -0
  118. agentedit-1.0.0/tests/fixtures/sample_py_attr/svc/services/brain.py +3 -0
  119. agentedit-1.0.0/tests/fixtures/sample_py_v4/app.py +56 -0
  120. agentedit-1.0.0/tests/fixtures/sample_py_v4/brain.py +6 -0
  121. agentedit-1.0.0/tests/fixtures/sample_ts/src/auth.ts +17 -0
  122. agentedit-1.0.0/tests/fixtures/sample_ts/src/controller.ts +15 -0
  123. agentedit-1.0.0/tests/fixtures/sample_ts/src/routes.ts +11 -0
  124. agentedit-1.0.0/tests/test_audit.py +113 -0
  125. agentedit-1.0.0/tests/test_changes.py +40 -0
  126. agentedit-1.0.0/tests/test_contracts.py +97 -0
  127. agentedit-1.0.0/tests/test_engine_depth.py +83 -0
  128. agentedit-1.0.0/tests/test_engine_v4.py +105 -0
  129. agentedit-1.0.0/tests/test_extract.py +58 -0
  130. agentedit-1.0.0/tests/test_go.py +53 -0
  131. agentedit-1.0.0/tests/test_graph_cli.py +95 -0
  132. agentedit-1.0.0/tests/test_graphs.py +103 -0
  133. agentedit-1.0.0/tests/test_hardening.py +103 -0
  134. agentedit-1.0.0/tests/test_index_impact.py +159 -0
  135. agentedit-1.0.0/tests/test_java.py +52 -0
  136. agentedit-1.0.0/tests/test_mcp.py +68 -0
  137. agentedit-1.0.0/tests/test_metadata.py +19 -0
  138. agentedit-1.0.0/tests/test_multirepo.py +38 -0
  139. agentedit-1.0.0/tests/test_probe_dispatch_gate.py +13 -0
  140. agentedit-1.0.0/tests/test_python.py +58 -0
  141. agentedit-1.0.0/tests/test_python_attr.py +75 -0
  142. agentedit-1.0.0/tests/test_python_gaps.py +156 -0
  143. agentedit-1.0.0/tests/test_robustness.py +102 -0
  144. agentedit-1.0.0/tests/test_rust.py +49 -0
  145. agentedit-1.0.0/tests/test_signature.py +52 -0
  146. agentedit-1.0.0/tests/test_store_purity.py +79 -0
  147. agentedit-1.0.0/tests/test_unresolved_buckets.py +50 -0
  148. agentedit-1.0.0/tests/test_watch.py +49 -0
@@ -0,0 +1,18 @@
1
+ .git
2
+ .venv
3
+ .venv2
4
+ __pycache__
5
+ *.pyc
6
+ *.egg-info
7
+ .pytest_cache
8
+ .mypy_cache
9
+ .ruff_cache
10
+ tests
11
+ eval
12
+ .github
13
+ .agentedit
14
+ *.db
15
+ *.db-shm
16
+ *.db-wal
17
+ Dockerfile
18
+ .dockerignore
@@ -0,0 +1,37 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ lint:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: "3.12"
16
+ - name: Install
17
+ run: pip install -e ".[dev]"
18
+ - name: Ruff
19
+ run: ruff check src tests eval
20
+ - name: Mypy (strict)
21
+ run: mypy src tests eval
22
+
23
+ test:
24
+ strategy:
25
+ fail-fast: false
26
+ matrix:
27
+ python-version: ["3.11", "3.12", "3.13"]
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - uses: actions/setup-python@v5
32
+ with:
33
+ python-version: ${{ matrix.python-version }}
34
+ - name: Install
35
+ run: pip install -e ".[dev]"
36
+ - name: Tests
37
+ run: python -m pytest -q
@@ -0,0 +1,40 @@
1
+ name: Release
2
+
3
+ # Builds a source distribution + wheel on a version tag and attaches them to
4
+ # the GitHub Release for that tag. Install commands are published in the README
5
+ # (pipx/uv from the release-asset URL, or `pip install git+...@tag`).
6
+ #
7
+ # No PyPI publishing: the `impactmap` name on PyPI belongs to an unrelated
8
+ # project, and releases are distributed from GitHub. PyPI is used only for the
9
+ # tree-sitter language wheels that ship as regular dependencies.
10
+
11
+ on:
12
+ push:
13
+ tags:
14
+ - "v*"
15
+
16
+ permissions:
17
+ contents: write
18
+
19
+ jobs:
20
+ build-and-attach:
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.12"
27
+ - name: Install build tooling
28
+ run: pip install build
29
+ - name: Build sdist + wheel
30
+ run: python -m build --outdir dist
31
+ - name: Smoke-install the wheel
32
+ run: |
33
+ python -m venv /tmp/verify
34
+ /tmp/verify/bin/pip install dist/*.whl
35
+ /tmp/verify/bin/impactmap --version
36
+ - name: Attach artifacts to the GitHub Release
37
+ uses: softprops/action-gh-release@v2
38
+ with:
39
+ files: dist/*
40
+ generate_release_notes: true
@@ -0,0 +1,33 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ .venv/
5
+ venv/
6
+ build/
7
+ dist/
8
+ .pytest_cache/
9
+ .mypy_cache/
10
+ .ruff_cache/
11
+ .coverage
12
+ htmlcov/
13
+
14
+ # Impactmap artifacts
15
+ .impactmap/
16
+ *.db
17
+ *.db-shm
18
+ *.db-wal
19
+
20
+ # Eval corpora / results
21
+ eval/corpora/
22
+ eval/results/*
23
+ !eval/corpora/.gitkeep
24
+ !eval/results/.gitkeep
25
+ !eval/results/*.json
26
+
27
+ # Local tooling
28
+ .idea/
29
+ .vscode/
30
+ .DS_Store
31
+
32
+ # Rust build artifacts in eval fixture
33
+ /tests/fixtures/eval_rust/target/
@@ -0,0 +1,65 @@
1
+ # AGENTS.md — AgentEdit
2
+
3
+ Working rules for any agent/developer in this repository.
4
+
5
+ ## What this is
6
+ A deterministic, local change-intelligence layer for coding agents: structural
7
+ code graph (tree-sitter) + impact/audit/why analysis + MCP. Engine core is
8
+ language-agnostic; languages are pluggable backends. Supports named graphs of
9
+ several repositories (multi-repo).
10
+
11
+ ## How we work (non-negotiable)
12
+ - **Quality > language count.** Never claim a capability the tests/eval don't prove.
13
+ - **Gates before moving on.** A change ships only when its exit criteria are
14
+ green (ruff, mypy strict, pytest, eval).
15
+ - **No bug moves forward.** Every defect found becomes a failing test first,
16
+ then is fixed.
17
+ - **Honesty is a feature.** Confidence, `unresolved`, external/suspected
18
+ surfaces and eval numbers are public; never fake certainty the graph doesn't have.
19
+ - **No mutable surface for agents.** The structural graph is rebuilt from code
20
+ and stays read-only; there is no knowledge/write layer.
21
+
22
+ ## Commands
23
+ ```bash
24
+ source .venv/bin/activate
25
+ pip install -e ".[dev]"
26
+
27
+ ruff check src tests eval # lint
28
+ # pytest (any invocation; tests/conftest.py puts the repo root on sys.path)
29
+ python -m pytest -q
30
+ mypy src tests eval # strict typing (whole repo)
31
+ # evals: per-language oracles, each writes its OWN artifact (never overwrite):
32
+ python -m eval.run_eval --corpus tests/fixtures/eval_ts --oracle tsc --mutation remove-declaration --mutation rename --mutation add-required-param --out eval/results/ts.json
33
+ python -m eval.run_eval --corpus tests/fixtures/eval_py --oracle pyright --mutation remove-declaration --mutation rename --mutation add-required-param --out eval/results/py.json
34
+ python -m eval.run_eval --corpus tests/fixtures/eval_go --oracle go --mutation remove-declaration --mutation rename --mutation add-required-param --out eval/results/go.json
35
+ python -m eval.run_eval --corpus tests/fixtures/eval_rust --oracle rust --mutation remove-declaration --mutation rename --mutation add-required-param --out eval/results/rust.json
36
+ python -m eval.run_eval --corpus tests/fixtures/eval_java --oracle java --mutation remove-declaration --mutation rename --mutation add-required-param --out eval/results/java.json
37
+ # note: evals need go/cargo(->RUSTUP_TOOLCHAIN=stable)/javac on PATH and npm for tsc+pyright; not in CI
38
+ python -m eval.probe_dispatch # engine gate: dispatch/inheritance/surfaces (py+TS)
39
+ agentedit index <repo> # CLI: build the graph
40
+ agentedit impact <qname> [--repo <r> | --graph <g>]
41
+ agentedit audit <qname|file> [--repo <r> | --graph <g>]
42
+ agentedit would-break <qname> --change <kind> [--repo <r> | --graph <g>]
43
+ agentedit why <qname> [--repo <r> | --graph <g>]
44
+ agentedit graph create|add-repo|contract-add|refresh <name>
45
+ agentedit mcp [--repo <r> | --graph <g>]
46
+ ```
47
+
48
+ ## Architecture rules
49
+ - **Dependency direction:** `model` imports nothing; `extract/index/store/analyze`
50
+ depend on `model`; `cli`/`mcp_server` are thin shells. No upward imports.
51
+ - **No LLM in the extraction path.** Parsing is deterministic.
52
+ - **New language = new backend** (see docs/ARCHITECTURE.md): `collect_files`,
53
+ `parse_file`, module-id, `spec_target`. The core
54
+ (`resolver/store/analyze/eval`) stays untouched.
55
+ - **analyze never derives module identity from file paths** — it reads
56
+ `files.module_qname` from the store.
57
+ - **Edge resolution records its method** (`same`/`import`/`global`) — new
58
+ strategies must degrade confidence, never fake it.
59
+ - Cross-repo edges exist only via declared, verified graph contracts; every
60
+ `Affected` ships its basis/evidence (why-chains).
61
+
62
+ ## Provenance
63
+ AgentEdit is the standalone open-source extraction of SwiftGate's `skelett`
64
+ code-graph engine. Keep attribution current in `NOTICE` and file headers when
65
+ code/semantics are carried forward.
@@ -0,0 +1,38 @@
1
+ # Changelog
2
+
3
+ All notable changes to AgentEdit are documented here. Format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.0.0/); versioning is SemVer.
5
+
6
+ ## [1.0.0] - 2026-09-06
7
+
8
+ First public release: **pure, deterministic multi-repo impact analysis** for
9
+ coding agents — no mutable knowledge layer, no LLM in the analysis path.
10
+
11
+ ### Added
12
+ - Structural code graph per repository (tree-sitter), auto language detection.
13
+ - `impact`, `dependents`, `would_break` with confidence-graded, why-chained
14
+ answers; `changes` change-surface; `search`, `symbols_in_file`.
15
+ - Flagship `audit`: one-call crash-audit brief (risk, grouped affected files as
16
+ a read-set, git rationale, suspected unresolved references, resolution
17
+ health). `why` for deterministic git rationale + mined candidates.
18
+ - **Multi-repo graphs**: named graphs hold any number of repositories; CLI and
19
+ MCP queries fan out per member; cross-repo dependency edges exist only via
20
+ declared, two-sided-verified contracts.
21
+ - **MCP stdio server** with eight read-only tools
22
+ (`impact`, `dependents`, `would_break`, `changes`, `search`,
23
+ `symbols_in_file`, `audit`, `why`) for repo and graph mode.
24
+ - **Watch** freshness engine and per-graph refresh.
25
+ - Five language backends: Python, TypeScript/JavaScript, Go, Rust, Java — each
26
+ with an eval corpus at 1.0/1.0 recall/precision.
27
+ - Honest `unresolved` reporting in three buckets (external / in-repo /
28
+ dynamic); framework/plugin entry marking; suspected name-match surfacing.
29
+
30
+ ### Changed
31
+ - Distribution name, import module and console command are all **agentedit**.
32
+ Releases are distributed as GitHub Release wheel assets and published to
33
+ PyPI; PyPI is also used for the tree-sitter language dependencies.
34
+ - Existing databases from pre-1.0 releases are cleaned in place on first open
35
+ (leftover `notes`/`knowledge` tables are dropped); the engine is structural
36
+ only.
37
+
38
+ [1.0.0]: https://github.com/thetaroot/agentedit/releases/tag/v1.0.0
@@ -0,0 +1,43 @@
1
+ # Contributing
2
+
3
+ Thanks for helping make AgentEdit a tool agents can trust. Trust is the
4
+ product — the bar is **no prediction without a basis, no claim without a
5
+ benchmark**.
6
+
7
+ ## License
8
+
9
+ This project is Apache-2.0. By contributing you agree that your contribution is
10
+ licensed under the same terms (inbound = outbound); attribution stays with
11
+ `thetaroot` in [NOTICE](NOTICE).
12
+
13
+ ## Setup
14
+
15
+ ```bash
16
+ python -m venv .venv && source .venv/bin/activate
17
+ pip install -e ".[dev]"
18
+ ```
19
+
20
+ ## Gates — must be green before merging
21
+
22
+ ```bash
23
+ ruff check src tests eval
24
+ mypy src tests eval
25
+ python -m pytest -q
26
+ ```
27
+
28
+ Language or resolution changes also touch the evals (`eval/results/*.json`):
29
+ add a mutation to the corpus and keep recall/precision at 1.0/1.0, or explain
30
+ any regression in the PR. Evals need real toolchains (`tsc`, `pyright`, go,
31
+ cargo, javac) — see [docs/EVALS.md].
32
+
33
+ ## Pull requests
34
+
35
+ - Small, focused commits; conventional commit messages.
36
+ - No secrets, tokens, or absolute local paths.
37
+ - Provenance of skelett-derived code stays documented in [NOTICE](NOTICE) and
38
+ file headers.
39
+ - Include tests for new behaviour and an eval-corpus mutation when semantics
40
+ change.
41
+
42
+ We build and use **SwiftGate** — if you find this project helpful, check it out
43
+ at [swiftgateai.de](https://swiftgateai.de).
@@ -0,0 +1,17 @@
1
+ FROM python:3.12-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # tree-sitter wheels build fine without compilers on slim for common platforms;
6
+ # install build deps only if a wheel is missing.
7
+ COPY pyproject.toml README.md LICENSE NOTICE ./
8
+ COPY src ./src
9
+
10
+ RUN pip install --no-cache-dir .
11
+
12
+ # The graph lives under the repo being indexed; mount it read/write.
13
+ VOLUME ["/repo"]
14
+ ENV AGENTEDIT_DB=/repo/.agentedit/graph.db
15
+
16
+ ENTRYPOINT ["agentedit"]
17
+ CMD ["--help"]
@@ -0,0 +1,186 @@
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, and
10
+ distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the
13
+ copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other
16
+ entities that control, are controlled by, or are under common control with
17
+ that entity. For the purposes of this definition, "control" means (i) the
18
+ power, direct or indirect, to cause the direction or management of such
19
+ entity, whether by contract or otherwise, or (ii) ownership of fifty percent
20
+ (50%) or more of the outstanding shares, or (iii) beneficial ownership of
21
+ such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
24
+ 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 source, and
28
+ configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical transformation
31
+ or translation of a Source form, including but not limited to compiled object
32
+ code, generated documentation, and conversions to other media types.
33
+
34
+ "Work" shall mean the work of authorship, whether in Source or Object form,
35
+ made available under the License, as indicated by a copyright notice that is
36
+ included in or attached to the work (an example is provided in the Appendix
37
+ below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object form,
40
+ that is based on (or derived from) the Work and for which the editorial
41
+ revisions, annotations, elaborations, or other modifications represent, as a
42
+ whole, an original work of authorship. For the purposes of this License,
43
+ Derivative Works shall not include works that remain separable from, or merely
44
+ link (or bind by name) to the interfaces of, the Work and Derivative Works
45
+ thereof.
46
+
47
+ "Contribution" shall mean any work of authorship, including the original
48
+ version of the Work and any modifications or additions to that Work or
49
+ Derivative Works thereof, that is intentionally submitted to Licensor for
50
+ inclusion in the Work by the copyright owner or by an individual or Legal
51
+ Entity authorized to submit on behalf of the copyright owner. For the purposes
52
+ of this definition, "submitted" means any form of electronic, verbal, or
53
+ written communication sent to the Licensor or its representatives, including
54
+ but not limited to communication on electronic mailing lists, source code
55
+ control systems, and issue tracking systems that are managed by, or on behalf
56
+ of, the Licensor for the purpose of discussing and improving the Work, but
57
+ excluding communication that is conspicuously marked or otherwise designated
58
+ in writing by the copyright owner as "Not a Contribution."
59
+
60
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
61
+ of whom a Contribution has been received by Licensor and subsequently
62
+ incorporated within the Work.
63
+
64
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
65
+ License, each Contributor hereby grants to You a perpetual, worldwide,
66
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
67
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
68
+ sublicense, and distribute the Work and such Derivative Works in Source or
69
+ Object form.
70
+
71
+ 3. Grant of Patent License. Subject to the terms and conditions of this
72
+ License, each Contributor hereby grants to You a perpetual, worldwide,
73
+ non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
74
+ section) patent license to make, have made, use, offer to sell, sell, import,
75
+ and otherwise transfer the Work, where such license applies only to those
76
+ patent claims licensable by such Contributor that are necessarily infringed by
77
+ their Contribution(s) alone or by combination of their Contribution(s) with
78
+ the Work to which such Contribution(s) was submitted. If You institute patent
79
+ litigation against any entity (including a cross-claim or counterclaim in a
80
+ lawsuit) alleging that the Work or a Contribution incorporated within the Work
81
+ constitutes direct or contributory patent infringement, then any patent
82
+ licenses granted to You under this License for that Work shall terminate as of
83
+ the date such litigation is filed.
84
+
85
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
86
+ Derivative Works thereof in any medium, with or without modifications, and in
87
+ Source or Object form, provided that You meet the following conditions:
88
+
89
+ (a) You must give any other recipients of the Work or Derivative Works a copy
90
+ of this License; and
91
+
92
+ (b) You must cause any modified files to carry prominent notices stating that
93
+ You changed the files; and
94
+
95
+ (c) You must retain, in the Source form of any Derivative Works that You
96
+ distribute, all copyright, patent, trademark, and attribution notices from the
97
+ Source form of the Work, excluding those notices that do not pertain to any
98
+ part of the Derivative Works; and
99
+
100
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then
101
+ any Derivative Works that You distribute must include a readable copy of the
102
+ attribution notices contained within such NOTICE file, excluding those notices
103
+ that do not pertain to any part of the Derivative Works, in at least one of the
104
+ following places: within a NOTICE text file distributed as part of the
105
+ Derivative Works; within the Source form or documentation, if provided along
106
+ with the Derivative Works; or, within a display generated by the Derivative
107
+ Works, if and wherever such third-party notices normally appear. The contents
108
+ of the NOTICE file are for informational purposes only and do not modify the
109
+ License. You may add Your own attribution notices within Derivative Works that
110
+ You distribute, alongside or as an addendum to the NOTICE text from the Work,
111
+ provided that such additional attribution notices cannot be construed as
112
+ modifying the License.
113
+
114
+ You may add Your own copyright statement to Your modifications and may provide
115
+ additional or different license terms and conditions for use, reproduction, or
116
+ distribution of Your modifications, or for any such Derivative Works as a
117
+ whole, provided Your use, reproduction, and distribution of the Work otherwise
118
+ complies with the conditions stated in this License.
119
+
120
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
121
+ Contribution intentionally submitted for inclusion in the Work by You to the
122
+ Licensor shall be under the terms and conditions of this License, without any
123
+ additional terms or conditions. Notwithstanding the above, nothing herein
124
+ shall supersede or modify the terms of any separate license agreement you may
125
+ have executed with Licensor regarding such Contributions.
126
+
127
+ 6. Trademarks. This License does not grant permission to use the trade names,
128
+ trademarks, service marks, or product names of the Licensor, except as required
129
+ for reasonable and customary use in describing the origin of the Work and
130
+ reproducing the content of the NOTICE file.
131
+
132
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
133
+ writing, Licensor provides the Work (and each Contributor provides its
134
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
135
+ KIND, either express or implied, including, without limitation, any warranties
136
+ or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
137
+ PARTICULAR PURPOSE. You are solely responsible for determining the
138
+ appropriateness of using or redistributing the Work and assume any risks
139
+ associated with Your exercise of permissions under this License.
140
+
141
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
142
+ tort (including negligence), contract, or otherwise, unless required by
143
+ applicable law (such as deliberate and grossly negligent acts) or agreed to in
144
+ writing, shall any Contributor be liable to You for damages, including any
145
+ direct, indirect, special, incidental, or consequential damages of any
146
+ character arising as a result of this License or out of the use or inability to
147
+ use the Work (including but not limited to damages for loss of goodwill, work
148
+ stoppage, computer failure or malfunction, or any and all other commercial
149
+ damages or losses), even if such Contributor has been advised of the
150
+ possibility of such damages.
151
+
152
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work
153
+ or Derivative Works thereof, You may choose to offer, and charge a fee for,
154
+ acceptance of support, warranty, indemnity, or other liability obligations
155
+ and/or rights consistent with this License. However, in accepting such
156
+ obligations, You may act only on Your own behalf and on Your sole
157
+ responsibility, not on behalf of any other Contributor, and only if You agree
158
+ to indemnify, defend, and hold each Contributor harmless for any liability
159
+ incurred by, or claims asserted against, such Contributor by reason of your
160
+ accepting any such warranty or additional liability.
161
+
162
+ END OF TERMS AND CONDITIONS
163
+
164
+ APPENDIX: How to apply the Apache License to your work.
165
+
166
+ To apply the Apache License to your work, attach the following boilerplate
167
+ notice, with the fields enclosed by brackets "[]" replaced with your own
168
+ identifying information. (Don't include the brackets!) The text should be
169
+ enclosed in the appropriate comment syntax for the file format. We also
170
+ recommend that a file or class name and description of purpose be included on
171
+ the same "printed page" as the copyright notice for easier identification
172
+ within third-party archives.
173
+
174
+ Copyright [yyyy] [name of copyright owner]
175
+
176
+ Licensed under the Apache License, Version 2.0 (the "License");
177
+ you may not use this file except in compliance with the License.
178
+ You may obtain a copy of the License at
179
+
180
+ http://www.apache.org/licenses/LICENSE-2.0
181
+
182
+ Unless required by applicable law or agreed to in writing, software
183
+ distributed under the License is distributed on an "AS IS" BASIS,
184
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
185
+ See the License for the specific language governing permissions and
186
+ limitations under the License.
agentedit-1.0.0/NOTICE ADDED
@@ -0,0 +1,19 @@
1
+ AgentEdit
2
+ Copyright 2026 thetaroot (SwiftGate)
3
+ Project home: https://github.com/thetaroot/agentedit
4
+
5
+ This product includes software developed for the SwiftGate project
6
+ (https://github.com/thetaroot/swiftgate), specifically its "skelett" code-graph
7
+ engine. The following modules carry forward design, semantics, and in some
8
+ cases code originally written for skelett, re-licensed here under Apache-2.0:
9
+
10
+ - extraction model and TypeScript/JavaScript symbol extraction
11
+ - edge kinds and signature-diff semantics used by would_break
12
+ - confidence-graded, structural impact traversal concepts
13
+
14
+ AgentEdit is the standalone, local, open-source extraction of that engine.
15
+ The managed, multi-tenant SwiftGate platform is a separate, proprietary
16
+ product. This project is released independently and is not an official
17
+ SwiftGate distribution.
18
+
19
+ Built with SwiftGate.
@@ -0,0 +1,86 @@
1
+ Metadata-Version: 2.5
2
+ Name: agentedit
3
+ Version: 1.0.0
4
+ Summary: A local change-intelligence layer for coding agents: know what your code change will break before you make it.
5
+ Project-URL: Homepage, https://github.com/thetaroot/agentedit
6
+ Project-URL: Source, https://github.com/thetaroot/agentedit
7
+ Project-URL: Issues, https://github.com/thetaroot/agentedit/issues
8
+ Project-URL: SwiftGate, https://swiftgateai.de
9
+ Author: thetaroot
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ License-File: NOTICE
13
+ Keywords: code-graph,coding-agents,impact-analysis,mcp,tree-sitter
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: Apache Software License
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Software Development :: Libraries
23
+ Classifier: Topic :: Software Development :: Quality Assurance
24
+ Requires-Python: >=3.11
25
+ Requires-Dist: tree-sitter-go>=0.23
26
+ Requires-Dist: tree-sitter-java>=0.23
27
+ Requires-Dist: tree-sitter-javascript>=0.23
28
+ Requires-Dist: tree-sitter-python>=0.23
29
+ Requires-Dist: tree-sitter-rust>=0.23
30
+ Requires-Dist: tree-sitter-typescript>=0.23
31
+ Requires-Dist: tree-sitter>=0.23
32
+ Provides-Extra: dev
33
+ Requires-Dist: mypy>=1.8; extra == 'dev'
34
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
35
+ Requires-Dist: pytest>=8.0; extra == 'dev'
36
+ Requires-Dist: ruff>=0.4; extra == 'dev'
37
+ Provides-Extra: eval
38
+ Requires-Dist: pytest>=8.0; extra == 'eval'
39
+ Description-Content-Type: text/markdown
40
+
41
+ # AgentEdit
42
+
43
+ ```bash
44
+ pipx install "https://github.com/thetaroot/agentedit/releases/download/v1.0.0/agentedit-1.0.0-py3-none-any.whl"
45
+ # or: pip install "git+https://github.com/thetaroot/agentedit@v1.0.0"
46
+ ```
47
+
48
+ Deterministic, local impact analysis for coding agents: **know what your code
49
+ change will break before you make it.**
50
+
51
+ ```bash
52
+ agentedit index . # build the local code graph
53
+ agentedit impact src.auth.authenticate # who depends on it?
54
+ agentedit audit src.auth.authenticate # one-call crash-audit before an edit
55
+ ```
56
+
57
+ ## What it does
58
+
59
+ - **Impact & crash-audit** — `impact`, `dependents`, `would_break`, `audit`
60
+ with confidence-graded answers, why-chains, git rationale and a minimal
61
+ read-set. Deterministic; no LLM in the analysis path.
62
+ - **Multi-repo** — one local *graph* holds many repositories; cross-repo
63
+ dependencies exist only via declared, verified contracts, never guessed.
64
+ - **5 languages** — Python, TypeScript/JavaScript, Go, Rust, Java; each with a
65
+ mutation eval corpus at 1.0/1.0 recall/precision ([docs/EVALS.md]).
66
+ - **Honest** — every edge records how it was resolved; unresolved usage is
67
+ counted and surfaced as *suspected*, never silently assumed safe.
68
+ - **MCP server** — eight read-only tools (`impact`, `dependents`,
69
+ `would_break`, `changes`, `search`, `symbols_in_file`, `audit`, `why`) for
70
+ repo and graph mode. `agentedit mcp --repo <path>` or `--graph <name>`.
71
+
72
+ Details: [docs/ARCHITECTURE.md] · [docs/EVALS.md] · [CONTRIBUTING.md]
73
+
74
+ ## License
75
+
76
+ Apache-2.0. AgentEdit is the standalone open-source extraction of SwiftGate's
77
+ `skelett` code-graph engine — see [NOTICE] and [THIRD_PARTY.md].
78
+
79
+ We build and use **SwiftGate** — if you find this open-source project helpful,
80
+ check it out at [swiftgateai.de](https://swiftgateai.de).
81
+
82
+ [docs/EVALS.md]: docs/EVALS.md
83
+ [docs/ARCHITECTURE.md]: docs/ARCHITECTURE.md
84
+ [CONTRIBUTING.md]: CONTRIBUTING.md
85
+ [NOTICE]: NOTICE
86
+ [THIRD_PARTY.md]: THIRD_PARTY.md
@@ -0,0 +1,46 @@
1
+ # AgentEdit
2
+
3
+ ```bash
4
+ pipx install "https://github.com/thetaroot/agentedit/releases/download/v1.0.0/agentedit-1.0.0-py3-none-any.whl"
5
+ # or: pip install "git+https://github.com/thetaroot/agentedit@v1.0.0"
6
+ ```
7
+
8
+ Deterministic, local impact analysis for coding agents: **know what your code
9
+ change will break before you make it.**
10
+
11
+ ```bash
12
+ agentedit index . # build the local code graph
13
+ agentedit impact src.auth.authenticate # who depends on it?
14
+ agentedit audit src.auth.authenticate # one-call crash-audit before an edit
15
+ ```
16
+
17
+ ## What it does
18
+
19
+ - **Impact & crash-audit** — `impact`, `dependents`, `would_break`, `audit`
20
+ with confidence-graded answers, why-chains, git rationale and a minimal
21
+ read-set. Deterministic; no LLM in the analysis path.
22
+ - **Multi-repo** — one local *graph* holds many repositories; cross-repo
23
+ dependencies exist only via declared, verified contracts, never guessed.
24
+ - **5 languages** — Python, TypeScript/JavaScript, Go, Rust, Java; each with a
25
+ mutation eval corpus at 1.0/1.0 recall/precision ([docs/EVALS.md]).
26
+ - **Honest** — every edge records how it was resolved; unresolved usage is
27
+ counted and surfaced as *suspected*, never silently assumed safe.
28
+ - **MCP server** — eight read-only tools (`impact`, `dependents`,
29
+ `would_break`, `changes`, `search`, `symbols_in_file`, `audit`, `why`) for
30
+ repo and graph mode. `agentedit mcp --repo <path>` or `--graph <name>`.
31
+
32
+ Details: [docs/ARCHITECTURE.md] · [docs/EVALS.md] · [CONTRIBUTING.md]
33
+
34
+ ## License
35
+
36
+ Apache-2.0. AgentEdit is the standalone open-source extraction of SwiftGate's
37
+ `skelett` code-graph engine — see [NOTICE] and [THIRD_PARTY.md].
38
+
39
+ We build and use **SwiftGate** — if you find this open-source project helpful,
40
+ check it out at [swiftgateai.de](https://swiftgateai.de).
41
+
42
+ [docs/EVALS.md]: docs/EVALS.md
43
+ [docs/ARCHITECTURE.md]: docs/ARCHITECTURE.md
44
+ [CONTRIBUTING.md]: CONTRIBUTING.md
45
+ [NOTICE]: NOTICE
46
+ [THIRD_PARTY.md]: THIRD_PARTY.md