CT13b (dependency part): package-published's dependency names its part

Each item of dependencies is {kind, part, version, digest}: kind 1 a resolved package's artifact reference, kind 3 the
toolchain's part. Its field artifact is part.

Builds: design 47 G §673, §466, §374

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-11 20:33:26 +01:00
parent 02a4ef3497
commit 28da5e08c3
5 changed files with 15 additions and 15 deletions
+3 -3
View File
@@ -45,14 +45,14 @@ const StreamToolchainAgreed = "SEAT_mesh-builds_toolchain-agreed"
// SubjectToolchainAgreed is where toolchain-agreed is published.
const SubjectToolchainAgreed = "mesh.seat.mesh-builds.event.toolchain-agreed"
// Dependency is a dependency the build resolved, named by the build module in its step key and carried by the builder (design 47 G section 374).
// Dependency is a dependency the build resolved: one item of kind 1 for each resolved package and one of kind 3 for the toolchain, named by the build module in its step key and carried by the builder (design 47 G 374, 673).
type Dependency struct {
// the dependency's artifact reference, <module>:<artifact>
Artifact string `json:"artifact"`
// the digest of the part, as the build used it
Digest string `json:"digest"`
// 1 an imported package, 3 the build toolchain (design 47 G section 374)
Kind int64 `json:"kind"`
// the dependency's part: for kind 1 the package's artifact reference, <module>:<artifact>; for kind 3 the agreed toolchain's part (design 47 G 466, 673)
Part string `json:"part"`
// the version of the dependency the build resolved
Version string `json:"version"`
}
@@ -17,7 +17,7 @@ func TestFixtures(t *testing.T) {
decode func([]byte) (any, error)
subjectIs *regexp.Regexp
}{
{name: "a package published with the dependencies the build resolved", subject: "mesh.seat.mesh-builds.event.package-published", given: "{\"artifact\":\"mesh-sdk:go\",\"at\":\"2026-11-10T10:00:00Z\",\"branch\":\"main\",\"dependencies\":[{\"artifact\":\"mesh-contracts:go-nodeengine\",\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"kind\":1,\"version\":\"0.1.4\"},{\"artifact\":\"mesh-build-go:toolchain\",\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"kind\":3,\"version\":\"1.26.0\"}],\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"mesh-sdk\",\"source\":3589,\"v\":1,\"version\":\"0.1.15\"}", wire: "{\"artifact\":\"mesh-sdk:go\",\"at\":\"2026-11-10T10:00:00Z\",\"branch\":\"main\",\"dependencies\":[{\"artifact\":\"mesh-contracts:go-nodeengine\",\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"kind\":1,\"version\":\"0.1.4\"},{\"artifact\":\"mesh-build-go:toolchain\",\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"kind\":3,\"version\":\"1.26.0\"}],\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"mesh-sdk\",\"source\":3589,\"v\":1,\"version\":\"0.1.15\"}",
{name: "a package published with the dependencies the build resolved", subject: "mesh.seat.mesh-builds.event.package-published", given: "{\"artifact\":\"mesh-sdk:go\",\"at\":\"2026-11-10T10:00:00Z\",\"branch\":\"main\",\"dependencies\":[{\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"kind\":1,\"part\":\"mesh-contracts:go-nodeengine\",\"version\":\"0.1.4\"},{\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"kind\":3,\"part\":\"mesh-build-go:toolchain\",\"version\":\"1.26.0\"}],\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"mesh-sdk\",\"source\":3589,\"v\":1,\"version\":\"0.1.15\"}", wire: "{\"artifact\":\"mesh-sdk:go\",\"at\":\"2026-11-10T10:00:00Z\",\"branch\":\"main\",\"dependencies\":[{\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"kind\":1,\"part\":\"mesh-contracts:go-nodeengine\",\"version\":\"0.1.4\"},{\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"kind\":3,\"part\":\"mesh-build-go:toolchain\",\"version\":\"1.26.0\"}],\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"mesh-sdk\",\"source\":3589,\"v\":1,\"version\":\"0.1.15\"}",
decode: func(b []byte) (any, error) { var v PackagePublishedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-builds\\.event\\.package-published$")},
{name: "a toolchain agreed", subject: "mesh.seat.mesh-builds.event.toolchain-agreed", given: "{\"at\":\"2026-11-10T10:00:00Z\",\"digests\":[{\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"nodes\":[\"ace\",\"g14\"]},{\"digest\":\"sha256:fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210\",\"nodes\":[\"novox\"]}],\"language\":\"go\",\"v\":1,\"version\":\"1.26.0\"}", wire: "{\"at\":\"2026-11-10T10:00:00Z\",\"digests\":[{\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"nodes\":[\"ace\",\"g14\"]},{\"digest\":\"sha256:fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210\",\"nodes\":[\"novox\"]}],\"language\":\"go\",\"v\":1,\"version\":\"1.26.0\"}",
decode: func(b []byte) (any, error) { var v ToolchainAgreedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-builds\\.event\\.toolchain-agreed$")},
@@ -13,16 +13,16 @@
"source": 3589,
"dependencies": [
{
"artifact": "mesh-contracts:go-nodeengine",
"kind": 1,
"version": "0.1.4",
"digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"part": "mesh-contracts:go-nodeengine"
},
{
"artifact": "mesh-build-go:toolchain",
"kind": 3,
"version": "1.26.0",
"digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
"digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"part": "mesh-build-go:toolchain"
}
],
"at": "2026-11-10T10:00:00Z"
+4 -4
View File
@@ -108,9 +108,9 @@
"Dependency": {
"type": "object",
"properties": {
"artifact": {
"part": {
"type": "string",
"description": "the dependency's artifact reference, <module>:<artifact>"
"description": "the dependency's part: for kind 1 the package's artifact reference, <module>:<artifact>; for kind 3 the agreed toolchain's part (design 47 G 466, 673)"
},
"kind": {
"type": "integer",
@@ -130,12 +130,12 @@
}
},
"required": [
"artifact",
"part",
"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)"
"description": "a dependency the build resolved: one item of kind 1 for each resolved package and one of kind 3 for the toolchain, named by the build module in its step key and carried by the builder (design 47 G 374, 673)"
},
"PackagePublished": {
"type": "object",
+3 -3
View File
@@ -23,14 +23,14 @@ export declare const toolchainAgreedStream: "SEAT_mesh-builds_toolchain-agreed";
export declare const toolchainAgreedSubject: "mesh.seat.mesh-builds.event.toolchain-agreed";
/** a dependency the build resolved, named by the build module in its step key and carried by the builder (design 47 G section 374) */
/** a dependency the build resolved: one item of kind 1 for each resolved package and one of kind 3 for the toolchain, named by the build module in its step key and carried by the builder (design 47 G 374, 673) */
export interface Dependency {
/** the dependency's artifact reference, <module>:<artifact> */
"artifact": string;
/** the digest of the part, as the build used it */
"digest": string;
/** 1 an imported package, 3 the build toolchain (design 47 G section 374) */
"kind": number;
/** the dependency's part: for kind 1 the package's artifact reference, <module>:<artifact>; for kind 3 the agreed toolchain's part (design 47 G 466, 673) */
"part": string;
/** the version of the dependency the build resolved */
"version": string;
}