Skip to content

AI Review Gate

Pre-merge AI code review with secret detection, antipattern analysis, and a tamper-proof audit trail.

Overview

mermaid
graph TD
    PR[PR Opened/Updated] --> RG[AI Review Gate]
    RG --> CL[Claude Analysis]
    CL --> FIND[Findings]
    FIND -->|Approved| CR[Check Run: Pass]
    FIND -->|Request Changes| CR2[Check Run: Fail]
    FIND --> AT[Audit Trail Entry]
    AT --> CHAIN[SHA-256 Chain]

When a PR is opened or updated, GitWire:

  1. Fetches the diff and changed files
  2. Sends to Claude for code review
  3. Checks for: logic errors, security issues, architectural problems, cost leaks, test coverage
  4. Creates a GitHub Check Run with the verdict
  5. Optionally creates a PR Review with inline comments
  6. Records the review in an immutable audit trail

Review Categories

CategoryWhat It Checks
check_logicLogic errors, race conditions, null references
check_securityHardcoded secrets, SQL injection, XSS vectors
check_architectureLayer violations, circular dependencies, tight coupling
check_cost_leaksUnbounded queries, missing pagination, resource leaks
check_testsMissing tests for changed code, test quality
check_docsMissing documentation for public APIs

Verdicts

VerdictMeaningAction
approvedNo issues foundCheck passes ✅
request_changesIssues found that should be fixedCheck fails ❌
needs_discussionAmbiguous changes, needs human reviewCheck warns ⚠️

Check Runs

GitWire creates GitHub Check Runs visible in the PR status bar. If checks:write permission is not available, it falls back to PR Review comments only.

Per-Repo Configuration

bash
curl -X POST https://gitwire.yourdomain.com/api/review/config/owner/repo \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "check_security": true,
    "check_logic": true,
    "block_on_verdict": ["request_changes"],
    "max_files_to_review": 30,
    "ignore_patterns": ["*.lock", "package-lock.json", "dist/**"]
  }'

API Endpoints (13 total)

MethodPathDescription
GET/api/review/statsReview statistics
GET/api/review/resultsAll review results
GET/api/review/results/:owner/:repoReviews for a repo
GET/api/review/config/:owner/:repoGet review config
POST/api/review/config/:owner/:repoUpdate review config
POST/api/review/trigger/:owner/:repo/:prManually trigger review
GET/api/audit/statsAudit trail statistics
GET/api/audit/entriesAudit trail entries
GET/api/audit/verifyVerify chain integrity
POST/api/audit/exportExport audit data
GET/api/audit/reportsList compliance reports
POST/api/audit/reportsGenerate compliance report
GET/api/audit/reports/:idGet specific report

In This Section

Released under the MIT License.