logical.Factstypeno test imports ittype Facts = { readonly capabilities: ReadonlySet<Capability>; readonly policy: Policy };What a plan depends on: the capabilities of the store and the policy of the view.
The plan of an operation: how a store of some capabilities carries it out, as data. A plan says how faithfully (native, emulated with its reason and risk, or refused with its reason) and which operations of the store it may use, so that explain answers before anything is run, the result of an operation carries the fidelity of its plan, and a test can hold that an operation used nothing its plan did not name. The plan depends on the capabilities of the store and the policy, and on nothing else.
import { plan } from "./plan.ts";
import { defaultPolicy } from "@intellectual-frontiers/anyfs-posix/governance";
const facts = { capabilities: new Set(["read", "write", "list", "stat", "delete"] as const), policy: defaultPolicy() };
plan(facts, "rename-file").fidelity.kind; // "emulated": a store without `rename` copies and then deleteslogical.Factstypeno test imports ittype Facts = { readonly capabilities: ReadonlySet<Capability>; readonly policy: Policy };What a plan depends on: the capabilities of the store and the policy of the view.
logical.Plantypeno test imports ittype Plan = {
readonly op: PlanOp;
readonly fidelity: Fidelity;
/** The operations of the store it may use. */
readonly steps: readonly OpName[];
/** What the operation does, in a sentence. */
readonly summary: string;
};How an operation is carried out.
logical.planfunctionno test imports itfunction plan(facts: Facts, op: "append" | "chmod" | "chown" | "close" | "fsync" | "link" | "mkdir" | "mmap" | "open-write" | "read-all" | "read-range" | "readdir" | "readlink" | "rename-dir" | "rename-file" | "rename-over" | "rm-r" | "rmdir" | "stat-dir" | "stat-file" | "symlink" | "touch" | "truncate" | "unlink" | "utimes" | "write" | "write-all"): PlanThe plan of an operation for a store of capabilities.
logical.plansfunctionno test imports itfunction plans(facts: Facts): readonly Plan[]Every plan for a store of capabilities, in the order of the operations.
Factstypetype Facts = { readonly capabilities: ReadonlySet<Capability>; readonly policy: Policy };What a plan depends on: the capabilities of the store and the policy of the view.
Plantypeno test imports ittype Plan = {
readonly op: PlanOp;
readonly fidelity: Fidelity;
/** The operations of the store it may use. */
readonly steps: readonly OpName[];
/** What the operation does, in a sentence. */
readonly summary: string;
};How an operation is carried out.
planfunctionfunction plan(facts: Facts, op: "append" | "chmod" | "chown" | "close" | "fsync" | "link" | "mkdir" | "mmap" | "open-write" | "read-all" | "read-range" | "readdir" | "readlink" | "rename-dir" | "rename-file" | "rename-over" | "rm-r" | "rmdir" | "stat-dir" | "stat-file" | "symlink" | "touch" | "truncate" | "unlink" | "utimes" | "write" | "write-all"): PlanThe plan of an operation for a store of capabilities.
plansfunctionfunction plans(facts: Facts): readonly Plan[]Every plan for a store of capabilities, in the order of the operations.