/** * The run stage of validation: a checked flow held to the project it is about * to run in, still before the first spawn. * * What the flow stage cannot know is here: the working tree, the ports the * launch hands over, and whether somebody is there. A flow valid on its own may * be refused on one project, since a check script belongs to the project, * and a commit, a copy or a read of `diff` needs a repository. With nobody * there, a flow that could reach a question nobody can leave unanswered is * refused now rather than failed there, behind a `choice` too: whether a case * is taken is only known once the run has spent what came before it. Every * rule reads the flows called too, where the call stands: a callee acts in * its caller's tree, through the same ports. * What passes is a `CheckedRun`, which carries the tree and ports it was * checked against, so a flow checked for one project cannot run in another. */ import type { AskUser } from "../ask.ts"; import type { GitPort } from "../git/index.ts"; import type { CheckScript } from "../verify.ts"; import type { CheckedFlow } from "./checked.ts"; import { type Fault } from "./fault.ts"; /** How a run reaches the world. A node whose port is absent refuses the run; without `ask`, nobody is there. */ export type FlowPorts = { /** Puts an `ask` node's question to the person. */ readonly ask?: AskUser; /** Runs a `check` node's script. */ readonly check?: CheckScript; /** Commits, reads `diff`, and makes and lands the copies of a `copies: true` block. */ readonly git?: GitPort; }; /** What a launch says about where it runs. */ export type RunStage = { /** The working tree, at the repository root: a check's path starts there. */ readonly cwd: string; /** How the run reaches the world; a node whose port is absent refuses it. */ readonly ports: FlowPorts; /** Whether a person can answer. With no `ask` port, nobody can, whatever this says. */ readonly somebodyThere: boolean; }; declare const checked: unique symbol; /** A checked flow that passed the run stage too. Only `checkRun` makes one, and it is what `runFlow` takes. */ export type CheckedRun = RunStage & { /** The flow, as the flow stage checked it. */ readonly flow: CheckedFlow; /** * Each check script's content by its path, read here: what runs is what was * read before the first spawn, whatever an agent does to the file after. */ readonly scripts: ReadonlyMap; readonly [checked]: true; }; /** A checked run, or every fault that refused it. */ export type CheckRun = { readonly ok: true; readonly run: CheckedRun; } | { readonly ok: false; readonly faults: readonly Fault[]; }; /** * `flow` held to `stage`. A missing port, a missing script and a tree that is * no repository are each reported once, at the first node needing it. Given * `read`, each script's content is taken from there instead of the disk: a * resume runs the scripts its run started with. */ export declare function checkRun(flow: CheckedFlow, stage: RunStage, read?: ReadonlyMap): Promise; export {}; //# sourceMappingURL=check-run.d.ts.map