Fix remixed cards keeping their module reference pointed at the catalog realm#652
Open
richardhjtan wants to merge 3 commits into
Open
Fix remixed cards keeping their module reference pointed at the catalog realm#652richardhjtan wants to merge 3 commits into
richardhjtan wants to merge 3 commits into
Conversation
…og realm buildInstanceOperation computed the correct target module reference for a copied instance but never wrote it onto the copied card's adoptsFrom, so remixing a listing left the installed card's module pointing back at the catalog realm instead of the destination realm. Also unskips the listing install live test and adds an assertion that catches this specifically, and fixes a stray relationships.categories.0 placement bug in the skill listing test fixture uncovered along the way. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes module reference rewriting during catalog listing installs/remixes by ensuring copied instance cards persist the computed destination adoptsFrom code reference, and it strengthens live coverage to prevent regressions.
Changes:
- Write
copyInstanceMeta.targetCodeRefonto the copied card resource (meta.adoptsFrom) during instance install operations. - Unskip the catalog listing install live test and add assertions that the installed card’s module resolves within the destination realm (not the catalog realm).
- Fix an incorrect
relationships['categories.0']placement in the skill listing test fixture.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/live/catalog-app/listing-install.test.gts | Unskips the live install test and adds assertions verifying installed module resolution points to the destination realm. |
| tests/helpers/test-fixtures.ts | Fixes categories.0 relationship placement in the mock catalog fixture for skill listings. |
| commands/listing-install.ts | Ensures copied instance cards have meta.adoptsFrom rewritten to the destination targetCodeRef. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+139
to
+142
| let store = getService('store'); | ||
| let installedCard = (await store.get( | ||
| result.exampleCardId as string, | ||
| )) as CardDef; |
Comment on lines
+143
to
+146
| let installedRef = identifyCard(installedCard.constructor); | ||
| if (!installedRef || !isResolvedCodeRef(installedRef)) { | ||
| throw new Error('expected a resolved code ref'); | ||
| } |
… merge Points the boxel monorepo checkout at fix/catalog-remix-adopts-from-base-realm so this PR's own Live Tests job can prove the fix works end to end before boxel#5478 merges. Must be reverted to the default branch before this PR is merged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…t before merge" This reverts commit 251ab33.
4 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.
Summary
buildInstanceOperationcomputed the correct target module reference (copyInstanceMeta.targetCodeRef) for a copied instance but never wrote it onto the copied card'smeta.adoptsFrom, so remixing/installing a listing left the installed card's module pointing back at the catalog realm instead of the destination realm.relationships.categories.0placement bug in the skill listing test fixture, found while getting the suite green.Companion fix in boxel addresses a separate, pre-existing bug in
planInstanceInstall's base-realm detection that this change uncovered (it was invisible untiladoptsFromactually started getting rewritten). Both are needed for a catalog remix/install to correctly resolve module references end to end.Test plan