The canonical record of a run (commons 0001-quality-evidenceFR-018 to FR-020, FR-025): the record of 0008-test-evidence (one OTLP/JSON document, a test span and a log record for each case) extended with what the quality system adds, and read back through the same decoders.
canonicalize takes the document a run assembled (assembleRecord) and returns the file to keep: the body of each case's log record is a CTRF test object (FR-018), a case that never started is a log record with the outcome not_run and its reason (FR-013, FR-019), each case carries its grade (FR-014), every resource carries ifc.quality.previous.sha256 (FR-022), and every text is redacted and names no person (FR-025).
readQuality reads a file back into a QualityRecord: the model of 0008 (TestRun, five outcomes) and, beside it, every case with its outcome, not_run included, its grade and, for a check's case, its rule and line.
checkRun makes the record of a check of Mizan (FR-020): each rule a case, each finding a failed case with its rule id, file and line.
type QualityCase = {
readonly id: string;
/** Its file, relative to the working folder, with `/`. */
readonly file…(926 characters)
typeQualityCase= {
readonlyid:string;
/** Its file, relative to the working folder, with `/`. */readonlyfile:string;
readonlyname:string;
readonlyrequirements:readonlystring[];
readonlyrisk:Risk;
readonlycharacteristic?:string;
readonlyoutcome:QualityOutcome;
/** A skip's, a todo's or a cancellation's reason, and why a case did not run (FR-019). */readonlyreason?:string;
readonlymessage?:string;
readonlyexpected?:string;
readonlyactual?:string;
readonlyattempt:number;
readonlystart:bigint;
readonlyend:bigint;
/** The runtime it ran on; `none` for a case that did not run. */readonlyruntime:string;
/** What the case is worth (FR-014, FR-026). */readonlygrade:Grade;
/** The rule of a check that the case reports (FR-020). */readonlyrule?:string;
/** The line of its file a finding points to (FR-020). */readonlyline?:number;
};
One case of a run, whatever became of it: a test of 0008-test-evidence, a case that did not run, or a check's rule or finding.
type QualityRecord = {
readonly traceId: string;
/** The model of 0008-test-evidence over the same file: the cases t…(567 characters)
typeQualityRecord= {
readonlytraceId:string;
/** The model of 0008-test-evidence over the same file: the cases that ran. */readonlyrun:TestRun;
/** Every case, in a stable order: what ran as the model orders it, then what did not run by file and name. */readonlycases:readonlyQualityCase[];
readonlycounts:QualityCounts;
/** The grade the file claims for itself (FR-014). */readonlygrade:Grade;
/** The SHA-256 of the evidence file before this one (FR-022); none where the file is not yet chained. */readonlyprevious?:Sha256;
};
typeNotRun= {
/** The requirements it would have proved. */readonlyrequirements:readonlystring[];
/** The case's name, or the requirement's id where only a requirement was planned. */readonlyname:string;
/** Its file, or `plan` where there is none. */readonlyfile?:string;
readonlyreason:string;
readonlyrisk?:Risk;
readonlyrule?:string;
};
A case, check or requirement that was planned and did not run, with the reason (FR-013).
A record read into the model of the quality system (FR-018): through the decoders of 0006-signals and the model of 0008-test-evidence (input is the file's text, or its JSON parsed), then the cases that did not run, each case's grade, rule and line, the grade of the file, and its link in the chain.
type CanonicalInput = {
/** The run's document as 0008-test-evidence assembles it (`assembleRecord`), or its text. */
…(589 characters)
typeCanonicalInput= {
/** The run's document as 0008-test-evidence assembles it (`assembleRecord`), or its text. */readonlyrecord:unknown;
/** The SHA-256 of the evidence file before this one, or none for the first (FR-022). */readonlyprevious?:Sha256;
/** What was planned and did not run (FR-013). */readonlynotRun?:readonlyNotRun[];
/** Facts about the run that every resource of the record carries besides the installation (a command and its options, a plan's hash): the check of another system names its own. */readonlyresourceAttributes?:Attributes;
};
The file to keep for a run (FR-018, FR-022, FR-025): the same OTLP/JSON document with each case's log record bodied as a CTRF test object and carrying its grade, a log record for each case that did not run, ifc.quality.previous.sha256 on every resource, every text redacted of secrets and e-mail addresses, and nothing that names a person (a refusal). Reading the text gives back the record.
type CheckInput = {
/** The check's name (`mizan`, `changes`). */
readonly tool: string;
readonly rules: readonly …(813 characters)
typeCheckInput= {
/** The check's name (`mizan`, `changes`). */readonlytool:string;
readonlyrules:readonlyCheckRule[];
readonlytraceId:TraceId;
readonlyspanId:SpanId;
/** A span id for each case, in order: one per rule that ran clean and one per finding; the caller supplies them (a host makes them). */readonlycaseIds:readonlySpanId[];
readonlystart:bigint;
readonlyend:bigint;
readonlyrunner:Installation;
/** The requirements the check proves, which each case names. */readonlyrequirements?:readonlystring[];
/** Facts about the run that the resource of the record carries besides the installation (a command and its options, a plan's hash, the version of each tool): a check of another system names its own. */readonlyresourceAttributes?:Attributes;
};
What checkRun is given: the check, its rules and the run's ids, times and installation.
The record of a check of Mizan (0001-quality-evidenceFR-020): each rule a case, each finding a failed case with its rule id, file and line, so that its findings render as SARIF results. A rule that ran and found nothing is a pass; each finding is a fail; a rule that could not run (a plain Git host cannot answer the strict rules of the changes check) is a case that is not_run with its reason, never a pass.