IF Commons GitHub

logical/compute

Written to: 7 requirements: 7 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-grc-logical FR-009, 0003-grc-logical FR-004, 0003-grc-logical FR-005, 0003-grc-logical FR-006, 0003-grc-logical FR-007, 0003-grc-logical FR-008 and 1 more

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"); // stale

Source: commons/grc/src/logical/compute.ts

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

logical.FreshnessStatetypeno test imports it
type FreshnessState = "fresh" | "due" | "stale";

The three states of freshness.

logical.Freshnesstypeno test imports it
type Freshness = { readonly state: FreshnessState; readonly dueAt: string | undefined };

How fresh something is.

logical.freshnessfunctionno test imports it
function 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 it
type 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 it
function drift(declared: Readonly<Record<string, Json>>, observed: Readonly<Record<string, Json>>): Drift

What 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 it
function 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 it
function 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 it
type ImpactDeclaration = { readonly paths: readonly string[]; readonly controls: readonly string[] };

A declaration that a change to some paths bears on controls.

logical.ImpactReasontypeno test imports it
type 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 it
type Impact = { readonly verdict: "allowed" | "blocked"; readonly reasons: readonly ImpactReason[] };

The judgement of a change.

logical.changeImpactfunctionno test imports it
function 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; }): Impact

A 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 it
const COVERAGE_STATES: readonly ["gap", "untested", "failing", "stale", "partial", "accepted", "covered"]

Every coverage state.

logical.CoverageStatetypeno test imports it
type CoverageState = (typeof COVERAGE_STATES)[number];

How well a control is covered.

logical.Coveragetypeno test imports it
type Coverage = { readonly urn: string; readonly state: CoverageState; readonly checks: readonly string[]; readonly via: readonly string[] };

The coverage of one control.

logical.coveragefunctionno test imports it
function 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 it
function 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 it
const DEFAULT_WEIGHTS: Readonly<Record<"critical" | "high" | "info" | "low" | "medium", number>>

The weight of each severity in a roll-up.

logical.Rolluptypeno test imports it
type 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 it
function 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>>): Rollup

The roll-up of results: the same for any order of them.

logical.riskLevelfunctionno test imports it
function 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 it
function 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 it
type FreshnessState = "fresh" | "due" | "stale";

The three states of freshness.

Freshnesstypeno test imports it
type Freshness = { readonly state: FreshnessState; readonly dueAt: string | undefined };

How fresh something is.

freshnessfunction
function 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.

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

Drifttypeno test imports it
type 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.

driftfunction
function drift(declared: Readonly<Record<string, Json>>, observed: Readonly<Record<string, Json>>): Drift

What 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.

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

newestResultsfunctionno test imports it
function 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).

applyExceptionsfunction
function 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.

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

ImpactDeclarationtypeno test imports it
type ImpactDeclaration = { readonly paths: readonly string[]; readonly controls: readonly string[] };

A declaration that a change to some paths bears on controls.

ImpactReasontypeno test imports it
type 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 it
type Impact = { readonly verdict: "allowed" | "blocked"; readonly reasons: readonly ImpactReason[] };

The judgement of a change.

changeImpactfunction
function 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; }): Impact

A 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.

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

COVERAGE_STATESconstno test imports it
const COVERAGE_STATES: readonly ["gap", "untested", "failing", "stale", "partial", "accepted", "covered"]

Every coverage state.

CoverageStatetype
type CoverageState = (typeof COVERAGE_STATES)[number];

How well a control is covered.

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

Coveragetypeno test imports it
type Coverage = { readonly urn: string; readonly state: CoverageState; readonly checks: readonly string[]; readonly via: readonly string[] };

The coverage of one control.

coveragefunction
function 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.

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

uncoveredfunction
function uncovered(c: readonly Coverage[]): readonly string[]

The controls with no passing check: every one that is not covered or accepted.

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

DEFAULT_WEIGHTSconstno test imports it
const DEFAULT_WEIGHTS: Readonly<Record<"critical" | "high" | "info" | "low" | "medium", number>>

The weight of each severity in a roll-up.

Rolluptypeno test imports it
type 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.

rollupfunction
function 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>>): Rollup

The roll-up of results: the same for any order of them.

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

riskLevelfunction
function 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.

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

risksDuefunction
function 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.

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

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