governance.LibraryNametypeno test imports ittype LibraryName = Brand<string, "library name">;The name of a library of commons: its folder and the end of its package name.
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"governance.LibraryNametypeno test imports ittype 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 ittype Semver = Brand<string, "semver">;A version of Semantic Versioning, with an optional pre-release and build part.
governance.IssueNumbertypeno test imports ittype IssueNumber = Brand<string, "issue number">;The number of an issue of the repository, in digits.
governance.SessionUrltypeno test imports ittype SessionUrl = Brand<string, "session url">;The address of a Claude Code session: https, with a host and no credential.
governance.CommitSubjecttypeno test imports ittype 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 ittype 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 ittype 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 ittype VariableName = Brand<string, "variable name">;The name of an environment variable: capitals, digits and underscores, not starting with a digit.
governance.parseLibraryNamefunctionno test imports itfunction parseLibraryName(text: string): Result<LibraryName, string>A library name from text, or why the text is not one.
governance.parseSemverfunctionno test imports itfunction parseSemver(text: string): Result<Semver, string>A version from text, or why the text is not one.
governance.parseIssueNumberfunctionno test imports itfunction 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 itconst 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 ittype 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 itfunction 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 itfunction parseSessionUrl(text: string): Result<SessionUrl, string>A session address from text, or why the text is not one.
governance.parseSubjectfunctionno test imports itfunction parseSubject(text: string): Result<CommitSubject, string>A commit subject from text, or why the text is not one.
governance.parseGitReffunctionno test imports itfunction parseGitRef(text: string): Result<GitRef, string>A Git reference from text, or why the text is not one.
governance.parseStepIdfunctionno test imports itfunction 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 itfunction parseVariableName(text: string): Result<VariableName, string>The name of an environment variable from text, or why the text is not one.
LibraryNametypetype LibraryName = Brand<string, "library name">;The name of a library of commons: its folder and the end of its package name.
Semvertypeno test imports ittype Semver = Brand<string, "semver">;A version of Semantic Versioning, with an optional pre-release and build part.
IssueNumbertypeno test imports ittype IssueNumber = Brand<string, "issue number">;The number of an issue of the repository, in digits.
SessionUrltypeno test imports ittype SessionUrl = Brand<string, "session url">;The address of a Claude Code session: https, with a host and no credential.
CommitSubjecttypeno test imports ittype 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 ittype 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 ittype 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 ittype VariableName = Brand<string, "variable name">;The name of an environment variable: capitals, digits and underscores, not starting with a digit.
parseLibraryNamefunctionfunction parseLibraryName(text: string): Result<LibraryName, string>A library name from text, or why the text is not one.
parseSemverfunctionfunction parseSemver(text: string): Result<Semver, string>A version from text, or why the text is not one.
parseIssueNumberfunctionfunction parseIssueNumber(text: string): Result<IssueNumber, string>An issue number from text (10 or #10), or why the text is not one.
COMMIT_IMPACTSconstno test imports itconst 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 ittype 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 itfunction parseCommitImpact(text: string): Result<"major" | "minor" | "patch", string>An impact from text (major, minor or patch), or why the text is not one.
parseSessionUrlfunctionfunction parseSessionUrl(text: string): Result<SessionUrl, string>A session address from text, or why the text is not one.
parseSubjectfunctionfunction parseSubject(text: string): Result<CommitSubject, string>A commit subject from text, or why the text is not one.
parseGitReffunctionfunction parseGitRef(text: string): Result<GitRef, string>A Git reference from text, or why the text is not one.
parseStepIdfunctionno test imports itfunction 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 itfunction parseVariableName(text: string): Result<VariableName, string>The name of an environment variable from text, or why the text is not one.