IF Commons GitHub

governance/capture

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-evidence-capture-journal FR-001

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" } });

Source: commons/evidence-capture/src/governance/capture.ts

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

governance.Observedtypeno test imports it
type 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 it
type 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 it
type 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 it
const 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 it
type JournalType = (typeof JOURNAL_TYPES)[number];

A kind of entry of the journal.

Observedtypetests failing
type 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).

Imported by 7 tests of the run (6 passed, 1 failed): a state is kept only where it changed, every look is journaled, commits come whe. the library's results

CaptureFailuretypetests failing
type 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.

Imported by 7 tests of the run (6 passed, 1 failed): a state is kept only where it changed, every look is journaled, commits come whe. the library's results

Observertypetests failing
type 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.

Imported by 7 tests of the run (6 passed, 1 failed): a state is kept only where it changed, every look is journaled, commits come whe. the library's results

JOURNAL_TYPESconst
const 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.

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

JournalTypetypeno test imports it
type JournalType = (typeof JOURNAL_TYPES)[number];

A kind of entry of the journal.

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