Skip to main content
Source of truth: backend/src/config/prompts.ts The review agent (CODE_REVIEW_SYSTEM_PROMPT) acts as a senior-engineer code reviewer. It optimizes for high-signal findings over volume — a clean PR with zero comments is a valid, successful result.

What the Agent Generates

The agent always returns a single JSON object (no Markdown fences; any fences that a less intelligent model adds are trimmed by a static function) with this shape:

Field expectations

Quality guarantees baked into the prompt

  • No style/naming/formatting nitpicks, no speculative issues
  • Findings must be introduced or materially exposed by this PR
  • Root causes are deduplicated (one comment per underlying problem)
  • Every finding includes a realistic failure path and an actionable fix

How to Interact With This Data

  1. Persistence — the raw JSON is stored on the review record:
    • review.rawReviewJSON → full parsed JSON above
    • review.reviewSummary → text summary (rendered as markdown in the client’s AI Review tab)
    • review.status / review.completedAt / review.reviewedCommitSha → lifecycle metadata
  2. Client rendering
    • Summary tab: summary.overview via the markdown component in PullRequestReviewView
    • Findings: map each comments[] item to an AIFinding (severity badge, explanation from comment, patch from suggestedFix)
    • Score widget: use confidence.overall instead of hardcoding
  3. Consumers should:
    • Treat risk === 'high' as blocking-worthy
    • Never assume comments is non-empty
    • Use failureScenario + comment for detail views; keep list rows short via title
    • Surface agenticFixPrompt as a one-click “fix with agent” action when present
  4. Review modesREVIEW_MODES (Quick / Focused / Deep Dive) only change depth (context scope, verification passes, max findings cap 5/10/20). The JSON output contract is identical across all modes.