Repository navigation
fix(search): default-group searches stay in the default group - #38
Merged
Merged
Conversation
search() turned group_ids=[''] into None, so a search scoped to the default group searched every group. resolve_extracted_edges scopes its duplicate and invalidation candidate searches to [edge.group_id], so a default-group edge (Menhir's default namespace) was compared against, and could expire, edges in other groups. [''] now stays a scope; an empty list still means no filter. Lucene drops an empty group_id:"" clause, so the Neo4j and Relate fulltext builders omit the group clause when '' is in the list and the Cypher group_id IN $group_ids filter scopes it (before, ['', 'x'] narrowed to 'x'). Fork-Label: upstream bug fix Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XS5vAATR9fFfT6MHbTpMap
The fork-contracts job installs no optional drivers, so importing the Relate search ops at module level failed collection. Fork-Label: upstream bug fix Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XS5vAATR9fFfT6MHbTpMap
This was referenced Nov 26, 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.
search()turnedgroup_ids=['']intoNone, so a search scoped to the default group searched every group.resolve_extracted_edgesscopes its duplicate and invalidation candidate searches to[edge.group_id], and nothing filters the candidates by group afterwards. A default-group edge (Menhir's default namespace) was therefore compared against, and could expire, edges in other groups. Upstream has the same line.Change
search/search.py:['']stays a scope. An empty list still means no group filter.search_utils.fulltext_query,_build_neo4j_fulltext_query,_build_relate_fulltext_query: Lucene drops an emptygroup_id:""clause (checked on Neo4j 5.26:group_id:"" AND (Redis)matches every group, andgroup_id:"" OR group_id:"other" AND (Redis)matches onlyother). A list holding''gets no Lucene group clause; every caller's Cyphergroup_id IN $group_idsfilter scopes it.Effect on Menhir
Noneand searches every silo.namespace="default", and clients pinned to it, now search the default silo only, asnamespace_to_group_idsdocuments.group_idmatch no group list. Production holds 8,976 suchRELATES_TOedges, so default-scoped searches and default-group invalidation no longer reach them. They did only because of this bug.Tests
tests/utils/search/test_default_group_scope.py: 8 tests, 4 of which fail before the fix. Added to the compatibility workflow.tests/test_default_group_search_scope_int.py(disposable Neo4j,GRAPHITI_SAVE_TEST_NEO4J_URI): the same fact stored in''and in another group. A['']search returned both edges before the fix and returns only the default edge after it.Fork-Label: upstream bug fix
🤖 Generated with Claude Code
https://claude.ai/code/session_01XS5vAATR9fFfT6MHbTpMap