CT11: regenerate the Go and TypeScript contracts from CT1 to CT9; each TypeScript contract as index.js with index.d.ts

Generated by seatgen (mesh-catalog, GEN1 and GEN2 on its worktree) from the
definitions of CT1 to CT9; module.json names the artifacts of the new seats
mesh-builds, mesh-pipeline-runner and git. seatgen -check is clean; every seat
package's generated fixture test passes.

Builds: design 47 G §341 (a TypeScript contract is emitted as index.js with
index.d.ts), §196, §339 (the generator refuses an unknown callers entry),
§260, §331.

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-11 10:48:56 +01:00
parent 15c065d2bb
commit 72ac9b09cb
90 changed files with 12101 additions and 2027 deletions
+291 -13
View File
@@ -15,36 +15,69 @@ import (
const Seat = "node-build-node"
const (
VerbCurrent = "current"
VerbPause = "pause"
VerbResume = "resume"
VerbDrop = "drop"
VerbCurrent = "current"
VerbPause = "pause"
VerbResume = "resume"
VerbDrop = "drop"
VerbKeptArtifact = "kept-artifact"
VerbSteps = "steps"
)
const (
AcceptDelivery = "delivery"
AcceptCheck = "check"
AcceptStep = "step"
AcceptRecheck = "recheck"
)
const (
EventStepEnded = "step-ended"
)
// Verbs is every verb the seat serves, in its definition's order: a new copy each call.
func Verbs() []string {
return []string{VerbCurrent, VerbPause, VerbResume, VerbDrop}
return []string{VerbCurrent, VerbPause, VerbResume, VerbDrop, VerbKeptArtifact, VerbSteps}
}
// Events is every event published on the seat's subject: a new copy each call.
func Events() []string {
return []string{EventStepEnded}
}
// Family is where the seat's events are kept: the shared events stream, filtered to the seat's subjects.
const (
Family = "node-build-node.events"
FamilyMaxAgeDays = 7
)
// StreamStepEnded is the stream step-ended is kept in.
const StreamStepEnded = "SEAT_node-build-node_step-ended"
// SubjectStepEnded is where step-ended is published, on mesh.seat.node-build-node.event.step-ended.<node>.
func SubjectStepEnded(node string) string {
return "mesh.seat.node-build-node.event.step-ended." + node
}
// SubjectStepEndedAll hears every step-ended.
const SubjectStepEndedAll = "mesh.seat.node-build-node.event.step-ended.*"
// AcceptSubjectDelivery is where delivery is sent.
const AcceptSubjectDelivery = "mesh.seat.node-build-node.accept.delivery"
// AcceptSubjectCheck is where check is sent.
const AcceptSubjectCheck = "mesh.seat.node-build-node.accept.check"
// AcceptSubjectStep is where step is sent.
const AcceptSubjectStep = "mesh.seat.node-build-node.accept.step"
// AcceptSubjectRecheck is where recheck is sent.
const AcceptSubjectRecheck = "mesh.seat.node-build-node.accept.recheck"
const (
StateSteps = "steps"
StatePauses = "pauses"
StateToolchains = "toolchains"
StateSteps = "steps"
StatePauses = "pauses"
StateToolchains = "toolchains"
StateDetectedSteps = "detected-steps"
)
// StepsByNodeIDKey is the key of one value of the state steps under the form "<node>.<id>".
@@ -224,6 +257,42 @@ func DecodeToolchainsByNodeLanguageValue(raw []byte) (ToolchainsByNodeLanguageVa
return v, nil
}
// DetectedStepsByModuleArtifactKey is the key of one value of the state detected-steps under the form "<module>.<artifact>".
func DetectedStepsByModuleArtifactKey(module, artifact string) string { return module + "." + artifact }
// ParseDetectedStepsByModuleArtifactKey reads the parts of a key of the form "<module>.<artifact>", in the order of the form; the last result is false for a key of another form.
func ParseDetectedStepsByModuleArtifactKey(key string) (string, string, bool) {
rest := key
v0, after0, found0 := strings.Cut(rest, ".")
if !found0 || v0 == "" {
return "", "", false
}
rest = after0
if rest == "" {
return "", "", false
}
v2 := rest
rest = ""
if rest != "" {
return "", "", false
}
return v0, v2, true
}
// DecodeDetectedStepsByModuleArtifactValue reads one value of the state detected-steps under the form "<module>.<artifact>", refusing a field DetectedStepsByModuleArtifactValue does not know and any text after the value.
func DecodeDetectedStepsByModuleArtifactValue(raw []byte) (DetectedStepsByModuleArtifactValue, error) {
var v DetectedStepsByModuleArtifactValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// AskArtifact is one artifact of a build ask: built from the fetched tree, or copied from an upstream pin.
type AskArtifact struct {
Artifact string `json:"artifact"`
@@ -236,8 +305,10 @@ type AskArtifact struct {
type BuildAnswer struct {
Artifacts []BuiltArtifact `json:"artifacts"`
Imports []string `json:"imports,omitempty"`
OutOfStep []string `json:"out-of-step,omitempty"`
Toolchain *ToolchainUsed `json:"toolchain,omitempty"`
// the digest of the artifact this node kept for the artifact store's holder instead of storing it through the seat oci-artifact-registry (the verb kept-artifact serves it); the keeping node is the step's own; absent when every artifact was stored
Kept string `json:"kept,omitempty"`
OutOfStep []string `json:"out-of-step,omitempty"`
Toolchain *ToolchainUsed `json:"toolchain,omitempty"`
}
// BuiltArtifact is one artifact a build made: its digest and the reference it was published under.
@@ -281,6 +352,28 @@ type ComposeAnswer struct {
Verdict any `json:"verdict,omitempty"`
}
// DetectedStep is a type of the contract.
type DetectedStep struct {
// the packages the step runs, by the language's convention
Packages []string `json:"packages,omitempty"`
Step string `json:"step"`
}
// The values of DetectedStep's step.
const (
DetectedStepStepLint = "lint"
DetectedStepStepUnit = "unit"
DetectedStepStepIntegration = "integration"
)
// DetectedSteps is the steps detected for one artifact at its newest build-input fingerprint, replaced when a newer fingerprint is detected and by steps with again (design 47 G section 326).
type DetectedSteps struct {
At *time.Time `json:"at,omitempty"`
Fingerprint string `json:"fingerprint"`
Steps []DetectedStep `json:"steps"`
V int64 `json:"v"`
}
// Drop is an ask a caller no longer waits for.
type Drop struct {
// when (RFC 3339 time)
@@ -352,6 +445,18 @@ type FetchRefusal struct {
Reason string `json:"reason"`
}
// KeptResult is a package's passing result the runner keeps, by the digest of what its tests read (ADR 0666 section 8): the step runs no package whose digest and level it names.
type KeptResult struct {
// sha256:<hex> of what the package's tests read
Digest string `json:"digest"`
// unit or integration
Level string `json:"level"`
Package string `json:"package"`
// the pipeline whose step kept it
Pipeline string `json:"pipeline,omitempty"`
Toolchain *ToolchainUsed `json:"toolchain,omitempty"`
}
// LevelAnswerDigestNeedsItem is a type of the contract.
type LevelAnswerDigestNeedsItem struct {
Needs []string `json:"needs,omitempty"`
@@ -550,7 +655,7 @@ type StepAsk struct {
Check *StepAskCheck `json:"check,omitempty"`
Compose *StepAskCompose `json:"compose,omitempty"`
ID string `json:"id"`
// build, check or compose
// build, check, compose or step
Kind string `json:"kind"`
// go, typescript or image
Language string `json:"language"`
@@ -559,11 +664,72 @@ type StepAsk struct {
Packages map[string]string `json:"packages,omitempty"`
// a run: a program built from a change and run in the build seat's sandbox over the heads, its input asked of a verb of the asker's seat; the Go seat's check stream alone carries it, as a compose
Run *RunJob `json:"run,omitempty"`
// a pipeline step: lint, unit tests or integration tests of one artifact at one commit, sent by the runner as the accepted kind step (design 47 *The steps and who serves them*)
Step *StepRun `json:"step,omitempty"`
// the layout version
V int64 `json:"v,omitempty"`
}
// StepResult is what a step answered, by the kind of ask: a build's artifacts, toolchain, imports and out-of-step modules; a check's fetch and levels; a compose's built, key and verdict; a run's built, key, exit, output and said; a declined ask's declined, needs and lacks. The fields of the kinds do not meet, so one layout holds the five.
// StepEnded is a pipeline step's end, said by the build seat's holder on the node that ran it (ADR 0666 sections 7, 21): the runner takes it only from that holder's account, naming the ask, the commit and the fingerprint it was asked at.
type StepEnded struct {
Artifact string `json:"artifact"`
// for a rerun, the caller the runtime proved
By string `json:"by,omitempty"`
// the packages not run because the ask's kept results held them
Carried []KeptResult `json:"carried,omitempty"`
Commit string `json:"commit"`
Ended *time.Time `json:"ended,omitempty"`
Fingerprint string `json:"fingerprint"`
// the ask's id
ID string `json:"id"`
// the packages that passed at their digest, for the runner to keep
Kept []KeptResult `json:"kept,omitempty"`
Module string `json:"module"`
// the node that ran it, as in the subject
Node string `json:"node"`
// never passed for a step that ran nothing
Outcome string `json:"outcome"`
// the step's output when it fits the message
Output string `json:"output,omitempty"`
// the output's object in the sender's sent store, when over the per-message limit (ADR 0666 section 16)
OutputObject string `json:"output-object,omitempty"`
Pipeline string `json:"pipeline"`
Rerun bool `json:"rerun,omitempty"`
// why it failed or could not run, naming the part not heard
Said string `json:"said,omitempty"`
Started *time.Time `json:"started,omitempty"`
Step string `json:"step"`
Tests *TestCounts `json:"tests,omitempty"`
// the layout version
V int64 `json:"v,omitempty"`
}
// The values of StepEnded's outcome.
const (
StepEndedOutcomePassed = "passed"
StepEndedOutcomeFailed = "failed"
StepEndedOutcomeNothingToRun = "nothing to run"
StepEndedOutcomeCouldNotRun = "could not run"
)
// The values of StepEnded's step.
const (
StepEndedStepLint = "lint"
StepEndedStepUnit = "unit"
StepEndedStepIntegration = "integration"
)
// StepNames is the names the registrations hold, which the lint step refuses fixed in code logic (ADR 0666 section 5, seams ruling M7): carried in the ask, never read by the build module from another part.
type StepNames struct {
// every watched branch a registration names
Branches []string `json:"branches"`
// every module the registrations name
Modules []string `json:"modules"`
// every repository a registration's git origin names, as <owner>/<name>
Repositories []string `json:"repositories"`
}
// StepResult is what a step answered, by the kind of ask: a build's artifacts, toolchain, imports, out-of-step modules and the artifact it kept; a check's fetch and levels; a compose's built, key and verdict; a run's built, key, exit, output and said; a declined ask's declined, needs and lacks. The fields of the kinds do not meet, so one layout holds the five.
type StepResult struct {
Artifacts []BuiltArtifact `json:"artifacts,omitempty"`
Built bool `json:"built,omitempty"`
@@ -573,7 +739,9 @@ type StepResult struct {
Exit int64 `json:"exit,omitempty"`
Fetch *FetchAnswer `json:"fetch,omitempty"`
Imports []string `json:"imports,omitempty"`
Key string `json:"key,omitempty"`
// the digest of the artifact this node kept for the artifact store's holder instead of storing it through the seat oci-artifact-registry (the verb kept-artifact serves it); the keeping node is the step's own; absent when every artifact was stored
Kept string `json:"kept,omitempty"`
Key string `json:"key,omitempty"`
// what the holder's node lacks of it
Lacks []string `json:"lacks,omitempty"`
Levels []LevelAnswer `json:"levels,omitempty"`
@@ -589,6 +757,42 @@ type StepResult struct {
Verdict any `json:"verdict,omitempty"`
}
// StepRun is one pipeline step of one artifact at one commit (ADR 0666 sections 7, 8, 17): the step a build seat runs in its sandbox from the change's own heads, the names the lint step needs and the kept results it may skip.
type StepRun struct {
// the artifact reference, <module>:<artifact>
Artifact string `json:"artifact"`
// the watched branch, or the branch of a run on request
Branch string `json:"branch,omitempty"`
// for a rerun, the caller the runtime proved
By string `json:"by,omitempty"`
// the commit the step runs at
Commit string `json:"commit"`
// where the step reads the change's heads
Fetch Fetch `json:"fetch"`
// the artifact's build-input fingerprint at the commit
Fingerprint string `json:"fingerprint"`
// the kept results of the artifact's packages, by digest and level (design 47 *Carried, not run*)
Kept []KeptResult `json:"kept,omitempty"`
Module string `json:"module"`
Names StepNames `json:"names"`
// the runner's pipeline key, <branch>.<revision>.<module>, a branch escaped as a key's name is
Pipeline string `json:"pipeline"`
// the step is asked again by the runner's rerun
Rerun bool `json:"rerun,omitempty"`
// the source revision of the watched branch the pipeline runs for; absent for a run on request
Revision int64 `json:"revision,omitempty"`
// the pipeline step
Step string `json:"step"`
Toolchain *ToolchainUsed `json:"toolchain,omitempty"`
}
// The values of StepRun's step.
const (
StepRunStepLint = "lint"
StepRunStepUnit = "unit"
StepRunStepIntegration = "integration"
)
// TakenVersion is of a directory whose go.mod requires an asked mesh package, the version it is built against: the asked one, or go.mod's when it names a newer one, said.
type TakenVersion struct {
Asked string `json:"asked"`
@@ -600,6 +804,12 @@ type TakenVersion struct {
Sum string `json:"sum,omitempty"`
}
// TestCounts is how many tests a step ran and carried, per level (ADR 0666 section 8: the pipeline's end names any repository or catalog module over the test budget).
type TestCounts struct {
Integration int64 `json:"integration,omitempty"`
Unit int64 `json:"unit,omitempty"`
}
// Toolchain is the toolchain a node reports.
type Toolchain struct {
// when (RFC 3339 time)
@@ -653,15 +863,80 @@ type DropInput struct {
// DropAnswer is what drop answers.
type DropAnswer = map[string]any
// KeptArtifactInput is what kept-artifact takes.
type KeptArtifactInput struct {
// the artifact's sha256, 64 lowercase hex digits, as the builder's done key names it
Digest string `json:"digest"`
// its build's fingerprint
Fp string `json:"fp"`
// the module, the holder of oci-artifact-registry
Module string `json:"module"`
}
// KeptArtifactAnswer is what kept-artifact answers.
type KeptArtifactAnswer struct {
// the digest of the bytes kept
Digest string `json:"digest,omitempty"`
// why it could not answer
Error string `json:"error,omitempty"`
// the fingerprint asked
Fp string `json:"fp"`
// the module asked
Module string `json:"module"`
// the object's name in it: the digest
Object string `json:"object,omitempty"`
// why nothing is answered: the module claims no oci-artifact-registry, this node keeps no build of it at that fingerprint (never kept, or swept), or keeps it under another digest
Refused string `json:"refused,omitempty"`
// bytes
Size int64 `json:"size,omitempty"`
// the object store the bytes are in, the build module's kept builds, as its manifest's objects names it on the bus
Store string `json:"store,omitempty"`
// the refusal in words, naming the module
Words string `json:"words,omitempty"`
}
// The values of KeptArtifactAnswer's refused.
const (
KeptArtifactAnswerRefusedClaimsNoOciArtifactRegistry = "claims no oci-artifact-registry"
KeptArtifactAnswerRefusedNotKept = "not kept"
KeptArtifactAnswerRefusedDigestDiffers = "digest differs"
)
// StepsInput is what steps takes.
type StepsInput struct {
// find them anew, not from the kept answer
Again bool `json:"again,omitempty"`
// the artifact reference, <module>:<artifact>
Artifact string `json:"artifact"`
Fetch Fetch `json:"fetch"`
Fingerprint string `json:"fingerprint,omitempty"`
Module string `json:"module"`
}
// StepsAnswer is what steps answers.
type StepsAnswer struct {
Artifact string `json:"artifact"`
Fingerprint string `json:"fingerprint,omitempty"`
// answered from the kept answer
Kept bool `json:"kept,omitempty"`
Steps []DetectedStep `json:"steps"`
}
// DeliveryAccept is the body of delivery.
type DeliveryAccept = StepAsk
// CheckAccept is the body of check.
type CheckAccept = StepAsk
// StepAccept is the body of step.
type StepAccept = StepAsk
// RecheckAccept is the body of recheck.
type RecheckAccept = StepAsk
// StepEndedEvent is the body of the event step-ended.
type StepEndedEvent = StepEnded
// StepsByNodeIDValue is one value of the state steps under the key <node>.<id>.
type StepsByNodeIDValue = Step
@@ -676,3 +951,6 @@ type PausesByCapacityNodeValue = Capacity
// ToolchainsByNodeLanguageValue is one value of the state toolchains under the key <node>.<language>.
type ToolchainsByNodeLanguageValue = Toolchain
// DetectedStepsByModuleArtifactValue is one value of the state detected-steps under the key <module>.<artifact>.
type DetectedStepsByModuleArtifactValue = DetectedSteps
@@ -17,6 +17,10 @@ func TestFixtures(t *testing.T) {
decode func([]byte) (any, error)
subjectIs *regexp.Regexp
}{
{name: "a unit step ended passed on its node, with its counts and what it carried", subject: "mesh.seat.node-build-node.event.step-ended.ace", given: "{\"artifact\":\"nats:program\",\"carried\":[{\"digest\":\"sha256:bbbb\",\"level\":\"unit\",\"package\":\"./modules/nats/a\"}],\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"ended\":\"2026-11-10T10:02:00Z\",\"fingerprint\":\"fp-0123\",\"id\":\"m2kx9a1b3c4d5e\",\"kept\":[{\"digest\":\"sha256:cccc\",\"level\":\"unit\",\"package\":\"./modules/nats/b\"}],\"module\":\"nats\",\"node\":\"ace\",\"outcome\":\"passed\",\"pipeline\":\"main.12.nats\",\"started\":\"2026-11-10T10:00:00Z\",\"step\":\"unit\",\"tests\":{\"unit\":14},\"v\":1}", wire: "{\"artifact\":\"nats:program\",\"carried\":[{\"digest\":\"sha256:bbbb\",\"level\":\"unit\",\"package\":\"./modules/nats/a\"}],\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"ended\":\"2026-11-10T10:02:00Z\",\"fingerprint\":\"fp-0123\",\"id\":\"m2kx9a1b3c4d5e\",\"kept\":[{\"digest\":\"sha256:cccc\",\"level\":\"unit\",\"package\":\"./modules/nats/b\"}],\"module\":\"nats\",\"node\":\"ace\",\"outcome\":\"passed\",\"pipeline\":\"main.12.nats\",\"started\":\"2026-11-10T10:00:00Z\",\"step\":\"unit\",\"tests\":{\"unit\":14},\"v\":1}",
decode: func(b []byte) (any, error) { var v StepEndedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.node-build-node\\.event\\.step-ended\\.[^.*> ]+$")},
{name: "an integration step that could not run, naming the part not heard", subject: "mesh.seat.node-build-node.event.step-ended.g14", given: "{\"artifact\":\"nats:program\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"id\":\"m2kx9a1b3c4d5f\",\"module\":\"nats\",\"node\":\"g14\",\"outcome\":\"could not run\",\"output-object\":\"mesh-build-go_sent-objects/m2kx9a1b3c4d5f\",\"pipeline\":\"main.12.nats\",\"said\":\"the sandbox could not fetch novox/mesh-sdk\",\"step\":\"integration\",\"v\":1}", wire: "{\"artifact\":\"nats:program\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"id\":\"m2kx9a1b3c4d5f\",\"module\":\"nats\",\"node\":\"g14\",\"outcome\":\"could not run\",\"output-object\":\"mesh-build-go_sent-objects/m2kx9a1b3c4d5f\",\"pipeline\":\"main.12.nats\",\"said\":\"the sandbox could not fetch novox/mesh-sdk\",\"step\":\"integration\",\"v\":1}",
decode: func(b []byte) (any, error) { var v StepEndedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.node-build-node\\.event\\.step-ended\\.[^.*> ]+$")},
{name: "a running step", subject: "", given: "{\"id\":\"a1b2\",\"node\":\"ace\",\"started\":\"2026-11-05T10:00:00Z\",\"state\":\"running\",\"tool\":\"build\",\"v\":1}", wire: "{\"id\":\"a1b2\",\"node\":\"ace\",\"started\":\"2026-11-05T10:00:00Z\",\"state\":\"running\",\"tool\":\"build\",\"v\":1}",
decode: func(b []byte) (any, error) { var v StepsByNodeIDValue; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "a paused node", subject: "", given: "{\"at\":\"2026-11-05T10:00:00Z\",\"by\":\"operator@shanks\",\"paused\":true,\"v\":1}", wire: "{\"at\":\"2026-11-05T10:00:00Z\",\"by\":\"operator@shanks\",\"paused\":true,\"v\":1}",
@@ -47,8 +51,32 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v StepsByNodeIDValue; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "an ask dropped by the caller that no longer waits", subject: "", given: "{\"at\":\"2026-11-05T10:00:00Z\",\"by\":\"mesh-delivery-builder\",\"v\":1,\"why\":\"a newer fingerprint supersedes it\"}", wire: "{\"at\":\"2026-11-05T10:00:00Z\",\"by\":\"mesh-delivery-builder\",\"v\":1,\"why\":\"a newer fingerprint supersedes it\"}",
decode: func(b []byte) (any, error) { var v PausesByDroppedIDValue; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "a step ask of the runner with the names and kept results", subject: "mesh.seat.node-build-node.accept.step", given: "{\"asker\":\"mesh-delivery-pipeline\",\"at\":\"2026-11-10T10:00:00Z\",\"id\":\"m2kx9a1b3c4d5e\",\"kind\":\"step\",\"language\":\"typescript\",\"step\":{\"artifact\":\"nats:program\",\"branch\":\"main\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fetch\":{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"repository\":\"novox/mesh-catalog\"},\"fingerprint\":\"fp-0123\",\"kept\":[{\"digest\":\"sha256:bbbb\",\"level\":\"unit\",\"package\":\"./modules/nats/a\",\"pipeline\":\"main.11.nats\"}],\"module\":\"nats\",\"names\":{\"branches\":[\"main\"],\"modules\":[\"nats\",\"mesh-sdk\"],\"repositories\":[\"novox/mesh-catalog\",\"novox/mesh-sdk\"]},\"pipeline\":\"main.12.nats\",\"revision\":12,\"step\":\"unit\"},\"v\":1}", wire: "{\"asker\":\"mesh-delivery-pipeline\",\"at\":\"2026-11-10T10:00:00Z\",\"id\":\"m2kx9a1b3c4d5e\",\"kind\":\"step\",\"language\":\"typescript\",\"step\":{\"artifact\":\"nats:program\",\"branch\":\"main\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fetch\":{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"repository\":\"novox/mesh-catalog\"},\"fingerprint\":\"fp-0123\",\"kept\":[{\"digest\":\"sha256:bbbb\",\"level\":\"unit\",\"package\":\"./modules/nats/a\",\"pipeline\":\"main.11.nats\"}],\"module\":\"nats\",\"names\":{\"branches\":[\"main\"],\"modules\":[\"nats\",\"mesh-sdk\"],\"repositories\":[\"novox/mesh-catalog\",\"novox/mesh-sdk\"]},\"pipeline\":\"main.12.nats\",\"revision\":12,\"step\":\"unit\"},\"v\":1}",
decode: func(b []byte) (any, error) { var v StepAccept; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.node-build-node\\.accept\\.step$")},
{name: "an artifact's detected steps", subject: "", given: "{\"at\":\"2026-11-10T10:00:00Z\",\"fingerprint\":\"fp-0123\",\"steps\":[{\"step\":\"lint\"},{\"packages\":[\"./modules/nats/a\"],\"step\":\"unit\"}],\"v\":1}", wire: "{\"at\":\"2026-11-10T10:00:00Z\",\"fingerprint\":\"fp-0123\",\"steps\":[{\"step\":\"lint\"},{\"packages\":[\"./modules/nats/a\"],\"step\":\"unit\"}],\"v\":1}",
decode: func(b []byte) (any, error) {
var v DetectedStepsByModuleArtifactValue
err := json.Unmarshal(b, &v)
return v, err
}, subjectIs: nil},
{name: "drop names the ask and why", subject: "", given: "{\"by\":\"mesh-delivery-builder\",\"id\":\"a1b2\",\"why\":\"a newer fingerprint supersedes it\"}", wire: "{\"by\":\"mesh-delivery-builder\",\"id\":\"a1b2\",\"why\":\"a newer fingerprint supersedes it\"}",
decode: func(b []byte) (any, error) { var v DropInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "kept-artifact asks", subject: "", given: "{\"digest\":\"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\",\"fp\":\"src2:1480985e\",\"module\":\"artifact-store\"}", wire: "{\"digest\":\"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\",\"fp\":\"src2:1480985e\",\"module\":\"artifact-store\"}",
decode: func(b []byte) (any, error) { var v KeptArtifactInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "kept-artifact answers where the bytes are", subject: "", given: "{\"digest\":\"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\",\"fp\":\"src2:1480985e\",\"module\":\"artifact-store\",\"object\":\"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\",\"size\":18874368,\"store\":\"mesh-build-go-kept\"}", wire: "{\"digest\":\"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\",\"fp\":\"src2:1480985e\",\"module\":\"artifact-store\",\"object\":\"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\",\"size\":18874368,\"store\":\"mesh-build-go-kept\"}",
decode: func(b []byte) (any, error) { var v KeptArtifactAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "kept-artifact refuses a module that is claims no oci-artifact-registry", subject: "", given: "{\"fp\":\"src2:aaaaaaaa\",\"module\":\"mesh-delivery-gate\",\"refused\":\"claims no oci-artifact-registry\",\"words\":\"mesh-delivery-gate claims no oci-artifact-registry: its build is fetched from the store\"}", wire: "{\"fp\":\"src2:aaaaaaaa\",\"module\":\"mesh-delivery-gate\",\"refused\":\"claims no oci-artifact-registry\",\"words\":\"mesh-delivery-gate claims no oci-artifact-registry: its build is fetched from the store\"}",
decode: func(b []byte) (any, error) { var v KeptArtifactAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "kept-artifact refuses a build it no longer keeps", subject: "", given: "{\"fp\":\"src2:1480985e\",\"module\":\"artifact-store\",\"refused\":\"not kept\",\"words\":\"this node keeps no build of artifact-store at src2:1480985e\"}", wire: "{\"fp\":\"src2:1480985e\",\"module\":\"artifact-store\",\"refused\":\"not kept\",\"words\":\"this node keeps no build of artifact-store at src2:1480985e\"}",
decode: func(b []byte) (any, error) { var v KeptArtifactAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "kept-artifact refuses a build kept under another digest", subject: "", given: "{\"digest\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"fp\":\"src2:1480985e\",\"module\":\"artifact-store\",\"refused\":\"digest differs\",\"words\":\"artifact-store at src2:1480985e is kept as eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\"}", wire: "{\"digest\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"fp\":\"src2:1480985e\",\"module\":\"artifact-store\",\"refused\":\"digest differs\",\"words\":\"artifact-store at src2:1480985e is kept as eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\"}",
decode: func(b []byte) (any, error) { var v KeptArtifactAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "kept-artifact answers an error, never none", subject: "", given: "{\"error\":\"the kept builds could not be read\",\"fp\":\"src2:1480985e\",\"module\":\"artifact-store\"}", wire: "{\"error\":\"the kept builds could not be read\",\"fp\":\"src2:1480985e\",\"module\":\"artifact-store\"}",
decode: func(b []byte) (any, error) { var v KeptArtifactAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "steps asks an artifact's pipeline steps at a commit", subject: "", given: "{\"artifact\":\"nats:program\",\"fetch\":{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"repository\":\"novox/mesh-catalog\"},\"fingerprint\":\"fp-0123\",\"module\":\"nats\"}", wire: "{\"artifact\":\"nats:program\",\"fetch\":{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"repository\":\"novox/mesh-catalog\"},\"fingerprint\":\"fp-0123\",\"module\":\"nats\"}",
decode: func(b []byte) (any, error) { var v StepsInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "steps answers lint and unit tests", subject: "", given: "{\"artifact\":\"nats:program\",\"fingerprint\":\"fp-0123\",\"steps\":[{\"step\":\"lint\"},{\"packages\":[\"./modules/nats\"],\"step\":\"unit\"}]}", wire: "{\"artifact\":\"nats:program\",\"fingerprint\":\"fp-0123\",\"steps\":[{\"step\":\"lint\"},{\"packages\":[\"./modules/nats\"],\"step\":\"unit\"}]}",
decode: func(b []byte) (any, error) { var v StepsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
}
for _, c := range cases {
v, err := c.decode([]byte(c.given))