IF Commons GitHub

governance/mod

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-planning-query-relations FR-001

The Governance layer of Planning Query: the relations as data (0002-planning-query-relations FR-001, FR-002). A relation has a name, a sentence and columns; each column has a name, a type and a sentence. The catalog the guard binds a statement to, the help that lists the relations and the rows are all made from these lists, so that no column is described twice.

import { relationNamed } from "./mod.ts";
relationNamed("issues")?.columns.map((c) => c.name).includes("opened_at"); // true

Source: commons/planning-query/src/governance/mod.ts

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

governancenamespace
namespace governance
governance.ColumnTypetypeno test imports it
type ColumnType = "int" | "text" | "bool" | "timestamp";

The types of a column: whole numbers, text, true or false, and an instant or a day as text in ISO 8601 (which sorts as time does).

governance.Columntypeno test imports it
type Column<N extends string = string> = { readonly name: N; readonly type: ColumnType; readonly summary: string };

A column: its name, its type and a sentence.

governance.ISSUE_COLUMNSconstno test imports it
const ISSUE_COLUMNS: readonly [Column<"id">, Column<"kind">, Column<"title">, Column<"body">, Column<"state">, Column<"r… (520 characters)
const ISSUE_COLUMNS: readonly [Column<"id">, Column<"kind">, Column<"title">, Column<"body">, Column<"state">, Column<"reason">, Column<"until">, Column<"severity">, Column<"source_severity">, Column<"blocker">, Column<"origin">, Column<"labels">, Column<"assignees">, Column<"external">, Column<"comments">, Column<"links">, Column<"opened_by">, Column<"opened_at">, Column<"updated_at">, Column<"motivation">, Column<"priority">, Column<"size">, Column<"goals">, Column<"engines">, Column<"cites">, Column<"evidence">]

The columns of issues, in order: one for each field of the core of an item and for its state, and the monorepo's (id, title, state, reason, severity, blocker, labels, assignees, comments, opened_at, updated_at).

governance.EVENT_COLUMNSconstno test imports it
const EVENT_COLUMNS: readonly [Column<"id">, Column<"issue">, Column<"type">, Column<"at">, Column<"actor">, Column<"actor_kind">, Column<"principal">]

The columns of events.

governance.LINK_COLUMNSconstno test imports it
const LINK_COLUMNS: readonly [Column<"from_issue">, Column<"to_issue">, Column<"kind">]

The columns of links.

governance.TRACE_COLUMNSconstno test imports it
const TRACE_COLUMNS: readonly [Column<"issue">, Column<"source">, Column<"fingerprint">, Column<"locator">, Column<"presence">, Column<"content_hash">]

The columns of traces.

governance.Relationtypeno test imports it
type Relation = { readonly name: string; readonly summary: string; readonly columns: readonly Column[] };

A relation of the library.

governance.RELATIONSconstno test imports it
const RELATIONS: readonly Relation[]

Every relation, in the order the help lists them.

governance.relationNamedfunctionno test imports it
function relationNamed(name: string): Relation | undefined

The relation of a name, or nothing.

ColumnTypetypeno test imports it
type ColumnType = "int" | "text" | "bool" | "timestamp";

The types of a column: whole numbers, text, true or false, and an instant or a day as text in ISO 8601 (which sorts as time does).

Columntypeno test imports it
type Column<N extends string = string> = { readonly name: N; readonly type: ColumnType; readonly summary: string };

A column: its name, its type and a sentence.

ISSUE_COLUMNSconst
const ISSUE_COLUMNS: readonly [Column<"id">, Column<"kind">, Column<"title">, Column<"body">, Column<"state">, Column<"r… (520 characters)
const ISSUE_COLUMNS: readonly [Column<"id">, Column<"kind">, Column<"title">, Column<"body">, Column<"state">, Column<"reason">, Column<"until">, Column<"severity">, Column<"source_severity">, Column<"blocker">, Column<"origin">, Column<"labels">, Column<"assignees">, Column<"external">, Column<"comments">, Column<"links">, Column<"opened_by">, Column<"opened_at">, Column<"updated_at">, Column<"motivation">, Column<"priority">, Column<"size">, Column<"goals">, Column<"engines">, Column<"cites">, Column<"evidence">]

The columns of issues, in order: one for each field of the core of an item and for its state, and the monorepo's (id, title, state, reason, severity, blocker, labels, assignees, comments, opened_at, updated_at).

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

EVENT_COLUMNSconst
const EVENT_COLUMNS: readonly [Column<"id">, Column<"issue">, Column<"type">, Column<"at">, Column<"actor">, Column<"actor_kind">, Column<"principal">]

The columns of events.

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

LINK_COLUMNSconst
const LINK_COLUMNS: readonly [Column<"from_issue">, Column<"to_issue">, Column<"kind">]

The columns of links.

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

TRACE_COLUMNSconst
const TRACE_COLUMNS: readonly [Column<"issue">, Column<"source">, Column<"fingerprint">, Column<"locator">, Column<"presence">, Column<"content_hash">]

The columns of traces.

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

Relationtypeno test imports it
type Relation = { readonly name: string; readonly summary: string; readonly columns: readonly Column[] };

A relation of the library.

RELATIONSconst
const RELATIONS: readonly Relation[]

Every relation, in the order the help lists them.

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

relationNamedfunction
function relationNamed(name: string): Relation | undefined

The relation of a name, or nothing.

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

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