IF Commons GitHub

standards

The standards-first rules about terms (commons 0018-standards-first FR-003 to FR-005): a term that rests on a standard names its term, an unaligned term carries a justification, and its decision is due within 90 days of the day the term was added: within the 90 days its absence is a finding the baseline may hold, after them it is a finding that fails whatever the baseline holds.

Pure functions over the records of terms and a day (YYYY-MM-DD), so that the answer does not depend on the clock. The days are counted between calendar dates in UTC.

import { termFindings } from "./standards.ts";
termFindings([{ iri: "https://x/T", basis: "unaligned", justification: "none found", addedOn: "2026-01-01", decision: false }], "2026-06-01").map((f) => f.rule);
// ["mizan/decision-overdue"]

Source: commons/mizan/src/standards.ts

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

basisMissingfunction
function basisMissing(ontology: readonly string[], recorded: readonly string[], file?: string): readonly MizanFinding[]

A term of an ontology that has no record of its basis (0018-standards-first FR-003, 0012-ontology FR-014): such a finding fails whatever the baseline holds.

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

daysBetweenfunction
function daysBetween(from: string, to: string): number | undefined

The whole days from one YYYY-MM-DD to another, or undefined where either is not a day.

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

GRACE_DAYSconstno test imports it
const GRACE_DAYS: 90

The days a decision may follow the term that needs it (0018-standards-first FR-005).

termFindingsfunction
function termFindings(terms: readonly TermRecord[], today: string, file?: string): readonly MizanFinding[]

The findings of the rules about terms, as of today; file is where the terms are stated.

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

BasisKindtypeno test imports it
type BasisKind = "adopts" | "specializes" | "maps" | "unaligned";

How a term relates to a standard (0018-standards-first FR-003).

TermRecordtypeno test imports it
type TermRecord = { readonly iri: string; readonly basis: BasisKind; /** The IRI of the standard's term, for a ter… (890 characters)
type TermRecord = {
  readonly iri: string;
  readonly basis: BasisKind;
  /** The IRI of the standard's term, for a term that has one. */
  readonly standardTerm?: string;
  /** Why no standard names the term, for an `unaligned` one. */
  readonly justification?: string;
  /** The day (`YYYY-MM-DD`) the term was added, from which its decision is due. */
  readonly addedOn?: string;
  /** Whether a `Decision` is linked to the term. */
  readonly decision: boolean;
  /** The day (`YYYY-MM-DD`) the term was deprecated, and the IRI of the term that replaces it (0012-ontology, 0018-standards-first). */
  readonly deprecatedOn?: string;
  readonly replacedBy?: string;
  /** The specifications, or requirements (`NNNN-slug FR-nnn`), that define the term (`mz:definedBy`), for the requirement-to-term stage of the trace (0003-mizan FR-044). */
  readonly definedBy?: readonly string[];
};

A term of an ontology and what it rests on, as the rules read it.

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