Skip to content

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 ​

FileDescribesGenerated from
schema/quorum.schema.jsonA YAML or JSON config, for the editors that read a schema: A config fileconfigFileSchema, src/config/schema.ts
schema/result.schema.jsonA result, as a review writes it and readResult reads it: The JSON resultresultSchema, src/core/result-schema.ts
schema/public-view.schema.jsonThe public view of a result, which every public sink renders and which readResult reads too, told apart by meta.viewpublicViewSchema, src/core/result-schema.ts
schema/progress.schema.jsonOne line of --progress json: an event of the review, of any type of the events, or a cli:lineprogressLineSchema, src/core/event-schema.ts
schema/panel-suite.schema.jsonA panel suite's suite.yaml, as quorum bench reads it: Panel suitespanelSuiteSchema, src/bench/panel.ts
schema/inert-text.vectors.jsonHostile inputs and what showHidden, inertLine and inertPlain make of each, which a port of quorum's display is tested against: The vectorsINERT_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:

bash
gh release download v<version> --repo this-is-tobi/quorum --pattern result.schema.json --pattern public-view.schema.json --pattern SHA256SUMS

Check 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:

bash
sha256sum -c SHA256SUMS --ignore-missing

The 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.

bash
gh attestation verify result.schema.json --repo this-is-tobi/quorum

A 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. readResult refuses a result whose meta.version is another release's, before it reads the shape. The schema takes any string as meta.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, discarded and unreviewed, and each entry of meta.incomplete, has a profile that is a key of meta.profiles.
  • A kept verdict alone has a confidence. The schema makes confidence optional 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.kind is scanner has a foundBy.report that is the place of a record of meta.context.reports read 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 discarded is a scanner's.
  • A source's ids. The ids of a range, local, staged or paths source are full commit ids of the source's objectFormat: 40 lowercase hexadecimal digits for sha1 and 64 for sha256, and a local or staged source's head may be null. The schema says only that each is a string.
  • A context document's origin, status and kind. A document of origin repository has a path and a commit, and no other origin has either. A document that is missing has no bytes and no hash. A document of kind rules holds rules, its count of rules, which is 0 when the document is missing, and no other kind holds rules.
  • A context report's fields by its kind. A report of format lcov, a coverage report, holds lines and neither profile nor issues, and no other report holds lines.
  • At least one profile. meta.profiles holds 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's extraBody holds 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, its headers, its query, its extraBody and each object inside it, and a profile's lenses and replyTokens.votes each hold at most 256 entries. A list's 256 is maxItems, which the schema holds.
  • Code points, not UTF-16 units. maxLength counts 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 length readResult refuses, since it holds the string to the bound in units. A string the code bounds in code points, an extraBody's, carries no maxLength.

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 context event holds the record a result's meta.context holds, 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 call event's model are 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 call events carry the number of their call:start, that a part follows its recovered and that run:end comes 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.yaml is 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: its date is a string, so a YAML 1.1 reader that turns 2026-07-14 into a date hands it a value it refuses.
  • A case's change. It holds exactly one of range and paths, and a range is never the case's own commit. Each path is relative, with no empty, . or .. segment.
  • A case's labels. refutedBy belongs to a false case alone, and labelSource: advisory, which names a true finding, to a true case alone.
  • A case's texts. date is a real day written YYYY-MM-DD, and repo an https:// URL of the form https://<host>/<owner>/<name> of at most 200 characters, with no credentials, port, query or fragment. A note, a finding's file, category and claim are one line of visible text, with no hidden character.
  • A location. A refutedBy location starts at or before its end and spans at most 500 lines.
  • Code points, not UTF-16 units. The maxLength of a note, of a finding's file, category and claim and of a refutedBy location's file counts code points, where --dry-run counts 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-run refuses.
  • Unique ids. Each case's id differs 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:

KeyHolds
formatquorum-inert-text/1, the format of the file. A reader checks it first and reads no other
hiddenClassThe 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}
plainMax1000, the cap in code points that inertPlain applies when a vector states no max
vectorsThe vectors, in the order the file lists them

Each vector is an object, its keys in this order:

KeyHolds
nameThe input's name in kebab case, unique in the file
inputThe text, a JSON string in which every hidden character and every character above U+007E is an escape, so the file holds none raw
wellFormedtrue 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
maxThe cap inertPlain is called with, present only in a vector that states one
showHiddenWhat showHidden makes of input
inertLineWhat inertLine makes of input
inertPlainWhat 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.

  • 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.

Released under the MIT License.