fix(metadata): keep each colliding item's own _packageId provenance (ADR-0048)#1822
Merged
xuyushun441-sys merged 1 commit intoJun 13, 2026
Merged
Conversation
…ADR-0048) When two packages ship a same-name item, getMetaItem/getMetaItems grafted the artifact protection envelope from a first-match lookup, so the second package's item inherited the FIRST package's _packageId. The frontend prefer-local (dashboard/report/page) filters the unscoped list by _packageId, so this mislabel resolved collisions to the wrong package. Scope the artifact lookup to the requested package (getMetaItem) and to each item's own _packageId (getMetaItems list decorate). getItem ordering unchanged — a bare-key overlay still takes ADR-0005 precedence. Verified live (page collision showcase vs studio): single ?package=, the unscoped list (both items, correct _packageId each), and the frontend page route (/apps/<pkg>/page/showcase_task_workbench renders each package's own page). 603 objectql tests green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jun 13, 2026
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.
The bug
While verifying the ADR-0048 frontend audit, I found that dashboard/report/page prefer-local was actually broken for collisions — the ✅ in my audit was wrong.
When two installed packages ship an item of the same
type/name,getMetaItem/getMetaItemsgrafted the artifact protection envelope from a first-match artifact lookup (lookupArtifactItem(type, name)with no package). So the second package's item inherited the first package's_packageId. Since the frontend prefer-local (preferLocal(list, name, app._packageId)) filters the unscoped list by_packageId, the mislabel made it resolve a collision to the wrong package — or miss the local item entirely.(This is the list
_packageIdre-stamp anomaly I'd spotted during the docs verification but hadn't run down.)Fix
getMetaItemscopes the artifact lookup torequest.packageId.getMetaItemsscopes the per-item decorate to the requested package (scoped list) else to each item's own_packageId.getItemordering unchanged — a bare-key runtime/DB overlay still takes ADR-0005 precedence (clarifying comment only). An env-wide package-less overlay of a colliding name stays inherently ambiguous by schema (sys_metadataunique ontype+name+org, not package); pure-artifact collisions (the marketplace default) now resolve correctly.Verification
Live, real
pagecollision (showcaseshowcase_task_workbench+ a Studio-package page of the same name):?package=com.objectstack.studio→ Studio's page,_packageId: com.objectstack.studio;?package=com.example.showcase→ showcase's./meta/pagelist → both rows, each with its own correct_packageId./apps/com.objectstack.studio/page/showcase_task_workbenchrenders Studio's (empty) page;/apps/com.example.showcase/page/showcase_task_workbenchrenders the full Task Workbench. No console errors.603 objectql tests green (added a list-collision provenance test; ADR-0005 overlay-precedence tests still pass).
🤖 Generated with Claude Code