semantic-diff 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- semantic_diff-0.1.0/PKG-INFO +131 -0
- semantic_diff-0.1.0/README.md +103 -0
- semantic_diff-0.1.0/pyproject.toml +57 -0
- semantic_diff-0.1.0/semantic_diff/__init__.py +0 -0
- semantic_diff-0.1.0/semantic_diff/analyzers/__init__.py +0 -0
- semantic_diff-0.1.0/semantic_diff/analyzers/llm_analyzer.py +413 -0
- semantic_diff-0.1.0/semantic_diff/cli.py +86 -0
- semantic_diff-0.1.0/semantic_diff/formatters/__init__.py +0 -0
- semantic_diff-0.1.0/semantic_diff/formatters/console_formatter.py +165 -0
- semantic_diff-0.1.0/semantic_diff/models.py +86 -0
- semantic_diff-0.1.0/semantic_diff/parsers/__init__.py +0 -0
- semantic_diff-0.1.0/semantic_diff/parsers/git_parser.py +208 -0
- semantic_diff-0.1.0/semantic_diff.egg-info/PKG-INFO +131 -0
- semantic_diff-0.1.0/semantic_diff.egg-info/SOURCES.txt +20 -0
- semantic_diff-0.1.0/semantic_diff.egg-info/dependency_links.txt +1 -0
- semantic_diff-0.1.0/semantic_diff.egg-info/entry_points.txt +2 -0
- semantic_diff-0.1.0/semantic_diff.egg-info/requires.txt +12 -0
- semantic_diff-0.1.0/semantic_diff.egg-info/top_level.txt +1 -0
- semantic_diff-0.1.0/setup.cfg +4 -0
- semantic_diff-0.1.0/tests/test_git_parser.py +733 -0
- semantic_diff-0.1.0/tests/test_llm_analyzer.py +584 -0
- semantic_diff-0.1.0/tests/test_models.py +149 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: semantic-diff
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: AI-powered semantic analysis of git commits
|
|
5
|
+
Author-email: Kenaz GmbH <hello@kenaz.ai>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/tkenaz/semantic_diff
|
|
8
|
+
Project-URL: Repository, https://github.com/tkenaz/semantic_diff
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
Requires-Dist: anthropic>=0.40.0
|
|
18
|
+
Requires-Dist: click>=8.1.0
|
|
19
|
+
Requires-Dist: rich>=13.0.0
|
|
20
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
21
|
+
Requires-Dist: gitpython>=3.1.0
|
|
22
|
+
Requires-Dist: pydantic>=2.0.0
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
25
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
26
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
27
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
28
|
+
|
|
29
|
+
# semantic-diff
|
|
30
|
+
|
|
31
|
+
AI-powered semantic analysis of git commits. Goes beyond `git diff` to show **intent**, **impact**, **risk**, and **review questions**.
|
|
32
|
+
|
|
33
|
+
## What it does
|
|
34
|
+
|
|
35
|
+
Regular `git diff` shows *what* changed. `semantic-diff` shows:
|
|
36
|
+
|
|
37
|
+
- **🎯 Intent** — What was the developer trying to accomplish? (not what changed, but *why*)
|
|
38
|
+
- **🗺️ Impact Map** — What parts of the system are affected directly and indirectly?
|
|
39
|
+
- **⚠️ Risk Assessment** — What could break? Edge cases? Breaking changes?
|
|
40
|
+
- **❓ Review Questions** — What should a reviewer ask the author?
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Clone the repo
|
|
46
|
+
git clone git@github.com:tkenaz/semantic_diff.git
|
|
47
|
+
cd semantic_diff
|
|
48
|
+
|
|
49
|
+
# Create virtual environment
|
|
50
|
+
python -m venv .venv
|
|
51
|
+
source .venv/bin/activate # Windows: .venv\Scripts\activate
|
|
52
|
+
|
|
53
|
+
# Install
|
|
54
|
+
pip install -e .
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Configuration
|
|
58
|
+
|
|
59
|
+
Create a `.env` file:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
63
|
+
SEMANTIC_DIFF_MODEL=claude-sonnet-4-5-20250929 # or claude-opus-4-5-20251101
|
|
64
|
+
SEMANTIC_DIFF_MAX_RETRIES=3 # optional, API retry attempts
|
|
65
|
+
SEMANTIC_DIFF_MAX_WAIT=30.0 # optional, max total retry wait time in seconds
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Usage
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Analyze HEAD commit in current repo
|
|
72
|
+
semantic-diff
|
|
73
|
+
|
|
74
|
+
# Analyze specific commit
|
|
75
|
+
semantic-diff abc123
|
|
76
|
+
|
|
77
|
+
# Analyze commit in another repo
|
|
78
|
+
semantic-diff HEAD --repo /path/to/repo
|
|
79
|
+
|
|
80
|
+
# Output as JSON (for piping to other tools)
|
|
81
|
+
semantic-diff HEAD --json
|
|
82
|
+
|
|
83
|
+
# Verbose mode
|
|
84
|
+
semantic-diff HEAD -v
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Example Output
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
╭──────────────────── 📋 Semantic Diff Analysis ────────────────────╮
|
|
91
|
+
│ Fix authentication bypass in login endpoint │
|
|
92
|
+
│ │
|
|
93
|
+
│ abc12345 by developer@example.com │
|
|
94
|
+
│ 2024-12-22T10:30:00 │
|
|
95
|
+
╰────────────────────────────────────────────────────────────────────╯
|
|
96
|
+
|
|
97
|
+
╭──────────────────────── 🎯 Intent ────────────────────────╮
|
|
98
|
+
│ Prevent unauthorized access by validating session tokens │
|
|
99
|
+
│ before processing login requests. │
|
|
100
|
+
│ │
|
|
101
|
+
│ Confidence: [████████░░] 85% │
|
|
102
|
+
╰────────────────────────────────────────────────────────────╯
|
|
103
|
+
|
|
104
|
+
╭──────────────────── ⚠️ Risk Assessment ───────────────────╮
|
|
105
|
+
│ Overall Risk: ⚡ HIGH │
|
|
106
|
+
│ │
|
|
107
|
+
│ ⚠️ BREAKING CHANGES DETECTED │
|
|
108
|
+
│ │
|
|
109
|
+
│ Identified Risks: │
|
|
110
|
+
│ ⚡ [high] Existing sessions may be invalidated │
|
|
111
|
+
│ 💡 Mitigation: Add migration for active sessions │
|
|
112
|
+
╰────────────────────────────────────────────────────────────╯
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Development
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Install dev dependencies
|
|
119
|
+
pip install -e ".[dev]"
|
|
120
|
+
|
|
121
|
+
# Run tests
|
|
122
|
+
pytest
|
|
123
|
+
|
|
124
|
+
# Format code
|
|
125
|
+
black semantic_diff
|
|
126
|
+
ruff check semantic_diff
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## License
|
|
130
|
+
|
|
131
|
+
MIT — Kenaz GmbH
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# semantic-diff
|
|
2
|
+
|
|
3
|
+
AI-powered semantic analysis of git commits. Goes beyond `git diff` to show **intent**, **impact**, **risk**, and **review questions**.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Regular `git diff` shows *what* changed. `semantic-diff` shows:
|
|
8
|
+
|
|
9
|
+
- **🎯 Intent** — What was the developer trying to accomplish? (not what changed, but *why*)
|
|
10
|
+
- **🗺️ Impact Map** — What parts of the system are affected directly and indirectly?
|
|
11
|
+
- **⚠️ Risk Assessment** — What could break? Edge cases? Breaking changes?
|
|
12
|
+
- **❓ Review Questions** — What should a reviewer ask the author?
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Clone the repo
|
|
18
|
+
git clone git@github.com:tkenaz/semantic_diff.git
|
|
19
|
+
cd semantic_diff
|
|
20
|
+
|
|
21
|
+
# Create virtual environment
|
|
22
|
+
python -m venv .venv
|
|
23
|
+
source .venv/bin/activate # Windows: .venv\Scripts\activate
|
|
24
|
+
|
|
25
|
+
# Install
|
|
26
|
+
pip install -e .
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Configuration
|
|
30
|
+
|
|
31
|
+
Create a `.env` file:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
35
|
+
SEMANTIC_DIFF_MODEL=claude-sonnet-4-5-20250929 # or claude-opus-4-5-20251101
|
|
36
|
+
SEMANTIC_DIFF_MAX_RETRIES=3 # optional, API retry attempts
|
|
37
|
+
SEMANTIC_DIFF_MAX_WAIT=30.0 # optional, max total retry wait time in seconds
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Analyze HEAD commit in current repo
|
|
44
|
+
semantic-diff
|
|
45
|
+
|
|
46
|
+
# Analyze specific commit
|
|
47
|
+
semantic-diff abc123
|
|
48
|
+
|
|
49
|
+
# Analyze commit in another repo
|
|
50
|
+
semantic-diff HEAD --repo /path/to/repo
|
|
51
|
+
|
|
52
|
+
# Output as JSON (for piping to other tools)
|
|
53
|
+
semantic-diff HEAD --json
|
|
54
|
+
|
|
55
|
+
# Verbose mode
|
|
56
|
+
semantic-diff HEAD -v
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Example Output
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
╭──────────────────── 📋 Semantic Diff Analysis ────────────────────╮
|
|
63
|
+
│ Fix authentication bypass in login endpoint │
|
|
64
|
+
│ │
|
|
65
|
+
│ abc12345 by developer@example.com │
|
|
66
|
+
│ 2024-12-22T10:30:00 │
|
|
67
|
+
╰────────────────────────────────────────────────────────────────────╯
|
|
68
|
+
|
|
69
|
+
╭──────────────────────── 🎯 Intent ────────────────────────╮
|
|
70
|
+
│ Prevent unauthorized access by validating session tokens │
|
|
71
|
+
│ before processing login requests. │
|
|
72
|
+
│ │
|
|
73
|
+
│ Confidence: [████████░░] 85% │
|
|
74
|
+
╰────────────────────────────────────────────────────────────╯
|
|
75
|
+
|
|
76
|
+
╭──────────────────── ⚠️ Risk Assessment ───────────────────╮
|
|
77
|
+
│ Overall Risk: ⚡ HIGH │
|
|
78
|
+
│ │
|
|
79
|
+
│ ⚠️ BREAKING CHANGES DETECTED │
|
|
80
|
+
│ │
|
|
81
|
+
│ Identified Risks: │
|
|
82
|
+
│ ⚡ [high] Existing sessions may be invalidated │
|
|
83
|
+
│ 💡 Mitigation: Add migration for active sessions │
|
|
84
|
+
╰────────────────────────────────────────────────────────────╯
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Development
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Install dev dependencies
|
|
91
|
+
pip install -e ".[dev]"
|
|
92
|
+
|
|
93
|
+
# Run tests
|
|
94
|
+
pytest
|
|
95
|
+
|
|
96
|
+
# Format code
|
|
97
|
+
black semantic_diff
|
|
98
|
+
ruff check semantic_diff
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
MIT — Kenaz GmbH
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "semantic-diff"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "AI-powered semantic analysis of git commits"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Kenaz GmbH", email = "hello@kenaz.ai"}
|
|
14
|
+
]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.10",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
]
|
|
23
|
+
dependencies = [
|
|
24
|
+
"anthropic>=0.40.0",
|
|
25
|
+
"click>=8.1.0",
|
|
26
|
+
"rich>=13.0.0",
|
|
27
|
+
"python-dotenv>=1.0.0",
|
|
28
|
+
"gitpython>=3.1.0",
|
|
29
|
+
"pydantic>=2.0.0",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
dev = [
|
|
34
|
+
"pytest>=7.0.0",
|
|
35
|
+
"pytest-cov>=4.0.0",
|
|
36
|
+
"black>=23.0.0",
|
|
37
|
+
"ruff>=0.1.0",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[project.scripts]
|
|
41
|
+
semantic-diff = "semantic_diff.cli:main"
|
|
42
|
+
|
|
43
|
+
[project.urls]
|
|
44
|
+
Homepage = "https://github.com/tkenaz/semantic_diff"
|
|
45
|
+
Repository = "https://github.com/tkenaz/semantic_diff"
|
|
46
|
+
|
|
47
|
+
[tool.setuptools.packages.find]
|
|
48
|
+
include = ["semantic_diff*"]
|
|
49
|
+
|
|
50
|
+
[tool.black]
|
|
51
|
+
line-length = 100
|
|
52
|
+
target-version = ["py310", "py311", "py312"]
|
|
53
|
+
|
|
54
|
+
[tool.ruff]
|
|
55
|
+
line-length = 100
|
|
56
|
+
select = ["E", "F", "I", "N", "W"]
|
|
57
|
+
ignore = ["E501"]
|
|
File without changes
|
|
File without changes
|