Repository navigation
fix(mcp): resolve repository-relative chunk reads - #208
Merged
Merged
Conversation
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.
An indexed search result returns a repository and a repository-relative path, but chunk reads previously resolved that path against the workspace root. A valid result could therefore fail to read unless the caller constructed a workspace prefix.
Add optional
repoto the MCP and HTTP read contracts, preserve it in remote forwarding, and share one filesystem resolver. Explicit repositories refuse traversal and symlink escapes. Withoutrepo, existing workspace paths retain precedence; otherwise a unique relative match resolves and ambiguity refuses with the matching repository names. Missing and unknown paths return corrective guidance. This does not reindex or expand the index.Private before/after control: indexed
alpha/src/example.rsadvertisesfile_path=src/example.rs; the old workspace-only reader cannot resolve it, while the new real private Lance index -> MCP find_refs -> read_chunk control returns the requested content with omitted or explicit repository. Unknown repositories still refuse. Nine resolver controls and remote parameter compatibility cover the failure boundaries.Validation:
just checkpassed with the required knowledge feature; fulljust testpassed (1,422 tests, five ignored). The targeted path selection passed 11 tests. The HOME guard finished clean across 157 watched paths and five resources. An additional falsifier reproduced a workspace/repository basename collision; configured child repositories now take precedence while single-repository roots retain their fallback. The integration test lives in its own module to preserve the large-file ceilings.Rollback: revert the merged source change through the normal lane; release or installation remains separate. No branch binary installation, service restart, or index rebuild is part of this proposal.