Files
mesh-delivery/contracts/go/seats/meshbuilds/contract.go
T
jschoubben 72ac9b09cb 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
2026-11-11 10:48:56 +01:00

122 lines
4.3 KiB
Go

// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// Package meshbuilds is the contract of the seat "mesh-builds", defined whole (seats/mesh-builds/seat.json): The builder's seat: it says each artifact it published and each agreed toolchain, and answers a module's reserved version. Held once for the mesh (design 47 G section 52, section 307).
package meshbuilds
import "time"
// Seat is the seat's name.
const Seat = "mesh-builds"
const (
VerbReserved = "reserved"
)
const (
EventPackagePublished = "package-published"
EventToolchainAgreed = "toolchain-agreed"
)
// Verbs is every verb the seat serves, in its definition's order: a new copy each call.
func Verbs() []string {
return []string{VerbReserved}
}
// Events is every event published on the seat's subject: a new copy each call.
func Events() []string {
return []string{EventPackagePublished, EventToolchainAgreed}
}
// Family is where the seat's events are kept: the shared events stream, filtered to the seat's subjects.
const (
Family = "mesh-builds.events"
FamilyMaxAgeDays = 7
)
// StreamPackagePublished is the stream package-published is kept in.
const StreamPackagePublished = "SEAT_mesh-builds_package-published"
// SubjectPackagePublished is where package-published is published.
const SubjectPackagePublished = "mesh.seat.mesh-builds.event.package-published"
// StreamToolchainAgreed is the stream toolchain-agreed is kept in.
const StreamToolchainAgreed = "SEAT_mesh-builds_toolchain-agreed"
// SubjectToolchainAgreed is where toolchain-agreed is published.
const SubjectToolchainAgreed = "mesh.seat.mesh-builds.event.toolchain-agreed"
// Dependency is a dependency the build resolved, named by the build module in its step key and carried by the builder (design 47 G section 374).
type Dependency struct {
// the dependency's artifact reference, <module>:<artifact>
Artifact string `json:"artifact"`
// the digest of the part, as the build used it
Digest string `json:"digest"`
// 1 an imported package, 3 the build toolchain (design 47 G section 374)
Kind int64 `json:"kind"`
// the version of the dependency the build resolved
Version string `json:"version"`
}
// PackagePublished is one artifact published at the module's reserved version (design 47 G section 52, section 334).
type PackagePublished struct {
// the package's artifact reference, <module>:<artifact>, from the catalog entry
Artifact string `json:"artifact"`
At *time.Time `json:"at,omitempty"`
// the watched branch the build was made from
Branch string `json:"branch"`
// each dependency the build resolved, with its version and digest
Dependencies []Dependency `json:"dependencies,omitempty"`
// the published artifact's digest
Digest string `json:"digest"`
// the module
Module string `json:"module"`
// the source revision of that branch the build was made from
Source int64 `json:"source"`
V int64 `json:"v"`
// the version the build reserved, MAJOR.MINOR.PATCH
Version string `json:"version"`
}
// ToolchainAgreed is the agreed toolchain of a language changed (design 47 G section 376, ADR 0584 section 1).
type ToolchainAgreed struct {
At *time.Time `json:"at,omitempty"`
// the toolchain part's digest
Digest string `json:"digest"`
// the language whose agreed toolchain changed
Language string `json:"language"`
V int64 `json:"v"`
// the agreed toolchain's version
Version string `json:"version"`
}
// ReservedInput is what reserved takes.
type ReservedInput struct {
// the module
Module string `json:"module"`
// the version, when asked for a particular one
Version string `json:"version,omitempty"`
}
// ReservedAnswerArtifactsItem is a type of the contract.
type ReservedAnswerArtifactsItem struct {
// the artifact reference, <module>:<artifact>
Artifact string `json:"artifact"`
// its digest once built; empty before
Digest string `json:"digest,omitempty"`
}
// ReservedAnswer is what reserved answers.
type ReservedAnswer struct {
Artifacts []ReservedAnswerArtifactsItem `json:"artifacts"`
// the module
Module string `json:"module"`
// the reserved version, MAJOR.MINOR.PATCH
Version string `json:"version"`
}
// PackagePublishedEvent is the body of the event package-published.
type PackagePublishedEvent = PackagePublished
// ToolchainAgreedEvent is the body of the event toolchain-agreed.
type ToolchainAgreedEvent = ToolchainAgreed