changes.CAPABILITY_LABELconstno test imports itconst CAPABILITY_LABEL: "capability"The label that marks a capability's change request: a provisional reading of how its kind is known (0020-ifccm OQ-3).
The findings of the changes check (commons 0020-ifccm FR-005 to FR-012, FR-019, FR-020, FR-032, FR-033) as Mizan findings: the same shape as the rules of mizan/rules.ts, so that a harness holds them with holdHarness and a baseline that only shrinks, each with the phase it was found in (warn or gate).
Pure functions over data: the commits of a range (as git-log.ts reads them), the harness's declaration, Decisions and roles, the day, and, for the strict rules, what the host said of each change request (as strict.ts asked it). A finding's key is its rule and the revision (never a line), so that a baseline holds one commit by its revision and a new commit is a new finding.
import { commitFindings } from "./rules.ts";
const day = "2026-11-17" as never;
commitFindings([{ sha: "a".repeat(40), parents: [], message: "Fix it\n", authorName: "A", authorEmail: "a@example.com", day }], { phase: "warn", decisions: [], roles: {} });
// one finding: changes/no-issuechanges.CAPABILITY_LABELconstno test imports itconst CAPABILITY_LABEL: "capability"The label that marks a capability's change request: a provisional reading of how its kind is known (0020-ifccm OQ-3).
changes.CHANGES_RULESconstno test imports itconst CHANGES_RULES: readonly ChangesRule[]Every rule, in the order the report lists them.
changes.commitFindingsfunctionno test imports itfunction commitFindings(commits: readonly CommitFacts[], ctx: Context): readonly ChangesFinding[]The offline findings of a range of commits: no issue, a closing word other than Closes, a departure with no Decision, an Impact: line that is not major, minor or patch, and a Decision approved by the author where a regulated domain is claimed.
changes.decisionFindingsfunctionno test imports itfunction decisionFindings(commits: readonly CommitFacts[] | undefined, decisions: readonly DecisionRecord[], roles: Readonly<Record<string, string>>, phase: Phase, file: string): readonly ChangesFinding[]The findings of the Decisions that exempt a commit (0020-ifccm FR-046): one that is not sound (no person, no day, no reason, a malformed entry) and, where the commits of a range are given, one whose revision is not in the range, names two commits of it, or names a commit that already names a change request or is a merge (an exemption nothing needs).
changes.declarationFindingsfunctionno test imports itfunction declarationFindings(declaration: Declaration | undefined, file: string): readonly ChangesFinding[]The finding of a declaration that is wrong by itself (0020-ifccm FR-010): refused at once, so it is a gate whatever the day.
changes.noIssueExemptionsfunctionno test imports itfunction noIssueExemptions(commits: readonly CommitFacts[], decisions: readonly DecisionRecord[], roles: Readonly<Record<string, string>>): ReadonlyMap<string, DecisionRecord>The commits of a range that a Decision exempts from naming a change request (0020-ifccm FR-046), by revision: a Decision that is sound (noIssueProblems says nothing) and whose no-issue <revision> names exactly one commit of the range, in full or by a prefix of at least 7 characters. A prefix that names two commits exempts neither.
changes.relaxationFindingsfunctionno test imports itfunction relaxationFindings(relaxed: readonly Relaxation[], decisions: readonly DecisionRecord[], phase: Phase, file: string): readonly ChangesFinding[]The findings of relaxations found in a declaration's history, none where a Decision covers gate-relaxed <revision> (0020-ifccm FR-012).
changes.ruleCasesfunctionno test imports itfunction ruleCases(findings: readonly ChangesFinding[], strictReason: string | undefined): readonly RuleCase[]The cases of a run: each rule's result, a strict rule not_run with strictReason where the host was not asked.
changes.STRICT_RULESconstno test imports itconst STRICT_RULES: readonly ChangesRule[]The rules that need the host (--strict, 0020-ifccm FR-009).
changes.strictFindingsfunctionno test imports itfunction strictFindings(commits: readonly CommitFacts[], answers: ReadonlyMap<string, IssueAnswer>, phase: Phase): readonly ChangesFinding[]The strict findings (0020-ifccm FR-006, FR-009): a change request that does not exist, a Refs on one already closed, a Closes on one whose checkbox items are not all ticked, and a Closes on a capability whose sections are missing or out of order, (0020-ifccm FR-003). answers is keyed by owner/repo#N or #N as namedIssues writes it; a reference with no answer, or a not_run, is judged by no rule.
changes.ChangesFindingtypeno test imports ittype ChangesFinding = Keyed & { readonly rule: ChangesRule; readonly severity: Phase };A finding of the changes check: a Mizan finding with the phase it was found in.
changes.ChangesRuletypeno test imports ittype ChangesRule =
| "changes/no-issue"
| "changes/closing-keyword"
| "changes/unknown-issue"
| "changes/closed-issue"
| "changes/gate-relaxed"
| "changes/early-close"
| "changes/issue-shape"
| "changes/no-decision"
| "changes/self-approved"
| "changes/declaration"
| "changes/impact"
| "changes/decision";The ids of the rules of the changes check (0020-ifccm FR-032, FR-033).
changes.CommitFactstypeno test imports ittype CommitFacts = {
readonly sha: string;
readonly parents: readonly string[];
readonly message: string;
readonly authorName: string;
readonly authorEmail: string;
readonly day: Day;
};A commit as the rules read it.
changes.Contexttypeno test imports ittype Context = {
readonly phase: Phase;
readonly declaration?: Declaration;
readonly decisions: readonly DecisionRecord[];
/** The role of each author, by email. */
readonly roles: Readonly<Record<string, string>>;
};What the rules need beyond the commits.
changes.IssueAnswertypeno test imports ittype IssueAnswer =
| { readonly kind: "found"; readonly issue: IssueInfo }
| { readonly kind: "missing" }
| { readonly kind: "not_run"; readonly reason: string };What the host said of one change request, as strict.ts asked it.
changes.RuleCasetypeno test imports ittype RuleCase =
| { readonly rule: ChangesRule; readonly outcome: "pass" }
| { readonly rule: ChangesRule; readonly outcome: "fail"; readonly findings: number }
| { readonly rule: ChangesRule; readonly outcome: "not_run"; readonly reason: string };One rule's result as a case of the run (0020-ifccm FR-031): passed, failed with its findings, or not run with the reason.
CAPABILITY_LABELconstno test imports itconst CAPABILITY_LABEL: "capability"The label that marks a capability's change request: a provisional reading of how its kind is known (0020-ifccm OQ-3).
CHANGES_RULESconstconst CHANGES_RULES: readonly ChangesRule[]Every rule, in the order the report lists them.
commitFindingsfunctionfunction commitFindings(commits: readonly CommitFacts[], ctx: Context): readonly ChangesFinding[]The offline findings of a range of commits: no issue, a closing word other than Closes, a departure with no Decision, an Impact: line that is not major, minor or patch, and a Decision approved by the author where a regulated domain is claimed.
decisionFindingsfunctionfunction decisionFindings(commits: readonly CommitFacts[] | undefined, decisions: readonly DecisionRecord[], roles: Readonly<Record<string, string>>, phase: Phase, file: string): readonly ChangesFinding[]The findings of the Decisions that exempt a commit (0020-ifccm FR-046): one that is not sound (no person, no day, no reason, a malformed entry) and, where the commits of a range are given, one whose revision is not in the range, names two commits of it, or names a commit that already names a change request or is a merge (an exemption nothing needs).
declarationFindingsfunctionno test imports itfunction declarationFindings(declaration: Declaration | undefined, file: string): readonly ChangesFinding[]The finding of a declaration that is wrong by itself (0020-ifccm FR-010): refused at once, so it is a gate whatever the day.
noIssueExemptionsfunctionfunction noIssueExemptions(commits: readonly CommitFacts[], decisions: readonly DecisionRecord[], roles: Readonly<Record<string, string>>): ReadonlyMap<string, DecisionRecord>The commits of a range that a Decision exempts from naming a change request (0020-ifccm FR-046), by revision: a Decision that is sound (noIssueProblems says nothing) and whose no-issue <revision> names exactly one commit of the range, in full or by a prefix of at least 7 characters. A prefix that names two commits exempts neither.
relaxationFindingsfunctionfunction relaxationFindings(relaxed: readonly Relaxation[], decisions: readonly DecisionRecord[], phase: Phase, file: string): readonly ChangesFinding[]The findings of relaxations found in a declaration's history, none where a Decision covers gate-relaxed <revision> (0020-ifccm FR-012).
ruleCasesfunctionno test imports itfunction ruleCases(findings: readonly ChangesFinding[], strictReason: string | undefined): readonly RuleCase[]The cases of a run: each rule's result, a strict rule not_run with strictReason where the host was not asked.
STRICT_RULESconstno test imports itconst STRICT_RULES: readonly ChangesRule[]The rules that need the host (--strict, 0020-ifccm FR-009).
strictFindingsfunctionfunction strictFindings(commits: readonly CommitFacts[], answers: ReadonlyMap<string, IssueAnswer>, phase: Phase): readonly ChangesFinding[]The strict findings (0020-ifccm FR-006, FR-009): a change request that does not exist, a Refs on one already closed, a Closes on one whose checkbox items are not all ticked, and a Closes on a capability whose sections are missing or out of order, (0020-ifccm FR-003). answers is keyed by owner/repo#N or #N as namedIssues writes it; a reference with no answer, or a not_run, is judged by no rule.
ChangesFindingtypeno test imports ittype ChangesFinding = Keyed & { readonly rule: ChangesRule; readonly severity: Phase };A finding of the changes check: a Mizan finding with the phase it was found in.
ChangesRuletypeno test imports ittype ChangesRule =
| "changes/no-issue"
| "changes/closing-keyword"
| "changes/unknown-issue"
| "changes/closed-issue"
| "changes/gate-relaxed"
| "changes/early-close"
| "changes/issue-shape"
| "changes/no-decision"
| "changes/self-approved"
| "changes/declaration"
| "changes/impact"
| "changes/decision";The ids of the rules of the changes check (0020-ifccm FR-032, FR-033).
CommitFactstypetype CommitFacts = {
readonly sha: string;
readonly parents: readonly string[];
readonly message: string;
readonly authorName: string;
readonly authorEmail: string;
readonly day: Day;
};A commit as the rules read it.
Contexttypetype Context = {
readonly phase: Phase;
readonly declaration?: Declaration;
readonly decisions: readonly DecisionRecord[];
/** The role of each author, by email. */
readonly roles: Readonly<Record<string, string>>;
};What the rules need beyond the commits.
IssueAnswertypetype IssueAnswer =
| { readonly kind: "found"; readonly issue: IssueInfo }
| { readonly kind: "missing" }
| { readonly kind: "not_run"; readonly reason: string };What the host said of one change request, as strict.ts asked it.
RuleCasetypeno test imports ittype RuleCase =
| { readonly rule: ChangesRule; readonly outcome: "pass" }
| { readonly rule: ChangesRule; readonly outcome: "fail"; readonly findings: number }
| { readonly rule: ChangesRule; readonly outcome: "not_run"; readonly reason: string };One rule's result as a case of the run (0020-ifccm FR-031): passed, failed with its findings, or not run with the reason.