Human-centered review interface for agent-generated code. Provides a programmatic API (CLI + library + web UI) that can be consumed by both humans and agents via MCP.
Part of the SIN-Code agent-engineering stack. Install all subsystems together via the SIN-Code Bundle.
- ReviewServer — create, store, and manage code reviews programmatically
- FastAPI server — REST endpoints for creating reviews, adding comments, and submitting decisions
- HTML UI — side-by-side diff view with comments and decision status
- Semantic diff — automatic file-change detection from unified diff text
- SQLite/JSON storage — choose persistence backend via file extension
- MCP server — expose review tools to AI agents via the Model Context Protocol
pip install -e .Optional MCP server support:
pip install -e ".[mcp]"See INSTALL.md for detailed setup instructions.
from sin_code_review_interface import ReviewServer, Decision
server = ReviewServer(storage_path="reviews.db")
review = server.create_review(
title="Implement auth flow",
diff="...diff content...",
author="agent-claude",
files_changed=["auth.py", "test_auth.py"]
)
server.add_comment(review.id, "Use bcrypt", "jeremy", "auth.py", 42)
server.submit_decision(review.id, "jeremy", Decision.APPROVE)
# List reviews
for r in server.list_reviews():
print(r.id, r.title, r.status)# Start the review server
sin-review serve --host 0.0.0.0 --port 8000Endpoints:
POST /reviews— create reviewGET /reviews— list reviewsGET /reviews/{id}— review details + side-by-side diffPOST /reviews/{id}/comments— add commentPOST /reviews/{id}/decisions— submit decisionGET /reviews/{id}/ui— HTML review page
# Start the review server
sin-review serve --host 0.0.0.0 --port 8000
# Generate semantic diff as HTML
sin-review diff file_a.py file_b.py --out report.htmlpytest tests/ -vRun the MCP server for agent integration:
python -m sin_code_review_interface.mcp_serverTools exposed:
create_review(title, diff, author, files_changed)— create a new reviewadd_comment(review_id, body, author, file, line)— add a comment to a reviewlist_pending_reviews()— list all reviews with status PENDINGsubmit_decision(review_id, reviewer, decision)— submit a review decision
The Review Interface is designed to work as part of the SIN-Code ecosystem:
- SIN-Code Bundle — orchestrates all subsystems from a single CLI (
sin) - Intent-Based Diffing (IBD) — enrich reviews with intent and risk scores
- Orchestration — pause agent workflows for human review
- Verification Oracle — attach verification verdicts to review comments
┌─────────────────────────────────────────┐
│ SIN-Code-Review-Interface │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Server │ │ API │ │ MCP │ │
│ │ (Fast) │ │ (REST) │ │ (Tools) │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
│ └─────────────┴─────────────┘ │
│ Storage (SQLite/JSON) │
└─────────────────────────────────────────┘
MIT — see LICENSE.