Fix local folder inconsistencies - require initialization and use symlinked paths - #14
Merged
mrsimpson merged 2 commits intoNov 29, 2025
Conversation
…linked paths
This commit addresses several inconsistencies in how local documentation folders
were handled compared to git repositories:
Changes:
1. **Init command now supports local folders**
- Creates symlinks in .knowledge/docsets/{id}/
- Validates source paths exist
- Creates .agentic-metadata.json for tracking
- Counts files and stores metadata
2. **Server validates initialization for local folders**
- Checks for .agentic-metadata.json before allowing search
- Returns consistent error messages for uninitialized docsets
- Both local folders and git repos now require explicit init
3. **Server returns symlinked paths for local folders**
- Local folders now return .knowledge/docsets/{id}/ path
- Agents no longer need to traverse up to project root
- Consistent behavior between git repos and local folders
4. **Create command updated**
- Removed automatic symlink creation for local folders
- Added helpful message to run init command
- Consistent flow: create -> init -> search
5. **Core package exports createSymlinks**
- Exported from paths/symlinks.js for use in CLI
Result: Local folders now behave consistently with git repos - both
require initialization via 'agentic-knowledge init {docset_id}' before
they can be searched, and both return paths under .knowledge/docsets/.
Updated tests to reflect the new consistent behavior where local folders
require initialization and use symlinked paths.
Changes:
1. **CLI test (create-command.test.ts)**
- Updated test name to reflect new behavior
- Changed assertion to expect symlinks NOT created during create
- Symlinks now only created during init command
2. **MCP Server test (web-sources.test.ts)**
- Added initialization setup for local folder docsets in test
- Creates symlinks and metadata files in beforeEach
- Updated test expectations to expect symlinked paths
- Local folders now return .knowledge/docsets/{id} paths
3. **E2E test setup (e2e-test-setup.ts)**
- Added automatic initialization when creating test projects
- Creates symlinks to source directories
- Creates .agentic-metadata.json files
- Simulates running 'agentic-knowledge init {docset-id}'
Result: All 181 tests passing (100% success rate)
mrsimpson
deleted the
claude/investigate-local-docs-016zGZKADXxc7HxR1v9TNnxq
branch
November 29, 2025 16:19
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.
This commit addresses several inconsistencies in how local documentation folders
were handled compared to git repositories:
Changes:
Init command now supports local folders
Server validates initialization for local folders
Server returns symlinked paths for local folders
Create command updated
Core package exports createSymlinks
Result: Local folders now behave consistently with git repos - both
require initialization via 'agentic-knowledge init {docset_id}' before
they can be searched, and both return paths under .knowledge/docsets/.