Guides
Gating CI
A gate compares measured evidence against a threshold you declared, and exits with a code your CI understands. The decision is made on the interval, not on the estimate.
The release policy
release.yaml is the scaffolded second file.
version: 1
confidence_level: 0.95
block_on: [FAIL, INSUFFICIENT_EVIDENCE, MANUAL_REVIEW]
warn_on: []
require_validated_evaluators: true
rules:
- id: label-floor
metric: exact_label
min: 0.80metric: names a criterion from oloproof.yaml. min: is a minimum threshold, so the rule passes when the interval's lower bound clears it and fails when the upper bound is below it. max: is the mirror: a budget on a latency, a cost, or a cost per accepted task, which passes when the upper bound is at or below it and fails when the lower bound is above it.
block_on lists the decision states that stop a release. The default blocks on INSUFFICIENT_EVIDENCE as well as on FAIL, which is the point: a suite too small to separate an effect from noise has not shown the change is safe, and treating that as a pass is the common way an evaluation misleads the team running it.
What a rule can decide
Before any run, oloproof plan with no id prints, for each rule, which counts of passing cases reach each state at the suite's current size:
What this suite can decide, if every case is measured:
label-floor (exact_label at least 0.8, 30 cases):
29 or 30 pass: PASS (established); 19 to 28: INSUFFICIENT_EVIDENCE (not
established yet); 18 or fewer: FAIL (ruled out). With 50 cases, PASS from
46; with 100, from 89.It is no new method and makes no claim about how likely each state is: it runs the interval the gate would run, chosen the way a run chooses it, at every possible count. A comparison rule on a pass rate gets the newly passing cases it needs for each count of newly failing ones (0 to 3), and the newly failing cases that rule it out when none newly pass. A rule whose interval reads more than a count (a mean of scores, a quantile, a replicated, clustered or early-stopped rate, a rule on a slice, an equivalence rule or one in a Holm family) says that no table is available, rather than guessing. Missing cases widen the interval, so with some missing these counts are the least that can decide.
How many more cases
When a rule does not decide, its line says how large a suite would decide it if the next cases go like these, and that at that size it is settled about half the time. For a pass rate it adds the size for a 4-in-5 chance, computed exactly at the rate it names (the observed rate, with any missing cases counted at their worst). oloproof plan RUN --power adds the same for a mean of scores or a quantile: estimated by resampling the values you saw, so it reads "if the values are as you saw them", is rounded, and comes with the size if the true value were halfway to the threshold. It takes about a second per rule. None of these sizes decides anything: the states and the exit code are the same with or without them.
Running the gate
oloproof gate latest --policy release.yamllatest is the run oloproof run just made, and latest~1 the one before it; the full id it printed works too. Gating is a separate command from running because a decision can be re-taken against an edited policy without re-executing anything: the evidence is stored and the threshold is not part of it.
Under each rule the gate prints what decided it: the estimate, its range, the method in words and the cases counted, such as 92.1%, range 78.6% to 98.3% (exact binomial interval); 38 of 40 cases; 2 missing. An observed-count rule prints the failures it saw against its limit. oloproof inspect latest decides the run again the same way under release.yaml and says so; the stored run and its gate stay as they were.
The gate also says whether the project is still what the run evaluated. It builds the project's system, suite and evaluators as they are now, running nothing (for a Python system it imports the module, as oloproof run --estimate does), and prints Evidence: current. or Evidence: stale., naming what changed since the run: the system (its code or configuration), the suite's cases or the evaluators. The decisions and the exit code stay what the evidence said: a stale PASS is still the PASS of that run, and running again decides the project as it is. A stale run's line also goes into the pull request summary. A run of another suite, such as an imported score file, is not compared. On the hosted workbench, a run's page says the same against the newest run of its suite the project holds.
What the gate compares as the system is its version: a callable's module source and the project's Python modules it imports (plus every file code_paths matches), its declared version and its configuration; for an HTTP system, its URL and declared version. A file it reads at run time, a module imported by a computed name, an installed dependency, or the service behind a URL is not compared, so a change there still reads as current. List such source under code_paths to have it compared.
Early stopping
Add early_stopping: true to a policy to let a run stop after a seeded batch once every rule has already decided PASS or FAIL. Runs without the flag execute every case exactly as before. The run records the seed, batch size, cases run, cases not needed and the avoided work; the terminal, bundle and workbench show those fields beside the decision.
Comparisons stop too. evaluate_comparison() runs the candidate and the baseline on the same seeded batches, so every case either side ran is a pair, and it stops both once every run rule and comparison rule has decided. A gate that decides only on the last batch stopped nothing, and the run is recorded as an ordinary completed run.
A stopped run keeps its methods: oloproof gate, plan and signoff re-decide it with the same intervals it stopped on.
Cases that never ran count at their worst possible value, so a stop is valid whenever it happens, but that also limits how early a PASS can come. Passing a minimum threshold T needs at least T × N of the N cases to have run, and a superiority rule needs more than half the suite. Early stopping saves the most on clear failures.
Some policies still run every case and record why in disabled_reasons: Holm families (holm_family_declared), quantiles, AUC or other ranking metrics, cost per accepted task, clustered metrics, replicated runs, and comparisons whose policy names conditional_exact_paired_difference@1 (difference_method:<id>) have no admitted optional-stopping path yet.
Exit codes
| Code | Meaning |
|---|---|
| 0 | No decision the policy blocks on: every rule passed, or those that did not are outside block_on |
| 1 | A rule failed |
| 2 | The configuration or invocation was wrong, before anything ran |
| 3 | The evidence did not decide; under every policy, a rule whose metric observed no case or more missing cases than its max_missing_fraction allows |
| 4 | A person is asked to decide |
| 5 | The run did not complete, so there is no quality result |
| 6 | Every rule allows the release, and the policy requires people to approve it |
When more than one gate is blocked, the code reported is the first of 1, 5, 4, 3, 6 that applies. A failure outranks an incomplete run, which outranks a request for review, which outranks insufficient evidence. Code 6 comes only from a policy with require_approval, and only when nothing else blocks.
Code 2 is not a quality result. It means the invocation was wrong and nothing was measured, so CI should treat it as a broken build rather than a failing system.
Overriding a blocked gate
Shipping against a blocked gate takes two named approvers and a written reason. The first gives the reason; a second approver, under a different name, approves:
oloproof signoff latest --by alice --reason "..."
oloproof signoff latest --by bob --approveThe decisions still say what the evidence said. Only the release action moves, and the override is recorded in the audit log, chained to the entry before it, pinned to the exact gate it approved. New evidence or an edited threshold needs approving again.
In a project that requires verified evidence, the workspace gate decides the release, and a sign-off from the terminal overrides only the gate your run pushed. Sign off against the workspace gate on the run page instead: the Owner gives the reason, and a different Owner or Admin approves it. It takes effect once both have, for that gate alone; if the workspace decides the gate again, ask again.
Requiring approval of a passing release
A PASS says the evidence clears your bar. It does not say anyone accepted the release. A policy that wants both says so:
version: 1
require_approval: true
rules:
- {id: correct, metric: answer_correct, min: 0.8}When every rule allows the release, the gate still blocks, with the reason approval_required and exit code 6, until two approvers sign off that gate with the same commands as an override. The decisions stay PASS; the sign-off records that it approves a release every rule allowed rather than overriding a rule. Like an override, it is pinned to the exact gate: new evidence or an edited policy needs approving again. A gate that already blocks for another reason keeps that reason and its code.
It applies to a run's gate. A comparison's gate does not read it, since no sign-off can name one. Where a project requires verified evidence (below) and an Owner pinned a policy that sets it, the workspace's own gate reads it too: a version whose every rule passes shows "Passes; waiting for approval" on its run page, an Owner approves it there with a reason, and a different Owner or Admin gives the second approval.
An approval in the workspace may carry a revisit date: the Owner can give one when asking and the second account when approving, a day in UTC from tomorrow to 730 days ahead, and the earlier of the two is sealed. The approval stands through that day. From the next it reads "Expired: revisit", the version waits for approval again, and a newer approval replaces it. No decision changes; only the release stops. Where a gate carries several sealed approvals, the newest by the time it was sealed counts, on the run page and in record verify alike.
While a project's requirement can hold a passing release for approval, changing the pinned policy or evaluation, or requiring nothing, waits for a second approval too: an Owner or Admin asks for it on the settings page, and it takes effect when a different Owner or Admin approves it, as long as one of the two is an Owner. A change of the labeller count or of the level of evidence takes effect at once.
Each of these two-person rules counts two accounts of the workspace, not two people, and one of the two is always an Owner. The workspace cannot tell whether one person holds two accounts, and Owners and Admins can both invite members, so an Admin cannot complete one of these rules alone, but an Owner who holds a second account can. Only an Owner makes another Owner. At the terminal, --by is a name you type, and nothing checks it. record verify reports each sign-off a record carries as not checked, with the names it carries, since nothing signs a sign-off.
Verified evidence
A gate decided on your machine says what your evidence shows. A workspace can ask for more, per project, on its settings page, where an Owner or Admin chooses what the project requires:
- Nothing beyond the gate: Decisions stand as pushed.
- Verified human sample: Every decision resting on a judge (an LLM judge, a model or custom code) must rest on a PPI interval over a human sample the workspace drew and checked itself; a judge-free metric stands. The project can also require two or more labellers per sampled case, counted by the account that gave each verdict, in the review queue or with oloproof review --sample, not by the name typed beside it. Where they disagree on a case, an Owner or Admin who labelled none of it resolves it on the queue page or the run page.
- Verified end to end: As above, and every decision must rest on outputs a registered runner produced: a runner your platform team operates, or the managed worker.
With a requirement in force, an Owner or Admin also pins what the workspace decides. They pin the evaluation: a finished run whose suite, evaluators and metrics become the project's evaluation, and which is itself the baseline every comparison is decided against. The settings page lists runs a registered runner signed first, and under verified end to end only a signed run can be pinned; under the human sample level, open an unsigned run before pinning it, since its records are whatever its pusher sent. And they pin the release policy, choosing from the policies pushed with the project's runs that the workspace has checked. With no policy pinned the workspace decides nothing. A policy with rules needs an evaluation pinned with it. A policy with no rules passes every version (with an evaluation pinned, every version of that evaluation) and holds each for approval where it asks. The workspace then decides every rule of that policy itself, for runs of exactly the pinned evaluation, from the evidence it holds and the samples it drew, and the page of the run a version is decided on leads with that workspace gate, each rule shown with its terms; the comparison page shows none. What it cannot decide on verified evidence is manual review, with the reason. A run with another suite, other evaluators or other metrics is another evaluation, and is not decided. A managed run (oloproof run --cloud) digests its cases plainly, so in a project that keys its digests its suite is another suite from a local run's, and an evaluation pinned on a local run never decides it (Managed runs). To grow or change the evaluation, an Owner pins a newer run. What the workspace decides is a system version, on its first run of the evaluation: under verified end to end, the first run a registered runner started for that version, whether or not it was pushed or finished; under the human sample level, the first the workspace received. Running the same version again until one run passes changes nothing, and every version evaluated is listed on the run page with its result. Comparisons are the workspace's too: it compares each version's deciding run with the pinned run, so you need not push a comparison at all. The policy your push carries still decides your local gate and CI; in the workspace it only shows beside the result. Under the verified human sample level, which evaluator produced a metric is what your push says; only verified end to end binds it.
To run a suite on a registered runner:
- On the machine that will run it, oloproof runner keygen --out runner.key writes the key and prints its public half.
- An Owner or Admin registers that public key for the project (POST /api/workspaces/<id>/runners), which returns its key id.
- Log the runner in to the project with oloproof login, then run with OLOPROOF_RUNNER_KEY_FILE (or the key itself in OLOPROOF_RUNNER_KEY) and OLOPROOF_RUNNER_KEY_ID set.
Before it executes anything, the runner records the run's suite with the workspace, signed, and refuses to run if it cannot. The runner signs what it executed, including the suite, the system and evaluator versions, and oloproof push sends that signature first; the workspace then checks every record it holds against it, including copies your egress policy redacted. A push that writes a verified run must carry that signature every time.
Verified execution attests which system version the runner executed and what it produced. It does not attest that this is the version in production, and it cannot see outputs anyone obtained by calling the system some other way. A runner holds its signing key in the process that runs your system and evaluators, so it must only run code its operator controls: a provider-backed system, a deployed endpoint or the platform team's own modules, never code the person being evaluated can change. Revoking a runner key for rotation keeps what it signed verified; revoking it as compromised (DELETE ...?compromised=true) voids every run it signed.
A run a registered runner signed can also be checked outside your workspace, by a customer you supply for example. oloproof record export writes its decision record: the evaluation, the runner's signed manifest, each rule's decision with its interval and method, and the evidence with every egress category blanked, so no input, output or expected value leaves. The other party checks it offline with the public key you registered:
oloproof record export latest --out record.json
oloproof record verify record.json --key PUBLIC_KEYrecord verify checks every signature and digest, recomputes each rule it can from the signed evidence, and lists what it could not check and what the record does not establish, such as who registered the key or what the workspace states without a signature. It exits 0 when every check passed, 5 when any failed, and 3 when every check passed but the workspace's statement is unsigned or its signature was not checked with a --workspace-key: it then never calls the record verified, so read the statement's lines as the exporter's word. It also prints the evaluation's digest; passing it back with --evaluation holds every later record to the same suite, evaluators, metrics and policy. The record carries the run's sign-offs and approvals as they were sealed, and says what each of its facts rests on: signed by the runner, computed by the engine, imported from another tool, attested by the people who signed, or stated by the workspace with nothing to check it against; record verify lists them and checks that each holds. A record oloproof record export writes carries no workspace statement, so where your provider's workspace decides releases its release line is only the terminal's: pass --require-workspace to fail such a record, and ask for one the workspace exported.
Where your provider's workspace decides releases, ask for the record the workspace exports: a governed run's page offers Download the decision record. That record carries the workspace's statement signed by the deployment's workspace-statement key, which the deployment publishes at /api/workspace-statement-key. Pin that key and pass it back:
oloproof record verify record.json --key PUBLIC_KEY --require-workspace --workspace-key STATEMENT_KEYA workspace-statement key implies --require-workspace: the record must carry the workspace's decided statement signed by that key, so one unsigned, stripped of its signature, signed by another key or changed after signing fails. The signature also covers the sign-offs and approvals the record carries and its export time, which record verify prints: the statement is the workspace's word as of that time, not now, so ask for a fresh export when its age matters. The key belongs to the deployment, so the signature is the word of whoever operates it; when the deployment rotates its key, it publishes the earlier ones as retired or revoked at the same address, and --workspace-keys FILE reads that list as you saved it. The signature does not let you recompute what the workspace decided on its own human sample, whose labels the record does not carry.
What a wrong release would cost
A gate says whether the evidence clears the bar, not what being wrong would cost. Declare it in release.yaml and the gate shows it under each pass-rate rule:
loss:
false_pass: 40 # shipping when the true rate is below the bar
false_fail: 4 # blocking when it is at or above
unit: hours
batch: {size: 100, cost: 3}Each rule then gets its expected cost of shipping and of blocking, under a prior on its rate (uniform unless you set prior: [a, b], and always your word), the worst cost of each action if it is wrong over the interval the rule was decided on, and whether one more batch of cases is worth its cost. Missing cases are read every way they could go, so each number is a range. oloproof plan RUN --run says whether the batch may pay, as a sentence and never a reason to stop. --json puts the same numbers in a loss field, and oloproof report RUN --html shows the same lines.
None of it decides. The states, the release action, the exit code and the gate key are exactly what they are without loss:. Acting on the lower expected cost is not the gate: at a true rate just under the bar it ships far more often than the gate would. Only pass rates read by Clopper-Pearson get a view; any other rule gets one line saying why not.
Where to go next
- Running in CI covers the job itself: installing, the event stream, and comparing a pull request against its base.
- Writing a suite covers the file the metrics come from.
- Errors covers what a run that did not complete reports.