IF Commons GitHub

logical/invariants

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-estate-logical FR-007

The invariants of the Operational Truth Ontology (commons ontology 0002-oto FR-003) that an estate can check: no unowned responsibilities (every capability an asset offers has an owning system), no evidence without attribution (every observation names its source) and no compliance without traceability (every policy result names the controls it gives evidence for). A violation is a system error, not an audit finding. The other three invariants need policies and the criticality of controls, which an estate does not hold, and are named here as not checked.

import { checkInvariants } from "./invariants.ts";
checkInvariants({ assets: [], observations: [], results: [{ asset: "athens", id: "disk-encryption", status: "pass", controls: [] }] })[0]?.invariant; // "NoComplianceWithoutTraceability"

Source: commons/estate/src/logical/invariants.ts

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

InvariantNametypeno test imports it
type InvariantName = "NoOrphanPolicies" | "NoUnownedResponsibilities" | "NoUnenforcedCriticalControls" | "NoEvidenceWithoutAttribution" | "NoAuthorityWithoutScope" | "NoComplianceWithoutTraceability";

The invariants of OTO, by their names in the ontology.

INVARIANT_COVERAGEconst
const INVARIANT_COVERAGE: Readonly<Record<InvariantName, "checked" | "not checked">>

Whether an estate checks an invariant: checked, or not checked where it needs what an estate does not hold.

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

Violationtypeno test imports it
type Violation = { readonly invariant: InvariantName; readonly subject: string; readonly message: string };

A violation: the invariant, what it is about and what is wrong.

InvariantInputtypeno test imports it
type InvariantInput = {
  readonly assets: readonly Asset[];
  readonly observations: readonly { readonly asset: string; readonly observation: Observation }[];
  readonly results: readonly (PolicyOutcome & { readonly asset: string })[];
};

What an estate is checked with: its assets, the observations of them (the asset each is of) and the policy results (the asset each is of).

checkInvariantsfunction
function checkInvariants(i: InvariantInput): readonly Violation[]

Every violation of the invariants an estate checks, in the order of the assets, the observations and the results.

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

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