mesh-delivery-contracts: mesh-delivery-checker, mesh-delivery and mesh-catalog defined whole with their states; mesh-catalog serves seat-definitions and its two events (D-2, D-3, D-27, ADR 0634 §6, ADR 0635 §5, ADR 0636 §1; issue 1966)

This commit is contained in:
2026-11-05 14:10:22 +01:00
parent a6f29d42be
commit d44c905e37
22 changed files with 4838 additions and 0 deletions
+594
View File
@@ -0,0 +1,594 @@
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// Package meshcatalog is the contract of the seat "mesh-catalog", defined whole (seats/mesh-catalog/seat.json): The catalog of the mesh: every module the trunk holds with its manifest, fingerprint and verdict, the packages published, and the seat list (ADR 0636 §1, §4).
package meshcatalog
import (
"bytes"
"encoding/json"
"errors"
"strings"
)
// Seat is the seat's name.
const Seat = "mesh-catalog"
const (
VerbModules = "modules"
VerbModule = "module"
VerbProvides = "provides"
VerbDependents = "dependents"
)
const (
EventSeatDefinitionChanged = "seat-definition-changed"
EventSeatDefinitionRemoved = "seat-definition-removed"
)
// Verbs is every verb the seat serves, in its definition's order: a new copy each call.
func Verbs() []string {
return []string{VerbModules, VerbModule, VerbProvides, VerbDependents}
}
// Events is every event published on the seat's subject: a new copy each call.
func Events() []string {
return []string{EventSeatDefinitionChanged, EventSeatDefinitionRemoved}
}
// Family is where the seat's events are kept: the shared events stream, filtered to the seat's subjects.
const (
Family = "mesh-catalog.events"
FamilyMaxAgeDays = 7
)
// SubjectSeatDefinitionChanged is where seat-definition-changed is published.
const SubjectSeatDefinitionChanged = "mesh.seat.mesh-catalog.event.seat-definition-changed"
// SubjectSeatDefinitionRemoved is where seat-definition-removed is published.
const SubjectSeatDefinitionRemoved = "mesh.seat.mesh-catalog.event.seat-definition-removed"
const (
StateManifests = "manifests"
StateModules = "modules"
StateCandidates = "candidates"
StateVerdicts = "verdicts"
StatePredefined = "predefined"
StateConfigCandidates = "config-candidates"
StatePackages = "packages"
)
// ManifestsByDigestKey is the key of one value of the state manifests under the form "<digest>".
func ManifestsByDigestKey(digest string) string { return digest }
// ParseManifestsByDigestKey reads the parts of a key of the form "<digest>", in the order of the form; the last result is false for a key of another form.
func ParseManifestsByDigestKey(key string) (string, bool) {
rest := key
if rest == "" {
return "", false
}
v0 := rest
rest = ""
if rest != "" {
return "", false
}
return v0, true
}
// DecodeManifestsByDigestValue reads one value of the state manifests under the form "<digest>", refusing a field ManifestsByDigestValue does not know and any text after the value.
func DecodeManifestsByDigestValue(raw []byte) (ManifestsByDigestValue, error) {
var v ManifestsByDigestValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// ModulesByModuleKey is the key of one value of the state modules under the form "<module>".
func ModulesByModuleKey(module string) string { return module }
// ParseModulesByModuleKey reads the parts of a key of the form "<module>", in the order of the form; the last result is false for a key of another form.
func ParseModulesByModuleKey(key string) (string, bool) {
rest := key
if rest == "" {
return "", false
}
v0 := rest
rest = ""
if rest != "" {
return "", false
}
return v0, true
}
// DecodeModulesByModuleValue reads one value of the state modules under the form "<module>", refusing a field ModulesByModuleValue does not know and any text after the value.
func DecodeModulesByModuleValue(raw []byte) (ModulesByModuleValue, error) {
var v ModulesByModuleValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// CandidatesByGroupKey is the key of one value of the state candidates under the form "<group>".
func CandidatesByGroupKey(group string) string { return group }
// ParseCandidatesByGroupKey reads the parts of a key of the form "<group>", in the order of the form; the last result is false for a key of another form.
func ParseCandidatesByGroupKey(key string) (string, bool) {
rest := key
if rest == "" {
return "", false
}
v0 := rest
rest = ""
if rest != "" {
return "", false
}
return v0, true
}
// DecodeCandidatesByGroupValue reads one value of the state candidates under the form "<group>", refusing a field CandidatesByGroupValue does not know and any text after the value.
func DecodeCandidatesByGroupValue(raw []byte) (CandidatesByGroupValue, error) {
var v CandidatesByGroupValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// VerdictsByDigestKey is the key of one value of the state verdicts under the form "<digest>".
func VerdictsByDigestKey(digest string) string { return digest }
// ParseVerdictsByDigestKey reads the parts of a key of the form "<digest>", in the order of the form; the last result is false for a key of another form.
func ParseVerdictsByDigestKey(key string) (string, bool) {
rest := key
if rest == "" {
return "", false
}
v0 := rest
rest = ""
if rest != "" {
return "", false
}
return v0, true
}
// DecodeVerdictsByDigestValue reads one value of the state verdicts under the form "<digest>", refusing a field VerdictsByDigestValue does not know and any text after the value.
func DecodeVerdictsByDigestValue(raw []byte) (VerdictsByDigestValue, error) {
var v VerdictsByDigestValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// PredefinedByListKey is the key of one value of the state predefined under the form "list".
func PredefinedByListKey() string { return "list" }
// ParsePredefinedByListKey reads the parts of a key of the form "list", in the order of the form; the last result is false for a key of another form.
func ParsePredefinedByListKey(key string) bool {
rest := key
if !strings.HasPrefix(rest, "list") {
return false
}
rest = rest[4:]
if rest != "" {
return false
}
return true
}
// DecodePredefinedByListValue reads one value of the state predefined under the form "list", refusing a field PredefinedByListValue does not know and any text after the value.
func DecodePredefinedByListValue(raw []byte) (PredefinedByListValue, error) {
var v PredefinedByListValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// ConfigCandidatesByPullKey is the key of one value of the state config-candidates under the form "<pull>".
func ConfigCandidatesByPullKey(pull string) string { return pull }
// ParseConfigCandidatesByPullKey reads the parts of a key of the form "<pull>", in the order of the form; the last result is false for a key of another form.
func ParseConfigCandidatesByPullKey(key string) (string, bool) {
rest := key
if rest == "" {
return "", false
}
v0 := rest
rest = ""
if rest != "" {
return "", false
}
return v0, true
}
// DecodeConfigCandidatesByPullValue reads one value of the state config-candidates under the form "<pull>", refusing a field ConfigCandidatesByPullValue does not know and any text after the value.
func DecodeConfigCandidatesByPullValue(raw []byte) (ConfigCandidatesByPullValue, error) {
var v ConfigCandidatesByPullValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// PackagesByModuleKey is the key of one value of the state packages under the form "<module>".
func PackagesByModuleKey(module string) string { return module }
// ParsePackagesByModuleKey reads the parts of a key of the form "<module>", in the order of the form; the last result is false for a key of another form.
func ParsePackagesByModuleKey(key string) (string, bool) {
rest := key
if rest == "" {
return "", false
}
v0 := rest
rest = ""
if rest != "" {
return "", false
}
return v0, true
}
// DecodePackagesByModuleValue reads one value of the state packages under the form "<module>", refusing a field PackagesByModuleValue does not know and any text after the value.
func DecodePackagesByModuleValue(raw []byte) (PackagesByModuleValue, error) {
var v PackagesByModuleValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// PackagesByPackageSeriesKey is the key of one value of the state packages under the form "<package>.<series>".
func PackagesByPackageSeriesKey(packagePart, series string) string { return packagePart + "." + series }
// ParsePackagesByPackageSeriesKey reads the parts of a key of the form "<package>.<series>", in the order of the form; the last result is false for a key of another form.
func ParsePackagesByPackageSeriesKey(key string) (string, string, bool) {
rest := key
v0, after0, found0 := strings.Cut(rest, ".")
if !found0 || v0 == "" {
return "", "", false
}
rest = after0
if rest == "" {
return "", "", false
}
v2 := rest
rest = ""
if rest != "" {
return "", "", false
}
return v0, v2, true
}
// DecodePackagesByPackageSeriesValue reads one value of the state packages under the form "<package>.<series>", refusing a field PackagesByPackageSeriesValue does not know and any text after the value.
func DecodePackagesByPackageSeriesValue(raw []byte) (PackagesByPackageSeriesValue, error) {
var v PackagesByPackageSeriesValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// ModulesInput is what modules takes.
type ModulesInput struct {
}
// ModulesAnswer is what modules answers.
type ModulesAnswer = map[string]any
// ModuleInput is what module takes.
type ModuleInput struct {
// the module's name
Module string `json:"module"`
}
// ModuleAnswer is what module answers.
type ModuleAnswer = map[string]any
// ProvidesInput is what provides takes.
type ProvidesInput struct {
// the provision, such as postgres-database
Provision string `json:"provision"`
}
// ProvidesAnswer is what provides answers.
type ProvidesAnswer = map[string]any
// DependentsInput is what dependents takes.
type DependentsInput struct {
// the module's name
Module string `json:"module"`
}
// DependentsAnswer is what dependents answers.
type DependentsAnswer = map[string]any
// SeatDefinitionChangedEvent is the body of the event seat-definition-changed.
type SeatDefinitionChangedEvent struct {
Digest string `json:"digest"`
Seat string `json:"seat"`
// trunk
Source string `json:"source"`
}
// SeatDefinitionRemovedEvent is the body of the event seat-definition-removed.
type SeatDefinitionRemovedEvent struct {
Seat string `json:"seat"`
}
// ManifestsByDigestValue is one value of the state manifests under the key <digest>.
type ManifestsByDigestValue struct {
// the manifest, UTF-8 JSON text
Manifest string `json:"manifest"`
Module string `json:"module"`
// the layout version
V int64 `json:"v,omitempty"`
}
// ModulesByModuleValueInputs2 is a type of the contract.
type ModulesByModuleValueInputs2 struct {
Bases []string `json:"bases,omitempty"`
Builder string `json:"builder,omitempty"`
Contexts map[string]string `json:"contexts,omitempty"`
ImportForm string `json:"import-form,omitempty"`
Imports []string `json:"imports,omitempty"`
Locks map[string]string `json:"locks,omitempty"`
Packages []string `json:"packages,omitempty"`
Paths map[string]string `json:"paths,omitempty"`
Tree string `json:"tree"`
}
// ModulesByModuleValue is one value of the state modules under the key <module>.
type ModulesByModuleValue struct {
Commit string `json:"commit"`
// the old-form fingerprint
Fp string `json:"fp,omitempty"`
FpSrc int64 `json:"fp-src,omitempty"`
// src2: fingerprint
Fp2 string `json:"fp2,omitempty"`
Inputs2 *ModulesByModuleValueInputs2 `json:"inputs2,omitempty"`
// manifest digest
Manifest string `json:"manifest,omitempty"`
Needs []string `json:"needs,omitempty"`
None string `json:"none,omitempty"`
// why it has none
None2 string `json:"none2,omitempty"`
Packages map[string]string `json:"packages,omitempty"`
Path string `json:"path,omitempty"`
Paths map[string][]string `json:"paths,omitempty"`
Problems []string `json:"problems,omitempty"`
Repository string `json:"repository"`
// the source revision
Src int64 `json:"src,omitempty"`
Toolchains map[string]any `json:"toolchains,omitempty"`
Unknown []string `json:"unknown,omitempty"`
// the layout version
V int64 `json:"v,omitempty"`
Verdict string `json:"verdict,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
// CandidatesByGroupValuePullsItemFpsValue is a type of the contract.
type CandidatesByGroupValuePullsItemFpsValue struct {
Fp2 string `json:"fp2,omitempty"`
Manifest string `json:"manifest,omitempty"`
None2 string `json:"none2,omitempty"`
Packages map[string]string `json:"packages,omitempty"`
Paths map[string]string `json:"paths,omitempty"`
}
// CandidatesByGroupValuePullsItem is a type of the contract.
type CandidatesByGroupValuePullsItem struct {
Fps map[string]CandidatesByGroupValuePullsItemFpsValue `json:"fps,omitempty"`
Head string `json:"head"`
Modules []string `json:"modules"`
Number int64 `json:"number"`
Repository string `json:"repository"`
}
// CandidatesByGroupValue is one value of the state candidates under the key <group>.
type CandidatesByGroupValue struct {
// the source revision it is read on
Base int64 `json:"base"`
Fpset string `json:"fpset,omitempty"`
Group string `json:"group"`
Heads string `json:"heads"`
Pulls []CandidatesByGroupValuePullsItem `json:"pulls"`
// the layout version
V int64 `json:"v,omitempty"`
}
// VerdictsByDigestValue is one value of the state verdicts under the key <digest>.
type VerdictsByDigestValue struct {
// when (RFC 3339 time)
At string `json:"at,omitempty"`
Judge string `json:"judge,omitempty"`
Module string `json:"module"`
Problems []string `json:"problems,omitempty"`
State string `json:"state"`
Unknown []string `json:"unknown,omitempty"`
// the layout version
V int64 `json:"v,omitempty"`
Warnings []string `json:"warnings,omitempty"`
}
// PredefinedByListValue is one value of the state predefined under the key list.
type PredefinedByListValue struct {
// when (RFC 3339 time)
At string `json:"at,omitempty"`
Commit string `json:"commit"`
// the foundation's predefined list as kept
List any `json:"list"`
// the layout version
V int64 `json:"v,omitempty"`
}
// ConfigCandidatesByPullValueDeclaresValueValue is a type of the contract.
type ConfigCandidatesByPullValueDeclaresValueValue struct {
// the default
Default any `json:"default"`
Description string `json:"description,omitempty"`
// the allowed values
Enum any `json:"enum,omitempty"`
Kind string `json:"kind"`
Maximum float64 `json:"maximum,omitempty"`
Minimum float64 `json:"minimum,omitempty"`
Pattern string `json:"pattern,omitempty"`
Predefined string `json:"predefined,omitempty"`
Required bool `json:"required,omitempty"`
Runtime bool `json:"runtime,omitempty"`
Trusted bool `json:"trusted,omitempty"`
Type string `json:"type,omitempty"`
Why string `json:"why"`
}
// ConfigCandidatesByPullValue is one value of the state config-candidates under the key <pull>.
type ConfigCandidatesByPullValue struct {
// when (RFC 3339 time)
At string `json:"at,omitempty"`
// module to key to declaration
Declares map[string]map[string]ConfigCandidatesByPullValueDeclaresValueValue `json:"declares"`
Head string `json:"head"`
Pull string `json:"pull"`
// the layout version
V int64 `json:"v,omitempty"`
}
// PackagesByModuleValuePackagesItem is a type of the contract.
type PackagesByModuleValuePackagesItem struct {
Digest string `json:"digest"`
Package string `json:"package"`
}
// PackagesByModuleValue is one value of the state packages under the key <module>.
type PackagesByModuleValue struct {
// when (RFC 3339 time)
At string `json:"at,omitempty"`
Commit string `json:"commit"`
Dir string `json:"dir,omitempty"`
// the Go module path
Module string `json:"module"`
Packages []PackagesByModuleValuePackagesItem `json:"packages"`
Repository string `json:"repository"`
// digest of go.mod and go.sum
Requires string `json:"requires,omitempty"`
// the layout version
V int64 `json:"v,omitempty"`
}
// PackagesByPackageSeriesValueNewestContentsPackagesItem is a type of the contract.
type PackagesByPackageSeriesValueNewestContentsPackagesItem struct {
Digest string `json:"digest"`
Package string `json:"package"`
}
// PackagesByPackageSeriesValueNewestContents is a type of the contract.
type PackagesByPackageSeriesValueNewestContents struct {
// when (RFC 3339 time)
At string `json:"at,omitempty"`
Commit string `json:"commit"`
Dir string `json:"dir,omitempty"`
// the Go module path
Module string `json:"module"`
Packages []PackagesByPackageSeriesValueNewestContentsPackagesItem `json:"packages"`
Repository string `json:"repository"`
// digest of go.mod and go.sum
Requires string `json:"requires,omitempty"`
// the layout version
V int64 `json:"v,omitempty"`
}
// PackagesByPackageSeriesValueNewest is a type of the contract.
type PackagesByPackageSeriesValueNewest struct {
Commit string `json:"commit,omitempty"`
Contents *PackagesByPackageSeriesValueNewestContents `json:"contents,omitempty"`
Digest string `json:"digest,omitempty"`
Fingerprint string `json:"fingerprint,omitempty"`
Version string `json:"version"`
}
// PackagesByPackageSeriesValueNumberedContentsPackagesItem is a type of the contract.
type PackagesByPackageSeriesValueNumberedContentsPackagesItem struct {
Digest string `json:"digest"`
Package string `json:"package"`
}
// PackagesByPackageSeriesValueNumberedContents is a type of the contract.
type PackagesByPackageSeriesValueNumberedContents struct {
// when (RFC 3339 time)
At string `json:"at,omitempty"`
Commit string `json:"commit"`
Dir string `json:"dir,omitempty"`
// the Go module path
Module string `json:"module"`
Packages []PackagesByPackageSeriesValueNumberedContentsPackagesItem `json:"packages"`
Repository string `json:"repository"`
// digest of go.mod and go.sum
Requires string `json:"requires,omitempty"`
// the layout version
V int64 `json:"v,omitempty"`
}
// PackagesByPackageSeriesValueNumbered is a type of the contract.
type PackagesByPackageSeriesValueNumbered struct {
Commit string `json:"commit,omitempty"`
Contents *PackagesByPackageSeriesValueNumberedContents `json:"contents,omitempty"`
Digest string `json:"digest,omitempty"`
Fingerprint string `json:"fingerprint,omitempty"`
Version string `json:"version"`
}
// PackagesByPackageSeriesValue is one value of the state packages under the key <package>.<series>.
type PackagesByPackageSeriesValue struct {
// when (RFC 3339 time)
At string `json:"at,omitempty"`
GoModule string `json:"go-module,omitempty"`
Name string `json:"name"`
Newest *PackagesByPackageSeriesValueNewest `json:"newest,omitempty"`
Numbered *PackagesByPackageSeriesValueNumbered `json:"numbered,omitempty"`
Package string `json:"package,omitempty"`
Seat string `json:"seat,omitempty"`
Series string `json:"series"`
// the layout version
V int64 `json:"v,omitempty"`
}
+3
View File
@@ -0,0 +1,3 @@
module git.novox.be/novox/mesh-delivery/contracts/go/seats/meshcatalog
go 1.26.0
+454
View File
@@ -0,0 +1,454 @@
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// Package meshdelivery is 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.
package meshdelivery
import (
"bytes"
"encoding/json"
"errors"
"strings"
)
// Seat is the seat's name.
const Seat = "mesh-delivery"
const (
VerbDeliveries = "deliveries"
VerbTimes = "times"
VerbShow = "show"
VerbGroups = "groups"
VerbWhatIf = "what-if"
VerbChecks = "checks"
VerbTable = "table"
VerbStalled = "stalled"
VerbRecheck = "recheck"
VerbRelease = "release"
VerbStop = "stop"
VerbClose = "close"
VerbRetireHistory = "retire-history"
VerbSettle = "settle"
)
// Verbs is every verb the seat serves, in its definition's order: a new copy each call.
func Verbs() []string {
return []string{VerbDeliveries, VerbTimes, VerbShow, VerbGroups, VerbWhatIf, VerbChecks, VerbTable, VerbStalled, VerbRecheck, VerbRelease, VerbStop, VerbClose, VerbRetireHistory, VerbSettle}
}
const (
StateSource = "source"
StateMerges = "merges"
StateAsks = "asks"
StateOwed = "owed"
StateTurns = "turns"
)
// SourceByMainKey is the key of one value of the state source under the form "main".
func SourceByMainKey() string { return "main" }
// ParseSourceByMainKey reads the parts of a key of the form "main", in the order of the form; the last result is false for a key of another form.
func ParseSourceByMainKey(key string) bool {
rest := key
if !strings.HasPrefix(rest, "main") {
return false
}
rest = rest[4:]
if rest != "" {
return false
}
return true
}
// DecodeSourceByMainValue reads one value of the state source under the form "main", refusing a field SourceByMainValue does not know and any text after the value.
func DecodeSourceByMainValue(raw []byte) (SourceByMainValue, error) {
var v SourceByMainValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// MergesByGroupKey is the key of one value of the state merges under the form "<group>".
func MergesByGroupKey(group string) string { return group }
// ParseMergesByGroupKey reads the parts of a key of the form "<group>", in the order of the form; the last result is false for a key of another form.
func ParseMergesByGroupKey(key string) (string, bool) {
rest := key
if rest == "" {
return "", false
}
v0 := rest
rest = ""
if rest != "" {
return "", false
}
return v0, true
}
// DecodeMergesByGroupValue reads one value of the state merges under the form "<group>", refusing a field MergesByGroupValue does not know and any text after the value.
func DecodeMergesByGroupValue(raw []byte) (MergesByGroupValue, error) {
var v MergesByGroupValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// AsksByMergeGroupHeadsKey is the key of one value of the state asks under the form "merge.<group>.<heads>".
func AsksByMergeGroupHeadsKey(group, heads string) string { return "merge." + group + "." + heads }
// ParseAsksByMergeGroupHeadsKey reads the parts of a key of the form "merge.<group>.<heads>", in the order of the form; the last result is false for a key of another form.
func ParseAsksByMergeGroupHeadsKey(key string) (string, string, bool) {
rest := key
if !strings.HasPrefix(rest, "merge.") {
return "", "", false
}
rest = rest[6:]
v1, after1, found1 := strings.Cut(rest, ".")
if !found1 || v1 == "" {
return "", "", false
}
rest = after1
if rest == "" {
return "", "", false
}
v3 := rest
rest = ""
if rest != "" {
return "", "", false
}
return v1, v3, true
}
// DecodeAsksByMergeGroupHeadsValue reads one value of the state asks under the form "merge.<group>.<heads>", refusing a field AsksByMergeGroupHeadsValue does not know and any text after the value.
func DecodeAsksByMergeGroupHeadsValue(raw []byte) (AsksByMergeGroupHeadsValue, error) {
var v AsksByMergeGroupHeadsValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// OwedByRepositoryNumberHeadActKey is the key of one value of the state owed under the form "<repository>.<number>.<head>.<act>".
func OwedByRepositoryNumberHeadActKey(repository, number, head, act string) string {
return repository + "." + number + "." + head + "." + act
}
// ParseOwedByRepositoryNumberHeadActKey reads the parts of a key of the form "<repository>.<number>.<head>.<act>", in the order of the form; the last result is false for a key of another form.
func ParseOwedByRepositoryNumberHeadActKey(key string) (string, string, string, string, bool) {
rest := key
v0, after0, found0 := strings.Cut(rest, ".")
if !found0 || v0 == "" {
return "", "", "", "", false
}
rest = after0
v2, after2, found2 := strings.Cut(rest, ".")
if !found2 || v2 == "" {
return "", "", "", "", false
}
rest = after2
v4, after4, found4 := strings.Cut(rest, ".")
if !found4 || v4 == "" {
return "", "", "", "", false
}
rest = after4
if rest == "" {
return "", "", "", "", false
}
v6 := rest
rest = ""
if rest != "" {
return "", "", "", "", false
}
return v0, v2, v4, v6, true
}
// DecodeOwedByRepositoryNumberHeadActValue reads one value of the state owed under the form "<repository>.<number>.<head>.<act>", refusing a field OwedByRepositoryNumberHeadActValue does not know and any text after the value.
func DecodeOwedByRepositoryNumberHeadActValue(raw []byte) (OwedByRepositoryNumberHeadActValue, error) {
var v OwedByRepositoryNumberHeadActValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// TurnsByRepositoryKey is the key of one value of the state turns under the form "<repository>".
func TurnsByRepositoryKey(repository string) string { return repository }
// ParseTurnsByRepositoryKey reads the parts of a key of the form "<repository>", in the order of the form; the last result is false for a key of another form.
func ParseTurnsByRepositoryKey(key string) (string, bool) {
rest := key
if rest == "" {
return "", false
}
v0 := rest
rest = ""
if rest != "" {
return "", false
}
return v0, true
}
// DecodeTurnsByRepositoryValue reads one value of the state turns under the form "<repository>", refusing a field TurnsByRepositoryValue does not know and any text after the value.
func DecodeTurnsByRepositoryValue(raw []byte) (TurnsByRepositoryValue, error) {
var v TurnsByRepositoryValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// DeliveriesInput is what deliveries takes.
type DeliveriesInput struct {
// "true": the final ones of the last thirty days too
All string `json:"all,omitempty"`
// a group's id (its branch name)
Group string `json:"group,omitempty"`
// owner/repository
Repository string `json:"repository,omitempty"`
// one state, e.g. delivering or held
State string `json:"state,omitempty"`
}
// The values of DeliveriesInput's all.
const (
DeliveriesInputAllTrue = "true"
DeliveriesInputAllFalse = "false"
)
// DeliveriesAnswer is what deliveries answers.
type DeliveriesAnswer = map[string]any
// TimesInput is what times takes.
type TimesInput struct {
}
// TimesAnswer is what times answers.
type TimesAnswer = map[string]any
// ShowInput is what show takes.
type ShowInput struct {
// a delivery's id, or a group's
ID string `json:"id"`
}
// ShowAnswer is what show answers.
type ShowAnswer = map[string]any
// GroupsInput is what groups takes.
type GroupsInput struct {
// "true": the groups that ended too
All string `json:"all,omitempty"`
}
// The values of GroupsInput's all.
const (
GroupsInputAllTrue = "true"
GroupsInputAllFalse = "false"
)
// GroupsAnswer is what groups answers.
type GroupsAnswer = map[string]any
// WhatIfInput is what what-if takes.
type WhatIfInput struct {
}
// WhatIfAnswer is what what-if answers.
type WhatIfAnswer = map[string]any
// ChecksInput is what checks takes.
type ChecksInput struct {
// a commit's sha, or the start of one, instead of a pull request
Commit string `json:"commit,omitempty"`
// a pull request's number: its head is read
Number string `json:"number,omitempty"`
// owner/repository
Repository string `json:"repository"`
}
// ChecksAnswer is what checks answers.
type ChecksAnswer = map[string]any
// TableInput is what table takes.
type TableInput struct {
}
// TableAnswer is what table answers.
type TableAnswer = map[string]any
// StalledInput is what stalled takes.
type StalledInput struct {
}
// StalledAnswer is what stalled answers.
type StalledAnswer = map[string]any
// RecheckInput is what recheck takes.
type RecheckInput struct {
// the delivery's id
ID string `json:"id"`
// why, kept with the transition
Why string `json:"why"`
}
// RecheckAnswer is what recheck answers.
type RecheckAnswer = map[string]any
// ReleaseInput is what release takes.
type ReleaseInput struct {
}
// ReleaseAnswer is what release answers.
type ReleaseAnswer = map[string]any
// StopInput is what stop takes.
type StopInput struct {
}
// StopAnswer is what stop answers.
type StopAnswer = map[string]any
// CloseInput is what close takes.
type CloseInput struct {
// the delivery's id
ID string `json:"id"`
// the condition it answers
Why string `json:"why"`
}
// CloseAnswer is what close answers.
type CloseAnswer = map[string]any
// RetireHistoryInput is what retire-history takes.
type RetireHistoryInput struct {
}
// RetireHistoryAnswer is what retire-history answers.
type RetireHistoryAnswer = map[string]any
// SettleInput is what settle takes.
type SettleInput struct {
// the held deliveries' ids (owner/repository@commit)
Ids []string `json:"ids"`
// why they may be settled, shown to the operator
Why string `json:"why"`
}
// SettleAnswer is what settle answers.
type SettleAnswer = map[string]any
// SourceByMainValue is one value of the state source under the key main.
type SourceByMainValue struct {
// the group that moved it
Group string `json:"group"`
// repository to the merged head, a full commit
Heads map[string]string `json:"heads"`
// the layout version
V int64 `json:"v,omitempty"`
}
// MergesByGroupValuePullsItem is a type of the contract.
type MergesByGroupValuePullsItem struct {
Commit string `json:"commit,omitempty"`
Head string `json:"head"`
Number int64 `json:"number"`
Repository string `json:"repository"`
// merging, merged or refused
State string `json:"state"`
Words string `json:"words,omitempty"`
}
// MergesByGroupValue is one value of the state merges under the key <group>.
type MergesByGroupValue struct {
// <repository>@<number> to the approved head
Approved map[string]string `json:"approved,omitempty"`
// the ask key
Ask string `json:"ask"`
Group string `json:"group"`
Pulls []MergesByGroupValuePullsItem `json:"pulls"`
// the layout version
V int64 `json:"v,omitempty"`
}
// AsksByMergeGroupHeadsValueHeadsItem is a type of the contract.
type AsksByMergeGroupHeadsValueHeadsItem struct {
// the full commit
Head string `json:"head"`
Number int64 `json:"number"`
// <owner>/<name>
Repository string `json:"repository"`
}
// AsksByMergeGroupHeadsValue is one value of the state asks under the key merge.<group>.<heads>.
type AsksByMergeGroupHeadsValue struct {
// the operator-channel ask as raised
Ask any `json:"ask"`
// the number of times it was asked
Asking int64 `json:"asking,omitempty"`
Group string `json:"group"`
Heads []AsksByMergeGroupHeadsValueHeadsItem `json:"heads"`
// the layout version
V int64 `json:"v,omitempty"`
}
// OwedByRepositoryNumberHeadActValue is one value of the state owed under the key <repository>.<number>.<head>.<act>.
type OwedByRepositoryNumberHeadActValue struct {
// status=<context>, view, note or comment.<seq>
Act string `json:"act"`
Context string `json:"context,omitempty"`
Ref string `json:"ref,omitempty"`
State string `json:"state,omitempty"`
Target string `json:"target,omitempty"`
Text string `json:"text,omitempty"`
// the layout version
V int64 `json:"v,omitempty"`
}
// TurnsByRepositoryValueWaitingItem is a type of the contract.
type TurnsByRepositoryValueWaitingItem struct {
// when (RFC 3339 time)
Approved string `json:"approved"`
Ask string `json:"ask,omitempty"`
Group string `json:"group"`
Heads string `json:"heads"`
// when (RFC 3339 time)
Since string `json:"since"`
Step string `json:"step,omitempty"`
WaitsFor string `json:"waits-for,omitempty"`
// when (RFC 3339 time)
WaitsSince string `json:"waits-since,omitempty"`
}
// TurnsByRepositoryValue is one value of the state turns under the key <repository>.
type TurnsByRepositoryValue struct {
Repository string `json:"repository"`
// the layout version
V int64 `json:"v,omitempty"`
Waiting []TurnsByRepositoryValueWaitingItem `json:"waiting"`
}
+3
View File
@@ -0,0 +1,3 @@
module git.novox.be/novox/mesh-delivery/contracts/go/seats/meshdelivery
go 1.26.0
@@ -0,0 +1,438 @@
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// Package meshdeliverychecker is the contract of the seat "mesh-delivery-checker", defined whole (seats/mesh-delivery-checker/seat.json): The merge check's tries: start one, read one, end one. The checker's own events stay under its own subjects (ADR 0620 §2).
package meshdeliverychecker
import (
"bytes"
"encoding/json"
"errors"
"strings"
)
// Seat is the seat's name.
const Seat = "mesh-delivery-checker"
const (
VerbTry = "try"
VerbTryRead = "try-read"
VerbTryEnd = "try-end"
)
// Verbs is every verb the seat serves, in its definition's order: a new copy each call.
func Verbs() []string {
return []string{VerbTry, VerbTryRead, VerbTryEnd}
}
// The holder's own events, listed beside the seat and published under the holder's subjects (ADR 0620 §2).
const (
HolderEventVerdict = "verdict"
HolderEventTagWanted = "tag-wanted"
HolderEventPreviewWritten = "preview.written"
)
// HolderSubjectVerdict is where the holder publishes verdict, kept in checker.asks.
func HolderSubjectVerdict(holder string) string { return "mesh.stream." + holder + ".event.verdict" }
// HolderSubjectTagWanted is where the holder publishes tag-wanted, kept in checker.asks.
func HolderSubjectTagWanted(holder string) string {
return "mesh.stream." + holder + ".event.tag-wanted"
}
// HolderSubjectPreviewWritten is where the holder publishes preview.written, kept in checks.
func HolderSubjectPreviewWritten(holder string) string {
return "mesh.stream." + holder + ".event.preview.written"
}
const (
StateVerdicts = "verdicts"
StateKept = "kept"
StateOwed = "owed"
StatePreviews = "previews"
)
// VerdictsByGroupHeadsKey is the key of one value of the state verdicts under the form "<group>.<heads>".
func VerdictsByGroupHeadsKey(group, heads string) string { return group + "." + heads }
// ParseVerdictsByGroupHeadsKey reads the parts of a key of the form "<group>.<heads>", in the order of the form; the last result is false for a key of another form.
func ParseVerdictsByGroupHeadsKey(key string) (string, string, bool) {
rest := key
v0, after0, found0 := strings.Cut(rest, ".")
if !found0 || v0 == "" {
return "", "", false
}
rest = after0
if rest == "" {
return "", "", false
}
v2 := rest
rest = ""
if rest != "" {
return "", "", false
}
return v0, v2, true
}
// DecodeVerdictsByGroupHeadsValue reads one value of the state verdicts under the form "<group>.<heads>", refusing a field VerdictsByGroupHeadsValue does not know and any text after the value.
func DecodeVerdictsByGroupHeadsValue(raw []byte) (VerdictsByGroupHeadsValue, error) {
var v VerdictsByGroupHeadsValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// KeptByLevelDigestKey is the key of one value of the state kept under the form "<level>.<digest>".
func KeptByLevelDigestKey(level, digest string) string { return level + "." + digest }
// ParseKeptByLevelDigestKey reads the parts of a key of the form "<level>.<digest>", in the order of the form; the last result is false for a key of another form.
func ParseKeptByLevelDigestKey(key string) (string, string, bool) {
rest := key
v0, after0, found0 := strings.Cut(rest, ".")
if !found0 || v0 == "" {
return "", "", false
}
rest = after0
if rest == "" {
return "", "", false
}
v2 := rest
rest = ""
if rest != "" {
return "", "", false
}
return v0, v2, true
}
// DecodeKeptByLevelDigestValue reads one value of the state kept under the form "<level>.<digest>", refusing a field KeptByLevelDigestValue does not know and any text after the value.
func DecodeKeptByLevelDigestValue(raw []byte) (KeptByLevelDigestValue, error) {
var v KeptByLevelDigestValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// OwedByRepositoryNumberHeadActKey is the key of one value of the state owed under the form "<repository>.<number>.<head>.<act>".
func OwedByRepositoryNumberHeadActKey(repository, number, head, act string) string {
return repository + "." + number + "." + head + "." + act
}
// ParseOwedByRepositoryNumberHeadActKey reads the parts of a key of the form "<repository>.<number>.<head>.<act>", in the order of the form; the last result is false for a key of another form.
func ParseOwedByRepositoryNumberHeadActKey(key string) (string, string, string, string, bool) {
rest := key
v0, after0, found0 := strings.Cut(rest, ".")
if !found0 || v0 == "" {
return "", "", "", "", false
}
rest = after0
v2, after2, found2 := strings.Cut(rest, ".")
if !found2 || v2 == "" {
return "", "", "", "", false
}
rest = after2
v4, after4, found4 := strings.Cut(rest, ".")
if !found4 || v4 == "" {
return "", "", "", "", false
}
rest = after4
if rest == "" {
return "", "", "", "", false
}
v6 := rest
rest = ""
if rest != "" {
return "", "", "", "", false
}
return v0, v2, v4, v6, true
}
// DecodeOwedByRepositoryNumberHeadActValue reads one value of the state owed under the form "<repository>.<number>.<head>.<act>", refusing a field OwedByRepositoryNumberHeadActValue does not know and any text after the value.
func DecodeOwedByRepositoryNumberHeadActValue(raw []byte) (OwedByRepositoryNumberHeadActValue, error) {
var v OwedByRepositoryNumberHeadActValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// PreviewsByRepositoryHeadTrunkKey is the key of one value of the state previews under the form "<repository>.<head>.<trunk>".
func PreviewsByRepositoryHeadTrunkKey(repository, head, trunk string) string {
return repository + "." + head + "." + trunk
}
// ParsePreviewsByRepositoryHeadTrunkKey reads the parts of a key of the form "<repository>.<head>.<trunk>", in the order of the form; the last result is false for a key of another form.
func ParsePreviewsByRepositoryHeadTrunkKey(key string) (string, string, string, bool) {
rest := key
v0, after0, found0 := strings.Cut(rest, ".")
if !found0 || v0 == "" {
return "", "", "", false
}
rest = after0
v2, after2, found2 := strings.Cut(rest, ".")
if !found2 || v2 == "" {
return "", "", "", false
}
rest = after2
if rest == "" {
return "", "", "", false
}
v4 := rest
rest = ""
if rest != "" {
return "", "", "", false
}
return v0, v2, v4, true
}
// DecodePreviewsByRepositoryHeadTrunkValue reads one value of the state previews under the form "<repository>.<head>.<trunk>", refusing a field PreviewsByRepositoryHeadTrunkValue does not know and any text after the value.
func DecodePreviewsByRepositoryHeadTrunkValue(raw []byte) (PreviewsByRepositoryHeadTrunkValue, error) {
var v PreviewsByRepositoryHeadTrunkValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// TryInput is what try takes.
type TryInput struct {
// the full commit to try, 40 or 64 hex digits
Head string `json:"head"`
// unit or integration: only this level; both when absent
Level string `json:"level,omitempty"`
// <owner>/<name>
Repository string `json:"repository"`
// a go test -run pattern: only those tests run, and nothing is kept
Tests string `json:"tests,omitempty"`
// the trunk commit to merge it onto, or the trunk's branch for its head now; the trunk's head when absent
Trunk string `json:"trunk,omitempty"`
}
// TryAnswer is what try answers.
type TryAnswer struct {
// the try's id
ID string `json:"id"`
// its state
State string `json:"state,omitempty"`
}
// TryReadInput is what try-read takes.
type TryReadInput struct {
// the try's id, try-<digits>
ID string `json:"id"`
}
// TryReadAnswer is what try-read answers.
type TryReadAnswer = map[string]any
// TryEndInput is what try-end takes.
type TryEndInput struct {
// the try's id, try-<digits>
ID string `json:"id"`
// why it is ended, in words
Why string `json:"why"`
}
// TryEndAnswer is what try-end answers.
type TryEndAnswer struct {
// it is ended
Ended bool `json:"ended"`
// the try
ID string `json:"id"`
}
// VerdictHolderEventSeriesItem is a type of the contract.
type VerdictHolderEventSeriesItem struct {
// its artifact, or the package's ecosystem name as the module's packages name it
Artifact string `json:"artifact"`
// the series on trunk
From string `json:"from"`
// the module whose artifact's series changes
Module string `json:"module"`
// the series the checked head gives it
To string `json:"to"`
}
// VerdictHolderEvent is the body of the holder's event verdict.
type VerdictHolderEvent struct {
// the commit checked
Head string `json:"head"`
// the generated files out of step with their seat definitions, each path (design 26)
OutOfStep []string `json:"out-of-step,omitempty"`
// the pull request's number, for a pull request's check
Pull int64 `json:"pull,omitempty"`
// owner/repo
Repository string `json:"repository"`
// each change of an artifact's series the checked head makes against trunk's manifests, once each (design 32); absent when it changes none
Series []VerdictHolderEventSeriesItem `json:"series,omitempty"`
// pass or fail
Verdict string `json:"verdict"`
}
// TagWantedHolderEvent is the body of the holder's event tag-wanted.
type TagWantedHolderEvent struct {
// the pull request's branch: its tag is removed when the branch ends
Branch string `json:"branch"`
// its head
Head string `json:"head"`
// the group member
Module string `json:"module"`
// the package it declares
Package string `json:"package"`
// the pull request
Pull int64 `json:"pull,omitempty"`
// owner/repo
Repository string `json:"repository"`
// the tag wanted
Tag string `json:"tag,omitempty"`
}
// VerdictsByGroupHeadsValueComposition is a type of the contract.
type VerdictsByGroupHeadsValueComposition struct {
Fpset string `json:"fpset,omitempty"`
Machines []string `json:"machines,omitempty"`
Sdk string `json:"sdk,omitempty"`
// not-run, pass or fail
State string `json:"state"`
Words string `json:"words,omitempty"`
}
// VerdictsByGroupHeadsValueFailed is a type of the contract.
type VerdictsByGroupHeadsValueFailed struct {
Machine string `json:"machine,omitempty"`
Test string `json:"test,omitempty"`
Words string `json:"words,omitempty"`
}
// VerdictsByGroupHeadsValueFailuresItem is a type of the contract.
type VerdictsByGroupHeadsValueFailuresItem struct {
Machine string `json:"machine,omitempty"`
Test string `json:"test,omitempty"`
Words string `json:"words,omitempty"`
}
// VerdictsByGroupHeadsValueLevelsValue is a type of the contract.
type VerdictsByGroupHeadsValueLevelsValue struct {
Kept int64 `json:"kept"`
Run int64 `json:"run"`
Skipped int64 `json:"skipped,omitempty"`
}
// VerdictsByGroupHeadsValueSeriesItem is a type of the contract.
type VerdictsByGroupHeadsValueSeriesItem struct {
Artifact string `json:"artifact"`
From string `json:"from"`
Module string `json:"module"`
To string `json:"to"`
}
// VerdictsByGroupHeadsValueTook is milliseconds.
type VerdictsByGroupHeadsValueTook struct {
Clone int64 `json:"clone,omitempty"`
Composition int64 `json:"composition,omitempty"`
IntegrationRun int64 `json:"integration-run,omitempty"`
IntegrationSetup int64 `json:"integration-setup,omitempty"`
Lint int64 `json:"lint,omitempty"`
Queue int64 `json:"queue,omitempty"`
Unit int64 `json:"unit,omitempty"`
}
// VerdictsByGroupHeadsValue is one value of the state verdicts under the key <group>.<heads>.
type VerdictsByGroupHeadsValue struct {
Beside map[string]string `json:"beside,omitempty"`
CarriedFrom map[string]string `json:"carried-from,omitempty"`
Composition *VerdictsByGroupHeadsValueComposition `json:"composition,omitempty"`
Failed *VerdictsByGroupHeadsValueFailed `json:"failed,omitempty"`
Failures []VerdictsByGroupHeadsValueFailuresItem `json:"failures,omitempty"`
Group string `json:"group"`
// 12 hex digits
Heads string `json:"heads"`
// by level, unit or integration
Levels map[string]VerdictsByGroupHeadsValueLevelsValue `json:"levels,omitempty"`
Machines []string `json:"machines,omitempty"`
OverBound []string `json:"over-bound,omitempty"`
Sdk string `json:"sdk,omitempty"`
Series []VerdictsByGroupHeadsValueSeriesItem `json:"series,omitempty"`
// running, pass or fail
State string `json:"state"`
// milliseconds
Took *VerdictsByGroupHeadsValueTook `json:"took,omitempty"`
// repository to the trunk head merged onto
Trunk map[string]string `json:"trunk,omitempty"`
// the layout version
V int64 `json:"v,omitempty"`
}
// KeptByLevelDigestValue is one value of the state kept under the key <level>.<digest>.
type KeptByLevelDigestValue struct {
// when (RFC 3339 time)
At string `json:"at,omitempty"`
Level string `json:"level"`
Package string `json:"package"`
Repository string `json:"repository"`
// pass: a failure is never kept
State string `json:"state"`
Tests int64 `json:"tests,omitempty"`
Took int64 `json:"took,omitempty"`
Toolchain string `json:"toolchain,omitempty"`
// the layout version
V int64 `json:"v,omitempty"`
}
// OwedByRepositoryNumberHeadActValue is one value of the state owed under the key <repository>.<number>.<head>.<act>.
type OwedByRepositoryNumberHeadActValue struct {
// status=<context>, view, note or comment.<seq>
Act string `json:"act"`
Context string `json:"context,omitempty"`
Ref string `json:"ref,omitempty"`
State string `json:"state,omitempty"`
Target string `json:"target,omitempty"`
Text string `json:"text,omitempty"`
// the layout version
V int64 `json:"v,omitempty"`
}
// PreviewsByRepositoryHeadTrunkValueModulesValue is a type of the contract.
type PreviewsByRepositoryHeadTrunkValueModulesValue struct {
Locks map[string]string `json:"locks,omitempty"`
// manifest digest
Manifest string `json:"manifest"`
Packages []string `json:"packages,omitempty"`
Paths map[string]string `json:"paths,omitempty"`
Tree string `json:"tree"`
}
// PreviewsByRepositoryHeadTrunkValue is one value of the state previews under the key <repository>.<head>.<trunk>.
type PreviewsByRepositoryHeadTrunkValue struct {
// files in conflict
Conflicts []string `json:"conflicts,omitempty"`
Head string `json:"head"`
// the merge commit
Merge string `json:"merge,omitempty"`
// by directory
Modules map[string]PreviewsByRepositoryHeadTrunkValueModulesValue `json:"modules,omitempty"`
Repository string `json:"repository"`
Trunk string `json:"trunk"`
// the layout version
V int64 `json:"v,omitempty"`
}
@@ -0,0 +1,3 @@
module git.novox.be/novox/mesh-delivery/contracts/go/seats/meshdeliverychecker
go 1.26.0
+60
View File
@@ -23,6 +23,36 @@
"series": "0.1",
"generated-from": "."
},
{
"name": "go-meshcatalog",
"kind": "package",
"language": "go",
"paths": [
"go/seats/meshcatalog"
],
"series": "0.1",
"generated-from": "."
},
{
"name": "go-meshdelivery",
"kind": "package",
"language": "go",
"paths": [
"go/seats/meshdelivery"
],
"series": "0.1",
"generated-from": "."
},
{
"name": "go-meshdeliverychecker",
"kind": "package",
"language": "go",
"paths": [
"go/seats/meshdeliverychecker"
],
"series": "0.1",
"generated-from": "."
},
{
"name": "go-npmpackageregistry",
"kind": "package",
@@ -99,6 +129,36 @@
"series": "0.1",
"generated-from": "."
},
{
"name": "ts-meshcatalog",
"kind": "package",
"language": "typescript",
"paths": [
"ts/seats/meshcatalog"
],
"series": "0.1",
"generated-from": "."
},
{
"name": "ts-meshdelivery",
"kind": "package",
"language": "typescript",
"paths": [
"ts/seats/meshdelivery"
],
"series": "0.1",
"generated-from": "."
},
{
"name": "ts-meshdeliverychecker",
"kind": "package",
"language": "typescript",
"paths": [
"ts/seats/meshdeliverychecker"
],
"series": "0.1",
"generated-from": "."
},
{
"name": "ts-npmpackageregistry",
"kind": "package",
+858
View File
@@ -0,0 +1,858 @@
{
"format": 1,
"seat": "mesh-catalog",
"scope": "mesh",
"grain": "whole",
"decision": "novox/hq ADR 0604",
"verbs": [
{
"name": "modules",
"description": "Every module the trunk holds, each with its repository, its directory there, the merge commit it was last changed at and its fingerprint (or why it has none): the catalog of the mesh, read from its holder's state. Reads only.",
"optional": true,
"input": {
"properties": {},
"type": "object"
},
"answer": {
"type": "object",
"description": "what modules answers, as its description says"
}
},
{
"name": "module",
"description": "One module whole: its repository, directory, commit and fingerprint, and its manifest as the trunk holds it. Older versions are in its repository's history. Reads only.",
"optional": true,
"input": {
"properties": {
"module": {
"description": "the module's name",
"type": "string"
}
},
"required": [
"module"
],
"type": "object"
},
"answer": {
"type": "object",
"description": "what module answers, as its description says"
}
},
{
"name": "provides",
"description": "Which modules provide a provision (a module provides its own name too) and which require it, from the module graph's provision edges. Reads only.",
"optional": true,
"input": {
"properties": {
"provision": {
"description": "the provision, such as postgres-database",
"type": "string"
}
},
"required": [
"provision"
],
"type": "object"
},
"answer": {
"type": "object",
"description": "what provides answers, as its description says"
}
},
{
"name": "dependents",
"description": "The modules whose build edges reach a module, directly or through others (a base, a mesh package it publishes, the build module that builds them): what a change of it builds again, from the module graph. Reads only.",
"optional": true,
"input": {
"properties": {
"module": {
"description": "the module's name",
"type": "string"
}
},
"required": [
"module"
],
"type": "object"
},
"answer": {
"type": "object",
"description": "what dependents answers, as its description says"
}
}
],
"description": "The catalog of the mesh: every module the trunk holds with its manifest, fingerprint and verdict, the packages published, and the seat list (ADR 0636 §1, §4).",
"family": {
"name": "mesh-catalog.events",
"max-age-days": 7
},
"events": [
{
"name": "seat-definition-changed",
"body": {
"type": "object",
"properties": {
"seat": {
"type": "string"
},
"source": {
"type": "string",
"description": "trunk"
},
"digest": {
"type": "string"
}
},
"required": [
"seat",
"source",
"digest"
]
}
},
{
"name": "seat-definition-removed",
"body": {
"type": "object",
"properties": {
"seat": {
"type": "string"
}
},
"required": [
"seat"
]
}
}
],
"states": [
{
"name": "manifests",
"template": "state",
"key-forms": [
{
"key": "<digest>",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"module": {
"type": "string"
},
"manifest": {
"type": "string",
"description": "the manifest, UTF-8 JSON text"
}
},
"required": [
"module",
"manifest"
]
},
"description": "a manifest by its digest, written once"
}
],
"description": "every manifest the indexer judged",
"history": 1
},
{
"name": "modules",
"template": "state",
"key-forms": [
{
"key": "<module>",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"fp": {
"type": "string",
"description": "the old-form fingerprint"
},
"none": {
"type": "string"
},
"fp2": {
"type": "string",
"description": "src2: fingerprint"
},
"none2": {
"type": "string",
"description": "why it has none"
},
"manifest": {
"type": "string",
"description": "manifest digest"
},
"inputs2": {
"type": "object",
"properties": {
"tree": {
"type": "string"
},
"bases": {
"type": "array",
"items": {
"type": "string"
}
},
"builder": {
"type": "string"
},
"contexts": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"locks": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"paths": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"packages": {
"type": "array",
"items": {
"type": "string"
}
},
"imports": {
"type": "array",
"items": {
"type": "string"
}
},
"import-form": {
"type": "string"
}
},
"required": [
"tree"
]
},
"src": {
"type": "integer",
"description": "the source revision"
},
"fp-src": {
"type": "integer"
},
"repository": {
"type": "string"
},
"commit": {
"type": "string"
},
"path": {
"type": "string"
},
"toolchains": {
"type": "object",
"additionalProperties": {
"description": "toolchain used"
}
},
"paths": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"packages": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"verdict": {
"type": "string"
},
"problems": {
"type": "array",
"items": {
"type": "string"
}
},
"unknown": {
"type": "array",
"items": {
"type": "string"
}
},
"warnings": {
"type": "array",
"items": {
"type": "string"
}
},
"needs": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"repository",
"commit"
],
"description": "one module as the trunk holds it"
},
"description": "a module the trunk holds"
}
],
"description": "the module catalog",
"history": 20
},
{
"name": "candidates",
"template": "state",
"key-forms": [
{
"key": "<group>",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"group": {
"type": "string"
},
"base": {
"type": "integer",
"description": "the source revision it is read on"
},
"heads": {
"type": "string"
},
"pulls": {
"type": "array",
"items": {
"type": "object",
"properties": {
"repository": {
"type": "string"
},
"number": {
"type": "integer"
},
"head": {
"type": "string"
},
"modules": {
"type": "array",
"items": {
"type": "string"
}
},
"fps": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"fp2": {
"type": "string"
},
"none2": {
"type": "string"
},
"manifest": {
"type": "string"
},
"paths": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"packages": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"required": [
"repository",
"number",
"head",
"modules"
]
}
},
"fpset": {
"type": "string"
}
},
"required": [
"group",
"base",
"heads",
"pulls"
],
"description": "the modules a group of open pull requests would change"
},
"description": "a group's candidate"
}
],
"description": "the candidates of open groups",
"history": 10
},
{
"name": "verdicts",
"template": "state",
"key-forms": [
{
"key": "<digest>",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"module": {
"type": "string"
},
"state": {
"type": "string"
},
"problems": {
"type": "array",
"items": {
"type": "string"
}
},
"unknown": {
"type": "array",
"items": {
"type": "string"
}
},
"warnings": {
"type": "array",
"items": {
"type": "string"
}
},
"judge": {
"type": "string"
},
"at": {
"type": "string",
"description": "when (RFC 3339 time)"
}
},
"required": [
"module",
"state"
],
"description": "a manifest's verdict, by the judge named"
},
"description": "a manifest's verdict by its digest"
}
],
"description": "the manifest verdicts",
"history": 5
},
{
"name": "predefined",
"template": "state",
"key-forms": [
{
"key": "list",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"commit": {
"type": "string"
},
"at": {
"type": "string",
"description": "when (RFC 3339 time)"
},
"list": {
"description": "the foundation's predefined list as kept"
}
},
"required": [
"commit",
"list"
]
},
"description": "the one key"
}
],
"description": "the kept predefined list",
"history": 5
},
{
"name": "config-candidates",
"template": "state",
"key-forms": [
{
"key": "<pull>",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"pull": {
"type": "string"
},
"head": {
"type": "string"
},
"declares": {
"type": "object",
"additionalProperties": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"kind": {
"type": "string"
},
"default": {
"description": "the default"
},
"why": {
"type": "string"
},
"type": {
"type": "string"
},
"description": {
"type": "string"
},
"enum": {
"description": "the allowed values"
},
"minimum": {
"type": "number"
},
"maximum": {
"type": "number"
},
"pattern": {
"type": "string"
},
"trusted": {
"type": "boolean"
},
"predefined": {
"type": "string"
},
"required": {
"type": "boolean"
},
"runtime": {
"type": "boolean"
}
},
"required": [
"kind",
"default",
"why"
]
}
},
"description": "module to key to declaration"
},
"at": {
"type": "string",
"description": "when (RFC 3339 time)"
}
},
"required": [
"pull",
"head",
"declares"
]
},
"description": "the configuration a pull request declares"
}
],
"description": "the configuration declared by open pull requests",
"history": 5
},
{
"name": "packages",
"template": "state",
"key-forms": [
{
"key": "<module>",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"module": {
"type": "string",
"description": "the Go module path"
},
"repository": {
"type": "string"
},
"dir": {
"type": "string"
},
"commit": {
"type": "string"
},
"requires": {
"type": "string",
"description": "digest of go.mod and go.sum"
},
"packages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"package": {
"type": "string"
},
"digest": {
"type": "string"
}
},
"required": [
"package",
"digest"
]
}
},
"at": {
"type": "string",
"description": "when (RFC 3339 time)"
}
},
"required": [
"module",
"repository",
"commit",
"packages"
]
},
"description": "a mesh Go module as its latest trunk merge published it"
},
{
"key": "<package>.<series>",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"name": {
"type": "string"
},
"package": {
"type": "string"
},
"series": {
"type": "string"
},
"seat": {
"type": "string"
},
"go-module": {
"type": "string"
},
"newest": {
"type": "object",
"properties": {
"version": {
"type": "string"
},
"commit": {
"type": "string"
},
"digest": {
"type": "string"
},
"fingerprint": {
"type": "string"
},
"contents": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"module": {
"type": "string",
"description": "the Go module path"
},
"repository": {
"type": "string"
},
"dir": {
"type": "string"
},
"commit": {
"type": "string"
},
"requires": {
"type": "string",
"description": "digest of go.mod and go.sum"
},
"packages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"package": {
"type": "string"
},
"digest": {
"type": "string"
}
},
"required": [
"package",
"digest"
]
}
},
"at": {
"type": "string",
"description": "when (RFC 3339 time)"
}
},
"required": [
"module",
"repository",
"commit",
"packages"
]
}
},
"required": [
"version"
]
},
"numbered": {
"type": "object",
"properties": {
"version": {
"type": "string"
},
"commit": {
"type": "string"
},
"digest": {
"type": "string"
},
"fingerprint": {
"type": "string"
},
"contents": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"module": {
"type": "string",
"description": "the Go module path"
},
"repository": {
"type": "string"
},
"dir": {
"type": "string"
},
"commit": {
"type": "string"
},
"requires": {
"type": "string",
"description": "digest of go.mod and go.sum"
},
"packages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"package": {
"type": "string"
},
"digest": {
"type": "string"
}
},
"required": [
"package",
"digest"
]
}
},
"at": {
"type": "string",
"description": "when (RFC 3339 time)"
}
},
"required": [
"module",
"repository",
"commit",
"packages"
]
}
},
"required": [
"version"
]
},
"at": {
"type": "string",
"description": "when (RFC 3339 time)"
}
},
"required": [
"name",
"series"
]
},
"description": "a published package series, numbered and newest"
}
],
"description": "the published packages",
"history": 5
}
]
}
@@ -0,0 +1,635 @@
{
"format": 1,
"seat": "mesh-delivery-checker",
"scope": "mesh",
"grain": "whole",
"decision": "novox/hq ADR 0547",
"verbs": [
{
"name": "try",
"description": "Try a pushed head before its pull request is opened: the checker judges it as it judges a pull request's head, merged onto its trunk's head, its unit and integration levels through the build modules, and owes the forge nothing. Answers the try's id at once; try-read reads where it stands. A try of the same head that waits or runs is the answer to a second ask; at most 4 wait or run at once, mesh-wide.",
"optional": true,
"replaces": [
"sh merge-check.sh",
"docker run postgres"
],
"input": {
"properties": {
"head": {
"description": "the full commit to try, 40 or 64 hex digits",
"type": "string"
},
"level": {
"description": "unit or integration: only this level; both when absent",
"type": "string"
},
"repository": {
"description": "<owner>/<name>",
"type": "string"
},
"tests": {
"description": "a go test -run pattern: only those tests run, and nothing is kept",
"type": "string"
},
"trunk": {
"description": "the trunk commit to merge it onto, or the trunk's branch for its head now; the trunk's head when absent",
"type": "string"
}
},
"required": [
"repository",
"head"
],
"type": "object"
},
"answer": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "the try's id"
},
"state": {
"type": "string",
"description": "its state"
}
},
"required": [
"id"
]
}
},
{
"name": "try-read",
"description": "Where a try stands, as stored: queued, running, or its end (pass, fail, or error when it could not run), with what was said of it, the head and the trunk commit it was merged onto, the time it took and what failed first. Read-only.",
"optional": true,
"input": {
"properties": {
"id": {
"description": "the try's id, try-<digits>",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
},
"answer": {
"type": "object",
"description": "the try: its state, its steps and its verdict when it has one"
}
},
{
"name": "try-end",
"description": "End a try that waits or runs, as error, by hand: say why (kept in what it says). Its place among the tries is free at once and the next try of its head asks anew with a new id. A try that ended already is refused.",
"optional": true,
"input": {
"properties": {
"id": {
"description": "the try's id, try-<digits>",
"type": "string"
},
"why": {
"description": "why it is ended, in words",
"type": "string"
}
},
"required": [
"id",
"why"
],
"type": "object"
},
"answer": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "the try"
},
"ended": {
"type": "boolean",
"description": "it is ended"
}
},
"required": [
"id",
"ended"
]
}
}
],
"description": "The merge check's tries: start one, read one, end one. The checker's own events stay under its own subjects (ADR 0620 §2).",
"holder-events": [
{
"name": "verdict",
"subject": "mesh.stream.<holder>.event.verdict",
"family": "checker.asks",
"body": {
"type": "object",
"properties": {
"repository": {
"type": "string",
"description": "owner/repo"
},
"pull": {
"type": "integer",
"description": "the pull request's number, for a pull request's check"
},
"head": {
"type": "string",
"description": "the commit checked"
},
"verdict": {
"type": "string",
"description": "pass or fail"
},
"out-of-step": {
"type": "array",
"items": {
"type": "string"
},
"description": "the generated files out of step with their seat definitions, each path (design 26)"
},
"series": {
"type": "array",
"items": {
"type": "object",
"properties": {
"module": {
"type": "string",
"description": "the module whose artifact's series changes"
},
"artifact": {
"type": "string",
"description": "its artifact, or the package's ecosystem name as the module's packages name it"
},
"from": {
"type": "string",
"description": "the series on trunk"
},
"to": {
"type": "string",
"description": "the series the checked head gives it"
}
},
"required": [
"module",
"artifact",
"from",
"to"
]
},
"description": "each change of an artifact's series the checked head makes against trunk's manifests, once each (design 32); absent when it changes none"
}
},
"required": [
"repository",
"head",
"verdict"
]
}
},
{
"name": "tag-wanted",
"subject": "mesh.stream.<holder>.event.tag-wanted",
"family": "checker.asks",
"body": {
"type": "object",
"properties": {
"repository": {
"type": "string",
"description": "owner/repo"
},
"pull": {
"type": "integer",
"description": "the pull request"
},
"head": {
"type": "string",
"description": "its head"
},
"branch": {
"type": "string",
"description": "the pull request's branch: its tag is removed when the branch ends"
},
"module": {
"type": "string",
"description": "the group member"
},
"package": {
"type": "string",
"description": "the package it declares"
},
"tag": {
"type": "string",
"description": "the tag wanted"
}
},
"required": [
"repository",
"head",
"branch",
"module",
"package"
]
}
},
{
"name": "preview.written",
"subject": "mesh.stream.<holder>.event.preview.written",
"family": "checks"
}
],
"states": [
{
"name": "verdicts",
"template": "state",
"key-forms": [
{
"key": "<group>.<heads>",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"group": {
"type": "string"
},
"heads": {
"type": "string",
"description": "12 hex digits"
},
"trunk": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "repository to the trunk head merged onto"
},
"state": {
"type": "string",
"description": "running, pass or fail"
},
"failed": {
"type": "object",
"properties": {
"test": {
"type": "string"
},
"machine": {
"type": "string"
},
"words": {
"type": "string"
}
}
},
"failures": {
"type": "array",
"items": {
"type": "object",
"properties": {
"test": {
"type": "string"
},
"machine": {
"type": "string"
},
"words": {
"type": "string"
}
}
}
},
"levels": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"run": {
"type": "integer"
},
"kept": {
"type": "integer"
},
"skipped": {
"type": "integer"
}
},
"required": [
"run",
"kept"
]
},
"description": "by level, unit or integration"
},
"took": {
"type": "object",
"properties": {
"queue": {
"type": "integer"
},
"clone": {
"type": "integer"
},
"unit": {
"type": "integer"
},
"lint": {
"type": "integer"
},
"integration-setup": {
"type": "integer"
},
"integration-run": {
"type": "integer"
},
"composition": {
"type": "integer"
}
},
"description": "milliseconds"
},
"machines": {
"type": "array",
"items": {
"type": "string"
}
},
"sdk": {
"type": "string"
},
"composition": {
"type": "object",
"properties": {
"state": {
"type": "string",
"description": "not-run, pass or fail"
},
"words": {
"type": "string"
},
"sdk": {
"type": "string"
},
"machines": {
"type": "array",
"items": {
"type": "string"
}
},
"fpset": {
"type": "string"
}
},
"required": [
"state"
]
},
"over-bound": {
"type": "array",
"items": {
"type": "string"
}
},
"beside": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"carried-from": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"series": {
"type": "array",
"items": {
"type": "object",
"properties": {
"module": {
"type": "string"
},
"artifact": {
"type": "string"
},
"from": {
"type": "string"
},
"to": {
"type": "string"
}
},
"required": [
"module",
"artifact",
"from",
"to"
]
}
}
},
"required": [
"group",
"heads",
"state"
],
"description": "one check of a group at one set of heads"
},
"description": "one check of a group; the group is an escaped branch name, heads 12 hex digits"
}
],
"description": "the checker's verdict of each group at each set of heads",
"history": 5
},
{
"name": "kept",
"template": "state",
"key-forms": [
{
"key": "<level>.<digest>",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"state": {
"type": "string",
"description": "pass: a failure is never kept"
},
"repository": {
"type": "string"
},
"package": {
"type": "string"
},
"level": {
"type": "string"
},
"tests": {
"type": "integer"
},
"took": {
"type": "integer"
},
"toolchain": {
"type": "string"
},
"at": {
"type": "string",
"description": "when (RFC 3339 time)"
}
},
"required": [
"state",
"repository",
"package",
"level"
],
"description": "one passing level of one package, kept so the next check does not run it again"
},
"description": "a passing level of one package by its content digest"
}
],
"description": "the kept passing levels",
"history": 1
},
{
"name": "owed",
"template": "state",
"key-forms": [
{
"key": "<repository>.<number>.<head>.<act>",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"act": {
"type": "string",
"description": "status=<context>, view, note or comment.<seq>"
},
"context": {
"type": "string"
},
"target": {
"type": "string"
},
"state": {
"type": "string"
},
"text": {
"type": "string"
},
"ref": {
"type": "string"
}
},
"required": [
"act"
],
"description": "one act owed to the forge, written by its owner and done by the forge bridge"
},
"description": "the status mesh/check the checker owes the forge for a head (its act is status=mesh/check)"
}
],
"description": "the status the checker owes the forge",
"history": 5
},
{
"name": "previews",
"template": "state",
"key-forms": [
{
"key": "<repository>.<head>.<trunk>",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"repository": {
"type": "string"
},
"head": {
"type": "string"
},
"trunk": {
"type": "string"
},
"merge": {
"type": "string",
"description": "the merge commit"
},
"conflicts": {
"type": "array",
"items": {
"type": "string"
},
"description": "files in conflict"
},
"modules": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"tree": {
"type": "string"
},
"manifest": {
"type": "string",
"description": "manifest digest"
},
"locks": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"paths": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"packages": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"tree",
"manifest"
]
},
"description": "by directory"
}
},
"required": [
"repository",
"head",
"trunk"
],
"description": "the merge of a head onto a trunk commit, read before a pull request is checked"
},
"description": "the merge of a head onto a trunk commit"
}
],
"description": "the previews of a head merged onto a trunk",
"history": 5
}
]
}
+570
View File
@@ -0,0 +1,570 @@
{
"format": 1,
"seat": "mesh-delivery",
"scope": "mesh",
"grain": "whole",
"decision": "novox/hq ADR 0239",
"verbs": [
{
"name": "deliveries",
"description": "Every delivery not final, and those that ended in the last day, one line each: its id (owner/repository@commit), its state, its group, what it waits for and since when. Narrowed by state, repository or group.",
"input": {
"properties": {
"all": {
"description": "\"true\": the final ones of the last thirty days too",
"enum": [
"true",
"false"
],
"type": "string"
},
"group": {
"description": "a group's id (its branch name)",
"type": "string"
},
"repository": {
"description": "owner/repository",
"type": "string"
},
"state": {
"description": "one state, e.g. delivering or held",
"type": "string"
}
},
"type": "object"
},
"answer": {
"type": "object",
"description": "what deliveries answers, as its description says"
}
},
{
"name": "times",
"description": "Removed in R6 (ADR 0539): refused by name, naming its replacement: the delivery view (nox-delivery): each machine's want and have, and since when",
"optional": true,
"input": {
"properties": {},
"type": "object"
},
"answer": {
"type": "object",
"description": "what times answers, as its description says"
}
},
{
"name": "show",
"description": "One delivery or group whole: its delivery plan (what it builds, what each machine receives, what is not an ordinary send), every transition with when and why, the machine steps of its walk, its group and its order.",
"input": {
"properties": {
"id": {
"description": "a delivery's id, or a group's",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
},
"answer": {
"type": "object",
"description": "what show answers, as its description says"
}
},
{
"name": "groups",
"description": "Every delivery group: its members in order, why each pair is ordered (declared, built by, version skew, engine before controller, by name), its composed check and its state, derived from its members.",
"input": {
"properties": {
"all": {
"description": "\"true\": the groups that ended too",
"enum": [
"true",
"false"
],
"type": "string"
}
},
"type": "object"
},
"answer": {
"type": "object",
"description": "what groups answers, as its description says"
}
},
{
"name": "what-if",
"description": "Removed in R6 (ADR 0539): refused by name, naming its replacement: the merge check's composition, which composes every machine a change touches",
"optional": true,
"input": {
"properties": {},
"type": "object"
},
"answer": {
"type": "object",
"description": "what what-if answers, as its description says"
}
},
{
"name": "checks",
"description": "What the mesh's checks said of a pull request's head or of one commit: each of the commit's mesh statuses (mesh/check, the one a main requires from R4e, hq's mesh/repo-check, mesh/delivery, …) with its state, description and when it was set; the merge check's full verdict as the controller said it — each layer's summary, the machine that ran it, when, its build id and its report; and whether the branch's protection would let it merge, every required status being success.",
"optional": true,
"input": {
"properties": {
"commit": {
"description": "a commit's sha, or the start of one, instead of a pull request",
"type": "string"
},
"number": {
"description": "a pull request's number: its head is read",
"type": "string"
},
"repository": {
"description": "owner/repository",
"type": "string"
}
},
"required": [
"repository"
],
"type": "object"
},
"answer": {
"type": "object",
"description": "what checks answers, as its description says"
}
},
{
"name": "table",
"description": "The state table every delivery runs by: each transition with its guard, each state's bound and what healer H2 may do once it has passed; and the machine steps' table.",
"input": {
"properties": {},
"type": "object"
},
"answer": {
"type": "object",
"description": "what table answers, as its description says"
}
},
{
"name": "stalled",
"description": "Every delivery held past its state's bound, with the transition the table lets healer H2 take for it, or none.",
"input": {
"properties": {},
"type": "object"
},
"answer": {
"type": "object",
"description": "what stalled answers, as its description says"
}
},
{
"name": "recheck",
"description": "Check a rejected or ready delivery again: it goes back to proposed and the controller is asked for its check. With why.",
"input": {
"properties": {
"id": {
"description": "the delivery's id",
"type": "string"
},
"why": {
"description": "why, kept with the transition",
"type": "string"
}
},
"required": [
"id",
"why"
],
"type": "object"
},
"answer": {
"type": "object",
"description": "what recheck answers, as its description says"
}
},
{
"name": "release",
"description": "Removed in R6 (ADR 0539): refused by name, naming its replacement: the assigner's asks (hold, restore, backup, record), answered on the phone or in the delivery view",
"optional": true,
"input": {
"properties": {},
"type": "object"
},
"answer": {
"type": "object",
"description": "what release answers, as its description says"
}
},
{
"name": "stop",
"description": "Removed in R6 (ADR 0539): refused by name, naming its replacement: a bad fingerprint is held and its canary set back by the assigner (ADR 0429 §6, ADR 0539 clause 18)",
"optional": true,
"input": {
"properties": {},
"type": "object"
},
"answer": {
"type": "object",
"description": "what stop answers, as its description says"
}
},
{
"name": "close",
"description": "Healer H2's verb: take the one transition the table names for a delivery held past its bound. Refused for any other.",
"input": {
"properties": {
"id": {
"description": "the delivery's id",
"type": "string"
},
"why": {
"description": "the condition it answers",
"type": "string"
}
},
"required": [
"id",
"why"
],
"type": "object"
},
"answer": {
"type": "object",
"description": "what close answers, as its description says"
}
},
{
"name": "retire-history",
"description": "Removed in R6 (ADR 0539): refused by name, naming its replacement: nothing to retire: the gate keeps no delivery after its merge",
"optional": true,
"input": {
"properties": {},
"type": "object"
},
"answer": {
"type": "object",
"description": "what retire-history answers, as its description says"
}
},
{
"name": "settle",
"description": "Ask the operator to settle deliveries held because their merge reached the trunk without a passing check: one ask on the operator's channel for all of them, as an Approve is asked. The verb moves nothing; on the operator's answer each goes to merged, and whether it is on the machines is derived as for any merge (novox/hq ADR 0556). Refused for a delivery not held, or held for another reason, naming why.",
"optional": true,
"input": {
"additionalProperties": false,
"properties": {
"ids": {
"description": "the held deliveries' ids (owner/repository@commit)",
"items": {
"type": "string"
},
"minItems": 1,
"type": "array"
},
"why": {
"description": "why they may be settled, shown to the operator",
"type": "string"
}
},
"required": [
"ids",
"why"
],
"type": "object"
},
"answer": {
"type": "object",
"description": "what settle answers, as its description says"
}
}
],
"description": "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.",
"states": [
{
"name": "source",
"template": "state",
"key-forms": [
{
"key": "main",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"group": {
"type": "string",
"description": "the group that moved it"
},
"heads": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "repository to the merged head, a full commit"
}
},
"required": [
"group",
"heads"
],
"description": "every repository's merged head; its revision is the mesh's source revision"
},
"description": "the one key, written by the holder alone by compare-and-set"
}
],
"description": "the mesh's source revision",
"history": 64
},
{
"name": "merges",
"template": "state",
"key-forms": [
{
"key": "<group>",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"group": {
"type": "string"
},
"ask": {
"type": "string",
"description": "the ask key"
},
"approved": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "<repository>@<number> to the approved head"
},
"pulls": {
"type": "array",
"items": {
"type": "object",
"properties": {
"repository": {
"type": "string"
},
"number": {
"type": "integer"
},
"head": {
"type": "string"
},
"state": {
"type": "string",
"description": "merging, merged or refused"
},
"commit": {
"type": "string"
},
"words": {
"type": "string"
}
},
"required": [
"repository",
"number",
"head",
"state"
]
}
}
},
"required": [
"group",
"ask",
"pulls"
],
"description": "one group's merge and how far each pull request is"
},
"description": "a group's merge"
}
],
"description": "the merges",
"history": 10
},
{
"name": "asks",
"template": "state",
"key-forms": [
{
"key": "merge.<group>.<heads>",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"group": {
"type": "string"
},
"heads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"repository": {
"type": "string",
"description": "<owner>/<name>"
},
"number": {
"type": "integer"
},
"head": {
"type": "string",
"description": "the full commit"
}
},
"required": [
"repository",
"number",
"head"
]
}
},
"ask": {
"description": "the operator-channel ask as raised"
},
"asking": {
"type": "integer",
"description": "the number of times it was asked"
}
},
"required": [
"group",
"heads",
"ask"
]
},
"description": "the ask of the operator for one group at one set of heads"
}
],
"description": "the asks of the operator for a merge",
"history": 5
},
{
"name": "owed",
"template": "state",
"key-forms": [
{
"key": "<repository>.<number>.<head>.<act>",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"act": {
"type": "string",
"description": "status=<context>, view, note or comment.<seq>"
},
"context": {
"type": "string"
},
"target": {
"type": "string"
},
"state": {
"type": "string"
},
"text": {
"type": "string"
},
"ref": {
"type": "string"
}
},
"required": [
"act"
],
"description": "one act owed to the forge, written by its owner and done by the forge bridge"
},
"description": "one act owed to the forge"
}
],
"description": "the acts the gate owes the forge",
"history": 5
},
{
"name": "turns",
"template": "state",
"key-forms": [
{
"key": "<repository>",
"value": {
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "the layout version"
},
"repository": {
"type": "string"
},
"waiting": {
"type": "array",
"items": {
"type": "object",
"properties": {
"group": {
"type": "string"
},
"heads": {
"type": "string"
},
"ask": {
"type": "string"
},
"approved": {
"type": "string",
"description": "when (RFC 3339 time)"
},
"since": {
"type": "string",
"description": "when (RFC 3339 time)"
},
"waits-for": {
"type": "string"
},
"waits-since": {
"type": "string",
"description": "when (RFC 3339 time)"
},
"step": {
"type": "string"
}
},
"required": [
"group",
"heads",
"approved",
"since"
]
}
}
},
"required": [
"repository",
"waiting"
],
"description": "the merges of a repository in the order they wait for their turn"
},
"description": "the merges waiting on a repository"
}
],
"description": "which merge waits for which",
"history": 5
}
]
}
+12
View File
@@ -0,0 +1,12 @@
{
"lockfileVersion": 3,
"name": "@novox/mesh-delivery-contracts-mesh-catalog",
"packages": {
"": {
"name": "@novox/mesh-delivery-contracts-mesh-catalog",
"version": "0.1.0"
}
},
"requires": true,
"version": "0.1.0"
}
@@ -0,0 +1,13 @@
{
"description": "The contract of the seat mesh-catalog, generated from its definition.",
"exports": {
".": "./src/index.ts"
},
"files": [
"src"
],
"name": "@novox/mesh-delivery-contracts-mesh-catalog",
"type": "module",
"types": "./src/index.ts",
"version": "0.1.0"
}
+430
View File
@@ -0,0 +1,430 @@
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// The contract of the seat "mesh-catalog", defined whole (seats/mesh-catalog/seat.json): The catalog of the mesh: every module the trunk holds with its manifest, fingerprint and verdict, the packages published, and the seat list (ADR 0636 §1, §4).
export const seat = "mesh-catalog";
export const verbs = {
modules: "modules",
module: "module",
provides: "provides",
dependents: "dependents",
} as const;
export const events = {
seatDefinitionChanged: "seat-definition-changed",
seatDefinitionRemoved: "seat-definition-removed",
} as const;
export const family = { name: "mesh-catalog.events", maxAgeDays: 7 } as const;
export const seatDefinitionChangedSubject = "mesh.seat.mesh-catalog.event.seat-definition-changed";
export const seatDefinitionRemovedSubject = "mesh.seat.mesh-catalog.event.seat-definition-removed";
export const states = {
manifests: "manifests",
modules: "modules",
candidates: "candidates",
verdicts: "verdicts",
predefined: "predefined",
configCandidates: "config-candidates",
packages: "packages",
} as const;
/** The key of one value of the state manifests under the form "<digest>". */
export function manifestsByDigestKey(digest: string): string {
return digest;
}
/** The parts of a key of the form "<digest>", or undefined for a key of another form. */
export function parseManifestsByDigestKey(key: string): { digest: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const digest = rest;
rest = "";
if (rest !== "") return undefined;
return { digest };
}
/** The key of one value of the state modules under the form "<module>". */
export function modulesByModuleKey(module: string): string {
return module;
}
/** The parts of a key of the form "<module>", or undefined for a key of another form. */
export function parseModulesByModuleKey(key: string): { module: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const module = rest;
rest = "";
if (rest !== "") return undefined;
return { module };
}
/** The key of one value of the state candidates under the form "<group>". */
export function candidatesByGroupKey(group: string): string {
return group;
}
/** The parts of a key of the form "<group>", or undefined for a key of another form. */
export function parseCandidatesByGroupKey(key: string): { group: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const group = rest;
rest = "";
if (rest !== "") return undefined;
return { group };
}
/** The key of one value of the state verdicts under the form "<digest>". */
export function verdictsByDigestKey(digest: string): string {
return digest;
}
/** The parts of a key of the form "<digest>", or undefined for a key of another form. */
export function parseVerdictsByDigestKey(key: string): { digest: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const digest = rest;
rest = "";
if (rest !== "") return undefined;
return { digest };
}
/** The key of one value of the state predefined under the form "list". */
export function predefinedByListKey(): string {
return "list";
}
/** The parts of a key of the form "list", or undefined for a key of another form. */
export function parsePredefinedByListKey(key: string): { } | undefined {
let rest = key;
if (!rest.startsWith("list")) return undefined;
rest = rest.slice(4);
if (rest !== "") return undefined;
return { };
}
/** The key of one value of the state config-candidates under the form "<pull>". */
export function configCandidatesByPullKey(pull: string): string {
return pull;
}
/** The parts of a key of the form "<pull>", or undefined for a key of another form. */
export function parseConfigCandidatesByPullKey(key: string): { pull: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const pull = rest;
rest = "";
if (rest !== "") return undefined;
return { pull };
}
/** The key of one value of the state packages under the form "<module>". */
export function packagesByModuleKey(module: string): string {
return module;
}
/** The parts of a key of the form "<module>", or undefined for a key of another form. */
export function parsePackagesByModuleKey(key: string): { module: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const module = rest;
rest = "";
if (rest !== "") return undefined;
return { module };
}
/** The key of one value of the state packages under the form "<package>.<series>". */
export function packagesByPackageSeriesKey(packagePart: string, series: string): string {
return packagePart + "." + series;
}
/** The parts of a key of the form "<package>.<series>", or undefined for a key of another form. */
export function parsePackagesByPackageSeriesKey(key: string): { packagePart: string; series: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const packagePart = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const series = rest;
rest = "";
if (rest !== "") return undefined;
return { packagePart, series };
}
/** is what modules takes. */
export interface ModulesInput {
}
/** is what modules answers. */
export type ModulesAnswer = Record<string, unknown>;
/** is what module takes. */
export interface ModuleInput {
/** the module's name */
"module": string;
}
/** is what module answers. */
export type ModuleAnswer = Record<string, unknown>;
/** is what provides takes. */
export interface ProvidesInput {
/** the provision, such as postgres-database */
"provision": string;
}
/** is what provides answers. */
export type ProvidesAnswer = Record<string, unknown>;
/** is what dependents takes. */
export interface DependentsInput {
/** the module's name */
"module": string;
}
/** is what dependents answers. */
export type DependentsAnswer = Record<string, unknown>;
/** is the body of the event seat-definition-changed. */
export interface SeatDefinitionChangedEvent {
"digest": string;
"seat": string;
/** trunk */
"source": string;
}
/** is the body of the event seat-definition-removed. */
export interface SeatDefinitionRemovedEvent {
"seat": string;
}
/** is one value of the state manifests under the key <digest>. */
export interface ManifestsByDigestValue {
/** the manifest, UTF-8 JSON text */
"manifest": string;
"module": string;
/** the layout version */
"v"?: number;
}
export interface ModulesByModuleValueInputs2 {
"bases"?: string[];
"builder"?: string;
"contexts"?: Record<string, string>;
"import-form"?: string;
"imports"?: string[];
"locks"?: Record<string, string>;
"packages"?: string[];
"paths"?: Record<string, string>;
"tree": string;
}
/** is one value of the state modules under the key <module>. */
export interface ModulesByModuleValue {
"commit": string;
/** the old-form fingerprint */
"fp"?: string;
"fp-src"?: number;
/** src2: fingerprint */
"fp2"?: string;
"inputs2"?: ModulesByModuleValueInputs2;
/** manifest digest */
"manifest"?: string;
"needs"?: string[];
"none"?: string;
/** why it has none */
"none2"?: string;
"packages"?: Record<string, string>;
"path"?: string;
"paths"?: Record<string, string[]>;
"problems"?: string[];
"repository": string;
/** the source revision */
"src"?: number;
"toolchains"?: Record<string, unknown>;
"unknown"?: string[];
/** the layout version */
"v"?: number;
"verdict"?: string;
"warnings"?: string[];
}
export interface CandidatesByGroupValuePullsItemFpsValue {
"fp2"?: string;
"manifest"?: string;
"none2"?: string;
"packages"?: Record<string, string>;
"paths"?: Record<string, string>;
}
export interface CandidatesByGroupValuePullsItem {
"fps"?: Record<string, CandidatesByGroupValuePullsItemFpsValue>;
"head": string;
"modules": string[];
"number": number;
"repository": string;
}
/** is one value of the state candidates under the key <group>. */
export interface CandidatesByGroupValue {
/** the source revision it is read on */
"base": number;
"fpset"?: string;
"group": string;
"heads": string;
"pulls": CandidatesByGroupValuePullsItem[];
/** the layout version */
"v"?: number;
}
/** is one value of the state verdicts under the key <digest>. */
export interface VerdictsByDigestValue {
/** when (RFC 3339 time) */
"at"?: string;
"judge"?: string;
"module": string;
"problems"?: string[];
"state": string;
"unknown"?: string[];
/** the layout version */
"v"?: number;
"warnings"?: string[];
}
/** is one value of the state predefined under the key list. */
export interface PredefinedByListValue {
/** when (RFC 3339 time) */
"at"?: string;
"commit": string;
/** the foundation's predefined list as kept */
"list": unknown;
/** the layout version */
"v"?: number;
}
export interface ConfigCandidatesByPullValueDeclaresValueValue {
/** the default */
"default": unknown;
"description"?: string;
/** the allowed values */
"enum"?: unknown;
"kind": string;
"maximum"?: number;
"minimum"?: number;
"pattern"?: string;
"predefined"?: string;
"required"?: boolean;
"runtime"?: boolean;
"trusted"?: boolean;
"type"?: string;
"why": string;
}
/** is one value of the state config-candidates under the key <pull>. */
export interface ConfigCandidatesByPullValue {
/** when (RFC 3339 time) */
"at"?: string;
/** module to key to declaration */
"declares": Record<string, Record<string, ConfigCandidatesByPullValueDeclaresValueValue>>;
"head": string;
"pull": string;
/** the layout version */
"v"?: number;
}
export interface PackagesByModuleValuePackagesItem {
"digest": string;
"package": string;
}
/** is one value of the state packages under the key <module>. */
export interface PackagesByModuleValue {
/** when (RFC 3339 time) */
"at"?: string;
"commit": string;
"dir"?: string;
/** the Go module path */
"module": string;
"packages": PackagesByModuleValuePackagesItem[];
"repository": string;
/** digest of go.mod and go.sum */
"requires"?: string;
/** the layout version */
"v"?: number;
}
export interface PackagesByPackageSeriesValueNewestContentsPackagesItem {
"digest": string;
"package": string;
}
export interface PackagesByPackageSeriesValueNewestContents {
/** when (RFC 3339 time) */
"at"?: string;
"commit": string;
"dir"?: string;
/** the Go module path */
"module": string;
"packages": PackagesByPackageSeriesValueNewestContentsPackagesItem[];
"repository": string;
/** digest of go.mod and go.sum */
"requires"?: string;
/** the layout version */
"v"?: number;
}
export interface PackagesByPackageSeriesValueNewest {
"commit"?: string;
"contents"?: PackagesByPackageSeriesValueNewestContents;
"digest"?: string;
"fingerprint"?: string;
"version": string;
}
export interface PackagesByPackageSeriesValueNumberedContentsPackagesItem {
"digest": string;
"package": string;
}
export interface PackagesByPackageSeriesValueNumberedContents {
/** when (RFC 3339 time) */
"at"?: string;
"commit": string;
"dir"?: string;
/** the Go module path */
"module": string;
"packages": PackagesByPackageSeriesValueNumberedContentsPackagesItem[];
"repository": string;
/** digest of go.mod and go.sum */
"requires"?: string;
/** the layout version */
"v"?: number;
}
export interface PackagesByPackageSeriesValueNumbered {
"commit"?: string;
"contents"?: PackagesByPackageSeriesValueNumberedContents;
"digest"?: string;
"fingerprint"?: string;
"version": string;
}
/** is one value of the state packages under the key <package>.<series>. */
export interface PackagesByPackageSeriesValue {
/** when (RFC 3339 time) */
"at"?: string;
"go-module"?: string;
"name": string;
"newest"?: PackagesByPackageSeriesValueNewest;
"numbered"?: PackagesByPackageSeriesValueNumbered;
"package"?: string;
"seat"?: string;
"series": string;
/** the layout version */
"v"?: number;
}
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"noEmit": true,
"strict": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*.ts"]
}
+12
View File
@@ -0,0 +1,12 @@
{
"lockfileVersion": 3,
"name": "@novox/mesh-delivery-contracts-mesh-delivery",
"packages": {
"": {
"name": "@novox/mesh-delivery-contracts-mesh-delivery",
"version": "0.1.0"
}
},
"requires": true,
"version": "0.1.0"
}
@@ -0,0 +1,13 @@
{
"description": "The contract of the seat mesh-delivery, generated from its definition.",
"exports": {
".": "./src/index.ts"
},
"files": [
"src"
],
"name": "@novox/mesh-delivery-contracts-mesh-delivery",
"type": "module",
"types": "./src/index.ts",
"version": "0.1.0"
}
@@ -0,0 +1,338 @@
// 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 const seat = "mesh-delivery";
export const verbs = {
deliveries: "deliveries",
times: "times",
show: "show",
groups: "groups",
whatIf: "what-if",
checks: "checks",
table: "table",
stalled: "stalled",
recheck: "recheck",
release: "release",
stop: "stop",
close: "close",
retireHistory: "retire-history",
settle: "settle",
} as const;
export const states = {
source: "source",
merges: "merges",
asks: "asks",
owed: "owed",
turns: "turns",
} as const;
/** The key of one value of the state source under the form "main". */
export function sourceByMainKey(): string {
return "main";
}
/** The parts of a key of the form "main", or undefined for a key of another form. */
export function parseSourceByMainKey(key: string): { } | undefined {
let rest = key;
if (!rest.startsWith("main")) return undefined;
rest = rest.slice(4);
if (rest !== "") return undefined;
return { };
}
/** The key of one value of the state merges under the form "<group>". */
export function mergesByGroupKey(group: string): string {
return group;
}
/** The parts of a key of the form "<group>", or undefined for a key of another form. */
export function parseMergesByGroupKey(key: string): { group: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const group = rest;
rest = "";
if (rest !== "") return undefined;
return { group };
}
/** The key of one value of the state asks under the form "merge.<group>.<heads>". */
export function asksByMergeGroupHeadsKey(group: string, heads: string): string {
return "merge." + group + "." + heads;
}
/** The parts of a key of the form "merge.<group>.<heads>", or undefined for a key of another form. */
export function parseAsksByMergeGroupHeadsKey(key: string): { group: string; heads: string } | undefined {
let rest = key;
if (!rest.startsWith("merge.")) return undefined;
rest = rest.slice(6);
const at1 = rest.indexOf(".");
if (at1 <= 0) return undefined;
const group = rest.slice(0, at1);
rest = rest.slice(at1 + 1);
if (rest === "") return undefined;
const heads = rest;
rest = "";
if (rest !== "") return undefined;
return { group, heads };
}
/** The key of one value of the state owed under the form "<repository>.<number>.<head>.<act>". */
export function owedByRepositoryNumberHeadActKey(repository: string, number: string, head: string, act: string): string {
return repository + "." + number + "." + head + "." + act;
}
/** The parts of a key of the form "<repository>.<number>.<head>.<act>", or undefined for a key of another form. */
export function parseOwedByRepositoryNumberHeadActKey(key: string): { repository: string; number: string; head: string; act: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const repository = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
const at2 = rest.indexOf(".");
if (at2 <= 0) return undefined;
const number = rest.slice(0, at2);
rest = rest.slice(at2 + 1);
const at4 = rest.indexOf(".");
if (at4 <= 0) return undefined;
const head = rest.slice(0, at4);
rest = rest.slice(at4 + 1);
if (rest === "") return undefined;
const act = rest;
rest = "";
if (rest !== "") return undefined;
return { repository, number, head, act };
}
/** The key of one value of the state turns under the form "<repository>". */
export function turnsByRepositoryKey(repository: string): string {
return repository;
}
/** The parts of a key of the form "<repository>", or undefined for a key of another form. */
export function parseTurnsByRepositoryKey(key: string): { repository: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const repository = rest;
rest = "";
if (rest !== "") return undefined;
return { repository };
}
/** 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 times takes. */
export interface TimesInput {
}
/** is what times answers. */
export type TimesAnswer = 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";
}
/** is what groups answers. */
export type GroupsAnswer = Record<string, unknown>;
/** is what what-if takes. */
export interface WhatIfInput {
}
/** is what what-if answers. */
export type WhatIfAnswer = Record<string, unknown>;
/** is what checks takes. */
export interface ChecksInput {
/** a commit's sha, or the start of one, instead of a pull request */
"commit"?: string;
/** a pull request's number: its head is read */
"number"?: string;
/** owner/repository */
"repository": string;
}
/** is what checks answers. */
export type ChecksAnswer = Record<string, unknown>;
/** is what table takes. */
export interface TableInput {
}
/** is what table answers. */
export type TableAnswer = Record<string, unknown>;
/** is what stalled takes. */
export interface StalledInput {
}
/** is what stalled answers. */
export type StalledAnswer = Record<string, unknown>;
/** is what recheck takes. */
export interface RecheckInput {
/** the delivery's id */
"id": string;
/** why, kept with the transition */
"why": string;
}
/** is what recheck answers. */
export type RecheckAnswer = Record<string, unknown>;
/** is what release takes. */
export interface ReleaseInput {
}
/** is what release answers. */
export type ReleaseAnswer = Record<string, unknown>;
/** is what stop takes. */
export interface StopInput {
}
/** is what stop answers. */
export type StopAnswer = Record<string, unknown>;
/** is what close takes. */
export interface CloseInput {
/** the delivery's id */
"id": string;
/** the condition it answers */
"why": string;
}
/** is what close answers. */
export type CloseAnswer = Record<string, unknown>;
/** is what retire-history takes. */
export interface RetireHistoryInput {
}
/** is what retire-history answers. */
export type RetireHistoryAnswer = Record<string, unknown>;
/** is what settle takes. */
export interface SettleInput {
/** the held deliveries' ids (owner/repository@commit) */
"ids": string[];
/** why they may be settled, shown to the operator */
"why": string;
}
/** is what settle answers. */
export type SettleAnswer = Record<string, unknown>;
/** is one value of the state source under the key main. */
export interface SourceByMainValue {
/** 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[];
}
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"noEmit": true,
"strict": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*.ts"]
}
+12
View File
@@ -0,0 +1,12 @@
{
"lockfileVersion": 3,
"name": "@novox/mesh-delivery-contracts-mesh-delivery-checker",
"packages": {
"": {
"name": "@novox/mesh-delivery-contracts-mesh-delivery-checker",
"version": "0.1.0"
}
},
"requires": true,
"version": "0.1.0"
}
@@ -0,0 +1,13 @@
{
"description": "The contract of the seat mesh-delivery-checker, generated from its definition.",
"exports": {
".": "./src/index.ts"
},
"files": [
"src"
],
"name": "@novox/mesh-delivery-contracts-mesh-delivery-checker",
"type": "module",
"types": "./src/index.ts",
"version": "0.1.0"
}
@@ -0,0 +1,341 @@
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// The contract of the seat "mesh-delivery-checker", defined whole (seats/mesh-delivery-checker/seat.json): The merge check's tries: start one, read one, end one. The checker's own events stay under its own subjects (ADR 0620 §2).
export const seat = "mesh-delivery-checker";
export const verbs = {
try: "try",
tryRead: "try-read",
tryEnd: "try-end",
} as const;
export const holderEvents = {
verdict: "verdict",
tagWanted: "tag-wanted",
previewWritten: "preview.written",
} as const;
export function verdictHolderSubject(holder: string): string {
return "mesh.stream." + holder + ".event.verdict";
}
export function tagWantedHolderSubject(holder: string): string {
return "mesh.stream." + holder + ".event.tag-wanted";
}
export function previewWrittenHolderSubject(holder: string): string {
return "mesh.stream." + holder + ".event.preview.written";
}
export const states = {
verdicts: "verdicts",
kept: "kept",
owed: "owed",
previews: "previews",
} as const;
/** The key of one value of the state verdicts under the form "<group>.<heads>". */
export function verdictsByGroupHeadsKey(group: string, heads: string): string {
return group + "." + heads;
}
/** The parts of a key of the form "<group>.<heads>", or undefined for a key of another form. */
export function parseVerdictsByGroupHeadsKey(key: string): { group: string; heads: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const group = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const heads = rest;
rest = "";
if (rest !== "") return undefined;
return { group, heads };
}
/** The key of one value of the state kept under the form "<level>.<digest>". */
export function keptByLevelDigestKey(level: string, digest: string): string {
return level + "." + digest;
}
/** The parts of a key of the form "<level>.<digest>", or undefined for a key of another form. */
export function parseKeptByLevelDigestKey(key: string): { level: string; digest: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const level = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const digest = rest;
rest = "";
if (rest !== "") return undefined;
return { level, digest };
}
/** The key of one value of the state owed under the form "<repository>.<number>.<head>.<act>". */
export function owedByRepositoryNumberHeadActKey(repository: string, number: string, head: string, act: string): string {
return repository + "." + number + "." + head + "." + act;
}
/** The parts of a key of the form "<repository>.<number>.<head>.<act>", or undefined for a key of another form. */
export function parseOwedByRepositoryNumberHeadActKey(key: string): { repository: string; number: string; head: string; act: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const repository = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
const at2 = rest.indexOf(".");
if (at2 <= 0) return undefined;
const number = rest.slice(0, at2);
rest = rest.slice(at2 + 1);
const at4 = rest.indexOf(".");
if (at4 <= 0) return undefined;
const head = rest.slice(0, at4);
rest = rest.slice(at4 + 1);
if (rest === "") return undefined;
const act = rest;
rest = "";
if (rest !== "") return undefined;
return { repository, number, head, act };
}
/** The key of one value of the state previews under the form "<repository>.<head>.<trunk>". */
export function previewsByRepositoryHeadTrunkKey(repository: string, head: string, trunk: string): string {
return repository + "." + head + "." + trunk;
}
/** The parts of a key of the form "<repository>.<head>.<trunk>", or undefined for a key of another form. */
export function parsePreviewsByRepositoryHeadTrunkKey(key: string): { repository: string; head: string; trunk: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const repository = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
const at2 = rest.indexOf(".");
if (at2 <= 0) return undefined;
const head = rest.slice(0, at2);
rest = rest.slice(at2 + 1);
if (rest === "") return undefined;
const trunk = rest;
rest = "";
if (rest !== "") return undefined;
return { repository, head, trunk };
}
/** is what try takes. */
export interface TryInput {
/** the full commit to try, 40 or 64 hex digits */
"head": string;
/** unit or integration: only this level; both when absent */
"level"?: string;
/** <owner>/<name> */
"repository": string;
/** a go test -run pattern: only those tests run, and nothing is kept */
"tests"?: string;
/** the trunk commit to merge it onto, or the trunk's branch for its head now; the trunk's head when absent */
"trunk"?: string;
}
/** is what try answers. */
export interface TryAnswer {
/** the try's id */
"id": string;
/** its state */
"state"?: string;
}
/** is what try-read takes. */
export interface TryReadInput {
/** the try's id, try-<digits> */
"id": string;
}
/** is what try-read answers. */
export type TryReadAnswer = Record<string, unknown>;
/** is what try-end takes. */
export interface TryEndInput {
/** the try's id, try-<digits> */
"id": string;
/** why it is ended, in words */
"why": string;
}
/** is what try-end answers. */
export interface TryEndAnswer {
/** it is ended */
"ended": boolean;
/** the try */
"id": string;
}
export interface VerdictHolderEventSeriesItem {
/** its artifact, or the package's ecosystem name as the module's packages name it */
"artifact": string;
/** the series on trunk */
"from": string;
/** the module whose artifact's series changes */
"module": string;
/** the series the checked head gives it */
"to": string;
}
/** is the body of the holder's event verdict. */
export interface VerdictHolderEvent {
/** the commit checked */
"head": string;
/** the generated files out of step with their seat definitions, each path (design 26) */
"out-of-step"?: string[];
/** the pull request's number, for a pull request's check */
"pull"?: number;
/** owner/repo */
"repository": string;
/** each change of an artifact's series the checked head makes against trunk's manifests, once each (design 32); absent when it changes none */
"series"?: VerdictHolderEventSeriesItem[];
/** pass or fail */
"verdict": string;
}
/** is the body of the holder's event tag-wanted. */
export interface TagWantedHolderEvent {
/** the pull request's branch: its tag is removed when the branch ends */
"branch": string;
/** its head */
"head": string;
/** the group member */
"module": string;
/** the package it declares */
"package": string;
/** the pull request */
"pull"?: number;
/** owner/repo */
"repository": string;
/** the tag wanted */
"tag"?: string;
}
export interface VerdictsByGroupHeadsValueComposition {
"fpset"?: string;
"machines"?: string[];
"sdk"?: string;
/** not-run, pass or fail */
"state": string;
"words"?: string;
}
export interface VerdictsByGroupHeadsValueFailed {
"machine"?: string;
"test"?: string;
"words"?: string;
}
export interface VerdictsByGroupHeadsValueFailuresItem {
"machine"?: string;
"test"?: string;
"words"?: string;
}
export interface VerdictsByGroupHeadsValueLevelsValue {
"kept": number;
"run": number;
"skipped"?: number;
}
export interface VerdictsByGroupHeadsValueSeriesItem {
"artifact": string;
"from": string;
"module": string;
"to": string;
}
/** milliseconds */
export interface VerdictsByGroupHeadsValueTook {
"clone"?: number;
"composition"?: number;
"integration-run"?: number;
"integration-setup"?: number;
"lint"?: number;
"queue"?: number;
"unit"?: number;
}
/** is one value of the state verdicts under the key <group>.<heads>. */
export interface VerdictsByGroupHeadsValue {
"beside"?: Record<string, string>;
"carried-from"?: Record<string, string>;
"composition"?: VerdictsByGroupHeadsValueComposition;
"failed"?: VerdictsByGroupHeadsValueFailed;
"failures"?: VerdictsByGroupHeadsValueFailuresItem[];
"group": string;
/** 12 hex digits */
"heads": string;
/** by level, unit or integration */
"levels"?: Record<string, VerdictsByGroupHeadsValueLevelsValue>;
"machines"?: string[];
"over-bound"?: string[];
"sdk"?: string;
"series"?: VerdictsByGroupHeadsValueSeriesItem[];
/** running, pass or fail */
"state": string;
/** milliseconds */
"took"?: VerdictsByGroupHeadsValueTook;
/** repository to the trunk head merged onto */
"trunk"?: Record<string, string>;
/** the layout version */
"v"?: number;
}
/** is one value of the state kept under the key <level>.<digest>. */
export interface KeptByLevelDigestValue {
/** when (RFC 3339 time) */
"at"?: string;
"level": string;
"package": string;
"repository": string;
/** pass: a failure is never kept */
"state": string;
"tests"?: number;
"took"?: number;
"toolchain"?: string;
/** 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 PreviewsByRepositoryHeadTrunkValueModulesValue {
"locks"?: Record<string, string>;
/** manifest digest */
"manifest": string;
"packages"?: string[];
"paths"?: Record<string, string>;
"tree": string;
}
/** is one value of the state previews under the key <repository>.<head>.<trunk>. */
export interface PreviewsByRepositoryHeadTrunkValue {
/** files in conflict */
"conflicts"?: string[];
"head": string;
/** the merge commit */
"merge"?: string;
/** by directory */
"modules"?: Record<string, PreviewsByRepositoryHeadTrunkValueModulesValue>;
"repository": string;
"trunk": string;
/** the layout version */
"v"?: number;
}
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"noEmit": true,
"strict": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*.ts"]
}