Files
mesh-delivery/contracts/ts/seats/nodebuildnode/parts/build-step.d.ts
T
jschoubben 7fca7f0ac8 CT12: the build seats' ask carries its version, every ask says ask-taken and step-ended (issue 1966)
The builder's reserved version reaches the build in the ask; a holder says when it takes and ends
any ask, a builder's build included, so the watchman times every ask; the toolchains key names its
program's digest; the checker may drop its own asks until its removal. step-progress and ask-taken
name no keep and go on the shared events stream. The delivery SDK's neutral forms follow the part.

Builds: design 47 G §472, §548, §549, §552, §573, §602, §603

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
2026-11-11 16:01:17 +01:00

670 lines
23 KiB
TypeScript

// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// The part "build-step" several seats include whole: What the three build seats share: the verbs that read and steer a node's builds, and the layouts of the asks they accept and the steps they keep. A seat lists its states against these (a part carries no states).
export declare const verbs: {
readonly current: "current";
readonly pause: "pause";
readonly resume: "resume";
readonly drop: "drop";
readonly keptArtifact: "kept-artifact";
readonly steps: "steps";
};
export declare const events: {
readonly stepEnded: "step-ended";
readonly toolchainReported: "toolchain-reported";
readonly stepProgress: "step-progress";
readonly askTaken: "ask-taken";
};
/** one artifact of a build ask: built from the fetched tree, or copied from an upstream pin */
export interface AskArtifact {
"artifact": string;
"from"?: string;
"seat"?: string;
"version"?: string;
}
/** an ask a build seat's holder took, said when it takes any ask, whatever its asker (design 47 G section 602) */
export interface AskTaken {
/** the ask's id */
"ask": string;
"asker": string;
"at": string;
/** the node that took it, as in the subject */
"node": string;
}
export interface BuildAnswer {
"artifacts": BuiltArtifact[];
"imports"?: string[];
/** the digest of the artifact this node kept for the artifact store's holder instead of storing it through the seat oci-artifact-registry (the verb kept-artifact serves it); the keeping node is the step's own; absent when every artifact was stored */
"kept"?: string;
"out-of-step"?: string[];
"toolchain"?: ToolchainUsed;
}
export interface BuiltArtifactResolvedItem {
/** sha256: of the package's bytes as the build fetched them */
"digest": string;
"package": string;
"version": string;
}
/** one artifact a build made: its digest and the reference it was published under */
export interface BuiltArtifact {
"artifact": string;
"digest": string;
"reference"?: string;
/** one per mesh package the build resolved (the catalog graph entry's packages, the edges of kind 1) */
"resolved"?: BuiltArtifactResolvedItem[];
}
/** how many steps the node runs at once */
export interface Capacity {
/** when (RFC 3339 time) */
"at"?: string;
"build-hours"?: string;
"build-hours-fault"?: string;
"by-cpu"?: number;
"configured": number;
"configured-from"?: string;
"cores-per-step"?: number;
"effective": number;
"ineligible"?: string;
"outside-hours"?: boolean;
"quota-cores"?: number;
"quota-from"?: string;
/** the layout version */
"v"?: number;
"why": string;
}
export interface CheckAnswer {
"fetch": FetchAnswer;
"levels"?: LevelAnswer[];
}
export interface ComposeAnswer {
"built": boolean;
"key"?: string;
/** the compose-candidate verdict */
"verdict"?: unknown;
}
export interface DetectedStep {
/** the packages the step runs, by the language's convention */
"packages"?: string[];
"step": "lint" | "unit" | "integration";
}
/** the steps detected for one artifact at its newest build-input fingerprint, replaced when a newer fingerprint is detected and by steps with again (design 47 G section 326) */
export interface DetectedSteps {
"at"?: string;
"fingerprint": string;
"steps": DetectedStep[];
"v": number;
}
/** an ask a caller no longer waits for */
export interface Drop {
/** when (RFC 3339 time) */
"at"?: string;
"by"?: string;
/** the layout version */
"v"?: number;
"why": string;
}
export interface FetchBesideItem {
"commit": string;
"repository": string;
}
export interface FetchBuildsItem {
"artifact": string;
/** the member's build digest, sha256: */
"digest": string;
"module": string;
/** the name in its ecosystem (the Go module path, the npm name) */
"package": string;
}
/** the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's */
export interface FetchPackage {
"commit"?: string;
"name"?: string;
"ref"?: string;
"repository"?: string;
"version"?: string;
}
/** what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, and the sibling repositories placed beside */
export interface Fetch {
/** the trunk commit a merge preview merges onto */
"base"?: string;
/** the sibling repositories placed beside the fetched tree */
"beside"?: FetchBesideItem[];
/** a group run's package members, each by its build's digest: the build module reads each from the artifact store at artifact-store://<module>/<artifact>/blobs/<digest>, checks the bytes against the digest and lays them as the group package; a package named here is named in neither packages nor package */
"builds"?: FetchBuildsItem[];
/** the full commit */
"commit": string;
/** the module's directory in the repository ("." for its root), with paths */
"dir"?: string;
/** the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's */
"package"?: FetchPackage;
/** the version (a full commit) of each mesh package to build against, by its module path */
"packages"?: Record<string, string>;
/** the paths the module names, relative to dir */
"paths"?: string[];
/** the pull request's ref, when only its head carries the commit */
"ref"?: string;
/** <owner>/<name> */
"repository": string;
}
/** what a build module's fetch tool answers, whole: the workspace it made, the commit in it, the module directories found; and, when the call gave a base, the merge preview (the trunk commit, the merge commit, the files that conflict, the paths the merge changes, the compiled programs among them, the tree of each module directory). A head that does not merge cleanly is an answer, not an error: merge is empty and conflicts names the files. The Go module adds the sibling repositories placed and the package versions taken; the TypeScript module the directories installed and refused and the group's package */
export interface FetchAnswer {
"base"?: string;
"beside"?: PlacedBeside[];
"changed"?: string[];
"commit": string;
"conflicts"?: string[];
"group"?: string;
"installed"?: string[];
"merge"?: string;
"modules": string[];
"packages"?: TakenVersion[];
"programs"?: Program[];
"refused"?: FetchRefusal[];
"trees"?: Record<string, ModuleTree>;
"workspace": string;
}
/** a TypeScript module whose packages the fetch did not install, with why */
export interface FetchRefusal {
"module": string;
"reason": string;
}
/** a package's passing result the runner keeps, by the digest of what its tests read (ADR 0666 section 8): the step runs no package whose digest and level it names */
export interface KeptResult {
/** sha256:<hex> of what the package's tests read */
"digest": string;
/** unit or integration */
"level": string;
"package": string;
/** the pipeline whose step kept it */
"pipeline"?: string;
"toolchain"?: ToolchainUsed;
}
export interface LevelAnswerDigestNeedsItem {
"needs"?: string[];
"package"?: string;
}
export interface LevelAnswerDigestPackagesItem {
"digest": string;
"package": string;
}
export interface LevelAnswerDigest {
"beside"?: string[];
"judged_by"?: string;
"level"?: string;
"needs"?: LevelAnswerDigestNeedsItem[];
"packages"?: LevelAnswerDigestPackagesItem[];
"without_tests"?: string[];
}
export interface LevelAnswerKeptItem {
"digest"?: string;
"package"?: string;
"tests"?: number;
}
export interface LevelAnswerUnmetItem {
"needs"?: string[];
"package"?: string;
}
/** one level of a check ask: the digest's answer, the kept verdicts taken, one test result per test step run, and the packages the node could not test */
export interface LevelAnswer {
"digest"?: LevelAnswerDigest;
"judged"?: string;
"kept"?: LevelAnswerKeptItem[];
"level": string;
"tests"?: unknown[];
"unmet"?: LevelAnswerUnmetItem[];
}
/** the tree of one module directory in a merge preview: its git tree, the digest of its manifest, the lock files' digests and the digests of the named paths */
export interface ModuleTree {
"locks"?: Record<string, string>;
"manifest": string;
/** no longer filled (ADR 0593 section 2); kept so a preview written before still reads */
"packages"?: string[];
"paths"?: Record<string, string>;
"tree": string;
}
/** whether the node takes no new ask */
export interface Pause {
/** when (RFC 3339 time) */
"at"?: string;
"by"?: string;
"paused": boolean;
/** the layout version */
"v"?: number;
}
/** a sibling repository placed as a plain directory under the workspace's beside directory */
export interface PlacedBeside {
"commit": string;
"dir": string;
"repository": string;
}
/** a changed file that is a compiled program (issue 1577): its path, its executable format, and the commit of the branch that added it when the merge's tree no longer holds it */
export interface Program {
"commit"?: string;
/** ELF, Mach-O or PE */
"kind": string;
"path": string;
}
/** what a run ask's step answers: whether this run built the program or took the one kept under its key, the key, the program's exit, the last line of its standard output and the first of its standard error */
export interface RunAnswer {
"built": boolean;
"exit": number;
"key": string;
/** raw when it is JSON, else a JSON string */
"output"?: unknown;
"said"?: string;
}
/** one commit a run's program reads */
export interface RunHead {
"commit": string;
"repository": string;
}
/** a run's input by reference: the seat verb the asker serves it on (seat:<seat>.<verb>), the sha256 of its bytes and its size, at most 256 KiB */
export interface RunInput {
/** 64 lowercase hex digits */
"digest": string;
/** bytes */
"size": number;
"verb": string;
}
/** a run ask's job: where its program is built, the heads it reads (each laid read-only at its repository's path), its input by reference, its arguments and what it is for */
export interface RunJob {
/** the program's arguments, each a word or a flag */
"args"?: string[];
/** the commits the program reads, a repository at most once */
"heads": RunHead[];
"input": RunInput;
"program": RunProgram;
/** what the run is for, for a reader of the ask */
"reader"?: string;
}
/** where a run's program is built: the repository and full commit fetched, the Go module's directory in it and the program's import path */
export interface RunProgram {
"commit": string;
"dir": string;
"package": string;
"repository": string;
}
/** one step a build module runs on a node */
export interface Step {
/** when the bus gives the ask again, for the state again (RFC 3339 time) */
"again-at"?: string;
/** when (RFC 3339 time) */
"ended"?: string;
"id": string;
"node": string;
"owner"?: string;
/** true when the step ended on a fault that passes (a transport fault), so a failed end after the last run says so */
"passing"?: boolean;
"phase"?: string;
/** when (RFC 3339 time) */
"phase-at"?: string;
"reason"?: string;
"result"?: StepResult;
/** which run of the ask this is, counted by the bus's delivery count (1 for the first) */
"run"?: number;
/** when (RFC 3339 time) */
"started": string;
/** running, again (ended on a transport fault, to be given again by the bus after again-at), passed, failed, refused or dropped (ended by the verb drop, its cause the reason) */
"state": string;
"tool": string;
/** the layout version */
"v"?: number;
"what"?: string;
}
export interface StepAskBuild {
"artifacts": AskArtifact[];
"fetch"?: Fetch;
"fp"?: string;
"module": string;
"path"?: string;
"publish"?: boolean;
"toolchain"?: ToolchainUsed;
}
export interface StepAskCheck {
"fetch": Fetch;
"kept"?: boolean;
"levels": string[];
/** the node names the check's tests run against */
"node-names"?: string[];
"packages"?: string[];
"run"?: string;
"runner"?: string;
"runner_when"?: string;
/** the toolchain the checker agreed for the language (ADR 0584 clause 2): a node on another declines the check */
"toolchain"?: ToolchainUsed;
}
export interface StepAskCompose {
"dir": string;
"fetch": Fetch;
"package": string;
"reader"?: string;
/** the compose-candidate request, in one of two forms: the request as a JSON object, or, for one near the bus's message limit, a JSON string "gzip+base64:" followed by the base64 of the request object gzip-compressed; a holder that does not know the packed form refuses it, naming that it holds no request object */
"request": unknown;
}
/** one ask of a build module */
export interface StepAsk {
"asker": string;
/** when (RFC 3339 time) */
"at"?: string;
"build"?: StepAskBuild;
"check"?: StepAskCheck;
"compose"?: StepAskCompose;
"id": string;
/** build, check, compose or step */
"kind": string;
/** go, typescript or image */
"language": string;
"needs"?: string[];
/** package to the tagged version a build pins */
"packages"?: Record<string, string>;
/** a run: a program built from a change and run in the build seat's sandbox over the heads, its input asked of a verb of the asker's seat; the Go seat's check stream alone carries it, as a compose */
"run"?: RunJob;
/** a pipeline step: lint, unit tests or integration tests of one artifact at one commit, sent by the runner as the accepted kind step (design 47 *The steps and who serves them*) */
"step"?: StepRun;
/** the layout version */
"v"?: number;
/** the version MAJOR.MINOR.PATCH the builder reserved for the build, passed to it as MESH_VERSION; empty for a build that reserves none, which stamps none (design 47 G section 573) */
"version"?: string;
}
/** an ask's end, said by the build seat's holder on the node that ran it, whatever its asker (design 47 G section 602): a pipeline step's end names the pipeline, the commit and the fingerprint it was asked at, which the runner takes only from that holder's account (ADR 0666 sections 7, 21); the end of any other ask names its asker, the ask, the node, the outcome and when, and neither commit nor fingerprint (design 47 G section 548) */
export interface StepEnded {
"artifact"?: string;
/** the ask's id, by which a reader takes only its own asks */
"ask": string;
/** who asked it */
"asker": string;
/** when it ended (RFC 3339 time) */
"at": string;
/** for a rerun, the caller the runtime proved */
"by"?: string;
/** the packages not run because the ask's kept results held them */
"carried"?: KeptResult[];
"commit"?: string;
"ended"?: string;
"fingerprint"?: string;
/** the ask's id */
"id": string;
/** the packages that passed at their digest, for the runner to keep */
"kept"?: KeptResult[];
"module"?: string;
/** the node that ran it, as in the subject */
"node": string;
/** never passed for a step that ran nothing */
"outcome": "passed" | "failed" | "nothing to run" | "could not run";
/** the step's output when it fits the message */
"output"?: string;
/** the output's object in the sender's sent store, when over the per-message limit (ADR 0666 section 16) */
"output-object"?: string;
"pipeline"?: string;
"rerun"?: boolean;
/** why it failed or could not run, naming the part not heard */
"said"?: string;
"started"?: string;
"step"?: "lint" | "unit" | "integration";
"tests"?: TestCounts;
/** the layout version */
"v"?: number;
}
/** a running ask's progress, said once a minute while the holder runs it (design 47 G section 496) */
export interface StepProgress {
"ask": string;
"asker": string;
"at": string;
"phase": "fetch" | "build" | "run" | "report";
}
/** what a step answered, by the kind of ask: a build's artifacts, toolchain, imports, out-of-step modules and the artifact it kept; a check's fetch and levels; a compose's built, key and verdict; a run's built, key, exit, output and said; a declined ask's declined, needs and lacks. The fields of the kinds do not meet, so one layout holds the five */
export interface StepResult {
"artifacts"?: BuiltArtifact[];
"built"?: boolean;
/** the holder declined the ask: its node lacks what the ask needs */
"declined"?: boolean;
/** a run's program's exit status */
"exit"?: number;
"fetch"?: FetchAnswer;
"imports"?: string[];
/** the digest of the artifact this node kept for the artifact store's holder instead of storing it through the seat oci-artifact-registry (the verb kept-artifact serves it); the keeping node is the step's own; absent when every artifact was stored */
"kept"?: string;
"key"?: string;
/** what the holder's node lacks of it */
"lacks"?: string[];
"levels"?: LevelAnswer[];
/** what the declined ask needs */
"needs"?: string[];
"out-of-step"?: string[];
/** a run's program's last line of standard output: raw when it is JSON, else a JSON string */
"output"?: unknown;
/** a run's program's first line of standard error, or why the step could not run it */
"said"?: string;
"toolchain"?: ToolchainUsed;
/** the compose-candidate verdict (the composer's own layout) */
"verdict"?: unknown;
}
/** one pipeline step of one artifact at one commit (ADR 0666 sections 7, 8, 17): the step a build seat runs in its sandbox from the change's own heads, the names the lint step needs and the kept results it may skip */
export interface StepRun {
/** the artifact reference, <module>:<artifact> */
"artifact": string;
/** the watched branch, or the branch of a run on request */
"branch"?: string;
/** for a rerun, the caller the runtime proved */
"by"?: string;
/** the commit the step runs at */
"commit": string;
/** where the step reads the change's heads */
"fetch": Fetch;
/** the artifact's build-input fingerprint at the commit */
"fingerprint": string;
/** the kept results of the artifact's packages, by digest and level (design 47 *Carried, not run*) */
"kept"?: KeptResult[];
"module": string;
/** the runner's pipeline key, <branch>.<revision>.<module>, a branch escaped as a key's name is */
"pipeline": string;
/** the step is asked again by the runner's rerun */
"rerun"?: boolean;
/** the source revision of the watched branch the pipeline runs for; absent for a run on request */
"revision"?: number;
/** the pipeline step */
"step": "lint" | "unit" | "integration";
"toolchain"?: ToolchainUsed;
}
/** of a directory whose go.mod requires an asked mesh package, the version it is built against: the asked one, or go.mod's when it names a newer one, said */
export interface TakenVersion {
"asked": string;
"built": string;
"dir": string;
"named": string;
"package": string;
"said"?: string;
"sum"?: string;
}
/** how many tests a step ran and carried, per level (ADR 0666 section 8: the pipeline's end names any repository or catalog module over the test budget) */
export interface TestCounts {
"integration"?: number;
"unit"?: number;
}
/** the toolchain a node reports */
export interface Toolchain {
/** when (RFC 3339 time) */
"at"?: string;
/** the sha256: digest of the language's toolchain program as the build module runs it: the program of the module that provides that language's toolchain, never the build module's own (design 47 G section 472) */
"digest"?: string;
/** go or typescript */
"language": string;
"recipe": string;
/** the layout version */
"v"?: number;
"version": string;
}
/** a node's toolchain of a language, said at the build module's start and each time its toolchains key of the language changes (design 47 G section 492) */
export interface ToolchainReported {
/** the digest of the program of the provision the build module requires for that language's toolchain, never the build module's own */
"digest": string;
"language": string;
"node": string;
"recipe": string;
"version": string;
}
/** the toolchain a build was made with: the language, the installed version and the build module's recipe */
export interface ToolchainUsed {
/** the building node's digest of its toolchain program (kind 3's entry), never the build module's own program */
"digest"?: string;
"language": string;
"recipe": string;
"version": string;
}
/** is what current takes. */
export interface CurrentInput {
}
/** is what current answers. */
export type CurrentAnswer = Record<string, unknown>;
/** is what pause takes. */
export interface PauseInput {
}
/** is what pause answers. */
export type PauseAnswer = Record<string, unknown>;
/** is what resume takes. */
export interface ResumeInput {
}
/** is what resume answers. */
export type ResumeAnswer = Record<string, unknown>;
/** is what drop takes. */
export interface DropInput {
/** who drops it */
"by"?: string;
/** the ask's id */
"id": string;
/** why the caller no longer waits */
"why": string;
}
/** is what drop answers. */
export type DropAnswer = Record<string, unknown>;
/** is what kept-artifact takes. */
export interface KeptArtifactInput {
/** the artifact's sha256, 64 lowercase hex digits, as the builder's done key names it */
"digest": string;
/** its build's fingerprint */
"fp": string;
/** the module, the holder of oci-artifact-registry */
"module": string;
}
/** is what kept-artifact answers. */
export interface KeptArtifactAnswer {
/** the digest of the bytes kept */
"digest"?: string;
/** why it could not answer */
"error"?: string;
/** the fingerprint asked */
"fp": string;
/** the module asked */
"module": string;
/** the object's name in it: the digest */
"object"?: string;
/** why nothing is answered: the module claims no oci-artifact-registry, this node keeps no build of it at that fingerprint (never kept, or swept), or keeps it under another digest */
"refused"?: "claims no oci-artifact-registry" | "not kept" | "digest differs";
/** bytes */
"size"?: number;
/** the object store the bytes are in, the build module's kept builds, as its manifest's objects names it on the bus */
"store"?: string;
/** the refusal in words, naming the module */
"words"?: string;
}
/** is what steps takes. */
export interface StepsInput {
/** find them anew, not from the kept answer */
"again"?: boolean;
/** the key of detected-steps, <module>.<artifact> */
"artifact": string;
/** delete the artifact's kept key instead of detecting; needs why */
"drop"?: boolean;
"fetch"?: Fetch;
"fingerprint"?: string;
"module": string;
/** with drop, why: a non-empty text, written in the hand-act log with the caller the bus proved */
"why"?: string;
}
/** is what steps answers. */
export interface StepsAnswer {
"artifact"?: string;
/** the artifact whose key a drop deleted */
"dropped"?: string;
/** why a drop deleted nothing, naming the hand-act log when it refused */
"error"?: string;
"fingerprint"?: string;
/** answered from the kept answer */
"kept"?: boolean;
"steps"?: DetectedStep[];
}
/** is the body of the event step-ended. */
export type StepEndedEvent = StepEnded;
/** is the body of the event toolchain-reported. */
export type ToolchainReportedEvent = ToolchainReported;
/** is the body of the event step-progress. */
export type StepProgressEvent = StepProgress;
/** is the body of the event ask-taken. */
export type AskTakenEvent = AskTaken;