Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Verification reports: schema version 2

A schema-v2 report describes every function one Verus run verified. This page is the reference for that document; the decisions behind it are in ADR 0014, amended for version 2 by ADR 0044. sail verify --output json (managed verification, the default; ADR 0046) prints a sail-project-result envelope holding one schema-v2 report per Cargo target, including targets whose reports were reused; see workspace verification. MCP verify returns the requested targets’ reports, and sail verify --measure-fragility and the opt-in portfolio print one schema-v2 report directly.

Each managed target’s target is Cargo’s exact target name, including hyphens. Distinct binaries foo-bar and foo_bar have separate target reports and proof receipts. Compiler crate-name normalization does not establish target identity. An ambiguous observation produces SAIL3107 rather than a reusable report.

  • JSON Schema: crates/sail-api/schema/verify-output-v2.json (draft 2020-12).
  • Rust types: sail_api::output (Report and the types it contains).
  • An example document: crates/sail-cli/tests/fixtures/attr/report.golden.json (from crates/sail-cli/tests/fixtures/attr/input.rs).

MCP tools return a smaller agent view of these reports by default (requested targets only, source-level counterexample variables). They return this document unchanged with detail: "targets" or "full"; see MCP reply size. The CLI document is unchanged.

Invocation and streams

--output json (or --output=json) belongs to sail. It may appear anywhere before a --. Everything else is passed to cargo verus verify unchanged and in order. After a --, every argument belongs to Verus.

StreamContents
stdoutExactly one JSON document, followed by a newline. Nothing else.
stderrEverything cargo verus verify writes to stderr, byte for byte, as it arrives (Cargo’s status lines and Verus’s diagnostics), plus any non-JSON text Verus printed on stdout.
exit codecargo verus verify’s exit code, or 2 with a SAIL01xx error if sail could not set up.

Under --output json, cargo verus writes stderr into a pipe rather than a terminal, so colours are off unless you force them (CARGO_TERM_COLOR=always). The bytes are otherwise the same as plain cargo verus verify, and the e2e CI step checks this.

Without --output json, sail verify adds nothing: its output is byte-identical to cargo verus verify.

What --output json adds to the Verus command

sail adds these Verus options for each verified target. It passes them as Cargo-Verus passes the user’s own options after --: in the Verus driver’s __VERUS_DRIVER_ARGS__ variable, ahead of the user’s options, never on the compiler’s command line. The command line a procedural macro can read is plain Cargo-Verus’s (#393). The dep-info records the variable’s value without Sail’s options, so Cargo’s freshness is unchanged.

  • --output-json --time, unless already present. Verus then prints its own per-function results (stdout, captured by sail). Plain sail verify adds them too, and prints Verus’s own output rebuilt from them.
  • --log smt-transcript --log air --log-dir <scratch>, for the obligation detail (see Attribution coverage). Only runs whose report is read add them: --output json, and so jobs and MCP, and repairs. Plain sail verify does not (ADR 0047).

None of these flags changes a byte of what Z3 receives. This is tested against the pinned Verus (crates/sail-verus/tests/attribution_verus.rs). --log smt does change Z3’s input, and sail never adds it.

When Cargo considers every package up to date, Verus does not run. crates is then empty and attribution.notes says why. To re-verify, change a source file or run cargo clean -p <package>. Cargo does not re-verify a fresh crate because Verus’s arguments changed (docs/verus-issues/VI-0005).

The document

All field names are snake_case. Existing optional values are present as null. The additive portfolio evidence and proving-configuration fields are omitted when no portfolio was requested.

FieldTypeMeaning
schema_version2This schema.
sail_versionstringThe sail that wrote it, exactly as sail --version prints it (a release build includes its suffix, for example 0.1.0-rc.5).
modestringdefault, or explicitly selected accept-first-proof (charter rule 8).
commandstring[]Cargo/Verus arguments without sail’s own flags, adjusted to this target’s effective focused and compile-only settings.
exit_codeint | nullcargo verus verify’s exit code.
solverobject | nullname (z3), version (as Z3 reported it), path, sha256 of the binary.
cache.daemonboolWhether solver sessions could be served from the cache daemon.
attributionobjectstatus (complete, partial or unavailable), notes (plain-language reasons), unmatched_sessions.
cratesarrayOne entry per Verus run (crate), in the order Verus finished.
diagnosticsarrayVerus’s diagnostics as data (see Diagnostics).
summaryobjectCounts over all functions: functions, verified, failed, unknown, provisional, unstable.
errorobject | nullcode and message when sail could not run Verus at all.
engineobject (optional)Only for an explicitly selected source engine (ADR 0027); see Engine provenance. Omitted for stock verification.

Cargo can forward different Verus options to a requested target and its dependencies. A report retains the original Cargo selection and other options, while focused selectors and --no-verify describe the effective package scope. Implicit logging flags are not added to this field. Compile-only success cannot establish proof authority; input currentness remains a separate observation.

A crate has a name (from its functions’ paths), verus (Verus’s own verified, errors, success and encountered_vir_error), and functions, sorted by name.

Counting units. summary and functions count functions. Verus’s verified and errors count verification units: for example, each loop is verified and counted separately from its function’s body. So a crate of five functions, two with a loop, can report 6 verified, 1 errors for one failed function. The two counts are expected to differ.

Functions

FieldMeaning
functionThe function’s crate-qualified path as Verus names it: demo::max, demo::arith::mul_pos, demo::Counter::incr.
moduleIts module as Verus reports it ("" for the crate root).
fn_modeexec, proof or spec.
verdictverified, failed, unknown or provisional. See Verdicts.
establishmentHow the result was established: confirmed or provisional.
evidence_tierHow strong the evidence for a settled verdict is: smt_verified for every verified or failed verdict today, null for unknown and provisional. See Evidence tier.
unstableWhether any of its answers could plausibly differ between plain Verus runs: a proof that used more than half its rlimit, or a give-up from resource exhaustion or near the limit (ADR 0009); also true when explicit replay measurement observes both proofs and failures.
verus_successVerus’s own success for it, verbatim. Incomplete for bit-vector queries (docs/verus-issues/VI-0003).
provenancemode; optional portfolio configuration.seed; source (fresh, cache, mixed or unrecorded); checks_solved, checks_served and checks_unrecorded; optional engine for source-engine results (Engine provenance).
timingsmt_micros and rlimit, as Verus reports them.
fragility{score, runs, proved} after an explicit complete replay measurement; otherwise null, with attribution notes when measurement is incomplete.
obligationsIts obligations, or null if attribution was unavailable for it.

Obligations

One obligation is one solver query op that Verus ran for the function: an AIR check-valid, sent to Z3 as one (push) … (pop) block, or as its own process for a spinoff.

FieldMeaning
idThe stable identity (next section).
kindVerus’s op kind: Function-Def (the body or a loop), Spec-Termination, Check-Api-Safety, Function-Recommends, Function-Expand-Errors; any of them may carry a -Profile-Rerun suffix.
ordinalIts position among the function’s in-module ops of this kind (0 for spinoffs).
spinoffnull, or {index, reason} for an op Verus ran in its own process (reason: nonlinear, bitvector, profile_rerun or spinoff_all).
advisorytrue for recommends, expand-errors and profile reruns. Their failures are notes or warnings in Verus, not errors, and never fail the function.
spanVerus’s span for the op (text verbatim, plus file, line, column, end_line and end_column). It is informational and not part of the identity.
outcomeproved (the first check answered unsat), failed, or unknown.
unstableAs for functions, for this obligation’s checks.
checksEvery check-sat in the op, in order: answer, rlimit_limit, rlimit_used, reason_unknown, and source (solved, cache, or null if not recorded). The first check decides validity. Later checks are Verus locating further failing assertions.
counterexampleThe first model Z3 gave for the op, if any: check (an index into checks), model (the get-model reply verbatim), and assignments (each zero-arity define-fun as {name, sort, value, itf}; see ITF values).

Verus encodes names in models. Parameter x is x!. Successive versions of local i are i@0, i@1, and so on. Assertion labels are %%location_label%%N, where false marks an assertion that failed in this model.

ITF values

Each assignment’s itf is its value in the value encoding of ITF (Apalache’s Informal Trace Format), so clients can read model values in one format:

SortVerbatim valueitf
Booltruetrue
Int42, (- 42){"#bigint": "42"}, {"#bigint": "-42"}
(_ BitVec n), n ≤ 128#xff, #b101{"#bigint": "255"}, {"#bigint": "5"} (unsigned)
anything elseFuelId!val!55, (I 3), 1.0{"#unserializable": "FuelId!val!55"}

itf is a rendering, never a replacement (charter rule 3). model keeps the solver’s get-model reply byte for byte and value keeps each value verbatim. The cache stores and replays the solver’s exact bytes.

Obligation identity

<function>#<kind>/<ordinal>          an op run in the function's module process
<function>#<kind>/spinoff-<index>    an op spun off into its own process

For example: demo::sum_to#Function-Def/0 (the loop), demo::sum_to#Function-Def/1 (the body after it), and demo::arith::mul_pos#Function-Def/spinoff-1.

What survives. An identity contains no source positions, no bucket or process order, and nothing derived from other functions. So it is unchanged by:

  • edits to other functions, including adding, removing or reordering them;
  • edits anywhere that move the function within its file (comments, blank lines, new items above it);
  • edits to the function’s body that do not change its op structure (for example changing an expression).

crates/sail-verus/tests/attribution_verus.rs checks this against the pinned Verus. It inserts a function and comments above everything, swaps two functions, and edits a third function’s body. Every identity is then unchanged, although every span moved.

What does not survive.

  • Renaming or moving the function (to another module or impl, or under a renamed crate): the path is part of the identity. The test checks this too.
  • Changing the function’s op structure: adding or removing a loop, or a by (nonlinear_arith) or by (bit_vector) block, renumbers that function’s ordinals or spinoff indices from the change onwards.
  • Changing a function’s verdict can add or remove ops. For example, Verus runs a Function-Recommends op only after a Function-Def failure, so that obligation exists only while the function fails.

Spans are reported with every obligation so that tools can match across a rename or move themselves. Matching by function path and kind, with the span as a tie-breaker, recovers most refactors.

Verdicts, establishment and evidence tier

  • verified: confirmed, and proved. Verus said success, and no attributed verdict-bearing obligation failed.
  • failed: confirmed, and not proved, and the failure is settled: Z3 found a model, or gave up far from its limit for its own reasons (for example (incomplete quantifiers)).
  • unknown: verification was not confirmed. Z3 may have given up at or near its limit, or no answer was recorded. Resource failures appear in plain Verus as failures (for example rlimit exceeded). A failing crate with incomplete attribution also leaves apparently successful timing entries uncertain (VI-0003). sail never presents an unknown as a settled failure (ADR 0009).
  • provisional: not yet established by the pinned solver on the exact query. A provisional result is never verified, whatever its evidence says (charter rule 7). sail verify itself never produces provisional results. Every answer it reports came from the pinned Z3, fresh or from the cache, so its establishment is confirmed. Live proof observations (sail jobs events, MCP verification_events) are provisional.

establishment and evidence_tier are two separate axes (ADR 0044). establishment says how a result was established; evidence_tier says how strong the evidence for a settled verdict is.

Evidence tier

The evidence tiers are ordered, weakest first:

ValueMeaning
sampledRuntime-checked contracts under property tests.
boundedChecked within declared bounds.
smt_verifiedSettled by an SMT solver.
certificate_checkedSolver proof certificates checked independently.
kernel_checkedChecked by a proof assistant’s kernel.

evidence_tier is set exactly when the verdict is settled (verified or failed) and is null otherwise. Every verdict Sail settles today comes from the pinned Z3 through Verus, so it is smt_verified. The other values are reserved for the verification runtime (scope), which adds to version 2 rather than changing it. A verdict is never upgraded across tiers.

Agreement with Verus. Complete attribution combines Verus’s reported success with every primary obligation outcome. Partial function requests exclude timing entries for unselected functions (VI-0009). In a failing crate with incomplete attribution, apparently successful timing entries remain unknown, with their raw success fields retained (VI-0003). Verus’s success stays true for a function whose only failure is a bit-vector query (VI-0003), although Verus reports the error and exits non-zero. When attribution shows the failed bit-vector obligation, sail reports failed. This agrees with Verus’s diagnostics and exit code. The e2e CI step checks agreement with Verus’s --output-json.

Provenance

Each check records how its answer was established (charter rule 7):

  • solved: a fresh run of the pinned Z3;
  • cache: a cache hit, which is always a reply the pinned Z3 produced for the same key (ADR 0008);
  • null: no record. For example, the daemon could not be reached and the shim fell back to pass-through, or a solver session grew past the shim’s retained-bytes bound (SAIL_SHIM_BUFFER_BYTES, default 256 MiB) and continued as pass-through without the cache.

A function’s provenance.source summarises its checks:

  • fresh: all solved;
  • cache: all served;
  • mixed: some of each;
  • unrecorded: at least one check has no record.

Engine provenance

Reports from the optional interactive source engine (--engine interactive, ADR 0027) carry an engine object at the top level and in every function’s provenance:

FieldMeaning
nameinteractive.
manifest_sha256SHA-256 of the validated engine build manifest.
established_byengine: the engine’s complete, sealed full phase produced the report. stock-fallback: the engine faulted and the exact stock Verus invocation produced it; such a report publishes no proof receipt and cannot accept a repair.

mode stays default: the engine is not a verdict-changing mode, and its conformance arm compares it with plain Verus. Managed project results add the same identity (without established_by) as a top-level engine field.

Diagnostics

Each top-level error, warning, note or help block on stderr becomes {level, code, message, spans, rendered}:

  • rendered is the block verbatim (ANSI colours removed);
  • spans lists its --> (primary) and ::: locations.

Nothing is reworded. Diagnostics are not yet linked to obligations. Standalone Rustc artifact events are build metadata and do not become part of a diagnostic’s rendered text. Indented examples and unrecognized JSON remain verbatim diagnostic text.

Attribution coverage

Attribution needs Verus’s logs.

Reports established without logs. Plain sail verify asks Verus for no logs (ADR 0047). When a later --output json, job or MCP run reuses a passing target whose proof such a run established, that target’s report has attribution.status unavailable, a first note saying the obligation detail was not recorded by the run that established it, obligations null, provenance source unrecorded and unstable false (it needs per-check effort). Its verdicts, rlimit and time are Verus’s own, as with logs: a target is reused only when Verus reported no error, so every function is verified. The next run that verifies the target again records the detail.

Older managed and single-file rules. Verus deletes every file in its log directory when it first writes there, and cargo verus gives every package and target in a run the same log directory (docs/verus-issues/VI-0004). sail therefore asks for logs only when one Verus process will write them: a single workspace member with at most one lib or bin target, and no --log arguments of the user’s own.

Otherwise attribution.status is unavailable, its notes say why, and every function’s obligations is null. Successful crates use Verus’s JSON; failing crates leave apparently successful timing entries unknown with a note.

partial means some processes could not be matched. The notes say which. Verus can overwrite a spinoff’s log when two ops of one function both spin off (survey §6). unmatched_sessions counts cached solver sessions that matched no log.

Functions that pass by Verus’s totals. Failing crates with incomplete attribution leave successful timing entries unknown, but Verus’s errors total does count every failure, bit-vector ones included (VI-0003). So when a crate’s verus.errors equals the number of its functions reported failed, no other function had an error, and its unknown functions passed by Verus’s totals. Their verdicts stay unknown in this document, since no per-function evidence confirms them. The human summaries (sail jobs result and MCP) report them separately as “passed by Verus’s totals”, and MCP counts them in counts.unknown_passed_by_verus_totals. A Vest edit with one failing lemma, for example, reads 0 verified, 1 failed, 3126 passed by Verus's totals (not attributed one by one), 0 unknown rather than 3126 unknown.

Durable jobs wrap this report in a project result, envelope version 2 (crates/sail-api/schema/project-result-v2.json). The proof-event journal read by sail jobs events and MCP verification_events has its own version-one schemas, which use this document’s function, obligation and diagnostic definitions: crates/sail-api/schema/proof-event-v1.json for one event and crates/sail-api/schema/proof-page-v1.json for a page. Events never replace the completed report; a provisional observation is never a verified claim.

Compatibility

Within schema version 2, fields are only ever added. A field is never removed, renamed, or given a different meaning; any such change is version 3. Consumers must ignore fields they do not know. The published JSON Schema is strict (additionalProperties: false), so that sail’s own tests catch drift. Validate against the schema of the version you were built for.

The optional engine fields above are omitted for stock verification.

With --portfolio accept-first-proof, optional portfolio evidence records the ordered seeds, each independent attempt (report, exit, timing, infrastructure error and verbatim stderr), and winner_seed. Every selected function’s provenance includes configuration.seed. Baseline seed 0 denotes unchanged solver defaults. Ordinary reports omit these optional fields.

--measure-fragility explicitly measures solver replay configurations and writes JSON (--fragility-seeds N, default 8). Each function’s existing fragility field is set only when its exact transcript input hash and ordered AIR checks cover every primary obligation. proved counts configurations proving every primary obligation together; score = 1 - proved/runs. It differs from the census’s per-check effort-pressure/disagreement metric. Missing mappings, ambiguous sessions and incomplete replays leave the field null with notes. Verdicts remain those of the baseline run. A replay score is not a complete-run seeded proof; only the portfolio mode can select such a proof.

The MCP verify tool accepts measure_fragility: true. The existing fragility tool also includes an optional verification report with the same function scores. Normal verification performs no replay measurement.

When a crate fails and attribution is incomplete, successful timing entries are reported unknown with a note (VI-0003). Their raw verus_success fields are retained. Verus can leave that field true for failed bit-vector queries, so it cannot establish a confirmed function proof in this case.

MCP persisted lookups include the establishing run’s solver identity, mode and winning seed in freshness. Source freshness does not assert that today’s toolchain matches that recorded identity.

Changes from version 1

Version 2 replaces version 1 before 0.1.0, the first release (ADR 0044). There is no compatibility mode.

  • schema_version is 2.
  • Each function’s tier is renamed establishment, with the same values and meaning.
  • Each function has a new evidence_tier.
  • Each counterexample assignment has a new itf.
  • The managed project-result envelope is version 2, since it embeds these reports.

A managed target may additionally include scope_reuse, the exact ordered arguments of a reused partial verification report. Such a target has complete: false and reused: false; it supplies no whole-target proof and does not increment execution.reused_targets. The original report and establishing run remain attached. Whole-target proof fields retain their existing meaning.