diff --git a/.changeset/sys-license-cloud-provided-registry.md b/.changeset/sys-license-cloud-provided-registry.md new file mode 100644 index 0000000000..f48b0df2ca --- /dev/null +++ b/.changeset/sys-license-cloud-provided-registry.md @@ -0,0 +1,20 @@ +--- +'@objectstack/spec': patch +--- + +`sys_license` is now registered in `CLOUD_PROVIDED_OBJECT_NAMES` +(`@objectstack/spec/system`), so `isPlatformProvidedObjectName('sys_license')` +returns `true` and a stack referencing it resolves instead of being flagged. + +The object is real and shipping: `@objectstack/service-tenant` declares it in +the cloud repository (`packages/service-tenant/src/objects/sys-license.object.ts`), +alongside `sys_package_installation` and the other four names already on the +list. This repository has cited it repo-wide as the canonical +`tenancy.enabled: false` example — the driver tenant-scope suites, the +platform-global note on `ObjectSchema`, ADR-0066's worked example — while the +registry omitted it, which is exactly the stale-entry failure the registry's +maintenance contract warns about: consumers now trust the list, so a missing +name turns a real cross-reference into a probable-typo warning +(`object-reference-unregistered-platform`) rather than a resolved one. + +No accept-set change and no behaviour change for any name already on the list. 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 aa69771d57..c846699f44 100644 --- a/packages/spec/src/system/constants/platform-object-names.test.ts +++ b/packages/spec/src/system/constants/platform-object-names.test.ts @@ -153,4 +153,18 @@ describe('platform-object predicates', () => { expect(hasPlatformObjectPrefix('crm_lead')).toBe(false); expect(isPlatformProvidedObjectName('user')).toBe(false); }); + + it('resolves a cloud-provided object this repo never declares', () => { + // `sys_license` is declared by `@objectstack/service-tenant` in the cloud + // repo (`packages/service-tenant/src/objects/sys-license.object.ts`), and + // this repo cites it repo-wide as the canonical `tenancy.enabled: false` + // example — the driver tenant-scope suites, `object.zod.ts`'s + // platform-global note, ADR-0066's worked example. While it was absent + // from the registry those references read as fictional, so a + // cloud-targeted stack naming a real object was warned about a typo. + // Pinned by name rather than left to the loop above, so dropping it fails + // one readable assertion instead of nothing. + expect(isPlatformProvidedObjectName('sys_license')).toBe(true); + expect(CLOUD_PROVIDED_OBJECT_NAMES).toContain('sys_license'); + }); }); diff --git a/packages/spec/src/system/constants/platform-object-names.ts b/packages/spec/src/system/constants/platform-object-names.ts index 2d9b29d2e2..6aff77525b 100644 --- a/packages/spec/src/system/constants/platform-object-names.ts +++ b/packages/spec/src/system/constants/platform-object-names.ts @@ -150,6 +150,7 @@ export const CLOUD_PROVIDED_OBJECT_NAMES: readonly string[] = [ 'sys_app', 'sys_environment', 'sys_environment_member', + 'sys_license', 'sys_package', 'sys_package_installation', ];