ci: gate the cross-language warden-v1 KAT (Rust/FFI/WASM)#7
Merged
Conversation
The condition identity and warden-gate-v1 seal/open must be byte-for-byte identical across every port, or a payload sealed by one and a condition evaluated by another never line up and nothing decrypts. The tests already exist in-tree (core/tests/vectors.rs, ffi/tests/ffi_roundtrip.rs, wasm/test/round_trip.cjs against the core-generated fixture) but nothing ran them in CI — only mobile-ci.yml (native build-check) existed. Add a `kat` workflow: - rust-kat: core identity/canonical KATs + the FFI C-ABI cross-language fixture (`cargo test -p warden-core -p warden-ffi`), plus a drift guard that regenerates wasm/test/fixture.json from warden-core and fails if the committed copy is stale (the silent-drift case the WASM/FFI ports rely on). - wasm-kat: wasm-pack build (nodejs) + node round_trip.cjs, validating WASM against the same fixture and the committed identity. Verified locally (Rust 1.83 + wasm-pack + node): core KAT 2/2, ffi fixture test green, wasm round-trip green, fixture regeneration byte-identical. Closes the warden CI KAT leg of the migration epic (bytesbrains/maktub-app#90). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
warden-v1envelope is implemented in three places that must stay byte-for-byte identical —core/(Rust, reference),ffi/(the C-ABI Dart calls), andwasm/(what the TS SDK calls). If any port drifts, a payload sealed by one and a condition evaluated by another never line up and nothing decrypts. The KAT/round-trip tests already exist in-tree, but the only CI workflow wasmobile-ci.yml(native build-check) — nothing actually ran the cross-language vectors, so drift could land silently.Change summary
New
katworkflow, two jobs:cargo test -p warden-core -p warden-ffi(thecore/tests/vectors.rsidentity/canonical KATs + theffi/tests/ffi_roundtrip.rsC-ABI cross-language fixture), plus a drift guard: regeneratewasm/test/fixture.jsonfromwarden-coreand fail if the committed copy is stale — the exact silent-drift case the WASM and FFI ports validate against.wasm-pack build --target nodejs+node test/round_trip.cjs, validating the WASM port against the same fixture and the committed identity (47fce3a1…06cdb68e).Follows
mobile-ci.ymlconventions: pinneddtolnay/rust-toolchain@1.83.0,Swatinem/rust-cache,--locked, path filters. Prebuiltwasm-pack(no edition2024 tooling build, so the crate compiles under the pinned 1.83).Tests
Verified locally (Rust 1.83 + wasm-pack + node 24):
ffi_matches_the_cross_language_fixture: passwasm/test/round_trip.cjs: ✓ identity, combine, open_gated, seal→open, noise-tolerant combineRisk
CI-only; no library/runtime change. Worst case is a flaky build job, not a shipped regression. The drift guard is deterministic (seeded RNG + canonical serialization), confirmed reproducible.
Backwards-compat
None affected — adds a workflow, touches no crate.
Closes the warden CI KAT leg of the migration epic (
bytesbrains/maktub-app#90).🤖 Generated with Claude Code