Skip to content

How Reviews Work#

A MergeMonkey review is the result of a deterministic pipeline that runs on every pull request. This page walks through each stage and what you'll see on a typical PR.

Triggers#

MergeMonkey runs automatically on:

  • PR / MR opened — full review on the initial diff.
  • PR / MR updated — incremental review on new commits (cached context is reused).
  • PR / MR reopened — treated as a new PR.
  • Slash commands — on-demand focused reviews, triggered from any PR comment. See Slash commands.

Draft PRs and MRs are not reviewed — including pushes made while still a draft. Marking it ready triggers the first review: on GitHub, the Ready for review button; on GitLab, removing the Draft: title prefix (the Mark as ready button or /ready).

The pipeline#

  1. Webhook received

    Your provider (GitHub or GitLab) sends a webhook to our ingress. We verify the signature, then enqueue a review job.

  2. Clone and diff

    A worker checks out a sparse, isolated copy of your repo at the PR head and computes the changed lines against the base.

  3. AST scan

    A tree-sitter parser builds an index of the changed files. Signals are emitted for risky patterns: string concatenation into SQL, untrusted input flowing into exec, unchecked null dereferences, and dozens of other categories.

  4. Context building

    Each signal is wrapped in a minimal, token-efficient context pack: the affected lines, surrounding function body, relevant imports, and type hints.

  5. AI judgement

    A large language model reviews each pack and produces a verdict. Low-confidence signals are discarded; high-confidence findings proceed.

  6. Post comments

    Findings are deduplicated against existing comments and posted inline on the exact changed line, plus a summary at the top of the PR.

A typical review completes in 30–90 seconds for a 10-file PR.

Comment types#

Summary comment#

The top-level comment on every PR summarizes:

  • Total findings by severity (Critical / High / Medium / Low)
  • Files reviewed and any files we skipped (vendored, generated, > 1 MB)
  • AGENT-VERIFIED findings count (see below)
  • A one-line TL;DR

Inline comments#

Each inline comment is attached to a specific changed line and contains:

  • A severity badge
  • A one-line headline describing the issue
  • Why it matters — the impact in one or two sentences
  • A suggested fix, as a code block where possible
  • The confidence tag, if applicable
🚨 Critical: SQL injection in query()

src/users.ts:42 interpolates `req.params.id` directly into a SQL
string. Use parameterized queries instead.

Suggestion:
  const user = await db.query(
    'SELECT * FROM users WHERE id = $1',
    [req.params.id]
  );

[AGENT-VERIFIED]

The [AGENT-VERIFIED] tag#

High-confidence findings that passed a second validation pass — where the AI re-reads the code context from scratch and confirms the issue — receive the [AGENT-VERIFIED] tag. You can trust these as "worth looking at" with very few false positives.

Findings without the tag still went through the normal confidence threshold; they just didn't pass the stricter second pass. They're worth scanning but may occasionally be noise.

Why the tag exists

Two rounds of AI validation catch cases where a pattern matched syntactically but didn't represent a real risk in context. We surface the tag so you know which findings had the extra scrutiny.

What we skip#

  • Vendored directories — node_modules/, vendor/, third_party/, dist/, build/
  • Generated files — *.pb.go, *.generated.ts, files tagged with a generated-code header
  • Binary files and lock files
  • Files larger than 1 MB (we log a skipped notice in the summary)
  • Draft PRs / MRs (and pushes to them) until marked ready

Re-running a review#

Push a new commit — we re-review automatically. Or from any PR comment:

/mergemonkey resume

See Slash commands for the full list.

Next#