Steptypeno test imports ittype Step = { readonly op: string; readonly path: string; readonly fidelity: Fidelity; readonly notes: readonly string[] };One step: the operation, the path it was about, and how it was carried out.
What a verb says of how it did its work (commons anyfs-cli 0003-anyfs-cli-logical FR-008, FR-009): every operation of the POSIX view of a store ends with its fidelity (native, emulated with a risk, or refused), and a verb keeps each in a trail. At the end the trail is a verdict: with --strict any operation that the library carried out by a means that can lose or change what was meant is a problem (E-STRICT), and with -v the emulations are written as lines so that nothing is pretended silently.
import { newTrail } from "./trail.ts";
const trail = newTrail();
trail.steps.length; // 0Steptypeno test imports ittype Step = { readonly op: string; readonly path: string; readonly fidelity: Fidelity; readonly notes: readonly string[] };One step: the operation, the path it was about, and how it was carried out.
Trailtypeno test imports ittype Trail = { readonly steps: Step[] };The steps of a verb, in order.
newTrailfunctionfunction newTrail(): TrailAn empty trail.
describeFailurefunctionfunction describeFailure(e: PosixError): stringA failed operation as a sentence: its errno in words, the path and what the store said.
keepfunctionfunction keep<T>(trail: Trail, op: string, path: string, done: Result<Outcome<T>, PosixError>): Result<T, PosixError>Keeps the fidelity of an operation, and gives its value, or the error it ended with.
strictViolationsfunctionfunction strictViolations(trail: Trail): readonly Step[]The steps a program that asks for strictness stops at.
emulatedLinesfunctionfunction emulatedLines(trail: Trail): readonly string[]The steps that were not native, once each (an operation on many files is one line), in the order met.