The contract files
The files under schema/ that a program written in another language reads: the structure of a config, of a result and its public view, of a line of --progress json and of a panel suite, as JSON Schema, and the inert-text vectors, the hostile inputs a port of quorum's display is tested against. They are generated from the code, the schemas from the zod schemas the code checks with, committed, and attached to every release beside the binaries. This page says what each file describes, what a schema leaves to code, the format of the vectors, and how to check a file you downloaded.
The files
| File | Describes | Generated from |
|---|---|---|
schema/quorum.schema.json | A YAML or JSON config, for the editors that read a schema: A config file | configFileSchema, src/config/schema.ts |
schema/result.schema.json | A result, as a review writes it and readResult reads it: The JSON result | resultSchema, src/core/result-schema.ts |
schema/public-view.schema.json | The public view of a result, which every public sink renders and which readResult reads too, told apart by meta.view | publicViewSchema, src/core/result-schema.ts |
schema/progress.schema.json | One line of --progress json: an event of the review, of any type of the events, or a cli:line | progressLineSchema, src/core/event-schema.ts |
schema/panel-suite.schema.json | A panel suite's suite.yaml, as quorum bench reads it: Panel suites | panelSuiteSchema, src/bench/panel.ts |
schema/inert-text.vectors.json | Hostile inputs and what showHidden, inertLine and inertPlain make of each, which a port of quorum's display is tested against: The vectors | INERT_TEXT_INPUTS, src/core/inert-vectors.ts |
bun run schema writes every file of the table from the code, and a test of the suite fails a committed file that differs from what the code writes, byte for byte, and a file in schema/ the table does not list. So a file is never stale: it is what the commit's code writes. Each is written as inertJson writes a result, with every character above U+007E escaped, so each file is ASCII and none holds a raw hidden character.
Each schema is draft-07, the draft every validator of the ecosystem reads, and the input side of its zod schema: the shape of the file as it is written, never a value the code reads out of it. Every schema but the config's opens with $schema, title and description, in that order. The description says the schema is structural and names this page. The vectors' file is data and no schema: it opens with its format, as The inert-text vectors says.
Where a release attaches them
A release lists every file of the table beside its binaries, flat, and SHA256SUMS lists them after the binaries. The CD attests each with the binaries, so a contract is checked as a binary is. Download the files you read, with the checksums, replacing <version> with the release's version:
gh release download v<version> --repo this-is-tobi/quorum --pattern result.schema.json --pattern public-view.schema.json --pattern SHA256SUMSCheck them against the checksums, with the sha256sum of GNU coreutils (shasum -a 256 on macOS), where --ignore-missing leaves out the files you did not download:
sha256sum -c SHA256SUMS --ignore-missingThe checksums come from the same release as the files, so they catch a damaged download and not a swapped one. The attestation of a file does: it is a signed record that GitHub Actions in this repository built that file.
gh attestation verify result.schema.json --repo this-is-tobi/quorumA file names no release: the release's version is set after the files are committed. Keep the files of each release you read results of, and read a result with the files of the release its meta.version names. readResult refuses a result of any other release, as The JSON result says. A release binary covers the binaries the same way.
What a schema says
A schema states structure: the type of each field, the fields an object requires, the closed lists a value belongs to, the pattern of an id, a hash, a commit or a function's name, and a string's most characters. It is strict: additionalProperties is false wherever a file names an object's fields, so a key the code does not write is refused, in meta and in a verdict as at the top. A result and a public view differ by what the view withholds, and each file refuses the other's fields, so a full result read as a view fails, and a view read as a full result fails too.
A verdict's function, the name of the function around the cited row, is a string of the pattern ^[A-Za-z_$][\w$]{2,63}$ in both schemas: 3 to 64 characters of a letter, a digit, _ or $, not starting with a digit, the bounds of the names related code looks up. \w is [0-9A-Za-z_], as RE2 and ECMAScript read it, and the pattern is anchored. The key is optional: A verdict says when it is absent.
A progress line is a union, as the line is: one strict object for each type of event, told apart by type, and the cli:line object, whose level is one of warning, banner, estimate, notice and error. A line of a type this release does not write matches none of them and is refused, as a line of a later release may be: JSON lines says what a reader does then. Every count and every duration is a whole number from 0, the core having rounded it, but the numbers of a usage, in a call event as in a result: its token counts and its cost are numbers from 0, not whole numbers. Each profile id an event holds, a profile, an entry of run:start's profiles and a key of its providers and its relatedCode.lenses or of a context event's rules, matches the pattern of a profile id; a findingId is 12 hexadecimal digits, the id a verdict holds, and so is the finding that a vote's call:start and call events name; the commit a run:start event names related code at is a full commit id, as in a result. The model a call event names is at most 100 characters. A panel suite's file is one strict object, with each case and each finding strict too.
One record is open: a provider's settings, meta.settings.providers.<id>. The schema says it is an object whose keys are strings of at most 4096 characters, and leaves its values open (additionalProperties: {}), since code checks each field one by one, as the next section says. A schema holds no order of keys either: the order The JSON result lists is the order the core writes, and no validator checks it.
What code checks
A JSON Schema cannot hold these rules, so a document the schema accepts can still be one quorum refuses. readResult reads a result or a public view whole, and quorum bench --dry-run reads a panel suite whole: a program that needs the full check calls the one that reads its document. A progress line is read one at a time, and its few rules are listed with it.
A result and a public view
These are the checks src/core/result-schema.ts makes beyond the structure, and the one readResult makes before it:
- The release.
readResultrefuses a result whosemeta.versionis another release's, before it reads the shape. The schema takes any string asmeta.version, so a result of another release that has this release's structure passes it. - Every verdict and every gap names a profile of the result. Each verdict of
kept,discardedandunreviewed, and each entry ofmeta.incomplete, has aprofilethat is a key ofmeta.profiles. - A kept verdict alone has a confidence. The schema makes
confidenceoptional in every verdict. A kept verdict holds one, and a discarded or an unreviewed verdict holds none. - A scanner's verdict names a report of its profile. A verdict whose
foundBy.kindisscannerhas afoundBy.reportthat is the place of a record ofmeta.context.reportsread for the verdict's own profile. - A public view lists the scanner's discarded verdicts alone. The finder's discarded findings are withheld from the view and counted, so each verdict of the view's
discardedis a scanner's. - A source's ids. The ids of a
range,local,stagedorpathssource are full commit ids of the source'sobjectFormat: 40 lowercase hexadecimal digits forsha1and 64 forsha256, and alocalorstagedsource'sheadmay benull. The schema says only that each is a string. - A context document's origin, status and kind. A document of origin
repositoryhas apathand acommit, and no other origin has either. A document that ismissinghas no bytes and no hash. A document of kindrulesholdsrules, its count of rules, which is 0 when the document is missing, and no other kind holdsrules. - A context report's fields by its kind. A report of format
lcov, a coverage report, holdslinesand neitherprofilenorissues, and no other report holdslines. - At least one profile.
meta.profilesholds an entry for each profile the review ran, so it is never empty. - Each field of a provider's record. The record holds only the fields a review records of a provider, each in its shape, and a field outside the list is refused: no base URL, no origin, no command, no argument and no key, and a header's or a query's value is the word
[redacted]. - An
extraBody's values. Each entry of a provider'sextraBodyholds at most 64 values, each object and array counted as one, and each string of one, a key too, is at most 64 code points. - The entries of a record.
meta.settings.providers,meta.settings.profiles, a provider's record, itsheaders, itsquery, itsextraBodyand each object inside it, and a profile'slensesandreplyTokens.voteseach hold at most 256 entries. A list's 256 ismaxItems, which the schema holds. - Code points, not UTF-16 units.
maxLengthcounts code points, where zod counts the UTF-16 units of a string, a character outside the Basic Multilingual Plane being two. So a string of characters outside that plane, emoji for instance, may pass a schema at a lengthreadResultrefuses, since it holds the string to the bound in units. A string the code bounds in code points, anextraBody's, carries nomaxLength.
A progress line
src/core/event-schema.ts refines no event of its own. Three things stay outside the schema:
- A context event's documents and reports. The
contextevent holds the record a result'smeta.contextholds, whose two rules the schema cannot state: a document's origin, status and kind, and a report's fields by its format, as the result's list above says them. - Code points, not UTF-16 units. The 100 characters of a
callevent'smodelare counted as the result's strings are: a schema counts code points and quorum counts UTF-16 units, so a model name of characters outside the Basic Multilingual Plane may pass the schema at a length quorum never writes. - What one line says of another. A schema reads one line alone. That
callevents carry the number of theircall:start, that apartfollows itsrecoveredand thatrun:endcomes last are no part of it.
A panel suite
The checks src/bench/panel.ts and src/bench/suite.ts make beyond the structure, each naming the file and the case by its index, all at once:
- The file.
suite.yamlis a regular file of at most 1 MiB and one YAML 1.2 document of the core schema, with no repeated key, alias or YAML 1.1 tag, plain data at most 64 keys deep and 10 000 values, with no__proto__key. The schema reads the data after that: itsdateis a string, so a YAML 1.1 reader that turns2026-07-14into a date hands it a value it refuses. - A case's change. It holds exactly one of
rangeandpaths, and arangeis never the case's owncommit. Each path is relative, with no empty,.or..segment. - A case's labels.
refutedBybelongs to a false case alone, andlabelSource: advisory, which names a true finding, to a true case alone. - A case's texts.
dateis a real day writtenYYYY-MM-DD, andrepoanhttps://URL of the formhttps://<host>/<owner>/<name>of at most 200 characters, with no credentials, port, query or fragment. Anote, a finding'sfile,categoryandclaimare one line of visible text, with no hidden character. - A location. A
refutedBylocation starts at or before its end and spans at most 500 lines. - Code points, not UTF-16 units. The
maxLengthof anote, of a finding'sfile,categoryandclaimand of arefutedBylocation'sfilecounts code points, where--dry-runcounts the UTF-16 units of a string, a character outside the Basic Multilingual Plane being two. So a text of such characters, emoji for instance, may pass the schema at a length--dry-runrefuses. - Unique ids. Each case's
iddiffers from every other's in the suite.
quorum bench --dry-run adds the checks that read a clone and each configuration, so a suite the schema accepts is not yet one a run accepts: each case's clone and the change it names, the finding's file as a section of the change and its line as a row of a hunk, each refuting file at the read commit with the lines the location names, the changes read being at most 64 MiB in all, and each configuration running the profile of every finding and passing the estimate of judging it. Panel suites lists them with the messages they give.
The inert-text vectors
schema/inert-text.vectors.json is one object, its keys in this order:
| Key | Holds |
|---|---|
format | quorum-inert-text/1, the format of the file. A reader checks it first and reads no other |
hiddenClass | The body of quorum's hidden class (HIDDEN_CLASS of src/core/sanitize.ts), for a character class under the u flag: \p{Cc}\p{Cf}\p{Cs}\p{Default_Ignorable_Code_Point}\p{Zl}\p{Zp} |
plainMax | 1000, the cap in code points that inertPlain applies when a vector states no max |
vectors | The vectors, in the order the file lists them |
Each vector is an object, its keys in this order:
| Key | Holds |
|---|---|
name | The input's name in kebab case, unique in the file |
input | The text, a JSON string in which every hidden character and every character above U+007E is an escape, so the file holds none raw |
wellFormed | true when input is well-formed UTF-16, false for a lone surrogate: a port whose strings are UTF-8 skips a vector that is false |
max | The cap inertPlain is called with, present only in a vector that states one |
showHidden | What showHidden makes of input |
inertLine | What inertLine makes of input |
inertPlain | What inertPlain makes of input, called with max when the vector has one, else with its default |
A vector is what the three functions make of its input in the release that generated the file, never a value written by hand. The vectors says what they pin, how a port reads them and which Unicode versions they hold.
Related
- The JSON result — every field of a result and of its public view, in the order they are written.
- Output handling — the inert-text vectors: what they pin and how a port is held to them.
- Library API —
readResult, the reader that makes the checks this page lists. - Architecture — how the CD builds, attaches and attests the files.
- Installation — downloading and checking a release's files.
