IF Commons GitHub

governance/machine

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-lab-machine FR-001, 0002-lab-machine FR-005

What a disposable machine is and what a container can stand in for. A machine is described by a name, a base image, its users and its packages; and every area of what a machine is has a statement of whether a container stands in for it faithfully or not, so that a test says which of its claims a container can prove, and a green run is never read as proof of what a container cannot show.

import { AREAS } from "./machine.ts";
AREAS.find((a) => a.area === "firewall")?.fidelity; // "not faithful"

Source: commons/lab/src/governance/machine.ts

Mutation score of this file: 83.1% (11 of 65 changes to its code were not noticed by a test).

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

governance.BASE_IMAGESconstno test imports it
const BASE_IMAGES: readonly ["ubuntu:24.04", "ubuntu:26.04", "debian:13", "quay.io/rockylinux/rockylinux:9"]

The base images a machine may be made from: the releases of Ubuntu the fleet runs, Debian 13 and Rocky Linux 9 (a RHEL-family image from a registry that does not limit anonymous pulls).

governance.BaseImagetypeno test imports it
type BaseImage = (typeof BASE_IMAGES)[number];

A base image.

governance.imageFamilyfunctionno test imports it
function imageFamily(image: "debian:13" | "quay.io/rockylinux/rockylinux:9" | "ubuntu:24.04" | "ubuntu:26.04"): "debian" | "rhel"

The family of Linux of an image, by how its packages are managed: debian (apt) or rhel (dnf).

governance.MachineUsertypeno test imports it
type MachineUser = { readonly name: string; readonly sudo: boolean };

A user of a machine: its name, and whether it may use sudo with no password (as the first user of a cloud image does).

governance.MachineSpectypeno test imports it
type MachineSpec = { /** A name of lower case letters, digits and hyphens: the name of the container is made from it. … (503 characters)
type MachineSpec = {
  /** A name of lower case letters, digits and hyphens: the name of the container is made from it. */
  readonly name: string;
  readonly image: BaseImage;
  readonly users: readonly MachineUser[];
  /** Packages of the release's own archive, installed with the package program of the image's family (apt or dnf) when the image is made. */
  readonly packages: readonly string[];
  /** The time zone the machine is set to (an area/location name). */
  readonly timezone?: string;
};

What a machine is made from.

governance.Areatypeno test imports it
type Area =
  | "systemd units and timers"
  | "apt packages"
  | "users, groups and keys"
  | "files and directories"
  | "time zone and locale"
  | "sshd and a restricted key"
  | "host name"
  | "firewall"
  | "kernel settings"
  | "mounts and disks"
  | "UEFI, Secure Boot and boot"
  | "hardware facts"
  | "power cycle";

An area of what a machine is.

governance.AreaFidelitytypeno test imports it
type AreaFidelity = { readonly area: Area; readonly fidelity: "faithful" | "not faithful"; readonly note: string };

Whether a container stands in for an area, and why.

governance.AREASconstno test imports it
const AREAS: readonly AreaFidelity[]

Every area, with what a container does for it: what is faithful is proved on a container, and what is not faithful is left to a real machine.

governance.NOT_FAITHFULconstno test imports it
const NOT_FAITHFUL: readonly Area[]

The areas a container does not stand in for: left to a real machine.

BASE_IMAGESconst
const BASE_IMAGES: readonly ["ubuntu:24.04", "ubuntu:26.04", "debian:13", "quay.io/rockylinux/rockylinux:9"]

The base images a machine may be made from: the releases of Ubuntu the fleet runs, Debian 13 and Rocky Linux 9 (a RHEL-family image from a registry that does not limit anonymous pulls).

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

BaseImagetypeno test imports it
type BaseImage = (typeof BASE_IMAGES)[number];

A base image.

imageFamilyfunctionno test imports it
function imageFamily(image: "debian:13" | "quay.io/rockylinux/rockylinux:9" | "ubuntu:24.04" | "ubuntu:26.04"): "debian" | "rhel"

The family of Linux of an image, by how its packages are managed: debian (apt) or rhel (dnf).

MachineUsertypeno test imports it
type MachineUser = { readonly name: string; readonly sudo: boolean };

A user of a machine: its name, and whether it may use sudo with no password (as the first user of a cloud image does).

MachineSpectypeno test imports it
type MachineSpec = { /** A name of lower case letters, digits and hyphens: the name of the container is made from it. … (503 characters)
type MachineSpec = {
  /** A name of lower case letters, digits and hyphens: the name of the container is made from it. */
  readonly name: string;
  readonly image: BaseImage;
  readonly users: readonly MachineUser[];
  /** Packages of the release's own archive, installed with the package program of the image's family (apt or dnf) when the image is made. */
  readonly packages: readonly string[];
  /** The time zone the machine is set to (an area/location name). */
  readonly timezone?: string;
};

What a machine is made from.

Areatypeno test imports it
type Area =
  | "systemd units and timers"
  | "apt packages"
  | "users, groups and keys"
  | "files and directories"
  | "time zone and locale"
  | "sshd and a restricted key"
  | "host name"
  | "firewall"
  | "kernel settings"
  | "mounts and disks"
  | "UEFI, Secure Boot and boot"
  | "hardware facts"
  | "power cycle";

An area of what a machine is.

AreaFidelitytypeno test imports it
type AreaFidelity = { readonly area: Area; readonly fidelity: "faithful" | "not faithful"; readonly note: string };

Whether a container stands in for an area, and why.

AREASconst
const AREAS: readonly AreaFidelity[]

Every area, with what a container does for it: what is faithful is proved on a container, and what is not faithful is left to a real machine.

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

NOT_FAITHFULconst
const NOT_FAITHFUL: readonly Area[]

The areas a container does not stand in for: left to a real machine.

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

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