logical.ProbeOutputtypeno test imports ittype ProbeOutput = Readonly<Record<string, Readonly<Record<string, string>>>>;A probe's output: sections, each a map of key to value.
The facts a probe gives, as a typed observation: the sections and key=value lines of its output read into a record of the operating system, the hardware, the security settings, the software and the ports that listen, with what the probe could not tell said as unknown; and the keyed records of that observation that an estate compares with what is declared, which hold nothing that changes only because the time does.
import { parseProbe, toObserved } from "./observed.ts";
const o = toObserved(parseProbe("@probe\nversion=1\nat=2026-12-01T00:00:00Z\n@os\nfamily=ubuntu\nversion=24.04\n"));
o.kind; // "ok"logical.ProbeOutputtypeno test imports ittype ProbeOutput = Readonly<Record<string, Readonly<Record<string, string>>>>;A probe's output: sections, each a map of key to value.
logical.parseProbefunctionno test imports itfunction parseProbe(text: string): Readonly<Record<string, Readonly<Record<string, string>>>>The probe's output read: @section lines start a section and key=value lines fill it; a blank line is skipped, and a line before any section belongs to none and is skipped.
logical.Observedtypeno test imports ittype Observed = {
/** When (an instant, ISO 8601) and with which version of the probe. */
readonly at: string;
rea… (1090 characters)type Observed = {
/** When (an instant, ISO 8601) and with which version of the probe. */
readonly at: string;
readonly probe: string;
readonly os: { readonly family: string; readonly name: string; readonly version: string; readonly kernel: string; readonly arch: string; readonly hostname: string; readonly model?: string; readonly serial?: string; readonly flavor?: string; readonly wsl?: boolean };
readonly hardware: { readonly cpus?: number; readonly memoryMB?: number; readonly diskTotalGB?: number; readonly diskUsedPct?: number };
/** Security settings: `on`, `off`, `manual` or `unknown`. */
readonly security: { readonly diskEncryption: string; readonly firewall: string; readonly autoUpdates: string; readonly sshPasswordAuth?: string; readonly antivirus?: string; readonly admins: readonly string[] };
readonly software: { readonly manager?: string; readonly packages?: number; readonly brewPackages?: number; readonly pendingUpdates?: number; readonly osquery?: string };
/** The TCP ports that listen, in order. */
readonly listening: readonly number[];
};What the probe found on a machine.
logical.toObservedfunctionno test imports itfunction toObserved(p: Readonly<Record<string, Readonly<Record<string, string>>>>): Result<Observed, string>The probe's output as an observation, or why not: a probe that gives no time is refused, because an observation with no time is no evidence.
logical.observedStatefunctionno test imports itfunction observedState(o: Observed): Readonly<Record<string, Json>>The keyed records of an observation that an estate compares with what is declared: the system, the security settings, the software and the ports. The time of the observation, the version of the probe and the counters that change on their own (the memory, the disk in use, the updates waiting) are left out, so that two observations of a machine that did not change are the same.
ProbeOutputtypeno test imports ittype ProbeOutput = Readonly<Record<string, Readonly<Record<string, string>>>>;A probe's output: sections, each a map of key to value.
parseProbefunctionfunction parseProbe(text: string): Readonly<Record<string, Readonly<Record<string, string>>>>The probe's output read: @section lines start a section and key=value lines fill it; a blank line is skipped, and a line before any section belongs to none and is skipped.
Observedtypetype Observed = {
/** When (an instant, ISO 8601) and with which version of the probe. */
readonly at: string;
rea… (1090 characters)type Observed = {
/** When (an instant, ISO 8601) and with which version of the probe. */
readonly at: string;
readonly probe: string;
readonly os: { readonly family: string; readonly name: string; readonly version: string; readonly kernel: string; readonly arch: string; readonly hostname: string; readonly model?: string; readonly serial?: string; readonly flavor?: string; readonly wsl?: boolean };
readonly hardware: { readonly cpus?: number; readonly memoryMB?: number; readonly diskTotalGB?: number; readonly diskUsedPct?: number };
/** Security settings: `on`, `off`, `manual` or `unknown`. */
readonly security: { readonly diskEncryption: string; readonly firewall: string; readonly autoUpdates: string; readonly sshPasswordAuth?: string; readonly antivirus?: string; readonly admins: readonly string[] };
readonly software: { readonly manager?: string; readonly packages?: number; readonly brewPackages?: number; readonly pendingUpdates?: number; readonly osquery?: string };
/** The TCP ports that listen, in order. */
readonly listening: readonly number[];
};What the probe found on a machine.
toObservedfunctionfunction toObserved(p: Readonly<Record<string, Readonly<Record<string, string>>>>): Result<Observed, string>The probe's output as an observation, or why not: a probe that gives no time is refused, because an observation with no time is no evidence.
observedStatefunctionfunction observedState(o: Observed): Readonly<Record<string, Json>>The keyed records of an observation that an estate compares with what is declared: the system, the security settings, the software and the ports. The time of the observation, the version of the probe and the counters that change on their own (the memory, the disk in use, the updates waiting) are left out, so that two observations of a machine that did not change are the same.