Summary
Add an AI-powered code review feature that analyzes PR diffs and posts inline review comments on GitHub. Each AI provider uses 3 specialized review agents (quality, guidelines, security) downloaded from myk-org/pi-config. When multiple providers are configured, they enter a peer review consensus loop.
Problem / Motivation
Currently, code reviews are entirely manual. An AI-powered review system can catch common issues (security vulnerabilities, code quality problems, guideline violations) automatically on every PR, reducing reviewer burden and improving code quality. The peer review consensus loop (when multiple AI providers are configured) reduces false positives and increases confidence in findings.
Requirements
- New
ai-review config section under existing ai-features in schema.yaml
- Config supports single provider (standard review) and multiple providers (peer review with consensus)
- Config available at global level, per-repo in
config.yaml, and per-repo in .github-webhook-server.yaml
- Trigger on PR
opened and synchronize (new commits), skip on clean rebase (existing detection)
- Download 3 review agent files from
myk-org/pi-config to all provider dirs (.claude/agents/, .gemini/agents/, .cursor/agents/) before each review
- Each AI provider runs all 3 agents (quality, guidelines, security) and consolidates findings
- Peer review loop adapted from jenkins-job-insight: anti-sycophancy prompts, cross-peer visibility, consensus checking
- Post inline review comments via GitHub Pull Request Review API (
create_review) - real code comments on diff lines
- Review summary with severity counts (CRITICAL/WARNING/SUGGESTION)
- Fire-and-forget background task (same pattern as test-oracle)
- Default timeout: 30 minutes per AI CLI call
- Never break webhook processing on failures
Deliverables
Summary
Add an AI-powered code review feature that analyzes PR diffs and posts inline review comments on GitHub. Each AI provider uses 3 specialized review agents (quality, guidelines, security) downloaded from myk-org/pi-config. When multiple providers are configured, they enter a peer review consensus loop.
Problem / Motivation
Currently, code reviews are entirely manual. An AI-powered review system can catch common issues (security vulnerabilities, code quality problems, guideline violations) automatically on every PR, reducing reviewer burden and improving code quality. The peer review consensus loop (when multiple AI providers are configured) reduces false positives and increases confidence in findings.
Requirements
ai-reviewconfig section under existingai-featuresinschema.yamlconfig.yaml, and per-repo in.github-webhook-server.yamlopenedandsynchronize(new commits), skip on clean rebase (existing detection)myk-org/pi-configto all provider dirs (.claude/agents/,.gemini/agents/,.cursor/agents/) before each reviewcreate_review) - real code comments on diff linesDeliverables
ai-reviewschema towebhook_server/config/schema.yaml(under$defs.ai-featuresand repo-level)webhook_server/libs/ai_review.py(agent setup, prompts, JSON parsing, peer review loop, posting)ai_review_configinwebhook_server/libs/github_api.pywebhook_server/libs/handlers/pull_request_handler.py(opened + synchronize non-clean)webhook_server/tests/test_ai_review.pywith comprehensive testsAGENTS.mdwith AI review documentation