Skip to content

Pin the bytes of every stored and wire format of a value before vitaminc's AEAD crates move #1832

Done

Description

@coderdan

Background

The plan to move vitaminc's AEAD crates into this repository (docs/plans/2026-11-14-move-vitaminc-aead-into-the-stack.md) moves code that encodes and seals every value Stack Encrypt stores. Stage 0 comes first: before any code moves, every stored and wire format of a value has a test that fails when its bytes change.

Problem

Several formats had no test that pins their bytes:

  • The plaintext inside a sealed value. Stored rows are only opened, and stored ciphertexts only cross-opened, because each seal uses a random nonce. Nothing checked the bytes that were sealed.
  • What the JavaScript bridge writes. No TypeScript runner exists for the conformance corpus.
  • A host's typed null, which only one engine unit test covers.
  • Opaque JSON, a document sealed as one value (EQL's json type), through the typed Rust path and through the dynamic path a binding uses.

Without these, a later stage could change stored bytes with every test still passing.

Proposal

  1. List what each existing fixture pins, by type, format and path.
  2. Pin the plaintext of each sealed value for every type the engine takes, through the typed Rust path and the dynamic path, with the deterministic test keys.
  3. Pin the frame the JavaScript bridge writes for each JavaScript value, and record where it differs from the corpus.
  4. Pin what the engine does with a host's typed null.
  5. Pin opaque JSON through both paths. The JSON tree (EQL's JsonSearch) is a different scheme and is already pinned.

Tests pin today's behaviour, including behaviour that later stages change on purpose, so each change shows up as a reviewed diff.

Metadata

Metadata

Assignees

Labels

RustSDKenhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions