Skip to content

Commit f4415dc

Browse files
committed
fix(spec): register sys_package_version in CLOUD_PROVIDED_OBJECT_NAMES
The curated cloud list carried sys_package and sys_package_installation but not the release-snapshot table between them, so the shipped sys_metadata.package_version_id lookup target was classed as a platform-prefixed name nothing registers. Add the one entry, pin it by name beside sys_license, and add the patch changeset. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MkQhmuuJAVDjmeWNixwDDH
1 parent d61139f commit f4415dc

3 files changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
"@objectstack/spec": patch
3+
---
4+
5+
`sys_package_version` is now registered in `CLOUD_PROVIDED_OBJECT_NAMES`
6+
(`@objectstack/spec/system`), so `isPlatformProvidedObjectName('sys_package_version')`
7+
returns `true` and a reference to it resolves instead of being flagged as a
8+
platform-prefixed name nothing registers (#16745).
9+
10+
The list already carried `sys_package` and `sys_package_installation` — the head
11+
and tail of the three-table package family that `cloud/package.zod.ts` declares —
12+
but not the release-snapshot table between them, whose row schema this repository
13+
ships as `cloud/package-version.zod.ts`. Platform metadata that ships with the
14+
product references the name: `sys_metadata.package_version_id` in
15+
`@objectstack/metadata-core` is a `Field.lookup('sys_package_version', …)`. Against
16+
the list's own stated purpose ("Listed here so a cloud-targeted stack is not told
17+
its references are fictional") that shipped lookup target was being judged
18+
fictional, and the same misclassification reached any dataset `object`, action
19+
parameter `reference`, dashboard `optionsFrom.object` or navigation
20+
`requiresObject` naming it.
21+
22+
One entry is added; no other member moves. The cloud-side half of the contract —
23+
that `@objectstack/service-tenant` registers the table — is owned by the cloud
24+
repository per the list's header and is not asserted from here.

packages/spec/src/system/constants/platform-object-names.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,21 @@ describe('platform-object predicates', () => {
167167
expect(isPlatformProvidedObjectName('sys_license')).toBe(true);
168168
expect(CLOUD_PROVIDED_OBJECT_NAMES).toContain('sys_license');
169169
});
170+
171+
it('resolves the middle table of the cloud package family', () => {
172+
// `sys_package` and `sys_package_installation` were registered; the
173+
// release-snapshot table between them was not, although this repo declares
174+
// its row schema (`cloud/package-version.zod.ts`) and ships a platform
175+
// object that looks it up (`sys_metadata.package_version_id` in
176+
// `@objectstack/metadata-core`). While it was absent the object-reference
177+
// ladder classed that shipped lookup target as a platform-prefixed name
178+
// nothing registers. Pinned by name, beside `sys_license`, for the same
179+
// reason. The other half of the contract — that the cloud runtime really
180+
// registers the table — is owned by the cloud repository, per the list's
181+
// header, and is not asserted here.
182+
for (const name of ['sys_package', 'sys_package_version', 'sys_package_installation']) {
183+
expect(isPlatformProvidedObjectName(name), name).toBe(true);
184+
expect(CLOUD_PROVIDED_OBJECT_NAMES, name).toContain(name);
185+
}
186+
});
170187
});

packages/spec/src/system/constants/platform-object-names.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ export const CLOUD_PROVIDED_OBJECT_NAMES: readonly string[] = [
153153
'sys_license',
154154
'sys_package',
155155
'sys_package_installation',
156+
'sys_package_version',
156157
];
157158

158159
/**

0 commit comments

Comments
 (0)