IF Commons GitHub

governance/ids

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

The identities of Repoctl as types that cannot be made wrong (commons repoctl 0002-repoctl-governance FR-001): a library name, a version, an issue number, a session address, a commit subject and a Git reference are values of a branded type, each made only by its smart constructor, which says why a text is not one. A function that takes one never checks again.

import { parseLibraryName, parseSemver } from "./ids.ts";
parseLibraryName("repoctl").kind; // "ok"
parseSemver("1.2").kind; // "err"

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

7 of 38 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.LibraryNametypeno test imports it
type LibraryName = Brand<string, "library name">;

The name of a library of commons: its folder and the end of its package name.

governance.Semvertypeno test imports it
type Semver = Brand<string, "semver">;

A version of Semantic Versioning, with an optional pre-release and build part.

governance.IssueNumbertypeno test imports it
type IssueNumber = Brand<string, "issue number">;

The number of an issue of the repository, in digits.

governance.SessionUrltypeno test imports it
type SessionUrl = Brand<string, "session url">;

The address of a Claude Code session: https, with a host and no credential.

governance.CommitSubjecttypeno test imports it
type CommitSubject = Brand<string, "commit subject">;

The subject line of a commit: one line of at most 100 characters that does not end with a full stop.

governance.GitReftypeno test imports it
type GitRef = Brand<string, "git ref">;

A name Git accepts for a branch, a tag or a remote reference, which does not begin with a dash.

governance.StepIdtypeno test imports it
type StepId = Brand<string, "step id">;

The name of a generator or of a check of a repository's configuration: lower-case words, digits, hyphens and colons.

governance.VariableNametypeno test imports it
type VariableName = Brand<string, "variable name">;

The name of an environment variable: capitals, digits and underscores, not starting with a digit.

governance.parseLibraryNamefunctionno test imports it
function parseLibraryName(text: string): Result<LibraryName, string>

A library name from text, or why the text is not one.

governance.parseSemverfunctionno test imports it
function parseSemver(text: string): Result<Semver, string>

A version from text, or why the text is not one.

governance.parseIssueNumberfunctionno test imports it
function parseIssueNumber(text: string): Result<IssueNumber, string>

An issue number from text (10 or #10), or why the text is not one.

governance.COMMIT_IMPACTSconstno test imports it
const COMMIT_IMPACTS: readonly ["patch", "minor", "major"]

The impacts a commit may state on its Impact: line (commons 0026-works-versioning FR-021): a closed union, least first.

governance.CommitImpacttypeno test imports it
type CommitImpact = (typeof COMMIT_IMPACTS)[number];

The impact a commit states: how much the release raises the version of a library the commit changes.

governance.parseCommitImpactfunctionno test imports it
function parseCommitImpact(text: string): Result<"major" | "minor" | "patch", string>

An impact from text (major, minor or patch), or why the text is not one.

governance.parseSessionUrlfunctionno test imports it
function parseSessionUrl(text: string): Result<SessionUrl, string>

A session address from text, or why the text is not one.

governance.parseSubjectfunctionno test imports it
function parseSubject(text: string): Result<CommitSubject, string>

A commit subject from text, or why the text is not one.

governance.parseGitReffunctionno test imports it
function parseGitRef(text: string): Result<GitRef, string>

A Git reference from text, or why the text is not one.

governance.parseStepIdfunctionno test imports it
function parseStepId(text: string): Result<StepId, string>

The name of a generator or of a check from text, or why the text is not one.

governance.parseVariableNamefunctionno test imports it
function parseVariableName(text: string): Result<VariableName, string>

The name of an environment variable from text, or why the text is not one.

LibraryNametype
type LibraryName = Brand<string, "library name">;

The name of a library of commons: its folder and the end of its package name.

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

Semvertypeno test imports it
type Semver = Brand<string, "semver">;

A version of Semantic Versioning, with an optional pre-release and build part.

IssueNumbertypeno test imports it
type IssueNumber = Brand<string, "issue number">;

The number of an issue of the repository, in digits.

SessionUrltypeno test imports it
type SessionUrl = Brand<string, "session url">;

The address of a Claude Code session: https, with a host and no credential.

CommitSubjecttypeno test imports it
type CommitSubject = Brand<string, "commit subject">;

The subject line of a commit: one line of at most 100 characters that does not end with a full stop.

GitReftypeno test imports it
type GitRef = Brand<string, "git ref">;

A name Git accepts for a branch, a tag or a remote reference, which does not begin with a dash.

StepIdtypeno test imports it
type StepId = Brand<string, "step id">;

The name of a generator or of a check of a repository's configuration: lower-case words, digits, hyphens and colons.

VariableNametypeno test imports it
type VariableName = Brand<string, "variable name">;

The name of an environment variable: capitals, digits and underscores, not starting with a digit.

parseLibraryNamefunction
function parseLibraryName(text: string): Result<LibraryName, string>

A library name from text, or why the text is not one.

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

parseSemverfunction
function parseSemver(text: string): Result<Semver, string>

A version from text, or why the text is not one.

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

parseIssueNumberfunction
function parseIssueNumber(text: string): Result<IssueNumber, string>

An issue number from text (10 or #10), or why the text is not one.

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

COMMIT_IMPACTSconstno test imports it
const COMMIT_IMPACTS: readonly ["patch", "minor", "major"]

The impacts a commit may state on its Impact: line (commons 0026-works-versioning FR-021): a closed union, least first.

CommitImpacttypeno test imports it
type CommitImpact = (typeof COMMIT_IMPACTS)[number];

The impact a commit states: how much the release raises the version of a library the commit changes.

parseCommitImpactfunctionno test imports it
function parseCommitImpact(text: string): Result<"major" | "minor" | "patch", string>

An impact from text (major, minor or patch), or why the text is not one.

parseSessionUrlfunction
function parseSessionUrl(text: string): Result<SessionUrl, string>

A session address from text, or why the text is not one.

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

parseSubjectfunction
function parseSubject(text: string): Result<CommitSubject, string>

A commit subject from text, or why the text is not one.

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

parseGitReffunction
function parseGitRef(text: string): Result<GitRef, string>

A Git reference from text, or why the text is not one.

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

parseStepIdfunctionno test imports it
function parseStepId(text: string): Result<StepId, string>

The name of a generator or of a check from text, or why the text is not one.

parseVariableNamefunctionno test imports it
function parseVariableName(text: string): Result<VariableName, string>

The name of an environment variable from text, or why the text is not one.

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