Skip to main content
[PARTIAL]. Real, tested code (packages/receipt), reachable only through examples/tutorials/53 through 56. Not wired into the server or the main trust record pipeline.
Nothing in packages/runtime or packages/api imports @parmana/receipt. The Receipt that actually reaches an ExecutionTrustRecord and POST /receipt is packages/shared/src/domain/receipt.ts’s Receipt, built by @parmana/crypto’s ReceiptCrypto inside packages/runtime/src/services/receipt-service.ts. This package defines its own, separate Receipt interface (ReceiptEngine.ts) and a separate ExecutionReceipt/ExecutionPermit model (see @parmana/execution-control), neither is the same type as the one used in the rest of this site, and neither is reachable from a running packages/api server.

Purpose

Builds and verifies an ExecutionReceipt: a bundle of an ExecutionPermit (from @parmana/execution-control) plus an ExecutionTrustRecord. Exercised end to end by examples/tutorials/53-execution-permit/ through 56-complete-execution-flow/.

Install

npm install @parmana/receipt

Key exports

ExportStability
ExecutionReceiptBuilder[PARTIAL]. .build(permit: ExecutionPermit, trustRecord: ExecutionTrustRecord): ExecutionReceipt. Real, tested, unconsumed elsewhere.
ExecutionReceiptVerifier[PARTIAL]. .verify(receipt): boolean, checks version === 1 and that permit/trustRecord are both present. Not a cryptographic check, it does not re-verify the permit’s signature or the trust record’s hash itself.
ExecutionReceipt (model){ version, permit, trustRecord }
ReceiptEngine / ReceiptBuilder[PARTIAL]. A third, separate Receipt shape ({ receiptId, businessTransactionId, trustRecordHash, verificationId, status, issuedAt, receiptHash }), also unconsumed anywhere in this monorepo outside its own tests.

Minimal example

import { ExecutionReceiptBuilder, ExecutionReceiptVerifier } from "@parmana/receipt";

const receipt = new ExecutionReceiptBuilder().build(permit, trustRecord);
const structurallyValid = new ExecutionReceiptVerifier().verify(receipt); // true
Full runnable version: examples/tutorials/56-complete-execution-flow/run.ts.

Next

@parmana/execution-control

Where ExecutionPermit, this package’s other input, comes from.

Execution trust records

The Receipt type this package’s own model is not the same as.