Skip to content

Rewrite adoptsFrom on installed instances and un-park the install/remix live suites - #674

Merged
richardhjtan merged 3 commits into
mainfrom
cs-12078-listing-install-rewrites-adopts-from
Jul 30, 2026
Merged

Rewrite adoptsFrom on installed instances and un-park the install/remix live suites#674
richardhjtan merged 3 commits into
mainfrom
cs-12078-listing-install-rewrites-adopts-from

Conversation

@richardhjtan

@richardhjtan richardhjtan commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Companion to cardstack/boxel#5631. Together they close CS-12078 (and the CS-11748 / CS-11780 symptoms).

Why

buildInstanceOperation computed the install planner's targetCodeRef and then discarded it — it never assigned cardResource.meta.adoptsFrom. So a copied instance kept whatever adoptsFrom the source card had:

  • a relative ref survived by accident, because the relative path stays valid under a folder-preserving copy;
  • an absolute catalog-realm ref stayed pointed at the catalog realm.

That is the visible half of the bug. This PR assigns the planner's decision.

Why it needs the boxel companion

Because adoptsFrom was never rewritten, the planner's base-realm misclassification was latent — wrong data that nothing read. The moment this PR starts honoring targetCodeRef, that misclassification becomes a visibly broken module reference: a Skill adopting @cardstack/base/skill would get rewritten to a local base/skill.gts that is never written.

boxel#5631 makes the planner RRI-native so base-realm refs are classified correctly in all three spellings. The two PRs are only meaningful together, which is why the earlier attempt at this pair (#652 / boxel#5478) was closed in favour of fixing the root cause.

What changed

  • commands/listing-install.ts — assign copyInstanceMeta.targetCodeRef onto the copied resource's meta.adoptsFrom.
  • tests/live/catalog-app/listing-install.test.gts — un-park (5 tests). The card-listing test now also asserts the installed card's module resolves into the destination realm and not into the catalog realm. Author/example.json's own adoptsFrom is an absolute catalog-realm URL in the fixtures, so this is the assertion that actually pins the bug.
  • tests/live/catalog-app/listing-remix.test.gts — un-park (4 tests). These cover the rendering consequence: a broken adoptsFrom kills the playground preview, so 'Author - Mike Dane' rendering is a real end-to-end signal.
  • tests/helpers/test-fixtures.ts — nest categories.0 inside relationships in the pirate-skill listing. It sat as a sibling of relationships, so the category link was silently not a relationship at all.

That's the 9 previously-parked live tests (5 install + 4 remix). They were parked at module level, which is why they never showed up in skip counts.

Note the Skill cases in both suites are the base-realm path specifically — they are the ones that fail without boxel#5631.

Status

boxel#5631 has merged, and the temporary CI pin used to verify the pair pre-merge is reverted (994195bea39ea1) — CI now runs against boxel main, which contains the planner change. Live Tests were green while pinned to the companion branch (all 10 previously-parked tests ran, 0 failures); the run against main is in flight on ea39ea1.

There are still no unit tests for buildInstanceOperation — the live suites are its only coverage.

🤖 Generated with Claude Code

richardhjtan and others added 2 commits July 29, 2026 00:54
`buildInstanceOperation` computed the install planner's `targetCodeRef` and then
dropped it, so a copied instance kept the source realm's `adoptsFrom`. Instances
whose ref happened to be relative survived by accident, since the relative path
stays valid under a folder-preserving copy; ones with an absolute catalog-realm
ref stayed pointed at the catalog. Assign the planner's decision instead.

That makes the install/remix live suites meaningful, so un-park both. The card
listing test now also asserts the installed card's module resolves into the
destination realm and no longer into the catalog realm — the assertion that
actually pins this bug.

Also nests `categories.0` inside `relationships` in the pirate-skill fixture; it
sat as a sibling, so the category link was silently not a relationship at all.

Depends on cardstack/boxel#5631 for correct base-realm classification: with
adoptsFrom now actually rewritten, a base-realm ref that the planner
misclassifies becomes a visibly broken module reference rather than dead data.

Co-Authored-By: Claude <noreply@anthropic.com>
…re merge

Points the boxel monorepo checkout at
cs-12078-make-the-catalog-install-planner-rri-native so this PR's own Live Tests
job can prove the fix end to end before cardstack/boxel#5631 merges. Must be
reverted to the default branch before this PR is merged.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown

Staging Submissions Preview

This PR's content is pushed to the staging submissions realm: https://realms-staging.stack.cards/submissions/

Changed folders:

  • commands/
  • tests/

Updated at 2026-07-30 07:55:16 UTC for commit ea39ea1. Shared realm: only this PR's changed files are pushed; files touched by multiple PRs reflect whichever pushed last, and deleted files are not removed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 catalog listing installs/remixes leaving copied card instances’ meta.adoptsFrom pointing at the source (catalog) realm by persisting the install planner’s chosen targetCodeRef, and re-enables the previously parked live acceptance suites that validate the end-to-end behavior.

Changes:

  • Write copyInstanceMeta.targetCodeRef onto the copied resource’s meta.adoptsFrom during instance install.
  • Unskip the live “listing install” and “listing remix” acceptance suites and add an assertion that the installed card’s module resolves into the destination realm (not the catalog realm).
  • Fix a test fixture JSON:API shape issue by nesting categories.0 under relationships.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
commands/listing-install.ts Persists the planner’s selected module reference onto copied instances via meta.adoptsFrom.
tests/live/catalog-app/listing-install.test.gts Unskips install suite and asserts installed card resolves into destination realm.
tests/live/catalog-app/listing-remix.test.gts Unskips remix suite to restore end-to-end coverage.
tests/helpers/test-fixtures.ts Fixes fixture relationship structure for categories.0.
.github/workflows/ci-test.yaml Temporarily pins boxel checkout ref for CI live tests (must be reverted before merge).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci-test.yaml Outdated
@richardhjtan
richardhjtan marked this pull request as ready for review July 30, 2026 11:43
@richardhjtan
richardhjtan requested a review from a team July 30, 2026 11:43
@richardhjtan
richardhjtan merged commit 930a3b2 into main Jul 30, 2026
3 checks passed
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