From 7f0fbf15ae3d67db353a450f201b74350503dbc3 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 11 Nov 2026 10:35:25 +0100 Subject: [PATCH] CT2: the seat mesh-builds, held once for the mesh: package-published, toolchain-agreed, reserved MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Definition and fixtures; the generated contracts come with CT11. Builds: design 47 G §52, §307 (seat held once, event package-published), §334 (artifact reference, version, digest, branch, source revision), §374 (resolved dependencies with version and digest), §376 (toolchain-agreed: language, version, toolchain digest), §369 (verb reserved, callers the registry seats' holders), §331, §396 (keep: package-published 128 MiB, toolchain-agreed 16 MiB, 90 days), §391 (class read). Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ --- .../seats/mesh-builds/fixtures/events.json | 43 ++++ .../seats/mesh-builds/fixtures/verbs.json | 26 +++ contracts/seats/mesh-builds/seat.json | 221 ++++++++++++++++++ 3 files changed, 290 insertions(+) create mode 100644 contracts/seats/mesh-builds/fixtures/events.json create mode 100644 contracts/seats/mesh-builds/fixtures/verbs.json create mode 100644 contracts/seats/mesh-builds/seat.json diff --git a/contracts/seats/mesh-builds/fixtures/events.json b/contracts/seats/mesh-builds/fixtures/events.json new file mode 100644 index 00000000..25c23b77 --- /dev/null +++ b/contracts/seats/mesh-builds/fixtures/events.json @@ -0,0 +1,43 @@ +[ + { + "name": "a package published with the dependencies the build resolved", + "of": "event:package-published", + "subject": "mesh.seat.mesh-builds.event.package-published", + "given": { + "v": 1, + "artifact": "mesh-sdk:go", + "module": "mesh-sdk", + "version": "0.1.15", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", + "branch": "main", + "source": 3589, + "dependencies": [ + { + "artifact": "mesh-contracts:go-nodeengine", + "kind": 1, + "version": "0.1.4", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + }, + { + "artifact": "mesh-build-go:toolchain", + "kind": 3, + "version": "1.26.0", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + } + ], + "at": "2026-11-10T10:00:00Z" + } + }, + { + "name": "a toolchain agreed", + "of": "event:toolchain-agreed", + "subject": "mesh.seat.mesh-builds.event.toolchain-agreed", + "given": { + "v": 1, + "language": "go", + "version": "1.26.0", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", + "at": "2026-11-10T10:00:00Z" + } + } +] diff --git a/contracts/seats/mesh-builds/fixtures/verbs.json b/contracts/seats/mesh-builds/fixtures/verbs.json new file mode 100644 index 00000000..668a960c --- /dev/null +++ b/contracts/seats/mesh-builds/fixtures/verbs.json @@ -0,0 +1,26 @@ +[ + { + "name": "reserved asks a module", + "of": "verb:reserved.input", + "given": { + "module": "mesh-sdk" + } + }, + { + "name": "reserved answers the version and each artifact's digest", + "of": "verb:reserved.answer", + "given": { + "module": "mesh-sdk", + "version": "0.1.15", + "artifacts": [ + { + "artifact": "mesh-sdk:go", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + }, + { + "artifact": "mesh-sdk:ts" + } + ] + } + } +] diff --git a/contracts/seats/mesh-builds/seat.json b/contracts/seats/mesh-builds/seat.json new file mode 100644 index 00000000..489c52a9 --- /dev/null +++ b/contracts/seats/mesh-builds/seat.json @@ -0,0 +1,221 @@ +{ + "format": 1, + "seat": "mesh-builds", + "scope": "mesh", + "grain": "whole", + "domain": "Delivery", + "decision": "novox/hq ADR 0666", + "description": "The builder's seat: it says each artifact it published and each agreed toolchain, and answers a module's reserved version. Held once for the mesh (design 47 G section 52, section 307).", + "verbs": [ + { + "name": "reserved", + "class": "read", + "callers": [ + "seat:go-package-registry", + "seat:npm-package-registry", + "seat:container-image-registry", + "seat:oci-artifact-registry" + ], + "description": "A module's reserved version with each artifact's digest, for a registry holder deciding whether to publish (design 47 G section 369; design 51, Publishing).", + "input": { + "type": "object", + "properties": { + "module": { + "type": "string", + "description": "the module" + }, + "version": { + "type": "string", + "description": "the version, when asked for a particular one" + } + }, + "required": [ + "module" + ] + }, + "answer": { + "type": "object", + "properties": { + "module": { + "type": "string", + "description": "the module" + }, + "version": { + "type": "string", + "description": "the reserved version, MAJOR.MINOR.PATCH" + }, + "artifacts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "artifact": { + "type": "string", + "description": "the artifact reference, :" + }, + "digest": { + "type": "string", + "description": "its digest once built; empty before" + } + }, + "required": [ + "artifact" + ] + } + } + }, + "required": [ + "module", + "version", + "artifacts" + ] + } + } + ], + "events": [ + { + "name": "package-published", + "subject": "package-published", + "keep": { + "max-age-days": 90, + "max-mib": 128 + }, + "body": { + "$ref": "#/defs/PackagePublished" + } + }, + { + "name": "toolchain-agreed", + "subject": "toolchain-agreed", + "keep": { + "max-age-days": 90, + "max-mib": 16 + }, + "body": { + "$ref": "#/defs/ToolchainAgreed" + } + } + ], + "family": { + "name": "mesh-builds.events", + "max-age-days": 7 + }, + "defs": { + "Dependency": { + "type": "object", + "properties": { + "artifact": { + "type": "string", + "description": "the dependency's artifact reference, :" + }, + "kind": { + "type": "integer", + "enum": [ + 1, + 3 + ], + "description": "1 an imported package, 3 the build toolchain (design 47 G section 374)" + }, + "version": { + "type": "string", + "description": "the version of the dependency the build resolved" + }, + "digest": { + "type": "string", + "description": "the digest of the part, as the build used it" + } + }, + "required": [ + "artifact", + "kind", + "version", + "digest" + ], + "description": "a dependency the build resolved, named by the build module in its step key and carried by the builder (design 47 G section 374)" + }, + "PackagePublished": { + "type": "object", + "properties": { + "v": { + "type": "integer" + }, + "artifact": { + "type": "string", + "description": "the package's artifact reference, :, from the catalog entry" + }, + "module": { + "type": "string", + "description": "the module" + }, + "version": { + "type": "string", + "description": "the version the build reserved, MAJOR.MINOR.PATCH" + }, + "digest": { + "type": "string", + "description": "the published artifact's digest" + }, + "branch": { + "type": "string", + "description": "the watched branch the build was made from" + }, + "source": { + "type": "integer", + "description": "the source revision of that branch the build was made from" + }, + "dependencies": { + "type": "array", + "items": { + "$ref": "#/defs/Dependency" + }, + "description": "each dependency the build resolved, with its version and digest" + }, + "at": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "v", + "artifact", + "module", + "version", + "digest", + "branch", + "source" + ], + "description": "one artifact published at the module's reserved version (design 47 G section 52, section 334)" + }, + "ToolchainAgreed": { + "type": "object", + "properties": { + "v": { + "type": "integer" + }, + "language": { + "type": "string", + "description": "the language whose agreed toolchain changed" + }, + "version": { + "type": "string", + "description": "the agreed toolchain's version" + }, + "digest": { + "type": "string", + "description": "the toolchain part's digest" + }, + "at": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "v", + "language", + "version", + "digest" + ], + "description": "the agreed toolchain of a language changed (design 47 G section 376, ADR 0584 section 1)" + } + } +}