governance.Observedtypeno test imports ittype Observed = { readonly id: string; readonly state: "managed" | "adopted" };An asset the collector observes: its id and whether it is managed or adopted (a discovered asset is not observed).
What the collector is given and what it gives back: the assets it observes, the way it observes one (a function a program supplies, so that the collector knows no probe), what an observation or a failure is, and the kinds of entry of the journal.
import type { Observer } from "./capture.ts";
const observe: Observer = async () => ({ kind: "ok", value: { stateText: "{}\n" } });governance.Observedtypeno test imports ittype Observed = { readonly id: string; readonly state: "managed" | "adopted" };An asset the collector observes: its id and whether it is managed or adopted (a discovered asset is not observed).
governance.CaptureFailuretypeno test imports ittype CaptureFailure = { readonly kind: "unreachable" | "refused" | "unreadable"; readonly message: string };Why an asset could not be observed: it could not be reached, it refused, or what it said could not be read.
governance.Observertypeno test imports ittype Observer = (asset: Observed) => Promise<Result<{ readonly stateText: string }, CaptureFailure>>;The way an asset is observed: its state as text (the same text for the same state, with no time in it), or why not.
governance.JOURNAL_TYPESconstno test imports itconst JOURNAL_TYPES: readonly ["capture.changed", "capture.unchanged", "capture.unreachable", "capture.refused", "capture.unreadable", "push.failed", "seal"]The kinds of entry of the journal: a look at an asset that found it changed or unchanged, a look that failed, a push that failed, and a seal.
governance.JournalTypetypeno test imports ittype JournalType = (typeof JOURNAL_TYPES)[number];A kind of entry of the journal.
Observedtypetests failingtype Observed = { readonly id: string; readonly state: "managed" | "adopted" };An asset the collector observes: its id and whether it is managed or adopted (a discovered asset is not observed).
CaptureFailuretypetests failingtype CaptureFailure = { readonly kind: "unreachable" | "refused" | "unreadable"; readonly message: string };Why an asset could not be observed: it could not be reached, it refused, or what it said could not be read.
Observertypetests failingtype Observer = (asset: Observed) => Promise<Result<{ readonly stateText: string }, CaptureFailure>>;The way an asset is observed: its state as text (the same text for the same state, with no time in it), or why not.
JOURNAL_TYPESconstconst JOURNAL_TYPES: readonly ["capture.changed", "capture.unchanged", "capture.unreachable", "capture.refused", "capture.unreadable", "push.failed", "seal"]The kinds of entry of the journal: a look at an asset that found it changed or unchanged, a look that failed, a push that failed, and a seal.
JournalTypetypeno test imports ittype JournalType = (typeof JOURNAL_TYPES)[number];A kind of entry of the journal.