IF Commons GitHub

pure/tier2-events

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0001-quality-evidence FR-041

The events of Tier 2 of the quality system (commons 0001-quality-evidence FR-041 to FR-044), kept in the ledger beside those of Tier 1 as append-only, chained files on the quality branch: a test plan registered before the run it governs, a sample drawn by a rule and a seed, a person's attestation of that sample, and a mutation run.

  • A plan (plan-registered) names its cases and the acceptance criterion of each; a run that follows it records the plan's hash.
  • A sample (sample-drawn) is chosen from a population by a named rule and a recorded seed, so that anyone can draw it again and get the same items; a person's attestation (sample-attested) gives the verdict on each item, with the person's name and role.
  • A mutation run (mutation-run) is the record of a run made by a tool the record names; this system does not run it.

Only decoders and types here, so that pure/ledger.ts can take them into its union of events without a cycle: the rules that judge them are in the files beside this one. The person in a record is data: a name and, where stated, a role, never inferred from anything else.

Source: commons/quality/src/pure/tier2-events.ts

0 of 11 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

personDecoderconstno test imports it
const personDecoder: Decoder<ObjectOf<{ name: Decoder<string>; }, { role: Decoder<string>; }>>

A named person and, where stated, the role they act in: what a record says of who, and nothing more.

PersonReftypeno test imports it
type PersonRef = Decoded<typeof personDecoder>;

A person as a record names them.

planCaseDecoderconstno test imports it
const planCaseDecoder: Decoder<ObjectOf<{ name: Decoder<string>; requirements: Decoder<readonly Brand<string, "RequirementId">[]>; acceptance: Decoder<string>; }, { file: Decoder<string>; }>>

One case of a test plan: its name, the requirements it proves and the criterion that makes it pass (FR-042).

planDecoderconstno test imports it
const planDecoder: Decoder<ObjectOf<{ title: Decoder<string>; cases: Decoder<readonly ObjectOf<{ name: Decoder<string>; requirements: Decoder<readonly Brand<string, "RequirementId">[]>; acceptance: Decoder<string>; }, { file: Decoder<string>; }>[]>; }, Record<never, never>>>

A test plan: what will be run, written down before it is run (FR-042).

TestPlantypeno test imports it
type TestPlan = Decoded<typeof planDecoder>;

A test plan as the record holds it.

SAMPLE_SUBJECTSconstno test imports it
const SAMPLE_SUBJECTS: readonly ["runs", "records", "agent-reviews"]

What a sample is drawn from.

SampleSubjecttypeno test imports it
type SampleSubject = (typeof SAMPLE_SUBJECTS)[number];

What a sample is drawn from: the runs kept as evidence, the files of the ledger, or the reviews that agents made (FR-044).

SAMPLE_RULEconstno test imports it
const SAMPLE_RULE: "hash-ranked/1"

The rule that chooses a sample: the items ranked by the SHA-256 of the seed and the item, the first of them taken.

mutationRowDecoderconstno test imports it
const mutationRowDecoder: Decoder<ObjectOf<{ requirement: Decoder<Brand<string, "RequirementId">>; mutants: Decoder<number>; killed: Decoder<number>; survived: Decoder<number>; }, { timeout: Decoder<number>; noCoverage: Decoder<number>; equivalent: Decoder<number>; }>>

One row of a mutation run: the mutants made for a requirement's tests and what became of each (FR-043).

MutationRowtypeno test imports it
type MutationRow = Decoded<typeof mutationRowDecoder>;

A row of a mutation run.

TIER2_EVENTSconstno test imports it
const TIER2_EVENTS: { readonly "plan-registered": Decoder<ObjectOf<{ kind: Decoder<"plan-registered">; id: Decoder<strin… (1907 characters)
const TIER2_EVENTS: { readonly "plan-registered": Decoder<ObjectOf<{ kind: Decoder<"plan-registered">; id: Decoder<string>; plan: Decoder<ObjectOf<{ title: Decoder<string>; cases: Decoder<readonly ObjectOf<{ name: Decoder<string>; requirements: Decoder<readonly Brand<string, "RequirementId">[]>; acceptance: Decoder<string>; }, { file: Decoder<string>; }>[]>; }, Record<never, never>>>; by: Decoder<ObjectOf<{ name: Decoder<string>; }, { role: Decoder<string>; }>>; day: Decoder<Day>; }, Record<never, never>>>; readonly "sample-drawn": Decoder<ObjectOf<{ kind: Decoder<"sample-drawn">; id: Decoder<string>; subject: Decoder<"agent-reviews" | "records" | "runs">; rule: Decoder<"hash-ranked/1">; seed: Decoder<string>; population: Decoder<ObjectOf<{ count: Decoder<number>; sha256: Decoder<Brand<string, "Sha256">>; }, Record<never, never>>>; size: Decoder<number>; items: Decoder<readonly string[]>; by: Decoder<ObjectOf<{ name: Decoder<string>; }, { role: Decoder<string>; }>>; day: Decoder<Day>; }, { ratePermille: Decoder<number>; }>>; readonly "sample-attested": Decoder<ObjectOf<{ kind: Decoder<"sample-attested">; sample: Decoder<string>; results: Decoder<readonly ObjectOf<{ item: Decoder<string>; verdict: Decoder<"fail" | "pass">; }, { note: Decoder<string>; }>[]>; person: Decoder<ObjectOf<{ name: Decoder<string>; }, { role: Decoder<string>; }>>; day: Decoder<Day>; }, {}>>; readonly "mutation-run": Decoder<ObjectOf<{ kind: Decoder<"mutation-run">; id: Decoder<string>; tool: Decoder<ObjectOf<{ name: Decoder<string>; }, { version: Decoder<string>; }>>; revision: Decoder<string>; results: Decoder<readonly ObjectOf<{ requirement: Decoder<Brand<string, "RequirementId">>; mutants: Decoder<number>; killed: Decoder<number>; survived: Decoder<number>; }, { timeout: Decoder<number>; noCoverage: Decoder<number>; equivalent: Decoder<number>; }>[]>; day: Decoder<Day>; }, Record<never, never>>>; }

The events of Tier 2, as decoders by kind: the ledger puts them in its union.

Titles, headings, exports, tables, columns and requirements. Esc closes.