Skip to main content

Module package

Module package 

Source
Expand description

.treeship package builder and reader.

A .treeship package is a directory (or tar archive) containing:

  • receipt.json – the canonical Session Receipt
  • merkle.json – standalone Merkle tree data
  • render.json – Explorer render hints
  • artifacts/ – referenced artifact payloads
  • proofs/ – inclusion proofs and zk proofs
  • preview.html – static preview (optional)

Structs§

ApprovalsBundle
Optional approval evidence to embed in the package alongside the receipt + artifacts. None means “no approvals consumed during this session, or none worth exporting.” Empty vectors mean “we looked and found nothing”; the resulting package omits the approvals/ dir entirely so absence is unambiguous.
ApprovalsIndex
approvals/index.json – top-level inventory of evidence in the package. Lets a consumer pre-flight what’s there before opening every file; doubles as a stable shape for downstream tooling.
PackageOutput
Result of building a package.
VerifyCheck
A single verification check result.

Enums§

PackageError
Errors from package operations.
VerifyStatus
Status of a verification check.

Functions§

build_package
Build a .treeship package directory from a composed receipt.
build_package_with_approvals
Like build_package but also embeds approval evidence (PR 4 of v0.9.9). bundle = None is identical to build_package; the approvals/ directory is omitted entirely so absence stays unambiguous.
read_approvals_bundle
Read approval evidence embedded in a package, if any. Returns Ok(ApprovalsBundle::default()) when the package has no approvals/ directory (the typical case for sessions that didn’t consume any scoped approvals). Errors only on malformed JSON inside files that the index claims exist.
read_package
Read and parse a .treeship package from disk.
render_preview_html
Generate a self-contained preview.html that embeds the receipt JSON and runs Merkle verification client-side using Web Crypto API.
verify_package
Verify a .treeship package locally.
verify_package_with_trust
Like verify_package but takes an explicit TrustRootStore so the caller can verify with a constructed-in-memory trust set (tests) or a non-default location (CLI --trust-roots).