Skip to content

Replace virtualNetworkFor with resolveInstanceURL#5400

Draft
backspace wants to merge 1 commit into
instance-id-rri-cs-11734from
cs-11778-card-api-replace-virtualnetworkfor-with-a-narrow
Draft

Replace virtualNetworkFor with resolveInstanceURL#5400
backspace wants to merge 1 commit into
instance-id-rri-cs-11734from
cs-11778-card-api-replace-virtualnetworkfor-with-a-narrow

Conversation

@backspace

Copy link
Copy Markdown
Contributor

This is based on #5393.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Host Test Results

    1 files  ±0      1 suites  ±0   2h 16m 13s ⏱️ + 2m 9s
3 377 tests ±0  3 362 ✅ ±0  15 💤 ±0  0 ❌ ±0 
3 396 runs  ±0  3 381 ✅ ±0  15 💤 ±0  0 ❌ ±0 

Results for commit b308f94. ± Comparison against earlier commit d73667a.

…S-11778)

Card definitions (spec.gts, experiments-realm/asset.gts) reached the store's
VirtualNetwork via the `virtualNetworkFor` export purely to turn an RRI/relative
reference into a real fetchable URL for a boundary that can't consume RRI (an
`<img src>`, the AI source-file reader's `new URL(...)`). Replace that export
with a narrow `resolveInstanceURL(instance, reference)` that returns a URL, not
the VirtualNetwork itself — closing the raw-VN leak to card definitions. It
resolves through the active Loader's VirtualNetwork (the network boundary).

Scope note: the CardStore.virtualNetwork interface member stays for now. Beyond
the two loadCardDocument fetch boundaries it is still read by query-field-support
(resolveQueryAndRealm) and host search (isFileDefCodeRef), which need the raw
VirtualNetwork for operations resolveInstanceURL doesn't cover. Removing the
interface member is deferred to a follow-up that migrates those consumers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@backspace backspace force-pushed the cs-11778-card-api-replace-virtualnetworkfor-with-a-narrow branch from d73667a to b308f94 Compare July 3, 2026 22:41
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