IF Commons GitHub

physical/conformance

Written to: 1 requirement: 0 proved, 0 partly, 0 failing, 1 with no test recorded. 0004-planning-sources FR-004

The laws of a lens as a check a source is given (0037-planning FR-023, FR-042): checkLens returns the laws a source breaks. (1) A patch that sets what the place already says has an empty plan and changes no byte. (2) After a patch is written, acquire returns the observations it returned before with the change of that patch and no other, and only the file of the thing changed. (3) acquire of an unchanged place twice returns the same observations in the same order with the same fingerprints. The harness makes a fresh place each time; a source that cannot write is held to the third law alone.

import { checkLens } from "./conformance.ts";
// const broken = await checkLens(async () => ({ source, snapshot }), context);

Source: commons/planning/src/physical/conformance.ts

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

physical.LensHarnesstypeno test imports it
type LensHarness = { readonly source: Source; snapshot(): Promise<Readonly<Record<string, string>>> };

A fresh place with its source, and a way to see every file of the place as text.

physical.LensContexttypeno test imports it
type LensContext = { readonly item: ItemId; readonly ids: () => EventId; readonly actor: Actor; readonly at: Instant; readonly maxObservations?: number };

What the check needs to build a patch.

physical.LensLawtypeno test imports it
type LensLaw = "get-put" | "put-get" | "get-get";

The laws of a lens.

physical.LawViolationtypeno test imports it
type LawViolation = { readonly law: LensLaw; readonly message: string };

A law a source breaks, and how.

physical.checkLensfunctionno test imports it
function checkLens(make: () => Promise<LensHarness>, ctx: LensContext): Promise<readonly LawViolation[]>

The laws a source breaks over the places the harness makes. Empty means the source keeps them on those places.

LensHarnesstypeno test imports it
type LensHarness = { readonly source: Source; snapshot(): Promise<Readonly<Record<string, string>>> };

A fresh place with its source, and a way to see every file of the place as text.

LensContexttypeno test imports it
type LensContext = { readonly item: ItemId; readonly ids: () => EventId; readonly actor: Actor; readonly at: Instant; readonly maxObservations?: number };

What the check needs to build a patch.

LensLawtypeno test imports it
type LensLaw = "get-put" | "put-get" | "get-get";

The laws of a lens.

LawViolationtypeno test imports it
type LawViolation = { readonly law: LensLaw; readonly message: string };

A law a source breaks, and how.

checkLensfunctionno test imports it
function checkLens(make: () => Promise<LensHarness>, ctx: LensContext): Promise<readonly LawViolation[]>

The laws a source breaks over the places the harness makes. Empty means the source keeps them on those places.

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