Skip to content

Spell every catalog-app adoptsFrom with the @cardstack/catalog alias - #675

Merged
richardhjtan merged 1 commit into
mainfrom
fix/alias-catalog-app-module-refs
Jul 29, 2026
Merged

Spell every catalog-app adoptsFrom with the @cardstack/catalog alias#675
richardhjtan merged 1 commit into
mainfrom
fix/alias-catalog-app-module-refs

Conversation

@richardhjtan

Copy link
Copy Markdown
Collaborator

Why

Every listing mirrored into the staging submissions realm renders as a card error:

field validation error: tried set Tag as field 'tags' but it is not an instance of Tag

The ../../Tag/app link is fine — it resolves, and the realm indexes it without errors. The mismatch is module identity:

class comes from
CardListing.tags field type @cardstack/catalog/…/listing/listing → global alias → catalog realm's catalog-app/listing/tag.gts
submissions/Tag/app instance ../catalog-app/listing/tag → realm-relative → submissions copy of tag.gts

@cardstack/catalog/ is a single global mapping to the catalog realm (boxel packages/host/app/services/network.ts); it never means "the realm I am in". And instanceOf (boxel packages/base/card-api.gts) compares code refs up the ancestor chain rather than JS prototypes, so two copies of the same file are two unrelated classes.

How it got here:

  1. Fix listing file #640 moved listings to the @cardstack/catalog/ alias but left the instances they link to — Tag/, Category/, Sphere/ — on realm-relative refs. Latent: inside the catalog realm both spellings name the same file.
  2. 526e57d, the first version of push-to-submissions, mirrored whole trees, depositing a second copy of catalog-app/ at the submissions realm root. Timestamps confirm one run wrote all of it (Category/maps-navigation 15:47:51Z, Tag/app 15:47:56Z, …/CardListing/b24c0bbf… 15:48:04Z on 2026-07-14). That is where the two spellings stopped meaning the same file.
  3. The push is changed-files-only since 691c24f and has no cleanup, so those relative-ref copies are frozen in the mirror and every listing pushed since inherits the break — even PRs that never touch Tag/.

What

93 instance files, adoptsFrom.module only:

  • Category/ (62), Tag/ (22), Sphere/ (5) — ../catalog-app/listing/{category,tag,sphere} → alias
  • fields/contact-link/FieldListing (1) — ../../../catalog-app/listing/listing → alias
  • 3 listings hardcoding https://app.boxel.ai/catalog/catalog-app/listing/listing → alias; served from staging those bind to production modules, the same defect in worse form

index.json keeps ./catalog-app/catalog — it is the realm's own index card and the push excludes it.

Verifying

Draft, to exercise push-to-submissions. The PR touches exactly the stale mirror files, so its own push run overwrites them; after that, https://realms-staging.stack.cards/submissions/c7eda3-travel-itinerary-planner/CardListing/b24c0bbf-7339-4a9f-b5f6-e346a36f6bd1 should render instead of erroring. The listing itself is unchanged and does not need re-pushing — it already uses the alias.

Follow-up, not in this PR: a lint check rejecting any catalog-app/ module ref not spelled as the alias, so it cannot drift back.

@github-actions

github-actions Bot commented Jul 29, 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 listings:

Changed folders:

  • 19dee3-virtual-try-on-application/
  • Category/
  • Sphere/
  • Tag/
  • b6ac3a-survey/
  • d29736-tier-list/
  • fields/

Updated at 2026-07-29 10:23:16 UTC for commit f362464. 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.

Listing instances moved to `@cardstack/catalog/catalog-app/listing/listing` in
#640, but the instances they link to — Tag, Category, Sphere — kept realm-relative
module refs. Inside the catalog realm both spellings resolve to the same file, so
nothing broke.

The staging submissions realm holds a second copy of catalog-app, left by the
first version of push-to-submissions, which mirrored whole trees. There the two
spellings diverge: a listing's `tags` field type comes from the catalog realm's
tag.gts while `submissions/Tag/app` adopts the submissions copy. instanceOf
compares code refs rather than prototypes, so every mirrored listing fails with

    field validation error: tried set Tag as field 'tags' but it is not an instance of Tag

Alias every catalog-app adoptsFrom so the spelling is realm-independent. Three
listings still hardcoding https://app.boxel.ai/catalog/... are folded in for the
same reason — served from staging they bind to production modules. index.json
keeps its relative ref: it is the realm's own index card, and the push to the
submissions realm excludes it.

Co-Authored-By: Claude <noreply@anthropic.com>
@richardhjtan
richardhjtan force-pushed the fix/alias-catalog-app-module-refs branch from 30a3361 to f362464 Compare July 29, 2026 10:22
@richardhjtan
richardhjtan marked this pull request as ready for review July 29, 2026 10:36
@richardhjtan
richardhjtan requested review from a team and Copilot July 29, 2026 10:36
@richardhjtan
richardhjtan merged commit b85b2bc into main Jul 29, 2026
4 checks passed

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 module-identity mismatches in mirrored “submissions” realm cards by standardizing meta.adoptsFrom.module to always use the global @cardstack/catalog/… alias for catalog-app types (Category/Tag/Sphere and listing bases). This prevents duplicated class definitions across realms from failing instanceOf-style validation when referenced from listings.

Changes:

  • Update Tag/*, Category/*, and Sphere/* instance cards to adopt from @cardstack/catalog/catalog-app/listing/{tag,category,sphere}.
  • Update one FieldListing card to adopt from @cardstack/catalog/catalog-app/listing/listing.
  • Replace hardcoded production URL adoptsFrom.module in 3 CardListing cards with the @cardstack/catalog alias.

Reviewed changes

Copilot reviewed 93 out of 93 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Tag/report.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/skill.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/field.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/new.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/general.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/official.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/bundled.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/ai.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/community.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/user-contributed.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/featured.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/tracker.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/app.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/planner.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/poster.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/game.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/dashboard.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/card.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/calculator.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/form.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/template.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Tag/theme.json Switch adoptsFrom module ref to @cardstack/catalog alias (Tag)
Sphere/work.json Switch adoptsFrom module ref to @cardstack/catalog alias (Sphere)
Sphere/learn.json Switch adoptsFrom module ref to @cardstack/catalog alias (Sphere)
Sphere/play.json Switch adoptsFrom module ref to @cardstack/catalog alias (Sphere)
Sphere/build.json Switch adoptsFrom module ref to @cardstack/catalog alias (Sphere)
Sphere/life.json Switch adoptsFrom module ref to @cardstack/catalog alias (Sphere)
Category/developer-tools-code.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/family-relationships.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/food-cooking.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/product-catalogs.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/real-estate-property.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/video-games-interactive.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/hobbies-crafts.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/operations-supply-chain.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/professional-services.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/teaching-instruction.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/technical-documentation.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/data-engineering.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/career-development.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/knowledge-management.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/science-discovery.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/design-creative.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/legal-compliance.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/goals-habits.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/data-management.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/social-networking.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/hr-people-management.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/business-development.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/ui-components-design.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/quality-assurance.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/personal-finance.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/data-analytics.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/software-development.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/creative-projects.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/web-development.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/home-living.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/events-celebrations.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/shopping-consumer.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/prototyping-experiments.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/language-learning.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/travel-experiences.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/content-creation.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/analytics-reporting.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/health-wellness.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/marketing-growth.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/skills-training.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/accounting-finance.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/communication.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/e-commerce-online-sales.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/sports-fitness.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/news-media.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/devops-infrastructure.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/reading-literature.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/adventure-outdoor-activities.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/maps-navigation.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/hardware-iot.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/api-integration.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/research-knowledge.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/security-privacy.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/travel-lifestyle.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/ai-automation.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/customer-support.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/education-courses.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/entertainment-media.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/project-management.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/gaming.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/parties-celebrations.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
Category/certifications-training.json Switch adoptsFrom module ref to @cardstack/catalog alias (Category)
fields/contact-link/FieldListing/a5045646-6938-45da-8138-f11ed34df2b9.json Switch FieldListing base adoptsFrom to @cardstack/catalog alias
d29736-tier-list/CardListing/e442113f-570a-4053-be33-2756371f88bb.json Replace hardcoded production listing module URL with @cardstack/catalog alias
b6ac3a-survey/CardListing/9ca941bc-fc90-4ac9-8dda-2558713269e8.json Replace hardcoded production listing module URL with @cardstack/catalog alias
19dee3-virtual-try-on-application/CardListing/d0e745d6-9ff4-441d-a3d9-177f1e785efd.json Replace hardcoded production listing module URL with @cardstack/catalog alias

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

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