source's input branch is optional; given none it answers branches, the branch of each source key the gate keeps. Fixtures and generated code follow. Builds: design 47 G §690, §614 Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
533 lines
17 KiB
TypeScript
533 lines
17 KiB
TypeScript
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
|
|
|
|
// The contract of the seat "mesh-delivery", defined whole (seats/mesh-delivery/seat.json): The delivery gate: reads and steers deliveries, merges and the checks that decide them; the merge is made on the operator's Approve once both checks passed.
|
|
|
|
export declare const seat: "mesh-delivery";
|
|
|
|
export declare const verbs: {
|
|
readonly deliveries: "deliveries";
|
|
readonly show: "show";
|
|
readonly groups: "groups";
|
|
readonly source: "source";
|
|
readonly stalled: "stalled";
|
|
readonly recovery: "recovery";
|
|
};
|
|
|
|
export declare const events: {
|
|
readonly owed: "owed";
|
|
readonly pinned: "pinned";
|
|
readonly freed: "freed";
|
|
readonly headsReplaced: "heads-replaced";
|
|
readonly recordOpened: "record-opened";
|
|
readonly recordEnded: "record-ended";
|
|
readonly filling: "filling";
|
|
readonly full: "full";
|
|
readonly room: "room";
|
|
readonly sourceMoved: "source-moved";
|
|
readonly recoveryMerged: "recovery-merged";
|
|
readonly approvalCarried: "approval-carried";
|
|
readonly pinsStated: "pins-stated";
|
|
};
|
|
|
|
export declare const family: { readonly name: "mesh-delivery.events"; readonly maxAgeDays: 7 };
|
|
|
|
export declare const owedStream: "SEAT_mesh-delivery_owed";
|
|
|
|
export declare function owedSubject(repository: string, number: string): string;
|
|
|
|
export declare const owedSubjectAll: "mesh.seat.mesh-delivery.event.owed.*.*";
|
|
|
|
export declare const pinnedSubject: "mesh.seat.mesh-delivery.event.pinned";
|
|
|
|
export declare const freedSubject: "mesh.seat.mesh-delivery.event.freed";
|
|
|
|
export declare const headsReplacedSubject: "mesh.seat.mesh-delivery.event.heads-replaced";
|
|
|
|
export declare const recordOpenedSubject: "mesh.seat.mesh-delivery.event.record-opened";
|
|
|
|
export declare const recordEndedSubject: "mesh.seat.mesh-delivery.event.record-ended";
|
|
|
|
export declare const fillingSubject: "mesh.seat.mesh-delivery.event.filling";
|
|
|
|
export declare const fullSubject: "mesh.seat.mesh-delivery.event.full";
|
|
|
|
export declare const roomSubject: "mesh.seat.mesh-delivery.event.room";
|
|
|
|
export declare function sourceMovedSubject(branch: string): string;
|
|
|
|
export declare const sourceMovedSubjectAll: "mesh.seat.mesh-delivery.event.source-moved.*";
|
|
|
|
export declare const recoveryMergedSubject: "mesh.seat.mesh-delivery.event.recovery-merged";
|
|
|
|
export declare const approvalCarriedStream: "SEAT_mesh-delivery_approval-carried";
|
|
|
|
export declare function approvalCarriedSubject(repository: string, pull: string): string;
|
|
|
|
export declare const approvalCarriedSubjectAll: "mesh.seat.mesh-delivery.event.approval-carried.*.*";
|
|
|
|
export declare const pinsStatedSubject: "mesh.seat.mesh-delivery.event.pins-stated";
|
|
|
|
export declare const states: {
|
|
readonly source: "source";
|
|
readonly merges: "merges";
|
|
readonly asks: "asks";
|
|
readonly owed: "owed";
|
|
readonly turns: "turns";
|
|
};
|
|
|
|
/** The key of one value of the state source under the form "<branch>". */
|
|
export declare function sourceByBranchKey(branch: string): string;
|
|
|
|
/** The parts of a key of the form "<branch>", or undefined for a key of another form. */
|
|
export declare function parseSourceByBranchKey(_key: string): { branch: string } | undefined;
|
|
|
|
/** The key of one value of the state merges under the form "<group>". */
|
|
export declare function mergesByGroupKey(group: string): string;
|
|
|
|
/** The parts of a key of the form "<group>", or undefined for a key of another form. */
|
|
export declare function parseMergesByGroupKey(_key: string): { group: string } | undefined;
|
|
|
|
/** The key of one value of the state asks under the form "merge.<group>.<heads>". */
|
|
export declare function asksByMergeGroupHeadsKey(group: string, heads: string): string;
|
|
|
|
/** The parts of a key of the form "merge.<group>.<heads>", or undefined for a key of another form. */
|
|
export declare function parseAsksByMergeGroupHeadsKey(_key: string): { group: string; heads: string } | undefined;
|
|
|
|
/** The key of one value of the state owed under the form "<repository>.<number>.<head>.<act>". */
|
|
export declare function owedByRepositoryNumberHeadActKey(repository: string, number: string, head: string, act: string): string;
|
|
|
|
/** The parts of a key of the form "<repository>.<number>.<head>.<act>", or undefined for a key of another form. */
|
|
export declare function parseOwedByRepositoryNumberHeadActKey(_key: string): { repository: string; number: string; head: string; act: string } | undefined;
|
|
|
|
/** The key of one value of the state turns under the form "<repository>". */
|
|
export declare function turnsByRepositoryKey(repository: string): string;
|
|
|
|
/** The parts of a key of the form "<repository>", or undefined for a key of another form. */
|
|
export declare function parseTurnsByRepositoryKey(_key: string): { repository: string } | undefined;
|
|
|
|
/** an act the gate said for a group, with its recorded outcome once the forge bridge said one */
|
|
export interface Act {
|
|
/** when the outcome was recorded */
|
|
"at"?: string;
|
|
/** the outcome the forge bridge said as owed.ended and the gate recorded; absent while unanswered */
|
|
"outcome"?: "performed" | "refused" | "could not be performed" | "undecodable" | "dropped";
|
|
"owed": Owed;
|
|
/** the forge's own words for a refusal, the error for an act that could not be performed, why one is undecodable or dropped */
|
|
"words"?: string;
|
|
}
|
|
|
|
/** the one Approve ask of a milestone (ADR 0493 §9), said apart from each delivery's transition */
|
|
export interface Ask {
|
|
/** on answered: approve or decline */
|
|
"answer"?: string;
|
|
/** the ask's id */
|
|
"ask": string;
|
|
/** when */
|
|
"at"?: string;
|
|
/** on answered: who answered */
|
|
"by"?: string;
|
|
/** its delivery group */
|
|
"group": string;
|
|
/** repository to the head asked */
|
|
"heads"?: Record<string, string>;
|
|
/** the milestone */
|
|
"milestone": string;
|
|
/** on withdrawn: why, such as a new head of a member */
|
|
"why"?: string;
|
|
}
|
|
|
|
/** the delivery records' ledger's fill against its cap */
|
|
export interface Fill {
|
|
/** when */
|
|
"at"?: string;
|
|
"bytes": number;
|
|
/** bytes */
|
|
"cap": number;
|
|
/** what full refuses, such as the next record */
|
|
"refused"?: string;
|
|
/** the kept data, by its name in the holder's manifest */
|
|
"store": string;
|
|
}
|
|
|
|
/** one delivery group: its members, its derived state and the acts the gate said for it */
|
|
export interface Group {
|
|
/** the acts the gate said for it, each with its id and its recorded outcome; an id said and not answered is the forge bridge's to perform */
|
|
"acts": Act[];
|
|
/** the group's check: its verdict, or asked as <id> */
|
|
"check"?: string;
|
|
/** the group's id, its branch */
|
|
"id": string;
|
|
/** its members in merge order */
|
|
"members": Member[];
|
|
/** its state, derived from its members */
|
|
"state": string;
|
|
/** why it is in that state */
|
|
"why"?: string;
|
|
}
|
|
|
|
/** one member of a group: a pull request */
|
|
export interface Member {
|
|
/** the branch it merges into */
|
|
"base"?: string;
|
|
/** its head */
|
|
"head": string;
|
|
/** the member's delivery id */
|
|
"id": string;
|
|
/** the pull request's number */
|
|
"number": number;
|
|
/** the pull request is open: not merged, closed or final */
|
|
"open"?: boolean;
|
|
/** the repository, <owner>/<name> */
|
|
"repository": string;
|
|
/** the member's delivery state */
|
|
"state": string;
|
|
}
|
|
|
|
/** one act the gate owes the forge, said once under its id and safe to repeat at the forge (design 47 *What the gate owes the forge*); the forge bridge performs it through the seat git's verb of the same act */
|
|
export interface Owed {
|
|
/** the act: merge (the seat git's merge-pull), status, view, comment or note */
|
|
"act": "merge" | "status" | "view" | "comment" | "note";
|
|
/** the operator's ask that approved the heads, for a merge */
|
|
"ask"?: string;
|
|
/** the commit a status or a note line is on; the head when absent */
|
|
"commit"?: string;
|
|
/** a status: its context, such as mesh/merge-gate */
|
|
"context"?: string;
|
|
/** a status: what it says */
|
|
"description"?: string;
|
|
/** the delivery group the pull request is a member of, for a merge */
|
|
"group"?: string;
|
|
/** the pull request's head the act is for */
|
|
"head": string;
|
|
/** the act's id, the same each time it is said again; a comment and a note line carry it, so the forge holds it once */
|
|
"id": string;
|
|
/** a note line: the one line */
|
|
"line"?: string;
|
|
/** the pull request's number */
|
|
"number": number;
|
|
/** the repository, <owner>/<name> */
|
|
"repository": string;
|
|
/** when the gate first said it */
|
|
"said"?: string;
|
|
/** a status: its state, pending, success, failure or error */
|
|
"state"?: string;
|
|
/** a status: the page it links to */
|
|
"target"?: string;
|
|
/** a comment or the view: the text, markdown */
|
|
"text"?: string;
|
|
}
|
|
|
|
/** the graph revisions a delivery record starts or stops pointing at */
|
|
export interface Pins {
|
|
/** assignment graph revisions, by their number on the seat mesh-wants */
|
|
"assignment"?: number[];
|
|
/** catalog graph revisions, by their number on the seat mesh-catalog */
|
|
"catalog"?: number[];
|
|
/** the record's milestone */
|
|
"milestone": string;
|
|
/** the record's id */
|
|
"record": string;
|
|
/** on freed: the record ended past its retention, or was removed by hand */
|
|
"why"?: string;
|
|
}
|
|
|
|
/** one repository of the source revision: its trunk branch and that trunk's head */
|
|
export interface SourceHead {
|
|
/** the trunk's head the source revision names */
|
|
"head": string;
|
|
/** the repository, <owner>/<name> */
|
|
"repository": string;
|
|
/** its trunk branch, such as main */
|
|
"trunk": string;
|
|
}
|
|
|
|
/** is what deliveries takes. */
|
|
export interface DeliveriesInput {
|
|
/** "true": the final ones of the last thirty days too */
|
|
"all"?: "true" | "false";
|
|
/** a group's id (its branch name) */
|
|
"group"?: string;
|
|
/** owner/repository */
|
|
"repository"?: string;
|
|
/** one state, e.g. delivering or held */
|
|
"state"?: string;
|
|
}
|
|
|
|
/** is what deliveries answers. */
|
|
export type DeliveriesAnswer = Record<string, unknown>;
|
|
|
|
/** is what show takes. */
|
|
export interface ShowInput {
|
|
/** a delivery's id, or a group's */
|
|
"id": string;
|
|
}
|
|
|
|
/** is what show answers. */
|
|
export type ShowAnswer = Record<string, unknown>;
|
|
|
|
/** is what groups takes. */
|
|
export interface GroupsInput {
|
|
/** "true": the groups that ended too */
|
|
"all"?: "true" | "false";
|
|
/** one group's id: that group alone, ended or not */
|
|
"group"?: string;
|
|
}
|
|
|
|
/** is what groups answers. */
|
|
export interface GroupsAnswer {
|
|
/** why it could not answer at all; a group it does not know is answered with no groups, never an error */
|
|
"error"?: string;
|
|
"groups"?: Group[];
|
|
}
|
|
|
|
/** is what source takes. */
|
|
export interface SourceInput {
|
|
/** the watched branch, escaped as a key name is; absent: the answer is the list of the branches the gate keeps a source revision of (design 47 G section 690) */
|
|
"branch"?: string;
|
|
}
|
|
|
|
/** is what source answers. */
|
|
export interface SourceAnswer {
|
|
/** the watched branch the source revision is of */
|
|
"branch"?: string;
|
|
/** given no branch: the branch name of each source.<branch> key the gate keeps, which every reader of the catalog half follows before the first registrations (design 47 G section 614, section 690) */
|
|
"branches"?: string[];
|
|
/** why it could not be read */
|
|
"error"?: string;
|
|
/** the group that moved the source revision last; absent before the first */
|
|
"group"?: string;
|
|
/** every repository the source revision names, by name */
|
|
"repositories"?: SourceHead[];
|
|
/** the source revision's number on the bus; 0 before the first */
|
|
"revision"?: number;
|
|
}
|
|
|
|
/** is what stalled takes. */
|
|
export interface StalledInput {
|
|
}
|
|
|
|
/** is what stalled answers. */
|
|
export type StalledAnswer = Record<string, unknown>;
|
|
|
|
/** is what recovery takes. */
|
|
export interface RecoveryInput {
|
|
/** the merge commit */
|
|
"commit": string;
|
|
/** the repository, <owner>/<name> */
|
|
"repository": string;
|
|
/** why the merge is a recovery */
|
|
"why": string;
|
|
}
|
|
|
|
/** is what recovery answers. */
|
|
export interface RecoveryAnswer {
|
|
/** the caller the runtime proved */
|
|
"by"?: string;
|
|
/** the merge commit */
|
|
"commit": string;
|
|
"recovery": boolean;
|
|
/** the repository */
|
|
"repository"?: string;
|
|
}
|
|
|
|
/** is the body of the event owed. */
|
|
export type OwedEvent = Owed;
|
|
|
|
/** is the body of the event pinned. */
|
|
export type PinnedEvent = Pins;
|
|
|
|
/** is the body of the event freed. */
|
|
export type FreedEvent = Pins;
|
|
|
|
/** is the body of the event heads-replaced. */
|
|
export interface HeadsReplacedEvent {
|
|
/** when */
|
|
"at"?: string;
|
|
/** the pull request closed */
|
|
"closed"?: boolean;
|
|
/** the group */
|
|
"group": string;
|
|
/** its new head; absent when it closed */
|
|
"head"?: string;
|
|
/** the candidate's heads, 12 hex digits, as its revisions are keyed */
|
|
"heads": string;
|
|
/** its pull request's number */
|
|
"number": number;
|
|
/** the member whose head moved or which closed */
|
|
"repository": string;
|
|
}
|
|
|
|
/** is the body of the event record-opened. */
|
|
export interface RecordOpenedEvent {
|
|
/** when */
|
|
"at"?: string;
|
|
/** a merge made at the forge, with no Approve */
|
|
"forge-made"?: boolean;
|
|
/** its milestone */
|
|
"milestone": string;
|
|
/** the record's id */
|
|
"record": string;
|
|
}
|
|
|
|
export interface RecordEndedEventAwayItem {
|
|
/** a node away */
|
|
"node": string;
|
|
/** since when */
|
|
"since"?: string;
|
|
}
|
|
|
|
/** is the body of the event record-ended. */
|
|
export interface RecordEndedEvent {
|
|
/** when */
|
|
"at"?: string;
|
|
/** the nodes away, each with since when; it ends without them */
|
|
"away"?: RecordEndedEventAwayItem[];
|
|
/** a merge made at the forge, with no Approve */
|
|
"forge-made"?: boolean;
|
|
/** its milestone */
|
|
"milestone": string;
|
|
/** the record's id */
|
|
"record": string;
|
|
}
|
|
|
|
/** is the body of the event filling. */
|
|
export type FillingEvent = Fill;
|
|
|
|
/** is the body of the event full. */
|
|
export type FullEvent = Fill;
|
|
|
|
/** is the body of the event room. */
|
|
export type RoomEvent = Fill;
|
|
|
|
/** is the body of the event source-moved. */
|
|
export interface SourceMovedEvent {
|
|
"at"?: string;
|
|
"branch": string;
|
|
/** the group that moved it, when one did */
|
|
"group"?: string;
|
|
"revision": number;
|
|
"v"?: number;
|
|
}
|
|
|
|
/** is the body of the event recovery-merged. */
|
|
export interface RecoveryMergedEvent {
|
|
"at"?: string;
|
|
/** the caller the runtime proved */
|
|
"by"?: string;
|
|
/** the merge commit */
|
|
"commit": string;
|
|
/** the repository */
|
|
"repository": string;
|
|
"v": number;
|
|
/** why */
|
|
"why": string;
|
|
}
|
|
|
|
/** is the body of the event approval-carried. */
|
|
export interface ApprovalCarriedEvent {
|
|
/** who approved: the operator */
|
|
"approver": string;
|
|
/** when it was said, RFC 3339 */
|
|
"at": string;
|
|
/** the head the Approve named */
|
|
"commit": string;
|
|
/** the pull request's number */
|
|
"pull": number;
|
|
/** the repository */
|
|
"repository": string;
|
|
}
|
|
|
|
/** is the body of the event pins-stated. */
|
|
export interface PinsStatedEvent {
|
|
/** when it was said, RFC 3339 */
|
|
"at": string;
|
|
}
|
|
|
|
/** is one value of the state source under the key <branch>. */
|
|
export interface SourceByBranchValue {
|
|
/** the group that moved it */
|
|
"group": string;
|
|
/** repository to the merged head, a full commit */
|
|
"heads": Record<string, string>;
|
|
/** the layout version */
|
|
"v"?: number;
|
|
}
|
|
|
|
export interface MergesByGroupValuePullsItem {
|
|
"commit"?: string;
|
|
"head": string;
|
|
"number": number;
|
|
"repository": string;
|
|
/** merging, merged or refused */
|
|
"state": string;
|
|
"words"?: string;
|
|
}
|
|
|
|
/** is one value of the state merges under the key <group>. */
|
|
export interface MergesByGroupValue {
|
|
/** <repository>@<number> to the approved head */
|
|
"approved"?: Record<string, string>;
|
|
/** the ask key */
|
|
"ask": string;
|
|
"group": string;
|
|
"pulls": MergesByGroupValuePullsItem[];
|
|
/** the layout version */
|
|
"v"?: number;
|
|
}
|
|
|
|
export interface AsksByMergeGroupHeadsValueHeadsItem {
|
|
/** the full commit */
|
|
"head": string;
|
|
"number": number;
|
|
/** <owner>/<name> */
|
|
"repository": string;
|
|
}
|
|
|
|
/** is one value of the state asks under the key merge.<group>.<heads>. */
|
|
export interface AsksByMergeGroupHeadsValue {
|
|
/** the operator-channel ask as raised */
|
|
"ask": unknown;
|
|
/** the number of times it was asked */
|
|
"asking"?: number;
|
|
"group": string;
|
|
"heads": AsksByMergeGroupHeadsValueHeadsItem[];
|
|
/** the layout version */
|
|
"v"?: number;
|
|
}
|
|
|
|
/** is one value of the state owed under the key <repository>.<number>.<head>.<act>. */
|
|
export interface OwedByRepositoryNumberHeadActValue {
|
|
/** status=<context>, view, note or comment.<seq> */
|
|
"act": string;
|
|
"context"?: string;
|
|
"ref"?: string;
|
|
"state"?: string;
|
|
"target"?: string;
|
|
"text"?: string;
|
|
/** the layout version */
|
|
"v"?: number;
|
|
}
|
|
|
|
export interface TurnsByRepositoryValueWaitingItem {
|
|
/** when (RFC 3339 time) */
|
|
"approved": string;
|
|
"ask"?: string;
|
|
"group": string;
|
|
"heads": string;
|
|
/** when (RFC 3339 time) */
|
|
"since": string;
|
|
"step"?: string;
|
|
"waits-for"?: string;
|
|
/** when (RFC 3339 time) */
|
|
"waits-since"?: string;
|
|
}
|
|
|
|
/** is one value of the state turns under the key <repository>. */
|
|
export interface TurnsByRepositoryValue {
|
|
"repository": string;
|
|
/** the layout version */
|
|
"v"?: number;
|
|
"waiting": TurnsByRepositoryValueWaitingItem[];
|
|
}
|
|
|