diff --git a/docs/plans/2026-11-14-move-vitaminc-aead-into-the-stack.md b/docs/plans/2026-11-14-move-vitaminc-aead-into-the-stack.md index 35fc346f0..b506093cc 100644 --- a/docs/plans/2026-11-14-move-vitaminc-aead-into-the-stack.md +++ b/docs/plans/2026-11-14-move-vitaminc-aead-into-the-stack.md @@ -36,9 +36,12 @@ define the value types, how each is encoded, and how a value is sealed. ## Summary Three crates move from `cipherstash/vitaminc` into this repository: -`vitaminc-aead`, `vitaminc-aead-frame` and `vitaminc-aead-derive`. They are -published from here. `vitaminc-aead` and `vitaminc-aead-derive` keep their -names. The frame crate is renamed `recipher-frame` in step 2.4. +`vitaminc-aead`, `vitaminc-aead-frame` and `vitaminc-aead-derive`. The frame +crate is renamed `recipher-frame` in step 2.4. `vitaminc-aead` is not +published again under that name: it is renamed `recipher-aead`. They are +published from here with `recipher`, the new name of `stack-encrypt`, and +not before (see "Publishing, with `recipher`"). What becomes of +`vitaminc-aead-derive` is open question 2. vitaminc's two Go packages, `vcffi` and `vcvalue`, move into the Go module in a third stage. @@ -155,13 +158,18 @@ copy of `vitaminc-aead-napi` 0.10.0, and depends only on `vitaminc-aead` and The engine passes AEAD types into all four. So the engine and these four must build against the same `vitaminc-aead`. Two consequences: -- **`vitaminc-aead` and `vitaminc-aead-derive` keep their names.** Under a - new name, Cargo would build two crates with two sets of types, and the - engine's calls into the four would not compile. The frame crate is not - bound this way: none of the four depends on it, and only `stack-encrypt` - and `stack-guest-abi` do, both by path. So it could be renamed without - breaking anything outside this repository, and step 2.4 renames it - `recipher-frame`. +- **`vitaminc-aead` cannot be renamed while the four depend on it.** Under + a new name, Cargo would build two crates with two sets of types, and the + engine's calls into the four would not compile. So before it becomes + `recipher-aead`, each of the four moves here or is released against + `recipher-aead`. The same holds for the other crates on crates.io that + depend on it: the `vitaminc` umbrella crate, `clww-ore` and `ore-rs` + (see the `[patch.crates-io]` table in the root `Cargo.toml`). + + The frame crate is not bound this way: none of the four depends on it, + and only `stack-encrypt` and `stack-guest-abi` do, both by path. So it + could be renamed without breaking anything outside this repository, and + step 2.4 renames it `recipher-frame`. - **A breaking change to `vitaminc-aead` needs new releases of all four**, and then of `clww-ore` and `ore-rs`, which the root `Cargo.toml` pins with `=`. A change that only adds a type, a method or a `Logical` variant does @@ -223,27 +231,40 @@ While the crates are unpublished: - **A release from this repository builds against crates.io's copy.** `cargo publish` drops `[patch]` tables, so a published `stack-encrypt`, `stack-kms` or `stack-auth` depends on crates.io's `vitaminc-aead` 0.10.x, - not on the copy here. A release that needs a change made in the copies - waits until the copies are published (see "Before the next - `stack-encrypt` release"). + not on the copy here. Stage 2 changed the copies, so there is no further + `stack-encrypt` release: the next release is `recipher`, with the renamed + crates (see "Publishing, with `recipher`"). - **The Go and TypeScript SDKs are not affected.** Both build the engine by path from the tree. - **`eql-bindings` can be published until step 2.4.** Its `stack-encrypt` feature is compiled against the `stack-encrypt` on crates.io when it is published. Stage 1 changes no API, so that still compiles. Step 2.4 changes - the API that `eql-bindings` uses, and from then an EQL release waits for a - `stack-encrypt` release. + the API that `eql-bindings` uses, and from then an EQL release with that + feature waits for the first release of `recipher`. - **vitaminc stops changing these three crates as soon as the copy is taken**, or the two copies diverge. The crates stay in vitaminc, unchanged, until everything in this plan is settled, so that the move can be backed out. They are deleted from vitaminc only then. -### Before the next `stack-encrypt` release +### Publishing, with `recipher` -Publish the three crates from this repository, under the same names. That -needs the crates.io owners and trusted publishing moved here. If stage 2 has -made a breaking change by then, the four crates that depend on -`vitaminc-aead` need a release against it first, or must have moved. +Decided on 2 December 2026, in place of publishing the crates under their +vitaminc names: `vitaminc-aead` is not published again. `stack-encrypt` is +renamed `recipher`, and the AEAD crates are published with it, under new +names, and not before. In order: + +1. For each crate on crates.io that depends on `vitaminc-aead` (the four + above, the `vitaminc` umbrella crate, `clww-ore` and `ore-rs`), decide + whether it moves here or is released against `recipher-aead`. The + rename cannot happen before that is done. +2. Rename `vitaminc-aead` to `recipher-aead`, and `stack-encrypt` to + `recipher`. Settle `vitaminc-aead-derive` (open question 2). +3. Publish `recipher` with `recipher-aead`, `recipher-frame`, and the + derive crate or crates that open question 2 leaves. The names are new + on crates.io, so this needs trusted publishing set up for them here. + +Until then, the three crates keep `publish = false` and their +`release = false` entries in `release-plz.toml`. ## Stage 2: consolidate @@ -513,7 +534,7 @@ The work: ### Done -Items 1 to 4 are done, on the branch `refactor/go-frame-codec-in-module`: +Items 1 to 4 are done, in #2003: - The two packages moved, and stay two packages. `vcffi` is now `languages/golang/encrypt/frame`: the codec and the storage profile. @@ -539,10 +560,11 @@ Items 1 to 4 are done, on the branch `refactor/go-frame-codec-in-module`: Two things are still to do: -- Item 5, in vitaminc. +- Item 5, in vitaminc: cipherstash/vitaminc#646 deletes `bindings/go` + (`vcffi`, `vcvalue` and `vcencrypt` with its guest). - The differential fuzzers that compared the Go codec with a Rust guest, in - vitaminc's `vcencrypt`. Those fuzzers could run against - `languages/golang/encrypt/guest`. + vitaminc's `vcencrypt`, are to run against + `languages/golang/encrypt/guest` (#2004). ## What waits on this plan @@ -579,6 +601,20 @@ Pull requests may change the three crates. 1. **What is a frame called?** Resolved in step 2.4: "frame" stays the name of the encoding, and the crate that holds its codec is `recipher-frame`. The owned value is `OwnedFrame`. +2. **What becomes of `vitaminc-aead-derive`?** The current intent is to + remove it, and to move its derives, changed as needed, into + `recipher-derive`. Today there are two derive crates: + - `vitaminc-aead-derive` derives `Encrypt` and `Decrypt` (attribute + `aead`). `vitaminc-aead` depends on it and re-exports the derives. + - `stack-encrypt-derive` derives `EncryptTarget` and `DecryptSource` + (attribute `stash`). + + To decide: + - whether `recipher-derive` is `stack-encrypt-derive` renamed, with the + AEAD derives added, or a new crate; + - whether `recipher-aead` still offers `Encrypt` and `Decrypt`, and so + depends on `recipher-derive`, or whether only `recipher` does; + - what changes in the derives and their `aead` attribute when they move. ## Rules this changes