Fix local-folder content decoding and strict query scoping#36
Draft
arlanrakh wants to merge 2 commits into
Draft
Fix local-folder content decoding and strict query scoping#36arlanrakh wants to merge 2 commits into
arlanrakh wants to merge 2 commits into
Conversation
Co-authored-by: Arlan Rakhmetzhanov <arlanrakh@users.noreply.github.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-authored-by: Arlan Rakhmetzhanov <arlanrakh@users.noreply.github.com>
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.
What this fixes
This PR addresses a local-folder retrieval/search regression where indexed local markdown could come back garbled and local-only queries could include public-source snippets.
Changes
nia search querybefore dispatch:--local-folders/nia.jsonlocal bindings viasources.resolve(..., "local_folder"){ id: ... }) alongside typed identifiers.sources.content: decode base64 / encoded local content into UTF-8 textsources.grep: decode encoded local-folder match textsearch.query: decode local-folder snippet content and enforce local-only filtering when request scope is local-folder only (filters out non-local snippets/readySources/blockedSources)Validation
bun run checkbun run check:typesbun test tests/services/cli-sdk.test.ts tests/commands/search.test.tsAll pass on this branch.
Summary by cubic
Fixes garbled local-folder content and stops non-local results from appearing in local-only searches. Adds strict scoping by resolving local-folder identifiers to canonical IDs.
Bug Fixes
sources.content,sources.grep, andsearch.queryfor both experimental and legacy paths.--local-folders/nia.jsonbindings to canonical source IDs and include them in experimental payloads via{ id: ... }(fallback to identifiers if unresolved).search.queryby dropping non-local snippets and non-local entries inreadySources/blockedSources.Refactors
Written for commit ebb7b58. Summary will update on new commits.