IF Commons GitHub

logical/links

Written to: 1 requirement: 0 proved, 0 partly, 0 failing, 1 with no test recorded. 0002-planning-core FR-007

The links between items and the rule that the links of kind blocks make a graph with no cycle (0037-planning FR-009): a link that would close a cycle is refused with the items of the cycle named. The graph is the order of core, order, which finds a cycle or an order in which each item comes after the items that block it.

import { addLink } from "./links.ts";
// addLink(links, { kind: "blocks", from: a, to: b }) is a Result of the links, or of a cycle that names its items

Source: commons/planning/src/logical/links.ts

0 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.

logical.LinkProblemtypeno test imports it
type LinkProblem = { readonly kind: "cycle"; readonly items: readonly ItemId[] } | { readonly kind: "self-link"; readonly item: ItemId };

Why a link is refused: it would close a cycle of blocks, or it links an item to itself.

logical.findBlocksCyclefunctionno test imports it
function findBlocksCycle(links: readonly Link[]): readonly ItemId[] | undefined

The cycle of blocks among the links, its items in order, or nothing where there is none.

logical.addLinkfunctionno test imports it
function addLink(links: readonly Link[], link: Link): Result<readonly Link[], LinkProblem>

The links with one more, or why it is refused. Adding a link that is already there changes nothing.

LinkProblemtypeno test imports it
type LinkProblem = { readonly kind: "cycle"; readonly items: readonly ItemId[] } | { readonly kind: "self-link"; readonly item: ItemId };

Why a link is refused: it would close a cycle of blocks, or it links an item to itself.

findBlocksCyclefunctionno test imports it
function findBlocksCycle(links: readonly Link[]): readonly ItemId[] | undefined

The cycle of blocks among the links, its items in order, or nothing where there is none.

addLinkfunctionno test imports it
function addLink(links: readonly Link[], link: Link): Result<readonly Link[], LinkProblem>

The links with one more, or why it is refused. Adding a link that is already there changes nothing.

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