IF Commons GitHub

logical/plan

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-anyfs-posix-logical FR-001, 0003-anyfs-posix-logical FR-002

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 deletes

Source: commons/anyfs-posix/src/logical/plan.ts

3 of 8 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.Factstypeno test imports it
type 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 it
type 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 it
function 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"): Plan

The plan of an operation for a store of capabilities.

logical.plansfunctionno test imports it
function plans(facts: Facts): readonly Plan[]

Every plan for a store of capabilities, in the order of the operations.

Factstype
type Facts = { readonly capabilities: ReadonlySet<Capability>; readonly policy: Policy };

What a plan depends on: the capabilities of the store and the policy of the view.

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

Plantypeno test imports it
type 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.

planfunction
function 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"): Plan

The plan of an operation for a store of capabilities.

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

plansfunction
function plans(facts: Facts): readonly Plan[]

Every plan for a store of capabilities, in the order of the operations.

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

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