logical.FreshnessStatetypeno test imports ittype FreshnessState = "fresh" | "due" | "stale";The three states of freshness.
The pure computations of the logical layer (0003-grc-logical): freshness, drift, change impact, coverage, roll-up scoring, the application of exceptions and the level of a risk. The time is always a parameter, and every result is the same for any order of its inputs.
import { freshness } from "./compute.ts";
freshness("2026-01-01T00:00:00Z", "P30D", "2026-02-05T00:00:00Z"); // stalelogical.FreshnessStatetypeno test imports ittype FreshnessState = "fresh" | "due" | "stale";The three states of freshness.
logical.Freshnesstypeno test imports ittype Freshness = { readonly state: FreshnessState; readonly dueAt: string | undefined };How fresh something is.
logical.freshnessfunctionno test imports itfunction freshness(newest: string | undefined, duration: string, now: string): Result<Freshness, string>The freshness of the newest observation at now: due within a tenth of the duration of its end, stale past it, and stale for none.
logical.Drifttypeno test imports ittype Drift = {
readonly added: readonly string[];
readonly removed: readonly string[];
readonly changed: readonly { readonly key: string; readonly path: string; readonly declared: Json | undefined; readonly observed: Json | undefined }[];
};What changed between two views of keyed records.
logical.driftfunctionno test imports itfunction drift(declared: Readonly<Record<string, Json>>, observed: Readonly<Record<string, Json>>): DriftWhat was added, removed and changed from what is declared to what is observed, in key order; a change names the path of the field and both values.
logical.newestResultsfunctionno test imports itfunction newestResults(results: readonly (Document & { readonly check: string; readonly controls: readonly string[]; rea… (1259 characters)function newestResults(results: readonly (Document & { readonly check: string; readonly controls: readonly string[]; readonly subject: string; readonly status: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"; readonly severity: "critical" | "high" | "info" | "low" | "medium"; readonly reason: string; readonly observedAt: string; } & { readonly value?: Json | undefined; readonly via?: string | undefined; readonly policy?: string | undefined; readonly exception?: string | undefined; readonly was?: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn" | undefined; })[]): readonly (Document & { readonly check: string; readonly controls: readonly string[]; readonly subject: string; readonly status: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"; readonly severity: "critical" | "high" | "info" | "low" | "medium"; readonly reason: string; readonly observedAt: string; } & { readonly value?: Json | undefined; readonly via?: string | undefined; readonly policy?: string | undefined; readonly exception?: string | undefined; readonly was?: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn" | undefined; })[]The newest result for each check and subject (by time, then by id).
logical.applyExceptionsfunctionno test imports itfunction applyExceptions(results: readonly (Document & { readonly check: string; readonly controls: readonly string[]; r… (1832 characters)function applyExceptions(results: readonly (Document & { readonly check: string; readonly controls: readonly string[]; readonly subject: string; readonly status: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"; readonly severity: "critical" | "high" | "info" | "low" | "medium"; readonly reason: string; readonly observedAt: string; } & { readonly value?: Json | undefined; readonly via?: string | undefined; readonly policy?: string | undefined; readonly exception?: string | undefined; readonly was?: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn" | undefined; })[], exceptions: readonly (Document & { readonly excuses: ObjectOf<{ type: Decoder<"check" | "control" | "policy">; ref: Decoder<string>; }, Record<never, never>>; readonly subjects: readonly string[]; readonly reason: string; readonly approvedBy: string; readonly grantedAt: string; readonly expiresAt: string; } & { readonly acceptedRisk?: ObjectOf<{ owner: Decoder<string>; level: Decoder<"high" | "low" | "moderate" | "very-high" | "very-low">; reviewBy: Decoder<string>; }, Record<never, never>> | undefined; readonly inheritable?: boolean | undefined; })[], at: string): readonly (Document & { readonly check: string; readonly controls: readonly string[]; readonly subject: string; readonly status: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"; readonly severity: "critical" | "high" | "info" | "low" | "medium"; readonly reason: string; readonly observedAt: string; } & { readonly value?: Json | undefined; readonly via?: string | undefined; readonly policy?: string | undefined; readonly exception?: string | undefined; readonly was?: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn" | undefined; })[]Results with the exceptions that apply at at applied: fail and warn become accepted (the exception's id kept, the old status in was); error, gap and pending do not.
logical.ImpactDeclarationtypeno test imports ittype ImpactDeclaration = { readonly paths: readonly string[]; readonly controls: readonly string[] };A declaration that a change to some paths bears on controls.
logical.ImpactReasontypeno test imports ittype ImpactReason = { readonly control: string; readonly path: string; readonly status: Status; readonly resolvedBy?: "exception" | "approval"; readonly exception?: string };Why a change is blocked, or what let it pass.
logical.Impacttypeno test imports ittype Impact = { readonly verdict: "allowed" | "blocked"; readonly reasons: readonly ImpactReason[] };The judgement of a change.
logical.changeImpactfunctionno test imports itfunction changeImpact(declarations: readonly ImpactDeclaration[], touched: readonly string[], newest: Readonly<Record<st… (891 characters)function changeImpact(declarations: readonly ImpactDeclaration[], touched: readonly string[], newest: Readonly<Record<string, "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn">>, options: { readonly exceptions?: readonly (Document & { readonly excuses: ObjectOf<{ type: Decoder<"check" | "control" | "policy">; ref: Decoder<string>; }, Record<never, never>>; readonly subjects: readonly string[]; readonly reason: string; readonly approvedBy: string; readonly grantedAt: string; readonly expiresAt: string; } & { readonly acceptedRisk?: ObjectOf<{ owner: Decoder<string>; level: Decoder<"high" | "low" | "moderate" | "very-high" | "very-low">; reviewBy: Decoder<string>; }, Record<never, never>> | undefined; readonly inheritable?: boolean | undefined; })[] | undefined; readonly approvals?: readonly string[] | undefined; readonly at: string; }): ImpactA change (the paths it touches) judged against declarations: blocked where a touched path is declared for a control whose newest status is fail, error or gap, unless an exception that applies or an approval the caller gives covers the control.
logical.COVERAGE_STATESconstno test imports itconst COVERAGE_STATES: readonly ["gap", "untested", "failing", "stale", "partial", "accepted", "covered"]Every coverage state.
logical.CoverageStatetypeno test imports ittype CoverageState = (typeof COVERAGE_STATES)[number];How well a control is covered.
logical.Coveragetypeno test imports ittype Coverage = { readonly urn: string; readonly state: CoverageState; readonly checks: readonly string[]; readonly via: readonly string[] };The coverage of one control.
logical.coveragefunctionno test imports itfunction coverage(frameworks: readonly (Document & { readonly version: string; readonly title: string; readonly controls… (3381 characters)function coverage(frameworks: readonly (Document & { readonly version: string; readonly title: string; readonly controls: readonly ObjectOf<{ id: Decoder<string>; title: Decoder<string>; statement: Decoder<string>; }, { family: Decoder<string>; }>[]; } & { readonly publisher?: string | undefined; readonly source?: string | undefined; })[], crosswalks: readonly (Document & { readonly mappings: readonly ObjectOf<{ from: Decoder<string>; to: Decoder<string>; relationship: Decoder<"equal" | "intersects-with" | "no-relationship" | "subset-of" | "superset-of">; strength: Decoder<number>; }, { note: Decoder<string>; }>[]; } & {})[], checks: readonly (Document & { readonly ask: string; readonly expect: import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"empty">; }, Record<never, never>> | import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"non-empty">; }, Record<never, never>> | import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"equals">; value: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<import("/home/runner/work/.github/.github/commons/grc/src/governance/kinds").Json>; }, Record<never, never>> | import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"count">; }, { min: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<number>; max: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<number>; }> | import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"every">; field: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<string>; op: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"eq" | "ge" | "gt" | "in" | "le" | "lt" | "matches" | "ne">; value: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<import("/home/runner/work/.github/.github/commons/grc/src/governance/kinds").Json>; }, Record<never, never>>; readonly platforms: readonly string[]; readonly freshness: string; readonly controls: readonly string[]; readonly runner: ObjectOf<{ kind: Decoder<string>; input: Decoder<Json>; }, Record<never, never>>; } & { readonly severity?: "critical" | "high" | "info" | "low" | "medium" | undefined; })[], results: readonly (Document & { readonly check: string; readonly controls: readonly string[]; readonly subject: string; readonly status: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"; readonly severity: "critical" | "high" | "info" | "low" | "medium"; readonly reason: string; readonly observedAt: string; } & { readonly value?: Json | undefined; readonly via?: string | undefined; readonly policy?: string | undefined; readonly exception?: string | undefined; readonly was?: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn" | undefined; })[], now: string): readonly Coverage[]The coverage of every control of the frameworks, in the order of their URNs.
logical.uncoveredfunctionno test imports itfunction uncovered(c: readonly Coverage[]): readonly string[]The controls with no passing check: every one that is not covered or accepted.
logical.DEFAULT_WEIGHTSconstno test imports itconst DEFAULT_WEIGHTS: Readonly<Record<"critical" | "high" | "info" | "low" | "medium", number>>The weight of each severity in a roll-up.
logical.Rolluptypeno test imports ittype Rollup = {
readonly counts: Readonly<Record<Status, number>>;
readonly worst: Status;
readonly weightApplicable: number;
readonly weightPassing: number;
readonly weightAccepted: number;
/** The weighted share of applicable results that pass or are accepted; `undefined` where none is applicable. */
readonly share: number | undefined;
};A roll-up.
logical.rollupfunctionno test imports itfunction rollup(results: readonly (Document & { readonly check: string; readonly controls: readonly string[]; readonly s… (731 characters)function rollup(results: readonly (Document & { readonly check: string; readonly controls: readonly string[]; readonly subject: string; readonly status: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"; readonly severity: "critical" | "high" | "info" | "low" | "medium"; readonly reason: string; readonly observedAt: string; } & { readonly value?: Json | undefined; readonly via?: string | undefined; readonly policy?: string | undefined; readonly exception?: string | undefined; readonly was?: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn" | undefined; })[], weights?: Readonly<Record<"critical" | "high" | "info" | "low" | "medium", number>>): RollupThe roll-up of results: the same for any order of them.
logical.riskLevelfunctionno test imports itfunction riskLevel(likelihood: "high" | "low" | "moderate" | "very-high" | "very-low", impact: "high" | "low" | "moderate" | "very-high" | "very-low"): "high" | "low" | "moderate" | "very-high" | "very-low"The level of risk of a likelihood and an impact.
logical.risksDuefunctionno test imports itfunction risksDue(risks: readonly (Document & { readonly title: string; readonly description: string; readonly likelihoo… (967 characters)function risksDue(risks: readonly (Document & { readonly title: string; readonly description: string; readonly likelihood: "high" | "low" | "moderate" | "very-high" | "very-low"; readonly impact: "high" | "low" | "moderate" | "very-high" | "very-low"; readonly level: "high" | "low" | "moderate" | "very-high" | "very-low"; readonly treatment: "accept" | "avoid" | "mitigate" | "transfer"; readonly owner: string; readonly reviewBy: string; readonly controls: readonly string[]; } & {})[], now: string): readonly (Document & { readonly title: string; readonly description: string; readonly likelihood: "high" | "low" | "moderate" | "very-high" | "very-low"; readonly impact: "high" | "low" | "moderate" | "very-high" | "very-low"; readonly level: "high" | "low" | "moderate" | "very-high" | "very-low"; readonly treatment: "accept" | "avoid" | "mitigate" | "transfer"; readonly owner: string; readonly reviewBy: string; readonly controls: readonly string[]; } & {})[]The risks whose review date has come at now, the highest level first.
FreshnessStatetypeno test imports ittype FreshnessState = "fresh" | "due" | "stale";The three states of freshness.
Freshnesstypeno test imports ittype Freshness = { readonly state: FreshnessState; readonly dueAt: string | undefined };How fresh something is.
freshnessfunctionfunction freshness(newest: string | undefined, duration: string, now: string): Result<Freshness, string>The freshness of the newest observation at now: due within a tenth of the duration of its end, stale past it, and stale for none.
Drifttypeno test imports ittype Drift = {
readonly added: readonly string[];
readonly removed: readonly string[];
readonly changed: readonly { readonly key: string; readonly path: string; readonly declared: Json | undefined; readonly observed: Json | undefined }[];
};What changed between two views of keyed records.
driftfunctionfunction drift(declared: Readonly<Record<string, Json>>, observed: Readonly<Record<string, Json>>): DriftWhat was added, removed and changed from what is declared to what is observed, in key order; a change names the path of the field and both values.
newestResultsfunctionno test imports itfunction newestResults(results: readonly (Document & { readonly check: string; readonly controls: readonly string[]; rea… (1259 characters)function newestResults(results: readonly (Document & { readonly check: string; readonly controls: readonly string[]; readonly subject: string; readonly status: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"; readonly severity: "critical" | "high" | "info" | "low" | "medium"; readonly reason: string; readonly observedAt: string; } & { readonly value?: Json | undefined; readonly via?: string | undefined; readonly policy?: string | undefined; readonly exception?: string | undefined; readonly was?: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn" | undefined; })[]): readonly (Document & { readonly check: string; readonly controls: readonly string[]; readonly subject: string; readonly status: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"; readonly severity: "critical" | "high" | "info" | "low" | "medium"; readonly reason: string; readonly observedAt: string; } & { readonly value?: Json | undefined; readonly via?: string | undefined; readonly policy?: string | undefined; readonly exception?: string | undefined; readonly was?: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn" | undefined; })[]The newest result for each check and subject (by time, then by id).
applyExceptionsfunctionfunction applyExceptions(results: readonly (Document & { readonly check: string; readonly controls: readonly string[]; r… (1832 characters)function applyExceptions(results: readonly (Document & { readonly check: string; readonly controls: readonly string[]; readonly subject: string; readonly status: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"; readonly severity: "critical" | "high" | "info" | "low" | "medium"; readonly reason: string; readonly observedAt: string; } & { readonly value?: Json | undefined; readonly via?: string | undefined; readonly policy?: string | undefined; readonly exception?: string | undefined; readonly was?: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn" | undefined; })[], exceptions: readonly (Document & { readonly excuses: ObjectOf<{ type: Decoder<"check" | "control" | "policy">; ref: Decoder<string>; }, Record<never, never>>; readonly subjects: readonly string[]; readonly reason: string; readonly approvedBy: string; readonly grantedAt: string; readonly expiresAt: string; } & { readonly acceptedRisk?: ObjectOf<{ owner: Decoder<string>; level: Decoder<"high" | "low" | "moderate" | "very-high" | "very-low">; reviewBy: Decoder<string>; }, Record<never, never>> | undefined; readonly inheritable?: boolean | undefined; })[], at: string): readonly (Document & { readonly check: string; readonly controls: readonly string[]; readonly subject: string; readonly status: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"; readonly severity: "critical" | "high" | "info" | "low" | "medium"; readonly reason: string; readonly observedAt: string; } & { readonly value?: Json | undefined; readonly via?: string | undefined; readonly policy?: string | undefined; readonly exception?: string | undefined; readonly was?: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn" | undefined; })[]Results with the exceptions that apply at at applied: fail and warn become accepted (the exception's id kept, the old status in was); error, gap and pending do not.
ImpactDeclarationtypeno test imports ittype ImpactDeclaration = { readonly paths: readonly string[]; readonly controls: readonly string[] };A declaration that a change to some paths bears on controls.
ImpactReasontypeno test imports ittype ImpactReason = { readonly control: string; readonly path: string; readonly status: Status; readonly resolvedBy?: "exception" | "approval"; readonly exception?: string };Why a change is blocked, or what let it pass.
Impacttypeno test imports ittype Impact = { readonly verdict: "allowed" | "blocked"; readonly reasons: readonly ImpactReason[] };The judgement of a change.
changeImpactfunctionfunction changeImpact(declarations: readonly ImpactDeclaration[], touched: readonly string[], newest: Readonly<Record<st… (891 characters)function changeImpact(declarations: readonly ImpactDeclaration[], touched: readonly string[], newest: Readonly<Record<string, "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn">>, options: { readonly exceptions?: readonly (Document & { readonly excuses: ObjectOf<{ type: Decoder<"check" | "control" | "policy">; ref: Decoder<string>; }, Record<never, never>>; readonly subjects: readonly string[]; readonly reason: string; readonly approvedBy: string; readonly grantedAt: string; readonly expiresAt: string; } & { readonly acceptedRisk?: ObjectOf<{ owner: Decoder<string>; level: Decoder<"high" | "low" | "moderate" | "very-high" | "very-low">; reviewBy: Decoder<string>; }, Record<never, never>> | undefined; readonly inheritable?: boolean | undefined; })[] | undefined; readonly approvals?: readonly string[] | undefined; readonly at: string; }): ImpactA change (the paths it touches) judged against declarations: blocked where a touched path is declared for a control whose newest status is fail, error or gap, unless an exception that applies or an approval the caller gives covers the control.
COVERAGE_STATESconstno test imports itconst COVERAGE_STATES: readonly ["gap", "untested", "failing", "stale", "partial", "accepted", "covered"]Every coverage state.
CoverageStatetypetype CoverageState = (typeof COVERAGE_STATES)[number];How well a control is covered.
Coveragetypeno test imports ittype Coverage = { readonly urn: string; readonly state: CoverageState; readonly checks: readonly string[]; readonly via: readonly string[] };The coverage of one control.
coveragefunctionfunction coverage(frameworks: readonly (Document & { readonly version: string; readonly title: string; readonly controls… (3381 characters)function coverage(frameworks: readonly (Document & { readonly version: string; readonly title: string; readonly controls: readonly ObjectOf<{ id: Decoder<string>; title: Decoder<string>; statement: Decoder<string>; }, { family: Decoder<string>; }>[]; } & { readonly publisher?: string | undefined; readonly source?: string | undefined; })[], crosswalks: readonly (Document & { readonly mappings: readonly ObjectOf<{ from: Decoder<string>; to: Decoder<string>; relationship: Decoder<"equal" | "intersects-with" | "no-relationship" | "subset-of" | "superset-of">; strength: Decoder<number>; }, { note: Decoder<string>; }>[]; } & {})[], checks: readonly (Document & { readonly ask: string; readonly expect: import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"empty">; }, Record<never, never>> | import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"non-empty">; }, Record<never, never>> | import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"equals">; value: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<import("/home/runner/work/.github/.github/commons/grc/src/governance/kinds").Json>; }, Record<never, never>> | import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"count">; }, { min: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<number>; max: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<number>; }> | import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"every">; field: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<string>; op: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"eq" | "ge" | "gt" | "in" | "le" | "lt" | "matches" | "ne">; value: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<import("/home/runner/work/.github/.github/commons/grc/src/governance/kinds").Json>; }, Record<never, never>>; readonly platforms: readonly string[]; readonly freshness: string; readonly controls: readonly string[]; readonly runner: ObjectOf<{ kind: Decoder<string>; input: Decoder<Json>; }, Record<never, never>>; } & { readonly severity?: "critical" | "high" | "info" | "low" | "medium" | undefined; })[], results: readonly (Document & { readonly check: string; readonly controls: readonly string[]; readonly subject: string; readonly status: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"; readonly severity: "critical" | "high" | "info" | "low" | "medium"; readonly reason: string; readonly observedAt: string; } & { readonly value?: Json | undefined; readonly via?: string | undefined; readonly policy?: string | undefined; readonly exception?: string | undefined; readonly was?: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn" | undefined; })[], now: string): readonly Coverage[]The coverage of every control of the frameworks, in the order of their URNs.
uncoveredfunctionfunction uncovered(c: readonly Coverage[]): readonly string[]The controls with no passing check: every one that is not covered or accepted.
DEFAULT_WEIGHTSconstno test imports itconst DEFAULT_WEIGHTS: Readonly<Record<"critical" | "high" | "info" | "low" | "medium", number>>The weight of each severity in a roll-up.
Rolluptypeno test imports ittype Rollup = {
readonly counts: Readonly<Record<Status, number>>;
readonly worst: Status;
readonly weightApplicable: number;
readonly weightPassing: number;
readonly weightAccepted: number;
/** The weighted share of applicable results that pass or are accepted; `undefined` where none is applicable. */
readonly share: number | undefined;
};A roll-up.
rollupfunctionfunction rollup(results: readonly (Document & { readonly check: string; readonly controls: readonly string[]; readonly s… (731 characters)function rollup(results: readonly (Document & { readonly check: string; readonly controls: readonly string[]; readonly subject: string; readonly status: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"; readonly severity: "critical" | "high" | "info" | "low" | "medium"; readonly reason: string; readonly observedAt: string; } & { readonly value?: Json | undefined; readonly via?: string | undefined; readonly policy?: string | undefined; readonly exception?: string | undefined; readonly was?: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn" | undefined; })[], weights?: Readonly<Record<"critical" | "high" | "info" | "low" | "medium", number>>): RollupThe roll-up of results: the same for any order of them.
riskLevelfunctionfunction riskLevel(likelihood: "high" | "low" | "moderate" | "very-high" | "very-low", impact: "high" | "low" | "moderate" | "very-high" | "very-low"): "high" | "low" | "moderate" | "very-high" | "very-low"The level of risk of a likelihood and an impact.
risksDuefunctionfunction risksDue(risks: readonly (Document & { readonly title: string; readonly description: string; readonly likelihoo… (967 characters)function risksDue(risks: readonly (Document & { readonly title: string; readonly description: string; readonly likelihood: "high" | "low" | "moderate" | "very-high" | "very-low"; readonly impact: "high" | "low" | "moderate" | "very-high" | "very-low"; readonly level: "high" | "low" | "moderate" | "very-high" | "very-low"; readonly treatment: "accept" | "avoid" | "mitigate" | "transfer"; readonly owner: string; readonly reviewBy: string; readonly controls: readonly string[]; } & {})[], now: string): readonly (Document & { readonly title: string; readonly description: string; readonly likelihood: "high" | "low" | "moderate" | "very-high" | "very-low"; readonly impact: "high" | "low" | "moderate" | "very-high" | "very-low"; readonly level: "high" | "low" | "moderate" | "very-high" | "very-low"; readonly treatment: "accept" | "avoid" | "mitigate" | "transfer"; readonly owner: string; readonly reviewBy: string; readonly controls: readonly string[]; } & {})[]The risks whose review date has come at now, the highest level first.