AI-powered semantic analysis of git commits
Project description
semantic-diff
AI-powered semantic analysis of git commits. Goes beyond git diff to show intent, impact, risk, and review questions.
What it does
Regular git diff shows what changed. semantic-diff shows:
- ๐ฏ Intent โ What was the developer trying to accomplish? (not what changed, but why)
- ๐บ๏ธ Impact Map โ What parts of the system are affected directly and indirectly?
- โ ๏ธ Risk Assessment โ What could break? Edge cases? Breaking changes?
- โ Review Questions โ What should a reviewer ask the author?
Installation
# Clone the repo
git clone git@github.com:tkenaz/semantic_diff.git
cd semantic_diff
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install
pip install -e .
Configuration
Create a .env file:
ANTHROPIC_API_KEY=sk-ant-...
SEMANTIC_DIFF_MODEL=claude-sonnet-4-5-20250929 # or claude-opus-4-5-20251101
SEMANTIC_DIFF_MAX_RETRIES=3 # optional, API retry attempts
SEMANTIC_DIFF_MAX_WAIT=30.0 # optional, max total retry wait time in seconds
Usage
# Analyze HEAD commit in current repo
semantic-diff
# Analyze specific commit
semantic-diff abc123
# Analyze commit in another repo
semantic-diff HEAD --repo /path/to/repo
# Output as JSON (for piping to other tools)
semantic-diff HEAD --json
# Verbose mode
semantic-diff HEAD -v
Example Output
โญโโโโโโโโโโโโโโโโโโโโ ๐ Semantic Diff Analysis โโโโโโโโโโโโโโโโโโโโโฎ
โ Fix authentication bypass in login endpoint โ
โ โ
โ abc12345 by developer@example.com โ
โ 2024-12-22T10:30:00 โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโโโโโโโโโโโโโโโโโโโโโโโโ ๐ฏ Intent โโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Prevent unauthorized access by validating session tokens โ
โ before processing login requests. โ
โ โ
โ Confidence: [โโโโโโโโโโ] 85% โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโโโโโโโโโโโโโโโโโโโโ โ ๏ธ Risk Assessment โโโโโโโโโโโโโโโโโโโโฎ
โ Overall Risk: โก HIGH โ
โ โ
โ โ ๏ธ BREAKING CHANGES DETECTED โ
โ โ
โ Identified Risks: โ
โ โก [high] Existing sessions may be invalidated โ
โ ๐ก Mitigation: Add migration for active sessions โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black semantic_diff
ruff check semantic_diff
License
MIT โ Kenaz GmbH
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
semantic_diff-0.1.0.tar.gz
(22.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file semantic_diff-0.1.0.tar.gz.
File metadata
- Download URL: semantic_diff-0.1.0.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32d86d46a97f24425c2bc06dd5d9d9e67d96c3219a51f565f859cfc9c4854d11
|
|
| MD5 |
4859f6885ba029ac3c34a6ea5847ae09
|
|
| BLAKE2b-256 |
d3f42f8f495c9a0596470ab90bb905a565acb3cae92359ecac21513c3ec12c4f
|
File details
Details for the file semantic_diff-0.1.0-py3-none-any.whl.
File metadata
- Download URL: semantic_diff-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
638001d78b7df5ec5f6a8a5277fdfaf2d4f5e331a8d66819f43ad9bc3011d2c8
|
|
| MD5 |
d24b5084c4560b34d80179c0e5cac2d8
|
|
| BLAKE2b-256 |
b61423b32aba638e645cd83f16b0400ca781d8733e593ba92d795a18d3fa6513
|