Skip to content

Update commands to use RIs and RRIs#4627

Draft
backspace wants to merge 9 commits intomainfrom
@cardstack/base-commands-cs-10992
Draft

Update commands to use RIs and RRIs#4627
backspace wants to merge 9 commits intomainfrom
@cardstack/base-commands-cs-10992

Conversation

@backspace
Copy link
Copy Markdown
Contributor

@backspace backspace commented May 1, 2026

This is a mechanical renaming within the commands package, with updates like this:

  • sourceFileUrlsourceFileIdentifier
  • GetCatalogRealmUrlsCommandGetCatalogRealmIdentifiersCommand

backspace and others added 5 commits May 1, 2026 14:52
Renames in packages/base/command.gts:

- GetRealmOfUrl{Input,Result} → GetRealmOfResourceIdentifier{Input,Result}
  Field rename: url → resourceIdentifier, realmUrl → realmIdentifier
- RealmUrlCard → RealmIdentifierCard, .realmUrl → .realmIdentifier
- InvalidateRealmUrlsInput → InvalidateRealmIdentifiersInput
  Field rename: urls → resourceIdentifiers
- CanReadRealmInput.realmUrl → realmIdentifier
- GetDefaultWritableRealmResult.realmUrl → realmIdentifier
- ValidateRealm{Input,Result}.realmUrl → realmIdentifier

Also renames the host command file get-realm-of-url.ts →
get-realm-of-resource-identifier.ts (and its class), and the matching
test file. Sweeps all consumers and integration tests.

The wire payload to the realm-server invalidation endpoint stays as
'urls' since that's the server's protocol. Other commands that still
use 'realmUrl' as a field name (ExecuteAtomicOperationsInput,
SendAiAssistantMessageInput, EvaluateModuleInput, InstantiateCardInput,
etc.) are out of scope for this commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Continues the CS-10992 sweep started in the previous commit:

Field renames in packages/base/command.gts:
- CopySourceInput.{originSourceUrl, destinationSourceUrl} → {originSourceIdentifier, destinationSourceIdentifier}
- CopySourceResult.url → identifier
- CopyFileToRealmInput.sourceFileUrl → sourceFileIdentifier
- CopyFileToRealmResult.newFileUrl → newFileIdentifier
- FileUrlCard → FileIdentifierCard, .fileUrl → .fileIdentifier
- WriteBinaryFileResult.fileUrl → fileIdentifier
- ReadBinaryFileInput.url → fileIdentifier
- PatchCodeCommandResult.finalFileUrl → finalFileIdentifier
- PatchCodeInput.fileUrl → fileIdentifier
- SendAiAssistantMessageInput.{attachedFileURLs, realmUrl} → {attachedFileIdentifiers, realmIdentifier}
- EvaluateModuleInput.{moduleUrl, realmUrl} → {moduleIdentifier, realmIdentifier}
- InstantiateCardInput.{moduleUrl, realmUrl} → {moduleIdentifier, realmIdentifier}
- ExecuteAtomicOperationsInput.realmUrl → realmIdentifier
- SanitizeModuleListInput/Result.moduleUrls → moduleIdentifiers
- GetAvailableRealmUrlsResult → GetAvailableRealmIdentifiersResult, .urls → .realmIdentifiers
- GetCatalogRealmUrlsResult → GetCatalogRealmIdentifiersResult, .urls → .realmIdentifiers
- FetchCardJsonInput.url → cardIdentifier
- RealmMetaField.url → realmIdentifier (and the inline RealmMeta type in realm.gts)

Sweeps consumers across host commands, components, services, tests, and
catalog-realm/experiments-realm.

Out of scope: AuthedFetchInput.url and SendRequestViaProxyInput.url
(generic URLs, not realm resource identifiers); RealmInfoField.{backgroundURL, iconURL}
(actual image URLs); GenerateThumbnailInput.{sourceImageUrl, targetRealmUrl} and
GenerateThumbnailOutput.imageDefUrl (image-domain fields).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- GenerateThumbnailInput.targetRealmUrl → targetRealmIdentifier
- GenerateThumbnailOutput.imageDefUrl → imageDefIdentifier

The catalog-realm UploadImageCommand and GenerateImageCommand have
their own targetRealmUrl fields (they're separate command classes
defined in catalog-realm) — those stay untouched in this commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ntifier

The catalog-realm-defined UploadImageCommand and GenerateImageCommand
had their own targetRealmUrl input fields. Rename to targetRealmIdentifier
for consistency with the rest of the command-API renames in this branch.

Sweeps callers in catalog-realm (image fields, time-machine, adventure,
product-rotater) and experiments-realm (image-upload-tester).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

Preview deployments

Host Test Results

    1 files      1 suites   1h 43m 14s ⏱️
2 565 tests 2 550 ✅ 15 💤 0 ❌
2 584 runs  2 569 ✅ 15 💤 0 ❌

Results for commit a41aab9.

Realm Server Test Results

    1 files  ±  0      1 suites  ±0   18m 3s ⏱️ + 13m 16s
1 239 tests +797  1 239 ✅ +797  0 💤 ±0  0 ❌ ±0 
1 317 runs  +862  1 317 ✅ +862  0 💤 ±0  0 ❌ ±0 

Results for commit a41aab9. ± Comparison against earlier commit 5d815bf.

backspace and others added 4 commits May 4, 2026 11:31
The previous rename commits updated class definitions in
packages/base/command.gts but missed several callers — tsc can't
catch them because Partial<FieldsOf<...>> CardDef constructors and
matrix runCommand payloads are both untyped object literals, so
mismatched keys silently leave the new field empty.

Production fixes (constructor was passing the old key):

- write-text-file.ts:97 — fileUrl → fileIdentifier
- write-binary-file.ts:135 — fileUrl → fileIdentifier
- get-default-writable-realm.ts:25 — realmUrl → realmIdentifier
- get-all-realm-metas.ts:33 — url → realmIdentifier
- software-factory/src/eval-execution.ts:378 — moduleUrl/realmUrl →
  moduleIdentifier/realmIdentifier in EVALUATE_MODULE_COMMAND payload
- software-factory/src/instantiate-execution.ts:722-726 — same for
  INSTANTIATE_CARD_COMMAND payload

Test fixes (tests still passed old keys to InputType):

- evaluate-module-test.gts (host integration)
- instantiate-card-test.gts (host integration)
- evaluate-module-command.spec.ts (software-factory)

This unbreaks downstream cascades: switch-submode createFile tests
read writeResult.fileIdentifier (empty), realm field tests read
realm.realmIdentifier (empty), and all eval-validation /
instantiate-validation SF tests fail at the runCommand layer.

Co-Authored-By: Claude Opus 4.7 (1M context) <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.

1 participant