blastdiff 0.1.0__py3-none-any.whl
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.
- blastdiff/__init__.py +3 -0
- blastdiff/__main__.py +8 -0
- blastdiff/cli.py +448 -0
- blastdiff/core/__init__.py +5 -0
- blastdiff/core/blast_radius.py +456 -0
- blastdiff/core/diff_parser.py +368 -0
- blastdiff/core/languages/__init__.py +17 -0
- blastdiff/core/languages/base.py +111 -0
- blastdiff/core/languages/go_lang.py +219 -0
- blastdiff/core/languages/python_lang.py +226 -0
- blastdiff/core/languages/rust_lang.py +230 -0
- blastdiff/core/languages/ts_lang.py +406 -0
- blastdiff/core/models.py +281 -0
- blastdiff/core/proof.py +257 -0
- blastdiff/core/story.py +566 -0
- blastdiff/core/symbol_impact.py +698 -0
- blastdiff/engine.py +398 -0
- blastdiff/export.py +160 -0
- blastdiff/git_adapter.py +503 -0
- blastdiff/mcp_server.py +589 -0
- blastdiff/server.py +438 -0
- blastdiff/store.py +502 -0
- blastdiff/web/app.js +2387 -0
- blastdiff/web/index.html +272 -0
- blastdiff/web/styles.css +2092 -0
- blastdiff-0.1.0.dist-info/METADATA +186 -0
- blastdiff-0.1.0.dist-info/RECORD +31 -0
- blastdiff-0.1.0.dist-info/WHEEL +5 -0
- blastdiff-0.1.0.dist-info/entry_points.txt +2 -0
- blastdiff-0.1.0.dist-info/licenses/LICENSE +21 -0
- blastdiff-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: blastdiff
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Local-first AI diff review and blast-radius workbench with coverage proof and agent repair loops.
|
|
5
|
+
Author: KatsuragiCSL
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 BlastDiff Contributors
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/KatsuragiCSL/blastdiff
|
|
29
|
+
Project-URL: Repository, https://github.com/KatsuragiCSL/blastdiff
|
|
30
|
+
Project-URL: Issues, https://github.com/KatsuragiCSL/blastdiff/issues
|
|
31
|
+
Project-URL: Changelog, https://github.com/KatsuragiCSL/blastdiff/blob/main/CHANGELOG.md
|
|
32
|
+
Keywords: git,diff,code-review,tree-sitter,ast,blast-radius,mcp,claude-code,developer-tools
|
|
33
|
+
Classifier: Development Status :: 4 - Beta
|
|
34
|
+
Classifier: Environment :: Console
|
|
35
|
+
Classifier: Intended Audience :: Developers
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
38
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
39
|
+
Requires-Python: >=3.11
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
License-File: LICENSE
|
|
42
|
+
Requires-Dist: fastapi>=0.115.0
|
|
43
|
+
Requires-Dist: uvicorn[standard]>=0.30.0
|
|
44
|
+
Requires-Dist: pydantic>=2.7.0
|
|
45
|
+
Requires-Dist: typer>=0.12.0
|
|
46
|
+
Requires-Dist: rich>=13.7.0
|
|
47
|
+
Requires-Dist: tree-sitter>=0.23.0
|
|
48
|
+
Requires-Dist: tree-sitter-python>=0.23.0
|
|
49
|
+
Requires-Dist: tree-sitter-typescript>=0.23.0
|
|
50
|
+
Requires-Dist: tree-sitter-javascript>=0.23.0
|
|
51
|
+
Requires-Dist: tree-sitter-go>=0.23.0
|
|
52
|
+
Requires-Dist: tree-sitter-rust>=0.23.0
|
|
53
|
+
Provides-Extra: dev
|
|
54
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
55
|
+
Requires-Dist: httpx>=0.27.0; extra == "dev"
|
|
56
|
+
Dynamic: license-file
|
|
57
|
+
|
|
58
|
+
# BlastDiff
|
|
59
|
+
|
|
60
|
+
Local-first diff review and blast-radius workbench before `git push`.
|
|
61
|
+
|
|
62
|
+
AI coding agents edit twenty files in two minutes.
|
|
63
|
+
`git diff` still dumps those changes in alphabetical order with no call-graph impact, no line-level test coverage proof, and no way to review only what changed in round two.
|
|
64
|
+
|
|
65
|
+
BlastDiff runs locally, offline, with zero API keys and zero LLM guesswork. It parses your diff and repository with `tree-sitter`, traces signature breaks to untouched callers, intersects added lines with real test coverage, and closes the fix loop with Claude Code, Codex, Cursor, or Antigravity over Markdown or MCP.
|
|
66
|
+
|
|
67
|
+

|
|
68
|
+
|
|
69
|
+
## Why BlastDiff
|
|
70
|
+
|
|
71
|
+
- **Deterministic proof first.** Every finding cites a `file:line`, an AST caller edge, or a line-level coverage record. Core analysis runs offline in under one second.
|
|
72
|
+
- **Story order, not alphabetical order.** Files sort by review risk: `CONTRACT & SCHEMA` -> `CORE LOGIC` -> `TESTS` -> `CONFIG` -> `DOCS`.
|
|
73
|
+
- **AST blast radius & caller preview.** Detects changed or removed function and class signatures in Python, TypeScript, JavaScript, Go, and Rust, lists every untouched external caller in the repository, and lets you inspect surrounding code or jump to VS Code in one click.
|
|
74
|
+
- **Diff-aware bidirectional symbol impact.** Click any function, method, class, or variable inside the diff view to inspect `Called By` (`Untouched External`, `In This Diff`, `Tests`) and `Calls / Depends On` (highlighting dependencies also modified in this diff), with automatic `Diff Only` preview for changed items.
|
|
75
|
+
- **Line-level coverage proof.** Reads standard Cobertura `coverage.xml` or `lcov.info` (or runs your test command via `blastdiff verify`) and marks added lines as executed or uncovered directly in the diff gutter.
|
|
76
|
+
- **Review Rounds (delta-of-delta).** After leaving comments and asking an agent to fix them, toggle **Delta Since Round N** to inspect only the files touched since your previous review pass.
|
|
77
|
+
- **Zero repository pollution.** Sessions, comments, and round snapshots live strictly inside `.git/blastdiff/state.db`. Running `blastdiff` never modifies `git status`.
|
|
78
|
+
- **Agent-agnostic repair loop.** Export a structured Markdown repair prompt in one click, or connect any MCP-capable coding agent via `blastdiff mcp`.
|
|
79
|
+
|
|
80
|
+

|
|
81
|
+
|
|
82
|
+
## Install
|
|
83
|
+
|
|
84
|
+
Requires Python 3.11+ and Git.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Run immediately with uv
|
|
88
|
+
uvx blastdiff
|
|
89
|
+
|
|
90
|
+
# Or install globally with pipx / pip
|
|
91
|
+
pipx install blastdiff
|
|
92
|
+
# pip install blastdiff
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
To install from source:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
git clone https://github.com/KatsuragiCSL/blastdiff.git
|
|
99
|
+
cd blastdiff
|
|
100
|
+
python -m venv .venv
|
|
101
|
+
# Windows
|
|
102
|
+
.\.venv\Scripts\activate
|
|
103
|
+
# macOS / Linux
|
|
104
|
+
source .venv/bin/activate
|
|
105
|
+
|
|
106
|
+
pip install -e ".[dev]"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Quick Start
|
|
110
|
+
|
|
111
|
+
Run inside any Git repository with uncommitted changes, on a feature branch, or even on a clean working tree (use the top bar selector to switch to `HEAD~1` or any branch):
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Open the local Web Review Workbench at http://127.0.0.1:4173
|
|
115
|
+
blastdiff
|
|
116
|
+
|
|
117
|
+
# Review changes against a base branch or commit
|
|
118
|
+
blastdiff open --base main
|
|
119
|
+
|
|
120
|
+
# Fast terminal check for pre-push hooks and CI
|
|
121
|
+
blastdiff check --fail-on-hazard
|
|
122
|
+
|
|
123
|
+
# Run tests and attach proof to the active review session
|
|
124
|
+
blastdiff verify -- pytest --cov=src --cov-report=xml
|
|
125
|
+
|
|
126
|
+
# Print the Markdown repair prompt for open review threads and hazards
|
|
127
|
+
blastdiff export
|
|
128
|
+
|
|
129
|
+
# Start the stdio MCP server for Claude Code, Codex, Cursor, or Antigravity
|
|
130
|
+
blastdiff mcp
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Tier-1 Hard-Fact Hazards
|
|
134
|
+
|
|
135
|
+
BlastDiff avoids subjective style warnings. Core hazards report concrete structural defects only:
|
|
136
|
+
|
|
137
|
+
| Kind | Severity | What It Proves |
|
|
138
|
+
| :--- | :--- | :--- |
|
|
139
|
+
| `signature_break` | Critical | An exported symbol signature changed while one or more external callers remain untouched. |
|
|
140
|
+
| `removed_symbol` | Critical | An exported symbol was deleted while external callers still reference it. |
|
|
141
|
+
| `layer_violation` | High | An import violates an explicit architecture rule in `.blastdiff.toml`. |
|
|
142
|
+
| `swallowed_exception` | High | Added lines introduce an empty `except: pass` or empty `catch {}` block. |
|
|
143
|
+
| `debug_leftover` | Medium | Added lines in non-test files introduce `breakpoint()`, `pdb.set_trace()`, or `debugger;`. |
|
|
144
|
+
| `hardcoded_secret` | Critical | Added lines match high-confidence credential token patterns. |
|
|
145
|
+
|
|
146
|
+
## Optional Architecture Rules (`.blastdiff.toml`)
|
|
147
|
+
|
|
148
|
+
Add `.blastdiff.toml` at your repository root to enforce import boundaries during local review:
|
|
149
|
+
|
|
150
|
+
```toml
|
|
151
|
+
[[arch.rules]]
|
|
152
|
+
name = "no-ui-to-db"
|
|
153
|
+
source_glob = "src/ui/**"
|
|
154
|
+
forbid_import = "db/client"
|
|
155
|
+
reason = "UI modules must call API services rather than database clients."
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## MCP Integration
|
|
159
|
+
|
|
160
|
+
Connect any MCP client to `blastdiff mcp` (stdio JSON-RPC 2.0). Available tools:
|
|
161
|
+
|
|
162
|
+
- `blastdiff_analyze`
|
|
163
|
+
- `blastdiff_list_threads`
|
|
164
|
+
- `blastdiff_resolve_thread`
|
|
165
|
+
- `blastdiff_get_blast_radius`
|
|
166
|
+
- `blastdiff_get_symbol_impact`
|
|
167
|
+
- `blastdiff_export_prompt`
|
|
168
|
+
- `blastdiff_get_round_delta`
|
|
169
|
+
|
|
170
|
+
## Language Support
|
|
171
|
+
|
|
172
|
+
- **All Git languages:** Story grouping, coverage proof mapping (`coverage.xml` / `lcov.info`), content-anchored review threads, round deltas, base-ref switching, Markdown export, and MCP.
|
|
173
|
+
- **Deep AST blast radius & symbol impact (`tree-sitter`):** Python, TypeScript, JavaScript, Go, and Rust. Adding a new language requires implementing one module against the `LanguageAnalyzer` protocol. See [CONTRIBUTING.md](./CONTRIBUTING.md).
|
|
174
|
+
|
|
175
|
+
## Project Governance
|
|
176
|
+
|
|
177
|
+
BlastDiff follows [CONSTITUTION.md](./CONSTITUTION.md), enforced in CI by `scripts/check_constitution.py`:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
python scripts/check_constitution.py
|
|
181
|
+
pytest -q
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## License
|
|
185
|
+
|
|
186
|
+
MIT. See [LICENSE](./LICENSE).
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
blastdiff/__init__.py,sha256=RikZ4wREyBQkWj2mLeEYVM-xX8b9y3g3VPsmIy_sj4w,95
|
|
2
|
+
blastdiff/__main__.py,sha256=bb7IPJEJFDU-wgCp4rZwDi7cLeyHMY5haVaC8own4MQ,157
|
|
3
|
+
blastdiff/cli.py,sha256=egR2JJ22sOOf-GPyT2OnGGzTHzVKEz4-1pBfJizh75I,17350
|
|
4
|
+
blastdiff/engine.py,sha256=2dDghOIVNu8_9162hrzb9G_Y3SPtwB1t2CNeooSCNeQ,13780
|
|
5
|
+
blastdiff/export.py,sha256=pz0RINtk6htUbMu1FhscpaaGxLpeDDSFuneLMEwX6U4,5417
|
|
6
|
+
blastdiff/git_adapter.py,sha256=joAvyXD2OsrGZ3Ib8pR2LlfuraJFhC3oGtdLJLlGX2w,16560
|
|
7
|
+
blastdiff/mcp_server.py,sha256=_oHPqQknlhirqB0ludoZHwrCn1yd6jVczANPWepZASw,20665
|
|
8
|
+
blastdiff/server.py,sha256=4CyhQrYT6_JdYA9CWjpcFhRFx88jOpX5rU6HzgVcpJ0,17248
|
|
9
|
+
blastdiff/store.py,sha256=lmpSNNO5sZ_6FZi33eW4p9_bJ1Ol_fOowyjXgb4pa6w,16099
|
|
10
|
+
blastdiff/core/__init__.py,sha256=1rQ5J2Hf12bSeg_Sr01xmgTJ4uKqLOoPGFQjCjbkp0Y,171
|
|
11
|
+
blastdiff/core/blast_radius.py,sha256=qSUwMLsNcHdum6y9uB-MfKgzO9hN_Gowv2n0j66M-DA,16645
|
|
12
|
+
blastdiff/core/diff_parser.py,sha256=e4IDpLbx7kBywD9_RqPlTWS5hprAPfdrMC4ZQS2JfWo,13145
|
|
13
|
+
blastdiff/core/models.py,sha256=qhpPXiTkwxR4K5pJk6hMUBKJUvIesdTCK8oJvSUcqK0,7674
|
|
14
|
+
blastdiff/core/proof.py,sha256=o0SkJB4nJsRbCXwd8G-4GkeFG3gpcD4-r7is22hWUdc,8796
|
|
15
|
+
blastdiff/core/story.py,sha256=95bXEvnSjTcT7LN8bP2W29tcawi_hdzrIQC6s8rGtfs,22802
|
|
16
|
+
blastdiff/core/symbol_impact.py,sha256=nyONqWpCxp1CKsms_iNnlkCzyAPHl7W_j7vHHsHICIs,29765
|
|
17
|
+
blastdiff/core/languages/__init__.py,sha256=f5KVqVNkGEtuPN2rEqSqem3mnXrBvCAfwoJ1IV40Aa8,436
|
|
18
|
+
blastdiff/core/languages/base.py,sha256=b71RgQMtkAES8npXkfU4jPaLGLi9ts_gsNqfmZcwQdU,3391
|
|
19
|
+
blastdiff/core/languages/go_lang.py,sha256=GDLGVKww9B9zgYjyV-el7SyxHCnUY-SGQHFMmAVjQDI,9189
|
|
20
|
+
blastdiff/core/languages/python_lang.py,sha256=4S5oJsn73HHh2lCUlzYFiJJPTiBdx-q-y65Jf3YU7FU,9695
|
|
21
|
+
blastdiff/core/languages/rust_lang.py,sha256=vZLNroNspH7qeA4QxL15-LsnIflFPJ-C2y-9aQ4xKrs,9135
|
|
22
|
+
blastdiff/core/languages/ts_lang.py,sha256=5EHuqIM_2Su4T0XYuRvzlxfIyhgLI1y7hIfVnTuZniQ,18301
|
|
23
|
+
blastdiff/web/app.js,sha256=USZncIwjuPtUjic6AOLh0hw4hhL5MV8h_Kvbj5mZyfQ,94861
|
|
24
|
+
blastdiff/web/index.html,sha256=LHBjBRn3cFN3ELZKW_IqF0ffTs7fhSTuDYHwA3DSboI,14832
|
|
25
|
+
blastdiff/web/styles.css,sha256=ZGvZsPC0iieexgSyRjtR4biMeV0MH8IuYWuAaAH1N-o,38107
|
|
26
|
+
blastdiff-0.1.0.dist-info/licenses/LICENSE,sha256=VZf26PFYamNU4GW1TMxpfxoSf3HQ4XPnA_SK5RilL_U,1079
|
|
27
|
+
blastdiff-0.1.0.dist-info/METADATA,sha256=Nitb2SX3s0rxBzthyBG46zePa04Z12Z-zz15XWTxxL0,8468
|
|
28
|
+
blastdiff-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
29
|
+
blastdiff-0.1.0.dist-info/entry_points.txt,sha256=d3W4rQhyArAiXSYEOWKsNePDO98SPeoyjOlkp7rbHqs,48
|
|
30
|
+
blastdiff-0.1.0.dist-info/top_level.txt,sha256=xm3hAUhCNvMWb0qb_l8z0Qpbz5CptTJwmY5faw4EQGM,10
|
|
31
|
+
blastdiff-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 BlastDiff Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
blastdiff
|