# Paper 15, pre-registration

Written 24 November 2026, before the first run and before any corpus exists.
Reviewed by an independent audit session before this version. Its design review
killed two cells and one of my stated reasons; both are recorded below as given,
not softened.

Paper 14 was retracted the day before this was written, because its generator and
its checker implemented the same predicate. This document exists so that failure
cannot repeat silently: the outcome categories, the controls and the call forms
are fixed here, before the data.

## Question

When a RAG stack is given a per-user metadata filter, is that filter applied,
accepted and silently discarded, or rejected?

That is the whole question. It is NOT whether these libraries provide tenant
isolation, and section "What this cannot show" is binding.

## Unit of observation

`(wrapper, backend, call path, version)`. Never "library X".

A wrapper is a translator, not a backend. llama-index and langchain are wrappers.
A cell counts only when a wrapper sits over a real backend and the backend is
recorded.

### Excluded from any "honoured" claim, with reasons

- **langchain `InMemoryVectorStore`**: its filter is typed
  `Callable[[Document], bool]`. I write the lambda and it runs in a list
  comprehension. "Honoured" would mean my own function works, which is paper 14
  exactly. Kept only as a demonstration of argument swallowing.
- **llama-index `SimpleVectorStore`**: same reason, same exclusion.
- **qdrant-client local mode**: a separate pure Python implementation under
  `local/`, written for testing. A result there describes that emulator, not
  Qdrant's filtering engine at any deployment level. If it appears at all it is
  labelled an emulator in the cell itself, not only in the limitations.

Real embedded backends available without Docker: **Chroma** and **LanceDB**.
Containerised and hosted services are out of scope, and no library-level result
is presented as evidence about them.

## Controls, all four required per cell

1. **Positive, per query.** The same query through the same object and call path
   with only the filter removed must return B documents in top k. A raw client
   call does not stand in for the wrapper.
2. **Negative.** A filter for an owner with zero documents must return empty.
3. **Dialect recorded.** The exact call is logged verbatim per cell.
4. **Filtered recall, by document ID.** The filtered query must return the A
   documents that the unfiltered query ranked, identified by ID.

Control 4 is the one I did not have. Without it, a filter on a misspelled field,
or on an int where a str was stored, or on a field the store dropped at index
time, returns EMPTY. Empty contains no B document, so it passes controls 1, 2 and
3 simultaneously and scores as honoured. **An empty or short filtered result is
`unknown`, never `honoured`.**

## Judging a leak

By document ID joined to my own ground truth table. **Never** by reading the
owner field back out of the result: a store that drops or rewrites metadata would
score a B document as not-B.

## Outcome categories, fixed now

- `honoured`: controls 1 and 4 both pass, no B document returned
- `silently_ignored`: argument accepted, no error, filter not applied
- `rejected`: raises, which is the safe failure and will be said so
- `unknown`: empty or short filtered result, control 4 fails
- `path_dependent`: differs across call paths on the same backend

## Call forms

Pre-registered from sources I do not control: each library's own documentation
and examples, and the most cited tutorials and issues. The list is fixed in
`call-forms.md` before the first run, and **every** form on it is run. Picking
forms after seeing results would make the outcome table mine.

Paths to cover, because the dialect lives in them: direct similarity search, MMR,
`as_retriever(search_kwargs=...)`, and hybrid where offered.

## Index states

A per query control on a freshly built static index tests only steady state, and
real leaks live in index state. Per document coverage must span:

- documents added after the ANN index was built (LanceDB searches indexed and
  unindexed fragments by different paths)
- a document whose owner was changed from B to A, and the reverse
- a deleted B document

**Per document coverage** is reported: the fraction of B documents that appeared
in at least one unfiltered result. A B document never retrieved unfiltered was
never tested.

## What will NOT be reported

- **Any leak rate.** With a filter ignored, the share of queries that leak is set
  by the A/B ratio, k and topical overlap, all design parameters. Categories per
  cell and per document coverage only. Nothing per query.
- **Any count across libraries** such as "N of 5 leak". The set is hand picked,
  cells are not independent, versions decide outcomes. No prevalence statement.
- **Any severity or exposure figure** built on download counts or tutorial
  prevalence.
- **Query totals as n.** An honoured equality filter is deterministic, so 10,000
  clean queries are one observation per code path.

## What this cannot show

A metadata filter is a predicate the caller supplies. If the application builds
it from request input, or an LLM writes it, which is what self-query retrievers
in both wrappers do, then the attacker influences the filter and honouring it
proves nothing about isolation. **This bench measures whether a supplied
predicate is applied. Tenant isolation is out of scope and no finding here
licenses a claim about it.**

Real text and real embeddings add nothing to validity for an honoured equality
pre-filter, because the outcome cannot depend on them. They are kept because
post-filter top-k behaviour does depend on them, and they are not presented as a
validity control.

A `**kwargs` swallow is a property of the call form, not of the library. The
wording will be "this call path accepts an undocumented argument and discards it
without error", with the path named.

## Corpus

Public, licensed text. Nothing from `sources/primary` or `lab/captures`. Source
recorded in the ledger. Every version pinned and published.
