hookFailsWhenUnableToCheckfunctionfunction hookFailsWhenUnableToCheck(policy: Policy): booleanWhat the workspace requires of itself (commons 0002-workspace-model FR-032, FR-033, 0003-host FR-015): the policy the manifest names, and the judgements that follow from it as pure functions: a regulated domain requires signed commits, a commit that is not signed and verified is an error there and a warning elsewhere, a hook that cannot run its checker fails there and says so elsewhere, and a Git host the policy does not allow is told.
hookFailsWhenUnableToCheckfunctionfunction hookFailsWhenUnableToCheck(policy: Policy): booleanhostAllowedfunctionfunction hostAllowed(policy: Policy, host: string): booleanWhether a Git host is allowed: any, where the policy lists none.
isRegulatedfunctionno test imports itfunction isRegulated(policy: Policy): booleanWhether the workspace names a regulated domain.
Policytypeno test imports ittype Policy = {
/** Whether a commit must be signed (OpenPGP or SSH) and verified; always true where a regulated domai… (620 characters)type Policy = {
/** Whether a commit must be signed (OpenPGP or SSH) and verified; always true where a regulated domain is named. */
readonly requiresSignedCommits: boolean;
/** The regulated domains the manifest names (the keys of `ifccm:RegulatedDomain`); none means an unregulated workspace. */
readonly regulatedDomain: readonly string[];
/** How many days a tool or module outside the catalog is informational before it is a warning. */
readonly unapprovedGraceDays: number;
/** The Git hosts a repository of the manifest may be on; empty means any. */
readonly allowedGitHost: readonly string[];
};The workspace's policy (ergonex:WorkspacePolicy).
policyOffunctionfunction policyOf(input?: PolicyInput): PolicyThe policy from what the manifest says: signed commits are required wherever a regulated domain is named, whatever else it says (FR-032).
PolicyInputtypeno test imports ittype PolicyInput = {
readonly requiresSignedCommits?: boolean | undefined;
readonly regulatedDomain?: readonly string[] | undefined;
readonly unapprovedGraceDays?: number | undefined;
readonly allowedGitHost?: readonly string[] | undefined;
};What the manifest says of the policy, each part optional.
unsignedCommitSeverityfunctionfunction unsignedCommitSeverity(policy: Policy, signedAndVerified: boolean): Severity | undefinedThe severity of a commit in a managed repository: nothing where the commit is signed and verified; an error where a regulated domain is named; a warning elsewhere (FR-032: "elsewhere the same commit MUST be a warning").