Repository navigation
Commit 93c9039
authored
feat(stack-encrypt)!: a data plan field with a term output declares its type
Closes #1082 (CIP-4326). A data plan field with any term output (eq,
match, ore, ope) and no "type" is now refused when the plan is built, with
Error::Plan, by record::plan, plan_with and Plan::new / new_with alike: an
indexed field's terms derive from the one declared kind, and every value is
checked against it on the way in and on the way out, so the engine never
trusts a binding to have tagged each value the same way. Before this a 34
sent once as a Float64 and once as an Int64 under one "ore" field was
accepted both times and stored two terms. That gap was kept open only
until the Go side filled the type; the Go SDK (#1094) fills it on every
field from the Go kind, so nothing a binding sends today is refused.
The type stays optional where no term derives from the field: a field whose
only output is "c" or "passthrough", and a target field, whose kind is the
EQL type's own (#1095). Declaring a type changes no stored byte (#1093), so
no row is re-encrypted. The IndexSpec: Index<Value> dispatch is unchanged:
the value still carries its tag, now always checked against a declaration
before the term is derived. The "transitional" wording goes from the
dynamic module, kind and record docs and from the plan document.
Tests: refused at build for every index kind, alone and beside a
ciphertext, spelled as a key and as the match object form, by the parser
and by hand; a sealed-only and a passthrough field still build, seal and
open without a type. Every test that indexed an untyped field now declares
the type; the one that fed a float to an untyped equality field now shows
there is no such field to feed, since float64 is refused at build and an
integer kind refuses the float value. The guest's native tests and
plan_check cover the refusal; the check_record fuzz generator emits a
"type" entry so indexed plans still parse under fuzzing.
Claude-Session: https://claude.ai/code/session_01V3WFXwax4J3uecpFEJ6yHc1 parent 3eb459b commit 93c9039
7 files changed
Lines changed: 209 additions & 72 deletions
File tree
- docs/plans
- languages/golang/encrypt/guest/tests
- packages/stack-encrypt
- fuzz/fuzz_targets
- src/dynamic
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1122 | 1122 | | |
1123 | 1123 | | |
1124 | 1124 | | |
1125 | | - | |
1126 | | - | |
1127 | | - | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1128 | 1129 | | |
1129 | 1130 | | |
1130 | 1131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| 174 | + | |
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
| |||
1296 | 1298 | | |
1297 | 1299 | | |
1298 | 1300 | | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
1299 | 1312 | | |
1300 | 1313 | | |
1301 | 1314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
35 | 48 | | |
36 | 49 | | |
37 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
169 | 172 | | |
170 | 173 | | |
171 | 174 | | |
172 | 175 | | |
173 | 176 | | |
174 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
175 | 204 | | |
176 | 205 | | |
177 | 206 | | |
| |||
189 | 218 | | |
190 | 219 | | |
191 | 220 | | |
| 221 | + | |
192 | 222 | | |
193 | 223 | | |
194 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
0 commit comments