IF Commons GitHub

governance/problems

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-repoctl-governance FR-004

The problem codes of Repoctl and what each means (commons repoctl 0002-repoctl-governance FR-004; commons headless 0003-headless-output FR-008): every problem a run can raise is one of a closed union of codes, and each code has an explanation (a title, what happened, the likely cause and the fix) that repoctl explain <code> prints and the documentation renders. The registry holds one entry for every code, which the compiler checks.

import { CATALOGUE, isProblemCode } from "./problems.ts";
isProblemCode("E-STALE-GENERATED"); // true
CATALOGUE["E-STALE-GENERATED"].fix; // "repoctl sync"

Source: commons/repoctl/src/governance/problems.ts

3 of 10 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.Explainedtypeno test imports it
type Explained = { readonly title: string; readonly what: string; readonly why: string; readonly fix: string };

What repoctl explain says of a code: the shape of Headless' explanation, held here so that the governance imports no more than it needs.

governance.ProblemCodetypeno test imports it
type ProblemCode = | "E-USAGE" | "E-ENVIRONMENT" | "E-STALE-GENERATED" | "E-GENERATOR-FAILED" | "E-SPEC-KIT" … (1185 characters)
type ProblemCode =
  | "E-USAGE"
  | "E-ENVIRONMENT"
  | "E-STALE-GENERATED"
  | "E-GENERATOR-FAILED"
  | "E-SPEC-KIT"
  | "E-MIZAN-RULE"
  | "E-VERSIONS"
  | "E-ACCEPTANCE"
  | "E-TYPES"
  | "E-VERSION-CONSTANT"
  | "E-UNDECLARED-DEPENDENCY"
  | "E-LIBRARY-CHECK"
  | "E-MERGE-FAILED"
  | "E-MERGE-CONFLICT"
  | "E-REGENERATE-FAILED"
  | "E-NPM-UNREACHABLE"
  | "E-RELEASE-RECORD"
  | "E-RELEASE-FAILED"
  | "E-PUBLISH-REFUSED"
  | "E-NO-TOKEN"
  | "E-NO-TARBALL"
  | "E-PUBLISH-FAILED"
  | "E-COMMIT-SUBJECT"
  | "E-COMMIT-REFS"
  | "E-COMMIT-IMPACT"
  | "E-COMMIT-SESSION"
  | "E-COMMIT-FORBIDDEN"
  | "E-COMMIT-NOTHING"
  | "E-COMMIT-FAILED"
  | "E-LIBRARY-NAME"
  | "E-LIBRARY-RESERVED"
  | "E-LIBRARY-EXISTS"
  | "E-DOCTOR-INSTALL"
  | "E-DOCTOR-LINKS"
  | "E-DOCTOR-NODE"
  | "E-DOCTOR-BUN"
  | "E-DOCTOR-GIT"
  | "E-HYGIENE-GIT"
  | "E-HYGIENE-PATH"
  | "E-HYGIENE-IMPORT"
  | "E-HYGIENE-VENDORED"
  | "E-HYGIENE-DUPLICATE"
  | "E-HYGIENE-RANGE"
  | "E-HYGIENE-IDENTITY"
  | "E-PROVE-FAILED"
  | "E-PROVE-QUARANTINE"
  | "E-CHECK-FAILED"
  | "E-CONFIG-MISSING"
  | "E-CONFIG-LOAD"
  | "E-CONFIG-INVALID"
  | "E-DOCS-GENERATOR-MISSING"
  | "E-DOCS-FAILED"
  | "E-USAGE-UNKNOWN";

The code of every problem: a closed union.

governance.PROBLEM_CODESconstno test imports it
const PROBLEM_CODES: readonly ProblemCode[]

Every code, in the order the explanations are listed.

governance.isProblemCodefunctionno test imports it
function isProblemCode(text: string): text is ProblemCode

Whether a text is one of the codes.

governance.CATALOGUEconstno test imports it
const CATALOGUE: Readonly<Record<ProblemCode, Explained>>

The explanation of every code: a registry the compiler holds complete.

Explainedtypeno test imports it
type Explained = { readonly title: string; readonly what: string; readonly why: string; readonly fix: string };

What repoctl explain says of a code: the shape of Headless' explanation, held here so that the governance imports no more than it needs.

ProblemCodetypeno test imports it
type ProblemCode = | "E-USAGE" | "E-ENVIRONMENT" | "E-STALE-GENERATED" | "E-GENERATOR-FAILED" | "E-SPEC-KIT" … (1185 characters)
type ProblemCode =
  | "E-USAGE"
  | "E-ENVIRONMENT"
  | "E-STALE-GENERATED"
  | "E-GENERATOR-FAILED"
  | "E-SPEC-KIT"
  | "E-MIZAN-RULE"
  | "E-VERSIONS"
  | "E-ACCEPTANCE"
  | "E-TYPES"
  | "E-VERSION-CONSTANT"
  | "E-UNDECLARED-DEPENDENCY"
  | "E-LIBRARY-CHECK"
  | "E-MERGE-FAILED"
  | "E-MERGE-CONFLICT"
  | "E-REGENERATE-FAILED"
  | "E-NPM-UNREACHABLE"
  | "E-RELEASE-RECORD"
  | "E-RELEASE-FAILED"
  | "E-PUBLISH-REFUSED"
  | "E-NO-TOKEN"
  | "E-NO-TARBALL"
  | "E-PUBLISH-FAILED"
  | "E-COMMIT-SUBJECT"
  | "E-COMMIT-REFS"
  | "E-COMMIT-IMPACT"
  | "E-COMMIT-SESSION"
  | "E-COMMIT-FORBIDDEN"
  | "E-COMMIT-NOTHING"
  | "E-COMMIT-FAILED"
  | "E-LIBRARY-NAME"
  | "E-LIBRARY-RESERVED"
  | "E-LIBRARY-EXISTS"
  | "E-DOCTOR-INSTALL"
  | "E-DOCTOR-LINKS"
  | "E-DOCTOR-NODE"
  | "E-DOCTOR-BUN"
  | "E-DOCTOR-GIT"
  | "E-HYGIENE-GIT"
  | "E-HYGIENE-PATH"
  | "E-HYGIENE-IMPORT"
  | "E-HYGIENE-VENDORED"
  | "E-HYGIENE-DUPLICATE"
  | "E-HYGIENE-RANGE"
  | "E-HYGIENE-IDENTITY"
  | "E-PROVE-FAILED"
  | "E-PROVE-QUARANTINE"
  | "E-CHECK-FAILED"
  | "E-CONFIG-MISSING"
  | "E-CONFIG-LOAD"
  | "E-CONFIG-INVALID"
  | "E-DOCS-GENERATOR-MISSING"
  | "E-DOCS-FAILED"
  | "E-USAGE-UNKNOWN";

The code of every problem: a closed union.

PROBLEM_CODESconst
const PROBLEM_CODES: readonly ProblemCode[]

Every code, in the order the explanations are listed.

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

isProblemCodefunction
function isProblemCode(text: string): text is ProblemCode

Whether a text is one of the codes.

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

CATALOGUEconst
const CATALOGUE: Readonly<Record<ProblemCode, Explained>>

The explanation of every code: a registry the compiler holds complete.

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

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