Skip to content

Change runtime dependency tracker internals to use RRIs#5541

Draft
backspace wants to merge 1 commit into
cs-11716-loader-internal-rri-keysfrom
cs-12212-tracker-rri-native
Draft

Change runtime dependency tracker internals to use RRIs#5541
backspace wants to merge 1 commit into
cs-11716-loader-internal-rri-keysfrom
cs-12212-tracker-rri-native

Conversation

@backspace

Copy link
Copy Markdown
Contributor

This is set to merge in #5540.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Host Test Results

    1 files  ±0      1 suites  ±0   2h 35m 50s ⏱️ - 1m 56s
3 550 tests +1  3 533 ✅ +1  15 💤 ±0  0 ❌ ±0  2 🔥 ±0 
3 569 runs  +1  3 550 ✅ +1  15 💤 ±0  2 ❌ ±0  2 🔥 ±0 

Results for commit 33f4a6d. ± Comparison against earlier commit bb1af14.

For more details on these errors, see this check.

Realm Server Test Results

    1 files  ±0      1 suites  ±0   17m 15s ⏱️ +17s
1 881 tests ±0  1 881 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 960 runs  ±0  1 960 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 33f4a6d. ± Comparison against earlier commit bb1af14.

@backspace
backspace force-pushed the cs-12212-tracker-rri-native branch from d69e92a to bb1af14 Compare July 17, 2026 19:30
Remove the dependencyTrackingKey / canonicalizeTrackingKey shim and let
the loader's own canonical identifier form feed the dependency tracker
directly.

The tracker previously keyed module nodes exclusively by http(s) URL:
its canonicalURL guard dropped any non-URL identifier. To bridge that,
the loader carried a dependencyTrackingKey shim that callers crossed
before tracking. That form is no longer needed — the tracker keys nodes
by the loader's canonical identifier: an RRI prefix (`@cardstack/base/X`)
for a mapped realm, the resolved real URL for a plain realm.

Two coordinated changes make direct tracking correct:

- canonicalIdentifier never emits a virtual alias. unresolveURL folds a
  prefix-mapped realm onto its RRI, but the virtual alias of a plain,
  prefix-less realm has no prefix to fold onto and would pass through —
  leaking a virtual URL into dependency lists the index persists as real
  URLs. Any such surviving alias is collapsed to its real URL via
  mapURL('virtual-to-real'), which no-ops on real URLs and RRIs. The
  result is an RRI for prefixed realms and the real URL for plain ones.

- normalizeModuleURL accepts an RRI prefix alongside http(s) URLs,
  stripping the executable extension either way.

card-api tracks identity.module and getKnownConsumedModules deps
directly; the two loader-internal tracking sites use canonicalIdentifier.
Instance and file dependency normalization stay URL-keyed, unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@backspace
backspace force-pushed the cs-12212-tracker-rri-native branch from bb1af14 to 33f4a6d Compare July 17, 2026 20:20
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