reviewgate

command
v0.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command reviewgate is the verdict engine of the in-session review gate (ADR 0080). The gate runs `ocr review --format json` once per configured model; this tool merges those runs, picks the gate from the tier policy for the files the diff touches, prints the findings the implementer must fix, and decides the verdict.

reviewgate verdict -policy FILE -changed FILE -round N [-ocr FILE]... [-title STR]
reviewgate record  -store DIR -slug OWNER/NAME -patchid ID -verdict pass|blocked|cap -tier NAME -round N -models "a,b" [-time RFC3339] [-covered N -total M [-covered-files FILE]] [-evidence FILE]...
reviewgate rounds  -file FILE -patchid ID [-bump]
reviewgate verify  -store DIR -slug OWNER/NAME -patchid ID -base SHA -head SHA -source-sha HEX -policy FILE -changed FILE

verdict exits 0 for pass, 1 for blocked, 2 for a usage or input error (including too few complete runs: the gate fails closed), and 3 when the round cap is reached with blocking findings left. A blocker finding is never deferred, so a blocker at the cap exits 1, not 3.

The policy's "models" list names the provider and model of each OCR run: the variance reviewer(s) chosen by the research bake-off (GLM 5.3 Flash found 4 of 17 known issues, codex plus Flash 6 of 17, about $0.05 a PR). An empty list would mean the gate runs OCR once, with whatever provider and model ocr is configured with. "fallback_models" is the watcher's replacement reviewer when codex is out (GLM 5.3); scripts/gate --review does not use it. The policy file is JSON and cannot carry comments, so that explanation lives here. loadPolicy validates both lists (a non-empty provider and model each); the gate script uses "models" to decide how many runs to make.

The policy's "questions" are standing review questions (id, severity, text) that the gate scripts append to every review prompts and to OCR's background text (not an OCR rule file); loadPolicy rejects an empty id or text, a repeated id and an unknown severity.

record writes the file the server-side watcher reads to verify the same patch was reviewed. -covered and -total say how many of the diff's files OCR reviewed (it leaves tests and Markdown out) and -covered-files names them (a newline list of repo-relative paths, one covered-file line each in the record); each -evidence file (one model run's OCR JSON) is copied next to the record, written before the record itself, and the record names it with its sha256 and the manifest's exact_range and source_artifact_sha256. verify is the server side of that record: exit 0 prints one status line, exit 1 prints "not verified: <reason>" (the caller then reviews the diff itself). It trusts nothing in the record but the names of the evidence files: it checks their sha256 and recomputes the verdict from them with the same code as verdict, under the given policy and changed files, round 1 (a round cap is a failure). The security-critical tier is never waived. A patch-id alone never verifies: the caller names the checkout it is verifying (-base and -head, the commits of the merge-base..head range the gate reviewed, and -source-sha, the manifest's source_artifact_sha256 for that checkout) and every recorded run must carry exactly that range and that source hash, so a rebase (same patch, new base and head) or a changed source is not verified. The patch-id stays the record's key and the round counter's. rounds keeps the per-branch round counter: one line per distinct patch-id that was reviewed with blocking findings.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL