Function: sealPreimage()
@kortexya/reasoninglayer / sealPreimage
Function: sealPreimage()
Section titled “Function: sealPreimage()”sealPreimage(
tenantId,scopeId,commitment):string
Defined in: src/utils/audit-headers.ts:219
The exact text a seal signature is computed over.
Parameters
Section titled “Parameters”tenantId
Section titled “tenantId”string
The tenant UUID in canonical lowercase, hyphenated form.
scopeId
Section titled “scopeId”string
The scope UUID in canonical lowercase, hyphenated form.
commitment
Section titled “commitment”string
The scope’s Merkle commitment (64 lowercase hex digits).
Returns
Section titled “Returns”string
The versioned domain tag, tenant UUID, scope UUID and commitment, each followed by a newline. Sign the UTF-8 bytes with Ed25519.
Remarks
Section titled “Remarks”Mirrors seal_preimage in the engine
(crates/domain/src/ports/seal_signature.rs). The tenant is bound
explicitly, so a signature over an empty scope’s commitment cannot be
replayed in another tenant. Send the signature and the public key as
AuditCausalHeaders.sealSignature and
AuditCausalHeaders.sealSigner, both base64.
Example
Section titled “Example”const message = new TextEncoder().encode(sealPreimage(tenantId, scope, commitment));