Skip to content

platform-object-names: CLOUD_PROVIDED_OBJECT_NAMES omits sys_package_version, so sys_metadata.package_version_id (shipped metadata-core lookup) is classed as a fictional platform object #16745

Description

@claude

Finding — contract drift inside packages/spec

packages/spec/src/system/constants/platform-object-names.ts declares the curated cloud list with this contract:

Objects contributed by the CLOUD runtime (@objectstack/service-tenant, defined in the separate cloud repository). … Listed here so a cloud-targeted stack is not told its references are fictional.

CLOUD_PROVIDED_OBJECT_NAMES carries sys_package and sys_package_installation — but not sys_package_version, the middle table of the same family that packages/spec/src/cloud/package.zod.ts declares:

  • sys_package — identity (one row per logical package)
  • sys_package_version — immutable release snapshots (see package-version.zod.ts)
  • sys_package_installation — env ↔ version pairing (see environment-package.zod.ts)

packages/spec/src/cloud/package-version.zod.ts is the row schema for it ("One row in sys_package_version — a sealed, versioned release of a package").

Where it bites

Shipped platform metadata references the object: packages/metadata-core/src/objects/sys-metadata.object.ts:76package_version_id: Field.lookup('sys_package_version', …) on sys_metadata.

The object-reference ladder (packages/lint/src/validate-object-references.ts, isPlatformProvidedObjectName) classes that name as rung 4 — platform-prefixed, registered by nothing — i.e. the object-reference-unregistered-platform advisory that exists for fictional names like sys_approval_process. Measured while enrolling field references in that ladder for #16611 (branch claude/issue-16611-lookup-reference-target-gate, commit c9164c0d, corpus: every *.object.ts under packages/ + examples/ at origin/main 5e53d73, 116 objects, 137 relationship fields): exactly one finding across the whole universe, and it is this one —

WARNING object-reference-unregistered-platform · objects[34].fields.package_version_id.reference :: lookup target "sys_package_version" carries a platform namespace prefix, but no platform package, official plugin, or cloud runtime object registers that name

Today the same misclassification would hit any dataset object, action param reference, dashboard filter optionsFrom.object or nav requiresObject naming sys_package_version.

Prescription

Add sys_package_version to CLOUD_PROVIDED_OBJECT_NAMES (one line), with the cloud repo's conformance half confirming that @objectstack/service-tenant registers it — the header says that half is owned there and cannot be tested from this repo. Same class as the closed finding on sys_license (#13842).

Filed unassigned from the #16611 measurement; not part of that card.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions