Skip to content

TypeScript SDK: add fuzzing, mutation testing and the CRAP gate once the API settles, not with the first pull requests #1824

Todo

Description

@coderdan

Background

@cipherstash/recipher is the TypeScript SDK on the Stack Encrypt engine. Its Rust half is a Node addon and a value bridge, recipher-value-napi. Both are in languages/typescript/packages/recipher-js, with a TypeScript layer over them. The SDK is being built as a stack of pull requests, which the plan in #1747 describes.

Every pull request in that stack runs these checks, through tests-recipher-js.yml and the repository's JavaScript tests:

  • cargo fmt --check;
  • clippy with warnings denied;
  • the Rust tests;
  • the Node test suites, including the value conformance cases.

These checks are what let the stack move with confidence.

The slower quality gates are fuzzing, mutation testing (cargo-mutants), the CRAP gate (a check that complex code is well tested), and the unused-dependency check. We learned on the Rust SDK and the Go SDK that adding these early slowed the work down. While the API is still changing, each change means rewriting fuzz targets and writing tests to kill mutants in code that is about to change again.

Problem

Both the plan (its "Rust quality gates" bullet under Tests) and #1797 say the two crates get these gates. Neither says when.

  • If the gates land with the early pull requests, they slow every one of them.
  • If nobody schedules them, the SDK reaches users without them.

That matters because the value bridge is where every plaintext crosses between JavaScript and Rust, and it parses dates, timestamps, decimals and UUIDs from caller-supplied text.

Proposal

  1. Now: every pull request in the stack runs the checks above, and nothing slower. A pull request that the checks skip, for example because its base branch has no merge ref, gets them running again before it merges.

  2. Later: once the core API stops changing between pull requests, add the slower gates. They must be in place before the SDK is available to users. The list is recipher-value-napi lost its mutation, CRAP and dependency checks in the move from vitaminc, and Biome skips it — restore them and add fuzzing #1797's:

    • mutation testing on the two crates, with --in-diff;
    • the CRAP gate, with an allow list for functions that need a live JavaScript engine;
    • fuzz targets for the text parsers and the JSON conversion;
    • the unused-dependency check.

    Also decide whether the TypeScript layer gets mutation testing.

  3. Any time: cheap checks can go in when convenient, because they don't slow the work. One example is bringing the copied JavaScript under Biome.

  4. Update the plan's Tests section to say that the slower gates come later, and point to this issue.

Done when

  • The gates in step 2 run on every pull request that touches recipher-js.
  • The plan says when they were added.

Relationship to other work

Activity

  1. added
    enhancement
    JavaScript
    on Nov 25, 2026
  2. self-assigned this
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

JavaScriptSDKenhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions