developers.cogni.build
Who sees whatretrieval & scope
Explorer

One question, two people, different answers — and neither is wrong

A corpus of twelve newsroom documents with real access rules. Pick a question and two people, and watch the same query resolve differently for each. Then move where the scope predicate is applied and watch two specific failures appear.

6

corpus · 12 documents

pipeline ·

Keyword finds exact identifiers a vector misses; vector finds the paraphrase a keyword misses. A system with only one of them fails in a way its own metrics never show.

A

B

The point

Why the predicate goes inside the query

Scope is not a filter over answers. It is part of the question. ScopePolicy#resolve builds a predicate from the principal's grants, and RetrievalService passes it into VectorStorePort#knn. The store never scores a chunk the reader may not see.
Applied afterwards, two things break at once. First, existence leaks: the retriever ranked those documents, so their positions, their count and their scores were all computed — and anything that reports "n results" or preserves rank numbering discloses that something is there. Second, and more quietly, k collapses: you asked for six and got two, because the four slots were spent on documents that were then removed. The candidates that should have filled them ranked lower and were never fetched.
The second failure is the dangerous one, because nothing reports it. Latency is normal, no error is raised, the answer is simply thinner and more confident than it should be. Recall drops for exactly the people with the narrowest permissions — and they are usually the ones least able to tell you the assistant is underperforming.

What that showed

Both answers were correct, and the predicate is what made that true rather than lucky. Filtering after the search produces two failures: one leaks the existence of documents, and the other silently thins the answer for exactly the people with the narrowest permissions — who are least able to tell you it is underperforming.