Fix remixed cards keeping their module reference pointed at the catalog realm#652
Fix remixed cards keeping their module reference pointed at the catalog realm#652richardhjtan wants to merge 4 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.
| let store = getService('store'); | ||
| let installedCard = (await store.get( | ||
| result.exampleCardId as string, | ||
| )) as CardDef; |
| 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.
Remix rides the same install pipeline and catalog-RRI resolution as listing-install, so it goes green with the same companion host fix; the suite also needs the catalog-listing skill's command refs to point at @cardstack/catalog/commands/* (fixed in boxel-skills #29df01a). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
[Claude Code 🤖] Closing alongside boxel#5478 — the team decided to fix the root cause (the RRI-native install planner, CS-12078) rather than ship the interim planner fix. This PR can't proceed without that companion: the unskipped install/remix suites are red against boxel main (the card-listing install test hangs without the planner change), and the When CS-12078 lands, the pieces here are worth salvaging from this branch: the |
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.@cardstack/catalog/commands/*— already landed in boxel-skills via 29df01a.)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.Merge order: boxel #5478 first, then re-run CI here — this repo's live-test job checks out boxel
main, so the suites stay red until the companion fix lands (a run pinned to the companion branch was green: see 251ab33).Test plan