governance.Valuetypeno test imports ittype Value = string | number | boolean | readonly string[];An attribute value: a plain value or a list of text.
The vocabulary of a policy gate (0002-policy-gate FR-001 to FR-003): the subjects of a change (an asset, a cloud resource, an endpoint, a file) with their attributes as plain values; a rule, which is a function from a subject to the problems it has, with an id, a title, a severity and what it applies to; a waiver, which a person grants for a rule and a subject, for a reason and until an instant; and the verdict.
import { SEVERITIES } from "./model.ts";
SEVERITIES; // ["block", "warn"]governance.Valuetypeno test imports ittype Value = string | number | boolean | readonly string[];An attribute value: a plain value or a list of text.
governance.Subjecttypeno test imports ittype Subject = { readonly id: string; readonly kind: string; readonly attributes: Readonly<Record<string, Value>> };A thing a change touches.
governance.Changetypeno test imports ittype Change = { readonly before: readonly Subject[]; readonly after: readonly Subject[] };A change: the subjects as they were and as they will be (a subject only in after is added, only in before removed).
governance.SEVERITIESconstno test imports itconst SEVERITIES: readonly ["block", "warn"]Whether a rule stops a change or only says so.
governance.Severitytypeno test imports ittype Severity = (typeof SEVERITIES)[number];A severity.
governance.Problemtypeno test imports ittype Problem = { readonly message: string; readonly attribute?: string };One problem a rule finds in a subject.
governance.Ruletypeno test imports ittype Rule = {
readonly id: string;
readonly title: string;
readonly severity: Severity;
/** The kinds of subject it applies to (every kind where absent). */
readonly kinds?: readonly string[];
/** The controls (of any framework, by their identifiers) the rule gives evidence for. */
readonly controls?: readonly string[];
readonly check: (subject: Subject) => readonly Problem[];
};A rule of a policy.
governance.Waivertypeno test imports ittype Waiver = { readonly rule: string; readonly subject: string; readonly reason: string; readonly by: string; readonly until: string };A waiver: a person lets a subject break a rule, for a reason, until an instant.
governance.Violationtypeno test imports ittype Violation = { readonly rule: string; readonly title: string; readonly severity: Severity; readonly subject: string; readonly message: string; readonly controls: readonly string[]; readonly waived?: Waiver };A violation: a rule broken by a subject.
governance.Verdicttypeno test imports ittype Verdict = {
/** Whether the change may go on: no violation that blocks and is not waived. */
readonly pass: boo… (420 characters)type Verdict = {
/** Whether the change may go on: no violation that blocks and is not waived. */
readonly pass: boolean;
readonly blocking: readonly Violation[];
readonly warnings: readonly Violation[];
readonly waived: readonly Violation[];
/** Waivers that were not used because they have expired, or that no violation needed. */
readonly unusedWaivers: readonly Waiver[];
readonly checked: number;
};The verdict of a gate.
Valuetypeno test imports ittype Value = string | number | boolean | readonly string[];An attribute value: a plain value or a list of text.
Subjecttypetype Subject = { readonly id: string; readonly kind: string; readonly attributes: Readonly<Record<string, Value>> };A thing a change touches.
Changetypeno test imports ittype Change = { readonly before: readonly Subject[]; readonly after: readonly Subject[] };A change: the subjects as they were and as they will be (a subject only in after is added, only in before removed).
SEVERITIESconstno test imports itconst SEVERITIES: readonly ["block", "warn"]Whether a rule stops a change or only says so.
Severitytypeno test imports ittype Severity = (typeof SEVERITIES)[number];A severity.
Problemtypeno test imports ittype Problem = { readonly message: string; readonly attribute?: string };One problem a rule finds in a subject.
Ruletypetype Rule = {
readonly id: string;
readonly title: string;
readonly severity: Severity;
/** The kinds of subject it applies to (every kind where absent). */
readonly kinds?: readonly string[];
/** The controls (of any framework, by their identifiers) the rule gives evidence for. */
readonly controls?: readonly string[];
readonly check: (subject: Subject) => readonly Problem[];
};A rule of a policy.
Waivertypetype Waiver = { readonly rule: string; readonly subject: string; readonly reason: string; readonly by: string; readonly until: string };A waiver: a person lets a subject break a rule, for a reason, until an instant.
Violationtypeno test imports ittype Violation = { readonly rule: string; readonly title: string; readonly severity: Severity; readonly subject: string; readonly message: string; readonly controls: readonly string[]; readonly waived?: Waiver };A violation: a rule broken by a subject.
Verdicttypeno test imports ittype Verdict = {
/** Whether the change may go on: no violation that blocks and is not waived. */
readonly pass: boo… (420 characters)type Verdict = {
/** Whether the change may go on: no violation that blocks and is not waived. */
readonly pass: boolean;
readonly blocking: readonly Violation[];
readonly warnings: readonly Violation[];
readonly waived: readonly Violation[];
/** Waivers that were not used because they have expired, or that no violation needed. */
readonly unusedWaivers: readonly Waiver[];
readonly checked: number;
};The verdict of a gate.