# A single-pass reviewer with a stated worst case.

> Abstract: Post `/review` on a GitHub pull request, a GitLab merge request or a local branch. The reviewer prepares the change, runs its scanners, and makes at most one model call inside a token budget you set. Then it posts one comment that lists what it found and what it could not check.

- [Install](install.md)
- [Request a review](request.md)

**A real review, [quoted whole](https://github.com/medici-finance/assay-pr-agent/pull/15#issuecomment-7180838060).**

- Manuscript: `medici-finance/assay-pr-agent#15`, revision `6c0e36c`; posted by `assay-pr-agent[bot]` on 26 November 2026
- Recommendation: Not reviewed: over budget
- Length: 7,284 estimated tokens against a limit of 6,000
- Findings: 7, all from Hadolint and none from a model
- Coverage: The model review was skipped. Hadolint ran with nothing left incomplete. History was unavailable.

```text
Codex review of 6c0e36cd4ea1484cce3b67cca249481983545e30
over-budget
Skipped Codex. Estimated prompt 7284 tokens exceeds the limit of 6000.

Static checks
- hadolint: 0 CI, 1 local, 7 findings, 0 incomplete.
- `` hadolint (local) Dockerfile:11 — DL3008 Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>` ``
- ` hadolint (local) Dockerfile:12 — DL4006 Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check `
- ` hadolint (local) Dockerfile:16 — DL4006 Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check `
- ` hadolint (local) Dockerfile:36 — DL3066 Non-numeric user-id may not be resolvable by host system `
- ` hadolint (local) Dockerfile:40 — DL4006 Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check `
- ` hadolint (local) Dockerfile:50 — DL3066 Non-numeric user-id may not be resolvable by host system `
- ` hadolint (local) Dockerfile:58 — DL3066 Non-numeric user-id may not be resolvable by host system `


Qualgen history unavailable for this review.


Review tooling built on [PR-Agent](https://github.com/the-pr-agent/pr-agent).

On-behalf-of: human:review-operator mode:unattended
```

Quoted verbatim. SHA-256 of the text above: `052f581691766ce57ed1e60f64165c64c085ad817c94b07ae98dc28f3854d7d2`

Comments:
- Comment 1 (line 2): The state is the second line of every comment. `over-budget` is exit status 2.
- Comment 2 (line 3): The model was never called. This review spent no model tokens.
- Comment 3 (line 5): Hadolint read the Dockerfile at the reviewed head. Its findings cost no model tokens and never enter the prompt.
- Comment 4 (line 16): Mined history was not available for this project. A source that cannot be read is reported, never skipped.
- Comment 5 (line 19): Credit for the review prompt, the line-numbered diff formatter and the token estimator, which come from PR-Agent.
- Comment 6 (line 21): The account the comment acts for, added by the forge tool that posts it.


## One request, one call, one comment

A review has five stages. Only the fourth can spend model tokens.

| Stage | What happens | Model calls, at most |
|---|---|---|
| Request | Someone posts `/review` on an open pull request or merge request. The poller reads the conversation on its next cycle and checks who asked. | 0 |
| Scan | ShellCheck, actionlint and the scanners the changed files call for read the Git blobs at the reviewed head. A trusted CI report stands in where one matches the source commit. | 0 |
| Budget | The change becomes line-numbered hunks and the complete prompt is estimated. Over the limit, the review stops here and is reported as `over-budget`. | 0 |
| Review | One call to your provider, with a 120-second timeout and at most three accepted findings. | 1 |
| Report | One comment on the reviewed head lists the findings, what could not be checked, and any path outside the review's coverage. | 0 |

> The quoted review stopped at the third stage. Everything from "Static checks" onward in it was produced without a model.

[Cost and coverage](cost.md) explains what the estimate counts, what happens to a file the model never sees, and why a repeated request does not pay again.

## What it will not do

The limits are the product. Each one is enforced in code, not left to a prompt.

- **It will not retry.** A failed or invalid model answer ends the review as `model-unavailable`. There is no fallback model, repair prompt or second call.
- **It will not run over budget.** The default limit is 6,000 estimated input tokens for the complete prompt. A larger change is refused before the model is invoked.
- **It will not use tools.** The provider CLI runs with tools, shell and web search disabled, and the prompt tells the model not to use them. It sees the patch and the scanner evidence, and nothing else.
- **It will not cite outside the change.** A finding whose line numbers fall outside the shown hunks rejects the whole answer.
- **It will not write by default.** The CLI writes a JSON report to stdout. Posting a comment takes `--post` with `--change`, and the poller posts only for an authorized `/review`.
- **It will not report a gap as clean.** A scanner that could not run, a file with no usable patch, or a commit missing from the checkout is written into the report, and the exit status becomes 2.

## Where it runs

It ships as one amd64 Linux image with three services. `setup` holds the installer and its browser wizard, `sync` keeps managed checkouts current, and `reviewer` polls for requests and reviews them. Run them with Docker Compose, plain Docker or the included Kubernetes manifests.

Authenticated forge access comes from Assay's released tools, bundled in the image, so nothing else needs installing on the host. Choose Cursor Agent, Claude Code or Codex CLI for the model and sign in with your own subscription, or supply an API key.

## What it checks without a model

- ShellCheck and actionlint run on the reviewed head's shell scripts and workflow files.
- Hadolint, zizmor and OSV-Scanner check Dockerfiles, Actions workflows and dependency manifests. They reuse a trusted CI report when one matches the source commit, and run locally otherwise.
- Assay's Go analysis report can be imported for Go projects.
- Qualgen reads the project's history and names the files that usually change together with the changed ones.

None of these costs model tokens, and all of them are reported when the model review is skipped or fails. [Static checks](checks.md), [CI reports](ci-reports.md) and [History advisories](history.md) have the details.

## Built on PR-Agent

Assay PR Agent builds on [PR-Agent](https://github.com/the-pr-agent/pr-agent). The PR-Agent contributors provide the review prompt, the line-numbered diff formatter and the token estimator used here. Their MIT-licensed Python package ships in the container with its original license notice. The upstream comment server is a separate entry point: this reviewer answers `/review` alone.

## Where to go next

- [Install](install.md): three containers with Docker Compose, plain Docker, or Kubernetes.
- [Request a review](request.md): who may post `/review`, what the poller skips, and what reaches the pull request.
- [Cost and coverage](cost.md): the estimate, the budget, the cache and the exit statuses.
- [Setup](setup.md) and [Review providers](providers.md): connect a forge and choose a model.
- [Output and exit codes](output.md): every field of the JSON report and the shape of the posted comment.

---

Source of this page: https://pr-agent.assay.guide/
