Skip to content

test(server): scope-isolation suite over HTTP with a read-route coverage gate (#1467, part 2) - #1489

Merged
ajianaz merged 1 commit into
developfrom
test/scope-isolation-http
Oct 16, 2026
Merged

ajianaz merged 1 commit into
developfrom
test/scope-isolation-http

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

What

Part 2 of 3 of the scope-isolation regression gate (#1467); part 1 is #1488.

crates/uteke-server/src/handlers/isolation_tests.rs runs the two-namespace store of part 1 (seed_two_scopes, plus one unrelated memory per scope so /orphans has hits) through route, with uteke-core's test-support feature as a dev-dependency only (a normal build of uteke-server still resolves uteke-core with [onnx,usearch,vecq]).

  • every_scoped_read_route_returns_only_its_own_namespace: 20 scoped read requests per namespace: /recall with each of the five strategies × search_type memory and all, plus pack, explain and a tag filter; /search, /list (with and without a tag), /recent, /export, /graph, /room/memories, /room/recall, /orphans, /tags, /room/list, /stats (GET and POST), /doc/search, /doc/list. Every memory ends in of <namespace>, so a response must hold its own marker (the check is not vacuous where hits are expected) and never the other namespace's marker or project tag, whatever the JSON shape.
  • counts_are_per_namespace and a_foreign_room_asked_for_under_a_scope_yields_nothing.
  • every_read_route_is_covered_or_exempt: every GET or non-writing POST row of the registry must be in surfaces or in EXEMPT with a reason (by-ID and by-slug fetches, room-ID routes, the route table, /health, /mcp, ...), and nothing listed may be stale. A new read route added without an isolation check fails this test (the "new endpoints get added to the suite" criterion).

Why

Part 1 gates the core API; the leak that matters to users is over a transport, where each handler parses its own scope parameter. The HTTP suite catches a handler that drops it.

Testing

  • cargo test -p uteke-server isolation_tests: 4 pass; cargo clippy --workspace --all-targets -D warnings is clean.
  • Mutation checks, then reverted: POST /search ignoring the namespace fails with "scoped to alpha returned beta records"; GET /export ignoring it fails the same way.
  • By-ID fetches (/memory, /provenance, /timeline, /edges) take no namespace, so IDs are global handles; they are listed as exemptions with that reason rather than skipped silently.
  • Parts 3 (MCP and CLI, plus docs/isolation-suite.md) follows. Requiring the Test check in branch protection is a repository setting for the owner.

@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 7afae23 into develop Oct 16, 2026
15 checks passed
@ajianaz
ajianaz deleted the test/scope-isolation-http branch October 16, 2026 04:50
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