Placetypeno test imports ittype Place = { readonly file: string; readonly jobId: string; readonly job: Job; readonly index: number; readonly step: Step };Where a step is.
The inventory of the build policy (commons 0038-build-policy FR-003): every step of every workflow of the model is classified as a red cause, a step whose output is read into findings, a gate or plumbing, by an ordered list of rules written as data with the reason of each; classify gives each step its policy, inventory gives the table of them (the table the documentation shows) with the counts, and policyFindings is the validation of the model against the policy: a step with no policy, a step of findings that is not wrapped or has no time limit below its job's, a matrix that fails fast, a job after a matrix that does not run with always(), plumbing in a cell that can fail it.
A step is placed by its workflow's file, its job's id and its position, and named by its name or its action or the first line of its script. The rules look at the job's id, the step's kind and its words; the first that matches decides. A step that no rule matches has no policy and is a finding of the model, so that a new step must be classified before the generator writes the workflow.
import { inventory } from "./inventory.ts";
inventory([]).counts; // { "red-cause": 0, finding: 0, gate: 0, plumbing: 0 }Placetypeno test imports ittype Place = { readonly file: string; readonly jobId: string; readonly job: Job; readonly index: number; readonly step: Step };Where a step is.
stepNameconstno test imports itconst stepName: (s: Step) => stringThe name a step is known by in the table: its name, else its action, else the first line of its script.
Ruletypeno test imports ittype Rule = { readonly why: string; readonly match: (p: Place) => boolean; readonly policy: (p: Place) => StepPolicy };A rule of the inventory: why, which steps, and what they are.
RULESconstno test imports itconst RULES: readonly Rule[]The rules, in order: the first that matches a step is its policy.
policyOffunctionno test imports itfunction policyOf(p: Place): { readonly policy: StepPolicy; readonly why: string; } | undefinedThe policy of a step by the first rule that matches it.
classifyfunctionfunction classify(w: Workflow): WorkflowThe workflow with a policy on every step that has none.
inventoryfunctionfunction inventory(ws: readonly Workflow[]): { readonly rows: readonly Row[]; readonly counts: Readonly<Record<"finding" | "gate" | "plumbing" | "red-cause", number>>; }The table of every step of the workflows, with the counts of each policy.
isWrappedconstno test imports itconst isWrapped: (s: Step) => booleanWhether a step of findings is run through the wrapper.
policyFindingsfunctionfunction policyFindings(w: Workflow): readonly string[]What is wrong with a workflow under the policy, one sentence each (0038-build-policy FR-003, FR-004, FR-005).