Skip to content

Fix remixed cards keeping their module reference pointed at the catalog realm#652

Open
richardhjtan wants to merge 3 commits into
mainfrom
fix/listing-install-adopts-from-module
Open

Fix remixed cards keeping their module reference pointed at the catalog realm#652
richardhjtan wants to merge 3 commits into
mainfrom
fix/listing-install-adopts-from-module

Conversation

@richardhjtan

Copy link
Copy Markdown
Collaborator

Summary

  • buildInstanceOperation computed the correct target module reference (copyInstanceMeta.targetCodeRef) for a copied instance but never wrote it onto the copied card's meta.adoptsFrom, so remixing/installing a listing left the installed card's module pointing back at the catalog realm instead of the destination realm.
  • Unskips the listing install live test and adds an assertion that specifically catches this (installed card's module must resolve into the destination realm, not the catalog realm).
  • Fixes a stray relationships.categories.0 placement 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 until adoptsFrom actually started getting rewritten). Both are needed for a catalog remix/install to correctly resolve module references end to end.

Test plan

  • Full live test suite against a real catalog realm: 137 tests, 86 pass, 51 skip (unrelated pre-existing skips), 0 fail

…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>
Copilot AI review requested due to automatic review settings July 13, 2026 10:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.targetCodeRef onto 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');
}
richardhjtan and others added 2 commits July 13, 2026 19:35
… 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants