IF Commons GitHub

logical/order

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-repoctl-sync FR-001

The order of the generators (commons repoctl 0003-repoctl-sync FR-001): a generator comes after every generator it declares in after and every generator that writes something it reads, which the globs of the table say, and where the facts do not order two of them the table's own order stands. A table in which generators wait for one another is refused with the ones that do. Pure: the same table gives the same order.

import { GENERATORS } from "@intellectual-frontiers/repoctl/governance";
import { orderGenerators } from "./order.ts";
const r = orderGenerators(GENERATORS);
r.kind === "ok" && r.value[0]?.id; // "libraries"

Source: commons/repoctl/src/logical/order.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.readsfunctionno test imports it
function reads(later: Generator, earlier: Generator): boolean

Whether later comes after earlier: it declares it in after, or it reads something that earlier writes.

logical.orderGeneratorsfunctionno test imports it
function orderGenerators(table: readonly Generator[]): Result<readonly Generator[], readonly StepId[]>

The generators in the order they are run, or the ids of those that wait for one another.

logical.generatorOffunctionno test imports it
function generatorOf(table: readonly Generator[], path: string): Generator | undefined

The generator that writes a path (from the repository's root, with /), the first of the table where two globs match it; none where no generator writes it.

logical.fixOffunctionno test imports it
function fixOf(g: Generator): string

The command that fixes a stale generator, as a person types it.

readsfunction
function reads(later: Generator, earlier: Generator): boolean

Whether later comes after earlier: it declares it in after, or it reads something that earlier writes.

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

orderGeneratorsfunction
function orderGenerators(table: readonly Generator[]): Result<readonly Generator[], readonly StepId[]>

The generators in the order they are run, or the ids of those that wait for one another.

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

generatorOffunction
function generatorOf(table: readonly Generator[], path: string): Generator | undefined

The generator that writes a path (from the repository's root, with /), the first of the table where two globs match it; none where no generator writes it.

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

fixOffunctionno test imports it
function fixOf(g: Generator): string

The command that fixes a stale generator, as a person types it.

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