You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(runtime): package-scoped single-item metadata resolution via ?package= (ADR-0048) (#1816)
* feat(runtime): package-scoped single-item metadata resolution via ?package= (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>
* fix(rest,objectql): make single-item ?package= actually disambiguate (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>
---------
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments