Skip to content

Classify a prefix-form module reference as absolute - #5927

Open
backspace wants to merge 1 commit into
mainfrom
cs-12676-isrelativepath-prefix
Open

Classify a prefix-form module reference as absolute#5927
backspace wants to merge 1 commit into
mainfrom
cs-12676-isrelativepath-prefix

Conversation

@backspace

@backspace backspace commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

This is a followup from #5847 feedback, in the RRI/@cardstack/base project.

Claude: isRelativePath asked only whether a value parses as a URL. URL.canParse says no for a registered prefix, so the canonical spelling of every base-realm module read as a relative path and resolveAdoptsFrom sent it down relative resolution.

Nothing breaks today: that path passes a prefix form through unchanged, and resolveModuleHref admits one before resolving. The classification was wrong while the outcome was right, resting on a downstream tolerance rather than on knowing what the value was.

The @ discriminator is the one the codebase already uses for this question — resolveRRIReference, which receives whatever this classifies, opens with the same test, and isLocalId records why it needs no VirtualNetwork: the two remote forms are syntactically distinguishable.

Since both routes agree, no behaviour distinguishes them and a regression would be silent, so the classifier is asserted directly and exported for that.

`isRelativePath` asked only whether a value parses as a URL. `URL.canParse` says
no for a registered prefix, so the canonical spelling of every base-realm module
read as a relative path and `resolveAdoptsFrom` sent it down relative
resolution.

Nothing breaks today: that path passes a prefix form through unchanged, and
`resolveModuleHref` admits one before resolving. The classification was wrong
while the outcome was right, resting on a downstream tolerance rather than on
knowing what the value was.

The `@` discriminator is the one the codebase already uses for this question —
`resolveRRIReference`, which receives whatever this classifies, opens with the
same test, and `isLocalId` records why it needs no VirtualNetwork: the two
remote forms are syntactically distinguishable.

Since both routes agree, no behaviour distinguishes them and a regression would
be silent, so the classifier is asserted directly and exported for that.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

    1 files      1 suites   2h 25m 54s ⏱️
4 596 tests 4 582 ✅ 14 💤 0 ❌
4 611 runs  4 597 ✅ 14 💤 0 ❌

Results for commit 13f7721.

Realm Server Test Results

    1 files      1 suites   19m 1s ⏱️
2 351 tests 2 351 ✅ 0 💤 0 ❌
2 434 runs  2 434 ✅ 0 💤 0 ❌

Results for commit 13f7721.

@backspace
backspace marked this pull request as ready for review August 28, 2026 18:14
@backspace
backspace requested a review from a team August 28, 2026 18:42
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