You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 936f345
Browse filesBrowse the repository at this point in the historyBrowse files
fix(stack-encrypt): address the review of match verify
- `Supports::query` takes the sealed `QueryToken` (from the #1190 fix),
so no caller can pair a needle with another value's filter and have
`verify` drop the real rows. `Needle`'s doc says how one is joined.
- `TermFor`'s doc and ADR-0009 say the "only a probabilistic term answers
`Matches`" rule binds this crate's terms; a term in another crate can
opt in by hand.
- The tokenizer zeroizes its own copies of the text: the folded string,
its characters, and each n-gram, built at its final size so it does not
reallocate. `verify` runs it on every decrypted row.
- `MatchQuery`'s `PartialEq` says two needles can share a filter and still
verify differently.
- ADR-0009 decision 4's code shows the trait as this PR ships it;
`target_limit` joins it with #1184.
- Tests: `verify` is a token test, not a substring test ("abcd" verifies
"abc bcd"), and the standard tokenizer verifies whole words in any
order.
Claude-Session: https://claude.ai/code/session_01VYKAWbd361xDLmqBdLoUcB
Copy file name to clipboardExpand all lines: packages/stack-encrypt/docs/adr/0009-operators-select-the-index-and-a-query-term-is-not-the-stored-term.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -168,8 +168,10 @@ ciphertext; its `Term` is left and right. A Bloom index's
168
168
169
169
The bound tightens per operator, through `TermFor<Op>`: any `QueryTerm`
170
170
answers `Eq`, but only a `Probabilistic` one answers `Matches`, and only a
171
-
`Ranked` one will answer `Nearest`. An index cannot claim an inexact
172
-
operator without saying how its answer is checked.
171
+
`Ranked` one will answer `Nearest`. None of this crate's indexes can claim
172
+
an inexact operator without saying how its answer is checked. The rule binds
173
+
this crate's terms through blanket impls; a term in another crate can opt
174
+
into `TermFor` by hand, so there it is a guide rather than a proof.
173
175
174
176
`carry` takes what the query term keeps of the value before the value is
175
177
consumed: nothing for an exact term, the query's tokens for a match query,
0 commit comments