feat(runtime): package-scoped single-item metadata resolution via ?package= (ADR-0048)#1816
Merged
Merged
Conversation
…ckage= (ADR-0048) REST single-item GET /meta/:type/:name now passes its `?package=` query into `getItem(type, name, currentPackageId)` — the package-scoped (prefer-local) resolution added with the namespace gate. Single-item fetch was previously context-free (only list + protocol paths were package-aware). Enables package-scoped single-doc resolution (doc content lives only on the single-item endpoint), so `doc` names no longer need a namespace prefix for uniqueness — prefix demoted to a recommended convention (doc.zod comments updated), matching page/dashboard/report. Verified: curl `/api/v1/meta/doc/showcase_index?package=com.example.showcase` returns the doc with content; the package param reaches getItem's 3rd arg. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…(ADR-0048) The prior commit threaded ?package= into the runtime dispatcher, but the live serving path (RestAPI + ObjectQL protocol) still dropped it for cacheable types: - rest-server: the cacheable single-item GET called getMetaItemCached (ETag keyed on type+name only) and never passed packageId, so a ?package= read on a doc/page/etc. was served package-blind. Now a ?package= read bypasses that cache and takes getMetaItem(type, name, packageId). - protocol.getMetaItem: forward packageId to the sys_metadata overlay query (package_id filter, prefer-local), to metadataService.get, and to registry.getItem. - metadata-facade: get() gained optional currentPackageId, forwarded to registry.getItem. Verified live: two packages (com.example.showcase, com.objectstack.studio) each shipping doc/showcase_index now resolve to their own item via ?package=<id>, and the doc viewer route /apps/:packageId/docs/:name renders the correct per-package content in the browser. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 13, 2026
os-zhuang
added a commit
to objectstack-ai/objectui
that referenced
this pull request
Jun 14, 2026
…x optional) (#1701) DocPage now passes the route's package (`/apps/:appName/docs/:name`, where :appName is the package id) to `meta.getItem('doc', name, { packageId })`. The client SDK already sends `?package=`; the framework REST endpoint now honors it (objectstack-ai/objectstack#1816), resolving the single doc package-scoped (prefer-local) — so doc names no longer need a namespace prefix for uniqueness. Legacy top-level /docs/:name (no :appName) stays context-free. Browser-verified: /apps/com.example.showcase/docs/showcase_index issues GET …/meta/doc/showcase_index?package=com.example.showcase → 200 and renders. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Make a single-item metadata GET (
/meta/:type/:name?package=<id>) actually resolve package-scoped (prefer-local): when two installed packages ship an item of the sametype/name, the requester's own package wins.The bug this fixes
The first commit threaded
?package=into the runtime HTTP dispatcher, but the live serving path (RestAPI + ObjectQL protocol) still dropped it for cacheable types. Browser verification surfaced the real gap:rest-server— the cacheable single-item GET calledgetMetaItemCached(ETag keyed ontype+nameonly) and never passedpackageId. So a?package=read on adoc/page/etc. was served package-blind, and two same-named items shared one cache entry. A?package=read now bypasses that cache and takes the disambiguatinggetMetaItem(type, name, packageId)path.protocol.getMetaItem— forwardspackageIdto thesys_metadataoverlay query (package_idprefer-local filter), tometadataService.get, and toregistry.getItem.metadata-facade—get()gained an optionalcurrentPackageId, forwarded toregistry.getItem.doc.zodcomments (first commit).Why it matters
Lets the doc viewer (
/apps/:packageId/docs/:name) resolve one doc scoped to its app, sodocnames no longer need a namespace prefix for uniqueness (the prefix becomes a recommended convention, likepage/dashboard/report).Frontend counterpart: objectui#1708.
Verification
getMetaItem(registry + overlay paths); REST cache-bypass on?package=. objectql 600 / rest 108 / runtime 370 green.doc/showcase_index):curl .../doc/showcase_index?package=com.example.showcase→ Showcasecurl .../doc/showcase_index?package=com.objectstack.studio→ "STUDIO VERSION"/apps/<pkg>/docs/showcase_indexrenders each package's own doc, no console errors.🤖 Generated with Claude Code