fix(core): correct local folder docset initialization path - #25
Merged
Merged
Conversation
## Intent
Fix critical bug where local folder docsets could not be initialized correctly.
The `calculateLocalPath()` function was returning the source path (e.g., `./docs`)
for `local_folder` type docsets instead of the standard docset directory
(`.knowledge/docsets/{id}`). This caused the init command to use the source
directory as the target, potentially deleting source files with `--force` and
creating circular symlinks.
## Key changes
- `calculateLocalPath()` now consistently returns `.knowledge/docsets/{id}` for
all source types including `local_folder`, matching behavior of `git_repo`
and `archive` types
- Local folder initialization now correctly creates symlinks in the docset
directory pointing to source folders, preserving source files
- Updated tests to expect the corrected behavior
- Fixed invalid source type `zip` to `archive` in example config
- Added `local-docs` docset as working example of local folder configuration
## Dependencies and side effects
- Existing local folder docsets will need to be re-initialized after this fix
- The symlink structure changes from source-path-based to standard docset
directory, ensuring consistency across all source types
- MCP server path resolution for local folders remains compatible as it already
uses the standard docset directory path
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.
Intent
Fix critical bug where local folder docsets could not be initialized correctly. The
calculateLocalPath()function was returning the source path (e.g.,./docs) forlocal_foldertype docsets instead of the standard docset directory (.knowledge/docsets/{id}). This caused the init command to use the source directory as the target, potentially deleting source files with--forceand creating circular symlinks.Key changes
calculateLocalPath()now consistently returns.knowledge/docsets/{id}for all source types includinglocal_folder, matching behavior ofgit_repoandarchivetypesziptoarchivein example configlocal-docsdocset as working example of local folder configurationDependencies and side effects