diff --git a/contracts/go/seats/nodebuildgo/contract.go b/contracts/go/seats/nodebuildgo/contract.go index d1a9288c..34d570c1 100644 --- a/contracts/go/seats/nodebuildgo/contract.go +++ b/contracts/go/seats/nodebuildgo/contract.go @@ -251,6 +251,15 @@ type FetchBesideItem struct { Repository string `json:"repository"` } +// FetchPackage is the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's. +type FetchPackage struct { + Commit string `json:"commit,omitempty"` + Name string `json:"name,omitempty"` + Ref string `json:"ref,omitempty"` + Repository string `json:"repository,omitempty"` + Version string `json:"version,omitempty"` +} + // Fetch is what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, and the sibling repositories placed beside. type Fetch struct { // the trunk commit a merge preview merges onto @@ -261,6 +270,8 @@ type Fetch struct { Commit string `json:"commit"` // the module's directory in the repository ("." for its root), with paths Dir string `json:"dir,omitempty"` + // the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's + Package *FetchPackage `json:"package,omitempty"` // the version (a full commit) of each mesh package to build against, by its module path Packages map[string]string `json:"packages,omitempty"` // the paths the module names, relative to dir diff --git a/contracts/go/seats/nodebuildimage/contract.go b/contracts/go/seats/nodebuildimage/contract.go index 69fc44b7..d80d6348 100644 --- a/contracts/go/seats/nodebuildimage/contract.go +++ b/contracts/go/seats/nodebuildimage/contract.go @@ -251,6 +251,15 @@ type FetchBesideItem struct { Repository string `json:"repository"` } +// FetchPackage is the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's. +type FetchPackage struct { + Commit string `json:"commit,omitempty"` + Name string `json:"name,omitempty"` + Ref string `json:"ref,omitempty"` + Repository string `json:"repository,omitempty"` + Version string `json:"version,omitempty"` +} + // Fetch is what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, and the sibling repositories placed beside. type Fetch struct { // the trunk commit a merge preview merges onto @@ -261,6 +270,8 @@ type Fetch struct { Commit string `json:"commit"` // the module's directory in the repository ("." for its root), with paths Dir string `json:"dir,omitempty"` + // the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's + Package *FetchPackage `json:"package,omitempty"` // the version (a full commit) of each mesh package to build against, by its module path Packages map[string]string `json:"packages,omitempty"` // the paths the module names, relative to dir diff --git a/contracts/go/seats/nodebuildnode/contract.go b/contracts/go/seats/nodebuildnode/contract.go index 51a5a76e..c40fa83d 100644 --- a/contracts/go/seats/nodebuildnode/contract.go +++ b/contracts/go/seats/nodebuildnode/contract.go @@ -251,6 +251,15 @@ type FetchBesideItem struct { Repository string `json:"repository"` } +// FetchPackage is the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's. +type FetchPackage struct { + Commit string `json:"commit,omitempty"` + Name string `json:"name,omitempty"` + Ref string `json:"ref,omitempty"` + Repository string `json:"repository,omitempty"` + Version string `json:"version,omitempty"` +} + // Fetch is what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, and the sibling repositories placed beside. type Fetch struct { // the trunk commit a merge preview merges onto @@ -261,6 +270,8 @@ type Fetch struct { Commit string `json:"commit"` // the module's directory in the repository ("." for its root), with paths Dir string `json:"dir,omitempty"` + // the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's + Package *FetchPackage `json:"package,omitempty"` // the version (a full commit) of each mesh package to build against, by its module path Packages map[string]string `json:"packages,omitempty"` // the paths the module names, relative to dir diff --git a/contracts/go/seats/nodebuildnode/contract_test.go b/contracts/go/seats/nodebuildnode/contract_test.go index 70e0c3a9..fd58eeb3 100644 --- a/contracts/go/seats/nodebuildnode/contract_test.go +++ b/contracts/go/seats/nodebuildnode/contract_test.go @@ -39,6 +39,8 @@ func TestFixtures(t *testing.T) { }, subjectIs: nil}, {name: "a build ask", subject: "mesh.seat.node-build-node.accept.delivery", given: "{\"asker\":\"mesh-delivery-builder\",\"build\":{\"artifacts\":[{\"artifact\":\"go\"}],\"module\":\"nats\"},\"id\":\"a1b2\",\"kind\":\"build\",\"language\":\"go\"}", wire: "{\"asker\":\"mesh-delivery-builder\",\"build\":{\"artifacts\":[{\"artifact\":\"go\"}],\"module\":\"nats\"},\"id\":\"a1b2\",\"kind\":\"build\",\"language\":\"go\"}", decode: func(b []byte) (any, error) { var v DeliveryAccept; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.node-build-node\\.accept\\.delivery$")}, + {name: "a check ask with the group's tagged package", subject: "mesh.seat.node-build-node.accept.check", given: "{\"asker\":\"mesh-delivery-checker\",\"at\":\"2026-11-05T10:00:00Z\",\"check\":{\"fetch\":{\"base\":\"89abcdef0123456789abcdef0123456789abcdef\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"package\":{\"name\":\"@novox/mesh-sdk\",\"version\":\"0.1.15-feat-x.1\"},\"ref\":\"refs/pull/7/head\",\"repository\":\"novox/mesh-delivery\"},\"kept\":true,\"levels\":[\"unit\",\"integration\"],\"node-names\":[\"ace\",\"g14\"],\"toolchain\":{\"language\":\"typescript\",\"recipe\":\"1\",\"version\":\"26.12.0\"}},\"id\":\"c3d5\",\"kind\":\"check\",\"language\":\"typescript\",\"v\":1}", wire: "{\"asker\":\"mesh-delivery-checker\",\"at\":\"2026-11-05T10:00:00Z\",\"check\":{\"fetch\":{\"base\":\"89abcdef0123456789abcdef0123456789abcdef\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"package\":{\"name\":\"@novox/mesh-sdk\",\"version\":\"0.1.15-feat-x.1\"},\"ref\":\"refs/pull/7/head\",\"repository\":\"novox/mesh-delivery\"},\"kept\":true,\"levels\":[\"unit\",\"integration\"],\"node-names\":[\"ace\",\"g14\"],\"toolchain\":{\"language\":\"typescript\",\"recipe\":\"1\",\"version\":\"26.12.0\"}},\"id\":\"c3d5\",\"kind\":\"check\",\"language\":\"typescript\",\"v\":1}", + decode: func(b []byte) (any, error) { var v CheckAccept; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.node-build-node\\.accept\\.check$")}, {name: "a finished check step of a TypeScript merge preview", subject: "", given: "{\"ended\":\"2026-11-05T10:01:00Z\",\"id\":\"c3d6\",\"node\":\"ace\",\"result\":{\"fetch\":{\"base\":\"abcdef0123456789abcdef0123456789abcdef01\",\"changed\":[\"modules/m/package.json\"],\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"merge\":\"0123456789abcdef0123456789abcdef01234567\",\"modules\":[\"modules/m\"],\"trees\":{\"modules/m\":{\"manifest\":\"0581b699d9d05517e69b21f5cedbeb2eee8aba2b205280b561be731594d7feef\",\"tree\":\"0123456789abcdef0123456789abcdef01234567\"}},\"workspace\":\"mvii1sxt979f67\"}},\"started\":\"2026-11-05T10:00:00Z\",\"state\":\"passed\",\"tool\":\"check\",\"v\":1}", wire: "{\"ended\":\"2026-11-05T10:01:00Z\",\"id\":\"c3d6\",\"node\":\"ace\",\"result\":{\"fetch\":{\"base\":\"abcdef0123456789abcdef0123456789abcdef01\",\"changed\":[\"modules/m/package.json\"],\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"merge\":\"0123456789abcdef0123456789abcdef01234567\",\"modules\":[\"modules/m\"],\"trees\":{\"modules/m\":{\"manifest\":\"0581b699d9d05517e69b21f5cedbeb2eee8aba2b205280b561be731594d7feef\",\"tree\":\"0123456789abcdef0123456789abcdef01234567\"}},\"workspace\":\"mvii1sxt979f67\"}},\"started\":\"2026-11-05T10:00:00Z\",\"state\":\"passed\",\"tool\":\"check\",\"v\":1}", decode: func(b []byte) (any, error) { var v StepsByNodeIDValue; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } diff --git a/contracts/parts/build-step.json b/contracts/parts/build-step.json index c272a8c2..82602f89 100644 --- a/contracts/parts/build-step.json +++ b/contracts/parts/build-step.json @@ -467,6 +467,17 @@ }, "description": "the version (a full commit) of each mesh package to build against, by its module path" }, + "package": { + "type": "object", + "description": "the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's", + "properties": { + "name": { "type": "string" }, + "version": { "type": "string" }, + "repository": { "type": "string" }, + "commit": { "type": "string" }, + "ref": { "type": "string" } + } + }, "beside": { "type": "array", "items": { diff --git a/contracts/seats/node-build-node/fixtures/states.json b/contracts/seats/node-build-node/fixtures/states.json index a9f265f5..125819d0 100644 --- a/contracts/seats/node-build-node/fixtures/states.json +++ b/contracts/seats/node-build-node/fixtures/states.json @@ -60,6 +60,45 @@ } } }, + { + "name": "a check ask with the group's tagged package", + "of": "accept:check", + "subject": "mesh.seat.node-build-node.accept.check", + "given": { + "v": 1, + "id": "c3d5", + "kind": "check", + "language": "typescript", + "asker": "mesh-delivery-checker", + "at": "2026-11-05T10:00:00Z", + "check": { + "fetch": { + "repository": "novox/mesh-delivery", + "commit": "0123456789abcdef0123456789abcdef01234567", + "ref": "refs/pull/7/head", + "base": "89abcdef0123456789abcdef0123456789abcdef", + "package": { + "name": "@novox/mesh-sdk", + "version": "0.1.15-feat-x.1" + } + }, + "levels": [ + "unit", + "integration" + ], + "kept": true, + "toolchain": { + "language": "typescript", + "version": "26.12.0", + "recipe": "1" + }, + "node-names": [ + "ace", + "g14" + ] + } + } + }, { "name": "a finished check step of a TypeScript merge preview", "of": "state:steps/.", diff --git a/contracts/ts/seats/nodebuildgo/src/index.ts b/contracts/ts/seats/nodebuildgo/src/index.ts index 83d2a60a..85ee7149 100644 --- a/contracts/ts/seats/nodebuildgo/src/index.ts +++ b/contracts/ts/seats/nodebuildgo/src/index.ts @@ -113,6 +113,7 @@ export type CurrentInput = buildStep.CurrentInput; export type Fetch = buildStep.Fetch; export type FetchAnswer = buildStep.FetchAnswer; export type FetchBesideItem = buildStep.FetchBesideItem; +export type FetchPackage = buildStep.FetchPackage; export type FetchRefusal = buildStep.FetchRefusal; export type LevelAnswer = buildStep.LevelAnswer; export type LevelAnswerDigest = buildStep.LevelAnswerDigest; diff --git a/contracts/ts/seats/nodebuildgo/src/parts/build-step.ts b/contracts/ts/seats/nodebuildgo/src/parts/build-step.ts index c61ca3bc..1b4aabcc 100644 --- a/contracts/ts/seats/nodebuildgo/src/parts/build-step.ts +++ b/contracts/ts/seats/nodebuildgo/src/parts/build-step.ts @@ -67,6 +67,15 @@ export interface FetchBesideItem { "repository": string; } +/** the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's */ +export interface FetchPackage { + "commit"?: string; + "name"?: string; + "ref"?: string; + "repository"?: string; + "version"?: string; +} + /** what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, and the sibling repositories placed beside */ export interface Fetch { /** the trunk commit a merge preview merges onto */ @@ -77,6 +86,8 @@ export interface Fetch { "commit": string; /** the module's directory in the repository ("." for its root), with paths */ "dir"?: string; + /** the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's */ + "package"?: FetchPackage; /** the version (a full commit) of each mesh package to build against, by its module path */ "packages"?: Record; /** the paths the module names, relative to dir */ diff --git a/contracts/ts/seats/nodebuildimage/src/index.ts b/contracts/ts/seats/nodebuildimage/src/index.ts index d0745fcc..ffa81df0 100644 --- a/contracts/ts/seats/nodebuildimage/src/index.ts +++ b/contracts/ts/seats/nodebuildimage/src/index.ts @@ -113,6 +113,7 @@ export type CurrentInput = buildStep.CurrentInput; export type Fetch = buildStep.Fetch; export type FetchAnswer = buildStep.FetchAnswer; export type FetchBesideItem = buildStep.FetchBesideItem; +export type FetchPackage = buildStep.FetchPackage; export type FetchRefusal = buildStep.FetchRefusal; export type LevelAnswer = buildStep.LevelAnswer; export type LevelAnswerDigest = buildStep.LevelAnswerDigest; diff --git a/contracts/ts/seats/nodebuildimage/src/parts/build-step.ts b/contracts/ts/seats/nodebuildimage/src/parts/build-step.ts index c61ca3bc..1b4aabcc 100644 --- a/contracts/ts/seats/nodebuildimage/src/parts/build-step.ts +++ b/contracts/ts/seats/nodebuildimage/src/parts/build-step.ts @@ -67,6 +67,15 @@ export interface FetchBesideItem { "repository": string; } +/** the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's */ +export interface FetchPackage { + "commit"?: string; + "name"?: string; + "ref"?: string; + "repository"?: string; + "version"?: string; +} + /** what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, and the sibling repositories placed beside */ export interface Fetch { /** the trunk commit a merge preview merges onto */ @@ -77,6 +86,8 @@ export interface Fetch { "commit": string; /** the module's directory in the repository ("." for its root), with paths */ "dir"?: string; + /** the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's */ + "package"?: FetchPackage; /** the version (a full commit) of each mesh package to build against, by its module path */ "packages"?: Record; /** the paths the module names, relative to dir */ diff --git a/contracts/ts/seats/nodebuildnode/src/index.ts b/contracts/ts/seats/nodebuildnode/src/index.ts index 0c66706f..c2142833 100644 --- a/contracts/ts/seats/nodebuildnode/src/index.ts +++ b/contracts/ts/seats/nodebuildnode/src/index.ts @@ -113,6 +113,7 @@ export type CurrentInput = buildStep.CurrentInput; export type Fetch = buildStep.Fetch; export type FetchAnswer = buildStep.FetchAnswer; export type FetchBesideItem = buildStep.FetchBesideItem; +export type FetchPackage = buildStep.FetchPackage; export type FetchRefusal = buildStep.FetchRefusal; export type LevelAnswer = buildStep.LevelAnswer; export type LevelAnswerDigest = buildStep.LevelAnswerDigest; diff --git a/contracts/ts/seats/nodebuildnode/src/parts/build-step.ts b/contracts/ts/seats/nodebuildnode/src/parts/build-step.ts index c61ca3bc..1b4aabcc 100644 --- a/contracts/ts/seats/nodebuildnode/src/parts/build-step.ts +++ b/contracts/ts/seats/nodebuildnode/src/parts/build-step.ts @@ -67,6 +67,15 @@ export interface FetchBesideItem { "repository": string; } +/** the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's */ +export interface FetchPackage { + "commit"?: string; + "name"?: string; + "ref"?: string; + "repository"?: string; + "version"?: string; +} + /** what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, and the sibling repositories placed beside */ export interface Fetch { /** the trunk commit a merge preview merges onto */ @@ -77,6 +86,8 @@ export interface Fetch { "commit": string; /** the module's directory in the repository ("." for its root), with paths */ "dir"?: string; + /** the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's */ + "package"?: FetchPackage; /** the version (a full commit) of each mesh package to build against, by its module path */ "packages"?: Record; /** the paths the module names, relative to dir */ diff --git a/sdk/buildstep/ask.go b/sdk/buildstep/ask.go index 7e46704e..9418a2be 100644 --- a/sdk/buildstep/ask.go +++ b/sdk/buildstep/ask.go @@ -213,7 +213,20 @@ type Fetch struct { Dir string `json:"dir,omitempty"` Paths []string `json:"paths,omitempty"` Packages PackageVersions `json:"packages,omitempty"` - Beside []FetchBeside `json:"beside,omitempty"` + // Package is the TypeScript module's group package: the group's tagged version ({name, version}) or the group's package + // member ({repository, commit, ref}). + Package *FetchPackage `json:"package,omitempty"` + Beside []FetchBeside `json:"beside,omitempty"` +} + +// FetchPackage is the group package a TypeScript fetch takes (ADR 0607 §3, ADR 0500 §5): either the group's tagged version +// (Name and Version) or the group's package member (Repository, Commit and Ref). +type FetchPackage struct { + Name string `json:"name,omitempty"` + Version string `json:"version,omitempty"` + Repository string `json:"repository,omitempty"` + Commit string `json:"commit,omitempty"` + Ref string `json:"ref,omitempty"` } // FetchBeside is a sibling repository placed beside the fetched tree.