IF Commons GitHub

governance/verbs

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-anyfs-cli-governance FR-001, 0002-anyfs-cli-governance FR-002

The verbs of the anyfs program as facts (commons anyfs-cli 0002-anyfs-cli-governance FR-001, FR-002; commons headless 0002-headless-governance, 0005-reach-and-targets): each verb is declared once, with what it is (a report or an action), what it may do to the world (read, mutate, destructive), whether repeating it is safe, whether it previews, the tier that may see it and the reach policy that says through which channels it comes and how a destruction is confirmed. The command line, the tool server and the documentation read this one table; a test holds that its facts do not contradict each other.

import { VERBS, verbIds } from "./verbs.ts";
VERBS["rm"].effect; // "destructive"
verbIds().includes("ls"); // true

Source: commons/anyfs-cli/src/governance/verbs.ts

4 of 6 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

VerbIdtypeno test imports it
type VerbId = | "ls" | "cat" | "stat" | "head" | "tail" | "find" | "du" | "tree" | "grep" | "diff" … (467 characters)
type VerbId =
  | "ls"
  | "cat"
  | "stat"
  | "head"
  | "tail"
  | "find"
  | "du"
  | "tree"
  | "grep"
  | "diff"
  | "sha256sum"
  | "put"
  | "mkdir"
  | "touch"
  | "cp"
  | "mv"
  | "rm"
  | "sync"
  | "bisync"
  | "merge"
  | "sync-medium"
  | "check"
  | "mirror status"
  | "mirror sync"
  | "mirror promote"
  | "serve"
  | "keygen"
  | "roster show"
  | "roster add"
  | "roster publish"
  | "roster fetch"
  | "roster rotate"
  | "places"
  | "doctor";

The words of every verb of the program, as a person types them: a closed union.

VerbFactstypeno test imports it
type VerbFacts = { readonly id: VerbId; readonly summary: string; readonly kind: Kind; readonly effect: Effect; … (621 characters)
type VerbFacts = {
  readonly id: VerbId;
  readonly summary: string;
  readonly kind: Kind;
  readonly effect: Effect;
  /** Whether running it again with the same input changes nothing more. */
  readonly idempotent: boolean;
  /** Whether `--dry-run` previews what it would change. */
  readonly dryRun: boolean;
  /** The lowest tier that sees it. */
  readonly tier: TierId;
  /** The channels it comes through. */
  readonly channels: readonly Channel[];
  /** How it is confirmed: a destruction by a flag from a person (and, from a tool server, only as a preview). */
  readonly confirmation: ConfirmationClass;
};

What a verb is.

LOCAL_ONLY_VERBSconst
const LOCAL_ONLY_VERBS: readonly VerbId[]

The verbs that come through the command line only: they open a listener or hold, make or change keys, which a tool server never does for an agent.

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

VERBSconst
const VERBS: Readonly<Record<VerbId, VerbFacts>>

Every verb, by its words: a registry the compiler holds complete.

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

VERB_IDSconst
const VERB_IDS: readonly VerbId[]

The ids of the verbs, in the order they are listed.

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

verbIdsfunction
function verbIds(): readonly VerbId[]

The ids of the verbs, in the order they are listed.

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

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