Skip to content

Change CardDef.id to be RRI#4845

Draft
backspace wants to merge 3 commits into
mainfrom
carddef-id-rri-cs-11042
Draft

Change CardDef.id to be RRI#4845
backspace wants to merge 3 commits into
mainfrom
carddef-id-rri-cs-11042

Conversation

@backspace
Copy link
Copy Markdown
Contributor

Another step toward @cardstack/base

backspace and others added 3 commits May 14, 2026 13:10
…tifier

Brands the live runtime card identifier type and the consumer-side
identifier strings that flow from it. Picks up where CS-10750 stopped:
that ticket branded the wire-shape types (CardResource.id,
ResolvedCodeRef.module); this one brands CardDef.id and the host- and
matrix-side fields and parameters that hold the same values.

Branded:
- CardDef.id, FileDef.id (via explicit field annotation + cast over
  contains(ReadOnlyField))
- setId(), SaveCardFn
- OperatorModeStateService.{openCardIds, getOpenCardIds,
  codePathString, getSummaryForAIBot, makeRemoteIdsList}
- PlaygroundSelection.cardId
- BoxelContext.{openCardIds, previewPanelSelection.cardId}
- extractRelationshipIds() return

Call-site fixes propagate the brand through the host command/component
graph (10 sites) and remove a redundant id: string redeclaration on
three TaskCard interfaces.

Deferred to follow-ups:
- ~42 test-fixture sites still pass raw strings into PlaygroundSelection
  literals
- @field openCardIds = containsMany(StringField) in base/command.gts
  still produces string[] (cast at the open-create-listing-modal
  boundary)
- autoAttachedCardIds is TrackedSet<string> in several components
  (cast at the room.gts boundary)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
With CardDef.id and getOpenCardIds() now branded RealmResourceIdentifier
(prior commit), the explicit rri() casts in search.ts and workspace.gts
are redundant. Removing them is one of the goals called out by the
ticket.

Test fixtures still construct PlaygroundSelection-shaped literals and
card.id assignments with raw strings. Wrap those with rri(...) so the
fixtures satisfy the brand.

Verified clean:
- pnpm --filter @cardstack/host run lint:types
- pnpm --filter @cardstack/runtime-common run lint:types
- pnpm --filter @cardstack/realm-server run lint:types
(all show zero cascade-related errors; remaining noise is pre-existing
TS2307 module-resolution and CssVariableFieldEntry issues unrelated
to this work.)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
# Conflicts:
#	packages/host/tests/integration/components/ask-ai-test.gts
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 15, 2026

Preview deployments

Host Test Results

    1 files      1 suites   1h 36m 56s ⏱️
2 659 tests 2 644 ✅ 15 💤 0 ❌
2 678 runs  2 663 ✅ 15 💤 0 ❌

Results for commit 9248d26.

Realm Server Test Results

    1 files      1 suites   9m 46s ⏱️
1 377 tests 1 377 ✅ 0 💤 0 ❌
1 458 runs  1 458 ✅ 0 💤 0 ❌

Results for commit 9248d26.

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.

1 participant