Repository navigation
Commit dfb7f57
committed
feat(stack-encrypt)!: derive every order term over its ADR-0002 order key, and order floats
Only text derived its order terms over vitaminc-ore's order key. Integers,
floats and bytes went through cllw-ore's own encodings, and those differ
from ADR-0002 for floats: cllw-ore orders -0.0 below 0.0 and keeps NaN
payloads apart. So nothing answered an ordering on a float, and about 13
EQL v4 ordered types had no order terms the way ADR-0002 defines them.
Every ORE and OPE term now encrypts the value's order key for its
OrderTarget (vitaminc_ore::order), under a key framing that names the key's
frozen domain label, as text's already did. cllw-ore does not implement
vitaminc-ore's OrderScheme yet, so the CLLW schemes encrypt the key: a
fixed-width key as the unsigned integer of its width, a variable-length key
as bytes. Each lands in the ciphertext type cllw-ore gives the source type,
so OreTerm<T> and OpeTerm<T> keep their types. An integer's key is the
bytes cllw-ore already encrypted, so integer and bytes terms move through
the framing alone; float terms move through the key too. Text terms do not
move. None was deployed.
Floats order as Postgres's float8 does: -0.0 ties 0.0 and every NaN is one
value above +Infinity. op::Ordered covers f64, whose Between judges an
inverted range on the keys, and the data path answers the orderings on
float32 and float64 fields. An f32 is ordered as the f64 it widens to: the
data path widens a float32, and a typed OreTerm<f32> is refused with the
new TermError::NarrowFloat rather than give a narrower term.
The query fixture gains a float64 field queried with lt and between, and
the Go generator writes the orderings on float fields: its generated
queries match the fixture byte for byte, and the property tests check
float32 and float64 terms against Postgres's float order.
Closes #1236
Claude-Session: https://claude.ai/code/session_01BZhkvKLpNtKuzj3HCfMXoL1 parent 54a204d commit dfb7f57
30 files changed
Lines changed: 911 additions & 173 deletions
File tree
- languages/golang
- cmd/stashgen
- encrypt
- internal/testusers
- stashgen
- enginetest
- packages/stack-encrypt
- docs/adr
- src
- dynamic
- op
- sem
- tests
- fixtures
- ui
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
49 | 55 | | |
50 | | - | |
51 | | - | |
| 56 | + | |
| 57 | + | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
263 | 268 | | |
264 | 269 | | |
265 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments