Repository navigation
test(core): scope-isolation suite and shared two-namespace fixture (#1467, part 1) - #1488
Merged
Merged
Conversation
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Oct 16, 2026
Merged
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
Part 1 of 3 of the scope-isolation regression gate (#1467).
uteke_core::test_support(behind the newtest-supportfeature, hidden from docs, never enabled by a release build) now exports the keyword embedder andseed_two_scopes(): two namespaces,alphaandbeta, whose memories share the SAME vocabulary (so every surface has hits in both scopes for one query), two project tags (project:alpha,project:beta) plus a shared tag, one room per namespace and one global document.crates/uteke-core/src/isolation_tests.rs, 7 tests, each non-vacuous (it first asserts the scope has hits):recallandrecall_hybridover all five strategies, tag filters (a foreign project tag matches nothing), unified recall (AllandMemory, all strategies), keywordsearch,list(with and without a tag), tag counts,export,count, scoped room recall and room listing,graph_dataandgraph_view.SearchType::Documentis the global document view (documents have no namespace, fix: unified recall scopes docs to namespace, reports honest scores (#1270) #1271), so it returns documents only and never a memory;AllandMemorynever return a document when scoped.Parts 2 (HTTP) and 3 (MCP and CLI, plus the coverage document) follow.
Why
#1353 showed one shape of scope leak; the class is any retrieval surface returning records outside the requested scope, and new search features keep adding surfaces. The suite makes that a test failure instead of a review finding. The fixture lives in core so the other transports seed the identical store.
Testing
cargo test -p uteke-core: 748 pass, 7 of them new; clippy is clean with and without--features test-support.Uteke::searchignore the namespace failskeyword_search_list_tags_and_export_stay_in_scope("search scoped to alpha returned a beta record"); making scoped room recall ignore the namespace failsroom_surfaces_stay_in_scope.get,provenance,timeline,edges) takes no namespace, so IDs are global handles; that is listed in the coverage document in part 3 as an explicit exemption, not silently skipped.