D1: the build step part gains the state again, run, again-at, passing and the verb drop; the three build seats regenerated (ADR 0664 §1, §4, issue 1748)

Shared lines for the join with milestone G: contracts/parts/build-step.json, the three seats' fixtures and generated contract files.

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-09 22:54:42 +01:00
parent 29e491e715
commit 440d02afb3
22 changed files with 599 additions and 13 deletions
@@ -10,6 +10,7 @@ export const verbs = {
current: "current",
pause: "pause",
resume: "resume",
drop: "drop",
} as const;
export const accepts = {
@@ -66,6 +67,23 @@ export function parsePausesByPausedNodeKey(_key: string): { node: string } | und
return { node };
}
/** The key of one value of the state pauses under the form "dropped.<id>". */
export function pausesByDroppedIDKey(id: string): string {
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: 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 };
}
/** The key of one value of the state pauses under the form "capacity.<node>". */
export function pausesByCapacityNodeKey(node: string): string {
return "capacity." + node;
@@ -110,6 +128,9 @@ export type CheckAnswer = buildStep.CheckAnswer;
export type ComposeAnswer = buildStep.ComposeAnswer;
export type CurrentAnswer = buildStep.CurrentAnswer;
export type CurrentInput = buildStep.CurrentInput;
export type Drop = buildStep.Drop;
export type DropAnswer = buildStep.DropAnswer;
export type DropInput = buildStep.DropInput;
export type Fetch = buildStep.Fetch;
export type FetchAnswer = buildStep.FetchAnswer;
export type FetchBesideItem = buildStep.FetchBesideItem;
@@ -159,6 +180,9 @@ export type StepsByNodeIDValue = Step;
/** is one value of the state pauses under the key paused.<node>. */
export type PausesByPausedNodeValue = Pause;
/** is one value of the state pauses under the key dropped.<id>. */
export type PausesByDroppedIDValue = Drop;
/** is one value of the state pauses under the key capacity.<node>. */
export type PausesByCapacityNodeValue = Capacity;
@@ -6,6 +6,7 @@ export const verbs = {
current: "current",
pause: "pause",
resume: "resume",
drop: "drop",
} as const;
/** one artifact of a build ask: built from the fetched tree, or copied from an upstream pin */
@@ -62,6 +63,16 @@ export interface ComposeAnswer {
"verdict"?: unknown;
}
/** 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;
@@ -244,19 +255,25 @@ export interface RunProgram {
/** 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, passed, failed or refused */
/** running, again (ended on a transport fault, to be given again by the bus after again-at), passed, failed or refused */
"state": string;
"tool": string;
/** the layout version */
@@ -396,3 +413,16 @@ 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>;