Skip to content

Commit 05e64b2

Browse files
committed
docs(stack-encrypt): ADR-0009 orders text, with no hedge
Text ordering is decided: the order key is the system ADR-0002's text fold, which vitaminc 0.6 ships in vitaminc-ore, and the ORE and OPE indexes answer the orderings on text over it. The ADR no longer says "if the catalog keeps text ordering" or that the paragraph goes if text ordering is dropped, and decision 7 names text beside the integer types.
1 parent 3a21644 commit 05e64b2

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

‎packages/stack-encrypt/docs/adr/0009-operators-select-the-index-and-a-query-term-is-not-the-stored-term.md‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,7 @@ pub trait Ranked: QueryTerm {
263263

264264
- A term that implements `QueryTerm` only is **exact**. The server's answer
265265
is the answer. HMAC `Eq`, ORE and OPE (`Lt`, `Between`) on numbers, JSON
266-
`AtPath<Eq>`, and ORE and OPE on text if the catalog keeps text ordering
267-
(see "Text ordering" below).
266+
`AtPath<Eq>`, and ORE and OPE on text (see "Text ordering" below).
268267
- A `Probabilistic` term can return **false positives and no false
269268
negatives**. `verify` is the operator's own meaning, run on a decrypted
270269
value: it decides whether a row the server returned is a real match. Bloom
@@ -501,10 +500,11 @@ key tie; that is what the column declared, and an earlier draft of this ADR
501500
was wrong to call it a false positive and put the term under `Probabilistic`.
502501
Its use is ordering and cursor paging on names (`ORDER BY name`, "the page
503502
after Nguyen"), and EQL v4 carries `query_text_ord` and `query_text_ord_ore`
504-
for it. Whether the Rust library produces the term is a catalog question
505-
(`TextOrdOre` is unproducible today, pending the system ADR-0002); nothing
506-
else in this ADR depends on it, and if text ordering is dropped this paragraph
507-
goes with it.
503+
for it. Stack Encrypt produces the term: the order key is vitaminc-ore's
504+
text order encoding, the system ADR-0002's fold pinned to Unicode 16, which
505+
vitaminc 0.6 ships, and the ORE and OPE indexes answer the orderings on text
506+
over it. `TextOrdOre` and `TextSearchOre` also need the block ORE scheme EQL
507+
stores (#1132).
508508

509509
A `Ranked` term's `target_limit` applies the index's configured recall
510510
factor and needs no `Stats`.
@@ -576,8 +576,9 @@ ciphertexts, once block ORE lands), inclusive at both ends, and the client
576576
refuses `lo > hi` (`TermError::InvertedRange`) before either term is
577577
derived; `(v, v)` is one value. One call derives both bounds, under one
578578
context, so a caller cannot pair a bound from one column with a bound from
579-
another. The ordering operators are answered over the integer types
580-
(`op::Ordered`), by the ORE index by default and by OPE through `.via(Ope)`.
579+
another. The ordering operators are answered over the integer types and
580+
text (`op::Ordered`), by the ORE index by default and by OPE through
581+
`.via(Ope)`.
581582

582583
In SQL the term stays one operand. EQL v4 gains a function that takes the
583584
column and the range, and a range query domain beside each ordered query
@@ -696,8 +697,8 @@ JSON column's query already selects it. A similarity index stores its vector
696697
separately, so a `Nearest` query must select the embedding, or the sketch,
697698
as well.
698699

699-
Text ordering, if the catalog keeps it, needs no special case: `Lt` on text
700-
is an exact term over the order key, and what that key folds is the system
700+
Text ordering needs no special case: `Lt` on text is an exact term over the
701+
order key, and what that key folds is the system
701702
ADR-0002's decision (the value model, linked above), which keeps equality off
702703
the order term for the same reason.
703704

@@ -877,8 +878,7 @@ let rows: Vec<UserRow> = sqlx::query_as(
877878
.fetch_all(&pool).await?;
878879
```
879880

880-
`AtPath<Lt>` on a text leaf, if the catalog keeps text ordering, is exact,
881-
as `Lt` on a text column would be: the leaf's order term compares order
881+
`AtPath<Lt>` on a text leaf is exact, as `Lt` on a text column is: the leaf's order term compares order
882882
keys, and there is nothing to verify.
883883

884884
**`Nearest`, ranked.** Stack Similarity has no EQL spelling yet, so this is

0 commit comments

Comments
 (0)