Skip to content

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
fix/namespace-default-general-toolsfrom
fix/iris-search-scope-case
Closed

fix(search): send files= scope and explicit case=; refuse unscoped searches; parse v8 result shapes (fixes #17)#25
PYDuquesnoy wants to merge 2 commits into
fix/namespace-default-general-toolsfrom
fix/iris-search-scope-case

Conversation

@PYDuquesnoy

Copy link
Copy Markdown
Contributor

What

Fixes #17iris_search searched nothing: the Atelier query never included the files= scope (/action/search greps only the scoped files; our documents param was declared but never read), and a missing case= param means case-SENSITIVE to Atelier, so even a correctly-scoped default search required byte-exact casing. Two further defects: only the legacy result.content response shape was parsed (v8's result-as-array and nested matches[] were dropped; total_found counted 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 + 66b486f end state, adapted to this fork's conventions:

Verification

New e2e test_search_scope_and_case_insensitive_default against live IRIS (APP): puts a marker class carrying a SeArChMaRkEr17 token, then asserts (1) unscoped search → SCOPE_REQUIRED + isError, (2) lowercase query with documents: ["IrisDevE2E.*.cls"] finds it — the pre-fix code returned 0 results on this exact call, (3) case_sensitive: true with lowercase correctly misses it. Full e2e suite 9/9 green, CI suites 9/9, clippy -D warnings clean.

Stacked on #16 (both touch search.rs); base will be retargeted to master when #16 merges.

🤖 Generated with Claude Code

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant