IF Commons GitHub

logical/judge

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0007-machine-probe-enroll FR-004

What the policy pack says of one machine: its observation judged by the policies, with the risks a person accepted for it. A machine never observed is waiting in every policy and never failing, because "not observed yet" is not a finding.

import { judgeObserved } from "./judge.ts";
judgeObserved(undefined, [], "2026-11-21T00:00:00Z").observedAt; // null

Source: commons/machine-probe/src/logical/judge.ts

1 of 4 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.Checkedtypeno test imports it
type Checked = { readonly observedAt: string | null; readonly results: readonly JudgedPolicy[] };

What the check of one machine found: when it was observed (nothing where it never was) and each policy's status.

logical.judgeObservedfunctionno test imports it
function judgeObserved(observed: Observed | undefined, accepted: readonly AcceptedRisk[], now: string): Checked

The observation of a machine (or none) judged by the policy pack and the risks accepted for it, at an instant.

Checkedtypeno test imports it
type Checked = { readonly observedAt: string | null; readonly results: readonly JudgedPolicy[] };

What the check of one machine found: when it was observed (nothing where it never was) and each policy's status.

judgeObservedfunction
function judgeObserved(observed: Observed | undefined, accepted: readonly AcceptedRisk[], now: string): Checked

The observation of a machine (or none) judged by the policy pack and the risks accepted for it, at an instant.

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

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