codiff 0.1.2__tar.gz → 0.1.3__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.
- {codiff-0.1.2 → codiff-0.1.3}/PKG-INFO +40 -11
- {codiff-0.1.2 → codiff-0.1.3}/README.md +39 -10
- {codiff-0.1.2 → codiff-0.1.3}/codiff/diff/engine.py +1 -1
- {codiff-0.1.2 → codiff-0.1.3}/codiff.egg-info/PKG-INFO +40 -11
- {codiff-0.1.2 → codiff-0.1.3}/pyproject.toml +1 -1
- {codiff-0.1.2 → codiff-0.1.3}/tests/test_cli.py +2 -2
- {codiff-0.1.2 → codiff-0.1.3}/LICENSE +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/__init__.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/__main__.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/cli.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/db/__init__.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/db/engine.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/db/models.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/db/operations.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/diff/__init__.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/diff/analysis.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/diff/differ.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/diff/indexer.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/diff/snapshot.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/export/__init__.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/export/json.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/export/mermaid.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/export/terminal.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/languages/__init__.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/languages/parser.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/languages/python/__init__.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/languages/python/parser.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/languages/python/resolver.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/languages/repository.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/languages/resolver.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/languages/typescript/__init__.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/languages/typescript/parser.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/languages/typescript/resolver.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/mcp_server.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/schema/__init__.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/schema/diff.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/schema/parsing.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/setup.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/utils/__init__.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/utils/args.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/utils/files.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/utils/git.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/utils/instructions.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/utils/instructions.yaml +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff/utils/terminal.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff.egg-info/SOURCES.txt +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff.egg-info/dependency_links.txt +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff.egg-info/entry_points.txt +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff.egg-info/requires.txt +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/codiff.egg-info/top_level.txt +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/setup.cfg +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/tests/test_call_patterns.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/tests/test_call_resolver.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/tests/test_code_parser.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/tests/test_db.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/tests/test_diff.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/tests/test_export_json.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/tests/test_export_mermaid.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/tests/test_export_terminal.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/tests/test_indexer.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/tests/test_setup.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/tests/test_snapshot.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/tests/test_ts_integration.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/tests/test_ts_parser.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/tests/test_ts_resolver.py +0 -0
- {codiff-0.1.2 → codiff-0.1.3}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codiff
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Structural call-graph diff for codebases, built for coding agents
|
|
5
5
|
Author-email: Issa Hammoud <issa.hammoud@outlook.com>
|
|
6
6
|
License: Apache License
|
|
@@ -238,6 +238,9 @@ Dynamic: license-file
|
|
|
238
238
|
|
|
239
239
|
# codiff
|
|
240
240
|
|
|
241
|
+
[](https://pypi.org/project/codiff/)
|
|
242
|
+
[](https://github.com/marketplace/actions/codiff-action)
|
|
243
|
+
|
|
241
244
|
A structural call-graph diff tool for multi-language codebases, built to work with coding agents.
|
|
242
245
|
|
|
243
246
|
Instead of a line diff, codiff shows what changed **at the function level**: which functions were added and where they hook into existing code, which were modified, which were removed — with call relationships mapped across files.
|
|
@@ -291,31 +294,57 @@ codiff diff --base main --format mermaid > mermaid.md
|
|
|
291
294
|
|
|
292
295
|
Open `mermaid.md` in any Markdown previewer (VS Code, GitHub, etc.) to visualise the diagram.
|
|
293
296
|
|
|
297
|
+
## GitHub Action
|
|
298
|
+
|
|
299
|
+
codiff is available as a GitHub Action that posts a structural diff comment on every pull request — no AI coding agent required. The comment is created when the PR opens and updated on every subsequent push.
|
|
300
|
+
|
|
301
|
+
Run once in your repository to set it up:
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
codiff init --agent github-actions
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
This creates `.github/workflows/codiff.yml`:
|
|
308
|
+
|
|
309
|
+
```yaml
|
|
310
|
+
name: codiff
|
|
311
|
+
|
|
312
|
+
on:
|
|
313
|
+
pull_request:
|
|
314
|
+
types: [opened, synchronize, reopened]
|
|
315
|
+
|
|
316
|
+
jobs:
|
|
317
|
+
codiff:
|
|
318
|
+
runs-on: ubuntu-latest
|
|
319
|
+
permissions:
|
|
320
|
+
pull-requests: write
|
|
321
|
+
steps:
|
|
322
|
+
- uses: issahammoud/codiff-action@v1
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Commit and push the file to activate the action.
|
|
326
|
+
|
|
327
|
+
> **Note:** Use either the GitHub Action or an AI coding agent integration, not both. If both are active, codiff detects the redundancy automatically and the action stays silent when the agent has already embedded a diagram in the PR description.
|
|
328
|
+
|
|
294
329
|
## Agent integration (MCP)
|
|
295
330
|
|
|
296
331
|
Run once per project to wire codiff into your coding agent:
|
|
297
332
|
|
|
298
333
|
```bash
|
|
299
|
-
codiff init --agent claude
|
|
300
|
-
codiff init --agent codex
|
|
301
|
-
codiff init --agent gemini
|
|
302
|
-
codiff init --agent vibe
|
|
303
|
-
codiff init --agent github-actions # GitHub Actions
|
|
334
|
+
codiff init --agent claude # Claude Code
|
|
335
|
+
codiff init --agent codex # OpenAI Codex CLI
|
|
336
|
+
codiff init --agent gemini # Gemini CLI
|
|
337
|
+
codiff init --agent vibe # Mistral Vibe
|
|
304
338
|
```
|
|
305
339
|
|
|
306
340
|
This writes the MCP server config and a project instructions file that tells the agent to call `codiff_diff` when creating pull requests. The agent then automatically embeds a structural diagram in every PR description.
|
|
307
341
|
|
|
308
|
-
The `github-actions` option creates `.github/workflows/codiff.yml`, which posts the diagram as a PR comment on every pull request — no AI coding agent required.
|
|
309
|
-
|
|
310
|
-
> **Note:** Use either an agent integration or the GitHub Action, not both. If both are active, codiff detects the redundancy automatically and the action stays silent when the agent has already embedded a diagram in the PR description.
|
|
311
|
-
|
|
312
342
|
| Agent | MCP config | Instructions file |
|
|
313
343
|
|---|---|---|
|
|
314
344
|
| `claude` | `.mcp.json` | `CLAUDE.md` |
|
|
315
345
|
| `codex` | `.codex/config.toml` | `AGENTS.md` |
|
|
316
346
|
| `gemini` | `~/.gemini/settings.json` | `GEMINI.md` |
|
|
317
347
|
| `vibe` | `~/.vibe/config.toml` | — |
|
|
318
|
-
| `github-actions` | — | `.github/workflows/codiff.yml` |
|
|
319
348
|
|
|
320
349
|
|
|
321
350
|
Here's the output of `codiff diff --base b8dde67 --head d25c385 --format mermaid` run on codiff's own codebase:
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# codiff
|
|
2
2
|
|
|
3
|
+
[](https://pypi.org/project/codiff/)
|
|
4
|
+
[](https://github.com/marketplace/actions/codiff-action)
|
|
5
|
+
|
|
3
6
|
A structural call-graph diff tool for multi-language codebases, built to work with coding agents.
|
|
4
7
|
|
|
5
8
|
Instead of a line diff, codiff shows what changed **at the function level**: which functions were added and where they hook into existing code, which were modified, which were removed — with call relationships mapped across files.
|
|
@@ -53,31 +56,57 @@ codiff diff --base main --format mermaid > mermaid.md
|
|
|
53
56
|
|
|
54
57
|
Open `mermaid.md` in any Markdown previewer (VS Code, GitHub, etc.) to visualise the diagram.
|
|
55
58
|
|
|
59
|
+
## GitHub Action
|
|
60
|
+
|
|
61
|
+
codiff is available as a GitHub Action that posts a structural diff comment on every pull request — no AI coding agent required. The comment is created when the PR opens and updated on every subsequent push.
|
|
62
|
+
|
|
63
|
+
Run once in your repository to set it up:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
codiff init --agent github-actions
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
This creates `.github/workflows/codiff.yml`:
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
name: codiff
|
|
73
|
+
|
|
74
|
+
on:
|
|
75
|
+
pull_request:
|
|
76
|
+
types: [opened, synchronize, reopened]
|
|
77
|
+
|
|
78
|
+
jobs:
|
|
79
|
+
codiff:
|
|
80
|
+
runs-on: ubuntu-latest
|
|
81
|
+
permissions:
|
|
82
|
+
pull-requests: write
|
|
83
|
+
steps:
|
|
84
|
+
- uses: issahammoud/codiff-action@v1
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Commit and push the file to activate the action.
|
|
88
|
+
|
|
89
|
+
> **Note:** Use either the GitHub Action or an AI coding agent integration, not both. If both are active, codiff detects the redundancy automatically and the action stays silent when the agent has already embedded a diagram in the PR description.
|
|
90
|
+
|
|
56
91
|
## Agent integration (MCP)
|
|
57
92
|
|
|
58
93
|
Run once per project to wire codiff into your coding agent:
|
|
59
94
|
|
|
60
95
|
```bash
|
|
61
|
-
codiff init --agent claude
|
|
62
|
-
codiff init --agent codex
|
|
63
|
-
codiff init --agent gemini
|
|
64
|
-
codiff init --agent vibe
|
|
65
|
-
codiff init --agent github-actions # GitHub Actions
|
|
96
|
+
codiff init --agent claude # Claude Code
|
|
97
|
+
codiff init --agent codex # OpenAI Codex CLI
|
|
98
|
+
codiff init --agent gemini # Gemini CLI
|
|
99
|
+
codiff init --agent vibe # Mistral Vibe
|
|
66
100
|
```
|
|
67
101
|
|
|
68
102
|
This writes the MCP server config and a project instructions file that tells the agent to call `codiff_diff` when creating pull requests. The agent then automatically embeds a structural diagram in every PR description.
|
|
69
103
|
|
|
70
|
-
The `github-actions` option creates `.github/workflows/codiff.yml`, which posts the diagram as a PR comment on every pull request — no AI coding agent required.
|
|
71
|
-
|
|
72
|
-
> **Note:** Use either an agent integration or the GitHub Action, not both. If both are active, codiff detects the redundancy automatically and the action stays silent when the agent has already embedded a diagram in the PR description.
|
|
73
|
-
|
|
74
104
|
| Agent | MCP config | Instructions file |
|
|
75
105
|
|---|---|---|
|
|
76
106
|
| `claude` | `.mcp.json` | `CLAUDE.md` |
|
|
77
107
|
| `codex` | `.codex/config.toml` | `AGENTS.md` |
|
|
78
108
|
| `gemini` | `~/.gemini/settings.json` | `GEMINI.md` |
|
|
79
109
|
| `vibe` | `~/.vibe/config.toml` | — |
|
|
80
|
-
| `github-actions` | — | `.github/workflows/codiff.yml` |
|
|
81
110
|
|
|
82
111
|
|
|
83
112
|
Here's the output of `codiff diff --base b8dde67 --head d25c385 --format mermaid` run on codiff's own codebase:
|
|
@@ -27,7 +27,7 @@ def compute_diff(
|
|
|
27
27
|
log.info("Diffing %s → %s", base_ref, head_ref or "working tree")
|
|
28
28
|
|
|
29
29
|
t = time.perf_counter()
|
|
30
|
-
db_sha = ensure_indexed(repo_path,
|
|
30
|
+
db_sha = ensure_indexed(repo_path, base_ref, max_workers=max_workers)
|
|
31
31
|
log.debug("[timing] ensure_indexed: %.2fs", time.perf_counter() - t)
|
|
32
32
|
|
|
33
33
|
db = get_db_path(repo_path)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codiff
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Structural call-graph diff for codebases, built for coding agents
|
|
5
5
|
Author-email: Issa Hammoud <issa.hammoud@outlook.com>
|
|
6
6
|
License: Apache License
|
|
@@ -238,6 +238,9 @@ Dynamic: license-file
|
|
|
238
238
|
|
|
239
239
|
# codiff
|
|
240
240
|
|
|
241
|
+
[](https://pypi.org/project/codiff/)
|
|
242
|
+
[](https://github.com/marketplace/actions/codiff-action)
|
|
243
|
+
|
|
241
244
|
A structural call-graph diff tool for multi-language codebases, built to work with coding agents.
|
|
242
245
|
|
|
243
246
|
Instead of a line diff, codiff shows what changed **at the function level**: which functions were added and where they hook into existing code, which were modified, which were removed — with call relationships mapped across files.
|
|
@@ -291,31 +294,57 @@ codiff diff --base main --format mermaid > mermaid.md
|
|
|
291
294
|
|
|
292
295
|
Open `mermaid.md` in any Markdown previewer (VS Code, GitHub, etc.) to visualise the diagram.
|
|
293
296
|
|
|
297
|
+
## GitHub Action
|
|
298
|
+
|
|
299
|
+
codiff is available as a GitHub Action that posts a structural diff comment on every pull request — no AI coding agent required. The comment is created when the PR opens and updated on every subsequent push.
|
|
300
|
+
|
|
301
|
+
Run once in your repository to set it up:
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
codiff init --agent github-actions
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
This creates `.github/workflows/codiff.yml`:
|
|
308
|
+
|
|
309
|
+
```yaml
|
|
310
|
+
name: codiff
|
|
311
|
+
|
|
312
|
+
on:
|
|
313
|
+
pull_request:
|
|
314
|
+
types: [opened, synchronize, reopened]
|
|
315
|
+
|
|
316
|
+
jobs:
|
|
317
|
+
codiff:
|
|
318
|
+
runs-on: ubuntu-latest
|
|
319
|
+
permissions:
|
|
320
|
+
pull-requests: write
|
|
321
|
+
steps:
|
|
322
|
+
- uses: issahammoud/codiff-action@v1
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Commit and push the file to activate the action.
|
|
326
|
+
|
|
327
|
+
> **Note:** Use either the GitHub Action or an AI coding agent integration, not both. If both are active, codiff detects the redundancy automatically and the action stays silent when the agent has already embedded a diagram in the PR description.
|
|
328
|
+
|
|
294
329
|
## Agent integration (MCP)
|
|
295
330
|
|
|
296
331
|
Run once per project to wire codiff into your coding agent:
|
|
297
332
|
|
|
298
333
|
```bash
|
|
299
|
-
codiff init --agent claude
|
|
300
|
-
codiff init --agent codex
|
|
301
|
-
codiff init --agent gemini
|
|
302
|
-
codiff init --agent vibe
|
|
303
|
-
codiff init --agent github-actions # GitHub Actions
|
|
334
|
+
codiff init --agent claude # Claude Code
|
|
335
|
+
codiff init --agent codex # OpenAI Codex CLI
|
|
336
|
+
codiff init --agent gemini # Gemini CLI
|
|
337
|
+
codiff init --agent vibe # Mistral Vibe
|
|
304
338
|
```
|
|
305
339
|
|
|
306
340
|
This writes the MCP server config and a project instructions file that tells the agent to call `codiff_diff` when creating pull requests. The agent then automatically embeds a structural diagram in every PR description.
|
|
307
341
|
|
|
308
|
-
The `github-actions` option creates `.github/workflows/codiff.yml`, which posts the diagram as a PR comment on every pull request — no AI coding agent required.
|
|
309
|
-
|
|
310
|
-
> **Note:** Use either an agent integration or the GitHub Action, not both. If both are active, codiff detects the redundancy automatically and the action stays silent when the agent has already embedded a diagram in the PR description.
|
|
311
|
-
|
|
312
342
|
| Agent | MCP config | Instructions file |
|
|
313
343
|
|---|---|---|
|
|
314
344
|
| `claude` | `.mcp.json` | `CLAUDE.md` |
|
|
315
345
|
| `codex` | `.codex/config.toml` | `AGENTS.md` |
|
|
316
346
|
| `gemini` | `~/.gemini/settings.json` | `GEMINI.md` |
|
|
317
347
|
| `vibe` | `~/.vibe/config.toml` | — |
|
|
318
|
-
| `github-actions` | — | `.github/workflows/codiff.yml` |
|
|
319
348
|
|
|
320
349
|
|
|
321
350
|
Here's the output of `codiff diff --base b8dde67 --head d25c385 --format mermaid` run on codiff's own codebase:
|
|
@@ -454,7 +454,7 @@ class TestRunDiff:
|
|
|
454
454
|
mock_ensure.assert_called_once()
|
|
455
455
|
assert mock_ensure.call_args.args[1] == "HEAD"
|
|
456
456
|
|
|
457
|
-
def
|
|
457
|
+
def test_two_ref_path_anchors_db_at_base(self, tmp_path):
|
|
458
458
|
with (
|
|
459
459
|
patch("codiff.diff.indexer.ensure_indexed", return_value="abc" * 13) as mock_ensure,
|
|
460
460
|
patch("codiff.db.get_db_path", return_value=":memory:"),
|
|
@@ -467,7 +467,7 @@ class TestRunDiff:
|
|
|
467
467
|
patch("codiff.export.render_terminal"),
|
|
468
468
|
):
|
|
469
469
|
_run_diff(str(tmp_path), "v1", head_ref="v2")
|
|
470
|
-
assert mock_ensure.call_args.args[1] == "
|
|
470
|
+
assert mock_ensure.call_args.args[1] == "v1"
|
|
471
471
|
assert mock_build.call_count == 2 # once for base, once for head
|
|
472
472
|
|
|
473
473
|
def test_fmt_json_prints_output(self, tmp_path, capsys):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|