Skip to content

Commit c5e4c16

Browse files
committed
docs(stack-encrypt): say what a declared type does to a row stored as another kind
"No row is re-encrypted" was true only of rows already stored as the declared kind. Before this release an indexed field had no type, so one row could hold 34 as a float and another as an integer under one field; once the field declares uint32 the float row fails to open with PlanError::FieldType, fails any batch that holds it, and its terms do not match a uint32 query. The entry now says so and says to re-encrypt such rows as the declared kind. The leaf-encoding entry's "re-encrypts nothing" is qualified the same way. Addresses PR #1096 review comment 4194355804. Claude-Session: https://claude.ai/code/session_01V3WFXwax4J3uecpFEJ6yHc
1 parent 54df742 commit c5e4c16

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

‎packages/stack-encrypt/CHANGELOG.md‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3434

3535
- **A data plan field with a term output must declare its `"type"`.** A
3636
plan whose indexed field (`"eq"`, `"match"`, `"ore"`, `"ope"`) has no
37-
`"type"` is refused when it is built (`Error::Plan`), by `record::plan`,
37+
`"type"` is refused when it is built (`Error::UntypedIndex`, naming the
38+
field), by `record::plan`,
3839
`record::plan_with` and `Plan::new` / `Plan::new_with` alike: the field's
3940
terms derive from the one declared kind, with every value checked against
4041
it, never from whatever tag each value arrived with. The type stays
@@ -43,7 +44,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4344
fills `"type"` on every field from the Go type, and `record.Plan.Validate`
4445
refuses an indexed `Untyped` field naming it, so generated code is
4546
unaffected; a plan written by hand without types must add them. Declaring
46-
a type changes no stored byte, so no row is re-encrypted.
47+
a type changes no stored byte, so a row stored as the declared kind opens
48+
as before. A row stored as another kind fails to open with
49+
`PlanError::FieldType`, and fails any batch that holds it; its terms do
50+
not match a query of the declared kind either. Re-encrypt such rows as
51+
the declared kind.
4752

4853
- **A target description carries a source mode.** `Encryption` gains a
4954
last type parameter, `M: SourceMode = Borrowed`, saying how it is handed
@@ -88,8 +93,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8893
- **Every data plan field seals the tagged `FfiValue` leaf, whatever its
8994
`"type"`**, as every field did before; the type admits indexes and checks
9095
kinds and changes no bytes, so a row written without a type opens under a
91-
plan that declares one, and a binding that starts sending `"type"`
92-
re-encrypts nothing. A Rust `u32` or `String` field under the same label
96+
plan that declares the kind it was sealed as, and a binding that starts
97+
sending `"type"` re-encrypts nothing stored as that kind. A Rust `u32` or `String` field under the same label
9398
derives the same terms as the data field but a different leaf, and the
9499
two leaves cannot be told apart by inspection (a bare string that begins
95100
with U+000A is a valid tagged string), so the lowering does not choose an

0 commit comments

Comments
 (0)