Skip to content

Change search hydration to support prefix RRIs#5441

Merged
backspace merged 3 commits into
mainfrom
canonical-instance-id-cs-11734
Jul 13, 2026
Merged

Change search hydration to support prefix RRIs#5441
backspace merged 3 commits into
mainfrom
canonical-instance-id-cs-11734

Conversation

@backspace

@backspace backspace commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

This is the last virtual network use in card API related to Markdown pills.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

    1 files  ± 0      1 suites  ±0   2h 52m 41s ⏱️ + 10m 26s
3 455 tests +22  3 440 ✅ +22  15 💤 ±0  0 ❌ ±0 
3 474 runs  +22  3 459 ✅ +22  15 💤 ±0  0 ❌ ±0 

Results for commit 46f6eed. ± Comparison against earlier commit 4fb30c2.

Realm Server Test Results

    1 files  ± 0      1 suites  ±0   11m 23s ⏱️ -32s
1 814 tests +75  1 814 ✅ +75  0 💤 ±0  0 ❌ ±0 
1 893 runs  +75  1 893 ✅ +75  0 💤 ±0  0 ❌ ±0 

Results for commit 46f6eed. ± Comparison against earlier commit 4fb30c2.

@backspace backspace changed the base branch from cs-11730-query-fields-rri-space to main July 9, 2026 12:43
@backspace backspace force-pushed the canonical-instance-id-cs-11734 branch from aa4d269 to 4fb30c2 Compare July 9, 2026 12:43
@backspace backspace marked this pull request as ready for review July 9, 2026 13:10
backspace and others added 3 commits July 10, 2026 09:14
…(CS-11734)

Instance and file-meta GET responses arrive with canonical ids (RRI prefix
form for mapped realms, via the realm server's boundary serialization), but
search item resources hydrate with the index's URL-form ids — so an
instance's id spelling depended on which path loaded it. The base
MarkDownTemplate keys its pill slots by card.id and looks up by the
RRI-resolved reference, so search-hydrated cards in mapped realms never
matched their pill and the reference rendered unresolved. Unresolve the id
once at the search-hydration boundary so both load paths agree.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ealm

Covers the whole reference chain the RRI migration converges on: markdown
extracts the ref in RRI space, the query-backed linkedCards field searches by
it, the search-hydrated instance id is canonical, and the pill slot matches —
so the referenced card's atom renders. Guards the two regressions that each
individually broke this: the client filter matcher dropping URL-form ids
against RRI filter values, and search-hydrated ids disagreeing with the
RRI-resolved slot key.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…CS-11739)

The CardStore interface exposed the VirtualNetwork object itself; its one
remaining consumer, resolveInstanceURL, only ever needed a resolved URL.
Replace the member with resolveURL(reference, base): stores expose
URL-resolution capability — never the network — so card code can satisfy
real-URL boundaries (<img src>, new URL()) without holding realm mappings.
Each store keeps its VirtualNetwork private, used only by its
loadCardDocument / loadFileMetaDocument fetch boundary and the resolveURL
implementation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@backspace backspace force-pushed the canonical-instance-id-cs-11734 branch from 4fb30c2 to 46f6eed Compare July 10, 2026 14:20
@backspace backspace requested a review from a team July 10, 2026 16:47
@habdelra habdelra requested a review from Copilot July 10, 2026 21:53

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 updates the Card API’s store boundary so card code can resolve references to fetchable URLs without being handed the VirtualNetwork object, and adjusts host-side search hydration so cards hydrated via _search use canonical (prefix/RRI) instance ids. This supports correct Rich Markdown “pill” rendering in prefix-mapped realms by keeping instance identity stable regardless of hydration path.

Changes:

  • Replace CardStore.virtualNetwork with CardStore.resolveURL(reference, base?) and update store implementations/wrappers accordingly.
  • Canonicalize _search-hydrated resource ids in the host store to prefix/RRI form via virtualNetwork.unresolveURL(...).
  • Add an integration test that exercises Rich Markdown card-ref pills in a prefix-mapped realm end-to-end.

Reviewed changes

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

Show a summary per file
File Description
packages/base/card-api.gts Changes the CardStore interface to expose resolveURL() instead of virtualNetwork, and updates resolveInstanceURL + fallback store behavior.
packages/host/app/services/store.ts Canonicalizes _search-hydrated resource ids to prefix/RRI form during hydration to keep identity consistent.
packages/host/app/services/render-service.ts Updates CardStoreWithErrors to implement the new resolveURL() boundary.
packages/host/app/lib/gc-card-store.ts Updates CardStoreWithGarbageCollection to implement the new resolveURL() boundary.
packages/host/tests/integration/field-configuration-test.gts Updates the test CardStore stub to match the new resolveURL() interface.
packages/host/tests/integration/components/rich-markdown-field-test.gts Adds an integration test covering relative :card[...] refs in a prefix-mapped realm and verifies pill rendering.

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

@backspace backspace merged commit 0942ac9 into main Jul 13, 2026
73 of 74 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.

3 participants