Skip to content

fix(registry): match scoped definition names on Windows - #136

Merged
moshest merged 1 commit into
mainfrom
claude/fix-scoped-name-separator
Sep 8, 2026
Merged

moshest merged 1 commit into
mainfrom
claude/fix-scoped-name-separator

Conversation

@moshest

@moshest moshest commented Sep 8, 2026

Copy link
Copy Markdown
Member

The bug

loadDefinition derives the expected name from relative(managerDir, filePath), which returns platform separators. On Windows a scoped definition yields @apollo\client, which never matches the @apollo/client inside the file:

Definition name "@apollo/client" doesn't match filename "@apollo\client.yaml"

listDefinitions() loads every definition, so one scoped package throws and no registry command runs at all on Windows.

Reported by @TeeJS in #133. They reproduced it on main with their own definitions removed, confirmed it doesn't affect Linux CI, and deliberately left it unfixed to keep that PR to one concern. Credit to them — this is their find and their proposed approach.

The fix

Normalise the derived name to forward slashes before comparing.

They suggested split(sep).join("/"), which is correct. I used .replaceAll("\\", "/") instead for one reason: sep is / on Linux, so split(sep) leaves backslashes untouched and the Windows behaviour becomes a branch that no Linux CI run ever executes. Normalising unconditionally keeps a single code path on both platforms, so the comparison Linux tests is the comparison Windows runs.

Test

The regression test reproduces the failure on Linux. A literal backslash in a filename is one filename here rather than a separator, but the string reaching the comparison is byte-identical to what Windows produces from a real separator.

Verified in both directions rather than assumed:

  • Without the fix, the new test fails with the exact reported error: Definition name "@apollo/client" doesn't match filename "@apollo\client.yaml"
  • With the fix, it passes
  • pnpm lint clean (needed pnpm fix for wrapping), pnpm build clean
  • pnpm test — 221 context + 49 registry, all passing

No changeset: @neuledge/registry is private: true, and CLAUDE.md scopes changesets to published packages.

Scope

The fix and its test only. The Windows path-separator artifact in doc_path values that @TeeJS also mentioned is a different thing — a display artifact in built output rather than a hard failure — and isn't touched here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NBQQpA86yYzwJUiVz8ph2R


Generated by Claude Code

loadDefinition derives the expected name from relative(managerDir, filePath),
which returns platform separators. On Windows a scoped definition yields
"@apollo\client" and never matches the "@apollo/client" inside the file, so
listDefinitions() threw for every scoped package and no registry command ran
at all.

Reported by @TeeJS in #133, who reproduced it on main with their own
definitions removed and deliberately left it unfixed to keep that PR to one
concern.

Normalising unconditionally rather than branching on sep keeps a single code
path on every platform, so Linux CI exercises the same comparison Windows does
instead of leaving the Windows branch untested.

The regression test reproduces the failure on Linux: a literal backslash in the
filename is one filename here rather than a separator, but the string reaching
the comparison is byte-identical to what Windows produces. Without the fix it
fails with the exact reported error, "Definition name \"@apollo/client\"
doesn't match filename \"@apollo\\client.yaml\"".

No changeset: @neuledge/registry is private.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NBQQpA86yYzwJUiVz8ph2R
@changeset-bot

changeset-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: fde6ab8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@moshest
moshest marked this pull request as ready for review September 8, 2026 23:34
@moshest
moshest merged commit 149f112 into main Sep 8, 2026
3 checks passed
@moshest
moshest deleted the claude/fix-scoped-name-separator branch September 8, 2026 23:34
moshest pushed a commit that referenced this pull request Sep 21, 2026
Validated locally against current main, since the fork's CI runs were
gated at action_required and never executed:

  gdscript    129 sections / 60,921 tokens
  godot    14,488 sections / 8,136,608 tokens

Both match the numbers in the PR description. Plain git sources, so the
versions:/min_version: shape that breaks the nightly publish does not
apply. Whole-tree scan clean.

The earlier exclude_paths objection on this PR was mistaken and was
withdrawn; #135 has since added exclude_paths for git sources anyway.

Thanks to @TeeJS, who also reported the Windows scoped-name bug fixed in
#136 while keeping it out of this PR.
moshest pushed a commit that referenced this pull request Sep 22, 2026
Releases @neuledge/context 1.2.4 -> 1.2.5 (patch).

Consumed one changeset, .changeset/tidy-manual-examples.md, declared as a
patch on @neuledge/context and added by #137: preserve code formatting in
HTML documentation that uses bare preformatted blocks, including systemd's
rendered DocBook manuals. It was the only changeset on main, it names the
published package only, and a patch bump is the right size for it.

@neuledge/registry 0.0.17 -> 0.0.18 is the automatic dependent bump that
changesets emits for the workspace:* dependency. It is "private": true, is
not published, appears in no changeset, and matches the shape of the last
release PR (#129).

Cross-checked recently merged work: #133, #149 and #150 add registry YAML
definitions only and #136 changes the private registry package only, so
none of them warrants a changeset. No user-facing packages/context change
merged without one.

Verified against npm before merging: dist-tags.latest for @neuledge/context
is 1.2.4 and 1.2.5 is absent from the published version list, so the new
version is strictly greater and does not collide.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NBQQpA86yYzwJUiVz8ph2R
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.

2 participants