Repository navigation
refactor(stack-encrypt,eql-bindings)!: read every plaintext by reference - #1737
Conversation
🦋 Changeset detectedLatest commit: 378bbf0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Mutation testing (cargo-mutants,
|
| caught | missed | unviable | timeout |
|---|---|---|---|
| 25 | 0 | 106 | 0 |
Every mutant in the changed lines was caught by a test.
e7258ac to
b44e96a
Compare
aaa842f to
fc3a506
Compare
…ttle its conflicts The first version of ADR-0014 and #1737 answer #1734 two ways. The ADR inferred each operation's role from its type through a marker parameter. #1737 uses position: `zip` takes a borrowed description as its argument and runs it first, so only the operation written first is handed an owned value. The review of the ADR reports that the inferred form is ambiguous for two readers. This revision adopts #1737's mechanism and settles each point where the two disagreed: - `passthrough` is the only taker, and a borrowed `passthrough` keeps its copy of a value stored in the clear, as ADR-0012 requires; - the named copy adapter is dropped; - whoever is handed an owned value wipes it on every path, which closes a gap in the public operations on `next`; - queries and their checks are readers; - the claim of one copy is scoped to the typed path, and the dynamic interface's count is stated; - `Date`, `Timestamp`, `Decimal`, `sem::Orderable` and `op::Ordered` are removed, and an order index is bounded by Vitamin C's `Orderable`, which does not cover bytes. That is the typed half of #1611. It also records the order in which #1737, the order bound and #1611 land, and defines "reader" and "taker" in CONTEXT.md. Refs #1734, #1737, #1611.
… from bytes Dan confirmed the revision's three choices on 22 November 2026, so the status is `accepted`. - A borrowed `passthrough` keeps its copy. The ADR now says when the copy happens (a whole record run from a borrow, to keep the plaintext) and what removing it would cost: a caller who needs the plaintext afterwards would clone the whole value, its secrets included. - `Owned` mode requires `Zeroize`, as written. - Stack Encrypt no longer derives an order term from bytes. The keyset's term functions take a `Vec<u8>` on `next` only because `sem::Orderable` covers it, and that trait is removed. No ordering operator compares bytes, and a stored row with such a term still opens. This was left open for #1611 and is now decided. Refs #1734, #1737, #1611.
A plaintext with a ciphertext and terms was copied once for each extra output. The operations took the plaintext by value, as vitaminc 0.9 required, so a description handed a borrow cloned it for each operation (`ConsumeSource for Borrowed`), and one handed the value cloned it for every side of a `zip` but the last (`ShareSource for Owned`). Every `Clone` bound on a plaintext followed from those two. vitaminc 0.10 reads by reference, so nothing needs the copy: - A ciphertext walks a borrow through `EncryptRef::lend`. In owned mode it still walks the value, so vitaminc wipes it. - An equality term normalizes a lent value. An order term keys its scheme with vitaminc-ore's `SchemeVisitor`, which holds no plaintext, and then encrypts the value by reference. - `zip` lends the plaintext to its second description, which is always a borrowed one, and then hands the first what it would be handed alone. So several operations over one owned value make no copy. - A data plan is handed its values. Each sealed or indexed field reads its value in place, and each passthrough field's value is moved into the output. `ShareSource` is removed. `ConsumeSource` remains for `passthrough` alone, whose output is the plaintext itself: a borrowed passthrough copies a value that is stored in the clear. A plaintext that is sealed or indexed is bounded by `EncryptRef` where it was bounded by `Clone`. `ValueFrame` and `JsonPlaintext` are no longer `Clone`. No library code used either impl. The stored format is unchanged: the frozen vectors, the stored-row fixtures and the conformance corpus pass as they are. Refs #1734
… and Decimal Stack Encrypt kept its own `value::Date`, `value::Timestamp` and `value::Decimal` because each term took its own copy of the plaintext, so a plaintext had to be `Clone`, and vitaminc's types are not. Every operation now reads its plaintext in place, so the copies have no reason to exist. `stack_encrypt::value` re-exports vitaminc-aead's types instead. vitaminc's types are built from jiff's and rust_decimal's, and exist only with those features. So: - `jiff` and `rust_decimal` are default features of stack-encrypt, and `dynamic` turns both on: a binding is handed every kind of value, and an order term over a date is derived from vitaminc's type. - The type lists in `sem`, `op` and `marker` are gated on the features, so a build with no default features still compiles and tests. - eql-bindings' `stack-encrypt` feature turns both on, because the date, timestamp and numeric families name the types. Its `jiff` and `rust_decimal` features remain as names for `stack-encrypt`. The constructors from integers, the integer accessors and `RangeError` are removed with the types. The stored format is unchanged: the frozen vectors, the stored-row fixtures, the pinned EQL payloads and the Go ledger rows pass as they were. Refs #1734
… handed ADR-0014 decision 4. The public `ciphertext` operation dropped a value whose context was refused without wiping it, because its `S` need not be `Zeroize`. A match term dropped every owned value unwiped. The targets and the derive avoided both with their own wiping forms, but a caller who composed the public operations did not. The bound is a third mode trait, `WipeSource`. `Borrowed` implements it for every plaintext, and `Owned` for a plaintext that is `Zeroize`, so the bound applies in owned mode only and a borrowed `&str` is still sealed. Every operation that seals or indexes is bounded by it, and so are `Index::operation` and `Indexes::operations`. With `ciphertext` wiping, the crate-internal `wiping_ciphertext` and `indexed_beside` go. A typed query hands its value to the index by value, so a query value is `Zeroize`. The JSON operations keep their own guard and `SourceMode`. Two tests count wipes on a type that is not `Clone`: a value with a ciphertext and two terms is wiped once when sealed and once when refused, and each public operation wipes its owned value once on both paths. ADR-0014 is amended to record the bound. Refs #1734
fc3a506 to
620dbe4
Compare
…able ADR-0014 decision 5, item 4 of #1734. `sem::Orderable` named each type's order target, and `op::Ordered` listed the types the ordering operators answer. They disagreed on bytes: an order index on `Vec<u8>` compiled, and no operator answered it, so its term revealed the order of the rows and answered no query. vitaminc-ore's `Orderable` already names each target, covers a reference to each type, and leaves bytes out. Both traits go, and every order index, order term and ordering operator is bounded by vitaminc-ore's trait, re-exported as `stack_encrypt::Orderable`. An order term now makes the value's order encoding first, and then keys its scheme: the value is read once, in place or by a walk that wipes it, and a term whose keyset is not loaded yet keeps only the encoding. The JSON index derives a string leaf's OPE term from the document in place, and a data plan a text field's order term from the frame in place. Each copied the text before. The keyset's term functions no longer take bytes, and their term-level tests of bytes are removed. A data plan can still declare an order index on bytes until #1611 refuses it, so the dynamic path derives that term by naming the `Bytes` target, and the stored rows and the conformance corpus do not change. Refs #1734
620dbe4 to
ab5a96c
Compare
- `compose` sorted a record's output slots into the plan's order. Nothing
reads that order: `shape_record` takes each slot by name, in the plan's
order. The sort is removed, and with it the `==` mutant no test could
catch.
- `Source`'s `Debug` had no test. One now checks that a lent and a given
source both print `Source { .. }`, and nothing they hold.
- `WipeSource::wipe` for `Borrowed` dropped a borrow. Dropping a borrow does
nothing, so replacing the body with `()` was an equivalent mutant. The
body is now empty.
Refs #1734
coderdan
left a comment
There was a problem hiding this comment.
Human pass. LGTM (minor findings).
There was a problem hiding this comment.
🟡 Changes recommended
Owned plaintext lacks a drop guard, allowing panics in borrowed zip or owned matching paths to drop sensitive values without wiping them.
1 open issue
What changed in this PR
Refactors Stack Encrypt, the Rust engine behind the language SDKs, and EQL bindings to read plaintext by reference rather than cloning it. This addresses #1734 while preserving stored formats; dynamic rejection of byte order indexes remains in the stacked #1611.
Changes:
- Reworks borrowed and owned operations to share plaintext reads and wipe owned inputs.
- Replaces local date, timestamp, decimal, and ordering types with Vitamin C’s types and traits.
- Updates EQL adapters, feature wiring, migration guidance, and regression tests.
| File | Description |
|---|---|
| packages/stack-encrypt/tests/ui/plaintext_needs_encrypt.stderr | Records the required borrowed encryption implementation. |
| packages/stack-encrypt/tests/ui/pass/query_only_and_borrowed.rs | Replaces query clone bounds with EncryptRef. |
| packages/stack-encrypt/tests/ui/pass/owned_without_clone.rs | Checks owned operations’ capability and wipe bounds. |
| packages/stack-encrypt/tests/ui/pass/owned_fan_out_without_clone.rs | Adds compile coverage for clone-free fan-out. |
| packages/stack-encrypt/tests/ui/owned_fan_out_needs_clone.stderr | Removes the obsolete clone-error snapshot. |
| packages/stack-encrypt/tests/ui/owned_fan_out_needs_clone.rs | Removes the obsolete fan-out restriction test. |
| packages/stack-encrypt/tests/ui/order_term_of_an_8_bit_integer.stderr | Updates ordering refusal diagnostics. |
| packages/stack-encrypt/tests/ui/order_term_of_an_8_bit_integer.rs | Updates the ordering trait name in comments. |
| packages/stack-encrypt/tests/ui/op_order_on_bytes.stderr | Records compile-time rejection of byte order terms. |
| packages/stack-encrypt/tests/ui/op_inexact_operator_needs_probabilistic.rs | Adapts a custom index to WipeSource. |
| packages/stack-encrypt/tests/ui/field_reference_operator_not_answered.stderr | Updates query-bound diagnostics. |
| packages/stack-encrypt/tests/ui/execution_callback.stderr | Updates private-constructor diagnostics. |
| packages/stack-encrypt/tests/ui/divergent_context_in_target.stderr | Records borrowed-mode zip diagnostics. |
| packages/stack-encrypt/tests/ui/derive_match_on_integer.stderr | Updates derived-target bound diagnostics. |
| packages/stack-encrypt/tests/transcode.rs | Adapts custom targets to EncryptRef. |
| packages/stack-encrypt/tests/term_serde.rs | Uses the re-exported ordering trait. |
| packages/stack-encrypt/tests/term_bytes.rs | Removes unsupported typed byte-order coverage. |
| packages/stack-encrypt/tests/record_lowering.rs | Moves passthrough values through owned composition. |
| packages/stack-encrypt/tests/owned_records.rs | Uses a non-Clone plaintext wipe probe. |
| packages/stack-encrypt/tests/ore_block.rs | Migrates scalar constructors and removes byte-order tests. |
| packages/stack-encrypt/tests/op.rs | Updates custom index wipe bounds. |
| packages/stack-encrypt/tests/index.rs | Adds borrowed encryption bounds to test helpers. |
| packages/stack-encrypt/tests/heap_hygiene.rs | Updates allocation expectations for borrowed JSON. |
| packages/stack-encrypt/tests/derive.rs | Updates the ordering trait import. |
| packages/stack-encrypt/tests/context_conformance.rs | Removes reliance on frame cloning. |
| packages/stack-encrypt/tests/conformance.rs | Borrows record inputs and rebuilds query values. |
| packages/stack-encrypt/tests/combinators.rs | Adds EncryptRef to comparison helpers. |
| packages/stack-encrypt/src/target/transcode.rs | Uses Vitamin C’s ordering bounds. |
| packages/stack-encrypt/src/target/source.rs | Introduces shared source handling and WipeSource. |
| packages/stack-encrypt/src/target/mod.rs | Exports source traits and documents reference reads. |
| packages/stack-encrypt/src/target/conversion.rs | Uses the owned-description constructor. |
| packages/stack-encrypt/src/target/collections.rs | Separates borrowed and owned collection construction. |
| packages/stack-encrypt/src/sem/query.rs | Validates query values through borrowed encodings. |
| packages/stack-encrypt/src/op/mod.rs | Replaces clone and local ordering bounds. |
| packages/stack-encrypt/src/lib.rs | Re-exports EncryptRef and Vitamin C’s Orderable. |
| packages/stack-encrypt/src/json/target.rs | Adapts owned JSON target construction. |
| packages/stack-encrypt/src/json/plaintext.rs | Removes Clone from JSON plaintext. |
| packages/stack-encrypt/src/json/inputs.rs | Calls guarded owned JSON operations directly. |
| packages/stack-encrypt/src/json/derive.rs | Reads documents and string leaves in place. |
| packages/stack-encrypt/src/field_reference.rs | Adapts query inputs to feature-gated scalar types. |
| packages/stack-encrypt/src/dynamic/value_frame.rs | Removes frame cloning. |
| packages/stack-encrypt/src/dynamic/term.rs | Borrows term inputs and preserves interim byte ordering. |
| packages/stack-encrypt/src/dynamic/record.rs | Transfers values into owned plan execution. |
| packages/stack-encrypt/src/dynamic/query.rs | Updates trait references and frame-based tests. |
| packages/stack-encrypt/src/dynamic/planned.rs | Moves passthrough fields without copying. |
| packages/stack-encrypt/fuzz/Cargo.lock | Resolves newly enabled scalar dependencies. |
| packages/stack-encrypt/docs/adr/0014-operations-read-the-plaintext-and-at-most-one-takes-it.md | Records wipe bounds and the interim dynamic byte path. |
| packages/stack-encrypt/CHANGELOG.md | Documents breaking changes and migration steps. |
| packages/stack-encrypt/Cargo.toml | Enables Vitamin C scalar features by default. |
| packages/stack-encrypt-derive/src/lib.rs | Updates the custom-target documentation example. |
| packages/eql/tests/encryption/tests/v4_types.rs | Migrates scalar fixtures and frame reuse. |
| packages/eql/tests/encryption/tests/v4_terms.rs | Rebuilds plaintext instead of cloning it. |
| packages/eql/tests/encryption/tests/v4_range.rs | Uses shared scalar fixture constructors. |
| packages/eql/tests/encryption/tests/v4_owned.rs | Tests clone-free owned and borrowed ciphertext creation. |
| packages/eql/tests/encryption/tests/v4_ore_block.rs | Rebuilds non-Clone ordered values per write. |
| packages/eql/tests/encryption/tests/v4_order.rs | Migrates ordered scalar fixtures. |
| packages/eql/tests/encryption/tests/typed_queries.rs | Removes cloning from typed query fixtures. |
| packages/eql/tests/encryption/tests/record_fields.rs | Removes unnecessary record clone derives. |
| packages/eql/tests/encryption/tests/json_tree_owned.rs | Uses a non-Clone JSON record. |
| packages/eql/tests/encryption/tests/heap_hygiene.rs | Checks matching borrowed and owned JSON allocations. |
| packages/eql/tests/encryption/tests/common/mod.rs | Adds shared Vitamin C scalar constructors. |
| packages/eql/crates/eql-bindings/src/v4/plaintext.rs | Re-exports Vitamin C scalars and OutOfRange. |
| packages/eql/crates/eql-bindings/src/encryption/query.rs | Updates query adapters’ reference and wipe bounds. |
| packages/eql/crates/eql-bindings/src/encryption.rs | Reads ciphertext and equality inputs by reference. |
| packages/eql/crates/eql-bindings/README.md | Updates scalar guidance and frame examples. |
| packages/eql/crates/eql-bindings/CHANGELOG.md | Documents EQL plaintext API migration. |
| packages/eql/crates/eql-bindings/Cargo.toml | Enables scalar features with Stack Encrypt support. |
| packages/eql/Cargo.lock | Updates EQL dependency resolution. |
| conformance/stack-encrypt/values-contract.md | Distinguishes typed rejection from remaining dynamic behavior. |
| Cargo.toml | Enables Vitamin C’s keyed ordering support. |
| Cargo.lock | Records ordering and scalar dependencies. |
Review effort: Balanced
cipherstash-agent
left a comment
There was a problem hiding this comment.
Review attestation
Reviewed 26e8a745 · posted from Claude Code (scheduled routine) · claude-opus-5-5 · effort medium
Sources: code-review · claude-opus-5-5; rust-security agent · claude-opus-5-5; mattpocock-skills:code-review (standards, spec) · claude-opus-5-5
Skills: code-review, rust-security, mattpocock-skills:code-review, review-cross-check, review-post
Findings (10): 1 major, 9 minor — 7 inline, 3 below.
packages/stack-encrypt/src/target/operations.rs:86-88, 1328-1330, 1540-1543(outside diff) minor These docs are stale.:88sayszip"is the one place that asks for [Clone]", but it now bounds onlyCtx: Clone.:1330says sealing "reads the document through one copy", which is wrong for ownedencrypt_into, and for borrowed it copies only before the keyset loads.:1542says only Owned mode takes a value that is notClone, but Borrowed no longer needsCloneeither. Source: code-review · claude-opus-5-5packages/stack-encrypt/docs/adr/0009-operators-select-the-index-and-a-query-term-is-not-the-stored-term.md:602(outside diff) minor This ADR still namesop::Orderedas the ordering bound, and this PR removes it. Add a dated amendment that points to ADR 0014 and vitaminc-ore'sOrderable. Source: mattpocock-skills:code-review (standards) · claude-opus-5-5docs/target-directed-encryption.md:306(outside diff) minor It still reads "Resolved: (1).S: Encrypt + Cloneon the bridge", and decision 2 (:308) still describes term clones. This PR takes option (2), but the "Superseded in part" note at:4does not say so. Source: mattpocock-skills:code-review (standards) · claude-opus-5-5
Each finding was checked against the head commit before posting. Seven findings were refuted and are not posted. One example is the removed bytes order-term unit test: stored_rows_v1.json still pins those term bytes. Open design questions, not posted: jiff/rust_decimal as default features that dynamic and the Go guest now link; the eql-bindings jiff/rust_decimal features kept as aliases; the six duplicated order Term impls in sem/mod.rs; block ORE over bytes on the dynamic path, untested since tests/ore_block.rs lost its bytes tests; and the CONTEXT.md Reader line that says no reader copies the value.
Generated by Claude Code
- An owned value is wiped when a reader panics. `zip` runs its borrowed argument over an owned value before handing the value on, and a match term reads the value it was given. Both now hold the value in a guard that wipes it through `WipeSource` if it is dropped before it is taken. So `zip` is bounded by `WipeSource`, and a data plan's `FieldValues` is `Zeroize`: it clears its fields, which are frames that wipe themselves. Two tests count one wipe after a reader panics. - `Source` derives `OpaqueDebug`, where it had a `Debug` of its own. - The order term functions in `sem` collapse to one per scheme (`ore`, `ope`, `ore_block`), each over an order encoding. The six `Term` impls come from one macro, and `ope_of` and the typed wrappers go. - The doc examples hold plaintext as the crate asks a caller to. The data plan and query examples put each value straight into a frame, where they serialised a `serde_json::Value` into a plain buffer. The derive examples move the value in, where they cloned it, and every example that decrypts text opens it into `Protected<String>`. Refs #1734
… place - A typed query value is wiped when its scope is refused. The three query sites ran the owned value through `under`, which drops a refused value. They use `under_field`, which wipes it, and the JSON query wipes its document through `PlainJson`. The JSON query operands are moved into their terms where they were cloned. - `ore_block_term` takes a reference to a local value: the `'static` bound is gone. - Tests: a query value refused for its scope is wiped once; an owned `indexed` equality term whose by-reference read panics wipes the value once; a date, which is not `Clone`, is sealed with a ciphertext, an equality term, and an order or block ORE term, owned and borrowed, and in a compile test; a borrowed `ore_block_term`; `Zeroize` for `FieldValues`, which the mutants gate found untested. - Docs: `Orderable` says that vitaminc-ore also covers jiff's and rust_decimal's `Copy` types and that nothing wipes them. Three passages in `target/operations.rs` that still described a copy are corrected. ADR 0009 is amended for `op::Ordered`, the design record notes that ADR 0014 replaced its `Clone` bound, and `CONTEXT.md` states the one copy a reader makes. - Changesets: one for this PR's `eql-bindings` changes, and the two pending ones that described Stack Encrypt's own date types now describe Vitamin C's. Refs #1734
|
Replies to the three findings in the body of the agent review (6011019053). All three are fixed in 378bbf0.
From the open questions: |

Summary
Stack Encrypt (
packages/stack-encrypt) is the Rust engine that the CipherStash language SDKs run on. A plaintext is the value before it is encrypted. Until now, one plaintext that fed several outputs was copied for each output, so the plaintext type had to beClone. An example is a field with a ciphertext and a search term. Each copy is one more thing to wipe from memory.This PR does all four items of #1734, as ADR 0014 decides them:
Clone.Date,Timestamp, andDecimalare removed. Callers use Vitamin C's types. Vitamin C is CipherStash's Rust cryptography library.Orderable.sem::Orderableandop::Orderedare removed, so an order index on bytes no longer compiles.The stored format does not change. The frozen vectors, the stored-row fixtures, and the conformance corpus pass unchanged.
Changes
Every operation reads in place (commit
7893c5091)Source: either a borrow of the value, or the value itself. A borrowed description always gets a borrow. An owned description gets the value.ziplends the value. The second description always reads a borrow, and runs first. The first description is handed what it would get alone. So in owned mode the first one takes the value after the other has read it. The outputs stay in written order.ShareSourceis removed.ConsumeSourcestays forpassthroughonly.Encrypt + EncryptRef, where it wasEncrypt + Clone.EncryptRefmeans&T: Encrypt.stack_encrypt::EncryptRefis a new re-export.ValueFrameandJsonPlaintextare no longerClone.Vitamin C's dates, timestamps, and decimals (commit
026a1c20f)stack_encrypt::valuere-exports Vitamin C'sDate,Timestamp,Decimal, andOutOfRange. Stack Encrypt's own types andRangeErrorare removed.jiffandrust_decimalfeatures. Both are on by default, and thedynamicfeature turns both on.eql-bindings: thestack-encryptfeature turns both features on.An owned operation wipes its value (commit
e8b7decc5)ciphertextdropped a value whose context was refused without wiping it. A match term dropped every owned value without wiping it. Both now wipe it.target::WipeSource.Borrowedimplements it for every plaintext.Ownedimplements it for a plaintext that isZeroize. So theZeroizebound applies in owned mode only, and a borrowed&strcan still be sealed.ciphertext,equality,matching, the three order terms,indexed,Index::operation, andIndexes::operationsare bounded byWipeSource, where they were bounded bySourceMode.Zeroize. Every query value this crate andeql-bindingsaccept already is.SourceMode.wiping_ciphertextandindexed_besideare removed, becauseciphertextnow wipes.Order indexes on vitaminc-ore's
Orderable(commitab5a96ce6)sem::Orderableandop::Orderedare removed.stack_encrypt::Orderablere-exports vitaminc-ore's trait, and its table is vitaminc-ore's. It covers the integers of 16 bits and wider,f32,f64,String,&str, and the threevaluetypes. It does not cover bytes, an 8-bit integer, or abool.ore_term,ope_term, andore_block_termno longer take bytes. Their term-level tests of bytes are removed.Bytestarget. So the stored rows and the conformance corpus do not change in this PR.Review fixes (commits
26e8a745f,163b5a044,378bbf061)Source'sDebughas a test, andZeroizefor the data plan's record has a test.zipand the match term hold an owned value in a guard. The guard wipes the value if the read panics.zipis bounded byWipeSourceas a result.sem, and one macro for the six orderTermimpls.SourcederivesOpaqueDebug.Orderable's docs cover jiff's and rust_decimal'sCopytypes. ADR 0009 is amended, and two pending changesets now describe Vitamin C's date types. A new changeset covers this PR'seql-bindingschanges.i8still orders into a wider target, and the compile error recommends it vitaminc#631.Tests
tests/source_mode.rscounts clones on a type that is notClone, and asserts zero.Clone:a_value_with_a_ciphertext_and_two_terms_is_wiped_once: anEncrypted<(EqualityTerm, MatchTerms)>sealed byencrypt_intowipes the value once. A refused context also wipes it once. The borrowed form leaves it with the caller.each_owned_operation_wipes_its_value_once:ciphertext,equality, andmatchingin owned mode each wipe once, when the value is read and when the context is refused.sem::order_terms_before_the_keyset_loads: an order term built before the keyset loads equals the term built after it, for all three schemes. A refusal reads the same before and after.pass/owned_fan_out_without_clone.rsreplaces a test that asserted an ownedzipneedsClone.pass/owned_without_clone.rsnow namesZeroize. Four compile-error snapshots changed because a bound changed. Two of those now show vitaminc-ore's own message for bytes and for an 8-bit integer.heap_hygiene(both crates) passes. Its JSON assertions now expect the same allocations in the borrowed and owned forms.Breaking changes
ziptakes a borrowed description as its second argument, and runs it first.Encryptimpl must addimpl Encrypt for &T.Zeroize. AnIndeximplemented outside this crate changesM: SourceMode<'s, S>toM: WipeSource<'s, S>.ShareSource,Clone for ValueFrame, andClone for JsonPlaintextare removed.Date,Timestamp, andDecimalare Vitamin C's. None isClone. A build withdefault-features = falsemust namejiffandrust_decimal.sem::Orderableandop::Orderedare removed. An order index on bytes does not compile, and the keyset's order term functions no longer take bytes.Both CHANGELOGs have an entry for each change.
One
Clonebound remainsBorrowed
passthrough. Its output is the value itself, so from a borrow it can only copy. The value is stored in the clear, so this is not a copy of a secret. ADR 0014 decision 3 keeps it.Go guest size
Measured with
cargo build --target wasm32-wasip1 --release --locked, againstnextat96e7242fd. The plain build now links jiff and rust_decimal.next--features eql, bytes--features eql, gzip −9mise run wasm:guest:buildpasses, including its check of the module's imports.Verification
All run on
378bbf061, except the guest size. I measured the size on620dbe46f, before the review fixes.cargo nextest run --workspace --all-featuresheap_hygiene, the frozen vectors, the stored-row fixtures, and the conformance corpus.--no-default-features: tests, clippy, and rustdoc-D warnings, doc examples, rustdoc with warnings as errorseql-bindingswithstack-encrypt, withtargets, andeql-encryption-tests--features eql. Release build and import check pass.Not run: mutation testing.
Related
Refs #1734. ADR 0014 (
packages/stack-encrypt/docs/adr/0014-operations-read-the-plaintext-and-at-most-one-takes-it.md). #1611 is stacked on this PR.Review notes
WipeSourceis a new public name. ADR 0014 left the form of the bound to the implementation. I tried a bound onZeroizein both modes first. It refused a borrowed&str. A borrow never needs a wipe. Tell me if you want another name, or the bound written another way.packages/stack-encrypt/src/target/source.rs, thenzipandrunintarget/operations.rs.order_encodingandorder_pendinginsem/mod.rs.order_atindynamic/term.rs. fix(stack-encrypt)!: a data plan refuses an order index on bytes #1611 removes it.