Skip to content

stack-encrypt refactor: finalize crate ownership, naming and coordinated migration #1489

Open

Description

@coderdan

Background

Stack Encrypt (packages/stack-encrypt) is the Rust engine that every CipherStash language SDK runs on. It is published on crates.io. Vitamin C is our separate library of cryptographic primitives, formats, and encodings.

The Stack Encrypt API plan, merged in pull request #1365, ran a naming review on 8 November 2026. Every public name it covered is now decided. The packaging document proposes a crate for each trait and format. That proposal is not yet approved.

Problem

The names in code on next are still the old ones. The renames are breaking changes, so they should land together, once, before the stable release. The crate boundaries are still open, and moving a crate after release is harder.

Proposal

Part 1: apply the naming review

The plan's names table lists each decision. In short:

  • StackCipher becomes Cipher, and KeysetCipher becomes Keyset.
  • In Go, Client becomes Cipher, with NewCipher, and the keyset-bound Cipher becomes Keyset. Generated _stash.go files must be generated again once.
  • OpSpec becomes Op.
  • #[stash(context = "..")] becomes scope = "..", Plan::context(..) becomes Plan::scope(..), and Go's context= tag becomes scope=.
  • The marker trait op::QueryTerm becomes Query, and LabelledTarget becomes Stored. The dynamic::QueryTerm struct keeps its name.
  • The ZeroKMS unit of work Request becomes crate-private. A binding sends a serialised Plan or Planned instead.
  • ContextExtension is removed. EncryptionPlan is never added.

CipherScope, dynamic::Scope, Label, and IntoLabel are removed as part of #1488.

None of these changes the stored format.

Part 2: decide the packaging

These questions are still open:

Acceptance

  • No old name remains in the public Rust or Go API.
  • The examples in the plan's Target state compile under the new names.
  • The packaging document's glossary matches the code.
  • Each Part 2 question has a recorded decision.
  • The dependency graph between Stack Encrypt, EQL, and Vitamin C has no cycle.
  • Builds without HTTP and for WASM still work. SQL and engine interoperability are unchanged.
  • Rust, EQL, and binding consumers are updated in a coordinated release, and conformance and artifact exchange pass again.

Relationship to other work

Plans: the Stack Encrypt API plan and the conformance roadmap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions