skip to changelog

canaad changelog

deterministic AAD for AEAD — build it, canonicalize it, get the same bytes everywhere

february 2026

  • feature

    pkg: packages field in meta export

    packages field added to meta export: { npm: '@gnufoo/canaad', crates: 'canaad-core' }. declares registry links per tool package format spec.

  • feature

    pkg: WasmNotInitializedError typed error class

    WasmNotInitializedError — typed error class with kind = 'WasmNotInitializedError' discriminant, exported from @gnufoo/canaad/tool. replaces bare Error throw in execute().

  • improvement

    pkg: named constants for byte limits

    TENANT_MAX_BYTES and RESOURCE_MAX_BYTES constants extracted from magic numbers with provenance comments.

  • improvement

    pkg: TextEncoder hoisted to module level

    TextEncoder hoisted to module level — allocated once instead of per validation call.

  • improvement

    pkg: package.json cleanup

    redundant main field removed from package.json. canaad_wasm.d.ts file-scope eslint-disable documented as known wasm-pack build artifact.

  • improvement

    pkg: tsdoc on all exports

    TSDoc on all exported names: initWasm, isInitialized, toolDefinition, execute, inputSchema, outputSchema, CanaadInput, CanaadOutput, meta.

  • fix

    pkg: byte-length validation for tenant and resource

    tenant and resource validation corrected from character count to byte length via TextEncoder.

  • fix

    pkg: integer ceiling at Number.MAX_SAFE_INTEGER

    timestamp and extension integers capped at Number.MAX_SAFE_INTEGER.

  • improvement

    canaad-cli: errors sections on result-returning functions

    added # Errors sections to all Result-returning functions documenting error conditions.

  • improvement

    canaad-core: test vector split

    split tests/test_vectors.rs (448 lines) into test_vectors/{section_10,negative,edge_cases}.rs by spec section.

  • improvement

    canaad-cli: module split

    split main.rs into args.rs (cli types), commands.rs (handlers), and io.rs (input routing). public cli surface unchanged.

  • improvement

    canaad-cli: exit code contract docs

    crate-level //! now documents exit code contract (0/1/2) and stdin-rejection invariant.

  • improvement

    canaad-core: narrow canonicalize_context visibility

    canonicalize_context and canonicalize_context_string narrowed from pub to pub(crate); neither was re-exported through lib.rs.

  • improvement

    canaad-core: validate() documented as semantic alias

    validate() documented as a semantic alias for parse() — same validation, use validate when you only care whether input is valid.

  • fix

    canaad-core: reserved key error fix in with_extension

    with_extension now returns ReservedKeyAsExtension when passed a reserved key (v, tenant, resource, purpose, ts). previously returned InvalidExtensionKeyFormat because is_reserved() was never reached.

  • fix

    canaad-core: safe integer cast on 32-bit targets

    SafeInt::try_from: replaced bare usize as u64 cast with u64::try_from for correctness on 32-bit targets.

  • fix

    canaad-wasm: MAX_SAFE_INTEGER enforcement at boundary

    enforce MAX_SAFE_INTEGER upper bound at the WASM boundary for integer inputs.

  • fix

    pkg: zod schema integer range alignment

    Zod schemas aligned with spec constraints for integer range validation.

  • improvement

    canaad-core: submodule split

    split types.rs, context.rs, and parse.rs into submodules. public api unchanged.

  • improvement

    canaad-core: single-pass duplicate key detection

    duplicate-key detection replaced with a single-pass serde_json visitor; previous implementation allocated a Vec<char> and traversed the input twice.

  • improvement

    canaad-core: ParsedAad visibility narrowed

    ParsedAad narrowed to pub(crate); was not part of the public api.

  • improvement

    canaad-wasm: remove unused js-sys dependency

    removed unused js-sys dependency.

  • feature

    canaad-cli: integration test suite

    23 integration tests covering all subcommands, output formats, input modes, and exit code contract.

  • breaking

    canaad-core: breaking builder error surface

    AadContextBuilder::extension_string() and extension_int() now surface validation errors through build() instead of silently dropping invalid values.

  • breaking

    canaad-wasm: breaking timestamp and extensionInt validation

    AadBuilder::timestamp() and extensionInt() no longer silently cast f64 to u64. build()/buildString() now reject NaN, Infinity, negative, and non-integer values.

  • improvement

    architecture docs: section 9

    added Section 9 "Integration at Decryption Boundaries" to architecture docs.

  • feature

    initial release

    canaad-core: aad parsing, validation, and canonicalization per rfc 8785 (jcs). duplicate key detection via serde_json visitor. AadContext with builder pattern. constants: CURRENT_VERSION, MAX_AAD_SIZE, MAX_SAFE_INTEGER, RESERVED_KEYS. functions: canonicalize, canonicalize_string, parse, validate.

  • feature

    canaad-cli initial

    subcommands: canonicalize, validate, hash. output formats: utf8, hex, base64, raw. input: argument, file (-f), or stdin. exit codes: 0 success, 1 validation error, 2 i/o error.

  • feature

    canaad-wasm initial

    functions: canonicalize, canonicalizeString, validate, hash. AadBuilder class with fluent api. constants: SPEC_VERSION, MAX_SAFE_INTEGER, MAX_SERIALIZED_BYTES.