quarantine Candidates
The propositions in contextId that could be affected by a schema change, restricted to those mentioning at least one type in mentionTypes.
Three requirements, all of them load-bearing:
Bounded. Return at most limit propositions. A backend must push the bound into its query, so a sweep of a large context costs one page at a time.
Scoped. Return only propositions whose
contextIdis contextId. A schema mis-declared in one context must never be able to reach another context's data, so this parameter is required and there is no whole-graph form.Mention-type aware. Return only propositions carrying at least one entity mention whose type is in mentionTypes. A backend must push this filter down too. Reading a context whole and filtering afterwards gives the same answer at a cost that grows with the size of the context, when what it should grow with is the size of the change.
Order by Proposition.id ascending, and start after afterId when it is given. A stable total order is what makes afterId a usable cursor: a sweep pages by passing back the last id it saw, and quarantining a proposition changes its status without moving it in this order, so no page is skipped and none repeats.
An empty mentionTypes returns nothing. A change that could affect no mention type has no candidates, and reading the context to discover that would be pure waste.
Already-quarantined propositions are included when they match. Skipping them here would hide them from DriftQuarantinePolicy.evaluate, which reports them in their own bucket so a sweep's conforming count stays honest.
Return
At most limit candidates, by ascending id. Empty when the page is past the end.
Parameters
The context to sweep. Required.
Entity type names a candidate must mention at least one of. Ordinarily DriftQuarantinePolicy.candidateMentionTypes of the diff being swept.
The most propositions to return. Must be positive.
Return only propositions whose id sorts after this one. null starts at the beginning.
Throws
if limit is not positive.
The same read from the beginning.
A real overload with a body, because Java can't see a Kotlin default argument.
Return
At most limit candidates, by ascending id.
Parameters
The context to sweep.
Entity type names a candidate must mention at least one of.
The most propositions to return. Must be positive.