changes.BEGINconstno test imports itconst BEGIN: "<!-- capabilities:begin -->"The marker that opens the generated view.
The view of the capabilities that touch each rung (commons 0020-ifccm FR-016, FR-017), generated between the markers <!-- capabilities:begin --> and <!-- capabilities:end --> of a harness's document, and the check that the document still holds it (--check). The view is an axis across the ladder and no rung of it.
Pure text in, text out. A capability states its rungs (ifccm:touchesRung) and its last revision; a rung states the commands that prove it (mz:provedBy). A capability is shown as proved on a rung when every one of the rung's commands has a passing run at the capability's last revision, and as open on it otherwise (0016-ladder FR-003); a rung that names no command cannot be proved, so a capability that touches it is open there. The view lists only the rungs some capability touches, in the order the rungs are given, and the capabilities of a rung by number.
import { viewOf } from "./capability-view.ts";
viewOf([{ id: "rung-5", label: "Checks", provedBy: ["bun test"] }], [{ id: 10, title: "The check", touchesRung: ["rung-5"], lastRevision: "abc1234" }], []);
// "### Checks (rung-5)\n\n- #10 The check: open, `bun test` has no passing run at abc1234\n"changes.BEGINconstno test imports itconst BEGIN: "<!-- capabilities:begin -->"The marker that opens the generated view.
changes.decodeViewRecordfunctionno test imports itfunction decodeViewRecord(source: string, capabilitiesRequired?: boolean): Result<ViewRecord, string>The record of a harness's capabilities read from its file's text (export const rungs, export const capabilities and, where it has them, export const runs), as data and never run. The offline view derives its capabilities from the commits (0020-ifccm FR-035), and then the file needs no capabilities (capabilitiesRequired false). The runs are stated here until the quality records of 0021-ifqs are read in their place.
changes.ENDconstno test imports itconst END: "<!-- capabilities:end -->"The marker that closes it.
changes.formatViewErrorfunctionno test imports itfunction formatViewError(e: ViewError): stringA view error as a sentence.
changes.isProvedfunctionno test imports itfunction isProved(rung: RungRecord, revision: string, runs: readonly CommandRun[]): booleanWhether every command of a rung has a passing run at the revision; a rung with no command is not proved.
changes.spliceViewfunctionno test imports itfunction spliceView(document: string, view: string): Result<string, ViewError>The document with the view between its markers.
changes.viewIsCurrentfunctionno test imports itfunction viewIsCurrent(document: string, view: string): Result<boolean, ViewError>Whether the document holds the view as it would be generated (--check): ok(true) where it does, ok(false) where it differs.
changes.viewOffunctionno test imports itfunction viewOf(rungs: readonly RungRecord[], capabilities: readonly CapabilityRecord[], runs: readonly CommandRun[]): stringThe view: for each rung some capability touches, in the order of rungs, the capabilities that touch it and whether each is proved or open there.
changes.CapabilityRecordtypeno test imports ittype CapabilityRecord = {
readonly id: number;
readonly title: string;
readonly touchesRung: readonly string[];
readonly lastRevision: string;
};A capability as the view reads it: its change request's number, its title, the rungs it touches and the last revision of its work.
changes.CommandRuntypeno test imports ittype CommandRun = { readonly command: string; readonly revision: string; readonly passed: boolean };A run of a rung's command at a revision.
changes.RungRecordtypeno test imports ittype RungRecord = {
readonly id: string;
readonly label: string;
readonly provedBy: readonly string[];
readonly homes?: readonly string[];
};A rung as the view reads it: its identifier, its label, the commands that prove it and, where the offline trace places files on it, its homes (0020-ifccm FR-035).
changes.ViewErrortypeno test imports ittype ViewError = { readonly kind: "no-markers" } | { readonly kind: "misplaced-markers" };Why a document cannot hold the view.
changes.ViewRecordtypeno test imports ittype ViewRecord = {
readonly rungs: readonly RungRecord[];
readonly capabilities: readonly CapabilityRecord[];
readonly runs: readonly CommandRun[];
};What a harness states for the view: its rungs, its capabilities and the runs of the rungs' commands.
BEGINconstconst BEGIN: "<!-- capabilities:begin -->"The marker that opens the generated view.
decodeViewRecordfunctionfunction decodeViewRecord(source: string, capabilitiesRequired?: boolean): Result<ViewRecord, string>The record of a harness's capabilities read from its file's text (export const rungs, export const capabilities and, where it has them, export const runs), as data and never run. The offline view derives its capabilities from the commits (0020-ifccm FR-035), and then the file needs no capabilities (capabilitiesRequired false). The runs are stated here until the quality records of 0021-ifqs are read in their place.
ENDconstconst END: "<!-- capabilities:end -->"The marker that closes it.
formatViewErrorfunctionno test imports itfunction formatViewError(e: ViewError): stringA view error as a sentence.
isProvedfunctionfunction isProved(rung: RungRecord, revision: string, runs: readonly CommandRun[]): booleanWhether every command of a rung has a passing run at the revision; a rung with no command is not proved.
spliceViewfunctionfunction spliceView(document: string, view: string): Result<string, ViewError>The document with the view between its markers.
viewIsCurrentfunctionfunction viewIsCurrent(document: string, view: string): Result<boolean, ViewError>Whether the document holds the view as it would be generated (--check): ok(true) where it does, ok(false) where it differs.
viewOffunctionfunction viewOf(rungs: readonly RungRecord[], capabilities: readonly CapabilityRecord[], runs: readonly CommandRun[]): stringThe view: for each rung some capability touches, in the order of rungs, the capabilities that touch it and whether each is proved or open there.
CapabilityRecordtypeno test imports ittype CapabilityRecord = {
readonly id: number;
readonly title: string;
readonly touchesRung: readonly string[];
readonly lastRevision: string;
};A capability as the view reads it: its change request's number, its title, the rungs it touches and the last revision of its work.
CommandRuntypeno test imports ittype CommandRun = { readonly command: string; readonly revision: string; readonly passed: boolean };A run of a rung's command at a revision.
RungRecordtypeno test imports ittype RungRecord = {
readonly id: string;
readonly label: string;
readonly provedBy: readonly string[];
readonly homes?: readonly string[];
};A rung as the view reads it: its identifier, its label, the commands that prove it and, where the offline trace places files on it, its homes (0020-ifccm FR-035).
ViewErrortypeno test imports ittype ViewError = { readonly kind: "no-markers" } | { readonly kind: "misplaced-markers" };Why a document cannot hold the view.
ViewRecordtypeno test imports ittype ViewRecord = {
readonly rungs: readonly RungRecord[];
readonly capabilities: readonly CapabilityRecord[];
readonly runs: readonly CommandRun[];
};What a harness states for the view: its rungs, its capabilities and the runs of the rungs' commands.