From c7fb8d6689f63b1291c6f3c3c4bffec1edd22f32 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 4 Nov 2026 11:50:54 +0100 Subject: [PATCH] SD-M3: the Go and TypeScript generated from the definitions (design 26 *The generator*) go/seats the seat list every reader compiles and every seat's name; a package per whole seat with its names, subjects, types and a test of its fixtures; ts/ the same as a TypeScript package. Written by seatgen, never by hand. Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig --- go/go.mod | 3 + go/parts/registry/contract.go | 173 + go/seats/containerimageregistry/contract.go | 195 + .../containerimageregistry/contract_test.go | 66 + go/seats/gopackageregistry/contract.go | 87 + go/seats/gopackageregistry/contract_test.go | 62 + go/seats/meshbroker/contract.go | 280 + go/seats/meshbroker/contract_test.go | 70 + go/seats/meshconfig/contract.go | 120 + go/seats/meshconfig/contract_test.go | 56 + go/seats/meshdeliverychecker/contract.go | 108 + go/seats/meshdeliverychecker/contract_test.go | 52 + go/seats/meshvault/contract.go | 355 + go/seats/meshvault/contract_test.go | 70 + go/seats/npmpackageregistry/contract.go | 87 + go/seats/npmpackageregistry/contract_test.go | 62 + go/seats/ociartifactregistry/contract.go | 153 + go/seats/ociartifactregistry/contract_test.go | 66 + go/seats/operatorchannel/contract.go | 298 + go/seats/operatorchannel/contract_test.go | 60 + go/seats/seats.go | 746 ++ ts/package.json | 19 + ts/src/container-image-registry.ts | 155 + ts/src/go-package-registry.ts | 50 + ts/src/index.ts | 12 + ts/src/mesh-broker.ts | 261 + ts/src/mesh-config.ts | 119 + ts/src/mesh-delivery-checker.ts | 107 + ts/src/mesh-vault.ts | 345 + ts/src/npm-package-registry.ts | 50 + ts/src/oci-artifact-registry.ts | 114 + ts/src/operator-channel.ts | 282 + ts/src/parts/registry.ts | 173 + ts/src/seats.ts | 6889 +++++++++++++++++ ts/tsconfig.json | 14 + 35 files changed, 11759 insertions(+) create mode 100644 go/go.mod create mode 100644 go/parts/registry/contract.go create mode 100644 go/seats/containerimageregistry/contract.go create mode 100644 go/seats/containerimageregistry/contract_test.go create mode 100644 go/seats/gopackageregistry/contract.go create mode 100644 go/seats/gopackageregistry/contract_test.go create mode 100644 go/seats/meshbroker/contract.go create mode 100644 go/seats/meshbroker/contract_test.go create mode 100644 go/seats/meshconfig/contract.go create mode 100644 go/seats/meshconfig/contract_test.go create mode 100644 go/seats/meshdeliverychecker/contract.go create mode 100644 go/seats/meshdeliverychecker/contract_test.go create mode 100644 go/seats/meshvault/contract.go create mode 100644 go/seats/meshvault/contract_test.go create mode 100644 go/seats/npmpackageregistry/contract.go create mode 100644 go/seats/npmpackageregistry/contract_test.go create mode 100644 go/seats/ociartifactregistry/contract.go create mode 100644 go/seats/ociartifactregistry/contract_test.go create mode 100644 go/seats/operatorchannel/contract.go create mode 100644 go/seats/operatorchannel/contract_test.go create mode 100644 go/seats/seats.go create mode 100644 ts/package.json create mode 100644 ts/src/container-image-registry.ts create mode 100644 ts/src/go-package-registry.ts create mode 100644 ts/src/index.ts create mode 100644 ts/src/mesh-broker.ts create mode 100644 ts/src/mesh-config.ts create mode 100644 ts/src/mesh-delivery-checker.ts create mode 100644 ts/src/mesh-vault.ts create mode 100644 ts/src/npm-package-registry.ts create mode 100644 ts/src/oci-artifact-registry.ts create mode 100644 ts/src/operator-channel.ts create mode 100644 ts/src/parts/registry.ts create mode 100644 ts/src/seats.ts create mode 100644 ts/tsconfig.json diff --git a/go/go.mod b/go/go.mod new file mode 100644 index 0000000..efb2a0d --- /dev/null +++ b/go/go.mod @@ -0,0 +1,3 @@ +module git.novox.be/novox/mesh-contracts/go + +go 1.26.0 diff --git a/go/parts/registry/contract.go b/go/parts/registry/contract.go new file mode 100644 index 0000000..81d4e3b --- /dev/null +++ b/go/parts/registry/contract.go @@ -0,0 +1,173 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// Package registry is the part "registry" several seats include whole: The verbs and events every registry seat shares, written once so the four cannot drift (design 51, design 26). Who may call each verb is the holder's trusted config value listing its callers (ADR 0363's form), checked against the caller the tool runner proved. +package registry + +const ( + VerbPublish = "publish" + VerbPublishPart = "publish-part" + VerbVersions = "versions" + VerbRemove = "remove" +) + +const ( + EventPublished = "published" + EventRefused = "refused" + EventRemoved = "removed" +) + +// Artifact is one published thing, as every registry event and answer names it. +type Artifact struct { + // the source commit it was built from + Commit string `json:"commit,omitempty"` + // its digest, sha256: (a Go package's h1: hash beside it in the version's record) + Digest string `json:"digest"` + // the build's fingerprint + Fingerprint string `json:"fingerprint,omitempty"` + // what it is + Kind string `json:"kind"` + // the package's, image's, bundle's or archive's name + Name string `json:"name"` + // the tag it carries, for a tagged version + Tag string `json:"tag,omitempty"` + // the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone + Version string `json:"version,omitempty"` +} + +// Outcome is the body of published, refused and removed. +type Outcome struct { + // the source commit it was built from + Commit string `json:"commit,omitempty"` + // its digest, sha256: (a Go package's h1: hash beside it in the version's record) + Digest string `json:"digest"` + // the build's fingerprint + Fingerprint string `json:"fingerprint,omitempty"` + // the module holding the seat that said it + Holder string `json:"holder"` + // what it is + Kind string `json:"kind"` + // the package's, image's, bundle's or archive's name + Name string `json:"name"` + // why: a refusal's cause, or a removal's (retention, tag-gone, by-hand) + Reason string `json:"reason,omitempty"` + // the reference the seat answers: //@sha256:, or @ for a package (ADR 0605 §9) + Reference string `json:"reference,omitempty"` + // the tag it carries, for a tagged version + Tag string `json:"tag,omitempty"` + // the transfer it ends, when it ended one + Transfer string `json:"transfer,omitempty"` + // the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone + Version string `json:"version,omitempty"` +} + +// Part is one part of a transfer. +type Part struct { + // the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob + Digest string `json:"digest"` + // its size in bytes + Size int64 `json:"size"` +} + +// PublishInput is what publish takes. +type PublishInput struct { + // the source commit it was built from + Commit string `json:"commit,omitempty"` + // its digest, sha256: (a Go package's h1: hash beside it in the version's record) + Digest string `json:"digest"` + // the build's fingerprint + Fingerprint string `json:"fingerprint,omitempty"` + // what it is + Kind string `json:"kind"` + // the package's, image's, bundle's or archive's name + Name string `json:"name"` + // every part's digest and size; none when the digest is already held + Parts []Part `json:"parts,omitempty"` + // the tag it carries, for a tagged version + Tag string `json:"tag,omitempty"` + // the transfer's name, the caller's own; the same name opens the same transfer again + Transfer string `json:"transfer"` + // the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone + Version string `json:"version,omitempty"` +} + +// PublishAnswer is what publish answers. +type PublishAnswer struct { + // the digest is held already: nothing to send; the outcome follows as an event + Held bool `json:"held,omitempty"` + // the digests of the parts the holder lacks, to send by publish-part + Lacks []string `json:"lacks,omitempty"` + // the transfer + Transfer string `json:"transfer"` +} + +// PublishPartInput is what publish-part takes. +type PublishPartInput struct { + // the chunk's bytes, base64 (at most 768 KiB before encoding) + Data string `json:"data"` + // this chunk is the part's last + Last bool `json:"last"` + // the part's digest + Part string `json:"part"` + // the chunk's place in its part, from 0 + Sequence int64 `json:"sequence"` + // the transfer + Transfer string `json:"transfer"` +} + +// PublishPartAnswer is what publish-part answers. +type PublishPartAnswer struct { + // the part is whole and its bytes match its digest + Complete bool `json:"complete,omitempty"` + // the part + Part string `json:"part"` + // the chunks of the part held so far + Received int64 `json:"received,omitempty"` + // the transfer + Transfer string `json:"transfer"` +} + +// VersionsInput is what versions takes. +type VersionsInput struct { + // narrowed to one kind (optional) + Kind string `json:"kind,omitempty"` + // the name + Name string `json:"name"` +} + +// VersionsAnswer is what versions answers. +type VersionsAnswer struct { + // the name + Name string `json:"name"` + // newest first + Versions []Artifact `json:"versions"` +} + +// RemoveInput is what remove takes. +type RemoveInput struct { + // the digest (for a bundle, archive or copied base) + Digest string `json:"digest,omitempty"` + // the name + Name string `json:"name"` + // why it goes + Reason string `json:"reason"` + // the tag (for a tagged version) + Tag string `json:"tag,omitempty"` + // the version + Version string `json:"version,omitempty"` +} + +// RemoveAnswer is what remove answers. +type RemoveAnswer struct { + Artifact *Artifact `json:"artifact,omitempty"` + // it is gone + Removed bool `json:"removed"` +} + +// PublishedEvent is the body of the event published. +type PublishedEvent = Outcome + +// RefusedEvent is the body of the event refused. +type RefusedEvent = Outcome + +// RemovedEvent is the body of the event removed. +type RemovedEvent = Outcome diff --git a/go/seats/containerimageregistry/contract.go b/go/seats/containerimageregistry/contract.go new file mode 100644 index 0000000..d14c33e --- /dev/null +++ b/go/seats/containerimageregistry/contract.go @@ -0,0 +1,195 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// Package containerimageregistry is the contract of the seat "container-image-registry", defined whole (seats/container-image-registry/seat.json): The mesh's container images, in the one artifact store: the OCI distribution protocol's read side, an image's tags and mirroring an outside image. +package containerimageregistry + +import ( + "git.novox.be/novox/mesh-contracts/go/parts/registry" +) + +// Seat is the seat's name. +const Seat = "container-image-registry" + +const ( + VerbPublish = "publish" + VerbPublishPart = "publish-part" + VerbVersions = "versions" + VerbRemove = "remove" + VerbMirror = "mirror" + VerbTags = "tags" + VerbHold = "hold" + VerbRelease = "release" +) + +const ( + EventPublished = "published" + EventRefused = "refused" + EventRemoved = "removed" + EventHeld = "held" + EventReleased = "released" +) + +// Family is where the seat's events are kept. +const ( + Family = "container-image-registry.events" + FamilyMaxAgeDays = 7 +) + +// SubjectPublished is where published is published. +const SubjectPublished = "mesh.seat.container-image-registry.event.published" + +// SubjectRefused is where refused is published. +const SubjectRefused = "mesh.seat.container-image-registry.event.refused" + +// SubjectRemoved is where removed is published. +const SubjectRemoved = "mesh.seat.container-image-registry.event.removed" + +// SubjectHeld is where held is published. +const SubjectHeld = "mesh.seat.container-image-registry.event.held" + +// SubjectReleased is where released is published. +const SubjectReleased = "mesh.seat.container-image-registry.event.released" + +// Artifact is the part registry's. +type Artifact = registry.Artifact + +// Outcome is the part registry's. +type Outcome = registry.Outcome + +// Part is the part registry's. +type Part = registry.Part + +// PublishAnswer is the part registry's. +type PublishAnswer = registry.PublishAnswer + +// PublishInput is the part registry's. +type PublishInput = registry.PublishInput + +// PublishPartAnswer is the part registry's. +type PublishPartAnswer = registry.PublishPartAnswer + +// PublishPartInput is the part registry's. +type PublishPartInput = registry.PublishPartInput + +// PublishedEvent is the part registry's. +type PublishedEvent = registry.PublishedEvent + +// RefusedEvent is the part registry's. +type RefusedEvent = registry.RefusedEvent + +// RemoveAnswer is the part registry's. +type RemoveAnswer = registry.RemoveAnswer + +// RemoveInput is the part registry's. +type RemoveInput = registry.RemoveInput + +// RemovedEvent is the part registry's. +type RemovedEvent = registry.RemovedEvent + +// VersionsAnswer is the part registry's. +type VersionsAnswer = registry.VersionsAnswer + +// VersionsInput is the part registry's. +type VersionsInput = registry.VersionsInput + +// Hold is the body of held and released. +type Hold struct { + // when, RFC 3339 + At string `json:"at,omitempty"` + // the caller the holder proved + By string `json:"by,omitempty"` + // the digest + Digest string `json:"digest"` + // the module holding the seat + Holder string `json:"holder"` + // the name + Name string `json:"name"` + // why + Reason string `json:"reason,omitempty"` +} + +// MirrorInput is what mirror takes. +type MirrorInput struct { + // its pinned digest, sha256: + Digest string `json:"digest"` + // the name it is kept under + Name string `json:"name"` + // the outside image's reference + Source string `json:"source"` +} + +// MirrorAnswer is what mirror answers. +type MirrorAnswer struct { + // the digest stored + Digest string `json:"digest"` + // the reference the seat answers + Reference string `json:"reference"` +} + +// TagsInput is what tags takes. +type TagsInput struct { + // the image + Name string `json:"name"` +} + +// TagsAnswerTagsItem is a type of the contract. +type TagsAnswerTagsItem struct { + // its digest + Digest string `json:"digest"` + // the tag + Tag string `json:"tag"` +} + +// TagsAnswer is what tags answers. +type TagsAnswer struct { + // the image + Name string `json:"name"` + // every tag + Tags []TagsAnswerTagsItem `json:"tags"` +} + +// HoldInput is what hold takes. +type HoldInput struct { + // the digest + Digest string `json:"digest"` + // the name + Name string `json:"name"` + // which of the sweep's rules keeps it + Reason string `json:"reason"` +} + +// HoldAnswer is what hold answers. +type HoldAnswer struct { + // it is held + Held bool `json:"held"` + // when the hold began, RFC 3339 + Since string `json:"since,omitempty"` +} + +// ReleaseInput is what release takes. +type ReleaseInput struct { + // the digest + Digest string `json:"digest"` + // the name + Name string `json:"name"` + // why it is let go + Reason string `json:"reason"` +} + +// ReleaseAnswer is what release answers. +type ReleaseAnswer struct { + // the hold is gone + Released bool `json:"released"` +} + +// HeldEvent is the body of the event held. +type HeldEvent = Hold + +// ReleasedEvent is the body of the event released. +type ReleasedEvent = Hold + +// ArtifactStoreForm is the form of the provision artifact-store. +type ArtifactStoreForm struct { + // the store's address + URL string `json:"url"` +} diff --git a/go/seats/containerimageregistry/contract_test.go b/go/seats/containerimageregistry/contract_test.go new file mode 100644 index 0000000..7141141 --- /dev/null +++ b/go/seats/containerimageregistry/contract_test.go @@ -0,0 +1,66 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +package containerimageregistry + +import ( + "encoding/json" + "reflect" + "regexp" + "testing" +) + +// TestFixtures reads every fixture of seats/container-image-registry/fixtures: each decodes into its type, a field the type does not +// know is dropped (ADR 0608 §6), and it reads back as its wire says; each subject named is the contract's. +func TestFixtures(t *testing.T) { + cases := []struct { + name, subject, given, wire string + decode func([]byte) (any, error) + subjectIs *regexp.Regexp + }{ + {name: "published on the seat's subject", subject: "mesh.seat.container-image-registry.event.published", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"distribution\",\"kind\":\"image\",\"name\":\"mesh-sdk\",\"reference\":\"container-image-registry/mesh-sdk/lib@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"distribution\",\"kind\":\"image\",\"name\":\"mesh-sdk\",\"reference\":\"container-image-registry/mesh-sdk/lib@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v PublishedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.container-image-registry\\.event\\.published$")}, + {name: "refused on the seat's subject", subject: "mesh.seat.container-image-registry.event.refused", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"distribution\",\"kind\":\"image\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"container-image-registry/mesh-sdk/lib@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"distribution\",\"kind\":\"image\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"container-image-registry/mesh-sdk/lib@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v RefusedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.container-image-registry\\.event\\.refused$")}, + {name: "removed on the seat's subject", subject: "mesh.seat.container-image-registry.event.removed", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"distribution\",\"kind\":\"image\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"container-image-registry/mesh-sdk/lib@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"distribution\",\"kind\":\"image\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"container-image-registry/mesh-sdk/lib@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v RemovedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.container-image-registry\\.event\\.removed$")}, + {name: "held on the seat's subject", subject: "mesh.seat.container-image-registry.event.held", given: "{\"at\":\"2026-11-04T12:00:00Z\",\"by\":\"mesh-artifact-sweep\",\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"holder\":\"distribution\",\"name\":\"mesh-sdk\",\"reason\":\"kept by the sweep's rule\"}", wire: "{\"at\":\"2026-11-04T12:00:00Z\",\"by\":\"mesh-artifact-sweep\",\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"holder\":\"distribution\",\"name\":\"mesh-sdk\",\"reason\":\"kept by the sweep's rule\"}", + decode: func(b []byte) (any, error) { var v HeldEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.container-image-registry\\.event\\.held$")}, + {name: "released on the seat's subject", subject: "mesh.seat.container-image-registry.event.released", given: "{\"at\":\"2026-11-04T12:00:00Z\",\"by\":\"mesh-artifact-sweep\",\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"holder\":\"distribution\",\"name\":\"mesh-sdk\",\"reason\":\"kept by the sweep's rule\"}", wire: "{\"at\":\"2026-11-04T12:00:00Z\",\"by\":\"mesh-artifact-sweep\",\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"holder\":\"distribution\",\"name\":\"mesh-sdk\",\"reason\":\"kept by the sweep's rule\"}", + decode: func(b []byte) (any, error) { var v ReleasedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.container-image-registry\\.event\\.released$")}, + {name: "publish opens a transfer", subject: "", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"image\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"image\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v PublishInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "a field the reader does not know is dropped", subject: "", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"image\",\"later\":{\"x\":1},\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"image\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v PublishInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers what it lacks", subject: "", given: "{\"lacks\":[\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"],\"transfer\":\"t1\"}", wire: "{\"lacks\":[\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"],\"transfer\":\"t1\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "a chunk of a part", subject: "", given: "{\"data\":\"aGVsbG8=\",\"last\":true,\"part\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"sequence\":0,\"transfer\":\"t1\"}", wire: "{\"data\":\"aGVsbG8=\",\"last\":true,\"part\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"sequence\":0,\"transfer\":\"t1\"}", + decode: func(b []byte) (any, error) { var v PublishPartInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "the versions held", subject: "", given: "{\"name\":\"mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"version\":\"0.1.19\"}]}", wire: "{\"name\":\"mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"version\":\"0.1.19\"}]}", + decode: func(b []byte) (any, error) { var v VersionsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + } + for _, c := range cases { + v, err := c.decode([]byte(c.given)) + if err != nil { + t.Errorf("%s: does not decode: %v", c.name, err) + continue + } + back, err := json.Marshal(v) + if err != nil { + t.Errorf("%s: does not encode: %v", c.name, err) + continue + } + var got, want any + if err := json.Unmarshal(back, &got); err != nil { + t.Fatal(err) + } + if err := json.Unmarshal([]byte(c.wire), &want); err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(got, want) { + t.Errorf("%s: reads back as %s, want %s", c.name, back, c.wire) + } + if c.subjectIs != nil && !c.subjectIs.MatchString(c.subject) { + t.Errorf("%s: subject %q is not the contract's %s", c.name, c.subject, c.subjectIs) + } + } +} diff --git a/go/seats/gopackageregistry/contract.go b/go/seats/gopackageregistry/contract.go new file mode 100644 index 0000000..39f58cf --- /dev/null +++ b/go/seats/gopackageregistry/contract.go @@ -0,0 +1,87 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// Package gopackageregistry is the contract of the seat "go-package-registry", defined whole (seats/go-package-registry/seat.json): The mesh's Go modules: Go's module proxy protocol's read side, and publishing over the bus. +package gopackageregistry + +import ( + "git.novox.be/novox/mesh-contracts/go/parts/registry" +) + +// Seat is the seat's name. +const Seat = "go-package-registry" + +const ( + VerbPublish = "publish" + VerbPublishPart = "publish-part" + VerbVersions = "versions" + VerbRemove = "remove" +) + +const ( + EventPublished = "published" + EventRefused = "refused" + EventRemoved = "removed" +) + +// Family is where the seat's events are kept. +const ( + Family = "go-package-registry.events" + FamilyMaxAgeDays = 7 +) + +// SubjectPublished is where published is published. +const SubjectPublished = "mesh.seat.go-package-registry.event.published" + +// SubjectRefused is where refused is published. +const SubjectRefused = "mesh.seat.go-package-registry.event.refused" + +// SubjectRemoved is where removed is published. +const SubjectRemoved = "mesh.seat.go-package-registry.event.removed" + +// Artifact is the part registry's. +type Artifact = registry.Artifact + +// Outcome is the part registry's. +type Outcome = registry.Outcome + +// Part is the part registry's. +type Part = registry.Part + +// PublishAnswer is the part registry's. +type PublishAnswer = registry.PublishAnswer + +// PublishInput is the part registry's. +type PublishInput = registry.PublishInput + +// PublishPartAnswer is the part registry's. +type PublishPartAnswer = registry.PublishPartAnswer + +// PublishPartInput is the part registry's. +type PublishPartInput = registry.PublishPartInput + +// PublishedEvent is the part registry's. +type PublishedEvent = registry.PublishedEvent + +// RefusedEvent is the part registry's. +type RefusedEvent = registry.RefusedEvent + +// RemoveAnswer is the part registry's. +type RemoveAnswer = registry.RemoveAnswer + +// RemoveInput is the part registry's. +type RemoveInput = registry.RemoveInput + +// RemovedEvent is the part registry's. +type RemovedEvent = registry.RemovedEvent + +// VersionsAnswer is the part registry's. +type VersionsAnswer = registry.VersionsAnswer + +// VersionsInput is the part registry's. +type VersionsInput = registry.VersionsInput + +// GoPackageRegistryForm is the form of the provision go-package-registry. +type GoPackageRegistryForm struct { + // the read side's address + URL string `json:"url"` +} diff --git a/go/seats/gopackageregistry/contract_test.go b/go/seats/gopackageregistry/contract_test.go new file mode 100644 index 0000000..f52946b --- /dev/null +++ b/go/seats/gopackageregistry/contract_test.go @@ -0,0 +1,62 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +package gopackageregistry + +import ( + "encoding/json" + "reflect" + "regexp" + "testing" +) + +// TestFixtures reads every fixture of seats/go-package-registry/fixtures: each decodes into its type, a field the type does not +// know is dropped (ADR 0608 §6), and it reads back as its wire says; each subject named is the contract's. +func TestFixtures(t *testing.T) { + cases := []struct { + name, subject, given, wire string + decode func([]byte) (any, error) + subjectIs *regexp.Regexp + }{ + {name: "published on the seat's subject", subject: "mesh.seat.go-package-registry.event.published", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v PublishedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.go-package-registry\\.event\\.published$")}, + {name: "refused on the seat's subject", subject: "mesh.seat.go-package-registry.event.refused", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v RefusedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.go-package-registry\\.event\\.refused$")}, + {name: "removed on the seat's subject", subject: "mesh.seat.go-package-registry.event.removed", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v RemovedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.go-package-registry\\.event\\.removed$")}, + {name: "publish opens a transfer", subject: "", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v PublishInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "a field the reader does not know is dropped", subject: "", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"later\":{\"x\":1},\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v PublishInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers what it lacks", subject: "", given: "{\"lacks\":[\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"],\"transfer\":\"t1\"}", wire: "{\"lacks\":[\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"],\"transfer\":\"t1\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "a chunk of a part", subject: "", given: "{\"data\":\"aGVsbG8=\",\"last\":true,\"part\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"sequence\":0,\"transfer\":\"t1\"}", wire: "{\"data\":\"aGVsbG8=\",\"last\":true,\"part\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"sequence\":0,\"transfer\":\"t1\"}", + decode: func(b []byte) (any, error) { var v PublishPartInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "the versions held", subject: "", given: "{\"name\":\"mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"version\":\"0.1.19\"}]}", wire: "{\"name\":\"mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"version\":\"0.1.19\"}]}", + decode: func(b []byte) (any, error) { var v VersionsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + } + for _, c := range cases { + v, err := c.decode([]byte(c.given)) + if err != nil { + t.Errorf("%s: does not decode: %v", c.name, err) + continue + } + back, err := json.Marshal(v) + if err != nil { + t.Errorf("%s: does not encode: %v", c.name, err) + continue + } + var got, want any + if err := json.Unmarshal(back, &got); err != nil { + t.Fatal(err) + } + if err := json.Unmarshal([]byte(c.wire), &want); err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(got, want) { + t.Errorf("%s: reads back as %s, want %s", c.name, back, c.wire) + } + if c.subjectIs != nil && !c.subjectIs.MatchString(c.subject) { + t.Errorf("%s: subject %q is not the contract's %s", c.name, c.subject, c.subjectIs) + } + } +} diff --git a/go/seats/meshbroker/contract.go b/go/seats/meshbroker/contract.go new file mode 100644 index 0000000..46907d3 --- /dev/null +++ b/go/seats/meshbroker/contract.go @@ -0,0 +1,280 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// Package meshbroker is the contract of the seat "mesh-broker", defined whole (seats/mesh-broker/seat.json): The mesh's bus, and the bus state modules ask of it in requires (design 25 § 12). create, apply, recreate and drop are granted to the bus module's own credential alone. +package meshbroker + +// Seat is the seat's name. +const Seat = "mesh-broker" + +const ( + VerbList = "list" + VerbShow = "show" + VerbCheck = "check" + VerbOrphans = "orphans" + VerbCreate = "create" + VerbApply = "apply" + VerbRecreate = "recreate" + VerbDrop = "drop" +) + +const ( + EventCreated = "created" + EventRefused = "refused" + EventDrifted = "drifted" + EventDriftCleared = "drift-cleared" + EventFull = "full" + EventFullCleared = "full-cleared" + EventOrphaned = "orphaned" + EventRecreated = "recreated" + EventDropped = "dropped" +) + +// Family is where the seat's events are kept. +const ( + Family = "mesh-broker.events" + FamilyMaxAgeDays = 30 + FamilyMaxMiB = 256 +) + +// SubjectCreated is where created is published. +const SubjectCreated = "mesh.seat.mesh-broker.event.created" + +// SubjectRefused is where refused is published. +const SubjectRefused = "mesh.seat.mesh-broker.event.refused" + +// SubjectDrifted is where drifted is published. +const SubjectDrifted = "mesh.seat.mesh-broker.event.drifted" + +// SubjectDriftCleared is where drift-cleared is published. +const SubjectDriftCleared = "mesh.seat.mesh-broker.event.drift-cleared" + +// SubjectFull is where full is published. +const SubjectFull = "mesh.seat.mesh-broker.event.full" + +// SubjectFullCleared is where full-cleared is published. +const SubjectFullCleared = "mesh.seat.mesh-broker.event.full-cleared" + +// SubjectOrphaned is where orphaned is published. +const SubjectOrphaned = "mesh.seat.mesh-broker.event.orphaned" + +// SubjectRecreated is where recreated is published. +const SubjectRecreated = "mesh.seat.mesh-broker.event.recreated" + +// SubjectDropped is where dropped is published. +const SubjectDropped = "mesh.seat.mesh-broker.event.dropped" + +// Entry is one piece of bus state as a manifest asks it. +type Entry struct { + // its own configuration, where no template fits + Configuration map[string]any `json:"configuration,omitempty"` + // its local name in the module's manifest + LocalName string `json:"local-name"` + // the module asking it + Module string `json:"module"` + // the template's options the module set, within their bounds + Options map[string]any `json:"options,omitempty"` + // how the bus keeps it + StorageType string `json:"storage-type"` + // its template; empty for a configuration of its own + Template string `json:"template,omitempty"` +} + +// Fill is a type of the contract. +type Fill struct { + // bytes held + Bytes int64 `json:"bytes"` + // its cap in bytes + Cap int64 `json:"cap"` + // messages, keys or objects held + Count int64 `json:"count"` +} + +// Held is one entry as the bus holds it. +type Held struct { + // its name on the bus, _ + BusName string `json:"bus-name"` + // its own configuration, where no template fits + Configuration map[string]any `json:"configuration,omitempty"` + Fill *Fill `json:"fill,omitempty"` + // its local name in the module's manifest + LocalName string `json:"local-name"` + // the module asking it + Module string `json:"module"` + // the template's options the module set, within their bounds + Options map[string]any `json:"options,omitempty"` + // the settings the bus holds + Settings map[string]any `json:"settings,omitempty"` + // how the bus keeps it + StorageType string `json:"storage-type"` + // its template; empty for a configuration of its own + Template string `json:"template,omitempty"` +} + +// Named is a type of the contract. +type Named struct { + // the entry's local name + LocalName string `json:"local-name"` + // the module + Module string `json:"module"` +} + +// Said is the body of every event of the seat. +type Said struct { + // the settings asked + Asked map[string]any `json:"asked,omitempty"` + // its name on the bus + BusName string `json:"bus-name"` + // its own configuration, where no template fits + Configuration map[string]any `json:"configuration,omitempty"` + Fill *Fill `json:"fill,omitempty"` + // the settings held + Held map[string]any `json:"held,omitempty"` + // its local name in the module's manifest + LocalName string `json:"local-name"` + // the module asking it + Module string `json:"module"` + // the template's options the module set, within their bounds + Options map[string]any `json:"options,omitempty"` + // the stream snapshot taken before a recreate or drop + Snapshot string `json:"snapshot,omitempty"` + // how the bus keeps it + StorageType string `json:"storage-type,omitempty"` + // its template; empty for a configuration of its own + Template string `json:"template,omitempty"` + // why: a refusal's cause, a drift's difference, a drop's or recreate's reason + Why string `json:"why,omitempty"` +} + +// Warranted is a type of the contract. +type Warranted struct { + // the entry's local name + LocalName string `json:"local-name"` + // the module + Module string `json:"module"` + // the operator's warrant, as the operator channel decided it (ADR 0259 §6) + Warrant string `json:"warrant"` + // why, kept in the record + Why string `json:"why"` +} + +// ListInput is what list takes. +type ListInput struct { + // one module (optional) + Module string `json:"module,omitempty"` +} + +// ListAnswer is what list answers. +type ListAnswer struct { + // every entry + Entries []Held `json:"entries"` +} + +// ShowInput is what show takes. +type ShowInput = Named + +// ShowAnswer is what show answers. +type ShowAnswer = Held + +// CheckInput is what check takes. +type CheckInput struct { + // one module (optional) + Module string `json:"module,omitempty"` +} + +// CheckAnswerDifferencesItem is a type of the contract. +type CheckAnswerDifferencesItem struct { + // asked + Asked map[string]any `json:"asked,omitempty"` + // the difference only grows: apply may act on it + Grows bool `json:"grows,omitempty"` + // held + Held map[string]any `json:"held,omitempty"` + // the entry + LocalName string `json:"local-name"` + // the module + Module string `json:"module"` +} + +// CheckAnswer is what check answers. +type CheckAnswer struct { + // every difference + Differences []CheckAnswerDifferencesItem `json:"differences"` +} + +// OrphansInput is what orphans takes. +type OrphansInput struct { +} + +// OrphansAnswer is what orphans answers. +type OrphansAnswer struct { + // every orphan + Entries []Held `json:"entries"` +} + +// CreateInput is what create takes. +type CreateInput = Entry + +// CreateAnswer is what create answers. +type CreateAnswer = Held + +// ApplyInput is what apply takes. +type ApplyInput = Named + +// ApplyAnswer is what apply answers. +type ApplyAnswer = Held + +// RecreateInput is what recreate takes. +type RecreateInput = Warranted + +// RecreateAnswer is what recreate answers. +type RecreateAnswer = Held + +// DropInput is what drop takes. +type DropInput = Warranted + +// DropAnswer is what drop answers. +type DropAnswer struct { + // it is gone + Dropped bool `json:"dropped"` + // the snapshot taken first + Snapshot string `json:"snapshot,omitempty"` +} + +// CreatedEvent is the body of the event created. +type CreatedEvent = Said + +// RefusedEvent is the body of the event refused. +type RefusedEvent = Said + +// DriftedEvent is the body of the event drifted. +type DriftedEvent = Said + +// DriftClearedEvent is the body of the event drift-cleared. +type DriftClearedEvent = Said + +// FullEvent is the body of the event full. +type FullEvent = Said + +// FullClearedEvent is the body of the event full-cleared. +type FullClearedEvent = Said + +// OrphanedEvent is the body of the event orphaned. +type OrphanedEvent = Said + +// RecreatedEvent is the body of the event recreated. +type RecreatedEvent = Said + +// DroppedEvent is the body of the event dropped. +type DroppedEvent = Said + +// BusStateForm is the form of the provision bus-state. +type BusStateForm struct { + // the entry's name on the bus + BusName string `json:"bus-name"` + // how the bus keeps it + StorageType string `json:"storage-type"` + // its subjects, for a stream + Subjects []string `json:"subjects,omitempty"` + // its template + Template string `json:"template,omitempty"` +} diff --git a/go/seats/meshbroker/contract_test.go b/go/seats/meshbroker/contract_test.go new file mode 100644 index 0000000..03c1f9c --- /dev/null +++ b/go/seats/meshbroker/contract_test.go @@ -0,0 +1,70 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +package meshbroker + +import ( + "encoding/json" + "reflect" + "regexp" + "testing" +) + +// TestFixtures reads every fixture of seats/mesh-broker/fixtures: each decodes into its type, a field the type does not +// know is dropped (ADR 0608 §6), and it reads back as its wire says; each subject named is the contract's. +func TestFixtures(t *testing.T) { + cases := []struct { + name, subject, given, wire string + decode func([]byte) (any, error) + subjectIs *regexp.Regexp + }{ + {name: "created on the seat's subject", subject: "mesh.seat.mesh-broker.event.created", given: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\"}", wire: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\"}", + decode: func(b []byte) (any, error) { var v CreatedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-broker\\.event\\.created$")}, + {name: "refused on the seat's subject", subject: "mesh.seat.mesh-broker.event.refused", given: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\",\"why\":\"the bus refused it\"}", wire: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\",\"why\":\"the bus refused it\"}", + decode: func(b []byte) (any, error) { var v RefusedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-broker\\.event\\.refused$")}, + {name: "drifted on the seat's subject", subject: "mesh.seat.mesh-broker.event.drifted", given: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\",\"why\":\"the bus refused it\"}", wire: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\",\"why\":\"the bus refused it\"}", + decode: func(b []byte) (any, error) { var v DriftedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-broker\\.event\\.drifted$")}, + {name: "drift-cleared on the seat's subject", subject: "mesh.seat.mesh-broker.event.drift-cleared", given: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\"}", wire: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\"}", + decode: func(b []byte) (any, error) { var v DriftClearedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-broker\\.event\\.drift-cleared$")}, + {name: "full on the seat's subject", subject: "mesh.seat.mesh-broker.event.full", given: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\"}", wire: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\"}", + decode: func(b []byte) (any, error) { var v FullEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-broker\\.event\\.full$")}, + {name: "full-cleared on the seat's subject", subject: "mesh.seat.mesh-broker.event.full-cleared", given: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\"}", wire: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\"}", + decode: func(b []byte) (any, error) { var v FullClearedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-broker\\.event\\.full-cleared$")}, + {name: "orphaned on the seat's subject", subject: "mesh.seat.mesh-broker.event.orphaned", given: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\"}", wire: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\"}", + decode: func(b []byte) (any, error) { var v OrphanedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-broker\\.event\\.orphaned$")}, + {name: "recreated on the seat's subject", subject: "mesh.seat.mesh-broker.event.recreated", given: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\",\"why\":\"the bus refused it\"}", wire: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\",\"why\":\"the bus refused it\"}", + decode: func(b []byte) (any, error) { var v RecreatedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-broker\\.event\\.recreated$")}, + {name: "dropped on the seat's subject", subject: "mesh.seat.mesh-broker.event.dropped", given: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\",\"why\":\"the bus refused it\"}", wire: "{\"asked\":{\"max-mib\":64},\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"held\":{\"max-mib\":64},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"storage-type\":\"ledger\",\"template\":\"ledger\",\"why\":\"the bus refused it\"}", + decode: func(b []byte) (any, error) { var v DroppedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-broker\\.event\\.dropped$")}, + {name: "create one entry", subject: "", given: "{\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"options\":{\"max-mib\":64},\"storage-type\":\"ledger\",\"template\":\"ledger\"}", wire: "{\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"options\":{\"max-mib\":64},\"storage-type\":\"ledger\",\"template\":\"ledger\"}", + decode: func(b []byte) (any, error) { var v CreateInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "drop on the operator's warrant", subject: "", given: "{\"local-name\":\"old\",\"module\":\"mesh-knowledge\",\"warrant\":\"w-1\",\"why\":\"the operator approved the drop\"}", wire: "{\"local-name\":\"old\",\"module\":\"mesh-knowledge\",\"warrant\":\"w-1\",\"why\":\"the operator approved the drop\"}", + decode: func(b []byte) (any, error) { var v DropInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "list answers every entry", subject: "", given: "{\"entries\":[{\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"options\":{\"max-mib\":64},\"settings\":{\"max-mib\":64},\"storage-type\":\"ledger\",\"template\":\"ledger\"}]}", wire: "{\"entries\":[{\"bus-name\":\"mesh-knowledge_ledger\",\"fill\":{\"bytes\":2048,\"cap\":67108864,\"count\":10},\"local-name\":\"ledger\",\"module\":\"mesh-knowledge\",\"options\":{\"max-mib\":64},\"settings\":{\"max-mib\":64},\"storage-type\":\"ledger\",\"template\":\"ledger\"}]}", + decode: func(b []byte) (any, error) { var v ListAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + } + for _, c := range cases { + v, err := c.decode([]byte(c.given)) + if err != nil { + t.Errorf("%s: does not decode: %v", c.name, err) + continue + } + back, err := json.Marshal(v) + if err != nil { + t.Errorf("%s: does not encode: %v", c.name, err) + continue + } + var got, want any + if err := json.Unmarshal(back, &got); err != nil { + t.Fatal(err) + } + if err := json.Unmarshal([]byte(c.wire), &want); err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(got, want) { + t.Errorf("%s: reads back as %s, want %s", c.name, back, c.wire) + } + if c.subjectIs != nil && !c.subjectIs.MatchString(c.subject) { + t.Errorf("%s: subject %q is not the contract's %s", c.name, c.subject, c.subjectIs) + } + } +} diff --git a/go/seats/meshconfig/contract.go b/go/seats/meshconfig/contract.go new file mode 100644 index 0000000..ff82d22 --- /dev/null +++ b/go/seats/meshconfig/contract.go @@ -0,0 +1,120 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// Package meshconfig is the contract of the seat "mesh-config", defined whole (seats/mesh-config/seat.json): The mesh's config values: read and set one, and the renames still open. mesh-config's own events stay under its own subjects (ADR 0620 §2). +package meshconfig + +// Seat is the seat's name. +const Seat = "mesh-config" + +const ( + VerbConfig = "config" + VerbRenames = "renames" +) + +// The holder's own events, listed beside the seat and published under the holder's subjects (ADR 0620 §2). +const ( + HolderEventConfigChanged = "config-changed" + HolderEventRenamed = "renamed" + HolderEventRetiring = "retiring" + HolderEventRetired = "retired" +) + +// HolderSubjectConfigChanged is where the holder publishes config-changed. +func HolderSubjectConfigChanged(holder string) string { + return "mesh.mod." + holder + ".event.config-changed" +} + +// HolderSubjectRenamed is where the holder publishes renamed, kept in config.events. +func HolderSubjectRenamed(holder string) string { return "mesh.mod." + holder + ".event.renamed" } + +// HolderSubjectRetiring is where the holder publishes retiring, kept in config.events. +func HolderSubjectRetiring(holder string) string { return "mesh.mod." + holder + ".event.retiring" } + +// HolderSubjectRetired is where the holder publishes retired, kept in config.events. +func HolderSubjectRetired(holder string) string { return "mesh.mod." + holder + ".event.retired" } + +// ConfigInput is what config takes. +type ConfigInput struct { + // list (when not given), set, clear or history + Action string `json:"action,omitempty"` + // who gave the value at the controller's terminal + By string `json:"by,omitempty"` + // the config key + Key string `json:"key,omitempty"` + // for history: at most this many, newest + Limit float64 `json:"limit,omitempty"` + // a module: its own value, with node + Module string `json:"module,omitempty"` + // a node + Node string `json:"node,omitempty"` + // for set: the value, of the key's type: a number, a string, a boolean, or for a trusted key an object or a list + Value any `json:"value,omitempty"` + // for set and clear: why + Why string `json:"why,omitempty"` +} + +// ConfigAnswer is what config answers. +type ConfigAnswer = map[string]any + +// RenamesInput is what renames takes. +type RenamesInput struct { + // one module (optional) + Module string `json:"module,omitempty"` +} + +// RenamesAnswerRenamesItem is a type of the contract. +type RenamesAnswerRenamesItem struct { + // when it moved, RFC 3339 + At string `json:"at,omitempty"` + // the old name + From string `json:"from"` + // the module + Module string `json:"module"` + // the nodes still holding the old name open + Open []string `json:"open,omitempty"` + // the new name + To string `json:"to"` +} + +// RenamesAnswer is what renames answers. +type RenamesAnswer struct { + // every open rename + Renames []RenamesAnswerRenamesItem `json:"renames"` +} + +// RenamedHolderEvent is the body of the holder's event renamed. +type RenamedHolderEvent struct { + // when, RFC 3339 + At string `json:"at"` + // the old name + From string `json:"from"` + // the module + Module string `json:"module"` + // the new name + To string `json:"to"` +} + +// RetiringHolderEvent is the body of the holder's event retiring. +type RetiringHolderEvent struct { + // the ask's id + Ask string `json:"ask,omitempty"` + // the value's or secret's name + Key string `json:"key"` + Kind string `json:"kind"` + // the module + Module string `json:"module"` + // since when, RFC 3339 + Since string `json:"since"` +} + +// RetiredHolderEvent is the body of the holder's event retired. +type RetiredHolderEvent struct { + // the ask's id + Ask string `json:"ask,omitempty"` + // the module + Module string `json:"module"` + // the name + Name string `json:"name"` + // the node + Node string `json:"node,omitempty"` +} diff --git a/go/seats/meshconfig/contract_test.go b/go/seats/meshconfig/contract_test.go new file mode 100644 index 0000000..eb8839a --- /dev/null +++ b/go/seats/meshconfig/contract_test.go @@ -0,0 +1,56 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +package meshconfig + +import ( + "encoding/json" + "reflect" + "regexp" + "testing" +) + +// TestFixtures reads every fixture of seats/mesh-config/fixtures: each decodes into its type, a field the type does not +// know is dropped (ADR 0608 §6), and it reads back as its wire says; each subject named is the contract's. +func TestFixtures(t *testing.T) { + cases := []struct { + name, subject, given, wire string + decode func([]byte) (any, error) + subjectIs *regexp.Regexp + }{ + {name: "config-changed, unchanged", subject: "mesh.mod.mesh-config.event.config-changed", given: "{\"key\":\"x\"}", wire: "{\"key\":\"x\"}", + decode: func(b []byte) (any, error) { var v map[string]any; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.config-changed$")}, + {name: "renamed", subject: "mesh.mod.mesh-config.event.renamed", given: "{\"at\":\"2026-11-04T12:00:00Z\",\"from\":\"old-key\",\"module\":\"messenger\",\"to\":\"new-key\"}", wire: "{\"at\":\"2026-11-04T12:00:00Z\",\"from\":\"old-key\",\"module\":\"messenger\",\"to\":\"new-key\"}", + decode: func(b []byte) (any, error) { var v RenamedHolderEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.renamed$")}, + {name: "retiring", subject: "mesh.mod.mesh-config.event.retiring", given: "{\"ask\":\"a1\",\"key\":\"old-key\",\"kind\":\"value\",\"module\":\"messenger\",\"since\":\"2026-11-04T12:00:00Z\"}", wire: "{\"ask\":\"a1\",\"key\":\"old-key\",\"kind\":\"value\",\"module\":\"messenger\",\"since\":\"2026-11-04T12:00:00Z\"}", + decode: func(b []byte) (any, error) { var v RetiringHolderEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.retiring$")}, + {name: "retired", subject: "mesh.mod.mesh-config.event.retired", given: "{\"ask\":\"a1\",\"module\":\"messenger\",\"name\":\"old-key\",\"node\":\"ace\"}", wire: "{\"ask\":\"a1\",\"module\":\"messenger\",\"name\":\"old-key\",\"node\":\"ace\"}", + decode: func(b []byte) (any, error) { var v RetiredHolderEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.retired$")}, + {name: "renames answers the open windows", subject: "", given: "{\"renames\":[{\"at\":\"2026-11-04T12:00:00Z\",\"from\":\"old-key\",\"module\":\"messenger\",\"open\":[\"g14\"],\"to\":\"new-key\"}]}", wire: "{\"renames\":[{\"at\":\"2026-11-04T12:00:00Z\",\"from\":\"old-key\",\"module\":\"messenger\",\"open\":[\"g14\"],\"to\":\"new-key\"}]}", + decode: func(b []byte) (any, error) { var v RenamesAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + } + for _, c := range cases { + v, err := c.decode([]byte(c.given)) + if err != nil { + t.Errorf("%s: does not decode: %v", c.name, err) + continue + } + back, err := json.Marshal(v) + if err != nil { + t.Errorf("%s: does not encode: %v", c.name, err) + continue + } + var got, want any + if err := json.Unmarshal(back, &got); err != nil { + t.Fatal(err) + } + if err := json.Unmarshal([]byte(c.wire), &want); err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(got, want) { + t.Errorf("%s: reads back as %s, want %s", c.name, back, c.wire) + } + if c.subjectIs != nil && !c.subjectIs.MatchString(c.subject) { + t.Errorf("%s: subject %q is not the contract's %s", c.name, c.subject, c.subjectIs) + } + } +} diff --git a/go/seats/meshdeliverychecker/contract.go b/go/seats/meshdeliverychecker/contract.go new file mode 100644 index 0000000..da03e1a --- /dev/null +++ b/go/seats/meshdeliverychecker/contract.go @@ -0,0 +1,108 @@ +// 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 + +// Seat is the seat's name. +const Seat = "mesh-delivery-checker" + +const ( + VerbTry = "try" + VerbTryRead = "try-read" + VerbTryEnd = "try-end" +) + +// 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.mod." + holder + ".event.verdict" } + +// HolderSubjectTagWanted is where the holder publishes tag-wanted, kept in checker.asks. +func HolderSubjectTagWanted(holder string) string { return "mesh.mod." + holder + ".event.tag-wanted" } + +// HolderSubjectPreviewWritten is where the holder publishes preview.written, kept in checks. +func HolderSubjectPreviewWritten(holder string) string { + return "mesh.mod." + holder + ".event.preview.written" +} + +// 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"` + // / + 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- + 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- + 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"` +} + +// 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"` + // pass or fail + Verdict string `json:"verdict"` +} + +// TagWantedHolderEvent is the body of the holder's event tag-wanted. +type TagWantedHolderEvent struct { + // 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"` +} diff --git a/go/seats/meshdeliverychecker/contract_test.go b/go/seats/meshdeliverychecker/contract_test.go new file mode 100644 index 0000000..0e1514f --- /dev/null +++ b/go/seats/meshdeliverychecker/contract_test.go @@ -0,0 +1,52 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +package meshdeliverychecker + +import ( + "encoding/json" + "reflect" + "regexp" + "testing" +) + +// TestFixtures reads every fixture of seats/mesh-delivery-checker/fixtures: each decodes into its type, a field the type does not +// know is dropped (ADR 0608 §6), and it reads back as its wire says; each subject named is the contract's. +func TestFixtures(t *testing.T) { + cases := []struct { + name, subject, given, wire string + decode func([]byte) (any, error) + subjectIs *regexp.Regexp + }{ + {name: "verdict on the checker's own family", subject: "mesh.mod.mesh-delivery-checker.event.verdict", given: "{\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"out-of-step\":[\"go/seats/meshbroker/contract.go\"],\"pull\":3,\"repository\":\"novox/mesh-contracts\",\"verdict\":\"fail\"}", wire: "{\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"out-of-step\":[\"go/seats/meshbroker/contract.go\"],\"pull\":3,\"repository\":\"novox/mesh-contracts\",\"verdict\":\"fail\"}", + decode: func(b []byte) (any, error) { var v VerdictHolderEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.verdict$")}, + {name: "tag-wanted on the checker's own family", subject: "mesh.mod.mesh-delivery-checker.event.tag-wanted", given: "{\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"module\":\"mesh-sdk\",\"package\":\"go\",\"pull\":170,\"repository\":\"novox/mesh-sdk\",\"tag\":\"registry-1966\"}", wire: "{\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"module\":\"mesh-sdk\",\"package\":\"go\",\"pull\":170,\"repository\":\"novox/mesh-sdk\",\"tag\":\"registry-1966\"}", + decode: func(b []byte) (any, error) { var v TagWantedHolderEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.tag-wanted$")}, + {name: "preview.written on the checker's stream", subject: "mesh.mod.mesh-delivery-checker.event.preview.written", given: "{}", wire: "{}", + decode: func(b []byte) (any, error) { var v map[string]any; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.preview\\.written$")}, + } + for _, c := range cases { + v, err := c.decode([]byte(c.given)) + if err != nil { + t.Errorf("%s: does not decode: %v", c.name, err) + continue + } + back, err := json.Marshal(v) + if err != nil { + t.Errorf("%s: does not encode: %v", c.name, err) + continue + } + var got, want any + if err := json.Unmarshal(back, &got); err != nil { + t.Fatal(err) + } + if err := json.Unmarshal([]byte(c.wire), &want); err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(got, want) { + t.Errorf("%s: reads back as %s, want %s", c.name, back, c.wire) + } + if c.subjectIs != nil && !c.subjectIs.MatchString(c.subject) { + t.Errorf("%s: subject %q is not the contract's %s", c.name, c.subject, c.subjectIs) + } + } +} diff --git a/go/seats/meshvault/contract.go b/go/seats/meshvault/contract.go new file mode 100644 index 0000000..b0231b3 --- /dev/null +++ b/go/seats/meshvault/contract.go @@ -0,0 +1,355 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// Package meshvault is the contract of the seat "mesh-vault", defined whole (seats/mesh-vault/seat.json): The mesh's secrets. accept and move-asks, which no holder served and nothing called, are left out (ADR 0620 §3). The vault's own events stay under its own subjects (ADR 0620 §2). +package meshvault + +// Seat is the seat's name. +const Seat = "mesh-vault" + +const ( + VerbGet = "get" + VerbSecretAsk = "secret-ask" + VerbIssued = "issued" + VerbRotate = "rotate" + VerbMoveIn = "move-in" + VerbNodeKey = "node-key" + VerbOwn = "own" + VerbIssueAccount = "issue-account" + VerbSign = "sign" + VerbEnrolmentToken = "enrolment-token" + VerbNodeAccount = "node-account" + VerbRotateNode = "rotate-node" + VerbNodeAccountConfirm = "node-account-confirm" + VerbAbandon = "abandon" + VerbRetire = "retire" +) + +// The holder's own events, listed beside the seat and published under the holder's subjects (ADR 0620 §2). +const ( + HolderEventProvisioned = "provisioned" + HolderEventRotated = "rotated" + HolderEventSecretChanged = "secret-changed" + HolderEventAccountHashed = "account-hashed" + HolderEventOwnReplaced = "own-replaced" + HolderEventAccountIssued = "account-issued" + HolderEventSigned = "signed" + HolderEventRotationBegun = "rotation-begun" + HolderEventNodeAccountReady = "node-account-ready" + HolderEventRotationDone = "rotation-done" + HolderEventOwnRetired = "own-retired" +) + +// HolderSubjectProvisioned is where the holder publishes provisioned. +func HolderSubjectProvisioned(holder string) string { + return "mesh.mod." + holder + ".event.provisioned" +} + +// HolderSubjectRotated is where the holder publishes rotated. +func HolderSubjectRotated(holder string) string { return "mesh.mod." + holder + ".event.rotated" } + +// HolderSubjectSecretChanged is where the holder publishes secret-changed. +func HolderSubjectSecretChanged(holder string) string { + return "mesh.mod." + holder + ".event.secret-changed" +} + +// HolderSubjectAccountHashed is where the holder publishes account-hashed. +func HolderSubjectAccountHashed(holder string) string { + return "mesh.mod." + holder + ".event.account-hashed" +} + +// HolderSubjectOwnReplaced is where the holder publishes own-replaced. +func HolderSubjectOwnReplaced(holder string) string { + return "mesh.mod." + holder + ".event.own-replaced" +} + +// HolderSubjectAccountIssued is where the holder publishes account-issued. +func HolderSubjectAccountIssued(holder string) string { + return "mesh.mod." + holder + ".event.account-issued" +} + +// HolderSubjectSigned is where the holder publishes signed. +func HolderSubjectSigned(holder string) string { return "mesh.mod." + holder + ".event.signed" } + +// HolderSubjectRotationBegun is where the holder publishes rotation-begun. +func HolderSubjectRotationBegun(holder string) string { + return "mesh.mod." + holder + ".event.rotation-begun" +} + +// HolderSubjectNodeAccountReady is where the holder publishes node-account-ready. +func HolderSubjectNodeAccountReady(holder string) string { + return "mesh.mod." + holder + ".event.node-account-ready" +} + +// HolderSubjectRotationDone is where the holder publishes rotation-done. +func HolderSubjectRotationDone(holder string) string { + return "mesh.mod." + holder + ".event.rotation-done" +} + +// HolderSubjectOwnRetired is where the holder publishes own-retired. +func HolderSubjectOwnRetired(holder string) string { + return "mesh.mod." + holder + ".event.own-retired" +} + +// GetInput is what get takes. +type GetInput struct { + // the secret's name + Name string `json:"name"` + // the asker's X25519 public key as SPKI PEM — never a private key + PublicKey string `json:"public_key"` +} + +// GetAnswer is what get answers. +type GetAnswer = map[string]any + +// SecretAskInput is what secret-ask takes. +type SecretAskInput struct { + // who asked, as the bus named its caller + AskedBy string `json:"asked_by,omitempty"` + // the second step: the call the first step answered + Call string `json:"call,omitempty"` + // the machine whose prompt asks + Desk string `json:"desk,omitempty"` + // the module + Module string `json:"module,omitempty"` + // the secret's name in the module + Name string `json:"name,omitempty"` + // the machine the secret is for + Node string `json:"node,omitempty"` + // instead of sealed: how the prompt ended + Outcome string `json:"outcome,omitempty"` + // the second step: the value sealed to the call's key — never the value + Sealed string `json:"sealed,omitempty"` +} + +// SecretAskAnswer is what secret-ask answers. +type SecretAskAnswer = map[string]any + +// IssuedInputHoldersItem is a type of the contract. +type IssuedInputHoldersItem struct { + // the consuming module + Module string `json:"module,omitempty"` + // the holder's machine + Node string `json:"node,omitempty"` +} + +// IssuedInput is what issued takes. +type IssuedInput struct { + // the second step: the call the first step answered + Call string `json:"call,omitempty"` + // the provision's holders from that provider, each {node, module}: its tool may answer a value for each, kept as that holder's own and handed to it alone + Holders []IssuedInputHoldersItem `json:"holders,omitempty"` + // the provider's module + Module string `json:"module,omitempty"` + // the provider's machine + Provider string `json:"provider,omitempty"` + // the provision + Provision string `json:"provision,omitempty"` + // the second step: the value sealed to the call's key — never the value + Sealed string `json:"sealed,omitempty"` +} + +// IssuedAnswer is what issued answers. +type IssuedAnswer = map[string]any + +// RotateInput is what rotate takes. +type RotateInput struct { + // who asked, when the controller carries the act + By string `json:"by,omitempty"` + // the module + Module string `json:"module,omitempty"` + // the secret's name in the module + Name string `json:"name,omitempty"` + // the machine, for a module's own secret + Node string `json:"node,omitempty"` + // the provider's machine + Provider string `json:"provider,omitempty"` + // the provision + Provision string `json:"provision,omitempty"` +} + +// RotateAnswer is what rotate answers. +type RotateAnswer = map[string]any + +// MoveInInput is what move-in takes. +type MoveInInput struct { + // the second step: the call the first step answered + Call string `json:"call,omitempty"` + // the consumer's machine + Consumer string `json:"consumer,omitempty"` + // the consuming module + ConsumerModule string `json:"consumer_module,omitempty"` + // the controller's generation for the value + Generation string `json:"generation,omitempty"` + // the credential's local name, when it has one + Local string `json:"local,omitempty"` + // when it was made (RFC 3339) + MadeAt string `json:"made_at,omitempty"` + // its module + Module string `json:"module,omitempty"` + // its name in the module + Name string `json:"name,omitempty"` + // a module's own secret: its machine + Node string `json:"node,omitempty"` + // made, accepted or issued, as the controller's store says + Origin string `json:"origin,omitempty"` + // a pair credential: the provider's machine + Provider string `json:"provider,omitempty"` + // the provision + Provision string `json:"provision,omitempty"` + // the second step: a raw X25519 public key the read-back is sealed to + ReadBackTo string `json:"read_back_to,omitempty"` + // the second step: the value sealed to the call's key — never the value + Sealed string `json:"sealed,omitempty"` +} + +// MoveInAnswer is what move-in answers. +type MoveInAnswer = map[string]any + +// NodeKeyInput is what node-key takes. +type NodeKeyInput struct { + // the machine's sealing key, a raw X25519 public key in base64 + Key string `json:"key,omitempty"` +} + +// NodeKeyAnswer is what node-key answers. +type NodeKeyAnswer = map[string]any + +// OwnInput is what own takes. +type OwnInput struct { + // the pair credentials the machine's composition reads, each {role: consumer|provider, provision, consumer, consumer_module, provider, local} + Credentials []map[string]any `json:"credentials,omitempty"` +} + +// OwnAnswer is what own answers. +type OwnAnswer = map[string]any + +// IssueAccountInput is what issue-account takes. +type IssueAccountInput struct { + // the bus user, e.g. ace.mesh-build-go + User string `json:"user"` +} + +// IssueAccountAnswer is what issue-account answers. +type IssueAccountAnswer = map[string]any + +// SignInput is what sign takes. +type SignInput struct { + // node-certificate or enrolment + Kind string `json:"kind"` + // the machine, for a node certificate: the caller's own, or the node mesh-enrolment enrols + Node string `json:"node,omitempty"` + // the redeem answer's bytes in base64, for an enrolment + Reply string `json:"reply,omitempty"` + // from mesh-enrolment: the serving key's public half the enrolling node presented + ServingKey string `json:"serving_key,omitempty"` +} + +// SignAnswer is what sign answers. +type SignAnswer = map[string]any + +// EnrolmentTokenInputTunnel is the node's first tunnel, built by mesh-enrolment at issue and carried in the token: the hub's public key, the hub's endpoint, the node's tunnel address, its own tunnel key and the network's range. +type EnrolmentTokenInputTunnel struct { + // the joining node's tunnel address + Address string `json:"address"` + // the hub's endpoint, host:port + HubEndpoint string `json:"hub_endpoint"` + // the hub's tunnel public key + HubKey string `json:"hub_key"` + // the joining machine's own tunnel public key, as given at issue + Key string `json:"key"` + // the private network's range, a prefix + Range string `json:"range"` +} + +// EnrolmentTokenInput is what enrolment-token takes. +type EnrolmentTokenInput struct { + // "true": drop the node's token and its hash + Drop string `json:"drop,omitempty"` + // when the token expires (RFC 3339), as the enrolment's key says + Expires string `json:"expires,omitempty"` + // the node the token is for + Node string `json:"node"` + // "true": answer the token sealed to the operator key + Sealed string `json:"sealed,omitempty"` + // the node's first tunnel, built by mesh-enrolment at issue and carried in the token: the hub's public key, the hub's endpoint, the node's tunnel address, its own tunnel key and the network's range + Tunnel *EnrolmentTokenInputTunnel `json:"tunnel,omitempty"` +} + +// EnrolmentTokenAnswer is what enrolment-token answers. +type EnrolmentTokenAnswer = map[string]any + +// NodeAccountInput is what node-account takes. +type NodeAccountInput struct { + // the digest of every public key the node presented (delivery.KeysDigest) + KeysDigest string `json:"keys_digest,omitempty"` + // the joining node + Node string `json:"node"` + // "true": retire the account minted for this node + Retire string `json:"retire,omitempty"` + // the sealing key's public half the node presented, which the account is sealed to + SealingKey string `json:"sealing_key,omitempty"` +} + +// NodeAccountAnswer is what node-account answers. +type NodeAccountAnswer = map[string]any + +// RotateNodeInput is what rotate-node takes. +type RotateNodeInput struct { + // the id of the hand act recorded for it in mesh-hand-acts + Act string `json:"act"` + // the node whose account rotates + Node string `json:"node"` + // why, in a sentence + Why string `json:"why"` +} + +// RotateNodeAnswer is what rotate-node answers. +type RotateNodeAnswer = map[string]any + +// NodeAccountConfirmInput is what node-account-confirm takes. +type NodeAccountConfirmInput struct { +} + +// NodeAccountConfirmAnswer is what node-account-confirm answers. +type NodeAccountConfirmAnswer = map[string]any + +// AbandonInput is what abandon takes. +type AbandonInput struct { + // the node whose rotation is abandoned + Node string `json:"node"` +} + +// AbandonAnswer is what abandon answers. +type AbandonAnswer = map[string]any + +// RetireInput is what retire takes. +type RetireInput struct { + // the module + Module string `json:"module"` + // the own secret's name + Name string `json:"name"` + // the node + Node string `json:"node"` + // the operator's warrant for this node, module and name + Warrant string `json:"warrant"` +} + +// RetireAnswer is what retire answers. +type RetireAnswer struct { + // the secret is gone + Retired bool `json:"retired"` +} + +// OwnRetiredHolderEvent is the body of the holder's event own-retired. +type OwnRetiredHolderEvent struct { + // the ask's id + Ask string `json:"ask,omitempty"` + // the caller the vault proved + Caller string `json:"caller"` + // the module + Module string `json:"module"` + // the secret's name + Name string `json:"name"` + // the node + Node string `json:"node"` +} diff --git a/go/seats/meshvault/contract_test.go b/go/seats/meshvault/contract_test.go new file mode 100644 index 0000000..56dbe3b --- /dev/null +++ b/go/seats/meshvault/contract_test.go @@ -0,0 +1,70 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +package meshvault + +import ( + "encoding/json" + "reflect" + "regexp" + "testing" +) + +// TestFixtures reads every fixture of seats/mesh-vault/fixtures: each decodes into its type, a field the type does not +// know is dropped (ADR 0608 §6), and it reads back as its wire says; each subject named is the contract's. +func TestFixtures(t *testing.T) { + cases := []struct { + name, subject, given, wire string + decode func([]byte) (any, error) + subjectIs *regexp.Regexp + }{ + {name: "provisioned under the vault's own subjects", subject: "mesh.mod.mesh-vault.event.provisioned", given: "{}", wire: "{}", + decode: func(b []byte) (any, error) { var v map[string]any; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.provisioned$")}, + {name: "rotated under the vault's own subjects", subject: "mesh.mod.mesh-vault.event.rotated", given: "{}", wire: "{}", + decode: func(b []byte) (any, error) { var v map[string]any; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.rotated$")}, + {name: "secret-changed under the vault's own subjects", subject: "mesh.mod.mesh-vault.event.secret-changed", given: "{}", wire: "{}", + decode: func(b []byte) (any, error) { var v map[string]any; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.secret-changed$")}, + {name: "account-hashed under the vault's own subjects", subject: "mesh.mod.mesh-vault.event.account-hashed", given: "{}", wire: "{}", + decode: func(b []byte) (any, error) { var v map[string]any; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.account-hashed$")}, + {name: "own-replaced under the vault's own subjects", subject: "mesh.mod.mesh-vault.event.own-replaced", given: "{}", wire: "{}", + decode: func(b []byte) (any, error) { var v map[string]any; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.own-replaced$")}, + {name: "account-issued under the vault's own subjects", subject: "mesh.mod.mesh-vault.event.account-issued", given: "{}", wire: "{}", + decode: func(b []byte) (any, error) { var v map[string]any; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.account-issued$")}, + {name: "signed under the vault's own subjects", subject: "mesh.mod.mesh-vault.event.signed", given: "{}", wire: "{}", + decode: func(b []byte) (any, error) { var v map[string]any; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.signed$")}, + {name: "rotation-begun under the vault's own subjects", subject: "mesh.mod.mesh-vault.event.rotation-begun", given: "{}", wire: "{}", + decode: func(b []byte) (any, error) { var v map[string]any; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.rotation-begun$")}, + {name: "node-account-ready under the vault's own subjects", subject: "mesh.mod.mesh-vault.event.node-account-ready", given: "{}", wire: "{}", + decode: func(b []byte) (any, error) { var v map[string]any; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.node-account-ready$")}, + {name: "rotation-done under the vault's own subjects", subject: "mesh.mod.mesh-vault.event.rotation-done", given: "{}", wire: "{}", + decode: func(b []byte) (any, error) { var v map[string]any; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.rotation-done$")}, + {name: "own-retired", subject: "mesh.mod.mesh-vault.event.own-retired", given: "{\"ask\":\"a1\",\"caller\":\"mesh-config\",\"module\":\"messenger\",\"name\":\"token\",\"node\":\"ace\"}", wire: "{\"ask\":\"a1\",\"caller\":\"mesh-config\",\"module\":\"messenger\",\"name\":\"token\",\"node\":\"ace\"}", + decode: func(b []byte) (any, error) { var v OwnRetiredHolderEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.own-retired$")}, + {name: "retire on a warrant", subject: "", given: "{\"module\":\"messenger\",\"name\":\"token\",\"node\":\"ace\",\"warrant\":\"w-1\"}", wire: "{\"module\":\"messenger\",\"name\":\"token\",\"node\":\"ace\",\"warrant\":\"w-1\"}", + decode: func(b []byte) (any, error) { var v RetireInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + } + for _, c := range cases { + v, err := c.decode([]byte(c.given)) + if err != nil { + t.Errorf("%s: does not decode: %v", c.name, err) + continue + } + back, err := json.Marshal(v) + if err != nil { + t.Errorf("%s: does not encode: %v", c.name, err) + continue + } + var got, want any + if err := json.Unmarshal(back, &got); err != nil { + t.Fatal(err) + } + if err := json.Unmarshal([]byte(c.wire), &want); err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(got, want) { + t.Errorf("%s: reads back as %s, want %s", c.name, back, c.wire) + } + if c.subjectIs != nil && !c.subjectIs.MatchString(c.subject) { + t.Errorf("%s: subject %q is not the contract's %s", c.name, c.subject, c.subjectIs) + } + } +} diff --git a/go/seats/npmpackageregistry/contract.go b/go/seats/npmpackageregistry/contract.go new file mode 100644 index 0000000..690946c --- /dev/null +++ b/go/seats/npmpackageregistry/contract.go @@ -0,0 +1,87 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// Package npmpackageregistry is the contract of the seat "npm-package-registry", defined whole (seats/npm-package-registry/seat.json): The mesh's npm packages: the npm registry protocol's read side, and publishing over the bus. +package npmpackageregistry + +import ( + "git.novox.be/novox/mesh-contracts/go/parts/registry" +) + +// Seat is the seat's name. +const Seat = "npm-package-registry" + +const ( + VerbPublish = "publish" + VerbPublishPart = "publish-part" + VerbVersions = "versions" + VerbRemove = "remove" +) + +const ( + EventPublished = "published" + EventRefused = "refused" + EventRemoved = "removed" +) + +// Family is where the seat's events are kept. +const ( + Family = "npm-package-registry.events" + FamilyMaxAgeDays = 7 +) + +// SubjectPublished is where published is published. +const SubjectPublished = "mesh.seat.npm-package-registry.event.published" + +// SubjectRefused is where refused is published. +const SubjectRefused = "mesh.seat.npm-package-registry.event.refused" + +// SubjectRemoved is where removed is published. +const SubjectRemoved = "mesh.seat.npm-package-registry.event.removed" + +// Artifact is the part registry's. +type Artifact = registry.Artifact + +// Outcome is the part registry's. +type Outcome = registry.Outcome + +// Part is the part registry's. +type Part = registry.Part + +// PublishAnswer is the part registry's. +type PublishAnswer = registry.PublishAnswer + +// PublishInput is the part registry's. +type PublishInput = registry.PublishInput + +// PublishPartAnswer is the part registry's. +type PublishPartAnswer = registry.PublishPartAnswer + +// PublishPartInput is the part registry's. +type PublishPartInput = registry.PublishPartInput + +// PublishedEvent is the part registry's. +type PublishedEvent = registry.PublishedEvent + +// RefusedEvent is the part registry's. +type RefusedEvent = registry.RefusedEvent + +// RemoveAnswer is the part registry's. +type RemoveAnswer = registry.RemoveAnswer + +// RemoveInput is the part registry's. +type RemoveInput = registry.RemoveInput + +// RemovedEvent is the part registry's. +type RemovedEvent = registry.RemovedEvent + +// VersionsAnswer is the part registry's. +type VersionsAnswer = registry.VersionsAnswer + +// VersionsInput is the part registry's. +type VersionsInput = registry.VersionsInput + +// NpmPackageRegistryForm is the form of the provision npm-package-registry. +type NpmPackageRegistryForm struct { + // the read side's address + URL string `json:"url"` +} diff --git a/go/seats/npmpackageregistry/contract_test.go b/go/seats/npmpackageregistry/contract_test.go new file mode 100644 index 0000000..66b39b2 --- /dev/null +++ b/go/seats/npmpackageregistry/contract_test.go @@ -0,0 +1,62 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +package npmpackageregistry + +import ( + "encoding/json" + "reflect" + "regexp" + "testing" +) + +// TestFixtures reads every fixture of seats/npm-package-registry/fixtures: each decodes into its type, a field the type does not +// know is dropped (ADR 0608 §6), and it reads back as its wire says; each subject named is the contract's. +func TestFixtures(t *testing.T) { + cases := []struct { + name, subject, given, wire string + decode func([]byte) (any, error) + subjectIs *regexp.Regexp + }{ + {name: "published on the seat's subject", subject: "mesh.seat.npm-package-registry.event.published", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v PublishedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.npm-package-registry\\.event\\.published$")}, + {name: "refused on the seat's subject", subject: "mesh.seat.npm-package-registry.event.refused", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v RefusedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.npm-package-registry\\.event\\.refused$")}, + {name: "removed on the seat's subject", subject: "mesh.seat.npm-package-registry.event.removed", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v RemovedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.npm-package-registry\\.event\\.removed$")}, + {name: "publish opens a transfer", subject: "", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v PublishInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "a field the reader does not know is dropped", subject: "", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"later\":{\"x\":1},\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v PublishInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers what it lacks", subject: "", given: "{\"lacks\":[\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"],\"transfer\":\"t1\"}", wire: "{\"lacks\":[\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"],\"transfer\":\"t1\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "a chunk of a part", subject: "", given: "{\"data\":\"aGVsbG8=\",\"last\":true,\"part\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"sequence\":0,\"transfer\":\"t1\"}", wire: "{\"data\":\"aGVsbG8=\",\"last\":true,\"part\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"sequence\":0,\"transfer\":\"t1\"}", + decode: func(b []byte) (any, error) { var v PublishPartInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "the versions held", subject: "", given: "{\"name\":\"mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"version\":\"0.1.19\"}]}", wire: "{\"name\":\"mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"version\":\"0.1.19\"}]}", + decode: func(b []byte) (any, error) { var v VersionsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + } + for _, c := range cases { + v, err := c.decode([]byte(c.given)) + if err != nil { + t.Errorf("%s: does not decode: %v", c.name, err) + continue + } + back, err := json.Marshal(v) + if err != nil { + t.Errorf("%s: does not encode: %v", c.name, err) + continue + } + var got, want any + if err := json.Unmarshal(back, &got); err != nil { + t.Fatal(err) + } + if err := json.Unmarshal([]byte(c.wire), &want); err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(got, want) { + t.Errorf("%s: reads back as %s, want %s", c.name, back, c.wire) + } + if c.subjectIs != nil && !c.subjectIs.MatchString(c.subject) { + t.Errorf("%s: subject %q is not the contract's %s", c.name, c.subject, c.subjectIs) + } + } +} diff --git a/go/seats/ociartifactregistry/contract.go b/go/seats/ociartifactregistry/contract.go new file mode 100644 index 0000000..e602f28 --- /dev/null +++ b/go/seats/ociartifactregistry/contract.go @@ -0,0 +1,153 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// Package ociartifactregistry is the contract of the seat "oci-artifact-registry", defined whole (seats/oci-artifact-registry/seat.json): The mesh's bundles and archives, by digest, in the one artifact store: the OCI distribution protocol's read side. +package ociartifactregistry + +import ( + "git.novox.be/novox/mesh-contracts/go/parts/registry" +) + +// Seat is the seat's name. +const Seat = "oci-artifact-registry" + +const ( + VerbPublish = "publish" + VerbPublishPart = "publish-part" + VerbVersions = "versions" + VerbRemove = "remove" + VerbHold = "hold" + VerbRelease = "release" +) + +const ( + EventPublished = "published" + EventRefused = "refused" + EventRemoved = "removed" + EventHeld = "held" + EventReleased = "released" +) + +// Family is where the seat's events are kept. +const ( + Family = "oci-artifact-registry.events" + FamilyMaxAgeDays = 7 +) + +// SubjectPublished is where published is published. +const SubjectPublished = "mesh.seat.oci-artifact-registry.event.published" + +// SubjectRefused is where refused is published. +const SubjectRefused = "mesh.seat.oci-artifact-registry.event.refused" + +// SubjectRemoved is where removed is published. +const SubjectRemoved = "mesh.seat.oci-artifact-registry.event.removed" + +// SubjectHeld is where held is published. +const SubjectHeld = "mesh.seat.oci-artifact-registry.event.held" + +// SubjectReleased is where released is published. +const SubjectReleased = "mesh.seat.oci-artifact-registry.event.released" + +// Artifact is the part registry's. +type Artifact = registry.Artifact + +// Outcome is the part registry's. +type Outcome = registry.Outcome + +// Part is the part registry's. +type Part = registry.Part + +// PublishAnswer is the part registry's. +type PublishAnswer = registry.PublishAnswer + +// PublishInput is the part registry's. +type PublishInput = registry.PublishInput + +// PublishPartAnswer is the part registry's. +type PublishPartAnswer = registry.PublishPartAnswer + +// PublishPartInput is the part registry's. +type PublishPartInput = registry.PublishPartInput + +// PublishedEvent is the part registry's. +type PublishedEvent = registry.PublishedEvent + +// RefusedEvent is the part registry's. +type RefusedEvent = registry.RefusedEvent + +// RemoveAnswer is the part registry's. +type RemoveAnswer = registry.RemoveAnswer + +// RemoveInput is the part registry's. +type RemoveInput = registry.RemoveInput + +// RemovedEvent is the part registry's. +type RemovedEvent = registry.RemovedEvent + +// VersionsAnswer is the part registry's. +type VersionsAnswer = registry.VersionsAnswer + +// VersionsInput is the part registry's. +type VersionsInput = registry.VersionsInput + +// Hold is the body of held and released. +type Hold struct { + // when, RFC 3339 + At string `json:"at,omitempty"` + // the caller the holder proved + By string `json:"by,omitempty"` + // the digest + Digest string `json:"digest"` + // the module holding the seat + Holder string `json:"holder"` + // the name + Name string `json:"name"` + // why + Reason string `json:"reason,omitempty"` +} + +// HoldInput is what hold takes. +type HoldInput struct { + // the digest + Digest string `json:"digest"` + // the name + Name string `json:"name"` + // which of the sweep's rules keeps it + Reason string `json:"reason"` +} + +// HoldAnswer is what hold answers. +type HoldAnswer struct { + // it is held + Held bool `json:"held"` + // when the hold began, RFC 3339 + Since string `json:"since,omitempty"` +} + +// ReleaseInput is what release takes. +type ReleaseInput struct { + // the digest + Digest string `json:"digest"` + // the name + Name string `json:"name"` + // why it is let go + Reason string `json:"reason"` +} + +// ReleaseAnswer is what release answers. +type ReleaseAnswer struct { + // the hold is gone + Released bool `json:"released"` +} + +// HeldEvent is the body of the event held. +type HeldEvent = Hold + +// ReleasedEvent is the body of the event released. +type ReleasedEvent = Hold + +// ArtifactStoreForm is the form of the provision artifact-store. +type ArtifactStoreForm struct { + // the store's address + URL string `json:"url"` +} diff --git a/go/seats/ociartifactregistry/contract_test.go b/go/seats/ociartifactregistry/contract_test.go new file mode 100644 index 0000000..f8e04e6 --- /dev/null +++ b/go/seats/ociartifactregistry/contract_test.go @@ -0,0 +1,66 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +package ociartifactregistry + +import ( + "encoding/json" + "reflect" + "regexp" + "testing" +) + +// TestFixtures reads every fixture of seats/oci-artifact-registry/fixtures: each decodes into its type, a field the type does not +// know is dropped (ADR 0608 §6), and it reads back as its wire says; each subject named is the contract's. +func TestFixtures(t *testing.T) { + cases := []struct { + name, subject, given, wire string + decode func([]byte) (any, error) + subjectIs *regexp.Regexp + }{ + {name: "published on the seat's subject", subject: "mesh.seat.oci-artifact-registry.event.published", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"distribution\",\"kind\":\"bundle\",\"name\":\"mesh-sdk\",\"reference\":\"oci-artifact-registry/mesh-sdk/lib@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"distribution\",\"kind\":\"bundle\",\"name\":\"mesh-sdk\",\"reference\":\"oci-artifact-registry/mesh-sdk/lib@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v PublishedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.oci-artifact-registry\\.event\\.published$")}, + {name: "refused on the seat's subject", subject: "mesh.seat.oci-artifact-registry.event.refused", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"distribution\",\"kind\":\"bundle\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"oci-artifact-registry/mesh-sdk/lib@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"distribution\",\"kind\":\"bundle\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"oci-artifact-registry/mesh-sdk/lib@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v RefusedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.oci-artifact-registry\\.event\\.refused$")}, + {name: "removed on the seat's subject", subject: "mesh.seat.oci-artifact-registry.event.removed", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"distribution\",\"kind\":\"bundle\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"oci-artifact-registry/mesh-sdk/lib@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"distribution\",\"kind\":\"bundle\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"oci-artifact-registry/mesh-sdk/lib@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v RemovedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.oci-artifact-registry\\.event\\.removed$")}, + {name: "held on the seat's subject", subject: "mesh.seat.oci-artifact-registry.event.held", given: "{\"at\":\"2026-11-04T12:00:00Z\",\"by\":\"mesh-artifact-sweep\",\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"holder\":\"distribution\",\"name\":\"mesh-sdk\",\"reason\":\"kept by the sweep's rule\"}", wire: "{\"at\":\"2026-11-04T12:00:00Z\",\"by\":\"mesh-artifact-sweep\",\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"holder\":\"distribution\",\"name\":\"mesh-sdk\",\"reason\":\"kept by the sweep's rule\"}", + decode: func(b []byte) (any, error) { var v HeldEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.oci-artifact-registry\\.event\\.held$")}, + {name: "released on the seat's subject", subject: "mesh.seat.oci-artifact-registry.event.released", given: "{\"at\":\"2026-11-04T12:00:00Z\",\"by\":\"mesh-artifact-sweep\",\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"holder\":\"distribution\",\"name\":\"mesh-sdk\",\"reason\":\"kept by the sweep's rule\"}", wire: "{\"at\":\"2026-11-04T12:00:00Z\",\"by\":\"mesh-artifact-sweep\",\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"holder\":\"distribution\",\"name\":\"mesh-sdk\",\"reason\":\"kept by the sweep's rule\"}", + decode: func(b []byte) (any, error) { var v ReleasedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.oci-artifact-registry\\.event\\.released$")}, + {name: "publish opens a transfer", subject: "", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"bundle\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"bundle\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v PublishInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "a field the reader does not know is dropped", subject: "", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"bundle\",\"later\":{\"x\":1},\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"bundle\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + decode: func(b []byte) (any, error) { var v PublishInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers what it lacks", subject: "", given: "{\"lacks\":[\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"],\"transfer\":\"t1\"}", wire: "{\"lacks\":[\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"],\"transfer\":\"t1\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "a chunk of a part", subject: "", given: "{\"data\":\"aGVsbG8=\",\"last\":true,\"part\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"sequence\":0,\"transfer\":\"t1\"}", wire: "{\"data\":\"aGVsbG8=\",\"last\":true,\"part\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"sequence\":0,\"transfer\":\"t1\"}", + decode: func(b []byte) (any, error) { var v PublishPartInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "the versions held", subject: "", given: "{\"name\":\"mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"version\":\"0.1.19\"}]}", wire: "{\"name\":\"mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"version\":\"0.1.19\"}]}", + decode: func(b []byte) (any, error) { var v VersionsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + } + for _, c := range cases { + v, err := c.decode([]byte(c.given)) + if err != nil { + t.Errorf("%s: does not decode: %v", c.name, err) + continue + } + back, err := json.Marshal(v) + if err != nil { + t.Errorf("%s: does not encode: %v", c.name, err) + continue + } + var got, want any + if err := json.Unmarshal(back, &got); err != nil { + t.Fatal(err) + } + if err := json.Unmarshal([]byte(c.wire), &want); err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(got, want) { + t.Errorf("%s: reads back as %s, want %s", c.name, back, c.wire) + } + if c.subjectIs != nil && !c.subjectIs.MatchString(c.subject) { + t.Errorf("%s: subject %q is not the contract's %s", c.name, c.subject, c.subjectIs) + } + } +} diff --git a/go/seats/operatorchannel/contract.go b/go/seats/operatorchannel/contract.go new file mode 100644 index 0000000..49fdc1e --- /dev/null +++ b/go/seats/operatorchannel/contract.go @@ -0,0 +1,298 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// Package operatorchannel is the contract of the seat "operator-channel", defined whole (seats/operator-channel/seat.json): Asking a person and answering on a channel (ADR 0259): held by the router, the messenger module, whose manifest declares the seat; written from that seat entry (design 26). +package operatorchannel + +// Seat is the seat's name. +const Seat = "operator-channel" + +const ( + VerbOpen = "open" + VerbHistory = "history" + VerbNotify = "notify" + VerbTell = "tell" + VerbAsks = "asks" +) + +const ( + AcceptAsk = "ask" + AcceptCancel = "cancel" + AcceptCondition = "condition" +) + +const ( + EventDecided = "decided" +) + +// Family is where the seat's events are kept. +const ( + Family = "operator-channel.decided" + FamilyMaxAgeDays = 30 +) + +// SubjectDecided is where decided is published for one caller. +func SubjectDecided(caller string) string { + return "mesh.seat.operator-channel.event.decided." + caller +} + +// AcceptSubjectAsk is where one caller sends ask. +func AcceptSubjectAsk(caller string) string { return "mesh.seat.operator-channel.accept.ask." + caller } + +// AcceptSubjectCancel is where one caller sends cancel. +func AcceptSubjectCancel(caller string) string { + return "mesh.seat.operator-channel.accept.cancel." + caller +} + +// AcceptSubjectCondition is where one caller sends condition. +func AcceptSubjectCondition(caller string) string { + return "mesh.seat.operator-channel.accept.condition." + caller +} + +// The holder's own events, listed beside the seat and published under the holder's subjects (ADR 0620 §2). +const ( + HolderEventRefused = "refused" + HolderEventOffered = "offered" + HolderEventClosed = "closed" +) + +// HolderSubjectRefused is where the holder publishes refused. +func HolderSubjectRefused(holder string) string { return "mesh.mod." + holder + ".event.refused" } + +// HolderSubjectOffered is where the holder publishes offered, kept in the router's restricted stream (design 55 § 11). +func HolderSubjectOffered(holder string) string { return "mesh.mod." + holder + ".event.offered" } + +// HolderSubjectClosed is where the holder publishes closed, kept in the router's restricted stream (design 55 § 11). +func HolderSubjectClosed(holder string) string { return "mesh.mod." + holder + ".event.closed" } + +const ( + RecordAsks = "asks" +) + +// Ask is a type of the contract. +type Ask struct { + // what it is about: a newer ask about it replaces the older + About string `json:"about,omitempty"` + // its secondary words + Details string `json:"details,omitempty"` + // when it ends unanswered, RFC 3339 + Expires string `json:"expires"` + // what happened and what it means + Explanation string `json:"explanation"` + // a few plain words + Headline string `json:"headline"` + // the asker's own id + ID string `json:"id"` + // what the asker then does + OnExpiry string `json:"on-expiry"` + // the answers it offers + Options []Option `json:"options"` + // urgent + Urgent bool `json:"urgent,omitempty"` + // who may answer: operator + Who string `json:"who"` + // the explanation with its values whole + Whole string `json:"whole,omitempty"` + // the details whole + WholeDetails string `json:"whole-details,omitempty"` +} + +// ConditionActionsItem is a type of the contract. +type ConditionActionsItem struct { + Arguments map[string]string `json:"arguments,omitempty"` + // label + Label string `json:"label"` + // level + Level string `json:"level,omitempty"` + // machine + Machine string `json:"machine,omitempty"` + // verb + Verb string `json:"verb"` +} + +// ConditionSubject is a type of the contract. +type ConditionSubject struct { + // id + ID string `json:"id"` + // machine + Machine string `json:"machine,omitempty"` + // scope + Scope string `json:"scope"` +} + +// Condition is a type of the contract. +type Condition struct { + // the answers it offers + Actions []ConditionActionsItem `json:"actions,omitempty"` + // plain words + Explanation string `json:"explanation,omitempty"` + // plain words + Headline string `json:"headline,omitempty"` + // the condition's key + Key string `json:"key"` + // what it needs + Needs string `json:"needs,omitempty"` + // the line said when it is over + Resolved string `json:"resolved,omitempty"` + // urgent or warning + Severity string `json:"severity,omitempty"` + // raised or cleared + State string `json:"state"` + Subject ConditionSubject `json:"subject"` + // one line + Summary string `json:"summary,omitempty"` + // the form's version, 1 + V int64 `json:"v"` +} + +// Option is a type of the contract. +type Option struct { + // the digest of exactly what the asker performs when it is chosen + Binds string `json:"binds,omitempty"` + // what it does, in plain words + Does string `json:"does"` + // the option's id + ID string `json:"id"` + // the button's label + Label string `json:"label"` + // the proof its answer needs + Level string `json:"level"` +} + +// Person is a type of the contract. +type Person struct { + // the name shown + Display string `json:"display,omitempty"` + // the account + Identity string `json:"identity"` + // the channel kind + Kind string `json:"kind"` + // how the router knew + Verified string `json:"verified"` + // the role + Who string `json:"who"` +} + +// Warrant is a type of the contract. +type Warrant struct { + // what it was about + About string `json:"about,omitempty"` + // the ask + Ask string `json:"ask"` + // the digest of the ask as the router took it + AskDigest string `json:"ask-digest,omitempty"` + // its asker + Asker string `json:"asker"` + // when, RFC 3339 + At string `json:"at"` + By *Person `json:"by,omitempty"` + // the module it came through + Channel string `json:"channel,omitempty"` + // its label + Label string `json:"label,omitempty"` + // its level + Level string `json:"level,omitempty"` + // the option chosen + Option string `json:"option,omitempty"` + Outcome string `json:"outcome"` + // the proofs present + Proofs []string `json:"proofs,omitempty"` + // why it ended without a choice, or what refused it + Words string `json:"words,omitempty"` +} + +// OpenInput is what open takes. +type OpenInput struct { +} + +// OpenAnswer is what open answers. +type OpenAnswer = map[string]any + +// HistoryInput is what history takes. +type HistoryInput struct { + // at most this many of each (default 50) + Limit int64 `json:"limit,omitempty"` +} + +// HistoryAnswer is what history answers. +type HistoryAnswer = map[string]any + +// NotifyInput is what notify takes. +type NotifyInput struct { + // it is over + Clear bool `json:"clear,omitempty"` + // one or two plain sentences + Explanation string `json:"explanation,omitempty"` + // plain words + Headline string `json:"headline,omitempty"` + // the message's key + Key string `json:"key,omitempty"` + // the line said when it is over + Resolved string `json:"resolved,omitempty"` + Severity string `json:"severity,omitempty"` + // what it is about + Subject string `json:"subject,omitempty"` + // one line + Summary string `json:"summary,omitempty"` +} + +// NotifyAnswer is what notify answers. +type NotifyAnswer = map[string]any + +// TellInput is what tell takes. +type TellInput struct { + // plain words + Headline string `json:"headline,omitempty"` + // one or two plain lines + Lines []string `json:"lines,omitempty"` + // what it is about + Subject string `json:"subject,omitempty"` +} + +// TellAnswer is what tell answers. +type TellAnswer = map[string]any + +// AsksInput is what asks takes. +type AsksInput struct { +} + +// AsksAnswer is what asks answers. +type AsksAnswer = map[string]any + +// AskAccept is the body of ask. +type AskAccept = Ask + +// CancelAccept is the body of cancel. +type CancelAccept struct { + // the ask's id + ID string `json:"id"` +} + +// ConditionAccept is the body of condition. +type ConditionAccept = Condition + +// DecidedEvent is the body of the event decided. +type DecidedEvent = Warrant + +// OfferedHolderEvent is the body of the holder's event offered. +type OfferedHolderEvent struct { + // its asker + Asker string `json:"asker"` + // the channels it was offered on + Channels []string `json:"channels,omitempty"` + // its headline + Headline string `json:"headline,omitempty"` + // the ask's id + ID string `json:"id"` +} + +// ClosedHolderEvent is the body of the holder's event closed. +type ClosedHolderEvent struct { + // its asker + Asker string `json:"asker"` + How string `json:"how"` + // the ask's id + ID string `json:"id"` +} + +// AsksRecord is one value of the record asks. +type AsksRecord = map[string]any diff --git a/go/seats/operatorchannel/contract_test.go b/go/seats/operatorchannel/contract_test.go new file mode 100644 index 0000000..2a8c9ce --- /dev/null +++ b/go/seats/operatorchannel/contract_test.go @@ -0,0 +1,60 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +package operatorchannel + +import ( + "encoding/json" + "reflect" + "regexp" + "testing" +) + +// TestFixtures reads every fixture of seats/operator-channel/fixtures: each decodes into its type, a field the type does not +// know is dropped (ADR 0608 §6), and it reads back as its wire says; each subject named is the contract's. +func TestFixtures(t *testing.T) { + cases := []struct { + name, subject, given, wire string + decode func([]byte) (any, error) + subjectIs *regexp.Regexp + }{ + {name: "decided for its asker", subject: "mesh.seat.operator-channel.event.decided.mesh-delivery", given: "{\"ask\":\"a1\",\"ask-digest\":\"sha256:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"asker\":\"mesh-delivery\",\"at\":\"2026-11-04T12:00:00Z\",\"by\":{\"identity\":\"1\",\"kind\":\"telegram\",\"verified\":\"user id\",\"who\":\"operator\"},\"channel\":\"telegram\",\"label\":\"Release\",\"level\":\"approve\",\"option\":\"ok\",\"outcome\":\"chosen\"}", wire: "{\"ask\":\"a1\",\"ask-digest\":\"sha256:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"asker\":\"mesh-delivery\",\"at\":\"2026-11-04T12:00:00Z\",\"by\":{\"identity\":\"1\",\"kind\":\"telegram\",\"verified\":\"user id\",\"who\":\"operator\"},\"channel\":\"telegram\",\"label\":\"Release\",\"level\":\"approve\",\"option\":\"ok\",\"outcome\":\"chosen\"}", + decode: func(b []byte) (any, error) { var v DecidedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.operator-channel\\.event\\.decided\\.[A-Za-z0-9_-]+$")}, + {name: "refused under the holder's own subjects", subject: "mesh.mod.messenger.event.refused", given: "{}", wire: "{}", + decode: func(b []byte) (any, error) { var v map[string]any; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.refused$")}, + {name: "offered on the router's restricted stream", subject: "mesh.mod.messenger.event.offered", given: "{\"asker\":\"mesh-delivery\",\"channels\":[\"telegram\"],\"headline\":\"release held\",\"id\":\"a1\"}", wire: "{\"asker\":\"mesh-delivery\",\"channels\":[\"telegram\"],\"headline\":\"release held\",\"id\":\"a1\"}", + decode: func(b []byte) (any, error) { var v OfferedHolderEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.offered$")}, + {name: "closed once per end", subject: "mesh.mod.messenger.event.closed", given: "{\"asker\":\"mesh-delivery\",\"how\":\"answered\",\"id\":\"a1\"}", wire: "{\"asker\":\"mesh-delivery\",\"how\":\"answered\",\"id\":\"a1\"}", + decode: func(b []byte) (any, error) { var v ClosedHolderEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.closed$")}, + {name: "an ask by its asker", subject: "mesh.seat.operator-channel.accept.ask.mesh-delivery", given: "{\"expires\":\"2026-11-05T12:00:00Z\",\"explanation\":\"A delivery waits on your word.\",\"headline\":\"release held\",\"id\":\"a1\",\"on-expiry\":\"the delivery stays held\",\"options\":[{\"binds\":\"sha256:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\",\"does\":\"releases it\",\"id\":\"ok\",\"label\":\"Release\",\"level\":\"approve\"}],\"who\":\"operator\"}", wire: "{\"expires\":\"2026-11-05T12:00:00Z\",\"explanation\":\"A delivery waits on your word.\",\"headline\":\"release held\",\"id\":\"a1\",\"on-expiry\":\"the delivery stays held\",\"options\":[{\"binds\":\"sha256:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\",\"does\":\"releases it\",\"id\":\"ok\",\"label\":\"Release\",\"level\":\"approve\"}],\"who\":\"operator\"}", + decode: func(b []byte) (any, error) { var v AskAccept; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.operator-channel\\.accept\\.ask\\.[A-Za-z0-9_-]+$")}, + {name: "a cancel by its asker", subject: "mesh.seat.operator-channel.accept.cancel.mesh-delivery", given: "{\"id\":\"a1\"}", wire: "{\"id\":\"a1\"}", + decode: func(b []byte) (any, error) { var v CancelAccept; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.operator-channel\\.accept\\.cancel\\.[A-Za-z0-9_-]+$")}, + {name: "a condition by its publisher", subject: "mesh.seat.operator-channel.accept.condition.mesh-watcher", given: "{\"key\":\"backup.ace.failed\",\"severity\":\"warning\",\"state\":\"raised\",\"subject\":{\"id\":\"ace\",\"scope\":\"node\"},\"v\":1}", wire: "{\"key\":\"backup.ace.failed\",\"severity\":\"warning\",\"state\":\"raised\",\"subject\":{\"id\":\"ace\",\"scope\":\"node\"},\"v\":1}", + decode: func(b []byte) (any, error) { var v ConditionAccept; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.operator-channel\\.accept\\.condition\\.[A-Za-z0-9_-]+$")}, + } + for _, c := range cases { + v, err := c.decode([]byte(c.given)) + if err != nil { + t.Errorf("%s: does not decode: %v", c.name, err) + continue + } + back, err := json.Marshal(v) + if err != nil { + t.Errorf("%s: does not encode: %v", c.name, err) + continue + } + var got, want any + if err := json.Unmarshal(back, &got); err != nil { + t.Fatal(err) + } + if err := json.Unmarshal([]byte(c.wire), &want); err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(got, want) { + t.Errorf("%s: reads back as %s, want %s", c.name, back, c.wire) + } + if c.subjectIs != nil && !c.subjectIs.MatchString(c.subject) { + t.Errorf("%s: subject %q is not the contract's %s", c.name, c.subject, c.subjectIs) + } + } +} diff --git a/go/seats/seats.go b/go/seats/seats.go new file mode 100644 index 0000000..fb55e4e --- /dev/null +++ b/go/seats/seats.go @@ -0,0 +1,746 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// Package seats is the mesh's seat list, generated from every seat's definition (design 26 *The seat set has one +// source*): what each seat is, where it is held, the provision it delivers, its verbs with their inputs, what it +// accepts and emits, what it receives and the paths it owns. mesh-sdk's runtime reads it; a seat its holder declares +// itself has a name here and no entry in the list. +package seats + +// Seat is one role the mesh defines. +type Seat struct { + Name string + Scope string + Grain string + Replicated bool + Delivers string + Accepts []string + Emits []string + PulledByKind bool + Yields bool + Serves []Verb + Receives []Receivable + Paths []Path + HeldByTheEngine bool + Decision string +} + +// Verb is one verb a seat serves: its input and answer as JSON Schema. +type Verb struct { + Name string + Description string + Input map[string]any + Output map[string]any + Optional bool + Replaces []string +} + +// Receivable is one kind of contribution a seat receives. +type Receivable struct { + Kind string + Comment string + Dirs bool + Shape *Shape + Offered bool +} + +// Shape is a kind given as data. Its checks are the runtime's. +type Shape struct { + Places []PlaceField + Order string + Examples []map[string]any + Text bool +} + +// PlaceField is one field a holder places by, and the values it takes. +type PlaceField struct { + Field string + Values []string +} + +// Path is one path on its machine a seat's holder owns. +type Path struct { + Path string + StepsBackFor string +} + +// The name of every seat defined. +const ( + MeshStore = "mesh-store" + MeshBroker = "mesh-broker" + MeshVault = "mesh-vault" + MeshConfig = "mesh-config" + MeshProvisioner = "mesh-provisioner" + MeshArtifactStore = "mesh-artifact-store" + MeshCatalog = "mesh-catalog" + MeshDelivery = "mesh-delivery" + MeshPlacement = "mesh-placement" + MeshDeliveryChecker = "mesh-delivery-checker" + MeshConditions = "mesh-conditions" + MeshWatchdogs = "mesh-watchdogs" + MeshSelfCheck = "mesh-self-check" + MeshHealers = "mesh-healers" + MeshWants = "mesh-wants" + MeshHandActs = "mesh-hand-acts" + MeshEnrolment = "mesh-enrolment" + MeshArtifactSweep = "mesh-artifact-sweep" + OperatorChannel = "operator-channel" + NpmPackageRegistry = "npm-package-registry" + GoPackageRegistry = "go-package-registry" + ContainerImageRegistry = "container-image-registry" + OciArtifactRegistry = "oci-artifact-registry" + Git = "git" + NodeBuildGo = "node-build-go" + NodeBuildNode = "node-build-node" + NodeBuildImage = "node-build-image" + MeshDnsResolver = "mesh-dns-resolver" + NodeHostname = "node-hostname" + NodeIntrusionPrevention = "node-intrusion-prevention" + NodePacketFilter = "node-packet-filter" + NodeServiceManager = "node-service-manager" + NodePackageManager = "node-package-manager" + NodeContainerRuntime = "node-container-runtime" + NodeEnvironment = "node-environment" + NodeProvisioner = "node-provisioner" + NodeLoginShell = "node-login-shell" + NodePower = "node-power" + NodeHotkeys = "node-hotkeys" + NodeMessageBus = "node-message-bus" + NodeBackup = "node-backup" + ThePrivateNetwork = "the-private-network" + NodeUplink = "node-uplink" + NodeResolver = "node-resolver" + NodeNfsServer = "node-nfs-server" + NodeMounts = "node-mounts" + NodeReads = "node-reads" + NodeFiles = "node-files" + NodeEngine = "node-engine" + NodeLoginManager = "node-login-manager" + NodeDisplayServer = "node-display-server" + NodeDisplaySession = "node-display-session" + NodeTerminalEmulator = "node-terminal-emulator" + NodeLauncher = "node-launcher" + NodeNotifier = "node-notifier" + NodeLockScreen = "node-lock-screen" + NodeClipboard = "node-clipboard" + NodeBar = "node-bar" + NodeCompositor = "node-compositor" + NodeSecretService = "node-secret-service" +) + +// Names is every seat defined, in reading order, the ones their holders declare included. +func Names() []string { + return []string{MeshStore, MeshBroker, MeshVault, MeshConfig, MeshProvisioner, MeshArtifactStore, MeshCatalog, MeshDelivery, MeshPlacement, MeshDeliveryChecker, MeshConditions, MeshWatchdogs, MeshSelfCheck, MeshHealers, MeshWants, MeshHandActs, MeshEnrolment, MeshArtifactSweep, OperatorChannel, NpmPackageRegistry, GoPackageRegistry, ContainerImageRegistry, OciArtifactRegistry, Git, NodeBuildGo, NodeBuildNode, NodeBuildImage, MeshDnsResolver, NodeHostname, NodeIntrusionPrevention, NodePacketFilter, NodeServiceManager, NodePackageManager, NodeContainerRuntime, NodeEnvironment, NodeProvisioner, NodeLoginShell, NodePower, NodeHotkeys, NodeMessageBus, NodeBackup, ThePrivateNetwork, NodeUplink, NodeResolver, NodeNfsServer, NodeMounts, NodeReads, NodeFiles, NodeEngine, NodeLoginManager, NodeDisplayServer, NodeDisplaySession, NodeTerminalEmulator, NodeLauncher, NodeNotifier, NodeLockScreen, NodeClipboard, NodeBar, NodeCompositor, NodeSecretService} +} + +// List is the seat list, in reading order: a new copy each call. +func List() []Seat { + return []Seat{ + {Name: MeshStore, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0079", Delivers: "postgres-database", + Serves: []Verb{ + {Name: "databases", Description: "Every database the store holds, with its on-disk size.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}, Replaces: []string{"psql -l"}}, + {Name: "query", Description: "One read-only statement against one database the store holds.", + Input: map[string]any{"properties": map[string]any{"database": map[string]any{"description": "the database to query", "type": "string"}, "sql": map[string]any{"description": "the read-only statement", "type": "string"}}, "required": []string{"database", "sql"}, "type": "object"}, Replaces: []string{"psql"}}, + }}, + {Name: MeshBroker, Scope: "mesh", Grain: "whole", Decision: "novox/hq ADR 0079; novox/hq ADR 0595", Delivers: "mesh-bus", Emits: []string{"created", "refused", "drifted", "drift-cleared", "full", "full-cleared", "orphaned", "recreated", "dropped"}, + Serves: []Verb{ + {Name: "list", Description: "Every entry the bus module created, its template, its settings and its fill against its cap.", + Input: map[string]any{"properties": map[string]any{"module": map[string]any{"description": "one module (optional)", "type": "string"}}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"entries": map[string]any{"description": "every entry", "items": map[string]any{"description": "one entry as the bus holds it", "properties": map[string]any{"bus-name": map[string]any{"description": "its name on the bus, _", "type": "string"}, "configuration": map[string]any{"description": "its own configuration, where no template fits", "type": "object"}, "fill": map[string]any{"properties": map[string]any{"bytes": map[string]any{"description": "bytes held", "type": "integer"}, "cap": map[string]any{"description": "its cap in bytes", "type": "integer"}, "count": map[string]any{"description": "messages, keys or objects held", "type": "integer"}}, "required": []string{"count", "bytes", "cap"}, "type": "object"}, "local-name": map[string]any{"description": "its local name in the module's manifest", "type": "string"}, "module": map[string]any{"description": "the module asking it", "type": "string"}, "options": map[string]any{"description": "the template's options the module set, within their bounds", "type": "object"}, "settings": map[string]any{"description": "the settings the bus holds", "type": "object"}, "storage-type": map[string]any{"description": "how the bus keeps it", "enum": []string{"stream", "key-value", "object-store", "ledger"}, "type": "string"}, "template": map[string]any{"description": "its template; empty for a configuration of its own", "enum": []string{"state", "events", "work-queue", "log", "objects", "ledger", ""}, "type": "string"}}, "required": []string{"module", "local-name", "storage-type", "bus-name"}, "type": "object"}, "type": "array"}}, "required": []string{"entries"}, "type": "object"}}, + {Name: "show", Description: "One entry, its template, settings and fill.", + Input: map[string]any{"properties": map[string]any{"local-name": map[string]any{"description": "the entry's local name", "type": "string"}, "module": map[string]any{"description": "the module", "type": "string"}}, "required": []string{"module", "local-name"}, "type": "object"}, + Output: map[string]any{"description": "one entry as the bus holds it", "properties": map[string]any{"bus-name": map[string]any{"description": "its name on the bus, _", "type": "string"}, "configuration": map[string]any{"description": "its own configuration, where no template fits", "type": "object"}, "fill": map[string]any{"properties": map[string]any{"bytes": map[string]any{"description": "bytes held", "type": "integer"}, "cap": map[string]any{"description": "its cap in bytes", "type": "integer"}, "count": map[string]any{"description": "messages, keys or objects held", "type": "integer"}}, "required": []string{"count", "bytes", "cap"}, "type": "object"}, "local-name": map[string]any{"description": "its local name in the module's manifest", "type": "string"}, "module": map[string]any{"description": "the module asking it", "type": "string"}, "options": map[string]any{"description": "the template's options the module set, within their bounds", "type": "object"}, "settings": map[string]any{"description": "the settings the bus holds", "type": "object"}, "storage-type": map[string]any{"description": "how the bus keeps it", "enum": []string{"stream", "key-value", "object-store", "ledger"}, "type": "string"}, "template": map[string]any{"description": "its template; empty for a configuration of its own", "enum": []string{"state", "events", "work-queue", "log", "objects", "ledger", ""}, "type": "string"}}, "required": []string{"module", "local-name", "storage-type", "bus-name"}, "type": "object"}}, + {Name: "check", Description: "Compare what the bus holds with what was asked, entry by entry; a difference that only grows is said as such.", + Input: map[string]any{"properties": map[string]any{"module": map[string]any{"description": "one module (optional)", "type": "string"}}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"differences": map[string]any{"description": "every difference", "items": map[string]any{"properties": map[string]any{"asked": map[string]any{"description": "asked", "type": "object"}, "grows": map[string]any{"description": "the difference only grows: apply may act on it", "type": "boolean"}, "held": map[string]any{"description": "held", "type": "object"}, "local-name": map[string]any{"description": "the entry", "type": "string"}, "module": map[string]any{"description": "the module", "type": "string"}}, "required": []string{"module", "local-name"}, "type": "object"}, "type": "array"}}, "required": []string{"differences"}, "type": "object"}}, + {Name: "orphans", Description: "Entries the bus holds that no manifest asks for; never one whose manifest the judge refused or outgrew, nor one of the foundation's old sections.", + Input: map[string]any{"description": "no arguments", "properties": map[string]any{}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"entries": map[string]any{"description": "every orphan", "items": map[string]any{"description": "one entry as the bus holds it", "properties": map[string]any{"bus-name": map[string]any{"description": "its name on the bus, _", "type": "string"}, "configuration": map[string]any{"description": "its own configuration, where no template fits", "type": "object"}, "fill": map[string]any{"properties": map[string]any{"bytes": map[string]any{"description": "bytes held", "type": "integer"}, "cap": map[string]any{"description": "its cap in bytes", "type": "integer"}, "count": map[string]any{"description": "messages, keys or objects held", "type": "integer"}}, "required": []string{"count", "bytes", "cap"}, "type": "object"}, "local-name": map[string]any{"description": "its local name in the module's manifest", "type": "string"}, "module": map[string]any{"description": "the module asking it", "type": "string"}, "options": map[string]any{"description": "the template's options the module set, within their bounds", "type": "object"}, "settings": map[string]any{"description": "the settings the bus holds", "type": "object"}, "storage-type": map[string]any{"description": "how the bus keeps it", "enum": []string{"stream", "key-value", "object-store", "ledger"}, "type": "string"}, "template": map[string]any{"description": "its template; empty for a configuration of its own", "enum": []string{"state", "events", "work-queue", "log", "objects", "ledger", ""}, "type": "string"}}, "required": []string{"module", "local-name", "storage-type", "bus-name"}, "type": "object"}, "type": "array"}}, "required": []string{"entries"}, "type": "object"}}, + {Name: "create", Description: "Create one entry now.", + Input: map[string]any{"description": "one piece of bus state as a manifest asks it", "properties": map[string]any{"configuration": map[string]any{"description": "its own configuration, where no template fits", "type": "object"}, "local-name": map[string]any{"description": "its local name in the module's manifest", "type": "string"}, "module": map[string]any{"description": "the module asking it", "type": "string"}, "options": map[string]any{"description": "the template's options the module set, within their bounds", "type": "object"}, "storage-type": map[string]any{"description": "how the bus keeps it", "enum": []string{"stream", "key-value", "object-store", "ledger"}, "type": "string"}, "template": map[string]any{"description": "its template; empty for a configuration of its own", "enum": []string{"state", "events", "work-queue", "log", "objects", "ledger", ""}, "type": "string"}}, "required": []string{"module", "local-name", "storage-type"}, "type": "object"}, + Output: map[string]any{"description": "one entry as the bus holds it", "properties": map[string]any{"bus-name": map[string]any{"description": "its name on the bus, _", "type": "string"}, "configuration": map[string]any{"description": "its own configuration, where no template fits", "type": "object"}, "fill": map[string]any{"properties": map[string]any{"bytes": map[string]any{"description": "bytes held", "type": "integer"}, "cap": map[string]any{"description": "its cap in bytes", "type": "integer"}, "count": map[string]any{"description": "messages, keys or objects held", "type": "integer"}}, "required": []string{"count", "bytes", "cap"}, "type": "object"}, "local-name": map[string]any{"description": "its local name in the module's manifest", "type": "string"}, "module": map[string]any{"description": "the module asking it", "type": "string"}, "options": map[string]any{"description": "the template's options the module set, within their bounds", "type": "object"}, "settings": map[string]any{"description": "the settings the bus holds", "type": "object"}, "storage-type": map[string]any{"description": "how the bus keeps it", "enum": []string{"stream", "key-value", "object-store", "ledger"}, "type": "string"}, "template": map[string]any{"description": "its template; empty for a configuration of its own", "enum": []string{"state", "events", "work-queue", "log", "objects", "ledger", ""}, "type": "string"}}, "required": []string{"module", "local-name", "storage-type", "bus-name"}, "type": "object"}}, + {Name: "apply", Description: "Apply a difference that only grows: a larger cap, a longer age.", + Input: map[string]any{"properties": map[string]any{"local-name": map[string]any{"description": "the entry's local name", "type": "string"}, "module": map[string]any{"description": "the module", "type": "string"}}, "required": []string{"module", "local-name"}, "type": "object"}, + Output: map[string]any{"description": "one entry as the bus holds it", "properties": map[string]any{"bus-name": map[string]any{"description": "its name on the bus, _", "type": "string"}, "configuration": map[string]any{"description": "its own configuration, where no template fits", "type": "object"}, "fill": map[string]any{"properties": map[string]any{"bytes": map[string]any{"description": "bytes held", "type": "integer"}, "cap": map[string]any{"description": "its cap in bytes", "type": "integer"}, "count": map[string]any{"description": "messages, keys or objects held", "type": "integer"}}, "required": []string{"count", "bytes", "cap"}, "type": "object"}, "local-name": map[string]any{"description": "its local name in the module's manifest", "type": "string"}, "module": map[string]any{"description": "the module asking it", "type": "string"}, "options": map[string]any{"description": "the template's options the module set, within their bounds", "type": "object"}, "settings": map[string]any{"description": "the settings the bus holds", "type": "object"}, "storage-type": map[string]any{"description": "how the bus keeps it", "enum": []string{"stream", "key-value", "object-store", "ledger"}, "type": "string"}, "template": map[string]any{"description": "its template; empty for a configuration of its own", "enum": []string{"state", "events", "work-queue", "log", "objects", "ledger", ""}, "type": "string"}}, "required": []string{"module", "local-name", "storage-type", "bus-name"}, "type": "object"}}, + {Name: "recreate", Description: "Rebuild an entry whose settings differ in a way that cannot grow, from its data where the storage type allows, after a stream snapshot.", + Input: map[string]any{"properties": map[string]any{"local-name": map[string]any{"description": "the entry's local name", "type": "string"}, "module": map[string]any{"description": "the module", "type": "string"}, "warrant": map[string]any{"description": "the operator's warrant, as the operator channel decided it (ADR 0259 §6)", "type": "string"}, "why": map[string]any{"description": "why, kept in the record", "type": "string"}}, "required": []string{"module", "local-name", "warrant", "why"}, "type": "object"}, + Output: map[string]any{"description": "one entry as the bus holds it", "properties": map[string]any{"bus-name": map[string]any{"description": "its name on the bus, _", "type": "string"}, "configuration": map[string]any{"description": "its own configuration, where no template fits", "type": "object"}, "fill": map[string]any{"properties": map[string]any{"bytes": map[string]any{"description": "bytes held", "type": "integer"}, "cap": map[string]any{"description": "its cap in bytes", "type": "integer"}, "count": map[string]any{"description": "messages, keys or objects held", "type": "integer"}}, "required": []string{"count", "bytes", "cap"}, "type": "object"}, "local-name": map[string]any{"description": "its local name in the module's manifest", "type": "string"}, "module": map[string]any{"description": "the module asking it", "type": "string"}, "options": map[string]any{"description": "the template's options the module set, within their bounds", "type": "object"}, "settings": map[string]any{"description": "the settings the bus holds", "type": "object"}, "storage-type": map[string]any{"description": "how the bus keeps it", "enum": []string{"stream", "key-value", "object-store", "ledger"}, "type": "string"}, "template": map[string]any{"description": "its template; empty for a configuration of its own", "enum": []string{"state", "events", "work-queue", "log", "objects", "ledger", ""}, "type": "string"}}, "required": []string{"module", "local-name", "storage-type", "bus-name"}, "type": "object"}}, + {Name: "drop", Description: "Remove one orphan, after a stream snapshot.", + Input: map[string]any{"properties": map[string]any{"local-name": map[string]any{"description": "the entry's local name", "type": "string"}, "module": map[string]any{"description": "the module", "type": "string"}, "warrant": map[string]any{"description": "the operator's warrant, as the operator channel decided it (ADR 0259 §6)", "type": "string"}, "why": map[string]any{"description": "why, kept in the record", "type": "string"}}, "required": []string{"module", "local-name", "warrant", "why"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"dropped": map[string]any{"description": "it is gone", "type": "boolean"}, "snapshot": map[string]any{"description": "the snapshot taken first", "type": "string"}}, "required": []string{"dropped"}, "type": "object"}}, + }}, + {Name: MeshVault, Scope: "mesh", Grain: "whole", Decision: "novox/hq ADR 0161", Delivers: "secret", + Serves: []Verb{ + {Name: "get", Description: "One secret, sealed to the public key the asker sends (the sealed box of ADR 0206), with its generation; answered only to an asker the vault allows, as the bus proved it. Never the value in the clear, and never to a private key.", Optional: true, + Input: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the secret's name", "type": "string"}, "public_key": map[string]any{"description": "the asker's X25519 public key as SPKI PEM — never a private key", "type": "string"}}, "required": []string{"name", "public_key"}, "type": "object"}, + Output: map[string]any{"description": "the holder's answer", "type": "object"}}, + {Name: "secret-ask", Description: "Ask the operator for a module's own secret at a desk, from the controller or a caller the vault's manifest names, named as the bus proved it (novox/hq ADR 0563 §8): the ask is recorded in the vault's store and bounded before the prompt opens, and what is typed is sealed to a key the vault made for the call and opens there alone.", Optional: true, + Input: map[string]any{"properties": map[string]any{"asked_by": map[string]any{"description": "who asked, as the bus named its caller", "type": "string"}, "call": map[string]any{"description": "the second step: the call the first step answered", "type": "string"}, "desk": map[string]any{"description": "the machine whose prompt asks", "type": "string"}, "module": map[string]any{"description": "the module", "type": "string"}, "name": map[string]any{"description": "the secret's name in the module", "type": "string"}, "node": map[string]any{"description": "the machine the secret is for", "type": "string"}, "outcome": map[string]any{"description": "instead of sealed: how the prompt ended", "type": "string"}, "sealed": map[string]any{"description": "the second step: the value sealed to the call's key — never the value", "type": "string"}}, "type": "object"}, + Output: map[string]any{"description": "the holder's answer", "type": "object"}}, + {Name: "issued", Description: "Take the credential a provider's software issued for a provision, from the controller alone, which asks the provider's tool with a key the vault made for the call; kept as the provision's one credential, or, when the tool answers a value per holder named, each as that holder's own; the same value again writes nothing.", Optional: true, + Input: map[string]any{"properties": map[string]any{"call": map[string]any{"description": "the second step: the call the first step answered", "type": "string"}, "holders": map[string]any{"description": "the provision's holders from that provider, each {node, module}: its tool may answer a value for each, kept as that holder's own and handed to it alone", "items": map[string]any{"properties": map[string]any{"module": map[string]any{"description": "the consuming module", "type": "string"}, "node": map[string]any{"description": "the holder's machine", "type": "string"}}, "type": "object"}, "type": "array"}, "module": map[string]any{"description": "the provider's module", "type": "string"}, "provider": map[string]any{"description": "the provider's machine", "type": "string"}, "provision": map[string]any{"description": "the provision", "type": "string"}, "sealed": map[string]any{"description": "the second step: the value sealed to the call's key — never the value", "type": "string"}}, "type": "object"}, + Output: map[string]any{"description": "the holder's answer", "type": "object"}}, + {Name: "rotate", Description: "Make a secret anew. Refused for a value a provider's software issued and for an accepted credential. Never answers the value.", Optional: true, + Input: map[string]any{"properties": map[string]any{"by": map[string]any{"description": "who asked, when the controller carries the act", "type": "string"}, "module": map[string]any{"description": "the module", "type": "string"}, "name": map[string]any{"description": "the secret's name in the module", "type": "string"}, "node": map[string]any{"description": "the machine, for a module's own secret", "type": "string"}, "provider": map[string]any{"description": "the provider's machine", "type": "string"}, "provision": map[string]any{"description": "the provision", "type": "string"}}, "type": "object"}, + Output: map[string]any{"description": "the holder's answer", "type": "object"}}, + {Name: "move-in", Description: "Take one value of the controller's store in, as it is, from the node-engine of a machine it was sealed to and no other caller: name the row, its origin and generation and get a call and a key made for it, then send the call, the value sealed to that key and a key to read back to. Never replaces a value the vault holds; answers what it kept, read back sealed to that key.", Optional: true, + Input: map[string]any{"properties": map[string]any{"call": map[string]any{"description": "the second step: the call the first step answered", "type": "string"}, "consumer": map[string]any{"description": "the consumer's machine", "type": "string"}, "consumer_module": map[string]any{"description": "the consuming module", "type": "string"}, "generation": map[string]any{"description": "the controller's generation for the value", "type": "string"}, "local": map[string]any{"description": "the credential's local name, when it has one", "type": "string"}, "made_at": map[string]any{"description": "when it was made (RFC 3339)", "type": "string"}, "module": map[string]any{"description": "its module", "type": "string"}, "name": map[string]any{"description": "its name in the module", "type": "string"}, "node": map[string]any{"description": "a module's own secret: its machine", "type": "string"}, "origin": map[string]any{"description": "made, accepted or issued, as the controller's store says", "type": "string"}, "provider": map[string]any{"description": "a pair credential: the provider's machine", "type": "string"}, "provision": map[string]any{"description": "the provision", "type": "string"}, "read_back_to": map[string]any{"description": "the second step: a raw X25519 public key the read-back is sealed to", "type": "string"}, "sealed": map[string]any{"description": "the second step: the value sealed to the call's key — never the value", "type": "string"}}, "type": "object"}, + Output: map[string]any{"description": "the holder's answer", "type": "object"}}, + {Name: "node-key", Description: "State this machine's sealing key to the vault, in its own name, from the node-engine of the machine alone: at its start and whenever the key changes. A first or changed key is recorded and the machine's core secrets are said changed; the same key again changes nothing.", Optional: true, + Input: map[string]any{"properties": map[string]any{"key": map[string]any{"description": "the machine's sealing key, a raw X25519 public key in base64", "type": "string"}}, "type": "object"}, + Output: map[string]any{"description": "the holder's answer", "type": "object"}}, + {Name: "own", Description: "Answer the node-engine of one machine, about its own machine alone (as the bus proved the caller, never an argument), its modules' own secrets and the pair credentials it consumes or provides that it names, each sealed to the key it stated with node-key. A credential the vault does not hold is named missing; never a value in the clear.", Optional: true, + Input: map[string]any{"properties": map[string]any{"credentials": map[string]any{"description": "the pair credentials the machine's composition reads, each {role: consumer|provider, provision, consumer, consumer_module, provider, local}", "items": map[string]any{"type": "object"}, "type": "array"}}, "type": "object"}, + Output: map[string]any{"description": "the holder's answer", "type": "object"}}, + {Name: "issue-account", Description: "Mint one bus account the grants part wants, now (novox/hq ADR 0561 §9): only while the controller's lease is handed away, never a node's account or the controller's, never anew for one the vault holds a value or an adopted hash for. Never the value.", Optional: true, + Input: map[string]any{"properties": map[string]any{"user": map[string]any{"description": "the bus user, e.g. ace.mesh-build-go", "type": "string"}}, "required": []string{"user"}, "type": "object"}, + Output: map[string]any{"description": "the holder's answer", "type": "object"}}, + {Name: "sign", Description: "Sign with the vault's key or authority (novox/hq ADR 0550 §2): kind node-certificate signs the certificate of a machine's internal name, asked by that machine's node-engine for the serving key its record states, built from bus state alone, or by mesh-enrolment for a node it enrols, for the serving key the node presented at redeem (ADR 0587 §3); kind enrolment signs a redeem answer under its own context, for mesh-enrolment alone. Answers the certificate or the signature and the signer's fingerprint, and says signed; never a key.", Optional: true, + Input: map[string]any{"properties": map[string]any{"kind": map[string]any{"description": "node-certificate or enrolment", "type": "string"}, "node": map[string]any{"description": "the machine, for a node certificate: the caller's own, or the node mesh-enrolment enrols", "type": "string"}, "reply": map[string]any{"description": "the redeem answer's bytes in base64, for an enrolment", "type": "string"}, "serving_key": map[string]any{"description": "from mesh-enrolment: the serving key's public half the enrolling node presented", "type": "string"}}, "required": []string{"kind"}, "type": "object"}, + Output: map[string]any{"description": "the holder's answer", "type": "object"}}, + {Name: "enrolment-token", Description: "Make a one-time token for a node mesh-enrolment issues on the operator's warrant: its secret kept with its copy sealed to the operator key and its hash written as the bus user enrol.. Answers only what the joining machine must trust (the bus's address, the bus certificate's fingerprint, the vault's public signing key), never the token; with sealed, the token sealed to the operator key, for tokens to relay; with drop, the token and its hash dropped, at the enrolment's end. Asked by mesh-enrolment alone, only from the lease write. The token carries the first tunnel mesh-enrolment built at issue (ADR 0587 §3, insight of 2026-11-02).", Optional: true, + Input: map[string]any{"properties": map[string]any{"drop": map[string]any{"description": "\"true\": drop the node's token and its hash", "enum": []string{"true", "false"}, "type": "string"}, "expires": map[string]any{"description": "when the token expires (RFC 3339), as the enrolment's key says", "type": "string"}, "node": map[string]any{"description": "the node the token is for", "type": "string"}, "sealed": map[string]any{"description": "\"true\": answer the token sealed to the operator key", "enum": []string{"true", "false"}, "type": "string"}, "tunnel": map[string]any{"additionalProperties": false, "description": "the node's first tunnel, built by mesh-enrolment at issue and carried in the token: the hub's public key, the hub's endpoint, the node's tunnel address, its own tunnel key and the network's range", "properties": map[string]any{"address": map[string]any{"description": "the joining node's tunnel address", "type": "string"}, "hub_endpoint": map[string]any{"description": "the hub's endpoint, host:port", "type": "string"}, "hub_key": map[string]any{"description": "the hub's tunnel public key", "type": "string"}, "key": map[string]any{"description": "the joining machine's own tunnel public key, as given at issue", "type": "string"}, "range": map[string]any{"description": "the private network's range, a prefix", "type": "string"}}, "required": []string{"address", "hub_endpoint", "hub_key", "key", "range"}, "type": "object"}}, "required": []string{"node"}, "type": "object"}, + Output: map[string]any{"description": "the holder's answer", "type": "object"}}, + {Name: "node-account", Description: "Mint a joining node's bus account node., sealed to the sealing key it presented, and write its hash; asked again for the same node and keys, answers the account it already minted; with retire, the account it minted for a revoked enrolment retired. Writes the node's node-logins key naming node.. Asked by mesh-enrolment alone. Never the value in the clear.", Optional: true, + Input: map[string]any{"properties": map[string]any{"keys_digest": map[string]any{"description": "the digest of every public key the node presented (delivery.KeysDigest)", "type": "string"}, "node": map[string]any{"description": "the joining node", "type": "string"}, "retire": map[string]any{"description": "\"true\": retire the account minted for this node", "enum": []string{"true", "false"}, "type": "string"}, "sealing_key": map[string]any{"description": "the sealing key's public half the node presented, which the account is sealed to", "type": "string"}}, "required": []string{"node"}, "type": "object"}, + Output: map[string]any{"description": "the holder's answer", "type": "object"}}, + {Name: "rotate-node", Description: "Begin a node's account rotation to its other login: answered only for a call carrying a hand act recorded through mesh-hand-acts, which the vault reads back by its id. Makes the other login's value sealed to that node, writes it rotating in node-logins and says rotation-begun; says node-account-ready once the bus node's have shows a list holding both logins. One node at a time across the mesh, the bus node last: a call while a rotation runs waits until it is done.", Optional: true, + Input: map[string]any{"properties": map[string]any{"act": map[string]any{"description": "the id of the hand act recorded for it in mesh-hand-acts", "type": "string"}, "node": map[string]any{"description": "the node whose account rotates", "type": "string"}, "why": map[string]any{"description": "why, in a sentence", "type": "string"}}, "required": []string{"node", "why", "act"}, "type": "object"}, + Output: map[string]any{"description": "the holder's answer", "type": "object"}}, + {Name: "node-account-confirm", Description: "Confirm a node's switch to its new login: asked by the node-engine dialled as that login, the runtime's proof of the caller being the confirmation. The old login's hash is then removed, and rotation-done said once the bus node's have shows the list without it.", Optional: true, + Input: map[string]any{"properties": map[string]any{}, "type": "object"}, + Output: map[string]any{"description": "the holder's answer", "type": "object"}}, + {Name: "abandon", Description: "Abandon a node's rotation before its old login is retired: the new login and its value dropped, the old one kept; a node that switched switches back first.", Optional: true, + Input: map[string]any{"properties": map[string]any{"node": map[string]any{"description": "the node whose rotation is abandoned", "type": "string"}}, "required": []string{"node"}, "type": "object"}, + Output: map[string]any{"description": "the holder's answer", "type": "object"}}, + {Name: "retire", Description: "Retire one module's own secret, by node, module and name, on the operator's warrant bound to exactly those three (design 32 *A value no longer read*). Emits own-retired.", Optional: true, + Input: map[string]any{"properties": map[string]any{"module": map[string]any{"description": "the module", "type": "string"}, "name": map[string]any{"description": "the own secret's name", "type": "string"}, "node": map[string]any{"description": "the node", "type": "string"}, "warrant": map[string]any{"description": "the operator's warrant for this node, module and name", "type": "string"}}, "required": []string{"node", "module", "name", "warrant"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"retired": map[string]any{"description": "the secret is gone", "type": "boolean"}}, "required": []string{"retired"}, "type": "object"}}, + }}, + {Name: MeshConfig, Scope: "mesh", Grain: "whole", Decision: "novox/hq ADR 0348, ADR 0565", + Serves: []Verb{ + {Name: "config", Description: "Set, clear, list or read the history of config values: mesh config or node config for a predefined key, or a module's own value on one node, each set with why, validated, and naming each module on each node whose value moves.", Optional: true, + Input: map[string]any{"properties": map[string]any{"action": map[string]any{"description": "list (when not given), set, clear or history", "type": "string"}, "by": map[string]any{"description": "who gave the value at the controller's terminal", "type": "string"}, "key": map[string]any{"description": "the config key", "type": "string"}, "limit": map[string]any{"description": "for history: at most this many, newest", "type": "number"}, "module": map[string]any{"description": "a module: its own value, with node", "type": "string"}, "node": map[string]any{"description": "a node", "type": "string"}, "value": map[string]any{"description": "for set: the value, of the key's type: a number, a string, a boolean, or for a trusted key an object or a list"}, "why": map[string]any{"description": "for set and clear: why", "type": "string"}}, "type": "object"}, + Output: map[string]any{"description": "the values asked, or the one set or cleared, or its history", "type": "object"}}, + {Name: "renames", Description: "The open renames of config values (design 32 *A config value renamed*): per rename the module, the old and new name, when it moved, and the nodes still holding the old name open.", Optional: true, + Input: map[string]any{"properties": map[string]any{"module": map[string]any{"description": "one module (optional)", "type": "string"}}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"renames": map[string]any{"description": "every open rename", "items": map[string]any{"properties": map[string]any{"at": map[string]any{"description": "when it moved, RFC 3339", "type": "string"}, "from": map[string]any{"description": "the old name", "type": "string"}, "module": map[string]any{"description": "the module", "type": "string"}, "open": map[string]any{"description": "the nodes still holding the old name open", "items": map[string]any{"type": "string"}, "type": "array"}, "to": map[string]any{"description": "the new name", "type": "string"}}, "required": []string{"module", "from", "to"}, "type": "object"}, "type": "array"}}, "required": []string{"renames"}, "type": "object"}}, + }}, + {Name: MeshProvisioner, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0349", + Serves: []Verb{ + {Name: "provisioning", Description: "Read what the provisioner keeps: the registry (which domain answers which kind of placeholder), the needs each module on each node recorded, what is applied where, or the items of every collection, narrowed by node and module. Reads only.", Optional: true, + Input: map[string]any{"properties": map[string]any{"collection": map[string]any{"description": "for collect: a collection", "type": "string"}, "module": map[string]any{"description": "a module: for collect, a contributor", "type": "string"}, "node": map[string]any{"description": "a node", "type": "string"}, "what": map[string]any{"description": "registry (when not given), needs, applied or collect", "type": "string"}}, "type": "object"}}, + }}, + {Name: MeshArtifactStore, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0075", Delivers: "artifact-store"}, + {Name: MeshCatalog, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0604", + Serves: []Verb{ + {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: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {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: map[string]any{"properties": map[string]any{"module": map[string]any{"description": "the module's name", "type": "string"}}, "required": []string{"module"}, "type": "object"}}, + {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: map[string]any{"properties": map[string]any{"provision": map[string]any{"description": "the provision, such as postgres-database", "type": "string"}}, "required": []string{"provision"}, "type": "object"}}, + {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: map[string]any{"properties": map[string]any{"module": map[string]any{"description": "the module's name", "type": "string"}}, "required": []string{"module"}, "type": "object"}}, + }}, + {Name: MeshDelivery, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0239", + Serves: []Verb{ + {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: map[string]any{"properties": map[string]any{"all": map[string]any{"description": "\"true\": the final ones of the last thirty days too", "enum": []string{"true", "false"}, "type": "string"}, "group": map[string]any{"description": "a group's id (its branch name)", "type": "string"}, "repository": map[string]any{"description": "owner/repository", "type": "string"}, "state": map[string]any{"description": "one state, e.g. delivering or held", "type": "string"}}, "type": "object"}}, + {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: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {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: map[string]any{"properties": map[string]any{"id": map[string]any{"description": "a delivery's id, or a group's", "type": "string"}}, "required": []string{"id"}, "type": "object"}}, + {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: map[string]any{"properties": map[string]any{"all": map[string]any{"description": "\"true\": the groups that ended too", "enum": []string{"true", "false"}, "type": "string"}}, "type": "object"}}, + {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: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {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: map[string]any{"properties": map[string]any{"commit": map[string]any{"description": "a commit's sha, or the start of one, instead of a pull request", "type": "string"}, "number": map[string]any{"description": "a pull request's number: its head is read", "type": "string"}, "repository": map[string]any{"description": "owner/repository", "type": "string"}}, "required": []string{"repository"}, "type": "object"}}, + {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: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {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: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {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: map[string]any{"properties": map[string]any{"id": map[string]any{"description": "the delivery's id", "type": "string"}, "why": map[string]any{"description": "why, kept with the transition", "type": "string"}}, "required": []string{"id", "why"}, "type": "object"}}, + {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: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {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: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {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: map[string]any{"properties": map[string]any{"id": map[string]any{"description": "the delivery's id", "type": "string"}, "why": map[string]any{"description": "the condition it answers", "type": "string"}}, "required": []string{"id", "why"}, "type": "object"}}, + {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: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {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: map[string]any{"additionalProperties": false, "properties": map[string]any{"ids": map[string]any{"description": "the held deliveries' ids (owner/repository@commit)", "items": map[string]any{"type": "string"}, "minItems": float64(1), "type": "array"}, "why": map[string]any{"description": "why they may be settled, shown to the operator", "type": "string"}}, "required": []string{"ids", "why"}, "type": "object"}}, + }}, + {Name: MeshPlacement, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0567", + Serves: []Verb{ + {Name: "placement", Description: "Read placement: one node's key, the nodes one module is placed on, or every key, each with its revision, and how full the state is against its cap. With history, one node's or one module's changes in order: a revision the state keeps whole, an older one as the proposal's changes from its placement-changed event.", Optional: true, + Input: map[string]any{"properties": map[string]any{"history": map[string]any{"description": "\"true\": the changes in order, from the stream and the state's revisions", "enum": []string{"true", "false"}, "type": "string"}, "module": map[string]any{"description": "one module: the nodes it is placed on", "type": "string"}, "node": map[string]any{"description": "one node", "type": "string"}, "seats": map[string]any{"description": "\"true\": who holds each seat, and on which node (the state seat-holders); with node, that node's", "enum": []string{"true", "false"}, "type": "string"}}, "type": "object"}}, + {Name: "proposals", Description: "Every open proposal of placement: its changes, the revision of each key it was laid over, its candidates, every node's answer, the differences computed and answered, its verdict and its ask. Narrowed to one by id.", Optional: true, + Input: map[string]any{"properties": map[string]any{"id": map[string]any{"description": "one proposal's id", "type": "string"}}, "type": "object"}}, + {Name: "propose", Description: "Propose a change of placement, with why: laid over the current keys and refused at once, naming every finding, when the result cannot be placed (two modules on one host port, a provider not placed, a seat held once held twice, two nodes with one address, two hubs, a module the indexer does not hold, a node with no record). Otherwise the nodes it touches compose it in shadow and answer, and on a passing verdict the operator is asked to approve it. Who proposes is the caller, as the runtime proves it. An add-node from mesh-enrolment, whose warrant names its node and address, is written with no ask of its own: its Approve is the enrolment's (ADR 0587 §7).", Optional: true, + Input: map[string]any{"additionalProperties": false, "properties": map[string]any{"changes": map[string]any{"description": "the changes, each an object with `op`: place (node, module, ports, bindings), take-off (node, module), pin (node, provision, provider {node, module}), unpin (node, provision), hold (node, module, claim, scope, kind, site), unhold (node, module, claim), decide (node, field, value: a decided field of the node, its address among them), config (node, module, mesh-wide, layer, mesh-wide-values, values), add-node (node, decided, keys: a joining node, mesh-enrolment's alone, the proposal's one change, with the enrolment's warrant, its tunnel key alone at the operator's yes; ADR 0587 §7), remove-node (node: a joining node never confirmed, taken off when its enrolment ends; mesh-enrolment's alone, on the same warrant)", "items": map[string]any{"required": []string{"op", "node"}, "type": "object"}, "minItems": float64(1), "type": "array"}, "warrant": map[string]any{"description": "for an add-node alone: the enrolment's warrant {node, address, ask, warrant}, naming the change's node and address", "required": []string{"node", "address", "ask", "warrant"}, "type": "object"}, "why": map[string]any{"description": "why, shown to the operator with the proposal", "type": "string"}}, "required": []string{"why", "changes"}, "type": "object"}}, + {Name: "withdraw", Description: "Withdraw an open proposal: its key and its candidates are deleted and placement-withdrawn carries it whole. With why.", Optional: true, + Input: map[string]any{"properties": map[string]any{"id": map[string]any{"description": "the proposal's id", "type": "string"}, "why": map[string]any{"description": "why, kept in the event", "type": "string"}}, "required": []string{"id", "why"}, "type": "object"}}, + {Name: "again", Description: "Judge an open proposal now with the answers that stand, and raise its ask again when its verdict passes and the operator's channel does not hold the ask. Nothing more: the recovery of a proposal whose judgement or ask was lost.", Optional: true, + Input: map[string]any{"properties": map[string]any{"id": map[string]any{"description": "the proposal's id", "type": "string"}}, "required": []string{"id"}, "type": "object"}}, + }}, + {Name: MeshDeliveryChecker, Scope: "mesh", Grain: "whole", Decision: "novox/hq ADR 0547", + Serves: []Verb{ + {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, + Input: map[string]any{"properties": map[string]any{"head": map[string]any{"description": "the full commit to try, 40 or 64 hex digits", "type": "string"}, "level": map[string]any{"description": "unit or integration: only this level; both when absent", "type": "string"}, "repository": map[string]any{"description": "/", "type": "string"}, "tests": map[string]any{"description": "a go test -run pattern: only those tests run, and nothing is kept", "type": "string"}, "trunk": map[string]any{"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": []string{"repository", "head"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"id": map[string]any{"description": "the try's id", "type": "string"}, "state": map[string]any{"description": "its state", "type": "string"}}, "required": []string{"id"}, "type": "object"}, Replaces: []string{"sh merge-check.sh", "docker run postgres"}}, + {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: map[string]any{"properties": map[string]any{"id": map[string]any{"description": "the try's id, try-", "type": "string"}}, "required": []string{"id"}, "type": "object"}, + Output: map[string]any{"description": "the try: its state, its steps and its verdict when it has one", "type": "object"}}, + {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: map[string]any{"properties": map[string]any{"id": map[string]any{"description": "the try's id, try-", "type": "string"}, "why": map[string]any{"description": "why it is ended, in words", "type": "string"}}, "required": []string{"id", "why"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"ended": map[string]any{"description": "it is ended", "type": "boolean"}, "id": map[string]any{"description": "the try", "type": "string"}}, "required": []string{"id", "ended"}, "type": "object"}}, + }}, + {Name: MeshConditions, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0564", Emits: []string{"condition-raised", "condition-changed", "condition-cleared"}, + Serves: []Verb{ + {Name: "conditions", Description: "What is wrong with the mesh now: every open condition, urgent first, then oldest, raised from the observers' findings (the watchman, the self-check, the healers, the assigner) and cleared when the finding goes, never by hand. Given a key, that one whole with its evidence; with history, every transition lately.", + Input: map[string]any{"properties": map[string]any{"days": map[string]any{"description": "with history: how many days back (default 7, at most 90)", "type": "string"}, "history": map[string]any{"description": "\"true\": every raising, change, silence and clearing lately, oldest first", "enum": []string{"true", "false"}, "type": "string"}, "key": map[string]any{"description": "a condition's key: that one whole; with history, only its transitions", "type": "string"}, "machine": map[string]any{"description": "only those about this machine", "type": "string"}, "scope": map[string]any{"description": "only this scope: machine, plan, call, build, merge, provider, seat, bus, core, probe, mesh, delivery or module", "type": "string"}, "severity": map[string]any{"description": "only urgent, or only warning", "type": "string"}}, "type": "object"}}, + {Name: "silence", Description: "Stop one condition's messages for a while, a hand act with why: it stays open and in status, and the silence is kept as its transition in history.", + Input: map[string]any{"properties": map[string]any{"cause": map[string]any{"description": "the cause in a word (the condition's kind when absent)", "type": "string"}, "for": map[string]any{"description": "how long: 30m, 4h, 2d; at most 7d", "type": "string"}, "key": map[string]any{"description": "the condition's key", "type": "string"}, "why": map[string]any{"description": "why, required and recorded", "type": "string"}}, "required": []string{"key", "for", "why"}, "type": "object"}}, + {Name: "resync", Description: "Read every observer's findings again and raise and clear what differs from the open conditions: the recovery of a keeper that missed a change.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + }}, + {Name: MeshWatchdogs, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0564", + Serves: []Verb{ + {Name: "signals", Description: "Every watchdog of the signals table the watchman keeps, each a key that expires unless its signal renews it: its row, what renews it, its bound, the age of its newest signal, and the finding its expiry wrote.", + Input: map[string]any{"properties": map[string]any{"row": map[string]any{"description": "one row, e.g. S1", "type": "string"}}, "type": "object"}}, + {Name: "stuck", Description: "Every want, build or step the watchman says stopped moving past its bound, with since when and the words of its finding.", + Input: map[string]any{"properties": map[string]any{"machine": map[string]any{"description": "only those on this machine", "type": "string"}}, "type": "object"}}, + {Name: "presence", Description: "Every machine and tool runner the watchman sees connected, with its last word, and those it says silent; a machine that said it sleeps is shown as sleeping, not silent.", + Input: map[string]any{"properties": map[string]any{"machine": map[string]any{"description": "one machine", "type": "string"}}, "type": "object"}}, + {Name: "dead-letters", Description: "Every message a consumer on the bus gave up on, kept in DEAD_LETTERS: whose consumer, the subject, how often it was handed over and when it was given up, newest first. With id: that one whole. With deliver or drop, a hand act with why.", + Input: map[string]any{"properties": map[string]any{"cause": map[string]any{"description": "with deliver or drop: the cause in a word (dead-letter when absent)", "type": "string"}, "consumer": map[string]any{"description": "a consumer's name, or .: only what that one gave up on", "type": "string"}, "deliver": map[string]any{"description": "a dead letter's id: deliver it again to the consumer that gave it up (needs why)", "type": "string"}, "drop": map[string]any{"description": "a dead letter's id: drop it for good (needs why)", "type": "string"}, "id": map[string]any{"description": "a dead letter's id, as the list gives it: that one whole, with its message", "type": "string"}, "limit": map[string]any{"description": "how many to list, newest first (default 50); only when listing", "type": "string"}, "why": map[string]any{"description": "with deliver or drop: why, required and recorded", "type": "string"}}, "type": "object"}}, + {Name: "resync", Description: "Rebuild presence from the bus's connections, and the pulses and findings from the keys the watchman watches, and take every dead-letter notice waiting: the recovery of a watchman that missed a change.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + }}, + {Name: MeshSelfCheck, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0564", Emits: []string{"checked"}, + Serves: []Verb{ + {Name: "doctor", Description: "The self-check: the last run's verdict at once, each probe passed, failed, deferred (its facts not on the bus yet, named) or could not run, and how long ago. With run, a run now; with probe, one probe's verdict whole. Runs every five minutes on its own; each failure is a finding.", + Input: map[string]any{"properties": map[string]any{"probe": map[string]any{"description": "one probe's id (D6): its verdict alone, with every finding", "type": "string"}, "run": map[string]any{"description": "\"true\": run every probe now and answer the verdict", "enum": []string{"true", "false"}, "type": "string"}}, "type": "object"}}, + {Name: "probes", Description: "The registry: what each probe asserts, where it reads its facts, and the finding it writes.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + }}, + {Name: MeshHealers, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0564", Emits: []string{"healer-acted"}, + Serves: []Verb{ + {Name: "healers", Description: "The healers: each registered response to one kind of condition, its repair, its budget and what happens when it is spent; every act taken lately with its outcome, and the mesh-wide brake.", + Input: map[string]any{"properties": map[string]any{"days": map[string]any{"description": "how many days of acts back (default 7)", "type": "string"}}, "type": "object"}}, + {Name: "heal", Description: "Take one healer's act for one open condition now, within its budget and the brake.", + Input: map[string]any{"properties": map[string]any{"key": map[string]any{"description": "the condition's key", "type": "string"}, "why": map[string]any{"description": "why now, kept with the act", "type": "string"}}, "required": []string{"key", "why"}, "type": "object"}}, + {Name: "drill", Description: "Record a drill: something broken on purpose to see the mesh raise and clear it, with what it tests. A drill is never a repair: no healer is wanted for it however often it is run.", + Input: map[string]any{"properties": map[string]any{"condition": map[string]any{"description": "the key of the condition the drill is meant to raise, if any (optional)", "type": "string"}, "what": map[string]any{"description": "what was done on purpose, in a line", "type": "string"}, "why": map[string]any{"description": "what the drill tests", "type": "string"}}, "required": []string{"what", "why"}, "type": "object"}}, + }}, + {Name: MeshWants, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0565", Emits: []string{"policy-changed"}, + Serves: []Verb{ + {Name: "upgrade", Description: "Whether each module's new builds wait for a person: its policy (roll, together or record) and where it comes from (a person, the module, the bus, its irreplaceable data, the default); the bus is never rolled. With module, that one; with module, policy and why, a person's choice for it, recorded as a hand act; with policy default, the choice taken back. With compare, each node's own composition and the assigner's findings.", + Input: map[string]any{"properties": map[string]any{"compare": map[string]any{"description": "\"true\": each node's own composition, by its digest, and the assigner's findings", "enum": []string{"true", "false"}, "type": "string"}, "module": map[string]any{"description": "one module", "type": "string"}, "policy": map[string]any{"description": "with module: roll, together, record, or default to take a person's choice back", "type": "string"}, "why": map[string]any{"description": "with policy: why, required and kept", "type": "string"}}, "type": "object"}}, + {Name: "bus", Description: "What a bus upgrade would do: the fingerprint of the bus module each node runs against the indexer's newest, and the last bus steps from the hand-act log and the assigner's puts of the bus. Read-only: the step itself is the put on the operator's warrant.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + }}, + {Name: MeshHandActs, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0565", Emits: []string{"act-recorded"}, + Serves: []Verb{ + {Name: "hand-act", Description: "Record one act done by hand: what, why, its cause in a word or a condition's kind (the word a second act for the same reason uses) and the condition it addresses. Who did it is the caller the runtime proves, never said by the caller. Said as act-recorded.", + Input: map[string]any{"properties": map[string]any{"cause": map[string]any{"description": "the cause in a word, or a condition's kind", "type": "string"}, "condition": map[string]any{"description": "the key of the condition it addressed, if any (optional)", "type": "string"}, "verb": map[string]any{"description": "the act's verb in the log: a repair when absent, `hand-act drill` for a drill, or a recorder's own", "type": "string"}, "what": map[string]any{"description": "what was done, in a line", "type": "string"}, "why": map[string]any{"description": "why it had to be done by hand", "type": "string"}}, "required": []string{"what", "why"}, "type": "object"}}, + {Name: "hand-acts", Description: "What was done by hand lately, over this log and the controller's: who, why and the cause of each, and the causes recorded twice within a fortnight (a healer is wanted).", + Input: map[string]any{"properties": map[string]any{"cause": map[string]any{"description": "only this cause", "type": "string"}, "days": map[string]any{"description": "how many days back (default 14)", "type": "string"}, "warrants": map[string]any{"description": "\"true\": every warrant recorded", "enum": []string{"true", "false"}, "type": "string"}, "who": map[string]any{"description": "only acts whose who contains this", "type": "string"}}, "type": "object"}}, + {Name: "warranted", Description: "Record what a module did on the operator's warrant: who chose, through which channel, with which proofs and which answer read from the router's own record of that module's ask, never from the caller; once per ask. Refused for an ask still open, ended without a choice, or not that module's.", + Input: map[string]any{"properties": map[string]any{"ask": map[string]any{"description": "its ask's id", "type": "string"}, "asker": map[string]any{"description": "the module that asked", "type": "string"}}, "required": []string{"asker", "ask"}, "type": "object"}}, + }}, + {Name: MeshEnrolment, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0587", Emits: []string{"enrolment-issued", "node-enrolled", "enrolment-refused", "enrolment-revoked", "enrolment-expired"}, + Serves: []Verb{ + {Name: "issue", Description: "Issue a one-time token for a new machine, on the operator's Approve: refused at once, naming every finding, for a name that is not a node name or that a node record, a placement key or an open enrolment holds, and for every call before the controller's lease is handed away. Otherwise reserves the lowest free private-network address, asks the operator under the seat's own name and, on the warrant, adds the node to placement with its tunnel key, asks the vault for the token and says enrolment-issued. The token itself is read only through tokens.", + Input: map[string]any{"properties": map[string]any{"expires": map[string]any{"description": "how long the token lasts, a duration such as 1h or 24h: one hour when not given, at most 24 hours", "type": "string"}, "node": map[string]any{"description": "the new machine's name in the mesh", "type": "string"}, "overlay_key": map[string]any{"description": "the new machine's private network (tunnel) public key, as `nox-mesh-host key` prints it", "type": "string"}, "why": map[string]any{"description": "why it joins, shown to the operator with the ask", "type": "string"}}, "required": []string{"node", "why", "overlay_key"}, "type": "object"}}, + {Name: "redeem", Description: "Spend a token: asked by a joining node-engine dialled as enrol. alone, with the public halves of its keys and its identity key's proof over them. Spends the token, asks the vault for the node's account and certificate, writes the node into placement, and answers the account sealed to the node, its certificate and the vault's public half, signed by the vault. Asked again with the same keys it finishes what is not done and answers the same; with other keys it is refused.", + Input: map[string]any{"additionalProperties": false, "properties": map[string]any{"node": map[string]any{"description": "the node the token was issued for", "type": "string"}, "overlay_key": map[string]any{"description": "the private network key's public half", "type": "string"}, "profile": map[string]any{"description": "what the machine is, as its record says it", "type": "object"}, "proof": map[string]any{"description": "the identity key's signature over the redeem's proof bytes (delivery.RedeemProof), base64", "type": "string"}, "public_key": map[string]any{"description": "the identity key's public half, base64", "type": "string"}, "sealing_key": map[string]any{"description": "the sealing key's public half, which the account is sealed to", "type": "string"}, "serving_key": map[string]any{"description": "the serving key's public half, which the certificate binds", "type": "string"}, "tunnel": map[string]any{"description": "a tunnel found on the machine: everything but its private key", "type": "object"}}, "required": []string{"node", "public_key", "sealing_key", "proof"}, "type": "object"}}, + {Name: "confirm", Description: "Confirm an enrolment: asked by the node-engine dialled as its own node login alone, the runtime's proof of that caller being the confirmation. Says node-enrolled and ends the enrolment.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {Name: "revoke", Description: "End an enrolment at any stage, with why, without an Approve: withdraws an open ask, deletes the node's key and its address, has the vault retire an account it already minted for it, records the act as a hand act and says enrolment-revoked.", + Input: map[string]any{"properties": map[string]any{"node": map[string]any{"description": "the node", "type": "string"}, "why": map[string]any{"description": "why, recorded with the hand act", "type": "string"}}, "required": []string{"node", "why"}, "type": "object"}}, + {Name: "tokens", Description: "Read every open enrolment, or one: its stage, expiry, ask and revision, the bucket's fill against its cap. For a node at live, its token sealed to the operator key, asked of the vault at that moment and relayed as the vault sealed it. With history, the ended enrolments from the seat's events, as far back as the events are kept.", + Input: map[string]any{"properties": map[string]any{"history": map[string]any{"description": "\"true\": the ended enrolments too", "enum": []string{"true", "false"}, "type": "string"}, "node": map[string]any{"description": "one node", "type": "string"}}, "type": "object"}}, + {Name: "again", Description: "Raise an issue's ask again when the operator's channel does not hold it, and nothing more.", + Input: map[string]any{"properties": map[string]any{"node": map[string]any{"description": "the node whose ask is raised again", "type": "string"}}, "required": []string{"node"}, "type": "object"}}, + }}, + {Name: MeshArtifactSweep, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0571", Emits: []string{"artifacts-gone"}, + Serves: []Verb{ + {Name: "artifacts", Description: "Every artifact the mesh made that lives in its artifact store, each with its repository, digest, kind (image or archive) and state: kept, and why (a want names it, or one of the five newest builds of its module in the builder's log), eligible (made, kept for no reason, not yet let go), or unrecorded (in the store and named by nothing the mesh made: never removed). Reads only.", + Input: map[string]any{"properties": map[string]any{"collected": map[string]any{"description": "\"true\": list the collected references too (counted always)", "enum": []string{"true", "false"}, "type": "string"}, "repository": map[string]any{"description": "only this repository's references, as / (the counts stay whole)", "type": "string"}}, "type": "object"}}, + {Name: "held", Description: "Whether the artifact store holds each reference given, asked with one HEAD each: held, gone (the store answered 404) or unknown with why. The builder asks it before it reuses a done key. Reads only.", + Input: map[string]any{"properties": map[string]any{"references": map[string]any{"description": "the artifacts' references, artifact-store:////blobs/sha256:: a list, or one text separated by commas", "items": map[string]any{"type": "string"}, "type": "array"}}, "required": []string{"references"}, "type": "object"}}, + {Name: "collect", Description: "The artifact store's sweep, now: what is eligible is let go of. Without confirm a dry run: what would be let go, nothing held or deleted. With confirm and why: every kept archive held first, then each eligible artifact let go of, oldest first, an index with the platform manifests no kept index names, each deletion recorded in the hand-act log. Bounded by most (500 by default, at most 5000) and 45 seconds; what is left is said. Never touches a digest the mesh did not make.", + Input: map[string]any{"properties": map[string]any{"confirm": map[string]any{"description": "\"true\": let go of what is eligible (needs why); without it nothing is done", "enum": []string{"true", "false"}, "type": "string"}, "most": map[string]any{"description": "let go of at most this many (500 by default, at most 5000)", "type": "string"}, "why": map[string]any{"description": "with confirm: why, required and recorded", "type": "string"}}, "type": "object"}}, + {Name: "mirrors", Description: "The bases the mesh copied into its artifact store, each kept (a kept build stood on it), eligible (only builds no longer kept stood on it) or unrecorded (no build the builder's log holds stood on it: never removed), by what the builder's log says each build stood on. Records nothing by hand.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {Name: "images", Description: "Every container image one machine's want and have name, each with the resources naming it: what the machine keeps when it prunes its images. Reads only.", + Input: map[string]any{"properties": map[string]any{"node": map[string]any{"description": "the machine's name", "type": "string"}}, "required": []string{"node"}, "type": "object"}}, + }}, + {Name: NpmPackageRegistry, Scope: "mesh", Grain: "whole", Decision: "novox/hq ADR 0109; novox/hq ADR 0605", Delivers: "npm-package-registry", Emits: []string{"published", "refused", "removed"}, + Serves: []Verb{ + {Name: "publish", Description: "Open a transfer, naming the artifact and the digest of every part; answers the digests the holder lacks, which the caller then sends by publish-part. A transfer already open answers the parts held, so a cut transfer goes on from there. With no parts and a version, the held digest is published under that version and nothing is stored (the trunk's claim).", + Input: map[string]any{"properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "parts": map[string]any{"description": "every part's digest and size; none when the digest is already held", "items": map[string]any{"description": "one part of a transfer", "properties": map[string]any{"digest": map[string]any{"description": "the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob", "type": "string"}, "size": map[string]any{"description": "its size in bytes", "type": "integer"}}, "required": []string{"digest", "size"}, "type": "object"}, "type": "array"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "transfer": map[string]any{"description": "the transfer's name, the caller's own; the same name opens the same transfer again", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"transfer", "name", "kind", "digest"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"held": map[string]any{"description": "the digest is held already: nothing to send; the outcome follows as an event", "type": "boolean"}, "lacks": map[string]any{"description": "the digests of the parts the holder lacks, to send by publish-part", "items": map[string]any{"type": "string"}, "type": "array"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer"}, "type": "object"}}, + {Name: "publish-part", Description: "Send one chunk of one part of an open transfer; the last chunk of the last part ends the transfer, and the holder hashes what it received, asks builder_versions, stores it and says published or refused. A chunk's message stays under the bus's largest message (1 MiB), so at most 768 KiB of data, base64.", + Input: map[string]any{"properties": map[string]any{"data": map[string]any{"description": "the chunk's bytes, base64 (at most 768 KiB before encoding)", "type": "string"}, "last": map[string]any{"description": "this chunk is the part's last", "type": "boolean"}, "part": map[string]any{"description": "the part's digest", "type": "string"}, "sequence": map[string]any{"description": "the chunk's place in its part, from 0", "type": "integer"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer", "part", "sequence", "last", "data"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"complete": map[string]any{"description": "the part is whole and its bytes match its digest", "type": "boolean"}, "part": map[string]any{"description": "the part", "type": "string"}, "received": map[string]any{"description": "the chunks of the part held so far", "type": "integer"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer", "part"}, "type": "object"}}, + {Name: "versions", Description: "The versions the seat holds of one name, newest first: each one's version, tag, digest, kind and when it was published.", + Input: map[string]any{"properties": map[string]any{"kind": map[string]any{"description": "narrowed to one kind (optional)", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}}, "required": []string{"name"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the name", "type": "string"}, "versions": map[string]any{"description": "newest first", "items": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "type": "array"}}, "required": []string{"name", "versions"}, "type": "object"}}, + {Name: "remove", Description: "Remove one tagged version; the holder refuses an untagged one but for the retention removal of a bundle, archive or copied base by the artifact sweep's holder. Every removal emits removed with its reason.", + Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest (for a bundle, archive or copied base)", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}, "reason": map[string]any{"description": "why it goes", "enum": []string{"tag-gone", "retention"}, "type": "string"}, "tag": map[string]any{"description": "the tag (for a tagged version)", "type": "string"}, "version": map[string]any{"description": "the version", "type": "string"}}, "required": []string{"name", "reason"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"artifact": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "removed": map[string]any{"description": "it is gone", "type": "boolean"}}, "required": []string{"removed"}, "type": "object"}}, + }}, + {Name: GoPackageRegistry, Scope: "mesh", Grain: "whole", Decision: "novox/hq ADR 0605", Delivers: "go-package-registry", Emits: []string{"published", "refused", "removed"}, + Serves: []Verb{ + {Name: "publish", Description: "Open a transfer, naming the artifact and the digest of every part; answers the digests the holder lacks, which the caller then sends by publish-part. A transfer already open answers the parts held, so a cut transfer goes on from there. With no parts and a version, the held digest is published under that version and nothing is stored (the trunk's claim).", + Input: map[string]any{"properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "parts": map[string]any{"description": "every part's digest and size; none when the digest is already held", "items": map[string]any{"description": "one part of a transfer", "properties": map[string]any{"digest": map[string]any{"description": "the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob", "type": "string"}, "size": map[string]any{"description": "its size in bytes", "type": "integer"}}, "required": []string{"digest", "size"}, "type": "object"}, "type": "array"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "transfer": map[string]any{"description": "the transfer's name, the caller's own; the same name opens the same transfer again", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"transfer", "name", "kind", "digest"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"held": map[string]any{"description": "the digest is held already: nothing to send; the outcome follows as an event", "type": "boolean"}, "lacks": map[string]any{"description": "the digests of the parts the holder lacks, to send by publish-part", "items": map[string]any{"type": "string"}, "type": "array"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer"}, "type": "object"}}, + {Name: "publish-part", Description: "Send one chunk of one part of an open transfer; the last chunk of the last part ends the transfer, and the holder hashes what it received, asks builder_versions, stores it and says published or refused. A chunk's message stays under the bus's largest message (1 MiB), so at most 768 KiB of data, base64.", + Input: map[string]any{"properties": map[string]any{"data": map[string]any{"description": "the chunk's bytes, base64 (at most 768 KiB before encoding)", "type": "string"}, "last": map[string]any{"description": "this chunk is the part's last", "type": "boolean"}, "part": map[string]any{"description": "the part's digest", "type": "string"}, "sequence": map[string]any{"description": "the chunk's place in its part, from 0", "type": "integer"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer", "part", "sequence", "last", "data"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"complete": map[string]any{"description": "the part is whole and its bytes match its digest", "type": "boolean"}, "part": map[string]any{"description": "the part", "type": "string"}, "received": map[string]any{"description": "the chunks of the part held so far", "type": "integer"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer", "part"}, "type": "object"}}, + {Name: "versions", Description: "The versions the seat holds of one name, newest first: each one's version, tag, digest, kind and when it was published.", + Input: map[string]any{"properties": map[string]any{"kind": map[string]any{"description": "narrowed to one kind (optional)", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}}, "required": []string{"name"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the name", "type": "string"}, "versions": map[string]any{"description": "newest first", "items": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "type": "array"}}, "required": []string{"name", "versions"}, "type": "object"}}, + {Name: "remove", Description: "Remove one tagged version; the holder refuses an untagged one but for the retention removal of a bundle, archive or copied base by the artifact sweep's holder. Every removal emits removed with its reason.", + Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest (for a bundle, archive or copied base)", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}, "reason": map[string]any{"description": "why it goes", "enum": []string{"tag-gone", "retention"}, "type": "string"}, "tag": map[string]any{"description": "the tag (for a tagged version)", "type": "string"}, "version": map[string]any{"description": "the version", "type": "string"}}, "required": []string{"name", "reason"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"artifact": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "removed": map[string]any{"description": "it is gone", "type": "boolean"}}, "required": []string{"removed"}, "type": "object"}}, + }}, + {Name: ContainerImageRegistry, Scope: "mesh", Grain: "whole", Decision: "novox/hq ADR 0605", Delivers: "artifact-store", Emits: []string{"published", "refused", "removed", "held", "released"}, + Serves: []Verb{ + {Name: "publish", Description: "Open a transfer, naming the artifact and the digest of every part; answers the digests the holder lacks, which the caller then sends by publish-part. A transfer already open answers the parts held, so a cut transfer goes on from there. With no parts and a version, the held digest is published under that version and nothing is stored (the trunk's claim).", + Input: map[string]any{"properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "parts": map[string]any{"description": "every part's digest and size; none when the digest is already held", "items": map[string]any{"description": "one part of a transfer", "properties": map[string]any{"digest": map[string]any{"description": "the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob", "type": "string"}, "size": map[string]any{"description": "its size in bytes", "type": "integer"}}, "required": []string{"digest", "size"}, "type": "object"}, "type": "array"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "transfer": map[string]any{"description": "the transfer's name, the caller's own; the same name opens the same transfer again", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"transfer", "name", "kind", "digest"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"held": map[string]any{"description": "the digest is held already: nothing to send; the outcome follows as an event", "type": "boolean"}, "lacks": map[string]any{"description": "the digests of the parts the holder lacks, to send by publish-part", "items": map[string]any{"type": "string"}, "type": "array"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer"}, "type": "object"}}, + {Name: "publish-part", Description: "Send one chunk of one part of an open transfer; the last chunk of the last part ends the transfer, and the holder hashes what it received, asks builder_versions, stores it and says published or refused. A chunk's message stays under the bus's largest message (1 MiB), so at most 768 KiB of data, base64.", + Input: map[string]any{"properties": map[string]any{"data": map[string]any{"description": "the chunk's bytes, base64 (at most 768 KiB before encoding)", "type": "string"}, "last": map[string]any{"description": "this chunk is the part's last", "type": "boolean"}, "part": map[string]any{"description": "the part's digest", "type": "string"}, "sequence": map[string]any{"description": "the chunk's place in its part, from 0", "type": "integer"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer", "part", "sequence", "last", "data"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"complete": map[string]any{"description": "the part is whole and its bytes match its digest", "type": "boolean"}, "part": map[string]any{"description": "the part", "type": "string"}, "received": map[string]any{"description": "the chunks of the part held so far", "type": "integer"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer", "part"}, "type": "object"}}, + {Name: "versions", Description: "The versions the seat holds of one name, newest first: each one's version, tag, digest, kind and when it was published.", + Input: map[string]any{"properties": map[string]any{"kind": map[string]any{"description": "narrowed to one kind (optional)", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}}, "required": []string{"name"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the name", "type": "string"}, "versions": map[string]any{"description": "newest first", "items": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "type": "array"}}, "required": []string{"name", "versions"}, "type": "object"}}, + {Name: "remove", Description: "Remove one tagged version; the holder refuses an untagged one but for the retention removal of a bundle, archive or copied base by the artifact sweep's holder. Every removal emits removed with its reason.", + Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest (for a bundle, archive or copied base)", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}, "reason": map[string]any{"description": "why it goes", "enum": []string{"tag-gone", "retention"}, "type": "string"}, "tag": map[string]any{"description": "the tag (for a tagged version)", "type": "string"}, "version": map[string]any{"description": "the version", "type": "string"}}, "required": []string{"name", "reason"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"artifact": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "removed": map[string]any{"description": "it is gone", "type": "boolean"}}, "required": []string{"removed"}, "type": "object"}}, + {Name: "mirror", Description: "Copy an outside image into the store by its pinned digest; emits published or refused.", + Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "its pinned digest, sha256:", "type": "string"}, "name": map[string]any{"description": "the name it is kept under", "type": "string"}, "source": map[string]any{"description": "the outside image's reference", "type": "string"}}, "required": []string{"source", "digest", "name"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest stored", "type": "string"}, "reference": map[string]any{"description": "the reference the seat answers", "type": "string"}}, "required": []string{"reference", "digest"}, "type": "object"}}, + {Name: "tags", Description: "The tags of one image and the digest each names.", + Input: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the image", "type": "string"}}, "required": []string{"name"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the image", "type": "string"}, "tags": map[string]any{"description": "every tag", "items": map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "its digest", "type": "string"}, "tag": map[string]any{"description": "the tag", "type": "string"}}, "required": []string{"tag", "digest"}, "type": "object"}, "type": "array"}}, "required": []string{"name", "tags"}, "type": "object"}}, + {Name: "hold", Description: "Keep one untagged bundle, archive or copied base from removal by retention, as the artifact sweep's rules keep it (ADR 0617 §2); never an image of the holder's own. Emits held.", + Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}, "reason": map[string]any{"description": "which of the sweep's rules keeps it", "type": "string"}}, "required": []string{"name", "digest", "reason"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"held": map[string]any{"description": "it is held", "type": "boolean"}, "since": map[string]any{"description": "when the hold began, RFC 3339", "type": "string"}}, "required": []string{"held"}, "type": "object"}}, + {Name: "release", Description: "Let a hold go; emits released. By hand only through the holder's own tool, the operator's session as the proved caller, recorded as a hand act.", + Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}, "reason": map[string]any{"description": "why it is let go", "type": "string"}}, "required": []string{"name", "digest", "reason"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"released": map[string]any{"description": "the hold is gone", "type": "boolean"}}, "required": []string{"released"}, "type": "object"}}, + }}, + {Name: OciArtifactRegistry, Scope: "mesh", Grain: "whole", Decision: "novox/hq ADR 0605", Delivers: "artifact-store", Emits: []string{"published", "refused", "removed", "held", "released"}, + Serves: []Verb{ + {Name: "publish", Description: "Open a transfer, naming the artifact and the digest of every part; answers the digests the holder lacks, which the caller then sends by publish-part. A transfer already open answers the parts held, so a cut transfer goes on from there. With no parts and a version, the held digest is published under that version and nothing is stored (the trunk's claim).", + Input: map[string]any{"properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "parts": map[string]any{"description": "every part's digest and size; none when the digest is already held", "items": map[string]any{"description": "one part of a transfer", "properties": map[string]any{"digest": map[string]any{"description": "the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob", "type": "string"}, "size": map[string]any{"description": "its size in bytes", "type": "integer"}}, "required": []string{"digest", "size"}, "type": "object"}, "type": "array"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "transfer": map[string]any{"description": "the transfer's name, the caller's own; the same name opens the same transfer again", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"transfer", "name", "kind", "digest"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"held": map[string]any{"description": "the digest is held already: nothing to send; the outcome follows as an event", "type": "boolean"}, "lacks": map[string]any{"description": "the digests of the parts the holder lacks, to send by publish-part", "items": map[string]any{"type": "string"}, "type": "array"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer"}, "type": "object"}}, + {Name: "publish-part", Description: "Send one chunk of one part of an open transfer; the last chunk of the last part ends the transfer, and the holder hashes what it received, asks builder_versions, stores it and says published or refused. A chunk's message stays under the bus's largest message (1 MiB), so at most 768 KiB of data, base64.", + Input: map[string]any{"properties": map[string]any{"data": map[string]any{"description": "the chunk's bytes, base64 (at most 768 KiB before encoding)", "type": "string"}, "last": map[string]any{"description": "this chunk is the part's last", "type": "boolean"}, "part": map[string]any{"description": "the part's digest", "type": "string"}, "sequence": map[string]any{"description": "the chunk's place in its part, from 0", "type": "integer"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer", "part", "sequence", "last", "data"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"complete": map[string]any{"description": "the part is whole and its bytes match its digest", "type": "boolean"}, "part": map[string]any{"description": "the part", "type": "string"}, "received": map[string]any{"description": "the chunks of the part held so far", "type": "integer"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer", "part"}, "type": "object"}}, + {Name: "versions", Description: "The versions the seat holds of one name, newest first: each one's version, tag, digest, kind and when it was published.", + Input: map[string]any{"properties": map[string]any{"kind": map[string]any{"description": "narrowed to one kind (optional)", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}}, "required": []string{"name"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the name", "type": "string"}, "versions": map[string]any{"description": "newest first", "items": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "type": "array"}}, "required": []string{"name", "versions"}, "type": "object"}}, + {Name: "remove", Description: "Remove one tagged version; the holder refuses an untagged one but for the retention removal of a bundle, archive or copied base by the artifact sweep's holder. Every removal emits removed with its reason.", + Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest (for a bundle, archive or copied base)", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}, "reason": map[string]any{"description": "why it goes", "enum": []string{"tag-gone", "retention"}, "type": "string"}, "tag": map[string]any{"description": "the tag (for a tagged version)", "type": "string"}, "version": map[string]any{"description": "the version", "type": "string"}}, "required": []string{"name", "reason"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"artifact": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "removed": map[string]any{"description": "it is gone", "type": "boolean"}}, "required": []string{"removed"}, "type": "object"}}, + {Name: "hold", Description: "Keep one untagged bundle, archive or copied base from removal by retention, as the artifact sweep's rules keep it (ADR 0617 §2); never an image of the holder's own. Emits held.", + Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}, "reason": map[string]any{"description": "which of the sweep's rules keeps it", "type": "string"}}, "required": []string{"name", "digest", "reason"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"held": map[string]any{"description": "it is held", "type": "boolean"}, "since": map[string]any{"description": "when the hold began, RFC 3339", "type": "string"}}, "required": []string{"held"}, "type": "object"}}, + {Name: "release", Description: "Let a hold go; emits released. By hand only through the holder's own tool, the operator's session as the proved caller, recorded as a hand act.", + Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}, "reason": map[string]any{"description": "why it is let go", "type": "string"}}, "required": []string{"name", "digest", "reason"}, "type": "object"}, + Output: map[string]any{"properties": map[string]any{"released": map[string]any{"description": "the hold is gone", "type": "boolean"}}, "required": []string{"released"}, "type": "object"}}, + }}, + {Name: Git, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0111", Delivers: "git"}, + {Name: NodeBuildGo, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0525, ADR 0536, ADR 0553", Accepts: []string{"delivery", "check", "recheck"}, PulledByKind: true, Yields: true, + Serves: []Verb{ + {Name: "current", Description: "The Go asks this node runs now (each ask's id, kind, module and when it started), its build capacity, and whether it is paused, taking no new ask.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {Name: "pause", Description: "Take no new Go ask on this node until resumed; an ask running here ends in its place. Kept across a restart of the build module (its pause key). A capacity of 0 is the lasting way to keep a node from building.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {Name: "resume", Description: "Take Go asks again on this node.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + }}, + {Name: NodeBuildNode, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0525, ADR 0536, ADR 0553", Accepts: []string{"delivery", "check", "recheck"}, PulledByKind: true, Yields: true, + Serves: []Verb{ + {Name: "current", Description: "The Node asks this node runs now (each ask's id, kind, module and when it started), its build capacity, and whether it is paused, taking no new ask.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {Name: "pause", Description: "Take no new Node ask on this node until resumed; an ask running here ends in its place. Kept across a restart of the build module (its pause key). A capacity of 0 is the lasting way to keep a node from building.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {Name: "resume", Description: "Take Node asks again on this node.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + }}, + {Name: NodeBuildImage, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0525, ADR 0536, ADR 0553", Accepts: []string{"delivery", "check", "recheck"}, PulledByKind: true, Yields: true, + Serves: []Verb{ + {Name: "current", Description: "The image asks this node runs now (each ask's id, kind, module and when it started), its build capacity, and whether it is paused, taking no new ask.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {Name: "pause", Description: "Take no new image ask on this node until resumed; an ask running here ends in its place. Kept across a restart of the build module (its pause key). A capacity of 0 is the lasting way to keep a node from building.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {Name: "resume", Description: "Take image asks again on this node.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + }}, + {Name: MeshDnsResolver, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0194, ADR 0223", Replicated: true, Delivers: "wildcard-resolution"}, + {Name: NodeHostname, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0199, ADR 0223", + Serves: []Verb{ + {Name: "entries", Description: "Every line of this machine's /etc/hosts, each marked whose it is: the operator's, or the block of the module or tool that writes it.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}, Replaces: []string{"cat /etc/hosts", "getent hosts"}}, + {Name: "add", Description: "Add one address and its names to the operator's lines of this machine's /etc/hosts — a name for this machine's own programs, not the mesh's.", + Input: map[string]any{"properties": map[string]any{"address": map[string]any{"description": "the IPv4 or IPv6 address", "type": "string"}, "names": map[string]any{"description": "the names for it, separated by spaces", "type": "string"}}, "required": []string{"address", "names"}, "type": "object"}, Replaces: []string{"edit /etc/hosts", "HOSTALIASES"}}, + {Name: "remove", Description: "Remove one name, or every line of one address, from the operator's lines of this machine's /etc/hosts. A line a module writes is refused, naming the module.", + Input: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "a host name, or an address to remove every line of", "type": "string"}}, "required": []string{"name"}, "type": "object"}, Replaces: []string{"sed -i /etc/hosts"}}, + }, Paths: []Path{{Path: "/etc/hosts", StepsBackFor: ""}, {Path: "/etc/hostname", StepsBackFor: ""}}}, + {Name: NodeIntrusionPrevention, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0121", + Serves: []Verb{ + {Name: "status", Description: "Every jail on this machine with how many it is watching and holding now, and the totals since the jail started; one jail's detail when named.", + Input: map[string]any{"properties": map[string]any{"jail": map[string]any{"description": "one jail (optional)", "type": "string"}}, "type": "object"}, Replaces: []string{"fail2ban-client status"}}, + {Name: "banned", Description: "Every address banned on this machine right now, with the jail that holds it and when the ban ends.", + Input: map[string]any{"properties": map[string]any{"jail": map[string]any{"description": "one jail (optional)", "type": "string"}}, "type": "object"}, Replaces: []string{"fail2ban-client banned"}}, + {Name: "ban", Description: "Ban one address in one jail now, for the jail's ban time — an operator's act on the live ban list, which the mesh never writes itself.", + Input: map[string]any{"properties": map[string]any{"ip": map[string]any{"description": "the address", "type": "string"}, "jail": map[string]any{"description": "the jail to hold it", "type": "string"}}, "required": []string{"ip", "jail"}, "type": "object"}, Replaces: []string{"fail2ban-client set banip"}}, + {Name: "unban", Description: "Let one address go, from one jail or from every jail when none is named.", + Input: map[string]any{"properties": map[string]any{"ip": map[string]any{"description": "the address", "type": "string"}, "jail": map[string]any{"description": "one jail (optional)", "type": "string"}}, "required": []string{"ip"}, "type": "object"}, Replaces: []string{"fail2ban-client unban", "fail2ban-client set unbanip"}}, + }}, + {Name: NodePacketFilter, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0121", + Serves: []Verb{ + {Name: "rules", Description: "The packet filter as this machine enforces it now: the nftables ruleset and, where the tool exists, the legacy filter's listings. Narrowed to one table or chain when asked.", + Input: map[string]any{"properties": map[string]any{"chain": map[string]any{"description": "one chain of that table (optional)", "type": "string"}, "table": map[string]any{"description": "one nftables table, as `family name` (optional)", "type": "string"}}, "type": "object"}, Replaces: []string{"nft list ruleset", "iptables -L", "iptables-save"}}, + {Name: "reload", Description: "Load the mesh's own filter again from the file the mesh writes, and answer with the mesh's table as loaded.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}, Replaces: []string{"nft -f"}}, + {Name: "remove", Description: "Remove one rule set the mesh did not write, named exactly as the host reports it (novox/hq ADR 0168) — `chain X (iptables-legacy)` or `table ip6 filter, chain DOCKER-USER`. Refuses the mesh's tables, the runtime's own chains, a built-in chain and an active found firewall's chains. An operator's act, by name, never a flush.", + Input: map[string]any{"properties": map[string]any{"where": map[string]any{"description": "the rule set, as `node show` lists it", "type": "string"}}, "required": []string{"where"}, "type": "object"}, Replaces: []string{"nft delete", "iptables -X"}}, + }}, + {Name: NodeServiceManager, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0177", + Serves: []Verb{ + {Name: "units", Description: "The units the service manager knows in a scope, each with its load, active and sub state; narrowed to a pattern when asked.", + Input: map[string]any{"properties": map[string]any{"pattern": map[string]any{"description": "a glob the unit's name must match (optional)", "type": "string"}, "scope": map[string]any{"description": "\"system\" (the default) or \"user\": the operator account's own manager", "type": "string"}}, "type": "object"}, Replaces: []string{"systemctl list-units"}}, + {Name: "status", Description: "One unit as the service manager sees it now: its states, whether it starts at boot, its main process, and whether the mesh declares it.", + Input: map[string]any{"properties": map[string]any{"scope": map[string]any{"description": "\"system\" (the default) or \"user\": the operator account's own manager", "type": "string"}, "unit": map[string]any{"description": "the unit's name, as the service manager knows it", "type": "string"}}, "required": []string{"unit"}, "type": "object"}, Replaces: []string{"systemctl status", "systemctl is-active"}}, + {Name: "start", Description: "Start one unit. For a unit the mesh declares, the answer says the host will restore what its declaration says at the next apply.", + Input: map[string]any{"properties": map[string]any{"scope": map[string]any{"description": "\"system\" (the default) or \"user\": the operator account's own manager", "type": "string"}, "unit": map[string]any{"description": "the unit's name, as the service manager knows it", "type": "string"}}, "required": []string{"unit"}, "type": "object"}, Replaces: []string{"systemctl start"}}, + {Name: "stop", Description: "Stop one unit; for a mesh-declared unit the answer says the host will restore its declared state.", + Input: map[string]any{"properties": map[string]any{"scope": map[string]any{"description": "\"system\" (the default) or \"user\": the operator account's own manager", "type": "string"}, "unit": map[string]any{"description": "the unit's name, as the service manager knows it", "type": "string"}}, "required": []string{"unit"}, "type": "object"}, Replaces: []string{"systemctl stop"}}, + {Name: "restart", Description: "Restart one unit.", + Input: map[string]any{"properties": map[string]any{"scope": map[string]any{"description": "\"system\" (the default) or \"user\": the operator account's own manager", "type": "string"}, "unit": map[string]any{"description": "the unit's name, as the service manager knows it", "type": "string"}}, "required": []string{"unit"}, "type": "object"}, Replaces: []string{"systemctl restart"}}, + {Name: "enable", Description: "Make one unit start at boot (or at the account's login, in user scope).", + Input: map[string]any{"properties": map[string]any{"scope": map[string]any{"description": "\"system\" (the default) or \"user\": the operator account's own manager", "type": "string"}, "unit": map[string]any{"description": "the unit's name, as the service manager knows it", "type": "string"}}, "required": []string{"unit"}, "type": "object"}, Replaces: []string{"systemctl enable"}}, + {Name: "disable", Description: "Stop one unit starting at boot (or at login, in user scope).", + Input: map[string]any{"properties": map[string]any{"scope": map[string]any{"description": "\"system\" (the default) or \"user\": the operator account's own manager", "type": "string"}, "unit": map[string]any{"description": "the unit's name, as the service manager knows it", "type": "string"}}, "required": []string{"unit"}, "type": "object"}, Replaces: []string{"systemctl disable"}}, + {Name: "journal", Description: "The last lines of one unit's journal (at most 2000), in a time window and narrowed to a priority and to lines holding a text when asked. A secret the unit printed is shown as [redacted: ].", + Input: map[string]any{"properties": map[string]any{"lines": map[string]any{"description": "how many lines from the end of what matches (default 100, at most 2000)", "type": "string"}, "match": map[string]any{"description": "only the lines holding this text, as written — a fixed string, not a pattern (optional)", "type": "string"}, "priority": map[string]any{"description": "only entries this severe or more: 0-7 or emerg, alert, crit, err, warning, notice, info, debug (optional)", "type": "string"}, "scope": map[string]any{"description": "\"system\" (the default) or \"user\": the operator account's own manager", "type": "string"}, "since": map[string]any{"description": "the window's start: an RFC 3339 time (2026-10-07T09:30:00Z) or relative to now (-30min, -2h, yesterday) (optional)", "type": "string"}, "unit": map[string]any{"description": "the unit's name, as the service manager knows it", "type": "string"}, "until": map[string]any{"description": "the window's end, in the same forms (optional; now when absent)", "type": "string"}}, "required": []string{"unit"}, "type": "object"}, Replaces: []string{"journalctl"}}, + {Name: "failed", Description: "Every failed unit on this machine, in the system manager and in the operator account's; a manager that does not answer is reported with its error, never as nothing failed.", Optional: true, + Input: map[string]any{"properties": map[string]any{"scope": map[string]any{"description": "\"system\" or \"user\": only that manager (both when absent)", "type": "string"}}, "type": "object"}, Replaces: []string{"systemctl --failed"}}, + {Name: "reset-failed", Description: "Clear one unit's failed record in its manager — its failed state and its start-limit count — and answer its state after. It removes no file and starts nothing.", + Input: map[string]any{"properties": map[string]any{"scope": map[string]any{"description": "\"system\" (the default) or \"user\": the operator account's own manager", "type": "string"}, "unit": map[string]any{"description": "the unit's name, as the service manager knows it", "type": "string"}}, "required": []string{"unit"}, "type": "object"}, Replaces: []string{"systemctl reset-failed"}}, + {Name: "wanted-by", Description: "What wants, requires or triggers one unit, read-only: the manager's reverse dependencies (WantedBy, RequiredBy, UpheldBy, BoundBy, TriggeredBy and the rest) and every enable link naming it in the scope's configuration directories (*.wants, *.requires, *.upholds), each with where it points and whether it dangles — the account's own directory included in user scope.", + Input: map[string]any{"properties": map[string]any{"scope": map[string]any{"description": "\"system\" (the default) or \"user\": the operator account's own manager", "type": "string"}, "unit": map[string]any{"description": "the unit's name, as the service manager knows it", "type": "string"}}, "required": []string{"unit"}, "type": "object"}, Replaces: []string{"systemctl list-dependencies --reverse", "systemctl show -p WantedBy", "ls ~/.config/systemd/user/*.wants"}}, + {Name: "unlink-dangling", Description: "Remove the dangling enable links named for one unit — links in a *.wants, *.requires or *.upholds directory of the account's or the machine's own configuration whose target does not exist, which `disable` leaves once the unit's file is gone — on the person's word: `why` is required. Each is recorded (its path, its target, the reason) before it is removed, and the manager reloaded; a link whose target exists, or one a package, a generator or the runtime placed, is left and said.", + Input: map[string]any{"properties": map[string]any{"scope": map[string]any{"description": "\"system\" (the default) or \"user\": the operator account's own manager", "type": "string"}, "unit": map[string]any{"description": "the unit's name, as the service manager knows it", "type": "string"}, "why": map[string]any{"description": "the person's reason for removing the links, kept in the record", "type": "string"}}, "required": []string{"unit", "why"}, "type": "object"}, Replaces: []string{"rm ~/.config/systemd/user/*.wants/", "unlink /etc/systemd/system/*.wants/"}}, + }}, + {Name: NodePackageManager, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0207"}, + {Name: NodeContainerRuntime, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0166, ADR 0207"}, + {Name: NodeEnvironment, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0203"}, + {Name: NodeProvisioner, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0349"}, + {Name: NodeLoginShell, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0204", + Serves: []Verb{ + {Name: "execute", Description: "Run one command on this machine as the operator account, in a non-interactive login shell in its home; answers with what it printed and how it exited.", Optional: true, + Input: map[string]any{"properties": map[string]any{"command": map[string]any{"description": "the command line, as you would type it", "type": "string"}, "timeout_seconds": map[string]any{"description": "give up after this long, at most 25 (default 20)", "type": "string"}}, "required": []string{"command"}, "type": "object"}}, + }}, + {Name: NodePower, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0211"}, + {Name: NodeHotkeys, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0212", + Receives: []Receivable{{Kind: "trigger", Comment: "#"}}}, + {Name: NodeMessageBus, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0215"}, + {Name: NodeBackup, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0214", + Serves: []Verb{ + {Name: "backed-up", Description: "What this machine backs up: each module, what it declared, its last good night, how many restore points are kept and the repository's size.", + Input: map[string]any{"properties": map[string]any{"module": map[string]any{"description": "one module (optional)", "type": "string"}}, "type": "object"}, Replaces: []string{"restic snapshots"}}, + {Name: "now", Description: "Take a backup now, of one module or of every module on this machine — before a migration, a retirement or anything else that could go wrong.", + Input: map[string]any{"properties": map[string]any{"module": map[string]any{"description": "one module (optional)", "type": "string"}}, "type": "object"}, Replaces: []string{"restic backup"}}, + {Name: "restore", Description: "Restore one module's data from a restore point BESIDE the live data, never over it: each directory as .restored-. Swapping it in is a person's act. Lists the restore points when none is named.", + Input: map[string]any{"properties": map[string]any{"module": map[string]any{"description": "the module", "type": "string"}, "path": map[string]any{"description": "one of the module's directories (all of them when omitted)", "type": "string"}, "snapshot": map[string]any{"description": "the restore point (from `backed-up`; the newest when omitted)", "type": "string"}}, "required": []string{"module"}, "type": "object"}, Replaces: []string{"restic restore"}}, + }, + Receives: []Receivable{{Kind: "backup", Comment: "#", Dirs: true}, {Kind: "data", Comment: "#", Dirs: true}}}, + {Name: ThePrivateNetwork, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0110"}, + {Name: NodeUplink, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0117", + Serves: []Verb{ + {Name: "resolvers", Description: "The machine's resolver file as it is now: the resolvers, search domains and options it lists, whether it is the file the mesh declares, and when it is not, who wrote it as far as the machine shows — its header, a backup a VPN client left beside it, a link in its place, a known writer running.", Optional: true, + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {Name: "links", Description: "Every network link on the machine: its state, its addresses, whether the default route leaves through it, and the resolvers and search domains the network manager knows for it — a VPN's tunnel included.", Optional: true, + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + }, Paths: []Path{{Path: "/etc/resolv.conf", StepsBackFor: "node-resolver"}}}, + {Name: NodeResolver, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0247", + Serves: []Verb{ + {Name: "routes", Description: "What this machine's own resolver sends where: the mesh's resolvers, which answer every name not routed elsewhere, and each link given servers of its own with the domains routed to them. Also the resolver file's outside writes it kept, newest first: when, who wrote it as far as the file says, whether a module took it, and when the resolver's own file was put back.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}, Replaces: []string{"resolvectl status", "resolvectl dns", "resolvectl domain"}}, + {Name: "route", Description: "Send these domains, and every name under them, to these servers over this link — and only them: the link is never the machine's default route for names, and the mesh's own domain is refused. Replaces whatever the link was given before. A link that goes away takes its route with it.", + Input: map[string]any{"properties": map[string]any{"domains": map[string]any{"description": "the domains to route there, separated by spaces or commas", "type": "string"}, "link": map[string]any{"description": "the network link the servers are reached over, by name (a VPN's tunnel interface)", "type": "string"}, "servers": map[string]any{"description": "the servers' addresses, separated by spaces or commas", "type": "string"}}, "required": []string{"link", "domains", "servers"}, "type": "object"}, Replaces: []string{"resolvectl dns", "resolvectl domain", "resolvectl default-route"}}, + {Name: "unroute", Description: "Take one link's route away: its domains go back to the mesh's resolvers. Nothing changes when the link has none.", + Input: map[string]any{"properties": map[string]any{"link": map[string]any{"description": "the network link, by name", "type": "string"}}, "required": []string{"link"}, "type": "object"}, Replaces: []string{"resolvectl revert"}}, + }, Paths: []Path{{Path: "/etc/resolv.conf", StepsBackFor: ""}}}, + {Name: NodeNfsServer, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0263", + Serves: []Verb{ + {Name: "exports", Description: "Every share this machine exports: its name, its path, read-write or read-only, the owner every client is mapped to (uid and gid), each node it is exported to with that node's private address and access (only the nodes the server grants it to and that ask for it), what is granted and not asked for or asked for and not granted, and whether the kernel holds it now. Also the exports found that are not the mesh's: a dataset's sharenfs property, a line in /etc/exports.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}, Replaces: []string{"exportfs -v", "cat /etc/exports", "zfs get sharenfs"}}, + {Name: "clients", Description: "Which machines have mounted which share now, as the NFS server knows its clients.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}, Replaces: []string{"ss -tn sport = :2049", "cat /proc/fs/nfsd/clients/*/info"}}, + {Name: "test", Description: "Whether this machine exports one share for the mesh now, and whether its NFS service is up; with an address, also whether the share is exported to that address: a node's own private address, when the server grants it the share and the node asks for it. What a machine mounting the share asks before it mounts.", + Input: map[string]any{"properties": map[string]any{"address": map[string]any{"description": "a node's private address, to ask whether the share is exported to it (optional)", "type": "string"}, "share": map[string]any{"description": "the share, by its name", "type": "string"}}, "required": []string{"share"}, "type": "object"}, Replaces: []string{"showmount -e"}}, + {Name: "reload", Description: "Have the kernel read this machine's export files again now (exportfs -ra) and answer the shares as it then holds them. The module's own process writes its export file; this is for after a change made outside it. Changes no shared path.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}, Replaces: []string{"exportfs -ra"}}, + {Name: "adopt", Description: "Take over an export a person made by hand: clear a dataset's sharenfs property for a path the mesh's own export now serves — only when that export is live. Without confirm, says what it would do and changes nothing.", + Input: map[string]any{"properties": map[string]any{"confirm": map[string]any{"description": "\"true\": change it (needs why); anything else is a dry run", "enum": []string{"true", "false"}, "type": "string"}, "path": map[string]any{"description": "the shared path whose hand-made export is taken over", "type": "string"}, "why": map[string]any{"description": "why, for the record", "type": "string"}}, "required": []string{"path"}, "type": "object"}, Replaces: []string{"zfs set sharenfs=off"}}, + }}, + {Name: NodeMounts, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0263", + Serves: []Verb{ + {Name: "list", Description: "Every mount point on this machine: its fstab line, the mesh's mount and automount units for it, its state (armed, mounted, absent, unreachable, failed) and since when, and which settings asked for it. A password in a mount's options is never shown.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}, Replaces: []string{"cat /etc/fstab", "findmnt", "systemctl list-units --type=mount"}}, + {Name: "test", Description: "Whether one share's or occasional source's server answers from this machine now, without touching its mount point.", + Input: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the share or source, by its name", "type": "string"}}, "required": []string{"name"}, "type": "object"}, Replaces: []string{"showmount -e", "ping"}}, + {Name: "mount", Description: "Mount one share or occasional source now, rather than at its first access.", + Input: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the share or source, by its name", "type": "string"}}, "required": []string{"name"}, "type": "object"}, Replaces: []string{"mount"}}, + {Name: "unmount", Description: "Release one share or occasional source now; its automount stays armed, so the next access mounts it again.", + Input: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the share or source, by its name", "type": "string"}}, "required": []string{"name"}, "type": "object"}, Replaces: []string{"umount"}}, + {Name: "adopt", Description: "Take over a mount a person wrote by hand: comment out the /etc/fstab line for a mount point the mesh's own units now serve, keeping a copy of the file — only when the mesh's automount for it is armed. Without confirm, says what it would do and changes nothing.", + Input: map[string]any{"properties": map[string]any{"confirm": map[string]any{"description": "\"true\": change it (needs why); anything else is a dry run", "enum": []string{"true", "false"}, "type": "string"}, "mountpoint": map[string]any{"description": "the mount point whose fstab line is taken over", "type": "string"}, "why": map[string]any{"description": "why, for the record", "type": "string"}}, "required": []string{"mountpoint"}, "type": "object"}, Replaces: []string{"sed -i /etc/fstab"}}, + }}, + {Name: NodeReads, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0310", + Serves: []Verb{ + {Name: "stat", Description: "Each component of one path or several, from / down: its type, owner and group (name and number), mode, whether it is a link and to what, and whether it is a mount point and of which file system. A link is not followed unless follow is \"true\". Read as the holder's own account, which holds no secret: a component it may not reach says so. At most 200 paths in one call.", + Input: map[string]any{"properties": map[string]any{"follow": map[string]any{"description": "\"true\": also say where the path leads once every link is followed", "enum": []string{"true", "false"}, "type": "string"}, "paths": map[string]any{"description": "one absolute path, or several separated by line breaks", "type": "string"}}, "required": []string{"paths"}, "type": "object"}, Replaces: []string{"stat", "ls -ld", "namei -l", "findmnt -T"}}, + {Name: "readlink", Description: "What one link points to, as written, and where the path leads once every link is followed, and whether that exists.", + Input: map[string]any{"properties": map[string]any{"path": map[string]any{"description": "an absolute path", "type": "string"}}, "required": []string{"path"}, "type": "object"}, Replaces: []string{"readlink", "readlink -f", "realpath"}}, + {Name: "list", Description: "Every entry of one directory with its type, owner, group, mode, size and, for a link, its target. At most 2000 entries; a longer directory is cut and says so. A place a secret is kept is refused by name.", + Input: map[string]any{"properties": map[string]any{"path": map[string]any{"description": "an absolute path to a directory", "type": "string"}}, "required": []string{"path"}, "type": "object"}, Replaces: []string{"ls", "ls -la"}}, + {Name: "read", Description: "One text file, or a part of it by line: at most 256 KiB in one answer (64 KiB unless more is asked), cut at a line and said so. A binary file is refused; a place a secret is kept, or a known credential file, is refused by name; a line shaped like a secret is withheld and its number said. /proc and /sys are read as far as the holder's account may.", + Input: map[string]any{"properties": map[string]any{"bytes": map[string]any{"description": "the most bytes to answer, up to 262144 (optional, 65536 unless given)", "type": "string"}, "from": map[string]any{"description": "the first line to answer, counted from 1 (optional)", "type": "string"}, "lines": map[string]any{"description": "how many lines to answer (optional)", "type": "string"}, "path": map[string]any{"description": "an absolute path to a file", "type": "string"}}, "required": []string{"path"}, "type": "object"}, Replaces: []string{"cat", "head", "tail", "less"}}, + {Name: "search", Description: "Find a fixed string (never a pattern) in one file or under one directory: every matching line with its file and number. Bounded: at most 500 matches (100 unless more is asked), 8 directories deep (4 unless more is asked), 5000 files and 4 MiB per file; links are not followed and binary files are skipped. A place a secret is kept is skipped and named; a matching line shaped like a secret is withheld. The answer says which bound it met.", + Input: map[string]any{"properties": map[string]any{"case": map[string]any{"description": "\"false\": match whatever the case (optional)", "enum": []string{"true", "false"}, "type": "string"}, "depth": map[string]any{"description": "how many directories deep, up to 8 (optional)", "type": "string"}, "matches": map[string]any{"description": "the most matches to answer, up to 500 (optional)", "type": "string"}, "path": map[string]any{"description": "an absolute path to a file or a directory", "type": "string"}, "text": map[string]any{"description": "the fixed string to find", "type": "string"}}, "required": []string{"text", "path"}, "type": "object"}, Replaces: []string{"grep", "grep -r", "grep -F"}}, + {Name: "account", Description: "One account or group by name or number, as this node's account files say: an account's number, group, home, shell and every group it is in; a group's number and members. With neither, every account and group. Never a password field.", + Input: map[string]any{"properties": map[string]any{"group": map[string]any{"description": "a group's name or number (optional)", "type": "string"}, "name": map[string]any{"description": "an account's name or number (optional)", "type": "string"}}, "type": "object"}, Replaces: []string{"getent passwd", "getent group", "id", "groups"}}, + }}, + {Name: NodeFiles, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0394", + Serves: []Verb{ + {Name: "stat", Description: "Each component of one path or several, from / down: its type, owner and group (name and number), mode, whether it is a link and to what, and whether it is a mount point and of which file system. A link is not followed unless follow is \"true\". At most 200 paths in one call. Read as the node's operator account, through sudo -n where its rights do not reach; a place a secret is kept, or a known credential file, is refused by name.", + Input: map[string]any{"properties": map[string]any{"follow": map[string]any{"description": "\"true\": also say where the path leads once every link is followed", "enum": []string{"true", "false"}, "type": "string"}, "paths": map[string]any{"description": "one absolute path, or several separated by line breaks", "type": "string"}}, "required": []string{"paths"}, "type": "object"}, Replaces: []string{"stat", "ls -ld", "namei -l", "findmnt -T"}}, + {Name: "readlink", Description: "What one link points to, as written, and where the path leads once every link is followed, and whether that exists. Read as the node's operator account, through sudo -n where its rights do not reach; a place a secret is kept, or a known credential file, is refused by name.", + Input: map[string]any{"properties": map[string]any{"path": map[string]any{"description": "an absolute path", "type": "string"}}, "required": []string{"path"}, "type": "object"}, Replaces: []string{"readlink", "readlink -f", "realpath"}}, + {Name: "list", Description: "Every entry of one directory with its type, owner, group, mode, size and, for a link, its target. At most 2000 entries; a longer directory is cut and says so. A place a secret is kept is refused by name. Read as the node's operator account, through sudo -n where its rights do not reach; a place a secret is kept, or a known credential file, is refused by name.", + Input: map[string]any{"properties": map[string]any{"path": map[string]any{"description": "an absolute path to a directory", "type": "string"}}, "required": []string{"path"}, "type": "object"}, Replaces: []string{"ls", "ls -la"}}, + {Name: "read", Description: "One text file, or a part of it by line: at most 256 KiB in one answer (64 KiB unless more is asked), cut at a line and said so. A binary file is refused; a place a secret is kept, or a known credential file, is refused by name; a line shaped like a secret is withheld and its number said. /proc and /sys are read as far as the holder's account may. Read as the node's operator account, through sudo -n where its rights do not reach; a place a secret is kept, or a known credential file, is refused by name.", + Input: map[string]any{"properties": map[string]any{"bytes": map[string]any{"description": "the most bytes to answer, up to 262144 (optional, 65536 unless given)", "type": "string"}, "from": map[string]any{"description": "the first line to answer, counted from 1 (optional)", "type": "string"}, "lines": map[string]any{"description": "how many lines to answer (optional)", "type": "string"}, "path": map[string]any{"description": "an absolute path to a file", "type": "string"}}, "required": []string{"path"}, "type": "object"}, Replaces: []string{"cat", "head", "tail", "less"}}, + {Name: "search", Description: "Find a fixed string (never a pattern) in one file or under one directory: every matching line with its file and number. Bounded: at most 500 matches (100 unless more is asked), 8 directories deep (4 unless more is asked), 5000 files and 4 MiB per file; links are not followed and binary files are skipped. A place a secret is kept is skipped and named; a matching line shaped like a secret is withheld. The answer says which bound it met. Read as the node's operator account, through sudo -n where its rights do not reach; a place a secret is kept, or a known credential file, is refused by name.", + Input: map[string]any{"properties": map[string]any{"case": map[string]any{"description": "\"false\": match whatever the case (optional)", "enum": []string{"true", "false"}, "type": "string"}, "depth": map[string]any{"description": "how many directories deep, up to 8 (optional)", "type": "string"}, "matches": map[string]any{"description": "the most matches to answer, up to 500 (optional)", "type": "string"}, "path": map[string]any{"description": "an absolute path to a file or a directory", "type": "string"}, "text": map[string]any{"description": "the fixed string to find", "type": "string"}}, "required": []string{"text", "path"}, "type": "object"}, Replaces: []string{"grep", "grep -r", "grep -F"}}, + {Name: "account", Description: "One account or group by name or number, as this node's account files say: an account's number, group, home, shell and every group it is in; a group's number and members. With neither, every account and group. Never a password field. Read as the node's operator account, through sudo -n where its rights do not reach; a place a secret is kept, or a known credential file, is refused by name.", + Input: map[string]any{"properties": map[string]any{"group": map[string]any{"description": "a group's name or number (optional)", "type": "string"}, "name": map[string]any{"description": "an account's name or number (optional)", "type": "string"}}, "type": "object"}, Replaces: []string{"getent passwd", "getent group", "id", "groups"}}, + {Name: "write", Description: "Write one text file whole, replacing what it holds; the old content goes to the node's trash. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + Input: map[string]any{"properties": map[string]any{"content": map[string]any{"description": "the text to write", "type": "string"}, "mode": map[string]any{"description": "the file's mode, such as 0644 (optional)", "enum": []string{"true", "false"}, "type": "string"}, "override": map[string]any{"description": "a reason, to change a path a module owns anyway (optional)", "enum": []string{"true", "false"}, "type": "string"}, "path": map[string]any{"description": "an absolute path", "type": "string"}, "reason": map[string]any{"description": "why the file is changed, for the audit trail", "type": "string"}}, "required": []string{"path", "content", "reason"}, "type": "object"}, Replaces: []string{"tee", ">"}}, + {Name: "copy", Description: "Copy a file or directory to a path on this node. A target on another node (:/path) is refused: copying between nodes comes in step 2 (issue 903). An existing target is overwritten, the old one kept in the node's trash for 7 days. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + Input: map[string]any{"properties": map[string]any{"from": map[string]any{"description": "an absolute path", "type": "string"}, "override": map[string]any{"description": "a reason, to change a path a module owns anyway (optional)", "enum": []string{"true", "false"}, "type": "string"}, "reason": map[string]any{"description": "why the file is changed, for the audit trail", "type": "string"}, "to": map[string]any{"description": "an absolute path on this node", "type": "string"}}, "required": []string{"from", "to", "reason"}, "type": "object"}, Replaces: []string{"cp", "cp -a", "ssh cp"}}, + {Name: "move", Description: "Move or rename a file or directory. A target on another node is refused: copying between nodes comes in step 2 (issue 903). An existing target is overwritten, the old one kept in the node's trash for 7 days. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + Input: map[string]any{"properties": map[string]any{"from": map[string]any{"description": "an absolute path", "type": "string"}, "override": map[string]any{"description": "a reason, to change a path a module owns anyway (optional)", "enum": []string{"true", "false"}, "type": "string"}, "reason": map[string]any{"description": "why the file is changed, for the audit trail", "type": "string"}, "to": map[string]any{"description": "an absolute path", "type": "string"}}, "required": []string{"from", "to", "reason"}, "type": "object"}, Replaces: []string{"mv"}}, + {Name: "delete", Description: "Delete a file or directory into the node's trash, where restore can bring it back. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + Input: map[string]any{"properties": map[string]any{"override": map[string]any{"description": "a reason, to change a path a module owns anyway (optional)", "enum": []string{"true", "false"}, "type": "string"}, "path": map[string]any{"description": "an absolute path", "type": "string"}, "reason": map[string]any{"description": "why the file is changed, for the audit trail", "type": "string"}, "recursive": map[string]any{"description": "\"true\": delete a directory with what it holds", "enum": []string{"true", "false"}, "type": "string"}}, "required": []string{"path", "reason"}, "type": "object"}, Replaces: []string{"rm", "rm -r"}}, + {Name: "mkdir", Description: "Make a directory. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + Input: map[string]any{"properties": map[string]any{"override": map[string]any{"description": "a reason, to change a path a module owns anyway (optional)", "enum": []string{"true", "false"}, "type": "string"}, "parents": map[string]any{"description": "\"true\": make the missing parents too", "enum": []string{"true", "false"}, "type": "string"}, "path": map[string]any{"description": "an absolute path", "type": "string"}, "reason": map[string]any{"description": "why the file is changed, for the audit trail", "type": "string"}}, "required": []string{"path", "reason"}, "type": "object"}, Replaces: []string{"mkdir", "mkdir -p"}}, + {Name: "chmod", Description: "Change the mode of a file or directory. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + Input: map[string]any{"properties": map[string]any{"mode": map[string]any{"description": "the mode, such as 0644 or u+x", "type": "string"}, "override": map[string]any{"description": "a reason, to change a path a module owns anyway (optional)", "enum": []string{"true", "false"}, "type": "string"}, "path": map[string]any{"description": "an absolute path", "type": "string"}, "reason": map[string]any{"description": "why the file is changed, for the audit trail", "type": "string"}, "recursive": map[string]any{"description": "\"true\": also everything under a directory", "enum": []string{"true", "false"}, "type": "string"}}, "required": []string{"path", "mode", "reason"}, "type": "object"}, Replaces: []string{"chmod"}}, + {Name: "chown", Description: "Change the owner and group of a file or directory. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + Input: map[string]any{"properties": map[string]any{"group": map[string]any{"description": "a group's name or number (optional)", "enum": []string{"true", "false"}, "type": "string"}, "override": map[string]any{"description": "a reason, to change a path a module owns anyway (optional)", "enum": []string{"true", "false"}, "type": "string"}, "owner": map[string]any{"description": "an account's name or number", "type": "string"}, "path": map[string]any{"description": "an absolute path", "type": "string"}, "reason": map[string]any{"description": "why the file is changed, for the audit trail", "type": "string"}, "recursive": map[string]any{"description": "\"true\": also everything under a directory", "enum": []string{"true", "false"}, "type": "string"}}, "required": []string{"path", "owner", "reason"}, "type": "object"}, Replaces: []string{"chown", "chgrp"}}, + {Name: "upload", Description: "Send one file of this node into a bucket of the object store, over a short signed link and never over the bus; answers the key (the file's SHA-256 when none is given), the size and the SHA-256. At most 100 MiB. A place a secret is kept, a known credential file, or a link to one is refused by name, before anything is sent. Read as the node's operator account, through sudo -n where its rights do not reach; a place a secret is kept, or a known credential file, is refused by name.", + Input: map[string]any{"properties": map[string]any{"bucket": map[string]any{"description": "the bucket the file goes into", "type": "string"}, "key": map[string]any{"description": "the object's key (optional; the file's SHA-256 when not given)", "type": "string"}, "path": map[string]any{"description": "an absolute path to a file", "type": "string"}}, "required": []string{"path", "bucket"}, "type": "object"}}, + {Name: "download", Description: "Write one object of a bucket to a file of this node, over a short signed link and never over the bus; the old file goes to the node's trash. At most 100 MiB. The bytes must hash to sha256, or to the key when the key is a SHA-256; otherwise no file is written. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + Input: map[string]any{"properties": map[string]any{"bucket": map[string]any{"description": "the bucket", "type": "string"}, "key": map[string]any{"description": "the object's key", "type": "string"}, "override": map[string]any{"description": "a reason, to change a path a module owns anyway (optional)", "type": "string"}, "path": map[string]any{"description": "an absolute path", "type": "string"}, "reason": map[string]any{"description": "why the file is changed, for the audit trail", "type": "string"}, "sha256": map[string]any{"description": "the SHA-256 the bytes must have (optional; the key when that is a SHA-256)", "type": "string"}}, "required": []string{"bucket", "key", "path", "reason"}, "type": "object"}}, + {Name: "trash", Description: "What the node's trash holds: each deleted or replaced item with its id, original path and when it went.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}, Replaces: []string{"ls ~/.local/share/Trash"}}, + {Name: "restore", Description: "Put an item of the node's trash back where it was; refuses when something is there now. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + Input: map[string]any{"properties": map[string]any{"id": map[string]any{"description": "an id from trash", "type": "string"}, "override": map[string]any{"description": "a reason, to change a path a module owns anyway (optional)", "enum": []string{"true", "false"}, "type": "string"}, "reason": map[string]any{"description": "why the file is changed, for the audit trail", "type": "string"}}, "required": []string{"id", "reason"}, "type": "object"}, Replaces: []string{"trash-restore"}}, + }}, + {Name: NodeEngine, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0563", Emits: []string{"asked", "done", "refused"}, HeldByTheEngine: true, + Serves: []Verb{ + {Name: "hand-over", Description: "Hand a directory this machine uses as found to the mesh (novox/hq ADR 0563 §3, §5): the engine judges the path as it does every hand-over (absolute, as it states it, used as found, reached through no link) and refuses in words, or asks the operator on their channel at the level approve, binding the owner, group and mode it will set. Nothing changes on the call: only the operator's yes hands it over. One ask is open per path; acts shows where it stands.", + Input: map[string]any{"properties": map[string]any{"path": map[string]any{"description": "the directory's absolute path, as the engine states it", "type": "string"}, "why": map[string]any{"description": "why it is asked, in words the operator reads", "type": "string"}}, "required": []string{"path"}, "type": "object"}}, + {Name: "access-act", Description: "Ask the operator for the take act on a library whose root holds data outside its group (novox/hq ADR 0328 §7, ADR 0563 §3, §4), on the library's home engine: the access as declared and its root as last declared, judged and refused in words or asked at the level approve. Only the operator's yes sets the library's group, group write and setgid under its root. One ask is open per access.", + Input: map[string]any{"properties": map[string]any{"access": map[string]any{"description": "the access, library:", "type": "string"}, "act": map[string]any{"description": "the act: take", "type": "string"}, "why": map[string]any{"description": "why it is asked, in words the operator reads", "type": "string"}}, "required": []string{"act", "access"}, "type": "object"}}, + {Name: "judge-directories", Description: "Which of this machine's declared directories the engine would refuse to make or keep, one line each (novox/hq ADR 0563 §2). Read-only: changes no owner or mode.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {Name: "setuid-search", Description: "Throw away the engine's last search for setuid programs and start a full one (novox/hq ADR 0563 §2); until it completes root-free answers that the machine is not judged yet. Refused while one runs, and when one was started within the hour, naming when the next may start.", + Input: map[string]any{"properties": map[string]any{"why": map[string]any{"description": "why it is asked, in words", "type": "string"}}, "type": "object"}}, + {Name: "root-free", Description: "Whether this machine is root-free (novox/hq ADR 0259 §8, ADR 0563 §6): free only on the engine's own verdict, at most fifteen minutes old, that the account agents run as cannot become root without a person, and the login shell's execute not served here. Anything else is no pass, and says why. Answered by this machine's engine alone.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {Name: "acts", Description: "Every act this machine's engine was asked through this seat (novox/hq ADR 0563 §9): each hand-over, access act and setuid search, open, done or refused, with who asked, the ask and the operator's warrant. Read-only.", + Input: map[string]any{"properties": map[string]any{"id": map[string]any{"description": "one act, by its id", "type": "string"}, "limit": map[string]any{"description": "at most this many, newest", "type": "string"}}, "type": "object"}}, + {Name: "packages", Description: "The packages this machine's compositions declare, present or absent, each with the modules that declare it, as the engine keeps them in its key of `packages`; until the controller hands its lease away, beside the controller's mirror for this machine and their difference. With write, the key written again from what the engine composed.", Optional: true, + Input: map[string]any{"properties": map[string]any{"write": map[string]any{"description": "\"true\": write this machine's key again from what the engine composed", "enum": []string{"true", "false"}, "type": "string"}}, "type": "object"}}, + {Name: "composition", Description: "One module's composition on this machine beside what runs of it, read-only: the composition its want's build has in the bucket composed- (the latest revision, or the one whose digest is given, from the revisions the bucket keeps), the digest of each kept revision, what runs (applied, its have, or the kept declaration), its want and have (phase running, failed, held or waiting-yes, and the digest that waits for a yes), and the move's judgement with its words: why a record module waits for a yes. With diff, every resource added, removed or changed, a provider's received file naming the consumers that join or leave.", Optional: true, + Input: map[string]any{"properties": map[string]any{"diff": map[string]any{"description": "\"true\": list the resources that differ from what runs", "type": "string"}, "digest": map[string]any{"description": "a composition's digest (sha256:…), to read that revision rather than the latest", "type": "string"}, "module": map[string]any{"description": "the module, as placed on this machine; node for the node's own", "type": "string"}}, "required": []string{"module"}, "type": "object"}}, + {Name: "compose", Description: "Compose this machine's modules now and say how it went, so a composition that failed, or a module held, recovers without a restart: what the pass refused or held, each with why, and when the engine composes again on its own after a seat that did not answer (a deadline, no responders: retried with a growing wait; a refusal never). With module, that module's apply is also tried again. Changes only what a pass the engine makes on its own would change.", Optional: true, + Input: map[string]any{"properties": map[string]any{"module": map[string]any{"description": "a module placed on this machine whose apply is also tried again (optional)", "type": "string"}}, "type": "object"}}, + {Name: "compose-candidate", Description: "Compose a check's candidate on this machine in shadow, with its own sealed values and the indexer's manifest verdicts, and say per module placed here whether it composes (with its digest and whether the candidate changes it), is refused by the candidate or is held without it, each with why, and the verdict of the machine's own composition (novox/hq ADR 0593 §7). Read-only: applies nothing and writes nothing. Answered by this machine's engine alone, within the asker's bound.", Optional: true, + Input: map[string]any{"properties": map[string]any{"candidate": map[string]any{"description": "the key of the indexer's candidate, .", "type": "string"}, "input": map[string]any{"description": "\"true\": also answer the composition input the candidate was composed from, for the sandbox path", "enum": []string{"true", "false"}, "type": "string"}}, "required": []string{"candidate"}, "type": "object"}}, + }}, + {Name: NodeLoginManager, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0208", + Serves: []Verb{ + {Name: "sessions", Description: "The sessions the login manager offers on this machine, and which one the operator account starts by default.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + }}, + {Name: NodeDisplayServer, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0208", + Serves: []Verb{ + {Name: "displays", Description: "The monitors connected now, each with its identity, its modes and where it is placed; and the layout profile in force, if one matches.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {Name: "layout", Description: "The monitor layout profiles, keyed by the connected monitors' identities: list them, save the current arrangement under a name, or apply one.", + Input: map[string]any{"properties": map[string]any{"action": map[string]any{"description": "list, save or apply", "enum": []string{"list", "save", "apply"}, "type": "string"}, "name": map[string]any{"description": "the profile to save or apply (save and apply only)", "type": "string"}}, "required": []string{"action"}, "type": "object"}}, + }}, + {Name: NodeDisplaySession, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0208", + Serves: []Verb{ + {Name: "reload", Description: "Reload the session's configuration in place, keeping its windows.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {Name: "workspaces", Description: "The session's workspaces: each one's name, output, and whether it is visible or focused.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + {Name: "windows", Description: "The session's windows: each one's title, class, workspace and whether it has focus; narrowed to one workspace when named.", + Input: map[string]any{"properties": map[string]any{"workspace": map[string]any{"description": "one workspace (optional)", "type": "string"}}, "type": "object"}}, + }, + Receives: []Receivable{{Kind: "config", Comment: "#"}}}, + {Name: NodeTerminalEmulator, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0208", + Serves: []Verb{ + {Name: "open", Description: "Open a terminal window in the operator's session, running a command or the login shell, in a directory or the account's home.", + Input: map[string]any{"properties": map[string]any{"command": map[string]any{"description": "what to run in it (optional; the login shell when absent)", "type": "string"}, "directory": map[string]any{"description": "where it starts (optional; the account's home when absent)", "type": "string"}}, "type": "object"}}, + }}, + {Name: NodeLauncher, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0208", + Serves: []Verb{ + {Name: "menu", Description: "Put a menu of choices in front of the operator and answer with the one chosen, or nothing when the menu was dismissed — the dmenu-compatible contract.", + Input: map[string]any{"properties": map[string]any{"choices": map[string]any{"description": "the lines to choose between, in order", "items": map[string]any{"type": "string"}, "type": "array"}, "prompt": map[string]any{"description": "what the menu asks (optional)", "type": "string"}}, "required": []string{"choices"}, "type": "object"}}, + {Name: "secret", Description: "Ask the operator for a value in a prompt that does not show what is typed, and answer it sealed to the key the asker gives — never in the clear — or cancelled when the prompt was dismissed or not answered in time.", Optional: true, + Input: map[string]any{"properties": map[string]any{"module": map[string]any{"description": "the module whose own secret is asked for", "type": "string"}, "node": map[string]any{"description": "the machine the module runs on", "type": "string"}, "seal_to": map[string]any{"description": "the asker's public sealing key: the answer is sealed to it", "type": "string"}, "secret": map[string]any{"description": "the own secret's name", "type": "string"}, "timeout_seconds": map[string]any{"description": "give up after this long (optional)", "type": "string"}}, "required": []string{"module", "secret", "node", "seal_to"}, "type": "object"}}, + }}, + {Name: NodeNotifier, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0208", + Serves: []Verb{ + {Name: "send", Description: "Show the operator a notification.", + Input: map[string]any{"properties": map[string]any{"body": map[string]any{"description": "its text (optional)", "type": "string"}, "title": map[string]any{"description": "the notification's summary", "type": "string"}, "urgency": map[string]any{"description": "low, normal (the default) or critical", "enum": []string{"low", "normal", "critical"}, "type": "string"}}, "required": []string{"title"}, "type": "object"}}, + {Name: "history", Description: "The notifications shown lately, newest first.", + Input: map[string]any{"properties": map[string]any{"limit": map[string]any{"description": "how many (optional, default 20)", "type": "string"}}, "type": "object"}}, + }}, + {Name: NodeLockScreen, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0208", + Serves: []Verb{ + {Name: "lock", Description: "Lock the operator's session now.", + Input: map[string]any{"properties": map[string]any{}, "type": "object"}}, + }}, + {Name: NodeClipboard, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0208", + Serves: []Verb{ + {Name: "history", Description: "What the clipboard held lately, newest first.", + Input: map[string]any{"properties": map[string]any{"limit": map[string]any{"description": "how many (optional, default 20)", "type": "string"}}, "type": "object"}}, + {Name: "copy", Description: "Put text on the operator's clipboard.", + Input: map[string]any{"properties": map[string]any{"text": map[string]any{"description": "the text", "type": "string"}}, "required": []string{"text"}, "type": "object"}}, + }}, + {Name: NodeBar, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0208", + Receives: []Receivable{{Kind: "block", Comment: "#", Offered: true, Shape: &Shape{Places: []PlaceField{{Field: "bar", Values: []string{"bottom", "top"}}, {Field: "place", Values: []string{"resources", "status"}}}, Order: "order", Examples: []map[string]any{map[string]any{"bar": "bottom", "place": "status", "shows": "battery"}, map[string]any{"bar": "bottom", "options": map[string]any{"device": "BAT0"}, "place": "status", "shows": "battery"}, map[string]any{"bar": "bottom", "options": map[string]any{"command": "echo \"a line\"", "interval": float64(5)}, "place": "status", "shows": "command"}, map[string]any{"bar": "bottom", "options": map[string]any{"state": "power.draw"}, "place": "status", "shows": "state"}, map[string]any{"bar": "bottom", "options": map[string]any{"key": "a-machine", "state": "power.draw"}, "place": "status", "shows": "state"}}, Text: true}}}}, + {Name: NodeCompositor, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0208"}, + {Name: NodeSecretService, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0208"}, + } +} diff --git a/ts/package.json b/ts/package.json new file mode 100644 index 0000000..28bd3f5 --- /dev/null +++ b/ts/package.json @@ -0,0 +1,19 @@ +{ + "description": "The mesh's seat contracts, generated from their definitions.", + "devDependencies": { + "typescript": "^5.6.0" + }, + "exports": { + ".": "./dist/index.js" + }, + "files": [ + "dist" + ], + "name": "@novox/mesh-contracts", + "scripts": { + "build": "tsc", + "prepare": "tsc" + }, + "type": "module", + "version": "0.1.0" +} diff --git a/ts/src/container-image-registry.ts b/ts/src/container-image-registry.ts new file mode 100644 index 0000000..ca92d41 --- /dev/null +++ b/ts/src/container-image-registry.ts @@ -0,0 +1,155 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// The contract of the seat "container-image-registry", defined whole (seats/container-image-registry/seat.json): The mesh's container images, in the one artifact store: the OCI distribution protocol's read side, an image's tags and mirroring an outside image. + +import type * as registry from "./parts/registry.js"; + +export const seat = "container-image-registry"; + +export const verbs = { + publish: "publish", + publishPart: "publish-part", + versions: "versions", + remove: "remove", + mirror: "mirror", + tags: "tags", + hold: "hold", + release: "release", +} as const; + +export const events = { + published: "published", + refused: "refused", + removed: "removed", + held: "held", + released: "released", +} as const; + +export const family = { name: "container-image-registry.events", maxAgeDays: 7 } as const; + +export const publishedSubject = "mesh.seat.container-image-registry.event.published"; + +export const refusedSubject = "mesh.seat.container-image-registry.event.refused"; + +export const removedSubject = "mesh.seat.container-image-registry.event.removed"; + +export const heldSubject = "mesh.seat.container-image-registry.event.held"; + +export const releasedSubject = "mesh.seat.container-image-registry.event.released"; + +export type Artifact = registry.Artifact; +export type Outcome = registry.Outcome; +export type Part = registry.Part; +export type PublishAnswer = registry.PublishAnswer; +export type PublishInput = registry.PublishInput; +export type PublishPartAnswer = registry.PublishPartAnswer; +export type PublishPartInput = registry.PublishPartInput; +export type PublishedEvent = registry.PublishedEvent; +export type RefusedEvent = registry.RefusedEvent; +export type RemoveAnswer = registry.RemoveAnswer; +export type RemoveInput = registry.RemoveInput; +export type RemovedEvent = registry.RemovedEvent; +export type VersionsAnswer = registry.VersionsAnswer; +export type VersionsInput = registry.VersionsInput; + +/** the body of held and released */ +export interface Hold { + /** when, RFC 3339 */ + "at"?: string; + /** the caller the holder proved */ + "by"?: string; + /** the digest */ + "digest": string; + /** the module holding the seat */ + "holder": string; + /** the name */ + "name": string; + /** why */ + "reason"?: string; +} + +/** is what mirror takes. */ +export interface MirrorInput { + /** its pinned digest, sha256: */ + "digest": string; + /** the name it is kept under */ + "name": string; + /** the outside image's reference */ + "source": string; +} + +/** is what mirror answers. */ +export interface MirrorAnswer { + /** the digest stored */ + "digest": string; + /** the reference the seat answers */ + "reference": string; +} + +/** is what tags takes. */ +export interface TagsInput { + /** the image */ + "name": string; +} + +export interface TagsAnswerTagsItem { + /** its digest */ + "digest": string; + /** the tag */ + "tag": string; +} + +/** is what tags answers. */ +export interface TagsAnswer { + /** the image */ + "name": string; + /** every tag */ + "tags": TagsAnswerTagsItem[]; +} + +/** is what hold takes. */ +export interface HoldInput { + /** the digest */ + "digest": string; + /** the name */ + "name": string; + /** which of the sweep's rules keeps it */ + "reason": string; +} + +/** is what hold answers. */ +export interface HoldAnswer { + /** it is held */ + "held": boolean; + /** when the hold began, RFC 3339 */ + "since"?: string; +} + +/** is what release takes. */ +export interface ReleaseInput { + /** the digest */ + "digest": string; + /** the name */ + "name": string; + /** why it is let go */ + "reason": string; +} + +/** is what release answers. */ +export interface ReleaseAnswer { + /** the hold is gone */ + "released": boolean; +} + +/** is the body of the event held. */ +export type HeldEvent = Hold; + +/** is the body of the event released. */ +export type ReleasedEvent = Hold; + +/** is the form of the provision artifact-store. */ +export interface ArtifactStoreForm { + /** the store's address */ + "url": string; +} + diff --git a/ts/src/go-package-registry.ts b/ts/src/go-package-registry.ts new file mode 100644 index 0000000..834ecb3 --- /dev/null +++ b/ts/src/go-package-registry.ts @@ -0,0 +1,50 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// The contract of the seat "go-package-registry", defined whole (seats/go-package-registry/seat.json): The mesh's Go modules: Go's module proxy protocol's read side, and publishing over the bus. + +import type * as registry from "./parts/registry.js"; + +export const seat = "go-package-registry"; + +export const verbs = { + publish: "publish", + publishPart: "publish-part", + versions: "versions", + remove: "remove", +} as const; + +export const events = { + published: "published", + refused: "refused", + removed: "removed", +} as const; + +export const family = { name: "go-package-registry.events", maxAgeDays: 7 } as const; + +export const publishedSubject = "mesh.seat.go-package-registry.event.published"; + +export const refusedSubject = "mesh.seat.go-package-registry.event.refused"; + +export const removedSubject = "mesh.seat.go-package-registry.event.removed"; + +export type Artifact = registry.Artifact; +export type Outcome = registry.Outcome; +export type Part = registry.Part; +export type PublishAnswer = registry.PublishAnswer; +export type PublishInput = registry.PublishInput; +export type PublishPartAnswer = registry.PublishPartAnswer; +export type PublishPartInput = registry.PublishPartInput; +export type PublishedEvent = registry.PublishedEvent; +export type RefusedEvent = registry.RefusedEvent; +export type RemoveAnswer = registry.RemoveAnswer; +export type RemoveInput = registry.RemoveInput; +export type RemovedEvent = registry.RemovedEvent; +export type VersionsAnswer = registry.VersionsAnswer; +export type VersionsInput = registry.VersionsInput; + +/** is the form of the provision go-package-registry. */ +export interface GoPackageRegistryForm { + /** the read side's address */ + "url": string; +} + diff --git a/ts/src/index.ts b/ts/src/index.ts new file mode 100644 index 0000000..18984e2 --- /dev/null +++ b/ts/src/index.ts @@ -0,0 +1,12 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +export * as seats from "./seats.js"; +export * as meshBroker from "./mesh-broker.js"; +export * as meshVault from "./mesh-vault.js"; +export * as meshConfig from "./mesh-config.js"; +export * as meshDeliveryChecker from "./mesh-delivery-checker.js"; +export * as operatorChannel from "./operator-channel.js"; +export * as npmPackageRegistry from "./npm-package-registry.js"; +export * as goPackageRegistry from "./go-package-registry.js"; +export * as containerImageRegistry from "./container-image-registry.js"; +export * as ociArtifactRegistry from "./oci-artifact-registry.js"; diff --git a/ts/src/mesh-broker.ts b/ts/src/mesh-broker.ts new file mode 100644 index 0000000..5f94f67 --- /dev/null +++ b/ts/src/mesh-broker.ts @@ -0,0 +1,261 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// The contract of the seat "mesh-broker", defined whole (seats/mesh-broker/seat.json): The mesh's bus, and the bus state modules ask of it in requires (design 25 § 12). create, apply, recreate and drop are granted to the bus module's own credential alone. + +export const seat = "mesh-broker"; + +export const verbs = { + list: "list", + show: "show", + check: "check", + orphans: "orphans", + create: "create", + apply: "apply", + recreate: "recreate", + drop: "drop", +} as const; + +export const events = { + created: "created", + refused: "refused", + drifted: "drifted", + driftCleared: "drift-cleared", + full: "full", + fullCleared: "full-cleared", + orphaned: "orphaned", + recreated: "recreated", + dropped: "dropped", +} as const; + +export const family = { name: "mesh-broker.events", maxAgeDays: 30, maxMiB: 256 } as const; + +export const createdSubject = "mesh.seat.mesh-broker.event.created"; + +export const refusedSubject = "mesh.seat.mesh-broker.event.refused"; + +export const driftedSubject = "mesh.seat.mesh-broker.event.drifted"; + +export const driftClearedSubject = "mesh.seat.mesh-broker.event.drift-cleared"; + +export const fullSubject = "mesh.seat.mesh-broker.event.full"; + +export const fullClearedSubject = "mesh.seat.mesh-broker.event.full-cleared"; + +export const orphanedSubject = "mesh.seat.mesh-broker.event.orphaned"; + +export const recreatedSubject = "mesh.seat.mesh-broker.event.recreated"; + +export const droppedSubject = "mesh.seat.mesh-broker.event.dropped"; + +/** one piece of bus state as a manifest asks it */ +export interface Entry { + /** its own configuration, where no template fits */ + "configuration"?: Record; + /** its local name in the module's manifest */ + "local-name": string; + /** the module asking it */ + "module": string; + /** the template's options the module set, within their bounds */ + "options"?: Record; + /** how the bus keeps it */ + "storage-type": "stream" | "key-value" | "object-store" | "ledger"; + /** its template; empty for a configuration of its own */ + "template"?: "state" | "events" | "work-queue" | "log" | "objects" | "ledger" | ""; +} + +export interface Fill { + /** bytes held */ + "bytes": number; + /** its cap in bytes */ + "cap": number; + /** messages, keys or objects held */ + "count": number; +} + +/** one entry as the bus holds it */ +export interface Held { + /** its name on the bus, _ */ + "bus-name": string; + /** its own configuration, where no template fits */ + "configuration"?: Record; + "fill"?: Fill; + /** its local name in the module's manifest */ + "local-name": string; + /** the module asking it */ + "module": string; + /** the template's options the module set, within their bounds */ + "options"?: Record; + /** the settings the bus holds */ + "settings"?: Record; + /** how the bus keeps it */ + "storage-type": "stream" | "key-value" | "object-store" | "ledger"; + /** its template; empty for a configuration of its own */ + "template"?: "state" | "events" | "work-queue" | "log" | "objects" | "ledger" | ""; +} + +export interface Named { + /** the entry's local name */ + "local-name": string; + /** the module */ + "module": string; +} + +/** the body of every event of the seat */ +export interface Said { + /** the settings asked */ + "asked"?: Record; + /** its name on the bus */ + "bus-name": string; + /** its own configuration, where no template fits */ + "configuration"?: Record; + "fill"?: Fill; + /** the settings held */ + "held"?: Record; + /** its local name in the module's manifest */ + "local-name": string; + /** the module asking it */ + "module": string; + /** the template's options the module set, within their bounds */ + "options"?: Record; + /** the stream snapshot taken before a recreate or drop */ + "snapshot"?: string; + /** how the bus keeps it */ + "storage-type"?: "stream" | "key-value" | "object-store" | "ledger"; + /** its template; empty for a configuration of its own */ + "template"?: "state" | "events" | "work-queue" | "log" | "objects" | "ledger" | ""; + /** why: a refusal's cause, a drift's difference, a drop's or recreate's reason */ + "why"?: string; +} + +export interface Warranted { + /** the entry's local name */ + "local-name": string; + /** the module */ + "module": string; + /** the operator's warrant, as the operator channel decided it (ADR 0259 §6) */ + "warrant": string; + /** why, kept in the record */ + "why": string; +} + +/** is what list takes. */ +export interface ListInput { + /** one module (optional) */ + "module"?: string; +} + +/** is what list answers. */ +export interface ListAnswer { + /** every entry */ + "entries": Held[]; +} + +/** is what show takes. */ +export type ShowInput = Named; + +/** is what show answers. */ +export type ShowAnswer = Held; + +/** is what check takes. */ +export interface CheckInput { + /** one module (optional) */ + "module"?: string; +} + +export interface CheckAnswerDifferencesItem { + /** asked */ + "asked"?: Record; + /** the difference only grows: apply may act on it */ + "grows"?: boolean; + /** held */ + "held"?: Record; + /** the entry */ + "local-name": string; + /** the module */ + "module": string; +} + +/** is what check answers. */ +export interface CheckAnswer { + /** every difference */ + "differences": CheckAnswerDifferencesItem[]; +} + +/** is what orphans takes. */ +export interface OrphansInput { +} + +/** is what orphans answers. */ +export interface OrphansAnswer { + /** every orphan */ + "entries": Held[]; +} + +/** is what create takes. */ +export type CreateInput = Entry; + +/** is what create answers. */ +export type CreateAnswer = Held; + +/** is what apply takes. */ +export type ApplyInput = Named; + +/** is what apply answers. */ +export type ApplyAnswer = Held; + +/** is what recreate takes. */ +export type RecreateInput = Warranted; + +/** is what recreate answers. */ +export type RecreateAnswer = Held; + +/** is what drop takes. */ +export type DropInput = Warranted; + +/** is what drop answers. */ +export interface DropAnswer { + /** it is gone */ + "dropped": boolean; + /** the snapshot taken first */ + "snapshot"?: string; +} + +/** is the body of the event created. */ +export type CreatedEvent = Said; + +/** is the body of the event refused. */ +export type RefusedEvent = Said; + +/** is the body of the event drifted. */ +export type DriftedEvent = Said; + +/** is the body of the event drift-cleared. */ +export type DriftClearedEvent = Said; + +/** is the body of the event full. */ +export type FullEvent = Said; + +/** is the body of the event full-cleared. */ +export type FullClearedEvent = Said; + +/** is the body of the event orphaned. */ +export type OrphanedEvent = Said; + +/** is the body of the event recreated. */ +export type RecreatedEvent = Said; + +/** is the body of the event dropped. */ +export type DroppedEvent = Said; + +/** is the form of the provision bus-state. */ +export interface BusStateForm { + /** the entry's name on the bus */ + "bus-name": string; + /** how the bus keeps it */ + "storage-type": string; + /** its subjects, for a stream */ + "subjects"?: string[]; + /** its template */ + "template"?: string; +} + diff --git a/ts/src/mesh-config.ts b/ts/src/mesh-config.ts new file mode 100644 index 0000000..a9d230f --- /dev/null +++ b/ts/src/mesh-config.ts @@ -0,0 +1,119 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// The contract of the seat "mesh-config", defined whole (seats/mesh-config/seat.json): The mesh's config values: read and set one, and the renames still open. mesh-config's own events stay under its own subjects (ADR 0620 §2). + +export const seat = "mesh-config"; + +export const verbs = { + config: "config", + renames: "renames", +} as const; + +export const holderEvents = { + configChanged: "config-changed", + renamed: "renamed", + retiring: "retiring", + retired: "retired", +} as const; + +export function configChangedHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.config-changed"; +} + +export function renamedHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.renamed"; +} + +export function retiringHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.retiring"; +} + +export function retiredHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.retired"; +} + +/** is what config takes. */ +export interface ConfigInput { + /** list (when not given), set, clear or history */ + "action"?: string; + /** who gave the value at the controller's terminal */ + "by"?: string; + /** the config key */ + "key"?: string; + /** for history: at most this many, newest */ + "limit"?: number; + /** a module: its own value, with node */ + "module"?: string; + /** a node */ + "node"?: string; + /** for set: the value, of the key's type: a number, a string, a boolean, or for a trusted key an object or a list */ + "value"?: unknown; + /** for set and clear: why */ + "why"?: string; +} + +/** is what config answers. */ +export type ConfigAnswer = Record; + +/** is what renames takes. */ +export interface RenamesInput { + /** one module (optional) */ + "module"?: string; +} + +export interface RenamesAnswerRenamesItem { + /** when it moved, RFC 3339 */ + "at"?: string; + /** the old name */ + "from": string; + /** the module */ + "module": string; + /** the nodes still holding the old name open */ + "open"?: string[]; + /** the new name */ + "to": string; +} + +/** is what renames answers. */ +export interface RenamesAnswer { + /** every open rename */ + "renames": RenamesAnswerRenamesItem[]; +} + +/** is the body of the holder's event renamed. */ +export interface RenamedHolderEvent { + /** when, RFC 3339 */ + "at": string; + /** the old name */ + "from": string; + /** the module */ + "module": string; + /** the new name */ + "to": string; +} + +/** is the body of the holder's event retiring. */ +export interface RetiringHolderEvent { + /** the ask's id */ + "ask"?: string; + /** the value's or secret's name */ + "key": string; + "kind": "value" | "secret"; + /** the module */ + "module": string; + /** since when, RFC 3339 */ + "since": string; +} + +/** is the body of the holder's event retired. */ +export interface RetiredHolderEvent { + /** the ask's id */ + "ask"?: string; + /** the module */ + "module": string; + /** the name */ + "name": string; + /** the node */ + "node"?: string; +} + diff --git a/ts/src/mesh-delivery-checker.ts b/ts/src/mesh-delivery-checker.ts new file mode 100644 index 0000000..045181b --- /dev/null +++ b/ts/src/mesh-delivery-checker.ts @@ -0,0 +1,107 @@ +// 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.mod." + holder + ".event.verdict"; +} + +export function tagWantedHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.tag-wanted"; +} + +export function previewWrittenHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.preview.written"; +} + +/** 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; + /** / */ + "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- */ + "id": string; +} + +/** is what try-read answers. */ +export type TryReadAnswer = Record; + +/** is what try-end takes. */ +export interface TryEndInput { + /** the try's id, try- */ + "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; +} + +/** 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; + /** pass or fail */ + "verdict": string; +} + +/** is the body of the holder's event tag-wanted. */ +export interface TagWantedHolderEvent { + /** 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; +} + diff --git a/ts/src/mesh-vault.ts b/ts/src/mesh-vault.ts new file mode 100644 index 0000000..89e9fee --- /dev/null +++ b/ts/src/mesh-vault.ts @@ -0,0 +1,345 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// The contract of the seat "mesh-vault", defined whole (seats/mesh-vault/seat.json): The mesh's secrets. accept and move-asks, which no holder served and nothing called, are left out (ADR 0620 §3). The vault's own events stay under its own subjects (ADR 0620 §2). + +export const seat = "mesh-vault"; + +export const verbs = { + get: "get", + secretAsk: "secret-ask", + issued: "issued", + rotate: "rotate", + moveIn: "move-in", + nodeKey: "node-key", + own: "own", + issueAccount: "issue-account", + sign: "sign", + enrolmentToken: "enrolment-token", + nodeAccount: "node-account", + rotateNode: "rotate-node", + nodeAccountConfirm: "node-account-confirm", + abandon: "abandon", + retire: "retire", +} as const; + +export const holderEvents = { + provisioned: "provisioned", + rotated: "rotated", + secretChanged: "secret-changed", + accountHashed: "account-hashed", + ownReplaced: "own-replaced", + accountIssued: "account-issued", + signed: "signed", + rotationBegun: "rotation-begun", + nodeAccountReady: "node-account-ready", + rotationDone: "rotation-done", + ownRetired: "own-retired", +} as const; + +export function provisionedHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.provisioned"; +} + +export function rotatedHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.rotated"; +} + +export function secretChangedHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.secret-changed"; +} + +export function accountHashedHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.account-hashed"; +} + +export function ownReplacedHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.own-replaced"; +} + +export function accountIssuedHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.account-issued"; +} + +export function signedHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.signed"; +} + +export function rotationBegunHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.rotation-begun"; +} + +export function nodeAccountReadyHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.node-account-ready"; +} + +export function rotationDoneHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.rotation-done"; +} + +export function ownRetiredHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.own-retired"; +} + +/** is what get takes. */ +export interface GetInput { + /** the secret's name */ + "name": string; + /** the asker's X25519 public key as SPKI PEM — never a private key */ + "public_key": string; +} + +/** is what get answers. */ +export type GetAnswer = Record; + +/** is what secret-ask takes. */ +export interface SecretAskInput { + /** who asked, as the bus named its caller */ + "asked_by"?: string; + /** the second step: the call the first step answered */ + "call"?: string; + /** the machine whose prompt asks */ + "desk"?: string; + /** the module */ + "module"?: string; + /** the secret's name in the module */ + "name"?: string; + /** the machine the secret is for */ + "node"?: string; + /** instead of sealed: how the prompt ended */ + "outcome"?: string; + /** the second step: the value sealed to the call's key — never the value */ + "sealed"?: string; +} + +/** is what secret-ask answers. */ +export type SecretAskAnswer = Record; + +export interface IssuedInputHoldersItem { + /** the consuming module */ + "module"?: string; + /** the holder's machine */ + "node"?: string; +} + +/** is what issued takes. */ +export interface IssuedInput { + /** the second step: the call the first step answered */ + "call"?: string; + /** the provision's holders from that provider, each {node, module}: its tool may answer a value for each, kept as that holder's own and handed to it alone */ + "holders"?: IssuedInputHoldersItem[]; + /** the provider's module */ + "module"?: string; + /** the provider's machine */ + "provider"?: string; + /** the provision */ + "provision"?: string; + /** the second step: the value sealed to the call's key — never the value */ + "sealed"?: string; +} + +/** is what issued answers. */ +export type IssuedAnswer = Record; + +/** is what rotate takes. */ +export interface RotateInput { + /** who asked, when the controller carries the act */ + "by"?: string; + /** the module */ + "module"?: string; + /** the secret's name in the module */ + "name"?: string; + /** the machine, for a module's own secret */ + "node"?: string; + /** the provider's machine */ + "provider"?: string; + /** the provision */ + "provision"?: string; +} + +/** is what rotate answers. */ +export type RotateAnswer = Record; + +/** is what move-in takes. */ +export interface MoveInInput { + /** the second step: the call the first step answered */ + "call"?: string; + /** the consumer's machine */ + "consumer"?: string; + /** the consuming module */ + "consumer_module"?: string; + /** the controller's generation for the value */ + "generation"?: string; + /** the credential's local name, when it has one */ + "local"?: string; + /** when it was made (RFC 3339) */ + "made_at"?: string; + /** its module */ + "module"?: string; + /** its name in the module */ + "name"?: string; + /** a module's own secret: its machine */ + "node"?: string; + /** made, accepted or issued, as the controller's store says */ + "origin"?: string; + /** a pair credential: the provider's machine */ + "provider"?: string; + /** the provision */ + "provision"?: string; + /** the second step: a raw X25519 public key the read-back is sealed to */ + "read_back_to"?: string; + /** the second step: the value sealed to the call's key — never the value */ + "sealed"?: string; +} + +/** is what move-in answers. */ +export type MoveInAnswer = Record; + +/** is what node-key takes. */ +export interface NodeKeyInput { + /** the machine's sealing key, a raw X25519 public key in base64 */ + "key"?: string; +} + +/** is what node-key answers. */ +export type NodeKeyAnswer = Record; + +/** is what own takes. */ +export interface OwnInput { + /** the pair credentials the machine's composition reads, each {role: consumer|provider, provision, consumer, consumer_module, provider, local} */ + "credentials"?: Record[]; +} + +/** is what own answers. */ +export type OwnAnswer = Record; + +/** is what issue-account takes. */ +export interface IssueAccountInput { + /** the bus user, e.g. ace.mesh-build-go */ + "user": string; +} + +/** is what issue-account answers. */ +export type IssueAccountAnswer = Record; + +/** is what sign takes. */ +export interface SignInput { + /** node-certificate or enrolment */ + "kind": string; + /** the machine, for a node certificate: the caller's own, or the node mesh-enrolment enrols */ + "node"?: string; + /** the redeem answer's bytes in base64, for an enrolment */ + "reply"?: string; + /** from mesh-enrolment: the serving key's public half the enrolling node presented */ + "serving_key"?: string; +} + +/** is what sign answers. */ +export type SignAnswer = Record; + +/** the node's first tunnel, built by mesh-enrolment at issue and carried in the token: the hub's public key, the hub's endpoint, the node's tunnel address, its own tunnel key and the network's range */ +export interface EnrolmentTokenInputTunnel { + /** the joining node's tunnel address */ + "address": string; + /** the hub's endpoint, host:port */ + "hub_endpoint": string; + /** the hub's tunnel public key */ + "hub_key": string; + /** the joining machine's own tunnel public key, as given at issue */ + "key": string; + /** the private network's range, a prefix */ + "range": string; +} + +/** is what enrolment-token takes. */ +export interface EnrolmentTokenInput { + /** "true": drop the node's token and its hash */ + "drop"?: "true" | "false"; + /** when the token expires (RFC 3339), as the enrolment's key says */ + "expires"?: string; + /** the node the token is for */ + "node": string; + /** "true": answer the token sealed to the operator key */ + "sealed"?: "true" | "false"; + /** the node's first tunnel, built by mesh-enrolment at issue and carried in the token: the hub's public key, the hub's endpoint, the node's tunnel address, its own tunnel key and the network's range */ + "tunnel"?: EnrolmentTokenInputTunnel; +} + +/** is what enrolment-token answers. */ +export type EnrolmentTokenAnswer = Record; + +/** is what node-account takes. */ +export interface NodeAccountInput { + /** the digest of every public key the node presented (delivery.KeysDigest) */ + "keys_digest"?: string; + /** the joining node */ + "node": string; + /** "true": retire the account minted for this node */ + "retire"?: "true" | "false"; + /** the sealing key's public half the node presented, which the account is sealed to */ + "sealing_key"?: string; +} + +/** is what node-account answers. */ +export type NodeAccountAnswer = Record; + +/** is what rotate-node takes. */ +export interface RotateNodeInput { + /** the id of the hand act recorded for it in mesh-hand-acts */ + "act": string; + /** the node whose account rotates */ + "node": string; + /** why, in a sentence */ + "why": string; +} + +/** is what rotate-node answers. */ +export type RotateNodeAnswer = Record; + +/** is what node-account-confirm takes. */ +export interface NodeAccountConfirmInput { +} + +/** is what node-account-confirm answers. */ +export type NodeAccountConfirmAnswer = Record; + +/** is what abandon takes. */ +export interface AbandonInput { + /** the node whose rotation is abandoned */ + "node": string; +} + +/** is what abandon answers. */ +export type AbandonAnswer = Record; + +/** is what retire takes. */ +export interface RetireInput { + /** the module */ + "module": string; + /** the own secret's name */ + "name": string; + /** the node */ + "node": string; + /** the operator's warrant for this node, module and name */ + "warrant": string; +} + +/** is what retire answers. */ +export interface RetireAnswer { + /** the secret is gone */ + "retired": boolean; +} + +/** is the body of the holder's event own-retired. */ +export interface OwnRetiredHolderEvent { + /** the ask's id */ + "ask"?: string; + /** the caller the vault proved */ + "caller": string; + /** the module */ + "module": string; + /** the secret's name */ + "name": string; + /** the node */ + "node": string; +} + diff --git a/ts/src/npm-package-registry.ts b/ts/src/npm-package-registry.ts new file mode 100644 index 0000000..0834e45 --- /dev/null +++ b/ts/src/npm-package-registry.ts @@ -0,0 +1,50 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// The contract of the seat "npm-package-registry", defined whole (seats/npm-package-registry/seat.json): The mesh's npm packages: the npm registry protocol's read side, and publishing over the bus. + +import type * as registry from "./parts/registry.js"; + +export const seat = "npm-package-registry"; + +export const verbs = { + publish: "publish", + publishPart: "publish-part", + versions: "versions", + remove: "remove", +} as const; + +export const events = { + published: "published", + refused: "refused", + removed: "removed", +} as const; + +export const family = { name: "npm-package-registry.events", maxAgeDays: 7 } as const; + +export const publishedSubject = "mesh.seat.npm-package-registry.event.published"; + +export const refusedSubject = "mesh.seat.npm-package-registry.event.refused"; + +export const removedSubject = "mesh.seat.npm-package-registry.event.removed"; + +export type Artifact = registry.Artifact; +export type Outcome = registry.Outcome; +export type Part = registry.Part; +export type PublishAnswer = registry.PublishAnswer; +export type PublishInput = registry.PublishInput; +export type PublishPartAnswer = registry.PublishPartAnswer; +export type PublishPartInput = registry.PublishPartInput; +export type PublishedEvent = registry.PublishedEvent; +export type RefusedEvent = registry.RefusedEvent; +export type RemoveAnswer = registry.RemoveAnswer; +export type RemoveInput = registry.RemoveInput; +export type RemovedEvent = registry.RemovedEvent; +export type VersionsAnswer = registry.VersionsAnswer; +export type VersionsInput = registry.VersionsInput; + +/** is the form of the provision npm-package-registry. */ +export interface NpmPackageRegistryForm { + /** the read side's address */ + "url": string; +} + diff --git a/ts/src/oci-artifact-registry.ts b/ts/src/oci-artifact-registry.ts new file mode 100644 index 0000000..974cccd --- /dev/null +++ b/ts/src/oci-artifact-registry.ts @@ -0,0 +1,114 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// The contract of the seat "oci-artifact-registry", defined whole (seats/oci-artifact-registry/seat.json): The mesh's bundles and archives, by digest, in the one artifact store: the OCI distribution protocol's read side. + +import type * as registry from "./parts/registry.js"; + +export const seat = "oci-artifact-registry"; + +export const verbs = { + publish: "publish", + publishPart: "publish-part", + versions: "versions", + remove: "remove", + hold: "hold", + release: "release", +} as const; + +export const events = { + published: "published", + refused: "refused", + removed: "removed", + held: "held", + released: "released", +} as const; + +export const family = { name: "oci-artifact-registry.events", maxAgeDays: 7 } as const; + +export const publishedSubject = "mesh.seat.oci-artifact-registry.event.published"; + +export const refusedSubject = "mesh.seat.oci-artifact-registry.event.refused"; + +export const removedSubject = "mesh.seat.oci-artifact-registry.event.removed"; + +export const heldSubject = "mesh.seat.oci-artifact-registry.event.held"; + +export const releasedSubject = "mesh.seat.oci-artifact-registry.event.released"; + +export type Artifact = registry.Artifact; +export type Outcome = registry.Outcome; +export type Part = registry.Part; +export type PublishAnswer = registry.PublishAnswer; +export type PublishInput = registry.PublishInput; +export type PublishPartAnswer = registry.PublishPartAnswer; +export type PublishPartInput = registry.PublishPartInput; +export type PublishedEvent = registry.PublishedEvent; +export type RefusedEvent = registry.RefusedEvent; +export type RemoveAnswer = registry.RemoveAnswer; +export type RemoveInput = registry.RemoveInput; +export type RemovedEvent = registry.RemovedEvent; +export type VersionsAnswer = registry.VersionsAnswer; +export type VersionsInput = registry.VersionsInput; + +/** the body of held and released */ +export interface Hold { + /** when, RFC 3339 */ + "at"?: string; + /** the caller the holder proved */ + "by"?: string; + /** the digest */ + "digest": string; + /** the module holding the seat */ + "holder": string; + /** the name */ + "name": string; + /** why */ + "reason"?: string; +} + +/** is what hold takes. */ +export interface HoldInput { + /** the digest */ + "digest": string; + /** the name */ + "name": string; + /** which of the sweep's rules keeps it */ + "reason": string; +} + +/** is what hold answers. */ +export interface HoldAnswer { + /** it is held */ + "held": boolean; + /** when the hold began, RFC 3339 */ + "since"?: string; +} + +/** is what release takes. */ +export interface ReleaseInput { + /** the digest */ + "digest": string; + /** the name */ + "name": string; + /** why it is let go */ + "reason": string; +} + +/** is what release answers. */ +export interface ReleaseAnswer { + /** the hold is gone */ + "released": boolean; +} + +/** is the body of the event held. */ +export type HeldEvent = Hold; + +/** is the body of the event released. */ +export type ReleasedEvent = Hold; + +/** is the form of the provision artifact-store. */ +export interface ArtifactStoreForm { + /** the store's address */ + "url": string; +} + diff --git a/ts/src/operator-channel.ts b/ts/src/operator-channel.ts new file mode 100644 index 0000000..adb1049 --- /dev/null +++ b/ts/src/operator-channel.ts @@ -0,0 +1,282 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// The contract of the seat "operator-channel", defined whole (seats/operator-channel/seat.json): Asking a person and answering on a channel (ADR 0259): held by the router, the messenger module, whose manifest declares the seat; written from that seat entry (design 26). + +export const seat = "operator-channel"; + +export const verbs = { + open: "open", + history: "history", + notify: "notify", + tell: "tell", + asks: "asks", +} as const; + +export const accepts = { + ask: "ask", + cancel: "cancel", + condition: "condition", +} as const; + +export const events = { + decided: "decided", +} as const; + +export const family = { name: "operator-channel.decided", maxAgeDays: 30 } as const; + +export function decidedSubject(caller: string): string { + return "mesh.seat.operator-channel.event.decided." + caller; +} + +export function askSubject(caller: string): string { + return "mesh.seat.operator-channel.accept.ask." + caller; +} + +export function cancelSubject(caller: string): string { + return "mesh.seat.operator-channel.accept.cancel." + caller; +} + +export function conditionSubject(caller: string): string { + return "mesh.seat.operator-channel.accept.condition." + caller; +} + +export const holderEvents = { + refused: "refused", + offered: "offered", + closed: "closed", +} as const; + +export function refusedHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.refused"; +} + +export function offeredHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.offered"; +} + +export function closedHolderSubject(holder: string): string { + return "mesh.mod." + holder + ".event.closed"; +} + +export interface Ask { + /** what it is about: a newer ask about it replaces the older */ + "about"?: string; + /** its secondary words */ + "details"?: string; + /** when it ends unanswered, RFC 3339 */ + "expires": string; + /** what happened and what it means */ + "explanation": string; + /** a few plain words */ + "headline": string; + /** the asker's own id */ + "id": string; + /** what the asker then does */ + "on-expiry": string; + /** the answers it offers */ + "options": Option[]; + /** urgent */ + "urgent"?: boolean; + /** who may answer: operator */ + "who": string; + /** the explanation with its values whole */ + "whole"?: string; + /** the details whole */ + "whole-details"?: string; +} + +export interface ConditionActionsItem { + "arguments"?: Record; + /** label */ + "label": string; + /** level */ + "level"?: string; + /** machine */ + "machine"?: string; + /** verb */ + "verb": string; +} + +export interface ConditionSubject { + /** id */ + "id": string; + /** machine */ + "machine"?: string; + /** scope */ + "scope": string; +} + +export interface Condition { + /** the answers it offers */ + "actions"?: ConditionActionsItem[]; + /** plain words */ + "explanation"?: string; + /** plain words */ + "headline"?: string; + /** the condition's key */ + "key": string; + /** what it needs */ + "needs"?: string; + /** the line said when it is over */ + "resolved"?: string; + /** urgent or warning */ + "severity"?: string; + /** raised or cleared */ + "state": string; + "subject": ConditionSubject; + /** one line */ + "summary"?: string; + /** the form's version, 1 */ + "v": number; +} + +export interface Option { + /** the digest of exactly what the asker performs when it is chosen */ + "binds"?: string; + /** what it does, in plain words */ + "does": string; + /** the option's id */ + "id": string; + /** the button's label */ + "label": string; + /** the proof its answer needs */ + "level": string; +} + +export interface Person { + /** the name shown */ + "display"?: string; + /** the account */ + "identity": string; + /** the channel kind */ + "kind": string; + /** how the router knew */ + "verified": string; + /** the role */ + "who": string; +} + +export interface Warrant { + /** what it was about */ + "about"?: string; + /** the ask */ + "ask": string; + /** the digest of the ask as the router took it */ + "ask-digest"?: string; + /** its asker */ + "asker": string; + /** when, RFC 3339 */ + "at": string; + "by"?: Person; + /** the module it came through */ + "channel"?: string; + /** its label */ + "label"?: string; + /** its level */ + "level"?: string; + /** the option chosen */ + "option"?: string; + "outcome": "chosen" | "expired" | "cancelled" | "replaced" | "refused"; + /** the proofs present */ + "proofs"?: string[]; + /** why it ended without a choice, or what refused it */ + "words"?: string; +} + +/** is what open takes. */ +export interface OpenInput { +} + +/** is what open answers. */ +export type OpenAnswer = Record; + +/** is what history takes. */ +export interface HistoryInput { + /** at most this many of each (default 50) */ + "limit"?: number; +} + +/** is what history answers. */ +export type HistoryAnswer = Record; + +/** is what notify takes. */ +export interface NotifyInput { + /** it is over */ + "clear"?: boolean; + /** one or two plain sentences */ + "explanation"?: string; + /** plain words */ + "headline"?: string; + /** the message's key */ + "key"?: string; + /** the line said when it is over */ + "resolved"?: string; + "severity"?: "urgent" | "warning"; + /** what it is about */ + "subject"?: string; + /** one line */ + "summary"?: string; +} + +/** is what notify answers. */ +export type NotifyAnswer = Record; + +/** is what tell takes. */ +export interface TellInput { + /** plain words */ + "headline"?: string; + /** one or two plain lines */ + "lines"?: string[]; + /** what it is about */ + "subject"?: string; +} + +/** is what tell answers. */ +export type TellAnswer = Record; + +/** is what asks takes. */ +export interface AsksInput { +} + +/** is what asks answers. */ +export type AsksAnswer = Record; + +/** is the body of ask. */ +export type AskAccept = Ask; + +/** is the body of cancel. */ +export interface CancelAccept { + /** the ask's id */ + "id": string; +} + +/** is the body of condition. */ +export type ConditionAccept = Condition; + +/** is the body of the event decided. */ +export type DecidedEvent = Warrant; + +/** is the body of the holder's event offered. */ +export interface OfferedHolderEvent { + /** its asker */ + "asker": string; + /** the channels it was offered on */ + "channels"?: string[]; + /** its headline */ + "headline"?: string; + /** the ask's id */ + "id": string; +} + +/** is the body of the holder's event closed. */ +export interface ClosedHolderEvent { + /** its asker */ + "asker": string; + "how": "answered" | "expired" | "cancelled" | "replaced" | "unlinked"; + /** the ask's id */ + "id": string; +} + +/** is one value of the record asks. */ +export type AsksRecord = Record; + diff --git a/ts/src/parts/registry.ts b/ts/src/parts/registry.ts new file mode 100644 index 0000000..e13b4d2 --- /dev/null +++ b/ts/src/parts/registry.ts @@ -0,0 +1,173 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// The part "registry" several seats include whole: The verbs and events every registry seat shares, written once so the four cannot drift (design 51, design 26). Who may call each verb is the holder's trusted config value listing its callers (ADR 0363's form), checked against the caller the tool runner proved. + +export const verbs = { + publish: "publish", + publishPart: "publish-part", + versions: "versions", + remove: "remove", +} as const; + +export const events = { + published: "published", + refused: "refused", + removed: "removed", +} as const; + +/** one published thing, as every registry event and answer names it */ +export interface Artifact { + /** the source commit it was built from */ + "commit"?: string; + /** its digest, sha256: (a Go package's h1: hash beside it in the version's record) */ + "digest": string; + /** the build's fingerprint */ + "fingerprint"?: string; + /** what it is */ + "kind": "package" | "image" | "bundle" | "archive" | "upstream"; + /** the package's, image's, bundle's or archive's name */ + "name": string; + /** the tag it carries, for a tagged version */ + "tag"?: string; + /** the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone */ + "version"?: string; +} + +/** the body of published, refused and removed */ +export interface Outcome { + /** the source commit it was built from */ + "commit"?: string; + /** its digest, sha256: (a Go package's h1: hash beside it in the version's record) */ + "digest": string; + /** the build's fingerprint */ + "fingerprint"?: string; + /** the module holding the seat that said it */ + "holder": string; + /** what it is */ + "kind": "package" | "image" | "bundle" | "archive" | "upstream"; + /** the package's, image's, bundle's or archive's name */ + "name": string; + /** why: a refusal's cause, or a removal's (retention, tag-gone, by-hand) */ + "reason"?: string; + /** the reference the seat answers: //@sha256:, or @ for a package (ADR 0605 §9) */ + "reference"?: string; + /** the tag it carries, for a tagged version */ + "tag"?: string; + /** the transfer it ends, when it ended one */ + "transfer"?: string; + /** the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone */ + "version"?: string; +} + +/** one part of a transfer */ +export interface Part { + /** the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob */ + "digest": string; + /** its size in bytes */ + "size": number; +} + +/** is what publish takes. */ +export interface PublishInput { + /** the source commit it was built from */ + "commit"?: string; + /** its digest, sha256: (a Go package's h1: hash beside it in the version's record) */ + "digest": string; + /** the build's fingerprint */ + "fingerprint"?: string; + /** what it is */ + "kind": "package" | "image" | "bundle" | "archive" | "upstream"; + /** the package's, image's, bundle's or archive's name */ + "name": string; + /** every part's digest and size; none when the digest is already held */ + "parts"?: Part[]; + /** the tag it carries, for a tagged version */ + "tag"?: string; + /** the transfer's name, the caller's own; the same name opens the same transfer again */ + "transfer": string; + /** the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone */ + "version"?: string; +} + +/** is what publish answers. */ +export interface PublishAnswer { + /** the digest is held already: nothing to send; the outcome follows as an event */ + "held"?: boolean; + /** the digests of the parts the holder lacks, to send by publish-part */ + "lacks"?: string[]; + /** the transfer */ + "transfer": string; +} + +/** is what publish-part takes. */ +export interface PublishPartInput { + /** the chunk's bytes, base64 (at most 768 KiB before encoding) */ + "data": string; + /** this chunk is the part's last */ + "last": boolean; + /** the part's digest */ + "part": string; + /** the chunk's place in its part, from 0 */ + "sequence": number; + /** the transfer */ + "transfer": string; +} + +/** is what publish-part answers. */ +export interface PublishPartAnswer { + /** the part is whole and its bytes match its digest */ + "complete"?: boolean; + /** the part */ + "part": string; + /** the chunks of the part held so far */ + "received"?: number; + /** the transfer */ + "transfer": string; +} + +/** is what versions takes. */ +export interface VersionsInput { + /** narrowed to one kind (optional) */ + "kind"?: string; + /** the name */ + "name": string; +} + +/** is what versions answers. */ +export interface VersionsAnswer { + /** the name */ + "name": string; + /** newest first */ + "versions": Artifact[]; +} + +/** is what remove takes. */ +export interface RemoveInput { + /** the digest (for a bundle, archive or copied base) */ + "digest"?: string; + /** the name */ + "name": string; + /** why it goes */ + "reason": "tag-gone" | "retention"; + /** the tag (for a tagged version) */ + "tag"?: string; + /** the version */ + "version"?: string; +} + +/** is what remove answers. */ +export interface RemoveAnswer { + "artifact"?: Artifact; + /** it is gone */ + "removed": boolean; +} + +/** is the body of the event published. */ +export type PublishedEvent = Outcome; + +/** is the body of the event refused. */ +export type RefusedEvent = Outcome; + +/** is the body of the event removed. */ +export type RemovedEvent = Outcome; + diff --git a/ts/src/seats.ts b/ts/src/seats.ts new file mode 100644 index 0000000..c72a5b9 --- /dev/null +++ b/ts/src/seats.ts @@ -0,0 +1,6889 @@ +// Code generated by seatgen from the seat definitions; DO NOT EDIT. + +// The mesh's seat list, generated from every seat's definition (design 26). + +export interface Verb { + name: string; + description: string; + input?: Record; + output?: Record; + optional?: boolean; + replaces?: string[]; +} + +export interface Seat { + name: string; + scope: "mesh" | "node"; + grain: "whole" | "seat-list"; + decision: string; + delivers?: string; + replicated?: boolean; + accepts?: string[]; + emits?: string[]; + pulledByKind?: boolean; + yields?: boolean; + heldByTheEngine?: boolean; + serves?: Verb[]; +} + +export const names = { + meshStore: "mesh-store", + meshBroker: "mesh-broker", + meshVault: "mesh-vault", + meshConfig: "mesh-config", + meshProvisioner: "mesh-provisioner", + meshArtifactStore: "mesh-artifact-store", + meshCatalog: "mesh-catalog", + meshDelivery: "mesh-delivery", + meshPlacement: "mesh-placement", + meshDeliveryChecker: "mesh-delivery-checker", + meshConditions: "mesh-conditions", + meshWatchdogs: "mesh-watchdogs", + meshSelfCheck: "mesh-self-check", + meshHealers: "mesh-healers", + meshWants: "mesh-wants", + meshHandActs: "mesh-hand-acts", + meshEnrolment: "mesh-enrolment", + meshArtifactSweep: "mesh-artifact-sweep", + operatorChannel: "operator-channel", + npmPackageRegistry: "npm-package-registry", + goPackageRegistry: "go-package-registry", + containerImageRegistry: "container-image-registry", + ociArtifactRegistry: "oci-artifact-registry", + git: "git", + nodeBuildGo: "node-build-go", + nodeBuildNode: "node-build-node", + nodeBuildImage: "node-build-image", + meshDnsResolver: "mesh-dns-resolver", + nodeHostname: "node-hostname", + nodeIntrusionPrevention: "node-intrusion-prevention", + nodePacketFilter: "node-packet-filter", + nodeServiceManager: "node-service-manager", + nodePackageManager: "node-package-manager", + nodeContainerRuntime: "node-container-runtime", + nodeEnvironment: "node-environment", + nodeProvisioner: "node-provisioner", + nodeLoginShell: "node-login-shell", + nodePower: "node-power", + nodeHotkeys: "node-hotkeys", + nodeMessageBus: "node-message-bus", + nodeBackup: "node-backup", + thePrivateNetwork: "the-private-network", + nodeUplink: "node-uplink", + nodeResolver: "node-resolver", + nodeNfsServer: "node-nfs-server", + nodeMounts: "node-mounts", + nodeReads: "node-reads", + nodeFiles: "node-files", + nodeEngine: "node-engine", + nodeLoginManager: "node-login-manager", + nodeDisplayServer: "node-display-server", + nodeDisplaySession: "node-display-session", + nodeTerminalEmulator: "node-terminal-emulator", + nodeLauncher: "node-launcher", + nodeNotifier: "node-notifier", + nodeLockScreen: "node-lock-screen", + nodeClipboard: "node-clipboard", + nodeBar: "node-bar", + nodeCompositor: "node-compositor", + nodeSecretService: "node-secret-service", +} as const; + +export const list: readonly Seat[] = [ + { + "decision": "novox/hq ADR 0079", + "delivers": "postgres-database", + "grain": "seat-list", + "name": "mesh-store", + "scope": "mesh", + "serves": [ + { + "description": "Every database the store holds, with its on-disk size.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "databases", + "replaces": [ + "psql -l" + ] + }, + { + "description": "One read-only statement against one database the store holds.", + "input": { + "properties": { + "database": { + "description": "the database to query", + "type": "string" + }, + "sql": { + "description": "the read-only statement", + "type": "string" + } + }, + "required": [ + "database", + "sql" + ], + "type": "object" + }, + "name": "query", + "replaces": [ + "psql" + ] + } + ] + }, + { + "decision": "novox/hq ADR 0079; novox/hq ADR 0595", + "delivers": "mesh-bus", + "emits": [ + "created", + "refused", + "drifted", + "drift-cleared", + "full", + "full-cleared", + "orphaned", + "recreated", + "dropped" + ], + "grain": "whole", + "name": "mesh-broker", + "scope": "mesh", + "serves": [ + { + "description": "Every entry the bus module created, its template, its settings and its fill against its cap.", + "input": { + "properties": { + "module": { + "description": "one module (optional)", + "type": "string" + } + }, + "type": "object" + }, + "name": "list", + "output": { + "properties": { + "entries": { + "description": "every entry", + "items": { + "description": "one entry as the bus holds it", + "properties": { + "bus-name": { + "description": "its name on the bus, _", + "type": "string" + }, + "configuration": { + "description": "its own configuration, where no template fits", + "type": "object" + }, + "fill": { + "properties": { + "bytes": { + "description": "bytes held", + "type": "integer" + }, + "cap": { + "description": "its cap in bytes", + "type": "integer" + }, + "count": { + "description": "messages, keys or objects held", + "type": "integer" + } + }, + "required": [ + "count", + "bytes", + "cap" + ], + "type": "object" + }, + "local-name": { + "description": "its local name in the module's manifest", + "type": "string" + }, + "module": { + "description": "the module asking it", + "type": "string" + }, + "options": { + "description": "the template's options the module set, within their bounds", + "type": "object" + }, + "settings": { + "description": "the settings the bus holds", + "type": "object" + }, + "storage-type": { + "description": "how the bus keeps it", + "enum": [ + "stream", + "key-value", + "object-store", + "ledger" + ], + "type": "string" + }, + "template": { + "description": "its template; empty for a configuration of its own", + "enum": [ + "state", + "events", + "work-queue", + "log", + "objects", + "ledger", + "" + ], + "type": "string" + } + }, + "required": [ + "module", + "local-name", + "storage-type", + "bus-name" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "entries" + ], + "type": "object" + } + }, + { + "description": "One entry, its template, settings and fill.", + "input": { + "properties": { + "local-name": { + "description": "the entry's local name", + "type": "string" + }, + "module": { + "description": "the module", + "type": "string" + } + }, + "required": [ + "module", + "local-name" + ], + "type": "object" + }, + "name": "show", + "output": { + "description": "one entry as the bus holds it", + "properties": { + "bus-name": { + "description": "its name on the bus, _", + "type": "string" + }, + "configuration": { + "description": "its own configuration, where no template fits", + "type": "object" + }, + "fill": { + "properties": { + "bytes": { + "description": "bytes held", + "type": "integer" + }, + "cap": { + "description": "its cap in bytes", + "type": "integer" + }, + "count": { + "description": "messages, keys or objects held", + "type": "integer" + } + }, + "required": [ + "count", + "bytes", + "cap" + ], + "type": "object" + }, + "local-name": { + "description": "its local name in the module's manifest", + "type": "string" + }, + "module": { + "description": "the module asking it", + "type": "string" + }, + "options": { + "description": "the template's options the module set, within their bounds", + "type": "object" + }, + "settings": { + "description": "the settings the bus holds", + "type": "object" + }, + "storage-type": { + "description": "how the bus keeps it", + "enum": [ + "stream", + "key-value", + "object-store", + "ledger" + ], + "type": "string" + }, + "template": { + "description": "its template; empty for a configuration of its own", + "enum": [ + "state", + "events", + "work-queue", + "log", + "objects", + "ledger", + "" + ], + "type": "string" + } + }, + "required": [ + "module", + "local-name", + "storage-type", + "bus-name" + ], + "type": "object" + } + }, + { + "description": "Compare what the bus holds with what was asked, entry by entry; a difference that only grows is said as such.", + "input": { + "properties": { + "module": { + "description": "one module (optional)", + "type": "string" + } + }, + "type": "object" + }, + "name": "check", + "output": { + "properties": { + "differences": { + "description": "every difference", + "items": { + "properties": { + "asked": { + "description": "asked", + "type": "object" + }, + "grows": { + "description": "the difference only grows: apply may act on it", + "type": "boolean" + }, + "held": { + "description": "held", + "type": "object" + }, + "local-name": { + "description": "the entry", + "type": "string" + }, + "module": { + "description": "the module", + "type": "string" + } + }, + "required": [ + "module", + "local-name" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "differences" + ], + "type": "object" + } + }, + { + "description": "Entries the bus holds that no manifest asks for; never one whose manifest the judge refused or outgrew, nor one of the foundation's old sections.", + "input": { + "description": "no arguments", + "properties": {}, + "type": "object" + }, + "name": "orphans", + "output": { + "properties": { + "entries": { + "description": "every orphan", + "items": { + "description": "one entry as the bus holds it", + "properties": { + "bus-name": { + "description": "its name on the bus, _", + "type": "string" + }, + "configuration": { + "description": "its own configuration, where no template fits", + "type": "object" + }, + "fill": { + "properties": { + "bytes": { + "description": "bytes held", + "type": "integer" + }, + "cap": { + "description": "its cap in bytes", + "type": "integer" + }, + "count": { + "description": "messages, keys or objects held", + "type": "integer" + } + }, + "required": [ + "count", + "bytes", + "cap" + ], + "type": "object" + }, + "local-name": { + "description": "its local name in the module's manifest", + "type": "string" + }, + "module": { + "description": "the module asking it", + "type": "string" + }, + "options": { + "description": "the template's options the module set, within their bounds", + "type": "object" + }, + "settings": { + "description": "the settings the bus holds", + "type": "object" + }, + "storage-type": { + "description": "how the bus keeps it", + "enum": [ + "stream", + "key-value", + "object-store", + "ledger" + ], + "type": "string" + }, + "template": { + "description": "its template; empty for a configuration of its own", + "enum": [ + "state", + "events", + "work-queue", + "log", + "objects", + "ledger", + "" + ], + "type": "string" + } + }, + "required": [ + "module", + "local-name", + "storage-type", + "bus-name" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "entries" + ], + "type": "object" + } + }, + { + "description": "Create one entry now.", + "input": { + "description": "one piece of bus state as a manifest asks it", + "properties": { + "configuration": { + "description": "its own configuration, where no template fits", + "type": "object" + }, + "local-name": { + "description": "its local name in the module's manifest", + "type": "string" + }, + "module": { + "description": "the module asking it", + "type": "string" + }, + "options": { + "description": "the template's options the module set, within their bounds", + "type": "object" + }, + "storage-type": { + "description": "how the bus keeps it", + "enum": [ + "stream", + "key-value", + "object-store", + "ledger" + ], + "type": "string" + }, + "template": { + "description": "its template; empty for a configuration of its own", + "enum": [ + "state", + "events", + "work-queue", + "log", + "objects", + "ledger", + "" + ], + "type": "string" + } + }, + "required": [ + "module", + "local-name", + "storage-type" + ], + "type": "object" + }, + "name": "create", + "output": { + "description": "one entry as the bus holds it", + "properties": { + "bus-name": { + "description": "its name on the bus, _", + "type": "string" + }, + "configuration": { + "description": "its own configuration, where no template fits", + "type": "object" + }, + "fill": { + "properties": { + "bytes": { + "description": "bytes held", + "type": "integer" + }, + "cap": { + "description": "its cap in bytes", + "type": "integer" + }, + "count": { + "description": "messages, keys or objects held", + "type": "integer" + } + }, + "required": [ + "count", + "bytes", + "cap" + ], + "type": "object" + }, + "local-name": { + "description": "its local name in the module's manifest", + "type": "string" + }, + "module": { + "description": "the module asking it", + "type": "string" + }, + "options": { + "description": "the template's options the module set, within their bounds", + "type": "object" + }, + "settings": { + "description": "the settings the bus holds", + "type": "object" + }, + "storage-type": { + "description": "how the bus keeps it", + "enum": [ + "stream", + "key-value", + "object-store", + "ledger" + ], + "type": "string" + }, + "template": { + "description": "its template; empty for a configuration of its own", + "enum": [ + "state", + "events", + "work-queue", + "log", + "objects", + "ledger", + "" + ], + "type": "string" + } + }, + "required": [ + "module", + "local-name", + "storage-type", + "bus-name" + ], + "type": "object" + } + }, + { + "description": "Apply a difference that only grows: a larger cap, a longer age.", + "input": { + "properties": { + "local-name": { + "description": "the entry's local name", + "type": "string" + }, + "module": { + "description": "the module", + "type": "string" + } + }, + "required": [ + "module", + "local-name" + ], + "type": "object" + }, + "name": "apply", + "output": { + "description": "one entry as the bus holds it", + "properties": { + "bus-name": { + "description": "its name on the bus, _", + "type": "string" + }, + "configuration": { + "description": "its own configuration, where no template fits", + "type": "object" + }, + "fill": { + "properties": { + "bytes": { + "description": "bytes held", + "type": "integer" + }, + "cap": { + "description": "its cap in bytes", + "type": "integer" + }, + "count": { + "description": "messages, keys or objects held", + "type": "integer" + } + }, + "required": [ + "count", + "bytes", + "cap" + ], + "type": "object" + }, + "local-name": { + "description": "its local name in the module's manifest", + "type": "string" + }, + "module": { + "description": "the module asking it", + "type": "string" + }, + "options": { + "description": "the template's options the module set, within their bounds", + "type": "object" + }, + "settings": { + "description": "the settings the bus holds", + "type": "object" + }, + "storage-type": { + "description": "how the bus keeps it", + "enum": [ + "stream", + "key-value", + "object-store", + "ledger" + ], + "type": "string" + }, + "template": { + "description": "its template; empty for a configuration of its own", + "enum": [ + "state", + "events", + "work-queue", + "log", + "objects", + "ledger", + "" + ], + "type": "string" + } + }, + "required": [ + "module", + "local-name", + "storage-type", + "bus-name" + ], + "type": "object" + } + }, + { + "description": "Rebuild an entry whose settings differ in a way that cannot grow, from its data where the storage type allows, after a stream snapshot.", + "input": { + "properties": { + "local-name": { + "description": "the entry's local name", + "type": "string" + }, + "module": { + "description": "the module", + "type": "string" + }, + "warrant": { + "description": "the operator's warrant, as the operator channel decided it (ADR 0259 §6)", + "type": "string" + }, + "why": { + "description": "why, kept in the record", + "type": "string" + } + }, + "required": [ + "module", + "local-name", + "warrant", + "why" + ], + "type": "object" + }, + "name": "recreate", + "output": { + "description": "one entry as the bus holds it", + "properties": { + "bus-name": { + "description": "its name on the bus, _", + "type": "string" + }, + "configuration": { + "description": "its own configuration, where no template fits", + "type": "object" + }, + "fill": { + "properties": { + "bytes": { + "description": "bytes held", + "type": "integer" + }, + "cap": { + "description": "its cap in bytes", + "type": "integer" + }, + "count": { + "description": "messages, keys or objects held", + "type": "integer" + } + }, + "required": [ + "count", + "bytes", + "cap" + ], + "type": "object" + }, + "local-name": { + "description": "its local name in the module's manifest", + "type": "string" + }, + "module": { + "description": "the module asking it", + "type": "string" + }, + "options": { + "description": "the template's options the module set, within their bounds", + "type": "object" + }, + "settings": { + "description": "the settings the bus holds", + "type": "object" + }, + "storage-type": { + "description": "how the bus keeps it", + "enum": [ + "stream", + "key-value", + "object-store", + "ledger" + ], + "type": "string" + }, + "template": { + "description": "its template; empty for a configuration of its own", + "enum": [ + "state", + "events", + "work-queue", + "log", + "objects", + "ledger", + "" + ], + "type": "string" + } + }, + "required": [ + "module", + "local-name", + "storage-type", + "bus-name" + ], + "type": "object" + } + }, + { + "description": "Remove one orphan, after a stream snapshot.", + "input": { + "properties": { + "local-name": { + "description": "the entry's local name", + "type": "string" + }, + "module": { + "description": "the module", + "type": "string" + }, + "warrant": { + "description": "the operator's warrant, as the operator channel decided it (ADR 0259 §6)", + "type": "string" + }, + "why": { + "description": "why, kept in the record", + "type": "string" + } + }, + "required": [ + "module", + "local-name", + "warrant", + "why" + ], + "type": "object" + }, + "name": "drop", + "output": { + "properties": { + "dropped": { + "description": "it is gone", + "type": "boolean" + }, + "snapshot": { + "description": "the snapshot taken first", + "type": "string" + } + }, + "required": [ + "dropped" + ], + "type": "object" + } + } + ] + }, + { + "decision": "novox/hq ADR 0161", + "delivers": "secret", + "grain": "whole", + "name": "mesh-vault", + "scope": "mesh", + "serves": [ + { + "description": "One secret, sealed to the public key the asker sends (the sealed box of ADR 0206), with its generation; answered only to an asker the vault allows, as the bus proved it. Never the value in the clear, and never to a private key.", + "input": { + "properties": { + "name": { + "description": "the secret's name", + "type": "string" + }, + "public_key": { + "description": "the asker's X25519 public key as SPKI PEM — never a private key", + "type": "string" + } + }, + "required": [ + "name", + "public_key" + ], + "type": "object" + }, + "name": "get", + "optional": true, + "output": { + "description": "the holder's answer", + "type": "object" + } + }, + { + "description": "Ask the operator for a module's own secret at a desk, from the controller or a caller the vault's manifest names, named as the bus proved it (novox/hq ADR 0563 §8): the ask is recorded in the vault's store and bounded before the prompt opens, and what is typed is sealed to a key the vault made for the call and opens there alone.", + "input": { + "properties": { + "asked_by": { + "description": "who asked, as the bus named its caller", + "type": "string" + }, + "call": { + "description": "the second step: the call the first step answered", + "type": "string" + }, + "desk": { + "description": "the machine whose prompt asks", + "type": "string" + }, + "module": { + "description": "the module", + "type": "string" + }, + "name": { + "description": "the secret's name in the module", + "type": "string" + }, + "node": { + "description": "the machine the secret is for", + "type": "string" + }, + "outcome": { + "description": "instead of sealed: how the prompt ended", + "type": "string" + }, + "sealed": { + "description": "the second step: the value sealed to the call's key — never the value", + "type": "string" + } + }, + "type": "object" + }, + "name": "secret-ask", + "optional": true, + "output": { + "description": "the holder's answer", + "type": "object" + } + }, + { + "description": "Take the credential a provider's software issued for a provision, from the controller alone, which asks the provider's tool with a key the vault made for the call; kept as the provision's one credential, or, when the tool answers a value per holder named, each as that holder's own; the same value again writes nothing.", + "input": { + "properties": { + "call": { + "description": "the second step: the call the first step answered", + "type": "string" + }, + "holders": { + "description": "the provision's holders from that provider, each {node, module}: its tool may answer a value for each, kept as that holder's own and handed to it alone", + "items": { + "properties": { + "module": { + "description": "the consuming module", + "type": "string" + }, + "node": { + "description": "the holder's machine", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "module": { + "description": "the provider's module", + "type": "string" + }, + "provider": { + "description": "the provider's machine", + "type": "string" + }, + "provision": { + "description": "the provision", + "type": "string" + }, + "sealed": { + "description": "the second step: the value sealed to the call's key — never the value", + "type": "string" + } + }, + "type": "object" + }, + "name": "issued", + "optional": true, + "output": { + "description": "the holder's answer", + "type": "object" + } + }, + { + "description": "Make a secret anew. Refused for a value a provider's software issued and for an accepted credential. Never answers the value.", + "input": { + "properties": { + "by": { + "description": "who asked, when the controller carries the act", + "type": "string" + }, + "module": { + "description": "the module", + "type": "string" + }, + "name": { + "description": "the secret's name in the module", + "type": "string" + }, + "node": { + "description": "the machine, for a module's own secret", + "type": "string" + }, + "provider": { + "description": "the provider's machine", + "type": "string" + }, + "provision": { + "description": "the provision", + "type": "string" + } + }, + "type": "object" + }, + "name": "rotate", + "optional": true, + "output": { + "description": "the holder's answer", + "type": "object" + } + }, + { + "description": "Take one value of the controller's store in, as it is, from the node-engine of a machine it was sealed to and no other caller: name the row, its origin and generation and get a call and a key made for it, then send the call, the value sealed to that key and a key to read back to. Never replaces a value the vault holds; answers what it kept, read back sealed to that key.", + "input": { + "properties": { + "call": { + "description": "the second step: the call the first step answered", + "type": "string" + }, + "consumer": { + "description": "the consumer's machine", + "type": "string" + }, + "consumer_module": { + "description": "the consuming module", + "type": "string" + }, + "generation": { + "description": "the controller's generation for the value", + "type": "string" + }, + "local": { + "description": "the credential's local name, when it has one", + "type": "string" + }, + "made_at": { + "description": "when it was made (RFC 3339)", + "type": "string" + }, + "module": { + "description": "its module", + "type": "string" + }, + "name": { + "description": "its name in the module", + "type": "string" + }, + "node": { + "description": "a module's own secret: its machine", + "type": "string" + }, + "origin": { + "description": "made, accepted or issued, as the controller's store says", + "type": "string" + }, + "provider": { + "description": "a pair credential: the provider's machine", + "type": "string" + }, + "provision": { + "description": "the provision", + "type": "string" + }, + "read_back_to": { + "description": "the second step: a raw X25519 public key the read-back is sealed to", + "type": "string" + }, + "sealed": { + "description": "the second step: the value sealed to the call's key — never the value", + "type": "string" + } + }, + "type": "object" + }, + "name": "move-in", + "optional": true, + "output": { + "description": "the holder's answer", + "type": "object" + } + }, + { + "description": "State this machine's sealing key to the vault, in its own name, from the node-engine of the machine alone: at its start and whenever the key changes. A first or changed key is recorded and the machine's core secrets are said changed; the same key again changes nothing.", + "input": { + "properties": { + "key": { + "description": "the machine's sealing key, a raw X25519 public key in base64", + "type": "string" + } + }, + "type": "object" + }, + "name": "node-key", + "optional": true, + "output": { + "description": "the holder's answer", + "type": "object" + } + }, + { + "description": "Answer the node-engine of one machine, about its own machine alone (as the bus proved the caller, never an argument), its modules' own secrets and the pair credentials it consumes or provides that it names, each sealed to the key it stated with node-key. A credential the vault does not hold is named missing; never a value in the clear.", + "input": { + "properties": { + "credentials": { + "description": "the pair credentials the machine's composition reads, each {role: consumer|provider, provision, consumer, consumer_module, provider, local}", + "items": { + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "name": "own", + "optional": true, + "output": { + "description": "the holder's answer", + "type": "object" + } + }, + { + "description": "Mint one bus account the grants part wants, now (novox/hq ADR 0561 §9): only while the controller's lease is handed away, never a node's account or the controller's, never anew for one the vault holds a value or an adopted hash for. Never the value.", + "input": { + "properties": { + "user": { + "description": "the bus user, e.g. ace.mesh-build-go", + "type": "string" + } + }, + "required": [ + "user" + ], + "type": "object" + }, + "name": "issue-account", + "optional": true, + "output": { + "description": "the holder's answer", + "type": "object" + } + }, + { + "description": "Sign with the vault's key or authority (novox/hq ADR 0550 §2): kind node-certificate signs the certificate of a machine's internal name, asked by that machine's node-engine for the serving key its record states, built from bus state alone, or by mesh-enrolment for a node it enrols, for the serving key the node presented at redeem (ADR 0587 §3); kind enrolment signs a redeem answer under its own context, for mesh-enrolment alone. Answers the certificate or the signature and the signer's fingerprint, and says signed; never a key.", + "input": { + "properties": { + "kind": { + "description": "node-certificate or enrolment", + "type": "string" + }, + "node": { + "description": "the machine, for a node certificate: the caller's own, or the node mesh-enrolment enrols", + "type": "string" + }, + "reply": { + "description": "the redeem answer's bytes in base64, for an enrolment", + "type": "string" + }, + "serving_key": { + "description": "from mesh-enrolment: the serving key's public half the enrolling node presented", + "type": "string" + } + }, + "required": [ + "kind" + ], + "type": "object" + }, + "name": "sign", + "optional": true, + "output": { + "description": "the holder's answer", + "type": "object" + } + }, + { + "description": "Make a one-time token for a node mesh-enrolment issues on the operator's warrant: its secret kept with its copy sealed to the operator key and its hash written as the bus user enrol.. Answers only what the joining machine must trust (the bus's address, the bus certificate's fingerprint, the vault's public signing key), never the token; with sealed, the token sealed to the operator key, for tokens to relay; with drop, the token and its hash dropped, at the enrolment's end. Asked by mesh-enrolment alone, only from the lease write. The token carries the first tunnel mesh-enrolment built at issue (ADR 0587 §3, insight of 2026-11-02).", + "input": { + "properties": { + "drop": { + "description": "\"true\": drop the node's token and its hash", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "expires": { + "description": "when the token expires (RFC 3339), as the enrolment's key says", + "type": "string" + }, + "node": { + "description": "the node the token is for", + "type": "string" + }, + "sealed": { + "description": "\"true\": answer the token sealed to the operator key", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "tunnel": { + "additionalProperties": false, + "description": "the node's first tunnel, built by mesh-enrolment at issue and carried in the token: the hub's public key, the hub's endpoint, the node's tunnel address, its own tunnel key and the network's range", + "properties": { + "address": { + "description": "the joining node's tunnel address", + "type": "string" + }, + "hub_endpoint": { + "description": "the hub's endpoint, host:port", + "type": "string" + }, + "hub_key": { + "description": "the hub's tunnel public key", + "type": "string" + }, + "key": { + "description": "the joining machine's own tunnel public key, as given at issue", + "type": "string" + }, + "range": { + "description": "the private network's range, a prefix", + "type": "string" + } + }, + "required": [ + "address", + "hub_endpoint", + "hub_key", + "key", + "range" + ], + "type": "object" + } + }, + "required": [ + "node" + ], + "type": "object" + }, + "name": "enrolment-token", + "optional": true, + "output": { + "description": "the holder's answer", + "type": "object" + } + }, + { + "description": "Mint a joining node's bus account node., sealed to the sealing key it presented, and write its hash; asked again for the same node and keys, answers the account it already minted; with retire, the account it minted for a revoked enrolment retired. Writes the node's node-logins key naming node.. Asked by mesh-enrolment alone. Never the value in the clear.", + "input": { + "properties": { + "keys_digest": { + "description": "the digest of every public key the node presented (delivery.KeysDigest)", + "type": "string" + }, + "node": { + "description": "the joining node", + "type": "string" + }, + "retire": { + "description": "\"true\": retire the account minted for this node", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "sealing_key": { + "description": "the sealing key's public half the node presented, which the account is sealed to", + "type": "string" + } + }, + "required": [ + "node" + ], + "type": "object" + }, + "name": "node-account", + "optional": true, + "output": { + "description": "the holder's answer", + "type": "object" + } + }, + { + "description": "Begin a node's account rotation to its other login: answered only for a call carrying a hand act recorded through mesh-hand-acts, which the vault reads back by its id. Makes the other login's value sealed to that node, writes it rotating in node-logins and says rotation-begun; says node-account-ready once the bus node's have shows a list holding both logins. One node at a time across the mesh, the bus node last: a call while a rotation runs waits until it is done.", + "input": { + "properties": { + "act": { + "description": "the id of the hand act recorded for it in mesh-hand-acts", + "type": "string" + }, + "node": { + "description": "the node whose account rotates", + "type": "string" + }, + "why": { + "description": "why, in a sentence", + "type": "string" + } + }, + "required": [ + "node", + "why", + "act" + ], + "type": "object" + }, + "name": "rotate-node", + "optional": true, + "output": { + "description": "the holder's answer", + "type": "object" + } + }, + { + "description": "Confirm a node's switch to its new login: asked by the node-engine dialled as that login, the runtime's proof of the caller being the confirmation. The old login's hash is then removed, and rotation-done said once the bus node's have shows the list without it.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "node-account-confirm", + "optional": true, + "output": { + "description": "the holder's answer", + "type": "object" + } + }, + { + "description": "Abandon a node's rotation before its old login is retired: the new login and its value dropped, the old one kept; a node that switched switches back first.", + "input": { + "properties": { + "node": { + "description": "the node whose rotation is abandoned", + "type": "string" + } + }, + "required": [ + "node" + ], + "type": "object" + }, + "name": "abandon", + "optional": true, + "output": { + "description": "the holder's answer", + "type": "object" + } + }, + { + "description": "Retire one module's own secret, by node, module and name, on the operator's warrant bound to exactly those three (design 32 *A value no longer read*). Emits own-retired.", + "input": { + "properties": { + "module": { + "description": "the module", + "type": "string" + }, + "name": { + "description": "the own secret's name", + "type": "string" + }, + "node": { + "description": "the node", + "type": "string" + }, + "warrant": { + "description": "the operator's warrant for this node, module and name", + "type": "string" + } + }, + "required": [ + "node", + "module", + "name", + "warrant" + ], + "type": "object" + }, + "name": "retire", + "optional": true, + "output": { + "properties": { + "retired": { + "description": "the secret is gone", + "type": "boolean" + } + }, + "required": [ + "retired" + ], + "type": "object" + } + } + ] + }, + { + "decision": "novox/hq ADR 0348, ADR 0565", + "grain": "whole", + "name": "mesh-config", + "scope": "mesh", + "serves": [ + { + "description": "Set, clear, list or read the history of config values: mesh config or node config for a predefined key, or a module's own value on one node, each set with why, validated, and naming each module on each node whose value moves.", + "input": { + "properties": { + "action": { + "description": "list (when not given), set, clear or history", + "type": "string" + }, + "by": { + "description": "who gave the value at the controller's terminal", + "type": "string" + }, + "key": { + "description": "the config key", + "type": "string" + }, + "limit": { + "description": "for history: at most this many, newest", + "type": "number" + }, + "module": { + "description": "a module: its own value, with node", + "type": "string" + }, + "node": { + "description": "a node", + "type": "string" + }, + "value": { + "description": "for set: the value, of the key's type: a number, a string, a boolean, or for a trusted key an object or a list" + }, + "why": { + "description": "for set and clear: why", + "type": "string" + } + }, + "type": "object" + }, + "name": "config", + "optional": true, + "output": { + "description": "the values asked, or the one set or cleared, or its history", + "type": "object" + } + }, + { + "description": "The open renames of config values (design 32 *A config value renamed*): per rename the module, the old and new name, when it moved, and the nodes still holding the old name open.", + "input": { + "properties": { + "module": { + "description": "one module (optional)", + "type": "string" + } + }, + "type": "object" + }, + "name": "renames", + "optional": true, + "output": { + "properties": { + "renames": { + "description": "every open rename", + "items": { + "properties": { + "at": { + "description": "when it moved, RFC 3339", + "type": "string" + }, + "from": { + "description": "the old name", + "type": "string" + }, + "module": { + "description": "the module", + "type": "string" + }, + "open": { + "description": "the nodes still holding the old name open", + "items": { + "type": "string" + }, + "type": "array" + }, + "to": { + "description": "the new name", + "type": "string" + } + }, + "required": [ + "module", + "from", + "to" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "renames" + ], + "type": "object" + } + } + ] + }, + { + "decision": "novox/hq ADR 0349", + "grain": "seat-list", + "name": "mesh-provisioner", + "scope": "mesh", + "serves": [ + { + "description": "Read what the provisioner keeps: the registry (which domain answers which kind of placeholder), the needs each module on each node recorded, what is applied where, or the items of every collection, narrowed by node and module. Reads only.", + "input": { + "properties": { + "collection": { + "description": "for collect: a collection", + "type": "string" + }, + "module": { + "description": "a module: for collect, a contributor", + "type": "string" + }, + "node": { + "description": "a node", + "type": "string" + }, + "what": { + "description": "registry (when not given), needs, applied or collect", + "type": "string" + } + }, + "type": "object" + }, + "name": "provisioning", + "optional": true + } + ] + }, + { + "decision": "novox/hq ADR 0075", + "delivers": "artifact-store", + "grain": "seat-list", + "name": "mesh-artifact-store", + "scope": "mesh" + }, + { + "decision": "novox/hq ADR 0604", + "grain": "seat-list", + "name": "mesh-catalog", + "scope": "mesh", + "serves": [ + { + "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.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "modules", + "optional": true + }, + { + "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.", + "input": { + "properties": { + "module": { + "description": "the module's name", + "type": "string" + } + }, + "required": [ + "module" + ], + "type": "object" + }, + "name": "module", + "optional": true + }, + { + "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.", + "input": { + "properties": { + "provision": { + "description": "the provision, such as postgres-database", + "type": "string" + } + }, + "required": [ + "provision" + ], + "type": "object" + }, + "name": "provides", + "optional": true + }, + { + "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.", + "input": { + "properties": { + "module": { + "description": "the module's name", + "type": "string" + } + }, + "required": [ + "module" + ], + "type": "object" + }, + "name": "dependents", + "optional": true + } + ] + }, + { + "decision": "novox/hq ADR 0239", + "grain": "seat-list", + "name": "mesh-delivery", + "scope": "mesh", + "serves": [ + { + "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" + }, + "name": "deliveries" + }, + { + "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", + "input": { + "properties": {}, + "type": "object" + }, + "name": "times", + "optional": true + }, + { + "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" + }, + "name": "show" + }, + { + "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" + }, + "name": "groups" + }, + { + "description": "Removed in R6 (ADR 0539): refused by name, naming its replacement: the merge check's composition, which composes every machine a change touches", + "input": { + "properties": {}, + "type": "object" + }, + "name": "what-if", + "optional": true + }, + { + "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.", + "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" + }, + "name": "checks", + "optional": true + }, + { + "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" + }, + "name": "table" + }, + { + "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" + }, + "name": "stalled" + }, + { + "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" + }, + "name": "recheck" + }, + { + "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", + "input": { + "properties": {}, + "type": "object" + }, + "name": "release", + "optional": true + }, + { + "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)", + "input": { + "properties": {}, + "type": "object" + }, + "name": "stop", + "optional": true + }, + { + "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" + }, + "name": "close" + }, + { + "description": "Removed in R6 (ADR 0539): refused by name, naming its replacement: nothing to retire: the gate keeps no delivery after its merge", + "input": { + "properties": {}, + "type": "object" + }, + "name": "retire-history", + "optional": true + }, + { + "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.", + "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" + }, + "name": "settle", + "optional": true + } + ] + }, + { + "decision": "novox/hq ADR 0567", + "grain": "seat-list", + "name": "mesh-placement", + "scope": "mesh", + "serves": [ + { + "description": "Read placement: one node's key, the nodes one module is placed on, or every key, each with its revision, and how full the state is against its cap. With history, one node's or one module's changes in order: a revision the state keeps whole, an older one as the proposal's changes from its placement-changed event.", + "input": { + "properties": { + "history": { + "description": "\"true\": the changes in order, from the stream and the state's revisions", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "module": { + "description": "one module: the nodes it is placed on", + "type": "string" + }, + "node": { + "description": "one node", + "type": "string" + }, + "seats": { + "description": "\"true\": who holds each seat, and on which node (the state seat-holders); with node, that node's", + "enum": [ + "true", + "false" + ], + "type": "string" + } + }, + "type": "object" + }, + "name": "placement", + "optional": true + }, + { + "description": "Every open proposal of placement: its changes, the revision of each key it was laid over, its candidates, every node's answer, the differences computed and answered, its verdict and its ask. Narrowed to one by id.", + "input": { + "properties": { + "id": { + "description": "one proposal's id", + "type": "string" + } + }, + "type": "object" + }, + "name": "proposals", + "optional": true + }, + { + "description": "Propose a change of placement, with why: laid over the current keys and refused at once, naming every finding, when the result cannot be placed (two modules on one host port, a provider not placed, a seat held once held twice, two nodes with one address, two hubs, a module the indexer does not hold, a node with no record). Otherwise the nodes it touches compose it in shadow and answer, and on a passing verdict the operator is asked to approve it. Who proposes is the caller, as the runtime proves it. An add-node from mesh-enrolment, whose warrant names its node and address, is written with no ask of its own: its Approve is the enrolment's (ADR 0587 §7).", + "input": { + "additionalProperties": false, + "properties": { + "changes": { + "description": "the changes, each an object with `op`: place (node, module, ports, bindings), take-off (node, module), pin (node, provision, provider {node, module}), unpin (node, provision), hold (node, module, claim, scope, kind, site), unhold (node, module, claim), decide (node, field, value: a decided field of the node, its address among them), config (node, module, mesh-wide, layer, mesh-wide-values, values), add-node (node, decided, keys: a joining node, mesh-enrolment's alone, the proposal's one change, with the enrolment's warrant, its tunnel key alone at the operator's yes; ADR 0587 §7), remove-node (node: a joining node never confirmed, taken off when its enrolment ends; mesh-enrolment's alone, on the same warrant)", + "items": { + "required": [ + "op", + "node" + ], + "type": "object" + }, + "minItems": 1, + "type": "array" + }, + "warrant": { + "description": "for an add-node alone: the enrolment's warrant {node, address, ask, warrant}, naming the change's node and address", + "required": [ + "node", + "address", + "ask", + "warrant" + ], + "type": "object" + }, + "why": { + "description": "why, shown to the operator with the proposal", + "type": "string" + } + }, + "required": [ + "why", + "changes" + ], + "type": "object" + }, + "name": "propose", + "optional": true + }, + { + "description": "Withdraw an open proposal: its key and its candidates are deleted and placement-withdrawn carries it whole. With why.", + "input": { + "properties": { + "id": { + "description": "the proposal's id", + "type": "string" + }, + "why": { + "description": "why, kept in the event", + "type": "string" + } + }, + "required": [ + "id", + "why" + ], + "type": "object" + }, + "name": "withdraw", + "optional": true + }, + { + "description": "Judge an open proposal now with the answers that stand, and raise its ask again when its verdict passes and the operator's channel does not hold the ask. Nothing more: the recovery of a proposal whose judgement or ask was lost.", + "input": { + "properties": { + "id": { + "description": "the proposal's id", + "type": "string" + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "name": "again", + "optional": true + } + ] + }, + { + "decision": "novox/hq ADR 0547", + "grain": "whole", + "name": "mesh-delivery-checker", + "scope": "mesh", + "serves": [ + { + "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.", + "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": "/", + "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" + }, + "name": "try", + "optional": true, + "output": { + "properties": { + "id": { + "description": "the try's id", + "type": "string" + }, + "state": { + "description": "its state", + "type": "string" + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "replaces": [ + "sh merge-check.sh", + "docker run postgres" + ] + }, + { + "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.", + "input": { + "properties": { + "id": { + "description": "the try's id, try-", + "type": "string" + } + }, + "required": [ + "id" + ], + "type": "object" + }, + "name": "try-read", + "optional": true, + "output": { + "description": "the try: its state, its steps and its verdict when it has one", + "type": "object" + } + }, + { + "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.", + "input": { + "properties": { + "id": { + "description": "the try's id, try-", + "type": "string" + }, + "why": { + "description": "why it is ended, in words", + "type": "string" + } + }, + "required": [ + "id", + "why" + ], + "type": "object" + }, + "name": "try-end", + "optional": true, + "output": { + "properties": { + "ended": { + "description": "it is ended", + "type": "boolean" + }, + "id": { + "description": "the try", + "type": "string" + } + }, + "required": [ + "id", + "ended" + ], + "type": "object" + } + } + ] + }, + { + "decision": "novox/hq ADR 0564", + "emits": [ + "condition-raised", + "condition-changed", + "condition-cleared" + ], + "grain": "seat-list", + "name": "mesh-conditions", + "scope": "mesh", + "serves": [ + { + "description": "What is wrong with the mesh now: every open condition, urgent first, then oldest, raised from the observers' findings (the watchman, the self-check, the healers, the assigner) and cleared when the finding goes, never by hand. Given a key, that one whole with its evidence; with history, every transition lately.", + "input": { + "properties": { + "days": { + "description": "with history: how many days back (default 7, at most 90)", + "type": "string" + }, + "history": { + "description": "\"true\": every raising, change, silence and clearing lately, oldest first", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "key": { + "description": "a condition's key: that one whole; with history, only its transitions", + "type": "string" + }, + "machine": { + "description": "only those about this machine", + "type": "string" + }, + "scope": { + "description": "only this scope: machine, plan, call, build, merge, provider, seat, bus, core, probe, mesh, delivery or module", + "type": "string" + }, + "severity": { + "description": "only urgent, or only warning", + "type": "string" + } + }, + "type": "object" + }, + "name": "conditions" + }, + { + "description": "Stop one condition's messages for a while, a hand act with why: it stays open and in status, and the silence is kept as its transition in history.", + "input": { + "properties": { + "cause": { + "description": "the cause in a word (the condition's kind when absent)", + "type": "string" + }, + "for": { + "description": "how long: 30m, 4h, 2d; at most 7d", + "type": "string" + }, + "key": { + "description": "the condition's key", + "type": "string" + }, + "why": { + "description": "why, required and recorded", + "type": "string" + } + }, + "required": [ + "key", + "for", + "why" + ], + "type": "object" + }, + "name": "silence" + }, + { + "description": "Read every observer's findings again and raise and clear what differs from the open conditions: the recovery of a keeper that missed a change.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "resync" + } + ] + }, + { + "decision": "novox/hq ADR 0564", + "grain": "seat-list", + "name": "mesh-watchdogs", + "scope": "mesh", + "serves": [ + { + "description": "Every watchdog of the signals table the watchman keeps, each a key that expires unless its signal renews it: its row, what renews it, its bound, the age of its newest signal, and the finding its expiry wrote.", + "input": { + "properties": { + "row": { + "description": "one row, e.g. S1", + "type": "string" + } + }, + "type": "object" + }, + "name": "signals" + }, + { + "description": "Every want, build or step the watchman says stopped moving past its bound, with since when and the words of its finding.", + "input": { + "properties": { + "machine": { + "description": "only those on this machine", + "type": "string" + } + }, + "type": "object" + }, + "name": "stuck" + }, + { + "description": "Every machine and tool runner the watchman sees connected, with its last word, and those it says silent; a machine that said it sleeps is shown as sleeping, not silent.", + "input": { + "properties": { + "machine": { + "description": "one machine", + "type": "string" + } + }, + "type": "object" + }, + "name": "presence" + }, + { + "description": "Every message a consumer on the bus gave up on, kept in DEAD_LETTERS: whose consumer, the subject, how often it was handed over and when it was given up, newest first. With id: that one whole. With deliver or drop, a hand act with why.", + "input": { + "properties": { + "cause": { + "description": "with deliver or drop: the cause in a word (dead-letter when absent)", + "type": "string" + }, + "consumer": { + "description": "a consumer's name, or .: only what that one gave up on", + "type": "string" + }, + "deliver": { + "description": "a dead letter's id: deliver it again to the consumer that gave it up (needs why)", + "type": "string" + }, + "drop": { + "description": "a dead letter's id: drop it for good (needs why)", + "type": "string" + }, + "id": { + "description": "a dead letter's id, as the list gives it: that one whole, with its message", + "type": "string" + }, + "limit": { + "description": "how many to list, newest first (default 50); only when listing", + "type": "string" + }, + "why": { + "description": "with deliver or drop: why, required and recorded", + "type": "string" + } + }, + "type": "object" + }, + "name": "dead-letters" + }, + { + "description": "Rebuild presence from the bus's connections, and the pulses and findings from the keys the watchman watches, and take every dead-letter notice waiting: the recovery of a watchman that missed a change.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "resync" + } + ] + }, + { + "decision": "novox/hq ADR 0564", + "emits": [ + "checked" + ], + "grain": "seat-list", + "name": "mesh-self-check", + "scope": "mesh", + "serves": [ + { + "description": "The self-check: the last run's verdict at once, each probe passed, failed, deferred (its facts not on the bus yet, named) or could not run, and how long ago. With run, a run now; with probe, one probe's verdict whole. Runs every five minutes on its own; each failure is a finding.", + "input": { + "properties": { + "probe": { + "description": "one probe's id (D6): its verdict alone, with every finding", + "type": "string" + }, + "run": { + "description": "\"true\": run every probe now and answer the verdict", + "enum": [ + "true", + "false" + ], + "type": "string" + } + }, + "type": "object" + }, + "name": "doctor" + }, + { + "description": "The registry: what each probe asserts, where it reads its facts, and the finding it writes.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "probes" + } + ] + }, + { + "decision": "novox/hq ADR 0564", + "emits": [ + "healer-acted" + ], + "grain": "seat-list", + "name": "mesh-healers", + "scope": "mesh", + "serves": [ + { + "description": "The healers: each registered response to one kind of condition, its repair, its budget and what happens when it is spent; every act taken lately with its outcome, and the mesh-wide brake.", + "input": { + "properties": { + "days": { + "description": "how many days of acts back (default 7)", + "type": "string" + } + }, + "type": "object" + }, + "name": "healers" + }, + { + "description": "Take one healer's act for one open condition now, within its budget and the brake.", + "input": { + "properties": { + "key": { + "description": "the condition's key", + "type": "string" + }, + "why": { + "description": "why now, kept with the act", + "type": "string" + } + }, + "required": [ + "key", + "why" + ], + "type": "object" + }, + "name": "heal" + }, + { + "description": "Record a drill: something broken on purpose to see the mesh raise and clear it, with what it tests. A drill is never a repair: no healer is wanted for it however often it is run.", + "input": { + "properties": { + "condition": { + "description": "the key of the condition the drill is meant to raise, if any (optional)", + "type": "string" + }, + "what": { + "description": "what was done on purpose, in a line", + "type": "string" + }, + "why": { + "description": "what the drill tests", + "type": "string" + } + }, + "required": [ + "what", + "why" + ], + "type": "object" + }, + "name": "drill" + } + ] + }, + { + "decision": "novox/hq ADR 0565", + "emits": [ + "policy-changed" + ], + "grain": "seat-list", + "name": "mesh-wants", + "scope": "mesh", + "serves": [ + { + "description": "Whether each module's new builds wait for a person: its policy (roll, together or record) and where it comes from (a person, the module, the bus, its irreplaceable data, the default); the bus is never rolled. With module, that one; with module, policy and why, a person's choice for it, recorded as a hand act; with policy default, the choice taken back. With compare, each node's own composition and the assigner's findings.", + "input": { + "properties": { + "compare": { + "description": "\"true\": each node's own composition, by its digest, and the assigner's findings", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "module": { + "description": "one module", + "type": "string" + }, + "policy": { + "description": "with module: roll, together, record, or default to take a person's choice back", + "type": "string" + }, + "why": { + "description": "with policy: why, required and kept", + "type": "string" + } + }, + "type": "object" + }, + "name": "upgrade" + }, + { + "description": "What a bus upgrade would do: the fingerprint of the bus module each node runs against the indexer's newest, and the last bus steps from the hand-act log and the assigner's puts of the bus. Read-only: the step itself is the put on the operator's warrant.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "bus" + } + ] + }, + { + "decision": "novox/hq ADR 0565", + "emits": [ + "act-recorded" + ], + "grain": "seat-list", + "name": "mesh-hand-acts", + "scope": "mesh", + "serves": [ + { + "description": "Record one act done by hand: what, why, its cause in a word or a condition's kind (the word a second act for the same reason uses) and the condition it addresses. Who did it is the caller the runtime proves, never said by the caller. Said as act-recorded.", + "input": { + "properties": { + "cause": { + "description": "the cause in a word, or a condition's kind", + "type": "string" + }, + "condition": { + "description": "the key of the condition it addressed, if any (optional)", + "type": "string" + }, + "verb": { + "description": "the act's verb in the log: a repair when absent, `hand-act drill` for a drill, or a recorder's own", + "type": "string" + }, + "what": { + "description": "what was done, in a line", + "type": "string" + }, + "why": { + "description": "why it had to be done by hand", + "type": "string" + } + }, + "required": [ + "what", + "why" + ], + "type": "object" + }, + "name": "hand-act" + }, + { + "description": "What was done by hand lately, over this log and the controller's: who, why and the cause of each, and the causes recorded twice within a fortnight (a healer is wanted).", + "input": { + "properties": { + "cause": { + "description": "only this cause", + "type": "string" + }, + "days": { + "description": "how many days back (default 14)", + "type": "string" + }, + "warrants": { + "description": "\"true\": every warrant recorded", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "who": { + "description": "only acts whose who contains this", + "type": "string" + } + }, + "type": "object" + }, + "name": "hand-acts" + }, + { + "description": "Record what a module did on the operator's warrant: who chose, through which channel, with which proofs and which answer read from the router's own record of that module's ask, never from the caller; once per ask. Refused for an ask still open, ended without a choice, or not that module's.", + "input": { + "properties": { + "ask": { + "description": "its ask's id", + "type": "string" + }, + "asker": { + "description": "the module that asked", + "type": "string" + } + }, + "required": [ + "asker", + "ask" + ], + "type": "object" + }, + "name": "warranted" + } + ] + }, + { + "decision": "novox/hq ADR 0587", + "emits": [ + "enrolment-issued", + "node-enrolled", + "enrolment-refused", + "enrolment-revoked", + "enrolment-expired" + ], + "grain": "seat-list", + "name": "mesh-enrolment", + "scope": "mesh", + "serves": [ + { + "description": "Issue a one-time token for a new machine, on the operator's Approve: refused at once, naming every finding, for a name that is not a node name or that a node record, a placement key or an open enrolment holds, and for every call before the controller's lease is handed away. Otherwise reserves the lowest free private-network address, asks the operator under the seat's own name and, on the warrant, adds the node to placement with its tunnel key, asks the vault for the token and says enrolment-issued. The token itself is read only through tokens.", + "input": { + "properties": { + "expires": { + "description": "how long the token lasts, a duration such as 1h or 24h: one hour when not given, at most 24 hours", + "type": "string" + }, + "node": { + "description": "the new machine's name in the mesh", + "type": "string" + }, + "overlay_key": { + "description": "the new machine's private network (tunnel) public key, as `nox-mesh-host key` prints it", + "type": "string" + }, + "why": { + "description": "why it joins, shown to the operator with the ask", + "type": "string" + } + }, + "required": [ + "node", + "why", + "overlay_key" + ], + "type": "object" + }, + "name": "issue" + }, + { + "description": "Spend a token: asked by a joining node-engine dialled as enrol. alone, with the public halves of its keys and its identity key's proof over them. Spends the token, asks the vault for the node's account and certificate, writes the node into placement, and answers the account sealed to the node, its certificate and the vault's public half, signed by the vault. Asked again with the same keys it finishes what is not done and answers the same; with other keys it is refused.", + "input": { + "additionalProperties": false, + "properties": { + "node": { + "description": "the node the token was issued for", + "type": "string" + }, + "overlay_key": { + "description": "the private network key's public half", + "type": "string" + }, + "profile": { + "description": "what the machine is, as its record says it", + "type": "object" + }, + "proof": { + "description": "the identity key's signature over the redeem's proof bytes (delivery.RedeemProof), base64", + "type": "string" + }, + "public_key": { + "description": "the identity key's public half, base64", + "type": "string" + }, + "sealing_key": { + "description": "the sealing key's public half, which the account is sealed to", + "type": "string" + }, + "serving_key": { + "description": "the serving key's public half, which the certificate binds", + "type": "string" + }, + "tunnel": { + "description": "a tunnel found on the machine: everything but its private key", + "type": "object" + } + }, + "required": [ + "node", + "public_key", + "sealing_key", + "proof" + ], + "type": "object" + }, + "name": "redeem" + }, + { + "description": "Confirm an enrolment: asked by the node-engine dialled as its own node login alone, the runtime's proof of that caller being the confirmation. Says node-enrolled and ends the enrolment.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "confirm" + }, + { + "description": "End an enrolment at any stage, with why, without an Approve: withdraws an open ask, deletes the node's key and its address, has the vault retire an account it already minted for it, records the act as a hand act and says enrolment-revoked.", + "input": { + "properties": { + "node": { + "description": "the node", + "type": "string" + }, + "why": { + "description": "why, recorded with the hand act", + "type": "string" + } + }, + "required": [ + "node", + "why" + ], + "type": "object" + }, + "name": "revoke" + }, + { + "description": "Read every open enrolment, or one: its stage, expiry, ask and revision, the bucket's fill against its cap. For a node at live, its token sealed to the operator key, asked of the vault at that moment and relayed as the vault sealed it. With history, the ended enrolments from the seat's events, as far back as the events are kept.", + "input": { + "properties": { + "history": { + "description": "\"true\": the ended enrolments too", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "node": { + "description": "one node", + "type": "string" + } + }, + "type": "object" + }, + "name": "tokens" + }, + { + "description": "Raise an issue's ask again when the operator's channel does not hold it, and nothing more.", + "input": { + "properties": { + "node": { + "description": "the node whose ask is raised again", + "type": "string" + } + }, + "required": [ + "node" + ], + "type": "object" + }, + "name": "again" + } + ] + }, + { + "decision": "novox/hq ADR 0571", + "emits": [ + "artifacts-gone" + ], + "grain": "seat-list", + "name": "mesh-artifact-sweep", + "scope": "mesh", + "serves": [ + { + "description": "Every artifact the mesh made that lives in its artifact store, each with its repository, digest, kind (image or archive) and state: kept, and why (a want names it, or one of the five newest builds of its module in the builder's log), eligible (made, kept for no reason, not yet let go), or unrecorded (in the store and named by nothing the mesh made: never removed). Reads only.", + "input": { + "properties": { + "collected": { + "description": "\"true\": list the collected references too (counted always)", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "repository": { + "description": "only this repository's references, as / (the counts stay whole)", + "type": "string" + } + }, + "type": "object" + }, + "name": "artifacts" + }, + { + "description": "Whether the artifact store holds each reference given, asked with one HEAD each: held, gone (the store answered 404) or unknown with why. The builder asks it before it reuses a done key. Reads only.", + "input": { + "properties": { + "references": { + "description": "the artifacts' references, artifact-store:////blobs/sha256:: a list, or one text separated by commas", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "references" + ], + "type": "object" + }, + "name": "held" + }, + { + "description": "The artifact store's sweep, now: what is eligible is let go of. Without confirm a dry run: what would be let go, nothing held or deleted. With confirm and why: every kept archive held first, then each eligible artifact let go of, oldest first, an index with the platform manifests no kept index names, each deletion recorded in the hand-act log. Bounded by most (500 by default, at most 5000) and 45 seconds; what is left is said. Never touches a digest the mesh did not make.", + "input": { + "properties": { + "confirm": { + "description": "\"true\": let go of what is eligible (needs why); without it nothing is done", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "most": { + "description": "let go of at most this many (500 by default, at most 5000)", + "type": "string" + }, + "why": { + "description": "with confirm: why, required and recorded", + "type": "string" + } + }, + "type": "object" + }, + "name": "collect" + }, + { + "description": "The bases the mesh copied into its artifact store, each kept (a kept build stood on it), eligible (only builds no longer kept stood on it) or unrecorded (no build the builder's log holds stood on it: never removed), by what the builder's log says each build stood on. Records nothing by hand.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "mirrors" + }, + { + "description": "Every container image one machine's want and have name, each with the resources naming it: what the machine keeps when it prunes its images. Reads only.", + "input": { + "properties": { + "node": { + "description": "the machine's name", + "type": "string" + } + }, + "required": [ + "node" + ], + "type": "object" + }, + "name": "images" + } + ] + }, + { + "decision": "novox/hq ADR 0109; novox/hq ADR 0605", + "delivers": "npm-package-registry", + "emits": [ + "published", + "refused", + "removed" + ], + "grain": "whole", + "name": "npm-package-registry", + "scope": "mesh", + "serves": [ + { + "description": "Open a transfer, naming the artifact and the digest of every part; answers the digests the holder lacks, which the caller then sends by publish-part. A transfer already open answers the parts held, so a cut transfer goes on from there. With no parts and a version, the held digest is published under that version and nothing is stored (the trunk's claim).", + "input": { + "properties": { + "commit": { + "description": "the source commit it was built from", + "type": "string" + }, + "digest": { + "description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", + "type": "string" + }, + "fingerprint": { + "description": "the build's fingerprint", + "type": "string" + }, + "kind": { + "description": "what it is", + "enum": [ + "package", + "image", + "bundle", + "archive", + "upstream" + ], + "type": "string" + }, + "name": { + "description": "the package's, image's, bundle's or archive's name", + "type": "string" + }, + "parts": { + "description": "every part's digest and size; none when the digest is already held", + "items": { + "description": "one part of a transfer", + "properties": { + "digest": { + "description": "the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob", + "type": "string" + }, + "size": { + "description": "its size in bytes", + "type": "integer" + } + }, + "required": [ + "digest", + "size" + ], + "type": "object" + }, + "type": "array" + }, + "tag": { + "description": "the tag it carries, for a tagged version", + "type": "string" + }, + "transfer": { + "description": "the transfer's name, the caller's own; the same name opens the same transfer again", + "type": "string" + }, + "version": { + "description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", + "type": "string" + } + }, + "required": [ + "transfer", + "name", + "kind", + "digest" + ], + "type": "object" + }, + "name": "publish", + "output": { + "properties": { + "held": { + "description": "the digest is held already: nothing to send; the outcome follows as an event", + "type": "boolean" + }, + "lacks": { + "description": "the digests of the parts the holder lacks, to send by publish-part", + "items": { + "type": "string" + }, + "type": "array" + }, + "transfer": { + "description": "the transfer", + "type": "string" + } + }, + "required": [ + "transfer" + ], + "type": "object" + } + }, + { + "description": "Send one chunk of one part of an open transfer; the last chunk of the last part ends the transfer, and the holder hashes what it received, asks builder_versions, stores it and says published or refused. A chunk's message stays under the bus's largest message (1 MiB), so at most 768 KiB of data, base64.", + "input": { + "properties": { + "data": { + "description": "the chunk's bytes, base64 (at most 768 KiB before encoding)", + "type": "string" + }, + "last": { + "description": "this chunk is the part's last", + "type": "boolean" + }, + "part": { + "description": "the part's digest", + "type": "string" + }, + "sequence": { + "description": "the chunk's place in its part, from 0", + "type": "integer" + }, + "transfer": { + "description": "the transfer", + "type": "string" + } + }, + "required": [ + "transfer", + "part", + "sequence", + "last", + "data" + ], + "type": "object" + }, + "name": "publish-part", + "output": { + "properties": { + "complete": { + "description": "the part is whole and its bytes match its digest", + "type": "boolean" + }, + "part": { + "description": "the part", + "type": "string" + }, + "received": { + "description": "the chunks of the part held so far", + "type": "integer" + }, + "transfer": { + "description": "the transfer", + "type": "string" + } + }, + "required": [ + "transfer", + "part" + ], + "type": "object" + } + }, + { + "description": "The versions the seat holds of one name, newest first: each one's version, tag, digest, kind and when it was published.", + "input": { + "properties": { + "kind": { + "description": "narrowed to one kind (optional)", + "type": "string" + }, + "name": { + "description": "the name", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "name": "versions", + "output": { + "properties": { + "name": { + "description": "the name", + "type": "string" + }, + "versions": { + "description": "newest first", + "items": { + "description": "one published thing, as every registry event and answer names it", + "properties": { + "commit": { + "description": "the source commit it was built from", + "type": "string" + }, + "digest": { + "description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", + "type": "string" + }, + "fingerprint": { + "description": "the build's fingerprint", + "type": "string" + }, + "kind": { + "description": "what it is", + "enum": [ + "package", + "image", + "bundle", + "archive", + "upstream" + ], + "type": "string" + }, + "name": { + "description": "the package's, image's, bundle's or archive's name", + "type": "string" + }, + "tag": { + "description": "the tag it carries, for a tagged version", + "type": "string" + }, + "version": { + "description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", + "type": "string" + } + }, + "required": [ + "name", + "kind", + "digest" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "name", + "versions" + ], + "type": "object" + } + }, + { + "description": "Remove one tagged version; the holder refuses an untagged one but for the retention removal of a bundle, archive or copied base by the artifact sweep's holder. Every removal emits removed with its reason.", + "input": { + "properties": { + "digest": { + "description": "the digest (for a bundle, archive or copied base)", + "type": "string" + }, + "name": { + "description": "the name", + "type": "string" + }, + "reason": { + "description": "why it goes", + "enum": [ + "tag-gone", + "retention" + ], + "type": "string" + }, + "tag": { + "description": "the tag (for a tagged version)", + "type": "string" + }, + "version": { + "description": "the version", + "type": "string" + } + }, + "required": [ + "name", + "reason" + ], + "type": "object" + }, + "name": "remove", + "output": { + "properties": { + "artifact": { + "description": "one published thing, as every registry event and answer names it", + "properties": { + "commit": { + "description": "the source commit it was built from", + "type": "string" + }, + "digest": { + "description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", + "type": "string" + }, + "fingerprint": { + "description": "the build's fingerprint", + "type": "string" + }, + "kind": { + "description": "what it is", + "enum": [ + "package", + "image", + "bundle", + "archive", + "upstream" + ], + "type": "string" + }, + "name": { + "description": "the package's, image's, bundle's or archive's name", + "type": "string" + }, + "tag": { + "description": "the tag it carries, for a tagged version", + "type": "string" + }, + "version": { + "description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", + "type": "string" + } + }, + "required": [ + "name", + "kind", + "digest" + ], + "type": "object" + }, + "removed": { + "description": "it is gone", + "type": "boolean" + } + }, + "required": [ + "removed" + ], + "type": "object" + } + } + ] + }, + { + "decision": "novox/hq ADR 0605", + "delivers": "go-package-registry", + "emits": [ + "published", + "refused", + "removed" + ], + "grain": "whole", + "name": "go-package-registry", + "scope": "mesh", + "serves": [ + { + "description": "Open a transfer, naming the artifact and the digest of every part; answers the digests the holder lacks, which the caller then sends by publish-part. A transfer already open answers the parts held, so a cut transfer goes on from there. With no parts and a version, the held digest is published under that version and nothing is stored (the trunk's claim).", + "input": { + "properties": { + "commit": { + "description": "the source commit it was built from", + "type": "string" + }, + "digest": { + "description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", + "type": "string" + }, + "fingerprint": { + "description": "the build's fingerprint", + "type": "string" + }, + "kind": { + "description": "what it is", + "enum": [ + "package", + "image", + "bundle", + "archive", + "upstream" + ], + "type": "string" + }, + "name": { + "description": "the package's, image's, bundle's or archive's name", + "type": "string" + }, + "parts": { + "description": "every part's digest and size; none when the digest is already held", + "items": { + "description": "one part of a transfer", + "properties": { + "digest": { + "description": "the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob", + "type": "string" + }, + "size": { + "description": "its size in bytes", + "type": "integer" + } + }, + "required": [ + "digest", + "size" + ], + "type": "object" + }, + "type": "array" + }, + "tag": { + "description": "the tag it carries, for a tagged version", + "type": "string" + }, + "transfer": { + "description": "the transfer's name, the caller's own; the same name opens the same transfer again", + "type": "string" + }, + "version": { + "description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", + "type": "string" + } + }, + "required": [ + "transfer", + "name", + "kind", + "digest" + ], + "type": "object" + }, + "name": "publish", + "output": { + "properties": { + "held": { + "description": "the digest is held already: nothing to send; the outcome follows as an event", + "type": "boolean" + }, + "lacks": { + "description": "the digests of the parts the holder lacks, to send by publish-part", + "items": { + "type": "string" + }, + "type": "array" + }, + "transfer": { + "description": "the transfer", + "type": "string" + } + }, + "required": [ + "transfer" + ], + "type": "object" + } + }, + { + "description": "Send one chunk of one part of an open transfer; the last chunk of the last part ends the transfer, and the holder hashes what it received, asks builder_versions, stores it and says published or refused. A chunk's message stays under the bus's largest message (1 MiB), so at most 768 KiB of data, base64.", + "input": { + "properties": { + "data": { + "description": "the chunk's bytes, base64 (at most 768 KiB before encoding)", + "type": "string" + }, + "last": { + "description": "this chunk is the part's last", + "type": "boolean" + }, + "part": { + "description": "the part's digest", + "type": "string" + }, + "sequence": { + "description": "the chunk's place in its part, from 0", + "type": "integer" + }, + "transfer": { + "description": "the transfer", + "type": "string" + } + }, + "required": [ + "transfer", + "part", + "sequence", + "last", + "data" + ], + "type": "object" + }, + "name": "publish-part", + "output": { + "properties": { + "complete": { + "description": "the part is whole and its bytes match its digest", + "type": "boolean" + }, + "part": { + "description": "the part", + "type": "string" + }, + "received": { + "description": "the chunks of the part held so far", + "type": "integer" + }, + "transfer": { + "description": "the transfer", + "type": "string" + } + }, + "required": [ + "transfer", + "part" + ], + "type": "object" + } + }, + { + "description": "The versions the seat holds of one name, newest first: each one's version, tag, digest, kind and when it was published.", + "input": { + "properties": { + "kind": { + "description": "narrowed to one kind (optional)", + "type": "string" + }, + "name": { + "description": "the name", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "name": "versions", + "output": { + "properties": { + "name": { + "description": "the name", + "type": "string" + }, + "versions": { + "description": "newest first", + "items": { + "description": "one published thing, as every registry event and answer names it", + "properties": { + "commit": { + "description": "the source commit it was built from", + "type": "string" + }, + "digest": { + "description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", + "type": "string" + }, + "fingerprint": { + "description": "the build's fingerprint", + "type": "string" + }, + "kind": { + "description": "what it is", + "enum": [ + "package", + "image", + "bundle", + "archive", + "upstream" + ], + "type": "string" + }, + "name": { + "description": "the package's, image's, bundle's or archive's name", + "type": "string" + }, + "tag": { + "description": "the tag it carries, for a tagged version", + "type": "string" + }, + "version": { + "description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", + "type": "string" + } + }, + "required": [ + "name", + "kind", + "digest" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "name", + "versions" + ], + "type": "object" + } + }, + { + "description": "Remove one tagged version; the holder refuses an untagged one but for the retention removal of a bundle, archive or copied base by the artifact sweep's holder. Every removal emits removed with its reason.", + "input": { + "properties": { + "digest": { + "description": "the digest (for a bundle, archive or copied base)", + "type": "string" + }, + "name": { + "description": "the name", + "type": "string" + }, + "reason": { + "description": "why it goes", + "enum": [ + "tag-gone", + "retention" + ], + "type": "string" + }, + "tag": { + "description": "the tag (for a tagged version)", + "type": "string" + }, + "version": { + "description": "the version", + "type": "string" + } + }, + "required": [ + "name", + "reason" + ], + "type": "object" + }, + "name": "remove", + "output": { + "properties": { + "artifact": { + "description": "one published thing, as every registry event and answer names it", + "properties": { + "commit": { + "description": "the source commit it was built from", + "type": "string" + }, + "digest": { + "description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", + "type": "string" + }, + "fingerprint": { + "description": "the build's fingerprint", + "type": "string" + }, + "kind": { + "description": "what it is", + "enum": [ + "package", + "image", + "bundle", + "archive", + "upstream" + ], + "type": "string" + }, + "name": { + "description": "the package's, image's, bundle's or archive's name", + "type": "string" + }, + "tag": { + "description": "the tag it carries, for a tagged version", + "type": "string" + }, + "version": { + "description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", + "type": "string" + } + }, + "required": [ + "name", + "kind", + "digest" + ], + "type": "object" + }, + "removed": { + "description": "it is gone", + "type": "boolean" + } + }, + "required": [ + "removed" + ], + "type": "object" + } + } + ] + }, + { + "decision": "novox/hq ADR 0605", + "delivers": "artifact-store", + "emits": [ + "published", + "refused", + "removed", + "held", + "released" + ], + "grain": "whole", + "name": "container-image-registry", + "scope": "mesh", + "serves": [ + { + "description": "Open a transfer, naming the artifact and the digest of every part; answers the digests the holder lacks, which the caller then sends by publish-part. A transfer already open answers the parts held, so a cut transfer goes on from there. With no parts and a version, the held digest is published under that version and nothing is stored (the trunk's claim).", + "input": { + "properties": { + "commit": { + "description": "the source commit it was built from", + "type": "string" + }, + "digest": { + "description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", + "type": "string" + }, + "fingerprint": { + "description": "the build's fingerprint", + "type": "string" + }, + "kind": { + "description": "what it is", + "enum": [ + "package", + "image", + "bundle", + "archive", + "upstream" + ], + "type": "string" + }, + "name": { + "description": "the package's, image's, bundle's or archive's name", + "type": "string" + }, + "parts": { + "description": "every part's digest and size; none when the digest is already held", + "items": { + "description": "one part of a transfer", + "properties": { + "digest": { + "description": "the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob", + "type": "string" + }, + "size": { + "description": "its size in bytes", + "type": "integer" + } + }, + "required": [ + "digest", + "size" + ], + "type": "object" + }, + "type": "array" + }, + "tag": { + "description": "the tag it carries, for a tagged version", + "type": "string" + }, + "transfer": { + "description": "the transfer's name, the caller's own; the same name opens the same transfer again", + "type": "string" + }, + "version": { + "description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", + "type": "string" + } + }, + "required": [ + "transfer", + "name", + "kind", + "digest" + ], + "type": "object" + }, + "name": "publish", + "output": { + "properties": { + "held": { + "description": "the digest is held already: nothing to send; the outcome follows as an event", + "type": "boolean" + }, + "lacks": { + "description": "the digests of the parts the holder lacks, to send by publish-part", + "items": { + "type": "string" + }, + "type": "array" + }, + "transfer": { + "description": "the transfer", + "type": "string" + } + }, + "required": [ + "transfer" + ], + "type": "object" + } + }, + { + "description": "Send one chunk of one part of an open transfer; the last chunk of the last part ends the transfer, and the holder hashes what it received, asks builder_versions, stores it and says published or refused. A chunk's message stays under the bus's largest message (1 MiB), so at most 768 KiB of data, base64.", + "input": { + "properties": { + "data": { + "description": "the chunk's bytes, base64 (at most 768 KiB before encoding)", + "type": "string" + }, + "last": { + "description": "this chunk is the part's last", + "type": "boolean" + }, + "part": { + "description": "the part's digest", + "type": "string" + }, + "sequence": { + "description": "the chunk's place in its part, from 0", + "type": "integer" + }, + "transfer": { + "description": "the transfer", + "type": "string" + } + }, + "required": [ + "transfer", + "part", + "sequence", + "last", + "data" + ], + "type": "object" + }, + "name": "publish-part", + "output": { + "properties": { + "complete": { + "description": "the part is whole and its bytes match its digest", + "type": "boolean" + }, + "part": { + "description": "the part", + "type": "string" + }, + "received": { + "description": "the chunks of the part held so far", + "type": "integer" + }, + "transfer": { + "description": "the transfer", + "type": "string" + } + }, + "required": [ + "transfer", + "part" + ], + "type": "object" + } + }, + { + "description": "The versions the seat holds of one name, newest first: each one's version, tag, digest, kind and when it was published.", + "input": { + "properties": { + "kind": { + "description": "narrowed to one kind (optional)", + "type": "string" + }, + "name": { + "description": "the name", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "name": "versions", + "output": { + "properties": { + "name": { + "description": "the name", + "type": "string" + }, + "versions": { + "description": "newest first", + "items": { + "description": "one published thing, as every registry event and answer names it", + "properties": { + "commit": { + "description": "the source commit it was built from", + "type": "string" + }, + "digest": { + "description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", + "type": "string" + }, + "fingerprint": { + "description": "the build's fingerprint", + "type": "string" + }, + "kind": { + "description": "what it is", + "enum": [ + "package", + "image", + "bundle", + "archive", + "upstream" + ], + "type": "string" + }, + "name": { + "description": "the package's, image's, bundle's or archive's name", + "type": "string" + }, + "tag": { + "description": "the tag it carries, for a tagged version", + "type": "string" + }, + "version": { + "description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", + "type": "string" + } + }, + "required": [ + "name", + "kind", + "digest" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "name", + "versions" + ], + "type": "object" + } + }, + { + "description": "Remove one tagged version; the holder refuses an untagged one but for the retention removal of a bundle, archive or copied base by the artifact sweep's holder. Every removal emits removed with its reason.", + "input": { + "properties": { + "digest": { + "description": "the digest (for a bundle, archive or copied base)", + "type": "string" + }, + "name": { + "description": "the name", + "type": "string" + }, + "reason": { + "description": "why it goes", + "enum": [ + "tag-gone", + "retention" + ], + "type": "string" + }, + "tag": { + "description": "the tag (for a tagged version)", + "type": "string" + }, + "version": { + "description": "the version", + "type": "string" + } + }, + "required": [ + "name", + "reason" + ], + "type": "object" + }, + "name": "remove", + "output": { + "properties": { + "artifact": { + "description": "one published thing, as every registry event and answer names it", + "properties": { + "commit": { + "description": "the source commit it was built from", + "type": "string" + }, + "digest": { + "description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", + "type": "string" + }, + "fingerprint": { + "description": "the build's fingerprint", + "type": "string" + }, + "kind": { + "description": "what it is", + "enum": [ + "package", + "image", + "bundle", + "archive", + "upstream" + ], + "type": "string" + }, + "name": { + "description": "the package's, image's, bundle's or archive's name", + "type": "string" + }, + "tag": { + "description": "the tag it carries, for a tagged version", + "type": "string" + }, + "version": { + "description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", + "type": "string" + } + }, + "required": [ + "name", + "kind", + "digest" + ], + "type": "object" + }, + "removed": { + "description": "it is gone", + "type": "boolean" + } + }, + "required": [ + "removed" + ], + "type": "object" + } + }, + { + "description": "Copy an outside image into the store by its pinned digest; emits published or refused.", + "input": { + "properties": { + "digest": { + "description": "its pinned digest, sha256:", + "type": "string" + }, + "name": { + "description": "the name it is kept under", + "type": "string" + }, + "source": { + "description": "the outside image's reference", + "type": "string" + } + }, + "required": [ + "source", + "digest", + "name" + ], + "type": "object" + }, + "name": "mirror", + "output": { + "properties": { + "digest": { + "description": "the digest stored", + "type": "string" + }, + "reference": { + "description": "the reference the seat answers", + "type": "string" + } + }, + "required": [ + "reference", + "digest" + ], + "type": "object" + } + }, + { + "description": "The tags of one image and the digest each names.", + "input": { + "properties": { + "name": { + "description": "the image", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "name": "tags", + "output": { + "properties": { + "name": { + "description": "the image", + "type": "string" + }, + "tags": { + "description": "every tag", + "items": { + "properties": { + "digest": { + "description": "its digest", + "type": "string" + }, + "tag": { + "description": "the tag", + "type": "string" + } + }, + "required": [ + "tag", + "digest" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "name", + "tags" + ], + "type": "object" + } + }, + { + "description": "Keep one untagged bundle, archive or copied base from removal by retention, as the artifact sweep's rules keep it (ADR 0617 §2); never an image of the holder's own. Emits held.", + "input": { + "properties": { + "digest": { + "description": "the digest", + "type": "string" + }, + "name": { + "description": "the name", + "type": "string" + }, + "reason": { + "description": "which of the sweep's rules keeps it", + "type": "string" + } + }, + "required": [ + "name", + "digest", + "reason" + ], + "type": "object" + }, + "name": "hold", + "output": { + "properties": { + "held": { + "description": "it is held", + "type": "boolean" + }, + "since": { + "description": "when the hold began, RFC 3339", + "type": "string" + } + }, + "required": [ + "held" + ], + "type": "object" + } + }, + { + "description": "Let a hold go; emits released. By hand only through the holder's own tool, the operator's session as the proved caller, recorded as a hand act.", + "input": { + "properties": { + "digest": { + "description": "the digest", + "type": "string" + }, + "name": { + "description": "the name", + "type": "string" + }, + "reason": { + "description": "why it is let go", + "type": "string" + } + }, + "required": [ + "name", + "digest", + "reason" + ], + "type": "object" + }, + "name": "release", + "output": { + "properties": { + "released": { + "description": "the hold is gone", + "type": "boolean" + } + }, + "required": [ + "released" + ], + "type": "object" + } + } + ] + }, + { + "decision": "novox/hq ADR 0605", + "delivers": "artifact-store", + "emits": [ + "published", + "refused", + "removed", + "held", + "released" + ], + "grain": "whole", + "name": "oci-artifact-registry", + "scope": "mesh", + "serves": [ + { + "description": "Open a transfer, naming the artifact and the digest of every part; answers the digests the holder lacks, which the caller then sends by publish-part. A transfer already open answers the parts held, so a cut transfer goes on from there. With no parts and a version, the held digest is published under that version and nothing is stored (the trunk's claim).", + "input": { + "properties": { + "commit": { + "description": "the source commit it was built from", + "type": "string" + }, + "digest": { + "description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", + "type": "string" + }, + "fingerprint": { + "description": "the build's fingerprint", + "type": "string" + }, + "kind": { + "description": "what it is", + "enum": [ + "package", + "image", + "bundle", + "archive", + "upstream" + ], + "type": "string" + }, + "name": { + "description": "the package's, image's, bundle's or archive's name", + "type": "string" + }, + "parts": { + "description": "every part's digest and size; none when the digest is already held", + "items": { + "description": "one part of a transfer", + "properties": { + "digest": { + "description": "the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob", + "type": "string" + }, + "size": { + "description": "its size in bytes", + "type": "integer" + } + }, + "required": [ + "digest", + "size" + ], + "type": "object" + }, + "type": "array" + }, + "tag": { + "description": "the tag it carries, for a tagged version", + "type": "string" + }, + "transfer": { + "description": "the transfer's name, the caller's own; the same name opens the same transfer again", + "type": "string" + }, + "version": { + "description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", + "type": "string" + } + }, + "required": [ + "transfer", + "name", + "kind", + "digest" + ], + "type": "object" + }, + "name": "publish", + "output": { + "properties": { + "held": { + "description": "the digest is held already: nothing to send; the outcome follows as an event", + "type": "boolean" + }, + "lacks": { + "description": "the digests of the parts the holder lacks, to send by publish-part", + "items": { + "type": "string" + }, + "type": "array" + }, + "transfer": { + "description": "the transfer", + "type": "string" + } + }, + "required": [ + "transfer" + ], + "type": "object" + } + }, + { + "description": "Send one chunk of one part of an open transfer; the last chunk of the last part ends the transfer, and the holder hashes what it received, asks builder_versions, stores it and says published or refused. A chunk's message stays under the bus's largest message (1 MiB), so at most 768 KiB of data, base64.", + "input": { + "properties": { + "data": { + "description": "the chunk's bytes, base64 (at most 768 KiB before encoding)", + "type": "string" + }, + "last": { + "description": "this chunk is the part's last", + "type": "boolean" + }, + "part": { + "description": "the part's digest", + "type": "string" + }, + "sequence": { + "description": "the chunk's place in its part, from 0", + "type": "integer" + }, + "transfer": { + "description": "the transfer", + "type": "string" + } + }, + "required": [ + "transfer", + "part", + "sequence", + "last", + "data" + ], + "type": "object" + }, + "name": "publish-part", + "output": { + "properties": { + "complete": { + "description": "the part is whole and its bytes match its digest", + "type": "boolean" + }, + "part": { + "description": "the part", + "type": "string" + }, + "received": { + "description": "the chunks of the part held so far", + "type": "integer" + }, + "transfer": { + "description": "the transfer", + "type": "string" + } + }, + "required": [ + "transfer", + "part" + ], + "type": "object" + } + }, + { + "description": "The versions the seat holds of one name, newest first: each one's version, tag, digest, kind and when it was published.", + "input": { + "properties": { + "kind": { + "description": "narrowed to one kind (optional)", + "type": "string" + }, + "name": { + "description": "the name", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "name": "versions", + "output": { + "properties": { + "name": { + "description": "the name", + "type": "string" + }, + "versions": { + "description": "newest first", + "items": { + "description": "one published thing, as every registry event and answer names it", + "properties": { + "commit": { + "description": "the source commit it was built from", + "type": "string" + }, + "digest": { + "description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", + "type": "string" + }, + "fingerprint": { + "description": "the build's fingerprint", + "type": "string" + }, + "kind": { + "description": "what it is", + "enum": [ + "package", + "image", + "bundle", + "archive", + "upstream" + ], + "type": "string" + }, + "name": { + "description": "the package's, image's, bundle's or archive's name", + "type": "string" + }, + "tag": { + "description": "the tag it carries, for a tagged version", + "type": "string" + }, + "version": { + "description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", + "type": "string" + } + }, + "required": [ + "name", + "kind", + "digest" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "name", + "versions" + ], + "type": "object" + } + }, + { + "description": "Remove one tagged version; the holder refuses an untagged one but for the retention removal of a bundle, archive or copied base by the artifact sweep's holder. Every removal emits removed with its reason.", + "input": { + "properties": { + "digest": { + "description": "the digest (for a bundle, archive or copied base)", + "type": "string" + }, + "name": { + "description": "the name", + "type": "string" + }, + "reason": { + "description": "why it goes", + "enum": [ + "tag-gone", + "retention" + ], + "type": "string" + }, + "tag": { + "description": "the tag (for a tagged version)", + "type": "string" + }, + "version": { + "description": "the version", + "type": "string" + } + }, + "required": [ + "name", + "reason" + ], + "type": "object" + }, + "name": "remove", + "output": { + "properties": { + "artifact": { + "description": "one published thing, as every registry event and answer names it", + "properties": { + "commit": { + "description": "the source commit it was built from", + "type": "string" + }, + "digest": { + "description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", + "type": "string" + }, + "fingerprint": { + "description": "the build's fingerprint", + "type": "string" + }, + "kind": { + "description": "what it is", + "enum": [ + "package", + "image", + "bundle", + "archive", + "upstream" + ], + "type": "string" + }, + "name": { + "description": "the package's, image's, bundle's or archive's name", + "type": "string" + }, + "tag": { + "description": "the tag it carries, for a tagged version", + "type": "string" + }, + "version": { + "description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", + "type": "string" + } + }, + "required": [ + "name", + "kind", + "digest" + ], + "type": "object" + }, + "removed": { + "description": "it is gone", + "type": "boolean" + } + }, + "required": [ + "removed" + ], + "type": "object" + } + }, + { + "description": "Keep one untagged bundle, archive or copied base from removal by retention, as the artifact sweep's rules keep it (ADR 0617 §2); never an image of the holder's own. Emits held.", + "input": { + "properties": { + "digest": { + "description": "the digest", + "type": "string" + }, + "name": { + "description": "the name", + "type": "string" + }, + "reason": { + "description": "which of the sweep's rules keeps it", + "type": "string" + } + }, + "required": [ + "name", + "digest", + "reason" + ], + "type": "object" + }, + "name": "hold", + "output": { + "properties": { + "held": { + "description": "it is held", + "type": "boolean" + }, + "since": { + "description": "when the hold began, RFC 3339", + "type": "string" + } + }, + "required": [ + "held" + ], + "type": "object" + } + }, + { + "description": "Let a hold go; emits released. By hand only through the holder's own tool, the operator's session as the proved caller, recorded as a hand act.", + "input": { + "properties": { + "digest": { + "description": "the digest", + "type": "string" + }, + "name": { + "description": "the name", + "type": "string" + }, + "reason": { + "description": "why it is let go", + "type": "string" + } + }, + "required": [ + "name", + "digest", + "reason" + ], + "type": "object" + }, + "name": "release", + "output": { + "properties": { + "released": { + "description": "the hold is gone", + "type": "boolean" + } + }, + "required": [ + "released" + ], + "type": "object" + } + } + ] + }, + { + "decision": "novox/hq ADR 0111", + "delivers": "git", + "grain": "seat-list", + "name": "git", + "scope": "mesh" + }, + { + "accepts": [ + "delivery", + "check", + "recheck" + ], + "decision": "novox/hq ADR 0525, ADR 0536, ADR 0553", + "grain": "seat-list", + "name": "node-build-go", + "pulledByKind": true, + "scope": "node", + "serves": [ + { + "description": "The Go asks this node runs now (each ask's id, kind, module and when it started), its build capacity, and whether it is paused, taking no new ask.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "current" + }, + { + "description": "Take no new Go ask on this node until resumed; an ask running here ends in its place. Kept across a restart of the build module (its pause key). A capacity of 0 is the lasting way to keep a node from building.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "pause" + }, + { + "description": "Take Go asks again on this node.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "resume" + } + ], + "yields": true + }, + { + "accepts": [ + "delivery", + "check", + "recheck" + ], + "decision": "novox/hq ADR 0525, ADR 0536, ADR 0553", + "grain": "seat-list", + "name": "node-build-node", + "pulledByKind": true, + "scope": "node", + "serves": [ + { + "description": "The Node asks this node runs now (each ask's id, kind, module and when it started), its build capacity, and whether it is paused, taking no new ask.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "current" + }, + { + "description": "Take no new Node ask on this node until resumed; an ask running here ends in its place. Kept across a restart of the build module (its pause key). A capacity of 0 is the lasting way to keep a node from building.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "pause" + }, + { + "description": "Take Node asks again on this node.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "resume" + } + ], + "yields": true + }, + { + "accepts": [ + "delivery", + "check", + "recheck" + ], + "decision": "novox/hq ADR 0525, ADR 0536, ADR 0553", + "grain": "seat-list", + "name": "node-build-image", + "pulledByKind": true, + "scope": "node", + "serves": [ + { + "description": "The image asks this node runs now (each ask's id, kind, module and when it started), its build capacity, and whether it is paused, taking no new ask.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "current" + }, + { + "description": "Take no new image ask on this node until resumed; an ask running here ends in its place. Kept across a restart of the build module (its pause key). A capacity of 0 is the lasting way to keep a node from building.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "pause" + }, + { + "description": "Take image asks again on this node.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "resume" + } + ], + "yields": true + }, + { + "decision": "novox/hq ADR 0194, ADR 0223", + "delivers": "wildcard-resolution", + "grain": "seat-list", + "name": "mesh-dns-resolver", + "replicated": true, + "scope": "mesh" + }, + { + "decision": "novox/hq ADR 0199, ADR 0223", + "grain": "seat-list", + "name": "node-hostname", + "scope": "node", + "serves": [ + { + "description": "Every line of this machine's /etc/hosts, each marked whose it is: the operator's, or the block of the module or tool that writes it.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "entries", + "replaces": [ + "cat /etc/hosts", + "getent hosts" + ] + }, + { + "description": "Add one address and its names to the operator's lines of this machine's /etc/hosts — a name for this machine's own programs, not the mesh's.", + "input": { + "properties": { + "address": { + "description": "the IPv4 or IPv6 address", + "type": "string" + }, + "names": { + "description": "the names for it, separated by spaces", + "type": "string" + } + }, + "required": [ + "address", + "names" + ], + "type": "object" + }, + "name": "add", + "replaces": [ + "edit /etc/hosts", + "HOSTALIASES" + ] + }, + { + "description": "Remove one name, or every line of one address, from the operator's lines of this machine's /etc/hosts. A line a module writes is refused, naming the module.", + "input": { + "properties": { + "name": { + "description": "a host name, or an address to remove every line of", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "name": "remove", + "replaces": [ + "sed -i /etc/hosts" + ] + } + ] + }, + { + "decision": "novox/hq ADR 0121", + "grain": "seat-list", + "name": "node-intrusion-prevention", + "scope": "node", + "serves": [ + { + "description": "Every jail on this machine with how many it is watching and holding now, and the totals since the jail started; one jail's detail when named.", + "input": { + "properties": { + "jail": { + "description": "one jail (optional)", + "type": "string" + } + }, + "type": "object" + }, + "name": "status", + "replaces": [ + "fail2ban-client status" + ] + }, + { + "description": "Every address banned on this machine right now, with the jail that holds it and when the ban ends.", + "input": { + "properties": { + "jail": { + "description": "one jail (optional)", + "type": "string" + } + }, + "type": "object" + }, + "name": "banned", + "replaces": [ + "fail2ban-client banned" + ] + }, + { + "description": "Ban one address in one jail now, for the jail's ban time — an operator's act on the live ban list, which the mesh never writes itself.", + "input": { + "properties": { + "ip": { + "description": "the address", + "type": "string" + }, + "jail": { + "description": "the jail to hold it", + "type": "string" + } + }, + "required": [ + "ip", + "jail" + ], + "type": "object" + }, + "name": "ban", + "replaces": [ + "fail2ban-client set banip" + ] + }, + { + "description": "Let one address go, from one jail or from every jail when none is named.", + "input": { + "properties": { + "ip": { + "description": "the address", + "type": "string" + }, + "jail": { + "description": "one jail (optional)", + "type": "string" + } + }, + "required": [ + "ip" + ], + "type": "object" + }, + "name": "unban", + "replaces": [ + "fail2ban-client unban", + "fail2ban-client set unbanip" + ] + } + ] + }, + { + "decision": "novox/hq ADR 0121", + "grain": "seat-list", + "name": "node-packet-filter", + "scope": "node", + "serves": [ + { + "description": "The packet filter as this machine enforces it now: the nftables ruleset and, where the tool exists, the legacy filter's listings. Narrowed to one table or chain when asked.", + "input": { + "properties": { + "chain": { + "description": "one chain of that table (optional)", + "type": "string" + }, + "table": { + "description": "one nftables table, as `family name` (optional)", + "type": "string" + } + }, + "type": "object" + }, + "name": "rules", + "replaces": [ + "nft list ruleset", + "iptables -L", + "iptables-save" + ] + }, + { + "description": "Load the mesh's own filter again from the file the mesh writes, and answer with the mesh's table as loaded.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "reload", + "replaces": [ + "nft -f" + ] + }, + { + "description": "Remove one rule set the mesh did not write, named exactly as the host reports it (novox/hq ADR 0168) — `chain X (iptables-legacy)` or `table ip6 filter, chain DOCKER-USER`. Refuses the mesh's tables, the runtime's own chains, a built-in chain and an active found firewall's chains. An operator's act, by name, never a flush.", + "input": { + "properties": { + "where": { + "description": "the rule set, as `node show` lists it", + "type": "string" + } + }, + "required": [ + "where" + ], + "type": "object" + }, + "name": "remove", + "replaces": [ + "nft delete", + "iptables -X" + ] + } + ] + }, + { + "decision": "novox/hq ADR 0177", + "grain": "seat-list", + "name": "node-service-manager", + "scope": "node", + "serves": [ + { + "description": "The units the service manager knows in a scope, each with its load, active and sub state; narrowed to a pattern when asked.", + "input": { + "properties": { + "pattern": { + "description": "a glob the unit's name must match (optional)", + "type": "string" + }, + "scope": { + "description": "\"system\" (the default) or \"user\": the operator account's own manager", + "type": "string" + } + }, + "type": "object" + }, + "name": "units", + "replaces": [ + "systemctl list-units" + ] + }, + { + "description": "One unit as the service manager sees it now: its states, whether it starts at boot, its main process, and whether the mesh declares it.", + "input": { + "properties": { + "scope": { + "description": "\"system\" (the default) or \"user\": the operator account's own manager", + "type": "string" + }, + "unit": { + "description": "the unit's name, as the service manager knows it", + "type": "string" + } + }, + "required": [ + "unit" + ], + "type": "object" + }, + "name": "status", + "replaces": [ + "systemctl status", + "systemctl is-active" + ] + }, + { + "description": "Start one unit. For a unit the mesh declares, the answer says the host will restore what its declaration says at the next apply.", + "input": { + "properties": { + "scope": { + "description": "\"system\" (the default) or \"user\": the operator account's own manager", + "type": "string" + }, + "unit": { + "description": "the unit's name, as the service manager knows it", + "type": "string" + } + }, + "required": [ + "unit" + ], + "type": "object" + }, + "name": "start", + "replaces": [ + "systemctl start" + ] + }, + { + "description": "Stop one unit; for a mesh-declared unit the answer says the host will restore its declared state.", + "input": { + "properties": { + "scope": { + "description": "\"system\" (the default) or \"user\": the operator account's own manager", + "type": "string" + }, + "unit": { + "description": "the unit's name, as the service manager knows it", + "type": "string" + } + }, + "required": [ + "unit" + ], + "type": "object" + }, + "name": "stop", + "replaces": [ + "systemctl stop" + ] + }, + { + "description": "Restart one unit.", + "input": { + "properties": { + "scope": { + "description": "\"system\" (the default) or \"user\": the operator account's own manager", + "type": "string" + }, + "unit": { + "description": "the unit's name, as the service manager knows it", + "type": "string" + } + }, + "required": [ + "unit" + ], + "type": "object" + }, + "name": "restart", + "replaces": [ + "systemctl restart" + ] + }, + { + "description": "Make one unit start at boot (or at the account's login, in user scope).", + "input": { + "properties": { + "scope": { + "description": "\"system\" (the default) or \"user\": the operator account's own manager", + "type": "string" + }, + "unit": { + "description": "the unit's name, as the service manager knows it", + "type": "string" + } + }, + "required": [ + "unit" + ], + "type": "object" + }, + "name": "enable", + "replaces": [ + "systemctl enable" + ] + }, + { + "description": "Stop one unit starting at boot (or at login, in user scope).", + "input": { + "properties": { + "scope": { + "description": "\"system\" (the default) or \"user\": the operator account's own manager", + "type": "string" + }, + "unit": { + "description": "the unit's name, as the service manager knows it", + "type": "string" + } + }, + "required": [ + "unit" + ], + "type": "object" + }, + "name": "disable", + "replaces": [ + "systemctl disable" + ] + }, + { + "description": "The last lines of one unit's journal (at most 2000), in a time window and narrowed to a priority and to lines holding a text when asked. A secret the unit printed is shown as [redacted: ].", + "input": { + "properties": { + "lines": { + "description": "how many lines from the end of what matches (default 100, at most 2000)", + "type": "string" + }, + "match": { + "description": "only the lines holding this text, as written — a fixed string, not a pattern (optional)", + "type": "string" + }, + "priority": { + "description": "only entries this severe or more: 0-7 or emerg, alert, crit, err, warning, notice, info, debug (optional)", + "type": "string" + }, + "scope": { + "description": "\"system\" (the default) or \"user\": the operator account's own manager", + "type": "string" + }, + "since": { + "description": "the window's start: an RFC 3339 time (2026-10-07T09:30:00Z) or relative to now (-30min, -2h, yesterday) (optional)", + "type": "string" + }, + "unit": { + "description": "the unit's name, as the service manager knows it", + "type": "string" + }, + "until": { + "description": "the window's end, in the same forms (optional; now when absent)", + "type": "string" + } + }, + "required": [ + "unit" + ], + "type": "object" + }, + "name": "journal", + "replaces": [ + "journalctl" + ] + }, + { + "description": "Every failed unit on this machine, in the system manager and in the operator account's; a manager that does not answer is reported with its error, never as nothing failed.", + "input": { + "properties": { + "scope": { + "description": "\"system\" or \"user\": only that manager (both when absent)", + "type": "string" + } + }, + "type": "object" + }, + "name": "failed", + "optional": true, + "replaces": [ + "systemctl --failed" + ] + }, + { + "description": "Clear one unit's failed record in its manager — its failed state and its start-limit count — and answer its state after. It removes no file and starts nothing.", + "input": { + "properties": { + "scope": { + "description": "\"system\" (the default) or \"user\": the operator account's own manager", + "type": "string" + }, + "unit": { + "description": "the unit's name, as the service manager knows it", + "type": "string" + } + }, + "required": [ + "unit" + ], + "type": "object" + }, + "name": "reset-failed", + "replaces": [ + "systemctl reset-failed" + ] + }, + { + "description": "What wants, requires or triggers one unit, read-only: the manager's reverse dependencies (WantedBy, RequiredBy, UpheldBy, BoundBy, TriggeredBy and the rest) and every enable link naming it in the scope's configuration directories (*.wants, *.requires, *.upholds), each with where it points and whether it dangles — the account's own directory included in user scope.", + "input": { + "properties": { + "scope": { + "description": "\"system\" (the default) or \"user\": the operator account's own manager", + "type": "string" + }, + "unit": { + "description": "the unit's name, as the service manager knows it", + "type": "string" + } + }, + "required": [ + "unit" + ], + "type": "object" + }, + "name": "wanted-by", + "replaces": [ + "systemctl list-dependencies --reverse", + "systemctl show -p WantedBy", + "ls ~/.config/systemd/user/*.wants" + ] + }, + { + "description": "Remove the dangling enable links named for one unit — links in a *.wants, *.requires or *.upholds directory of the account's or the machine's own configuration whose target does not exist, which `disable` leaves once the unit's file is gone — on the person's word: `why` is required. Each is recorded (its path, its target, the reason) before it is removed, and the manager reloaded; a link whose target exists, or one a package, a generator or the runtime placed, is left and said.", + "input": { + "properties": { + "scope": { + "description": "\"system\" (the default) or \"user\": the operator account's own manager", + "type": "string" + }, + "unit": { + "description": "the unit's name, as the service manager knows it", + "type": "string" + }, + "why": { + "description": "the person's reason for removing the links, kept in the record", + "type": "string" + } + }, + "required": [ + "unit", + "why" + ], + "type": "object" + }, + "name": "unlink-dangling", + "replaces": [ + "rm ~/.config/systemd/user/*.wants/", + "unlink /etc/systemd/system/*.wants/" + ] + } + ] + }, + { + "decision": "novox/hq ADR 0207", + "grain": "seat-list", + "name": "node-package-manager", + "scope": "node" + }, + { + "decision": "novox/hq ADR 0166, ADR 0207", + "grain": "seat-list", + "name": "node-container-runtime", + "scope": "node" + }, + { + "decision": "novox/hq ADR 0203", + "grain": "seat-list", + "name": "node-environment", + "scope": "node" + }, + { + "decision": "novox/hq ADR 0349", + "grain": "seat-list", + "name": "node-provisioner", + "scope": "node" + }, + { + "decision": "novox/hq ADR 0204", + "grain": "seat-list", + "name": "node-login-shell", + "scope": "node", + "serves": [ + { + "description": "Run one command on this machine as the operator account, in a non-interactive login shell in its home; answers with what it printed and how it exited.", + "input": { + "properties": { + "command": { + "description": "the command line, as you would type it", + "type": "string" + }, + "timeout_seconds": { + "description": "give up after this long, at most 25 (default 20)", + "type": "string" + } + }, + "required": [ + "command" + ], + "type": "object" + }, + "name": "execute", + "optional": true + } + ] + }, + { + "decision": "novox/hq ADR 0211", + "grain": "seat-list", + "name": "node-power", + "scope": "node" + }, + { + "decision": "novox/hq ADR 0212", + "grain": "seat-list", + "name": "node-hotkeys", + "scope": "node" + }, + { + "decision": "novox/hq ADR 0215", + "grain": "seat-list", + "name": "node-message-bus", + "scope": "node" + }, + { + "decision": "novox/hq ADR 0214", + "grain": "seat-list", + "name": "node-backup", + "scope": "node", + "serves": [ + { + "description": "What this machine backs up: each module, what it declared, its last good night, how many restore points are kept and the repository's size.", + "input": { + "properties": { + "module": { + "description": "one module (optional)", + "type": "string" + } + }, + "type": "object" + }, + "name": "backed-up", + "replaces": [ + "restic snapshots" + ] + }, + { + "description": "Take a backup now, of one module or of every module on this machine — before a migration, a retirement or anything else that could go wrong.", + "input": { + "properties": { + "module": { + "description": "one module (optional)", + "type": "string" + } + }, + "type": "object" + }, + "name": "now", + "replaces": [ + "restic backup" + ] + }, + { + "description": "Restore one module's data from a restore point BESIDE the live data, never over it: each directory as .restored-. Swapping it in is a person's act. Lists the restore points when none is named.", + "input": { + "properties": { + "module": { + "description": "the module", + "type": "string" + }, + "path": { + "description": "one of the module's directories (all of them when omitted)", + "type": "string" + }, + "snapshot": { + "description": "the restore point (from `backed-up`; the newest when omitted)", + "type": "string" + } + }, + "required": [ + "module" + ], + "type": "object" + }, + "name": "restore", + "replaces": [ + "restic restore" + ] + } + ] + }, + { + "decision": "novox/hq ADR 0110", + "grain": "seat-list", + "name": "the-private-network", + "scope": "node" + }, + { + "decision": "novox/hq ADR 0117", + "grain": "seat-list", + "name": "node-uplink", + "scope": "node", + "serves": [ + { + "description": "The machine's resolver file as it is now: the resolvers, search domains and options it lists, whether it is the file the mesh declares, and when it is not, who wrote it as far as the machine shows — its header, a backup a VPN client left beside it, a link in its place, a known writer running.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "resolvers", + "optional": true + }, + { + "description": "Every network link on the machine: its state, its addresses, whether the default route leaves through it, and the resolvers and search domains the network manager knows for it — a VPN's tunnel included.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "links", + "optional": true + } + ] + }, + { + "decision": "novox/hq ADR 0247", + "grain": "seat-list", + "name": "node-resolver", + "scope": "node", + "serves": [ + { + "description": "What this machine's own resolver sends where: the mesh's resolvers, which answer every name not routed elsewhere, and each link given servers of its own with the domains routed to them. Also the resolver file's outside writes it kept, newest first: when, who wrote it as far as the file says, whether a module took it, and when the resolver's own file was put back.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "routes", + "replaces": [ + "resolvectl status", + "resolvectl dns", + "resolvectl domain" + ] + }, + { + "description": "Send these domains, and every name under them, to these servers over this link — and only them: the link is never the machine's default route for names, and the mesh's own domain is refused. Replaces whatever the link was given before. A link that goes away takes its route with it.", + "input": { + "properties": { + "domains": { + "description": "the domains to route there, separated by spaces or commas", + "type": "string" + }, + "link": { + "description": "the network link the servers are reached over, by name (a VPN's tunnel interface)", + "type": "string" + }, + "servers": { + "description": "the servers' addresses, separated by spaces or commas", + "type": "string" + } + }, + "required": [ + "link", + "domains", + "servers" + ], + "type": "object" + }, + "name": "route", + "replaces": [ + "resolvectl dns", + "resolvectl domain", + "resolvectl default-route" + ] + }, + { + "description": "Take one link's route away: its domains go back to the mesh's resolvers. Nothing changes when the link has none.", + "input": { + "properties": { + "link": { + "description": "the network link, by name", + "type": "string" + } + }, + "required": [ + "link" + ], + "type": "object" + }, + "name": "unroute", + "replaces": [ + "resolvectl revert" + ] + } + ] + }, + { + "decision": "novox/hq ADR 0263", + "grain": "seat-list", + "name": "node-nfs-server", + "scope": "node", + "serves": [ + { + "description": "Every share this machine exports: its name, its path, read-write or read-only, the owner every client is mapped to (uid and gid), each node it is exported to with that node's private address and access (only the nodes the server grants it to and that ask for it), what is granted and not asked for or asked for and not granted, and whether the kernel holds it now. Also the exports found that are not the mesh's: a dataset's sharenfs property, a line in /etc/exports.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "exports", + "replaces": [ + "exportfs -v", + "cat /etc/exports", + "zfs get sharenfs" + ] + }, + { + "description": "Which machines have mounted which share now, as the NFS server knows its clients.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "clients", + "replaces": [ + "ss -tn sport = :2049", + "cat /proc/fs/nfsd/clients/*/info" + ] + }, + { + "description": "Whether this machine exports one share for the mesh now, and whether its NFS service is up; with an address, also whether the share is exported to that address: a node's own private address, when the server grants it the share and the node asks for it. What a machine mounting the share asks before it mounts.", + "input": { + "properties": { + "address": { + "description": "a node's private address, to ask whether the share is exported to it (optional)", + "type": "string" + }, + "share": { + "description": "the share, by its name", + "type": "string" + } + }, + "required": [ + "share" + ], + "type": "object" + }, + "name": "test", + "replaces": [ + "showmount -e" + ] + }, + { + "description": "Have the kernel read this machine's export files again now (exportfs -ra) and answer the shares as it then holds them. The module's own process writes its export file; this is for after a change made outside it. Changes no shared path.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "reload", + "replaces": [ + "exportfs -ra" + ] + }, + { + "description": "Take over an export a person made by hand: clear a dataset's sharenfs property for a path the mesh's own export now serves — only when that export is live. Without confirm, says what it would do and changes nothing.", + "input": { + "properties": { + "confirm": { + "description": "\"true\": change it (needs why); anything else is a dry run", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "path": { + "description": "the shared path whose hand-made export is taken over", + "type": "string" + }, + "why": { + "description": "why, for the record", + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "name": "adopt", + "replaces": [ + "zfs set sharenfs=off" + ] + } + ] + }, + { + "decision": "novox/hq ADR 0263", + "grain": "seat-list", + "name": "node-mounts", + "scope": "node", + "serves": [ + { + "description": "Every mount point on this machine: its fstab line, the mesh's mount and automount units for it, its state (armed, mounted, absent, unreachable, failed) and since when, and which settings asked for it. A password in a mount's options is never shown.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "list", + "replaces": [ + "cat /etc/fstab", + "findmnt", + "systemctl list-units --type=mount" + ] + }, + { + "description": "Whether one share's or occasional source's server answers from this machine now, without touching its mount point.", + "input": { + "properties": { + "name": { + "description": "the share or source, by its name", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "name": "test", + "replaces": [ + "showmount -e", + "ping" + ] + }, + { + "description": "Mount one share or occasional source now, rather than at its first access.", + "input": { + "properties": { + "name": { + "description": "the share or source, by its name", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "name": "mount", + "replaces": [ + "mount" + ] + }, + { + "description": "Release one share or occasional source now; its automount stays armed, so the next access mounts it again.", + "input": { + "properties": { + "name": { + "description": "the share or source, by its name", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "name": "unmount", + "replaces": [ + "umount" + ] + }, + { + "description": "Take over a mount a person wrote by hand: comment out the /etc/fstab line for a mount point the mesh's own units now serve, keeping a copy of the file — only when the mesh's automount for it is armed. Without confirm, says what it would do and changes nothing.", + "input": { + "properties": { + "confirm": { + "description": "\"true\": change it (needs why); anything else is a dry run", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "mountpoint": { + "description": "the mount point whose fstab line is taken over", + "type": "string" + }, + "why": { + "description": "why, for the record", + "type": "string" + } + }, + "required": [ + "mountpoint" + ], + "type": "object" + }, + "name": "adopt", + "replaces": [ + "sed -i /etc/fstab" + ] + } + ] + }, + { + "decision": "novox/hq ADR 0310", + "grain": "seat-list", + "name": "node-reads", + "scope": "node", + "serves": [ + { + "description": "Each component of one path or several, from / down: its type, owner and group (name and number), mode, whether it is a link and to what, and whether it is a mount point and of which file system. A link is not followed unless follow is \"true\". Read as the holder's own account, which holds no secret: a component it may not reach says so. At most 200 paths in one call.", + "input": { + "properties": { + "follow": { + "description": "\"true\": also say where the path leads once every link is followed", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "paths": { + "description": "one absolute path, or several separated by line breaks", + "type": "string" + } + }, + "required": [ + "paths" + ], + "type": "object" + }, + "name": "stat", + "replaces": [ + "stat", + "ls -ld", + "namei -l", + "findmnt -T" + ] + }, + { + "description": "What one link points to, as written, and where the path leads once every link is followed, and whether that exists.", + "input": { + "properties": { + "path": { + "description": "an absolute path", + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "name": "readlink", + "replaces": [ + "readlink", + "readlink -f", + "realpath" + ] + }, + { + "description": "Every entry of one directory with its type, owner, group, mode, size and, for a link, its target. At most 2000 entries; a longer directory is cut and says so. A place a secret is kept is refused by name.", + "input": { + "properties": { + "path": { + "description": "an absolute path to a directory", + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "name": "list", + "replaces": [ + "ls", + "ls -la" + ] + }, + { + "description": "One text file, or a part of it by line: at most 256 KiB in one answer (64 KiB unless more is asked), cut at a line and said so. A binary file is refused; a place a secret is kept, or a known credential file, is refused by name; a line shaped like a secret is withheld and its number said. /proc and /sys are read as far as the holder's account may.", + "input": { + "properties": { + "bytes": { + "description": "the most bytes to answer, up to 262144 (optional, 65536 unless given)", + "type": "string" + }, + "from": { + "description": "the first line to answer, counted from 1 (optional)", + "type": "string" + }, + "lines": { + "description": "how many lines to answer (optional)", + "type": "string" + }, + "path": { + "description": "an absolute path to a file", + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "name": "read", + "replaces": [ + "cat", + "head", + "tail", + "less" + ] + }, + { + "description": "Find a fixed string (never a pattern) in one file or under one directory: every matching line with its file and number. Bounded: at most 500 matches (100 unless more is asked), 8 directories deep (4 unless more is asked), 5000 files and 4 MiB per file; links are not followed and binary files are skipped. A place a secret is kept is skipped and named; a matching line shaped like a secret is withheld. The answer says which bound it met.", + "input": { + "properties": { + "case": { + "description": "\"false\": match whatever the case (optional)", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "depth": { + "description": "how many directories deep, up to 8 (optional)", + "type": "string" + }, + "matches": { + "description": "the most matches to answer, up to 500 (optional)", + "type": "string" + }, + "path": { + "description": "an absolute path to a file or a directory", + "type": "string" + }, + "text": { + "description": "the fixed string to find", + "type": "string" + } + }, + "required": [ + "text", + "path" + ], + "type": "object" + }, + "name": "search", + "replaces": [ + "grep", + "grep -r", + "grep -F" + ] + }, + { + "description": "One account or group by name or number, as this node's account files say: an account's number, group, home, shell and every group it is in; a group's number and members. With neither, every account and group. Never a password field.", + "input": { + "properties": { + "group": { + "description": "a group's name or number (optional)", + "type": "string" + }, + "name": { + "description": "an account's name or number (optional)", + "type": "string" + } + }, + "type": "object" + }, + "name": "account", + "replaces": [ + "getent passwd", + "getent group", + "id", + "groups" + ] + } + ] + }, + { + "decision": "novox/hq ADR 0394", + "grain": "seat-list", + "name": "node-files", + "scope": "node", + "serves": [ + { + "description": "Each component of one path or several, from / down: its type, owner and group (name and number), mode, whether it is a link and to what, and whether it is a mount point and of which file system. A link is not followed unless follow is \"true\". At most 200 paths in one call. Read as the node's operator account, through sudo -n where its rights do not reach; a place a secret is kept, or a known credential file, is refused by name.", + "input": { + "properties": { + "follow": { + "description": "\"true\": also say where the path leads once every link is followed", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "paths": { + "description": "one absolute path, or several separated by line breaks", + "type": "string" + } + }, + "required": [ + "paths" + ], + "type": "object" + }, + "name": "stat", + "replaces": [ + "stat", + "ls -ld", + "namei -l", + "findmnt -T" + ] + }, + { + "description": "What one link points to, as written, and where the path leads once every link is followed, and whether that exists. Read as the node's operator account, through sudo -n where its rights do not reach; a place a secret is kept, or a known credential file, is refused by name.", + "input": { + "properties": { + "path": { + "description": "an absolute path", + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "name": "readlink", + "replaces": [ + "readlink", + "readlink -f", + "realpath" + ] + }, + { + "description": "Every entry of one directory with its type, owner, group, mode, size and, for a link, its target. At most 2000 entries; a longer directory is cut and says so. A place a secret is kept is refused by name. Read as the node's operator account, through sudo -n where its rights do not reach; a place a secret is kept, or a known credential file, is refused by name.", + "input": { + "properties": { + "path": { + "description": "an absolute path to a directory", + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "name": "list", + "replaces": [ + "ls", + "ls -la" + ] + }, + { + "description": "One text file, or a part of it by line: at most 256 KiB in one answer (64 KiB unless more is asked), cut at a line and said so. A binary file is refused; a place a secret is kept, or a known credential file, is refused by name; a line shaped like a secret is withheld and its number said. /proc and /sys are read as far as the holder's account may. Read as the node's operator account, through sudo -n where its rights do not reach; a place a secret is kept, or a known credential file, is refused by name.", + "input": { + "properties": { + "bytes": { + "description": "the most bytes to answer, up to 262144 (optional, 65536 unless given)", + "type": "string" + }, + "from": { + "description": "the first line to answer, counted from 1 (optional)", + "type": "string" + }, + "lines": { + "description": "how many lines to answer (optional)", + "type": "string" + }, + "path": { + "description": "an absolute path to a file", + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "name": "read", + "replaces": [ + "cat", + "head", + "tail", + "less" + ] + }, + { + "description": "Find a fixed string (never a pattern) in one file or under one directory: every matching line with its file and number. Bounded: at most 500 matches (100 unless more is asked), 8 directories deep (4 unless more is asked), 5000 files and 4 MiB per file; links are not followed and binary files are skipped. A place a secret is kept is skipped and named; a matching line shaped like a secret is withheld. The answer says which bound it met. Read as the node's operator account, through sudo -n where its rights do not reach; a place a secret is kept, or a known credential file, is refused by name.", + "input": { + "properties": { + "case": { + "description": "\"false\": match whatever the case (optional)", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "depth": { + "description": "how many directories deep, up to 8 (optional)", + "type": "string" + }, + "matches": { + "description": "the most matches to answer, up to 500 (optional)", + "type": "string" + }, + "path": { + "description": "an absolute path to a file or a directory", + "type": "string" + }, + "text": { + "description": "the fixed string to find", + "type": "string" + } + }, + "required": [ + "text", + "path" + ], + "type": "object" + }, + "name": "search", + "replaces": [ + "grep", + "grep -r", + "grep -F" + ] + }, + { + "description": "One account or group by name or number, as this node's account files say: an account's number, group, home, shell and every group it is in; a group's number and members. With neither, every account and group. Never a password field. Read as the node's operator account, through sudo -n where its rights do not reach; a place a secret is kept, or a known credential file, is refused by name.", + "input": { + "properties": { + "group": { + "description": "a group's name or number (optional)", + "type": "string" + }, + "name": { + "description": "an account's name or number (optional)", + "type": "string" + } + }, + "type": "object" + }, + "name": "account", + "replaces": [ + "getent passwd", + "getent group", + "id", + "groups" + ] + }, + { + "description": "Write one text file whole, replacing what it holds; the old content goes to the node's trash. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + "input": { + "properties": { + "content": { + "description": "the text to write", + "type": "string" + }, + "mode": { + "description": "the file's mode, such as 0644 (optional)", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "override": { + "description": "a reason, to change a path a module owns anyway (optional)", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "path": { + "description": "an absolute path", + "type": "string" + }, + "reason": { + "description": "why the file is changed, for the audit trail", + "type": "string" + } + }, + "required": [ + "path", + "content", + "reason" + ], + "type": "object" + }, + "name": "write", + "replaces": [ + "tee", + ">" + ] + }, + { + "description": "Copy a file or directory to a path on this node. A target on another node (:/path) is refused: copying between nodes comes in step 2 (issue 903). An existing target is overwritten, the old one kept in the node's trash for 7 days. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + "input": { + "properties": { + "from": { + "description": "an absolute path", + "type": "string" + }, + "override": { + "description": "a reason, to change a path a module owns anyway (optional)", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "reason": { + "description": "why the file is changed, for the audit trail", + "type": "string" + }, + "to": { + "description": "an absolute path on this node", + "type": "string" + } + }, + "required": [ + "from", + "to", + "reason" + ], + "type": "object" + }, + "name": "copy", + "replaces": [ + "cp", + "cp -a", + "ssh cp" + ] + }, + { + "description": "Move or rename a file or directory. A target on another node is refused: copying between nodes comes in step 2 (issue 903). An existing target is overwritten, the old one kept in the node's trash for 7 days. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + "input": { + "properties": { + "from": { + "description": "an absolute path", + "type": "string" + }, + "override": { + "description": "a reason, to change a path a module owns anyway (optional)", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "reason": { + "description": "why the file is changed, for the audit trail", + "type": "string" + }, + "to": { + "description": "an absolute path", + "type": "string" + } + }, + "required": [ + "from", + "to", + "reason" + ], + "type": "object" + }, + "name": "move", + "replaces": [ + "mv" + ] + }, + { + "description": "Delete a file or directory into the node's trash, where restore can bring it back. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + "input": { + "properties": { + "override": { + "description": "a reason, to change a path a module owns anyway (optional)", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "path": { + "description": "an absolute path", + "type": "string" + }, + "reason": { + "description": "why the file is changed, for the audit trail", + "type": "string" + }, + "recursive": { + "description": "\"true\": delete a directory with what it holds", + "enum": [ + "true", + "false" + ], + "type": "string" + } + }, + "required": [ + "path", + "reason" + ], + "type": "object" + }, + "name": "delete", + "replaces": [ + "rm", + "rm -r" + ] + }, + { + "description": "Make a directory. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + "input": { + "properties": { + "override": { + "description": "a reason, to change a path a module owns anyway (optional)", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "parents": { + "description": "\"true\": make the missing parents too", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "path": { + "description": "an absolute path", + "type": "string" + }, + "reason": { + "description": "why the file is changed, for the audit trail", + "type": "string" + } + }, + "required": [ + "path", + "reason" + ], + "type": "object" + }, + "name": "mkdir", + "replaces": [ + "mkdir", + "mkdir -p" + ] + }, + { + "description": "Change the mode of a file or directory. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + "input": { + "properties": { + "mode": { + "description": "the mode, such as 0644 or u+x", + "type": "string" + }, + "override": { + "description": "a reason, to change a path a module owns anyway (optional)", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "path": { + "description": "an absolute path", + "type": "string" + }, + "reason": { + "description": "why the file is changed, for the audit trail", + "type": "string" + }, + "recursive": { + "description": "\"true\": also everything under a directory", + "enum": [ + "true", + "false" + ], + "type": "string" + } + }, + "required": [ + "path", + "mode", + "reason" + ], + "type": "object" + }, + "name": "chmod", + "replaces": [ + "chmod" + ] + }, + { + "description": "Change the owner and group of a file or directory. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + "input": { + "properties": { + "group": { + "description": "a group's name or number (optional)", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "override": { + "description": "a reason, to change a path a module owns anyway (optional)", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "owner": { + "description": "an account's name or number", + "type": "string" + }, + "path": { + "description": "an absolute path", + "type": "string" + }, + "reason": { + "description": "why the file is changed, for the audit trail", + "type": "string" + }, + "recursive": { + "description": "\"true\": also everything under a directory", + "enum": [ + "true", + "false" + ], + "type": "string" + } + }, + "required": [ + "path", + "owner", + "reason" + ], + "type": "object" + }, + "name": "chown", + "replaces": [ + "chown", + "chgrp" + ] + }, + { + "description": "Send one file of this node into a bucket of the object store, over a short signed link and never over the bus; answers the key (the file's SHA-256 when none is given), the size and the SHA-256. At most 100 MiB. A place a secret is kept, a known credential file, or a link to one is refused by name, before anything is sent. Read as the node's operator account, through sudo -n where its rights do not reach; a place a secret is kept, or a known credential file, is refused by name.", + "input": { + "properties": { + "bucket": { + "description": "the bucket the file goes into", + "type": "string" + }, + "key": { + "description": "the object's key (optional; the file's SHA-256 when not given)", + "type": "string" + }, + "path": { + "description": "an absolute path to a file", + "type": "string" + } + }, + "required": [ + "path", + "bucket" + ], + "type": "object" + }, + "name": "upload" + }, + { + "description": "Write one object of a bucket to a file of this node, over a short signed link and never over the bus; the old file goes to the node's trash. At most 100 MiB. The bytes must hash to sha256, or to the key when the key is a SHA-256; otherwise no file is written. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + "input": { + "properties": { + "bucket": { + "description": "the bucket", + "type": "string" + }, + "key": { + "description": "the object's key", + "type": "string" + }, + "override": { + "description": "a reason, to change a path a module owns anyway (optional)", + "type": "string" + }, + "path": { + "description": "an absolute path", + "type": "string" + }, + "reason": { + "description": "why the file is changed, for the audit trail", + "type": "string" + }, + "sha256": { + "description": "the SHA-256 the bytes must have (optional; the key when that is a SHA-256)", + "type": "string" + } + }, + "required": [ + "bucket", + "key", + "path", + "reason" + ], + "type": "object" + }, + "name": "download" + }, + { + "description": "What the node's trash holds: each deleted or replaced item with its id, original path and when it went.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "trash", + "replaces": [ + "ls ~/.local/share/Trash" + ] + }, + { + "description": "Put an item of the node's trash back where it was; refuses when something is there now. Refuses a path a module owns unless override names a reason; done as the node's operator account, through sudo -n where its rights do not reach.", + "input": { + "properties": { + "id": { + "description": "an id from trash", + "type": "string" + }, + "override": { + "description": "a reason, to change a path a module owns anyway (optional)", + "enum": [ + "true", + "false" + ], + "type": "string" + }, + "reason": { + "description": "why the file is changed, for the audit trail", + "type": "string" + } + }, + "required": [ + "id", + "reason" + ], + "type": "object" + }, + "name": "restore", + "replaces": [ + "trash-restore" + ] + } + ] + }, + { + "decision": "novox/hq ADR 0563", + "emits": [ + "asked", + "done", + "refused" + ], + "grain": "seat-list", + "heldByTheEngine": true, + "name": "node-engine", + "scope": "node", + "serves": [ + { + "description": "Hand a directory this machine uses as found to the mesh (novox/hq ADR 0563 §3, §5): the engine judges the path as it does every hand-over (absolute, as it states it, used as found, reached through no link) and refuses in words, or asks the operator on their channel at the level approve, binding the owner, group and mode it will set. Nothing changes on the call: only the operator's yes hands it over. One ask is open per path; acts shows where it stands.", + "input": { + "properties": { + "path": { + "description": "the directory's absolute path, as the engine states it", + "type": "string" + }, + "why": { + "description": "why it is asked, in words the operator reads", + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "name": "hand-over" + }, + { + "description": "Ask the operator for the take act on a library whose root holds data outside its group (novox/hq ADR 0328 §7, ADR 0563 §3, §4), on the library's home engine: the access as declared and its root as last declared, judged and refused in words or asked at the level approve. Only the operator's yes sets the library's group, group write and setgid under its root. One ask is open per access.", + "input": { + "properties": { + "access": { + "description": "the access, library:", + "type": "string" + }, + "act": { + "description": "the act: take", + "type": "string" + }, + "why": { + "description": "why it is asked, in words the operator reads", + "type": "string" + } + }, + "required": [ + "act", + "access" + ], + "type": "object" + }, + "name": "access-act" + }, + { + "description": "Which of this machine's declared directories the engine would refuse to make or keep, one line each (novox/hq ADR 0563 §2). Read-only: changes no owner or mode.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "judge-directories" + }, + { + "description": "Throw away the engine's last search for setuid programs and start a full one (novox/hq ADR 0563 §2); until it completes root-free answers that the machine is not judged yet. Refused while one runs, and when one was started within the hour, naming when the next may start.", + "input": { + "properties": { + "why": { + "description": "why it is asked, in words", + "type": "string" + } + }, + "type": "object" + }, + "name": "setuid-search" + }, + { + "description": "Whether this machine is root-free (novox/hq ADR 0259 §8, ADR 0563 §6): free only on the engine's own verdict, at most fifteen minutes old, that the account agents run as cannot become root without a person, and the login shell's execute not served here. Anything else is no pass, and says why. Answered by this machine's engine alone.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "root-free" + }, + { + "description": "Every act this machine's engine was asked through this seat (novox/hq ADR 0563 §9): each hand-over, access act and setuid search, open, done or refused, with who asked, the ask and the operator's warrant. Read-only.", + "input": { + "properties": { + "id": { + "description": "one act, by its id", + "type": "string" + }, + "limit": { + "description": "at most this many, newest", + "type": "string" + } + }, + "type": "object" + }, + "name": "acts" + }, + { + "description": "The packages this machine's compositions declare, present or absent, each with the modules that declare it, as the engine keeps them in its key of `packages`; until the controller hands its lease away, beside the controller's mirror for this machine and their difference. With write, the key written again from what the engine composed.", + "input": { + "properties": { + "write": { + "description": "\"true\": write this machine's key again from what the engine composed", + "enum": [ + "true", + "false" + ], + "type": "string" + } + }, + "type": "object" + }, + "name": "packages", + "optional": true + }, + { + "description": "One module's composition on this machine beside what runs of it, read-only: the composition its want's build has in the bucket composed- (the latest revision, or the one whose digest is given, from the revisions the bucket keeps), the digest of each kept revision, what runs (applied, its have, or the kept declaration), its want and have (phase running, failed, held or waiting-yes, and the digest that waits for a yes), and the move's judgement with its words: why a record module waits for a yes. With diff, every resource added, removed or changed, a provider's received file naming the consumers that join or leave.", + "input": { + "properties": { + "diff": { + "description": "\"true\": list the resources that differ from what runs", + "type": "string" + }, + "digest": { + "description": "a composition's digest (sha256:…), to read that revision rather than the latest", + "type": "string" + }, + "module": { + "description": "the module, as placed on this machine; node for the node's own", + "type": "string" + } + }, + "required": [ + "module" + ], + "type": "object" + }, + "name": "composition", + "optional": true + }, + { + "description": "Compose this machine's modules now and say how it went, so a composition that failed, or a module held, recovers without a restart: what the pass refused or held, each with why, and when the engine composes again on its own after a seat that did not answer (a deadline, no responders: retried with a growing wait; a refusal never). With module, that module's apply is also tried again. Changes only what a pass the engine makes on its own would change.", + "input": { + "properties": { + "module": { + "description": "a module placed on this machine whose apply is also tried again (optional)", + "type": "string" + } + }, + "type": "object" + }, + "name": "compose", + "optional": true + }, + { + "description": "Compose a check's candidate on this machine in shadow, with its own sealed values and the indexer's manifest verdicts, and say per module placed here whether it composes (with its digest and whether the candidate changes it), is refused by the candidate or is held without it, each with why, and the verdict of the machine's own composition (novox/hq ADR 0593 §7). Read-only: applies nothing and writes nothing. Answered by this machine's engine alone, within the asker's bound.", + "input": { + "properties": { + "candidate": { + "description": "the key of the indexer's candidate, .", + "type": "string" + }, + "input": { + "description": "\"true\": also answer the composition input the candidate was composed from, for the sandbox path", + "enum": [ + "true", + "false" + ], + "type": "string" + } + }, + "required": [ + "candidate" + ], + "type": "object" + }, + "name": "compose-candidate", + "optional": true + } + ] + }, + { + "decision": "novox/hq ADR 0208", + "grain": "seat-list", + "name": "node-login-manager", + "scope": "node", + "serves": [ + { + "description": "The sessions the login manager offers on this machine, and which one the operator account starts by default.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "sessions" + } + ] + }, + { + "decision": "novox/hq ADR 0208", + "grain": "seat-list", + "name": "node-display-server", + "scope": "node", + "serves": [ + { + "description": "The monitors connected now, each with its identity, its modes and where it is placed; and the layout profile in force, if one matches.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "displays" + }, + { + "description": "The monitor layout profiles, keyed by the connected monitors' identities: list them, save the current arrangement under a name, or apply one.", + "input": { + "properties": { + "action": { + "description": "list, save or apply", + "enum": [ + "list", + "save", + "apply" + ], + "type": "string" + }, + "name": { + "description": "the profile to save or apply (save and apply only)", + "type": "string" + } + }, + "required": [ + "action" + ], + "type": "object" + }, + "name": "layout" + } + ] + }, + { + "decision": "novox/hq ADR 0208", + "grain": "seat-list", + "name": "node-display-session", + "scope": "node", + "serves": [ + { + "description": "Reload the session's configuration in place, keeping its windows.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "reload" + }, + { + "description": "The session's workspaces: each one's name, output, and whether it is visible or focused.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "workspaces" + }, + { + "description": "The session's windows: each one's title, class, workspace and whether it has focus; narrowed to one workspace when named.", + "input": { + "properties": { + "workspace": { + "description": "one workspace (optional)", + "type": "string" + } + }, + "type": "object" + }, + "name": "windows" + } + ] + }, + { + "decision": "novox/hq ADR 0208", + "grain": "seat-list", + "name": "node-terminal-emulator", + "scope": "node", + "serves": [ + { + "description": "Open a terminal window in the operator's session, running a command or the login shell, in a directory or the account's home.", + "input": { + "properties": { + "command": { + "description": "what to run in it (optional; the login shell when absent)", + "type": "string" + }, + "directory": { + "description": "where it starts (optional; the account's home when absent)", + "type": "string" + } + }, + "type": "object" + }, + "name": "open" + } + ] + }, + { + "decision": "novox/hq ADR 0208", + "grain": "seat-list", + "name": "node-launcher", + "scope": "node", + "serves": [ + { + "description": "Put a menu of choices in front of the operator and answer with the one chosen, or nothing when the menu was dismissed — the dmenu-compatible contract.", + "input": { + "properties": { + "choices": { + "description": "the lines to choose between, in order", + "items": { + "type": "string" + }, + "type": "array" + }, + "prompt": { + "description": "what the menu asks (optional)", + "type": "string" + } + }, + "required": [ + "choices" + ], + "type": "object" + }, + "name": "menu" + }, + { + "description": "Ask the operator for a value in a prompt that does not show what is typed, and answer it sealed to the key the asker gives — never in the clear — or cancelled when the prompt was dismissed or not answered in time.", + "input": { + "properties": { + "module": { + "description": "the module whose own secret is asked for", + "type": "string" + }, + "node": { + "description": "the machine the module runs on", + "type": "string" + }, + "seal_to": { + "description": "the asker's public sealing key: the answer is sealed to it", + "type": "string" + }, + "secret": { + "description": "the own secret's name", + "type": "string" + }, + "timeout_seconds": { + "description": "give up after this long (optional)", + "type": "string" + } + }, + "required": [ + "module", + "secret", + "node", + "seal_to" + ], + "type": "object" + }, + "name": "secret", + "optional": true + } + ] + }, + { + "decision": "novox/hq ADR 0208", + "grain": "seat-list", + "name": "node-notifier", + "scope": "node", + "serves": [ + { + "description": "Show the operator a notification.", + "input": { + "properties": { + "body": { + "description": "its text (optional)", + "type": "string" + }, + "title": { + "description": "the notification's summary", + "type": "string" + }, + "urgency": { + "description": "low, normal (the default) or critical", + "enum": [ + "low", + "normal", + "critical" + ], + "type": "string" + } + }, + "required": [ + "title" + ], + "type": "object" + }, + "name": "send" + }, + { + "description": "The notifications shown lately, newest first.", + "input": { + "properties": { + "limit": { + "description": "how many (optional, default 20)", + "type": "string" + } + }, + "type": "object" + }, + "name": "history" + } + ] + }, + { + "decision": "novox/hq ADR 0208", + "grain": "seat-list", + "name": "node-lock-screen", + "scope": "node", + "serves": [ + { + "description": "Lock the operator's session now.", + "input": { + "properties": {}, + "type": "object" + }, + "name": "lock" + } + ] + }, + { + "decision": "novox/hq ADR 0208", + "grain": "seat-list", + "name": "node-clipboard", + "scope": "node", + "serves": [ + { + "description": "What the clipboard held lately, newest first.", + "input": { + "properties": { + "limit": { + "description": "how many (optional, default 20)", + "type": "string" + } + }, + "type": "object" + }, + "name": "history" + }, + { + "description": "Put text on the operator's clipboard.", + "input": { + "properties": { + "text": { + "description": "the text", + "type": "string" + } + }, + "required": [ + "text" + ], + "type": "object" + }, + "name": "copy" + } + ] + }, + { + "decision": "novox/hq ADR 0208", + "grain": "seat-list", + "name": "node-bar", + "scope": "node" + }, + { + "decision": "novox/hq ADR 0208", + "grain": "seat-list", + "name": "node-compositor", + "scope": "node" + }, + { + "decision": "novox/hq ADR 0208", + "grain": "seat-list", + "name": "node-secret-service", + "scope": "node" + } +]; diff --git a/ts/tsconfig.json b/ts/tsconfig.json new file mode 100644 index 0000000..c610421 --- /dev/null +++ b/ts/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "declaration": true, + "outDir": "dist", + "rootDir": "src", + "strict": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + }, + "include": ["src/**/*.ts"] +}