# The merge gate

# The merge gate

inline can turn its review into a required status check, so a PR can't merge while unresolved findings remain. The gate is off by default, opt-in per workspace or per repo, and designed so it can never wedge a PR shut by accident.

## Modes

The gate mode comes from the repo override, falling back to the workspace default (both default **off**):

| Mode | Behavior |
| --- | --- |
| `off` | No check is posted. |
| `report` | An always-passing check that carries the findings tally — informational only. |
| `block-high` | Fails while any **high**-severity finding is open. |
| `block-medium` | Fails while any **medium+** finding is open. |
| `block-low` | Fails while **any** finding is open. |

The check appears on GitHub as **`inline / review`**. Start with `report` to see what the gate *would* block before you make it required in branch protection.

## How delivery works

The gate is posted per PR head, updated in place:

- **GitHub App connections** create a real **Check Run**, one per head, updated as findings resolve.
- **OAuth connections** can't create check runs, so inline posts a **commit status** with context `inline/review` instead.

Syncing the gate is best-effort — a gate failure can never break the review pipeline itself.

## What counts as "open"

Only genuinely actionable findings hold the gate. A finding blocks when it is:

- **posted** (visible on the PR), and
- **thread-anchored** (it has a resolvable GitHub comment thread), and
- not yet **resolved**, **addressed**, or given a **feedback outcome**.

A finding with no comment thread has no resolve affordance, so it can't hold a merge hostage — it's shown in the summary but doesn't block. Bot-authored PRs and heads that were never reviewed pass with a recorded skip reason, so a required check is never permanently stuck.

## How a finding clears

There are two paths, both automatic:

1. **Resolve the thread on GitHub.** Resolving the review conversation notifies inline, which records the resolution and recomputes the gate.
2. **Change the flagged code.** A later push that touches the finding's lines marks it *addressed* — the fix is the proof — and the gate recomputes.

Either way, inline re-evaluates the open findings for the head and updates the check. When the last blocking finding clears, the check goes green.

## Configuring it

Set the gate mode in [review config](./review-config.html): a workspace default under **Review config**, and an optional per-repo override on the repository's settings. To make it enforced, add `inline / review` (or the `inline/review` status) to your branch protection rules on GitHub.
