IF Commons GitHub

versions/gate

The release gate (commons 0026-works-versioning FR-026): a harness that declares a regulated domain (0020-ifccm) releases only on the evidence tier it declares (releaseTier of its declaration), and every release records the tier it was released on.

Pure: the declaration and the tier judged (by quality tier, 0021-ifqs) are arguments, so this module imports nothing of the quality system. A regulated harness whose declaration names no releaseTier is refused; so is one whose tier was not judged or is below the declared one. A harness that declares no regulated domain is not held to a tier and the release records the tier judged, or says it was not judged.

import { releaseGate } from "./gate.ts";
releaseGate({ regulatedDomains: ["DeviceQuality"], releaseTier: "Tier2" }, "Tier1").kind; // "refused"

Source: commons/mizan/src/versions/gate.ts

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

versions.isReleaseTierfunctionno test imports it
function isReleaseTier(text: string): text is "Tier0" | "Tier1" | "Tier2"

Whether a text is a tier a harness may name.

versions.releaseGatefunctionno test imports it
function releaseGate(declaration: Declaration | undefined, judged: "Tier0" | "Tier1" | "Tier2" | undefined): GateOutcome

The gate: a regulated harness releases only at the tier it declares or above, and one that declares none, or whose tier was not judged, is refused (FR-026).

versions.tierAtLeastfunctionno test imports it
function tierAtLeast(judged: "Tier0" | "Tier1" | "Tier2", declared: "Tier0" | "Tier1" | "Tier2"): boolean

Whether judged is at least declared.

versions.GateOutcometypeno test imports it
type GateOutcome =
  | {
      readonly kind: "allowed";
      /** The tier the release records: the tier judged, or undefined where none was. */ readonly tier: ReleaseTier | undefined;
    }
  | { readonly kind: "refused"; readonly reason: string };

What the gate says of a release.

isReleaseTierfunction
function isReleaseTier(text: string): text is "Tier0" | "Tier1" | "Tier2"

Whether a text is a tier a harness may name.

Imported by 19 tests of the run (19 passed, 0 failed): the library's results

releaseGatefunction
function releaseGate(declaration: Declaration | undefined, judged: "Tier0" | "Tier1" | "Tier2" | undefined): GateOutcome

The gate: a regulated harness releases only at the tier it declares or above, and one that declares none, or whose tier was not judged, is refused (FR-026).

Imported by 19 tests of the run (19 passed, 0 failed): the library's results

tierAtLeastfunctionno test imports it
function tierAtLeast(judged: "Tier0" | "Tier1" | "Tier2", declared: "Tier0" | "Tier1" | "Tier2"): boolean

Whether judged is at least declared.

GateOutcometypeno test imports it
type GateOutcome =
  | {
      readonly kind: "allowed";
      /** The tier the release records: the tier judged, or undefined where none was. */ readonly tier: ReleaseTier | undefined;
    }
  | { readonly kind: "refused"; readonly reason: string };

What the gate says of a release.

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