IF Commons GitHub

logical/plans

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-anyfs-cli-logical FR-011, 0003-anyfs-cli-logical FR-012

How a plan and a report of the bridge are written for a person and as data (commons anyfs-cli 0003-anyfs-cli-logical FR-011, FR-012): the counts by kind of action, the bytes, what would be lost and the hash that approves the plan, then each action in a line. And the refusals of the bridge as the problems of the catalogue, each with the command that fixes it. Pure functions over the types of the bridge.

import { planLines } from "./plans.ts";
// planLines(plan).at(-1) // "plan sha256:..."

Source: commons/anyfs-cli/src/logical/plans.ts

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

countsOffunctionno test imports it
function countsOf(actions: readonly Action[]): readonly { readonly kind: "conflict" | "create" | "delete" | "remove-source" | "rename" | "skip" | "update"; readonly count: number; }[]

How many actions of each kind a plan has, in the order a plan lists them, leaving out the kinds with none.

planLinesfunction
function planLines(plan: Plan, limit?: number): readonly string[]

The lines that say what a plan does: a header, each action, the losses, the bytes and its hash.

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

refusalProblemfunctionno test imports it
function refusalProblem(refusal: PlanRefusal): Problem

The problem a refused plan is.

applyRefusalProblemfunction
function applyRefusalProblem(refusal: ApplyRefusal): Problem

The problem an apply that did not start is.

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

reportLinesfunctionno test imports it
function reportLines(report: Report): readonly string[]

The lines that say what an apply did.

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