An AI-powered code review tool that finds real bugs by analyzing the boundaries between changed code and its callers/callees. Instead of just looking at the diff, this tool performs Outside-Diff Impact Slicing to catch contract mismatches, logic errors, and integration bugs that traditional diff-based reviews miss.
The tool analyzes git diffs and builds context by:
- Identifying changed functions/classes in your commits
- Finding callees (definitions your changed code calls)
- Finding callers (code that calls your changed functions)
- Sending structured context to GPT-5-mini to detect bugs at these boundaries
This catches bugs like:
- Functions called with wrong parameter counts after signature changes
- Callers not updated when function signatures change
- Contract violations between changed code and its dependencies
review_demo.py
- Main script implementing the Outside-Diff Impact Slicing techniquerequirements.txt
- Python dependencies
- Python 3.10+
- Git repository with at least one commit to diff against
- OpenAI API key (for GPT-5-mini access)
# Clone the repository
git clone https://github.com/coderabbitai/odsc-west-2025.git
cd odsc-west-2025
# Install dependencies
pip install -r requirements.txt
Note: This tool currently analyzes Python codebases only.
Run the script from any Python git repository with uncommitted changes or recent commits:
python review_demo.py
When prompted, enter your OpenAI API key. The script will:
- Extract changed lines from
git diff HEAD~1
- Build a call graph of your Python codebase
- Identify impact files (callers and callees)
- Generate structured context with the diff, changed code, and impact code
- Send the context to GPT-5-mini for bug analysis
- Output JSON findings with bug categories, summaries, and suggested fixes
The tool outputs JSON with structured bug reports:
{
"bugs": [
{
"changed_file": "path/to/file.py",
"changed_lines": "73",
"bug_category": "contract-mismatch",
"summary": "Function called with wrong parameter types",
"comment": "Detailed explanation with evidence...",
"diff_fix_suggestion": "--- a/file.py\n+++ b/file.py\n..."
}
]
}
- Currently supports Python codebases only
- Works best on focused PRs (10-50 changed lines)
- Large PRs may exceed context window limits
For a detailed explanation of the technique, see the accompanying article on context engineering for AI code reviews.
This demo accompanies the talk "Context Engineering for AI Code Reviews with MCP, LLMs, and Open-Source DevOps Tooling" at ODSC AI West.