fix(search): send files= scope and explicit case=; refuse unscoped searches; parse v8 result shapes (fixes #17) - #25
Closed
PYDuquesnoy wants to merge 2 commits into
Conversation
…arches; parse v8 result shapes (fixes #17) iris_search inherited pre-fix upstream code with four defects: - the Atelier query never included files= — /action/search greps only the files scope, so every search searched NOTHING; the documents param was declared but never read - a missing case= param means case-SENSITIVE to Atelier, so default searches silently required byte-exact casing - only the legacy result.content shape was parsed — v8's result-as-array and nested matches[] were dropped, and total_found counted documents - the 2s sync timeout had no override and tripped on slow-but-synchronous servers, falling through to an async POST that parses empty as 0 hits Port of upstream 07f64e5 + 66b486f end state, adapted to this fork: scope is REQUIRED (SCOPE_REQUIRED via the #2 error envelope, isError on the wire), case always explicit (case=0 default), flatten_results() handles v8/legacy/nested/flat shapes (one result per MATCH), sync budget 30s + IRIS_SEARCH_SYNC_TIMEOUT, namespace keeps the #15 resolve path. e2e (live IRIS): unscoped search → SCOPE_REQUIRED; lowercase query with scope finds a MiXeD-case token (pre-fix: 0 results); case_sensitive:true correctly misses it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 6, 2026
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
Fixes #17 —
iris_searchsearched nothing: the Atelier query never included thefiles=scope (/action/searchgreps only the scoped files; ourdocumentsparam was declared but never read), and a missingcase=param means case-SENSITIVE to Atelier, so even a correctly-scoped default search required byte-exact casing. Two further defects: only the legacyresult.contentresponse shape was parsed (v8's result-as-array and nestedmatches[]were dropped;total_foundcounted documents, not matches), and the 2s sync timeout tripped on slow-but-synchronous servers, falling through to an async POST that parses an empty reply as 0 hits.How
Port of upstream
07f64e5+66b486fend state, adapted to this fork's conventions:documentsis now REQUIRED — an unscoped search returnsSCOPE_REQUIREDthrough the [mcp:error-surface] tool failures are not flagged as errors and the error envelope differs per tool #2 error envelope (isErroron the wire) instead of upstream'ssuccess:false-in-ok_json, because a namespace-wide grep times out server-side and reads as "term not found".casealways sent explicitly:case=0default (insensitive),case=1forcase_sensitive: true.flatten_results()handles v8 result-as-array, legacyresult.content, nestedmatches[], and flat single-match entries — one result per match. Unit-tested on all four shapes.IRIS_SEARCH_SYNC_TIMEOUT.iris_executeignoresIRIS_NAMESPACEfrom the MCP server env and silently runs in USER #15resolve_namespacepath; tool description updated (scope required, case default, namespace default).Verification
New e2e
test_search_scope_and_case_insensitive_defaultagainst live IRIS (APP): puts a marker class carrying aSeArChMaRkEr17token, then asserts (1) unscoped search →SCOPE_REQUIRED+isError, (2) lowercase query withdocuments: ["IrisDevE2E.*.cls"]finds it — the pre-fix code returned 0 results on this exact call, (3)case_sensitive: truewith lowercase correctly misses it. Full e2e suite 9/9 green, CI suites 9/9, clippy-D warningsclean.Stacked on #16 (both touch
search.rs); base will be retargeted tomasterwhen #16 merges.🤖 Generated with Claude Code