IF Commons GitHub

logical/platform

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0004-linux-observe-platform FR-002, 0004-linux-observe-platform FR-003

The platform of a machine read from the text of /etc/os-release and uname -m, and the platform a model declares parsed with every reason it is refused. Nothing here runs a program.

import { platformOfOsRelease } from "./platform.ts";
platformOfOsRelease('ID=debian\nVERSION_ID="13"\n').kind; // "ok"

Source: commons/linux-observe/src/logical/platform.ts

5 of 10 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.architectureOffunctionno test imports it
function architectureOf(unameM: string): "aarch64" | "x86_64" | undefined

The architecture uname -m says, where Archon knows it (arm64 is aarch64, amd64 is x86_64).

logical.osReleaseTablefunctionno test imports it
function osReleaseTable(text: string): ReadonlyMap<string, string>

The KEY=value lines of an os-release as a table: a value may be in single or double quotes.

logical.parseDeclaredfunctionno test imports it
function parseDeclared(input: unknown): Result<Declared, readonly string[]>

A declared platform from what a model wrote, or every reason it is refused.

logical.platformDriftfunctionno test imports it
function platformDrift(declared: Declared, observed: Observed): readonly string[]

What differs between the platform declared and the one observed, one sentence each: a machine that is not what its model says is said, not converged as though it were.

logical.platformOfOsReleasefunctionno test imports it
function platformOfOsRelease(text: string, unameM?: string | undefined): Result<Observed, string>

The platform an os-release describes, or the reason it is not one Archon knows: an ID and an ID_LIKE of no known family are named, never guessed.

architectureOffunction
function architectureOf(unameM: string): "aarch64" | "x86_64" | undefined

The architecture uname -m says, where Archon knows it (arm64 is aarch64, amd64 is x86_64).

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

osReleaseTablefunction
function osReleaseTable(text: string): ReadonlyMap<string, string>

The KEY=value lines of an os-release as a table: a value may be in single or double quotes.

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

parseDeclaredfunction
function parseDeclared(input: unknown): Result<Declared, readonly string[]>

A declared platform from what a model wrote, or every reason it is refused.

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

platformDriftfunction
function platformDrift(declared: Declared, observed: Observed): readonly string[]

What differs between the platform declared and the one observed, one sentence each: a machine that is not what its model says is said, not converged as though it were.

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

platformOfOsReleasefunction
function platformOfOsRelease(text: string, unameM?: string | undefined): Result<Observed, string>

The platform an os-release describes, or the reason it is not one Archon knows: an ID and an ID_LIKE of no known family are named, never guessed.

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

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