Repository navigation
fix(skill): detect local registry sources by filesystem, not string shape - #420
Merged
Merged
Conversation
…hape A scheme-less source resolving to a real directory is now treated as a local registry (file:// URL) instead of a git URL. Fixes add-registry git-cloning '.', 'myfolder', '~/x' etc. into the skill cache — git clone succeeds on local dirs, so a git repo at '.' produced a stale HEAD clone that link-mode installs then pointed at. Stored value is an absolute file:// URL, so relative-source resolution no longer depends on call-time cwd. Refs #419
…ion" This reverts commit a005b72.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
skill add-registrygit-cloning local folder sources instead of using them in place.normalizeRegistrySourceInputdecided git-vs-local by string shape: onlyfile:URLs, absolute paths, and.//../shorthands counted as local. Bare.,~/x, and plain relative dirs (myfolder) fell through togit clone— which succeeds on local dirs, so a git repo at.produced a stale HEAD clone in~/.ai-devkit/skills/<id>/that link-mode installs then pointed at (untracked files and uncommitted edits missing).Fix: after
file:-URL and scheme checks (protocol://,user@host:scp-style), a scheme-less value thatpath.resolves to a real directory is treated as local → stored as an absolutefile://URL. Only URL-shaped or nonexistent paths reach git.Bonus: the stored
file://absolute path also fixes relative sources resolving against call-timecwdinstead of the config's project root.Refs #419
Test plan
normalizeRegistrySourceInputcases:.,..,~,~/x, barenested,file://,https://,git@, nonexistent path → git fallbackskill-registry-source.test.ts— 11/11skillcommand tests — 47/47tsc --noEmit+oxfmtclean.inside a git repo →git clone .→ HEAD clone) before fix