Project Info
AI-Powered Code Change Intelligence & Breaking Change Detection Turning code deployment from Russian roulette into predictable science
Inspiration
Every developer has that one commit that haunts their dreams. A "simple" function rename that crashes the mobile app. A "harmless" API update that locks out millions of users. A database schema change that wipes data forever. The inspiration for DiffSense came from watching brilliant engineering teams repeatedly fall into the same trap: invisible breaking changes. We realized that these disasters aren't randomโthey're predictable. The connections between code changes and their cascading effects follow patterns that human eyes miss but AI can see.
What it does
DiffSense is like having a crystal ball for your code changes. It's an AI-powered platform that: Predictive Breaking Change Detection Analyzes every code change using advanced ML models Predicts ripple effects across your entire codebase Provides impact severity scoring and affected user estimates Intelligent Context Analysis Uses RAG (Retrieval-Augmented Generation) to understand your codebase Leverages Claude AI for natural language explanations Performs deep AST analysis and pattern detection Maintains historical context of previous breaking changes Smart Recommendations Generates actionable suggestions to prevent disasters Provides migration strategies for necessary breaking changes Prioritizes fixes by business impact and technical risk Real-time Integration GitHub OAuth integration for seamless repository access WebSocket support for real-time change monitoring RESTful API for integration with existing CI/CD pipelines Vector embeddings for semantic code similarity analysis
How we built it
Architecture We built DiffSense using a modern, AI-first architecture: Frontend: React with Vite, TailwindCSS for beautiful, responsive UI Backend: FastAPI with Python for high-performance API endpoints AI/ML Stack: Claude AI for natural language understanding CodeBERT for code semantic analysis SentenceTransformers for vector embeddings Custom ML models for breaking change prediction Data Layer: SQLite for development with vector caching for embeddings Infrastructure: Layered architecture supporting future microservices migration Key Technical Innovations Semantic Code Analysis: Combined AST parsing with ML embeddings Intelligent RAG System: Context-aware retrieval for better AI responses Predictive Breaking Change Models: Custom ML pipeline trained on git history patterns Real-time Change Tracking: WebSocket-based live monitoring system Development Process AI-first design philosophy from day one Extensive testing with real-world repositories User-centered design for developer experience
Challenges we ran into
Technical Challenges Scale of Code Analysis: Analyzing entire repositories efficiently without overwhelming resources Context Window Limitations: Working within AI model token limits while maintaining comprehensive analysis False Positive Management: Balancing sensitivity with practical usability Real-time Performance: Delivering instant feedback without sacrificing accuracy Integration Challenges GitHub API Rate Limits: Efficiently managing API calls for large repositories Cross-platform Compatibility: Supporting diverse development environments Security & Privacy: Handling sensitive code data with enterprise-grade security Performance Optimization: Maintaining speed while processing complex codebases
Accomplishments we're proud of
Technical Achievements Built a working AI system that can actually predict breaking changes Utilized a breaking change detector to power our web app Fine tuned a RAG model to smart prompt a Claude API Innovation First-of-its-kind predictive breaking change detection Novel combination of static analysis, ML, and AI reasoning Beautiful, intuitive UX that makes complex AI accessible
What we learned
Technical Insights AI works best with structure: Combining traditional static analysis with AI gives better results than pure AI Context is everything: The quality of our RAG system directly impacts AI accuracy User feedback is gold: Real developer usage patterns taught us what actually matters
What's next
VS Code Extension with inline risk alerts and code search Fine-tune models on commit-level breaking changes Improve code embeddings & retrieval quality (RAG) Add context retention for multi-turn queries Scale backend infrastructure for faster, larger repo support The Future is Predictable DiffSense represents a fundamental shift in how we think about code changes. Instead of crossing our fingers and hoping for the best, we're moving toward a world where every change is analyzed, understood, and deployed with confidence. We're not just preventing bugs. We're preventing disasters. The future of software isn't about writing perfect codeโit's about knowing exactly what your imperfect code will do before it's too late. Welcome to the future of predictable code deployment. Welcome to DiffSense.
DiffSense: Feature Drift Detector
๐ AI Berkeley Hackathon Project - Semantic drift detection using embedding-powered analysis of git history
๐ Quick Start for Judges
Instant Demo (2 minutes)
./setup.sh demo
Shows semantic drift analysis on a generated repository
Full Web Application (5 minutes)
./setup.sh full
# Open http://localhost:3000
Complete interface for analyzing any GitHub repository
Help & Options
./setup.sh help
๐ฏ The Problem
Modern software development moves fast. Features change, APIs evolve, and sometimes small commits create huge unexpected impactsโwhether breaking downstream functionality, causing subtle bugs, or violating intended product behavior. Teams lose track of why things were changed or when something started behaving differently.
๐ก Solution: DiffSense
DiffSense solves this by using embedding-powered semantic drift detection over git diffs, commit messages, issue tickets, and changelogs.
โ You input a function, file, or API you want to audit
โ The system retrieves its historical versions, compares the semantic meaning of changes over time via embeddings
โ Generates clear, human-readable explanations of how and why that feature changed
๐ Quick Start
Option 1: One-Command Start (Recommended)
./start.sh
Option 2: Manual Setup
Backend Setup:
cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python main.py
Frontend Setup:
cd frontend
npm install
npm run dev
Demo Script:
cd backend
python demo.py
๐๏ธ Architecture
Technology Stack
- Backend: Python FastAPI with ML pipeline
- Frontend: React with Recharts visualization
- ML Models:
- CodeBERT for code embeddings
- sentence-transformers for text embeddings
- Hybrid embedding approach
- Git Analysis: GitPython for repository parsing
- API: RESTful endpoints with real-time analysis
Core Components
- Git Analyzer (
git_analyzer.py) - Extract and parse git history - Embedding Engine (
embedding_engine.py) - Generate semantic embeddings - Drift Detector (
drift_detector.py) - Analyze semantic changes over time - FastAPI Backend (
main.py) - REST API for frontend integration - React Frontend - Interactive visualization and analysis interface
โจ Core Features
1. Semantic Drift Detection
- Track how code meaning changes over time using AI embeddings
- Identify gradual vs sudden semantic shifts
- Measure cumulative drift from original implementation
2. Breaking Change Prediction
- ML-powered risk scoring for commits
- Predict potentially risky changes before they impact users
- Historical pattern analysis for risk assessment
3. Interactive Timeline Visualization
- Visual drift timeline with commit details
- Identify significant change events
- Hover details with commit messages and metrics
4. Multi-Level Analysis
- File-level: Analyze entire file evolution
- Function-level: Track specific function changes
- Repository-level: Overall project health metrics
๐ฎ Demo Flow
- Repository Input: Enter GitHub repository URL
- File Selection: Choose file or function to analyze
- Semantic Analysis: AI processes git history and generates embeddings
- Drift Visualization: Interactive timeline showing semantic changes
- Risk Assessment: Breaking change prediction with explanations
- Export Results: Summary reports and recommendations
๐ Use Cases
For Development Teams
- Detect undocumented breaking changes before a release
- Help new developers quickly catch up on why parts of the codebase evolved
- Trace regressions back to their origins, even in noisy or badly documented projects
For Project Managers
- Risk assessment for releases
- Technical debt tracking over time
- API stability monitoring
For Open Source Maintainers
- Contributor onboarding with feature evolution stories
- Impact analysis for proposed changes
- Documentation gap identification
๐ ๏ธ Technical Implementation
Embedding Strategy
# Hybrid approach combining code and text semantics
code_embedding = CodeBERT.encode(code_diff)
text_embedding = SentenceTransformer.encode(commit_message)
hybrid_embedding = 0.7 * code_embedding + 0.3 * text_embedding
Drift Calculation
# Semantic similarity tracking over time
def calculate_drift(embeddings_timeline):
drift_scores = []
for i in range(1, len(embeddings_timeline)):
similarity = cosine_similarity(embeddings_timeline[0], embeddings_timeline[i])
drift_scores.append(1 - similarity) # Higher = more drift
return drift_scores
Breaking Change Prediction
- Feature Engineering: Code metrics + semantic embeddings + commit metadata
- Heuristic Model: Risk scoring based on drift patterns and change magnitude
- Contextual Analysis: Related issues, commit message sentiment, file importance
๐ Project Structure
DiffSense/
โโโ README.md # This file
โโโ TECHNICAL_ROADMAP.md # Detailed implementation guide
โโโ start.sh # One-command startup script
โโโ backend/
โ โโโ main.py # FastAPI server
โ โโโ demo.py # Standalone demo script
โ โโโ requirements.txt # Python dependencies
โ โโโ src/
โ โโโ git_analyzer.py # Git repository analysis
โ โโโ embedding_engine.py # AI embedding generation
โ โโโ drift_detector.py # Semantic drift detection
โโโ frontend/
โโโ package.json # Node.js dependencies
โโโ vite.config.js # Vite configuration
โโโ tailwind.config.js # Tailwind CSS config
โโโ src/
โโโ App.jsx # Main React application
โโโ components/
โโโ RepositoryCloner.jsx # Repository input interface
โโโ DriftAnalyzer.jsx # Main analysis interface
โโโ FileSelector.jsx # File selection component
โโโ DriftSummary.jsx # Analysis results summary
โโโ DriftTimeline.jsx # Interactive timeline chart
๐ฏ Hackathon Demo Points
Technical Innovation
- Novel application of code embeddings for semantic drift detection
- Hybrid embedding approach combining code and natural language understanding
- Real-time git history analysis with visual feedback
Practical Value
- Addresses real pain points in software development
- Scalable to any git repository
- Immediate actionable insights for development teams
User Experience
- Intuitive web interface with beautiful visualizations
- One-click repository analysis
- Interactive timeline exploration
- Clear risk assessments and explanations
๐ Future Enhancements
- LLM Integration: Use Claude/GPT for natural language explanations
- Advanced ML: Train custom models for breaking change prediction
- Integration: GitHub Apps, VS Code extensions, CI/CD webhooks
- Collaboration: Team insights, change approval workflows
- Scale: Enterprise deployment, multi-repository analysis
๐โโ๏ธ Getting Started for Judges
- Quick Demo:
./start.shโ Open http://localhost:3000 - Standalone Demo:
cd backend && python demo.py - Example Repository: Try with
https://github.com/microsoft/vscode - Explore: Select a file like
src/vs/editor/editor.api.ts
๐ค Team & Acknowledgments
Built for the AI Berkeley Hackathon. Special thanks to the open-source community for the foundational tools that make this possible.
Ready to detect feature drift in your codebase? Let's get started! ๐
Analysis
View
Metric
- 11
- 11
- 2
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- AnthropicIn code
- CSSIn code
- FastAPIIn code
- HTMLIn code
- Hugging FaceIn code
- JavaScriptIn code
- OpenAIIn code
- PythonIn code
- PyTorchIn code
- ReactIn code
- RedisIn code
- Tailwind CSSIn code
- TypeScriptIn code
13 of 13 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
2.0 MB
Source files
60
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
jalenfran/DiffSense
79 files ยท 2.8 MB ยท @ f2be630
Structure
Interface
21 files ยท 27%Screens, components and styles rendered to the user.
Application logic
23 files ยท 29%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here โ open the file browser to check anything the diagram implies.
Languages
- JavaScript67%
- Python30%
- Markdown2%
- TypeScript1%
- CSS1%
- HTML0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
backend/requirements.txt
pypi ยท 21- alembic
- anthropic
- black
- chromadb
- fastapi
- flake8
- gitpython
- mypy
- numpy
- openai
- pydantic
- pytest
- python-dotenv
- python-multipart
- redis
- scikit-learn
- sentence-transformers
- sqlalchemy
- +3 more
frontend/package.json
npm ยท 16- axios
- highlight.js
- lucide-react
- react
- react-dom
- react-markdown
- react-syntax-highlighter
- rehype-highlight
- remark-gfm
- +7 more
code-extension/package.json
npm ยท 15- react
- react-dom
- +13 more
Declared in the repositoryโs manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This projectโs features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.