IF Commons GitHub

governance/item

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

An item and what is folded from its events (0037-planning FR-001, FR-004): a sum of the kinds of item over one shared core, a state that is never stored as a fact, the links, the comments, the decisions and the changes that wait. A kind MAY add fields of its own and none removes a field of the core; today every kind is the core.

import type { Item } from "./item.ts";
const open = (i: Item) => i.state.kind === "open";

Source: commons/planning/src/governance/item.ts

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

governance.Statetypeno test imports it
type State =
  | { readonly kind: "proposed" }
  | { readonly kind: "open" }
  | { readonly kind: "in-progress" }
  | { readonly kind: "deferred"; readonly until: Day }
  | { readonly kind: "closed"; readonly reason: CloseReason; readonly at: Instant; readonly by: Actor };

The state of an item: a fold of its events, never stored.

governance.Linktypeno test imports it
type Link = { readonly kind: LinkKind; readonly from: ItemId; readonly to: ItemId };

A link of one item to another: the first blocks, is the same as, relates to or is the parent of the second.

governance.Commenttypeno test imports it
type Comment = { readonly id: EventId; readonly at: Instant; readonly actor: Actor; readonly body: string };

A remark on an item.

governance.Decisiontypeno test imports it
type Decision = { readonly id: EventId; readonly at: Instant; readonly actor: Actor; readonly verdict: Verdict; readonly note: string };

A verdict given on an item.

governance.Waitingtypeno test imports it
type Waiting = { readonly event: EventId; readonly field: AuthorityField; readonly by: Actor };

A change that an agent or a tool made to a field whose authority is person-only: it waits, and changes nothing, until a person makes the change.

governance.Coretypeno test imports it
type Core = { readonly id: ItemId; readonly title: string; readonly body: string; readonly labels: readonly stri… (647 characters)
type Core = {
  readonly id: ItemId;
  readonly title: string;
  readonly body: string;
  readonly labels: readonly string[];
  readonly assignees: readonly string[];
  readonly severity?: Severity;
  readonly origin: Origin;
  readonly state: State;
  readonly external: readonly ExternalId[];
  readonly links: readonly Link[];
  readonly comments: readonly Comment[];
  readonly decisions: readonly Decision[];
  readonly waiting: readonly Waiting[];
  readonly openedBy: Actor;
  readonly openedAt: Instant;
  readonly updatedAt: Instant;
  /** Its events, in the order they are folded. */
  readonly events: readonly ItemEvent[];
} & Carried;

What every item has, whatever its kind: the shared core, with what its source carried.

governance.ItemOftypeno test imports it
type ItemOf<K extends ItemKind> = Core & { readonly kind: K };

An item of one kind.

governance.Itemtypeno test imports it
type Item = { readonly [K in ItemKind]: ItemOf<K> }[ItemKind];

An item: a sum of the kinds over the shared core.

governance.Policytypeno test imports it
type Policy = {
  readonly authority: { readonly [F in AuthorityField]?: FieldAuthority };
  /** `any-person`: any person confirms a proposal; `principal`: only the principal of the event that proposed it. */
  readonly confirmers: "any-person" | "principal";
};

The authority over each field that a configuration sets, and who may confirm a proposal (0037-planning FR-006, FR-012). A field with no authority is latest-wins.

governance.DEFAULT_POLICYconstno test imports it
const DEFAULT_POLICY: Policy

The policy where a configuration says nothing.

governance.isCountedfunctionno test imports it
function isCounted(item: Item): boolean

Whether an item is counted by a view or a query that is not told to include proposals (0037-planning FR-006).

Statetypeno test imports it
type State =
  | { readonly kind: "proposed" }
  | { readonly kind: "open" }
  | { readonly kind: "in-progress" }
  | { readonly kind: "deferred"; readonly until: Day }
  | { readonly kind: "closed"; readonly reason: CloseReason; readonly at: Instant; readonly by: Actor };

The state of an item: a fold of its events, never stored.

Linktypeno test imports it
type Link = { readonly kind: LinkKind; readonly from: ItemId; readonly to: ItemId };

A link of one item to another: the first blocks, is the same as, relates to or is the parent of the second.

Commenttypeno test imports it
type Comment = { readonly id: EventId; readonly at: Instant; readonly actor: Actor; readonly body: string };

A remark on an item.

Decisiontypeno test imports it
type Decision = { readonly id: EventId; readonly at: Instant; readonly actor: Actor; readonly verdict: Verdict; readonly note: string };

A verdict given on an item.

Waitingtypeno test imports it
type Waiting = { readonly event: EventId; readonly field: AuthorityField; readonly by: Actor };

A change that an agent or a tool made to a field whose authority is person-only: it waits, and changes nothing, until a person makes the change.

Coretypeno test imports it
type Core = { readonly id: ItemId; readonly title: string; readonly body: string; readonly labels: readonly stri… (647 characters)
type Core = {
  readonly id: ItemId;
  readonly title: string;
  readonly body: string;
  readonly labels: readonly string[];
  readonly assignees: readonly string[];
  readonly severity?: Severity;
  readonly origin: Origin;
  readonly state: State;
  readonly external: readonly ExternalId[];
  readonly links: readonly Link[];
  readonly comments: readonly Comment[];
  readonly decisions: readonly Decision[];
  readonly waiting: readonly Waiting[];
  readonly openedBy: Actor;
  readonly openedAt: Instant;
  readonly updatedAt: Instant;
  /** Its events, in the order they are folded. */
  readonly events: readonly ItemEvent[];
} & Carried;

What every item has, whatever its kind: the shared core, with what its source carried.

ItemOftypeno test imports it
type ItemOf<K extends ItemKind> = Core & { readonly kind: K };

An item of one kind.

Itemtypeno test imports it
type Item = { readonly [K in ItemKind]: ItemOf<K> }[ItemKind];

An item: a sum of the kinds over the shared core.

Policytypeno test imports it
type Policy = {
  readonly authority: { readonly [F in AuthorityField]?: FieldAuthority };
  /** `any-person`: any person confirms a proposal; `principal`: only the principal of the event that proposed it. */
  readonly confirmers: "any-person" | "principal";
};

The authority over each field that a configuration sets, and who may confirm a proposal (0037-planning FR-006, FR-012). A field with no authority is latest-wins.

DEFAULT_POLICYconstno test imports it
const DEFAULT_POLICY: Policy

The policy where a configuration says nothing.

isCountedfunctionno test imports it
function isCounted(item: Item): boolean

Whether an item is counted by a view or a query that is not told to include proposals (0037-planning FR-006).

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