CT11: regenerate the Go and TypeScript contracts from CT1 to CT9; each TypeScript contract as index.js with index.d.ts

Generated by seatgen (mesh-catalog, GEN1 and GEN2 on its worktree) from the
definitions of CT1 to CT9; module.json names the artifacts of the new seats
mesh-builds, mesh-pipeline-runner and git. seatgen -check is clean; every seat
package's generated fixture test passes.

Builds: design 47 G §341 (a TypeScript contract is emitted as index.js with
index.d.ts), §196, §339 (the generator refuses an unknown callers entry),
§260, §331.

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-11 10:48:56 +01:00
parent 15c065d2bb
commit 72ac9b09cb
90 changed files with 12101 additions and 2027 deletions
@@ -4,121 +4,86 @@
import type * as buildStep from "./parts/build-step.js";
export const seat = "node-build-node";
export declare const seat: "node-build-node";
export const verbs = {
current: "current",
pause: "pause",
resume: "resume",
drop: "drop",
} as const;
export declare const verbs: {
readonly current: "current";
readonly pause: "pause";
readonly resume: "resume";
readonly drop: "drop";
readonly keptArtifact: "kept-artifact";
readonly steps: "steps";
};
export const accepts = {
delivery: "delivery",
check: "check",
recheck: "recheck",
} as const;
export declare const accepts: {
readonly delivery: "delivery";
readonly check: "check";
readonly step: "step";
readonly recheck: "recheck";
};
export const deliverySubject = "mesh.seat.node-build-node.accept.delivery";
export declare const events: {
readonly stepEnded: "step-ended";
};
export const checkSubject = "mesh.seat.node-build-node.accept.check";
export declare const family: { readonly name: "node-build-node.events"; readonly maxAgeDays: 7 };
export const recheckSubject = "mesh.seat.node-build-node.accept.recheck";
export declare const stepEndedStream: "SEAT_node-build-node_step-ended";
export const states = {
steps: "steps",
pauses: "pauses",
toolchains: "toolchains",
} as const;
export declare function stepEndedSubject(node: string): string;
export declare const stepEndedSubjectAll: "mesh.seat.node-build-node.event.step-ended.*";
export declare const deliverySubject: "mesh.seat.node-build-node.accept.delivery";
export declare const checkSubject: "mesh.seat.node-build-node.accept.check";
export declare const stepSubject: "mesh.seat.node-build-node.accept.step";
export declare const recheckSubject: "mesh.seat.node-build-node.accept.recheck";
export declare const states: {
readonly steps: "steps";
readonly pauses: "pauses";
readonly toolchains: "toolchains";
readonly detectedSteps: "detected-steps";
};
/** The key of one value of the state steps under the form "<node>.<id>". */
export function stepsByNodeIDKey(node: string, id: string): string {
return node + "." + id;
}
export declare function stepsByNodeIDKey(node: string, id: string): string;
/** The parts of a key of the form "<node>.<id>", or undefined for a key of another form. */
export function parseStepsByNodeIDKey(_key: string): { node: string; id: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const id = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, id };
}
export declare function parseStepsByNodeIDKey(_key: string): { node: string; id: string } | undefined;
/** The key of one value of the state pauses under the form "paused.<node>". */
export function pausesByPausedNodeKey(node: string): string {
return "paused." + node;
}
export declare function pausesByPausedNodeKey(node: string): string;
/** The parts of a key of the form "paused.<node>", or undefined for a key of another form. */
export function parsePausesByPausedNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("paused.")) return undefined;
_rest = _rest.slice(7);
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
export declare function parsePausesByPausedNodeKey(_key: string): { node: string } | undefined;
/** The key of one value of the state pauses under the form "dropped.<id>". */
export function pausesByDroppedIDKey(id: string): string {
return "dropped." + id;
}
export declare function pausesByDroppedIDKey(id: string): string;
/** The parts of a key of the form "dropped.<id>", or undefined for a key of another form. */
export function parsePausesByDroppedIDKey(_key: string): { id: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("dropped.")) return undefined;
_rest = _rest.slice(8);
if (_rest === "") return undefined;
const id = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { id };
}
export declare function parsePausesByDroppedIDKey(_key: string): { id: string } | undefined;
/** The key of one value of the state pauses under the form "capacity.<node>". */
export function pausesByCapacityNodeKey(node: string): string {
return "capacity." + node;
}
export declare function pausesByCapacityNodeKey(node: string): string;
/** The parts of a key of the form "capacity.<node>", or undefined for a key of another form. */
export function parsePausesByCapacityNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("capacity.")) return undefined;
_rest = _rest.slice(9);
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
export declare function parsePausesByCapacityNodeKey(_key: string): { node: string } | undefined;
/** The key of one value of the state toolchains under the form "<node>.<language>". */
export function toolchainsByNodeLanguageKey(node: string, language: string): string {
return node + "." + language;
}
export declare function toolchainsByNodeLanguageKey(node: string, language: string): string;
/** The parts of a key of the form "<node>.<language>", or undefined for a key of another form. */
export function parseToolchainsByNodeLanguageKey(_key: string): { node: string; language: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const language = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, language };
}
export declare function parseToolchainsByNodeLanguageKey(_key: string): { node: string; language: string } | undefined;
/** The key of one value of the state detected-steps under the form "<module>.<artifact>". */
export declare function detectedStepsByModuleArtifactKey(module: string, artifact: string): string;
/** The parts of a key of the form "<module>.<artifact>", or undefined for a key of another form. */
export declare function parseDetectedStepsByModuleArtifactKey(_key: string): { module: string; artifact: string } | undefined;
export type AskArtifact = buildStep.AskArtifact;
export type BuildAnswer = buildStep.BuildAnswer;
@@ -128,6 +93,8 @@ export type CheckAnswer = buildStep.CheckAnswer;
export type ComposeAnswer = buildStep.ComposeAnswer;
export type CurrentAnswer = buildStep.CurrentAnswer;
export type CurrentInput = buildStep.CurrentInput;
export type DetectedStep = buildStep.DetectedStep;
export type DetectedSteps = buildStep.DetectedSteps;
export type Drop = buildStep.Drop;
export type DropAnswer = buildStep.DropAnswer;
export type DropInput = buildStep.DropInput;
@@ -136,6 +103,9 @@ export type FetchAnswer = buildStep.FetchAnswer;
export type FetchBesideItem = buildStep.FetchBesideItem;
export type FetchPackage = buildStep.FetchPackage;
export type FetchRefusal = buildStep.FetchRefusal;
export type KeptArtifactAnswer = buildStep.KeptArtifactAnswer;
export type KeptArtifactInput = buildStep.KeptArtifactInput;
export type KeptResult = buildStep.KeptResult;
export type LevelAnswer = buildStep.LevelAnswer;
export type LevelAnswerDigest = buildStep.LevelAnswerDigest;
export type LevelAnswerDigestNeedsItem = buildStep.LevelAnswerDigestNeedsItem;
@@ -160,8 +130,15 @@ export type StepAsk = buildStep.StepAsk;
export type StepAskBuild = buildStep.StepAskBuild;
export type StepAskCheck = buildStep.StepAskCheck;
export type StepAskCompose = buildStep.StepAskCompose;
export type StepEnded = buildStep.StepEnded;
export type StepEndedEvent = buildStep.StepEndedEvent;
export type StepNames = buildStep.StepNames;
export type StepResult = buildStep.StepResult;
export type StepRun = buildStep.StepRun;
export type StepsAnswer = buildStep.StepsAnswer;
export type StepsInput = buildStep.StepsInput;
export type TakenVersion = buildStep.TakenVersion;
export type TestCounts = buildStep.TestCounts;
export type Toolchain = buildStep.Toolchain;
export type ToolchainUsed = buildStep.ToolchainUsed;
@@ -171,6 +148,9 @@ export type DeliveryAccept = StepAsk;
/** is the body of check. */
export type CheckAccept = StepAsk;
/** is the body of step. */
export type StepAccept = StepAsk;
/** is the body of recheck. */
export type RecheckAccept = StepAsk;
@@ -189,3 +169,6 @@ export type PausesByCapacityNodeValue = Capacity;
/** is one value of the state toolchains under the key <node>.<language>. */
export type ToolchainsByNodeLanguageValue = Toolchain;
/** is one value of the state detected-steps under the key <module>.<artifact>. */
export type DetectedStepsByModuleArtifactValue = DetectedSteps;
+159
View File
@@ -0,0 +1,159 @@
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// The contract of the seat "node-build-node", defined whole (seats/node-build-node/seat.json): The Node build module on a node: it takes the asks of the builder and the checker, runs them as steps and answers.
export const seat = "node-build-node";
export const verbs = {
current: "current",
pause: "pause",
resume: "resume",
drop: "drop",
keptArtifact: "kept-artifact",
steps: "steps",
};
export const accepts = {
delivery: "delivery",
check: "check",
step: "step",
recheck: "recheck",
};
export const events = {
stepEnded: "step-ended",
};
export const family = { name: "node-build-node.events", maxAgeDays: 7 };
export const stepEndedStream = "SEAT_node-build-node_step-ended";
export function stepEndedSubject(node) {
return "mesh.seat.node-build-node.event.step-ended." + node;
}
export const stepEndedSubjectAll = "mesh.seat.node-build-node.event.step-ended.*";
export const deliverySubject = "mesh.seat.node-build-node.accept.delivery";
export const checkSubject = "mesh.seat.node-build-node.accept.check";
export const stepSubject = "mesh.seat.node-build-node.accept.step";
export const recheckSubject = "mesh.seat.node-build-node.accept.recheck";
export const states = {
steps: "steps",
pauses: "pauses",
toolchains: "toolchains",
detectedSteps: "detected-steps",
};
/** The key of one value of the state steps under the form "<node>.<id>". */
export function stepsByNodeIDKey(node, id) {
return node + "." + id;
}
/** The parts of a key of the form "<node>.<id>", or undefined for a key of another form. */
export function parseStepsByNodeIDKey(_key) {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const id = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, id };
}
/** The key of one value of the state pauses under the form "paused.<node>". */
export function pausesByPausedNodeKey(node) {
return "paused." + node;
}
/** The parts of a key of the form "paused.<node>", or undefined for a key of another form. */
export function parsePausesByPausedNodeKey(_key) {
let _rest = _key;
if (!_rest.startsWith("paused.")) return undefined;
_rest = _rest.slice(7);
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
/** The key of one value of the state pauses under the form "dropped.<id>". */
export function pausesByDroppedIDKey(id) {
return "dropped." + id;
}
/** The parts of a key of the form "dropped.<id>", or undefined for a key of another form. */
export function parsePausesByDroppedIDKey(_key) {
let _rest = _key;
if (!_rest.startsWith("dropped.")) return undefined;
_rest = _rest.slice(8);
if (_rest === "") return undefined;
const id = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { id };
}
/** The key of one value of the state pauses under the form "capacity.<node>". */
export function pausesByCapacityNodeKey(node) {
return "capacity." + node;
}
/** The parts of a key of the form "capacity.<node>", or undefined for a key of another form. */
export function parsePausesByCapacityNodeKey(_key) {
let _rest = _key;
if (!_rest.startsWith("capacity.")) return undefined;
_rest = _rest.slice(9);
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
/** The key of one value of the state toolchains under the form "<node>.<language>". */
export function toolchainsByNodeLanguageKey(node, language) {
return node + "." + language;
}
/** The parts of a key of the form "<node>.<language>", or undefined for a key of another form. */
export function parseToolchainsByNodeLanguageKey(_key) {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const language = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, language };
}
/** The key of one value of the state detected-steps under the form "<module>.<artifact>". */
export function detectedStepsByModuleArtifactKey(module, artifact) {
return module + "." + artifact;
}
/** The parts of a key of the form "<module>.<artifact>", or undefined for a key of another form. */
export function parseDetectedStepsByModuleArtifactKey(_key) {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const module = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const artifact = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { module, artifact };
}
@@ -1,13 +1,18 @@
{
"description": "The contract of the seat node-build-node, generated from its definition.",
"exports": {
".": "./src/index.ts"
".": {
"default": "./index.js",
"types": "./index.d.ts"
}
},
"files": [
"src"
"index.js",
"index.d.ts",
"parts"
],
"name": "@novox/mesh-delivery-contracts-node-build-node",
"type": "module",
"types": "./src/index.ts",
"types": "./index.d.ts",
"version": "0.1.0"
}
@@ -2,12 +2,18 @@
// 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 const verbs = {
current: "current",
pause: "pause",
resume: "resume",
drop: "drop",
} as const;
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";
};
/** one artifact of a build ask: built from the fetched tree, or copied from an upstream pin */
export interface AskArtifact {
@@ -20,6 +26,8 @@ export interface AskArtifact {
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;
}
@@ -63,6 +71,20 @@ export interface ComposeAnswer {
"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) */
@@ -133,6 +155,18 @@ export interface FetchRefusal {
"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;
@@ -323,7 +357,7 @@ export interface StepAsk {
"check"?: StepAskCheck;
"compose"?: StepAskCompose;
"id": string;
/** build, check or compose */
/** build, check, compose or step */
"kind": string;
/** go, typescript or image */
"language": string;
@@ -332,11 +366,57 @@ export interface StepAsk {
"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;
}
/** what a step answered, by the kind of ask: a build's artifacts, toolchain, imports and out-of-step modules; 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 */
/** a pipeline step's end, said by the build seat's holder on the node that ran it (ADR 0666 sections 7, 21): the runner takes it only from that holder's account, naming the ask, the commit and the fingerprint it was asked at */
export interface StepEnded {
"artifact": 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;
}
/** the names the registrations hold, which the lint step refuses fixed in code logic (ADR 0666 section 5, seams ruling M7): carried in the ask, never read by the build module from another part */
export interface StepNames {
/** every watched branch a registration names */
"branches": string[];
/** every module the registrations name */
"modules": string[];
/** every repository a registration's git origin names, as <owner>/<name> */
"repositories": string[];
}
/** 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;
@@ -346,6 +426,8 @@ export interface StepResult {
"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[];
@@ -362,6 +444,35 @@ export interface StepResult {
"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;
"names": StepNames;
/** 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;
@@ -373,6 +484,12 @@ export interface TakenVersion {
"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) */
@@ -426,3 +543,58 @@ export interface DropInput {
/** 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 artifact reference, <module>:<artifact> */
"artifact": string;
"fetch": Fetch;
"fingerprint"?: string;
"module": string;
}
/** is what steps answers. */
export interface StepsAnswer {
"artifact": string;
"fingerprint"?: string;
/** answered from the kept answer */
"kept"?: boolean;
"steps": DetectedStep[];
}
/** is the body of the event step-ended. */
export type StepEndedEvent = StepEnded;
@@ -0,0 +1,18 @@
// 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 const verbs = {
current: "current",
pause: "pause",
resume: "resume",
drop: "drop",
keptArtifact: "kept-artifact",
steps: "steps",
};
export const events = {
stepEnded: "step-ended",
};
export {};