Skip to main content

Module bundle

Module bundle 

Source
Expand description

bundle 1 (CONTRACT-1.8b H2, docs/bundle-1.md): a namespace’s function descriptors, name bindings and signed receipts as one JSON object, with a manifest signed by the namespace’s host (Ed25519, RFC 8032, over the JCS bytes of the names, the namespace and the receipt hashes). Operator format, not spec: the body of the plan-3.1 write endpoint and of import-signed.

Structs§

Imported
What an import did.

Enums§

BundleError
Why a bundle is refused. The first failing check is reported; nothing is written unless all pass.

Functions§

build
Builds a bundle 1 (see the module documentation): descriptors (each a canonical function descriptor), names ((name, fn_hash)), receipts (each a receipt’s JSON), signed with the key of seed as the manifest of namespace. The names and the receipts are put in ascending order. Errors: Format for a receipt or descriptor that does not parse.
build_with_catalog
As build, with the publisher’s catalogue (CONTRACT-build2-part2-read R5): catalog is a list of entries {"name", "kind", "label", "description", "args", "examples", "dictionary"} (each a JSON object), checked as a publish’s catalogue lines are, and sorted by name into the bundle’s catalog member, which the manifest signs. An empty list makes a bundle without the member. Errors: Format for an entry that breaks its bounds.
build_with_tests
As build_with_catalog, with the bundle’s tests (Build 2 Part 3, E5): tests are the test objects of test lines (each {"test", "call", "asof"?, "inputs"?, "expect"}), sorted by function name then by case id into the bundle’s tests member, which the manifest signs. No tests make a bundle without the member. Errors: Format for a test that is not a test.
import_signed
Imports the bundle bytes for the mesh host, whose own namespaces are owned, at the clock’s now (CONTRACT-1.8b H2). Checks run in the order of the contract, and nothing is written unless they all pass. The writes are, in order: the descriptors; the receipts (each put_receipt), then the versions (each put_version); the name bindings last, so that a crash part-way leaves no name answering. A re-run completes a partial import: a version or a binding already there is skipped.
manifest_bytes
The bytes the manifest signs (CONTRACT-1.8b H2): the JCS object of the names ((name, fn_hash), ascending by name), the namespace and the receipt hashes (ascending).