IF Commons GitHub

governance/states

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-estate-governance FR-002, 0002-estate-governance FR-003

What each state of an asset offers, as data, and the reason a state does not offer a capability; and the moves between states that are allowed. A discovered asset is only listed and offers nothing, an adopted asset is observed and checked but never changed, and a managed asset offers every capability.

import { offers, reasonNotOffered } from "./states.ts";
offers("adopted", "converge"); // false
reasonNotOffered("adopted", "converge"); // "an adopted asset is observed and checked, never changed"

Source: commons/estate/src/governance/states.ts

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

OFFEREDconstno test imports it
const OFFERED: Readonly<Record<"adopted" | "discovered" | "managed", readonly ("access" | "backup" | "converge" | "identity" | "observe" | "plan" | "provision" | "retire" | "update" | "verify")[]>>

The capabilities each state offers.

offersfunction
function offers(state: "adopted" | "discovered" | "managed", capability: "access" | "backup" | "converge" | "identity" | "observe" | "plan" | "provision" | "retire" | "update" | "verify", origin?: "integration" | "paired" | "provisioned" | "scan" | "self" | undefined): boolean

Whether a state offers a capability: a managed asset that was not provisioned (it is inherited) does not offer provision.

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

reasonNotOfferedfunction
function reasonNotOffered(state: "adopted" | "discovered" | "managed", capability: "access" | "backup" | "converge" | "identity" | "observe" | "plan" | "provision" | "retire" | "update" | "verify", origin?: "integration" | "paired" | "provisioned" | "scan" | "self" | undefined): string | undefined

The reason a state does not offer a capability; nothing where it does.

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

TRANSITIONSconstno test imports it
const TRANSITIONS: readonly (readonly ["adopted" | "discovered" | "managed", "adopted" | "discovered" | "managed"])[]

The moves between states that are allowed (Stolos 067-adopt): a discovered asset is adopted, an adopted asset is released back to discovered or managed (taken over, with an approval), and a managed asset is never moved: it was installed as managed or taken over, and leaves by being retired.

mayMovefunction
function mayMove(from: "adopted" | "discovered" | "managed", to: "adopted" | "discovered" | "managed"): boolean

Whether an asset may move from one state to another.

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

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