Fast automated AI code review for Bitbucket, GitLab, GitHub, Gitea/Forgejo, and Azure DevOps
pip install prxref==0.27.0 Copy PIP instructions
prxref reviews pull and merge requests on Bitbucket, GitHub, GitLab, Gitea/Forgejo (including Codeberg), and Azure DevOps in sub-minute review cycles. It parses unified diffs, partitions changes into risk-ranked chunks, gives each worker the dependency pins and out-of-hunk definitions its chunk references when the forge can serve file content, fans out parallel single-shot LLM reviews across a cheap-first model fallback chain, filters findings through deterministic quality gates, and publishes inline comments alongside an executive summary. Give it the spec or ticket a change implements with --spec (a web page, a local file or directory, or a Jira ticket URL) and the review also checks the diff against that spec.
┌──────────────────────┐ │ Pull / MR URL │ └──────────┬───────────┘ │ ▼ ┌──────────────────────┐ │ detect_forge │ └──────────┬───────────┘ │ ▼ ┌──────────────────────┐ │ Forge Adapter │ │ (GitHub / GitLab / │ │ Bitbucket Cloud / │ │ BB Server / ADO) │ └──────────┬───────────┘ │ ▼ ┌──────────────────────┐ │ Unified Diff │ └──────────┬───────────┘ │ ▼ ┌──────────────────────┐ │ Risk-Ranked Chunking │ └──────────┬───────────┘ │ ▼ ┌──────────────────────┐ │ Parallel LLM Workers │ │ (Fallback Chain) │ └──────────┬───────────┘ │ ▼ ┌──────────────────────┐ │ Quality Gate │ │ Line Align / Dedup │ └──────────┬───────────┘ │ ▼ ┌──────────────────────┐ │ Post Inline Comments │ │ + Summary │ └──────────────────────┘ Deterministic Checks and Quality Passes Not every finding comes from a model, and no finding posts unfiltered. prxref computes one class of finding directly from the parsed diff — the release-shaped-PR check — and then runs every finding, model-authored or not, through the team severity map (only when the review rules declare one) and spec grounding, two passes that relabel a severity and drop nothing, and then through fourteen more deterministic passes: the example-echo check, location validation, package.json claim checks, line alignment, thread dedup, settled-thread suppression, severity consistency, the removal-claim check, the hedge gate, finding grouping (opt-in with PRXREF_GROUP_FINDINGS), the per-rule cap (on by default when review rules are loaded; PRXREF_MAX_FINDINGS_PER_RULE), the quality gate, sweep dedup, and the containment note. A filtered finding is never discarded silently — it is kept with a drop_reason for the run log, and visible in a --no-post dry run or under --format json.
The passes, the checks, every drop_reason string, and which of them have a knob: docs/quality.md.
A team that keeps PRs small can set PRXREF_SIZE_WARN_LINES (lines added plus removed) and/or PRXREF_SIZE_WARN_FILES (files changed). A PR above either threshold gets one line at the top of its summary, such as This PR changes 812 lines in 24 files, above the team guideline of 500 lines and 20 files. Consider splitting it. The line names only the limits that were exceeded. Both thresholds are unset by default, which turns the advisory off; 0 is a real threshold that flags any change at all. The counts come from the parsed diff and skip the common ecosystems' lockfiles (package-lock.json, uv.lock, Cargo.lock, go.sum, …), generated files (*.snap, __snapshots__/, *.min.js, *.map, *.generated.*, *.auto.*), and any path matching PRXREF_SIZE_IGNORE_GLOBS, which adds to those built-ins and never replaces them. A binary file counts as one file and zero lines, so the line count is a lower bound when a forge omits a file's hunks. The advisory is not a finding: it never changes the verdict or the exit code, and with --no-post or PRXREF_POST_MODE=inline it appears only in the run record, under --format json as size_advisory, and as a size advisory: line in the CLI output. See docs/env-vars.md for the glob syntax.
Run reviews instantly without local installation using uvx, or install the CLI globally:
# Run one-shot review via uvx uvx prxref review --pr-url https://github.com/org/repo/pull/123 # Or install tool globally uv tool install prxref prxref review --pr-url https://github.com/org/repo/pull/123 # Or install straight from source (works before the first PyPI release) uv tool install git+https://github.com/sblattj/prxref In CI, keep the pipeline to credentials and the endpoint, and commit a .prxref.toml at the repository root for everything else (see docs/config-file.md and the example); prxref config check validates it. On a lane that gates merges, read that file from the target branch, as its security section shows.
To work on prxref itself (development setup, tests, and lint), see CONTRIBUTING.md.
Pass any PR or MR URL directly. Forge type, repository namespace, and pull request ID are detected automatically:
# Bitbucket Cloud prxref review --pr-url https://bitbucket.org/workspace/repo/pull-requests/42 # Bitbucket Server / Data Center (self-hosted, any host, with or without a deployment context path) prxref review --pr-url https://bitbucket.corp.example/projects/PLAT/repos/api/pull-requests/42 # ...including a plain-HTTP deployment, e.g. the standalone install's default port prxref review --pr-url http://bitbucket.internal:7990/projects/PLAT/repos/api/pull-requests/42 # GitHub & GitHub Enterprise prxref review --pr-url https://github.com/owner/repository/pull/108 # GitLab & Self-Hosted GitLab (including nested subgroups) prxref review --pr-url https://gitlab.com/group/subgroup/project/-/merge_requests/15 # Gitea & Forgejo, on any host (including Codeberg) prxref review --pr-url https://codeberg.org/owner/repository/pulls/7 prxref review --pr-url https://git.example.com/owner/repository/pulls/7 # Azure DevOps Services (dev.azure.com or the legacy *.visualstudio.com host) prxref review --pr-url https://dev.azure.com/organization/project/_git/repository/pullrequest/42 prxref review --pr-url https://organization.visualstudio.com/project/_git/repository/pullrequest/42 # Azure DevOps Server (on-prem; the URL names the collection and the project) prxref review --pr-url https://ado.corp.example/tfs/DefaultCollection/project/_git/repository/pullrequest/42 Supported hosts. Every forge is supported on any host. GitHub Enterprise Server and self-hosted GitLab share one adapter each with their SaaS products, which speak the same REST API at a different base URL. Bitbucket does not: Server / Data Center speaks /rest/api/1.0 against different resource shapes, so it is a separate adapter selected automatically from the URL — PRXREF_BITBUCKET_SERVER_TOKEN for Data Center, PRXREF_BITBUCKET_TOKEN for Cloud. Gitea and Forgejo share one adapter on any host, Codeberg included, authenticated by PRXREF_GITEA_TOKEN; a public repository can be reviewed with no token. Azure DevOps Services and Server share one adapter. It has no diff endpoint to call, so it rebuilds the PR's diff from the changed files; a public project can be reviewed with no token at all. Posting to Azure DevOps is not yet verified against a live server, and Azure DevOps Server is untested. See docs/forges.md.
prxref operates without direct cloud provider SDK keys (no Anthropic API keys). It ships with no default endpoint and no default model chain: point it at any OpenAI-compatible /chat/completions server (OpenRouter, Together, Groq, vLLM, Ollama, a self-hosted gateway), install the optional litellm extra, or run the claude or kiro-cli CLI you are already logged in to. PRXREF_LLM_MODELS is required on every backend and PRXREF_LLM_BASE_URL on openai-compat; leaving a required one unset exits 2 with an error naming the variable.
# Default backend: plain HTTP to any OpenAI-compatible endpoint export PRXREF_LLM_BACKEND=openai-compat # aliases: ferry, http export PRXREF_LLM_BASE_URL="https://openrouter.ai/api/v1" export PRXREF_LLM_API_KEY="$OPENROUTER_API_KEY" export PRXREF_LLM_MODELS="z-ai/glm-5.3-flash" export PRXREF_LLM_REASONING_EFFORT=low export PRXREF_LLM_MAX_TOKENS=4096 # raise this if you raise the effort # Optional: in-process litellm extra # pip install 'prxref[litellm]' export PRXREF_LLM_BACKEND=litellm export PRXREF_LLM_MODELS="openrouter/meta-llama/llama-3.3-70b-instruct,bedrock/anthropic.claude-3-7-sonnet-20250219-v1:0" # Optional: your own logged-in Claude Code CLI, on your own machine export PRXREF_LLM_BACKEND=claude-cli export PRXREF_LLM_MODELS="sonnet" export PRXREF_LLM_TIMEOUT=120 # each call includes CLI start-up claude-cli and kiro-cli run the CLI already installed and logged in on your machine, on your subscription and for your own use only. Do not use them for a team, a shared webhook, or CI; use an API key through openai-compat or litellm there. See Subscription CLI backends.
On a reasoning model the hidden reasoning trace draws from the same completion budget as the answer, so turning PRXREF_LLM_REASONING_EFFORT up makes truncation more likely. A reply that hits the budget before it is usable is retried once at double the budget (capped at 16384), which costs one extra call and happens only in that case. If the retry is cut off too, the chunk is counted as failed and the posted summary names the reason and the variable to raise; see Reasoning models and the token budget.
On openai-compat and litellm, temperature 0.0 and a sampling seed are sent on every call — PRXREF_LLM_SEED when set, else one random seed per process shared by the whole run (issue #56), and none at all with PRXREF_LLM_SEED=off, for providers such as Bedrock that reject it — but neither makes a review bit-reproducible — provider fingerprints, load-balanced backends, and gateways that ignore seed all still vary the model's output. The CLI backends send neither, and the run record's sampling field shows both as null. Everything downstream of the model is deterministic: findings are ordered by (file, line, title) and the caps break ties by content, and the run record's sampling field reports which knobs were in force. See Determinism.
See docs/llm.md for architecture, failover behavior, and backend setup, and docs/env-vars.md for tuning the confidence floor and finding caps to your team.
The model chain, the effort, the token budget and the other non-secret settings above can also be committed in the repository's .prxref.toml (llm_models = ["z-ai/glm-5.3-flash"]); the backend, the endpoint and the key stay in the environment. See docs/config-file.md; prxref config check validates the file.
Configure the authentication token matching your forge:
See docs/env-vars.md for the full configuration reference, docs/forges.md for forge specifics, docs/quality.md for the deterministic checks and every drop reason, and docs/systemic-sweep.md for the whole-PR sweep's digest classes.
When the token can read a PR but not comment on it (a fork PR under a plain pull_request workflow, or a read-only pipeline token), prxref still delivers the review through the CI job itself — GitHub annotations and job summary, Azure Pipelines log issues, a GitLab Code Quality report, or the log — and records the failed posts in the run record; see When prxref cannot post (PRXREF_FALLBACK, on by default).
Run prxref as a persistent daemon to handle webhook events from GitHub, Bitbucket, GitLab, Gitea/Forgejo, and Azure DevOps:
prxref serve --port 8080 --host 0.0.0.0 The service exposes:
Give prxref the spec or ticket a change implements, and the review also checks the diff against it. A source is a public web page, a local file, a local directory (up to 20 .md, .markdown, .txt or .adoc files directly inside it), or a Jira ticket URL:
prxref review --pr-url https://github.com/org/repo/pull/123 \ --spec https://jira.example.com/browse/PROJ-42 \ --spec https://spec.example.com/client-guidelines.html \ --spec /etc/prxref/specs/ prxref fetches each source and keeps its RFC 2119 statements (MUST, SHOULD, MAY), version pins and naming rules; a Jira ticket's summary and description are kept line by line, up to 6,000 characters, and ranked first. It ranks the rest against the diff and adds that bounded digest (PRXREF_SPEC_DIGEST_TOKENS) to every chunk worker's prompt and to the whole-PR sweep's, with no extra model call. A finding whose only basis is one of those constraints is a 🔍 spec finding, and it quotes the constraint as Spec: "…". PRXREF_SPEC_SOURCES sets the sources for every run, the webhook daemon included; --spec replaces that list for one run.
Every setting: docs/env-vars.md. How grounding meets the quality passes: docs/quality.md. Spec sources in CI and on the daemon, fetch time bounds, and what the logs record: docs/deploy.md.
Give prxref the ticket a PR is meant to implement, and every finding is marked in, out, or unknown against that ticket's scope:
A configured ticket is in one of three states:
Acceptance criteria are recognized by any one of these: a heading or label standing alone on its line (Acceptance criteria, Acceptance test(s), or Definition of done in any case, or AC in capitals, optionally as a # heading, in bold, or with a trailing colon), a Markdown task-list item (- [ ] … or - [x] …), or a Gherkin Given line followed later by a Then line.
What each finding's scope means. in: the finding concerns what the ticket asks for, including code that visibly contradicts one of its acceptance criteria. out: it concerns a change the ticket does not ask for, such as an unrelated refactor or a drive-by edit. unknown: the ticket and the diff do not let the model tell. Without a ticket, or with an empty one, every finding is unknown, and so is any answer from the model other than exactly one of those three words. Scope is advisory only: it never changes a finding's severity or confidence, the verdict, the error cap, or PRXREF_FAIL_ON. The outofscope severity is unrelated and only means minor. How a scope shows on a posted comment is covered in Finding Markers.
How the ticket reaches the model. The ticket text goes into the user prompt of every chunk worker and of the whole-PR sweep, under a ### Ticket context heading. It sits inside a code fence it cannot close, with a line telling the model that it is data, not instructions. The request to add a scope to every finding is prxref's own policy, so it goes into the system prompt instead. While that request is in the prompt, the example finding under ## Output Format in the worker and sweep prompts also carries "scope": "in", because a model that copies the example rather than following the instruction would otherwise never label scope; without a ticket, or with an empty one, the prompts are unchanged. PRXREF_TICKET_CONTEXT_MAX_CHARS (default 6000) caps the text. A longer ticket is cut, and a line after the fence says how many of its characters are shown. Criteria past the cap are not in view, so they do not count toward the state above.
What is recorded. The ticket_context key of --format json and the run's ticket ok trace event hold the path, the SHA-256 of the file's raw bytes, its length in characters, the cap, whether it was truncated, whether it has acceptance criteria, and whether it was empty. The -v line shows the path, the start of the SHA-256, the length, and the active findings' in/out/unknown counts. None of these ever holds the ticket text. The text does appear in the prompt files that --trace-dir writes (chunk0.user.md, sweep.user.md), so treat that directory like the ticket itself.
The webhook daemon ignores the file. One file cannot describe every PR a daemon sees, so prxref serve never reads PRXREF_TICKET_CONTEXT_FILE and logs a warning once at startup when it is set.
Give prxref your team's review checklist and every chunk worker and the whole-PR sweep review against it:
Team rules add to prxref's review prompts but cannot take a line out of them. To change the prompts themselves, give prxref a directory of your own templates:
prxref prompts export ~/acme-prompts # the packaged templates, byte for byte # edit ~/acme-prompts/worker.md, and delete the templates you leave unchanged prxref review --pr-url https://github.com/acme/widget/pull/42 --prompts-dir ~/acme-prompts # or for every run, the webhook daemon included export PRXREF_PROMPTS_DIR=~/acme-prompts What can be overridden. worker.md (each chunk worker's prompt), systemic.md (the whole-PR sweep's prompt) and summary.md (the posted summary comment). A template missing from the directory keeps the packaged one. The judge prompt of prxref eval cannot be overridden, so runs with different prompts are always graded by the same judge. Checked before any network call. A directory or template that fails a check exits 2, naming --prompts-dir, PRXREF_PROMPTS_DIR or the .prxref.toml key, whichever supplied it. The checks are stated once, under PRXREF_PROMPTS_DIR in docs/env-vars.md. --prompts-dir DIR wins over the variable for one run, and --prompts-dir "" turns it off. Stamped on every run. The run record's prompt_templates holds the directory and, for each template file present in it (edited or not, so an unchanged exported copy is stamped too), its path, the SHA-256 of its raw bytes and its length in characters, never its text; a template absent from the directory has no entry. It appears in --format json (null without a prompts directory) and the JSONL trace. The -v line reads prompts: DIR summary= worker= , showing the first 12 characters of each SHA-256, so every review names the exact templates that produced it. Read the templates from a trusted checkout, never from the PR under review. Whoever controls the directory controls the whole review, so a PR that commits templates into the checkout CI reviews rewrites its own review. Copy the directory from the target branch or keep it outside the repository. See docs/prompt-templates.md for each template's placeholders, the CI recipe, the daemon, and upgrading.
A chunk worker sees its chunk's diff and the definitions it references from the same file. Repository context also shows it the code the change leans on elsewhere: definitions from other files, and the API and database contracts a change points at. It is off by default:
PRXREF_REPO_CONTEXT=repo prxref review --pr-url https://github.com/acme/widget/pull/42 --no-post # or from a local checkout of the PR head, with no forge at all PRXREF_REPO_CONTEXT=repo prxref review --diff-file pr.diff --repo-dir ./widget PRXREF_REPO_CONTEXT What each chunk worker also sees off (default) Nothing from repository context: no entry, no repository read, no repo_context trace event. The same-file definitions and dependency versions, Java and Kotlin ones included since 0.17.0, do not depend on this setting. diff Definitions from the PR's other changed files, and, for a type another chunk changes, the lines changed inside it. Java and Kotlin type declarations are found as well as JavaScript, TypeScript and Python ones. With a reader, a definition one file of the chunk references and another file of the same chunk holds outside its hunks is found too. repo Also definitions from files outside the diff, found through imports, Java's same-package file convention, and a search of file names; a ### Contract excerpts block with the OpenAPI operation or schema, JSON Schema, or earlier migration that a changed route, table or name matches; and, with a file listing, a last block, ### Code elsewhere that reads state this chunk writes: short excerpts of unchanged code in the same language that reads a map, table or other state the chunk's added lines write to (at most 6 per chunk, ranked last in the budget). Where it reads. Files are read at the PR head through the forge (every forge adapter can read and list files, see docs/forges.md), or from --repo-dir when given. With neither, diff builds its entries from the diff's hunk lines, and repo does the same with a WARNING. At repo the repository's file listing is read once per run; without one, a WARNING says the name search and the contract files outside the PR are off. What it never reads. A floor that is always on keeps **/expected.json, **/cases.json, **/case.json, **/prxref-eval/**, **/.env*, **/*.pem and **/*.key out of every listing, read and repository-context entry. PRXREF_CONTEXT_EXCLUDE_GLOBS adds globs to it, and cannot take a floor path back out. Neither hides a changed file's hunks, which reach the prompt as the diff. PRXREF_CONTEXT_CONTRACT_GLOBS replaces the built-in set of contract globs. Budget. PRXREF_REPO_CONTEXT_MAX_CHARS (default 12000) caps each chunk's entries, admitted in rank order until one does not fit, and a closing line counts the rest. Reads of files outside the PR are capped at 16 per chunk and 200 per run. The timeout retry, which follows a chunk call that outlasts PRXREF_LLM_TIMEOUT, drops all of it, the reader block included, to shrink the prompt. Workers only. The whole-PR sweep prompt is unchanged. Recorded. --format json and the run record carry repo_context: the reader, the listing size, the read counts, and each admitted entry's path, line and reason, never file text. The JSONL trace gains a chunk context event per chunk, and in text output -v prints a repo context: line. Context follow-up (opt-in, #22). A worker that cannot see a symbol's definition is told to ask about it at confidence 0.5 or below, so the default floor of 0.6 drops the question. With PRXREF_CONTEXT_FOLLOWUP=on at repo, a chunk whose first reply holds such a below-floor question is sent once more, with the whole definitions of up to 3 symbols its questions name, in backticks or as code-shaped plain text (every question gets one before any gets two), appended as a last block, ### Definitions referenced by this chunk, looked up for its open questions. The lookup is deterministic, the model calls no tools, and a chunk gets at most one follow-up, none after a timeout retry, while the sweep gets none. A question the second reply confirms is replaced by the confirming finding; one it does not is dropped as not confirmed by context follow-up; the second reply's other findings are discarded. A follow-up that fails keeps the first reply's findings. It costs up to 8 reads, 4 excerpts and 4000 characters a chunk, and at most 2 more calls. At off (the default) nothing changes; at on below repo, or with no reader, one WARNING says it is off for the run. The run record carries context_followup. See Context follow-up. To measure what it changes, run prxref eval once per level and compare the two runs. Every setting: docs/env-vars.md.
Each severity has one glyph. It is the same in the summary's counts line, the summary's findings list, and the header of every inline comment:
🟦 is not a severity. It marks a finding that the ticket context puts outside the ticket (scope is out), and it goes in front of the severity glyph, never in place of it:
Findings inside the ticket (in) and findings the reviewer could not place (unknown) carry no scope marker, so a run without a ticket context renders exactly the severity glyphs. Scope never changes a finding's severity. It is not counted separately either: the counts line counts every active finding by severity, and the verdict, the error cap, and PRXREF_FAIL_ON ignore scope.
Before 0.14.0, outofscope findings rendered 🟦. They now render ⬜ on every run, and 🟦 means only "outside the ticket".
Every glyph above is the default. PRXREF_SEVERITY_MARKERS (or severity_markers in .prxref.toml) replaces any of them with name=glyph pairs, for example error=🔴,warning=🟡,out_of_ticket=🔷; the names are error, warning, spec, outofscope and out_of_ticket, and the five glyphs must stay distinct. See docs/env-vars.md.
With PRXREF_SUGGESTIONS=on (off by default), an inline comment can carry replacement code for the lines it flags. Each forge gets the form it can apply:
An empty suggestion deletes the lines: an empty suggestion block on GitHub and GitLab, and the sentence Suggested change: delete line N elsewhere. A suggestion replaces at most 20 lines, all inside one diff hunk. A suggestion that fails a check is dropped and the finding posts as a plain comment. The summary's findings list never shows suggestions.
By default every run re-reviews the whole PR. With PRXREF_INCREMENTAL=on (off by default), a push re-reviews only the files it changed:
A run reviews every file on a first review, when the forge cannot read its summary or the read fails, when the summary has no marker, when the PR head is unknown or the forge cannot compare commits, and when the comparison fails (a force-push can make the marked head unknown). It also reviews every file with --full-review, with PRXREF_POST_MODE=inline (which never writes the marker), with PRXREF_FAIL_ON other than never (a gate's verdict must see the whole PR), and on every replay. --full-review and a PRXREF_FAIL_ON gate skip reading the previous summary, but they still record the head they reviewed, so the following push is incremental again (when a review unit of such a run fails, it records no head, and the following push reviews every file). The --format json key incremental says which scope a run took and why. Turning it on costs one extra forge read per run for the previous summary, plus a compare read when the head has moved. See docs/env-vars.md.
Replay flags, for evaluation (see Replay Mode (Evaluation)). Any of them turns posting off for the run:
--as-of, --description-file and --no-description are mutually exclusive: giving two or more exits 2 naming each one given. They are CLI-only, with no environment variable.
The other subcommands: prxref serve [--port N] [--host H] [--config PATH] runs the webhook server (default port 8080, default host 0.0.0.0); prxref trace render FILE [-o OUT] renders a JSONL run trace (PRXREF_TRACE_FILE) to a standalone HTML pipeline view, written next to the trace unless -o/--out names the output; and prxref --version prints the version.
prxref serve --config PATH names a repository config file for every webhook review. The daemon never auto-discovers .prxref.toml, because its working directory is not the repository it reviews: it reads a file only when --config or PRXREF_CONFIG_FILE names one (off reads none), checks it before listening (a missing or invalid file exits 2), and re-reads it on every webhook. serve has no --no-config; leave both unset, or give --config off.
prxref config check [--config PATH | --no-config] [--format {text,json}] checks the repository config file and the environment without reading a pull request or calling a model. It resolves the file exactly as review does, then prints config file: (or config file: none), one = ( ) line per setting, sorted, whose source is default, file or env PRXREF_ , and ok. Credentials and webhook secrets print only as or . --format json prints one object, {"config_file": , "values": {" ": {"value", "source"}}}. It exits 0 when the configuration is valid, and 2 with the configuration error: ... line a review would print when it is not; with --format json, an error leaves stdout empty. A bare prxref config prints the top-level help and exits 2.
prxref prompts export DIR [--force] writes the packaged worker.md, systemic.md and summary.md prompt templates into DIR, byte for byte, as the starting point for a PRXREF_PROMPTS_DIR override directory, and prints each path it wrote. It creates DIR when it is missing. When any of the three files already exists it overwrites nothing, writes nothing, and exits 2 naming the file; --force overwrites them. The judge prompt of prxref eval is never exported, because it cannot be overridden. How to edit and use the exported templates: Prompt Template Overrides.
prxref eval scores replays against labelled human findings. It never posts, and it adds no environment variable. Its three actions:
The whole reference, from the case format to every score.json key: docs/evals.md.
A replay reviews a pinned, reproducible input instead of a PR as it stands, so one change can be reviewed again later, by another model or another prxref build, and compared. Three invocations cover it:
# A blind replay of a PR at two pinned commits, without its existing discussion prxref review --pr-url https://github.com/acme/widgets/pull/42 \ --base-sha 0123456789abcdef0123456789abcdef01234567 \ --head-sha 89abcdef0123456789abcdef0123456789abcdef \ --no-threads --format json # A diff on disk with its ticket and spec corpus; no PR and no forge at all prxref review --diff-file change.diff --context-file TICKET.md --spec docs/specs --format json # One eval case (see tests/evals/README.md) prxref review --diff-file tests/evals/ /diff.patch --context-file tests/evals/ /ticket.md \ --spec tests/evals/ /docs --no-post --format json A replay never posts. Any replay flag turns posting off for the run, with or without --no-post; when nothing else had already turned it off, the run logs replay run: posting to the forge is disabled. The replay forges also refuse every write, and a replay never prunes older comments.
Pinned SHAs: --base-sha and --head-sha come as a pair, must be full 40- or 64-character hex commit SHAs (resolve a short one with git rev-parse), are lowercased, must name two different commits, and need --pr-url. The review reads the merge-base diff BASE...HEAD and file context at HEAD; the endpoint each forge uses is under "Pinned Commit Range (Replay)" in docs/forges.md.
--diff-file PATH reviews that file (git diff or git format-patch output) instead of fetching a diff. Without --pr-url nothing is contacted: there are no threads and no file context unless --repo-dir names a checkout to read it from, and a git format-patch file supplies the title, description and author. With --pr-url the file replaces the PR's diff, and without --head-sha a warning says that file context is still read at the PR's current head.
The title and description are pinned too. A --pr-url replay shows the PR's title and description as they were at a cutoff, not as they are now, because a description edited after review (a table of the review fixes, say) tells the model what the reviewers found. The cutoff is the first of these that exists:
The history is read once, before the review starts, by one call to the forge's history reader; that network read is not recorded in the run trace. GitHub and Bitbucket Cloud can read it, and GitHub needs a token to (see "Description History (Replay)" in docs/forges.md). The title is pinned exactly when the description is. A cutoff before the PR was opened shows the original description.
Falling back to the current text. When the history cannot pin them, the replay keeps the PR's current title and description, stamps "description": "live", and logs a WARNING that starts replay shows the PR's CURRENT title and description and gives the reason: the forge cannot read description history (Bitbucket Server, GitLab, Gitea/Forgejo and Azure DevOps cannot), the read failed (no GitHub token, a 401 or 403, a transport error), the history has neither a first review nor a head commit date, or it does not reach the cutoff (it is incomplete, or the version then in force was deleted). None of these stops the review. An explicit --as-of on a forge that cannot read history is the exception: it exits 2 naming --as-of, because the time you asked for cannot be honoured.
--description-file PATH and --no-description replace the description with that file's text or with nothing, read no history, and leave the title as it is now. Both also work without --pr-url, replacing the description a git format-patch file supplies. At most one of --as-of, --description-file and --no-description may be given.
What a pinned replay does not pin. The PR's current threads still reach the prompt unless you add --no-threads; a replay at pinned SHAs without --no-threads logs a warning saying so. With --pr-url, --diff-file and no --head-sha, file context is read at the PR's current head, with a warning. The title stays the current one under --description-file and --no-description, and after a fall back to the current text.
The record. A replay's JSON record gains a replay stamp, always with all seven keys, and the text summary prints it as a replay: line. A normal run's record has no replay key.
"replay": {"base_sha": null, "head_sha": null, "threads": "hidden", "diff_file": "change.diff", "description": "file", "as_of": null, "as_of_source": null} threads is "hidden" under --no-threads or with no --pr-url, else "shown"; diff_file is the path as you typed it. description is "pinned" (the title and description in force at the cutoff), "live" (the current ones), "file" (--description-file, or --diff-file without --pr-url, where any description comes from the file) or "none" (--no-description). as_of is the cutoff as a UTC time ending in Z, with a fraction of a second only when the source time had one, and as_of_source is "flag", "first-review" or "head-commit". Both are set whenever a cutoff was chosen, on a "live" stamp too: one whose history did not reach the cutoff, or whose history read failed after --as-of had chosen it. Both are null when no cutoff was chosen. Given back as --as-of, as_of names the same instant. The text line then ends description=pinned as_of=2026-05-01T09:30:00Z (first-review).
Exit codes. A bad set of replay flags exits 2 naming the flag, and it is checked before the PR URL is parsed. A review error inside a replay — an empty pinned range (a head already merged into the base) or a blank diff file — ends the run as an Error run: it exits 0 under the default PRXREF_FAIL_ON=never, and 1 under error or any, like any review that does not complete. See Exit Codes.
The replay flags have no environment variable, on purpose, and the webhook server never replays.
prxref eval turns replays into numbers. Give it pull requests that human reviewers have already reviewed, each labelled with the findings they left, and it replays every case through the real pipeline, grades prxref's findings against the labels, and compares two runs, so a new model, prompt template, rules file or setting can be judged across a dataset rather than on one PR:
prxref eval run --cases tests/evals --label base PRXREF_LLM_MODELS=example-model-b prxref eval run --cases tests/evals --label cand prxref eval score --label base prxref eval score --label cand prxref eval compare base cand Cases come as a cases.json file or as a directory of case-*/ directories, the layout of tests/evals/. A label is graded deterministically when it carries a must_match predicate, and by an LLM judge on the review's own backend (--judge-model) when it does not. Recall is micro recall over every label, with half credit for a partial judge grade, broken down by severity and by category. The score also reports unmatched AI findings per PR, severity agreement, failed chunks, time and cost, and never sums an unknown cost. Runs go to ./prxref-eval/ / by default; add prxref-eval/ to your .gitignore. A run never posts, and a case that fails is recorded and scored, never fatal. The full reference is docs/evals.md.
prxref is an advisor, never a gate. Its exit code says whether prxref was configured correctly, not whether your code is good.
PRXREF_FAIL_ON is the one opt-out of the advisory contract, and its default never is the doctrine above, unchanged. Setting it to error or any turns the reviewer into a merge gate — failing a build on a finding turns a probabilistic reviewer into a gate, and the first false positive teaches a team to bypass the gate, so think hard before you set it. Read the verdict from the posted summary, which also carries a partial-review banner when some chunks did not make it. Do not build a security control on the exit code. The webhook daemon has no exit code and is unaffected.
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.




