On this page
Diagnostic JSON schema
Select --diagnostics json before the command. A diagnostic report is a JSON array, not JSON Lines. Plain check/prove invocations are the convenient structured interface; other commands can add ordinary stdout output. Read the stream table before connecting a JSON parser.
A machine-readable JSON Schema accompanies this reference. It describes diagnostic arrays only and allows additional object fields for forward-compatible consumers. It cannot validate stdout that also contains file listings or application output.
Diagnostic object
Every serialized diagnostic contains these keys. Nullable values are JSON null, not omitted. Consumers should allow future keys, recognize unknown codes and preserve useful text.
| Key | Type | Meaning |
|---|---|---|
code |
string | Stable Bxxxx diagnostic identity |
name |
string | Catalog name, such as overflow-check |
severity |
string | error, warning, or info |
phase |
string | lexical, syntax, semantic, flow, proof, runtime, driver, or internal |
message |
string | Human explanation in the source syntax where available |
primary |
label or null | Main location and label |
secondary |
array of labels | Related source locations |
notes |
array of notes | Additional explanation, optionally located |
fixes |
array of fixes | Suggested source replacements |
advice |
string or null | Suggested remedy |
counterexample |
counterexample or null | Model bindings and limited replay status |
instance |
string or null | Origin-based 16-hex-digit instance key, when origin is recorded |
The instance hash uses code, unit, enclosing subprogram and an ordinal. It can remain stable across unrelated edits; it is not a globally unique identifier, a source-content hash or a proof certificate. Do not join diagnostics solely on rendered wording.
Positions, labels, notes and fixes
A label is {"span": SPAN, "label": STRING}. A note is {"text": STRING, "span": SPAN_OR_NULL}. A fix is {"span": SPAN, "replacement": STRING, "description": STRING}.
A known-source span contains file (string), start, end, line, column, endLine, endColumn (integers). start/end are zero-based UTF-8 byte offsets describing [start,end); line and column are one-based decoded-text positions. They are not interchangeable with bytes or an editor's UTF-16 character offsets. An unknown-source span contains only start and end. Paths can be relative or include virtual/predefined/input names.
Validate that the document is still the version described before applying a replacement. Spans from one report do not automatically track later edits. Multiple fixes may be alternatives or overlap; do not blindly apply all edits. A proposed precondition changes caller obligations and needs specification review even if it makes proof succeed.
Counterexamples
A counterexample is {"replayed": BOOLEAN, "bindings": [BINDING, ...], "region": REGION or null}. A binding has name (string), value (VALUE), point (span or null). A scalar VALUE is a string in the diagnosed file's syntax, including bound spellings such as Integer'Last in Vada and Integer::Last in Varc; an aggregate VALUE is an array of {"choice": STRING, "value": VALUE} associations. This is a recursive value representation, not a JSON number model.
A region gives the failing inputs, as the human rendering's failing inputs line does: {"input": STRING, "exact": BOOLEAN, "parts": [PART, ...], "text": STRING}. It holds all the values of the input for which the check fails when exact is true, else a sample. A PART is {"atMost": VALUE}, {"atLeast": VALUE}, {"from": VALUE, "to": VALUE} or {"exactly": VALUE}; the parts are alternatives, and text writes them in the file's syntax.
replayed: true means the serializer classified replay as a confirmed failure or confirmed nontermination. It does not distinguish those two cases. False does not distinguish every unconfirmed/unsupported replay reason. Read the diagnostic and notes as well as the flag. Null means no counterexample was attached, not a zero-valued input.
Structured example
The following is a shape example; offsets/text are illustrative, not a captured transcript:
[
{
"code": "B4101", "name": "overflow-check", "severity": "error", "phase": "proof",
"message": "overflow check fails",
"primary": {"span": {"file": "src/main.vadb", "start": 10, "end": 15,
"line": 2, "column": 1, "endLine": 2, "endColumn": 6}, "label": "might overflow"},
"secondary": [], "notes": [], "fixes": [], "advice": null,
"counterexample": {"replayed": true, "bindings": [
{"name": "Value", "value": "Integer'Last", "point": null}
], "region": {"input": "Value", "exact": true, "parts": [{"atLeast": "Integer'Last"}],
"text": "Value >= Integer'Last"}},
"instance": null
}
]For accepted check/prove commands, exit 1 indicates errors; an array of warnings can accompany exit 0. Syntax errors are reported in the array like every other diagnostic. An invalid command line (B7003) is reported in human form on stderr, and a process that is killed or crashes produces no JSON. For build/run/emit success the diagnostic array may be followed by non-JSON output. A consumer must check invocation type and process status rather than treating any parseable prefix as the complete result.
SARIF for code scanning
--diagnostics sarif writes the same diagnostics as one SARIF 2.1.0 log on stdout, for services that read static-analysis results, such as GitHub code scanning:
veradic --diagnostics sarif prove --project verada.toml > verada.sarifThe log has one run whose tool is veradic, with its version and one rule for each code that appears (its id is the code, its name the catalog name, its short description the code's title; veradic explain CODE gives the full text). Each diagnostic is one result:
| SARIF | From the diagnostic |
|---|---|
ruleId |
code |
level |
severity: error, warning, or note for information |
message.text |
the message, then the primary label, the notes, counterexample: with its values, failing inputs: with the region, and help: with the advice, one per line |
locations |
the primary span |
relatedLocations |
the secondary spans, each with its label when it has one |
fixes |
the fix-its, each a replacement of its span's region |
Lines and columns start at 1 and columns count characters (columnKind is unicodeCodePoints), as in the JSON report. A file named by a relative path keeps it, relative to the directory veradic ran in, which is what code scanning expects when it runs at the repository's root; an absolute path becomes a file:// URI. A counterexample and its failing inputs are written into the message, as text; use the JSON report for their structure and for instance keys. A secondary span without a label has no message. The exit status is as for the JSON report.