Skip to content

fix(metadata): package-scope the Studio editor read via ?package= (ADR-0048) - #1819

Merged
xuyushun441-sys merged 1 commit into
mainfrom
feat/adr-0048-studio-editor-package-scope
Jun 13, 2026
Merged

fix(metadata): package-scope the Studio editor read via ?package= (ADR-0048)#1819
xuyushun441-sys merged 1 commit into
mainfrom
feat/adr-0048-studio-editor-package-scope

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

What

Closes the last gap in the ADR-0048 per-route package-scoped resolution audit: the Studio metadata editor (/apps/:appName/metadata/:type/:name).

The ?layers=true single-item read (the editor's 3-state code/overlay/effective view) ignored packageId, so editing one of two same-named items from different packages resolved ambiguously (first match). Note :appName there is the studio package, not the edited item's owner — so the scope must come from the item's owning package, carried as ?package=.

Changes

  • protocol.getMetaItemLayered threads packageId into the code layer (metadataService.get + lookupArtifactItem + registry.getItem) and the sys_metadata overlay query (package_id prefer-local).
  • registry.getArtifactItem(type, name, currentPackageId?) + lookupArtifactItem gained the optional package-scope hint (prefer-local).
  • rest-server threads ?package= into the layered branch.

Frontend counterpart

objectui PRMetadataClient.layered/getDraft accept { packageId }; the metadata list links emit ?package=<row._packageId>; ResourceEditPage reads it and scopes the layered/draft read.

Verification

  • Unit: getMetaItemLayered package-scoping (code + overlay). objectql 602 / rest 108 green.
  • Live: the Studio editor at /apps/com.objectstack.studio/metadata/doc/showcase_index loads each package's own item per ?package=:
    • ?package=com.example.showcase → Label "Showcase", content "# Showcase…"
    • ?package=com.objectstack.studio → Label "Studio Intro", content "# STUDIO VERSION"
    • layered REST endpoint (?layers=true&package=) disambiguates code/effective. No console errors.

🤖 Generated with Claude Code

…age= (ADR-0048)
The ?layers=true single-item read (Studio editor's 3-state view) ignored
packageId, so editing one of two same-named items from different packages
resolved ambiguously. Thread packageId through getMetaItemLayered (code layer +
overlay query), registry.getArtifactItem / lookupArtifactItem (prefer-local),
and the rest-server layered branch.
Verified live: the Studio editor at /apps/:app/metadata/doc/showcase_index loads
each package's own item per ?package= (com.example.showcase vs
com.objectstack.studio); layered REST endpoint disambiguates; objectql 602 /
rest 108 green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercelBot commented Jun 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
specReadyReadyPreview, CommentJun 13, 2026 5:23pm

Request Review

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

Labels

documentationImprovements or additions to documentationsize/mteststooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@xuyushun441-sys@os-zhuang