diff --git a/.changeset/spec-cloud-provided-package-version.md b/.changeset/spec-cloud-provided-package-version.md new file mode 100644 index 0000000000..1ee95fcc3f --- /dev/null +++ b/.changeset/spec-cloud-provided-package-version.md @@ -0,0 +1,28 @@ +--- +"@objectstack/spec": minor +--- + +`CLOUD_PROVIDED_OBJECT_NAMES` (`@objectstack/spec/system`) gains a member: +`sys_package_version`. `isPlatformProvidedObjectName('sys_package_version')` now +returns `true`, so a reference to that name resolves instead of being flagged as +a platform-prefixed name nothing registers (#16745). + +This widens an accept set. The name was previously refused, the list is a closed +set, and nothing in the published header enumerated this member — so the ladder +now accepts a value it used to warn on, and the widening reaches every surface +that consults the predicate: a dataset `object`, an action parameter +`reference`, a dashboard `optionsFrom.object` and a navigation `requiresObject` +naming `sys_package_version` all stop being diagnosed. + +Why this name and not another: the list already carried `sys_package` and +`sys_package_installation` — the head and tail of the three-table package family +that `cloud/package.zod.ts` declares — but not the release-snapshot table +between them, whose row schema this repository ships as +`cloud/package-version.zod.ts`. Platform metadata that ships with the product +references it: `sys_metadata.package_version_id` in `@objectstack/metadata-core` +is a `Field.lookup('sys_package_version', …)`. + +One entry is added; no other member moves and nothing is removed or narrowed. +The cloud-side half of the contract — that `@objectstack/service-tenant` +registers the table — is owned by the cloud repository per the list's header and +is not asserted from here. diff --git a/packages/spec/src/system/constants/platform-object-names.test.ts b/packages/spec/src/system/constants/platform-object-names.test.ts index c846699f44..b2a4cde719 100644 --- a/packages/spec/src/system/constants/platform-object-names.test.ts +++ b/packages/spec/src/system/constants/platform-object-names.test.ts @@ -167,4 +167,21 @@ describe('platform-object predicates', () => { expect(isPlatformProvidedObjectName('sys_license')).toBe(true); expect(CLOUD_PROVIDED_OBJECT_NAMES).toContain('sys_license'); }); + + it('resolves the middle table of the cloud package family', () => { + // `sys_package` and `sys_package_installation` were registered; the + // release-snapshot table between them was not, although this repo declares + // its row schema (`cloud/package-version.zod.ts`) and ships a platform + // object that looks it up (`sys_metadata.package_version_id` in + // `@objectstack/metadata-core`). While it was absent the object-reference + // ladder classed that shipped lookup target as a platform-prefixed name + // nothing registers. Pinned by name, beside `sys_license`, for the same + // reason. The other half of the contract — that the cloud runtime really + // registers the table — is owned by the cloud repository, per the list's + // header, and is not asserted here. + for (const name of ['sys_package', 'sys_package_version', 'sys_package_installation']) { + expect(isPlatformProvidedObjectName(name), name).toBe(true); + expect(CLOUD_PROVIDED_OBJECT_NAMES, name).toContain(name); + } + }); }); diff --git a/packages/spec/src/system/constants/platform-object-names.ts b/packages/spec/src/system/constants/platform-object-names.ts index 6aff77525b..f691ad7939 100644 --- a/packages/spec/src/system/constants/platform-object-names.ts +++ b/packages/spec/src/system/constants/platform-object-names.ts @@ -153,6 +153,7 @@ export const CLOUD_PROVIDED_OBJECT_NAMES: readonly string[] = [ 'sys_license', 'sys_package', 'sys_package_installation', + 'sys_package_version', ]; /**