physical.LensHarnesstypeno test imports ittype 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.
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);physical.LensHarnesstypeno test imports ittype 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 ittype 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 ittype LensLaw = "get-put" | "put-get" | "get-get";The laws of a lens.
physical.LawViolationtypeno test imports ittype LawViolation = { readonly law: LensLaw; readonly message: string };A law a source breaks, and how.
physical.checkLensfunctionno test imports itfunction 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 ittype 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 ittype 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 ittype LensLaw = "get-put" | "put-get" | "get-get";The laws of a lens.
LawViolationtypeno test imports ittype LawViolation = { readonly law: LensLaw; readonly message: string };A law a source breaks, and how.
checkLensfunctionno test imports itfunction 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.