Skip to main content

Module node

Module node 

Source
Expand description

Canonical manifest-node encoding — WPMF v1.

A manifest node is addressed by BLAKE3(canonical_node_bytes). There is exactly one byte string per logical node, so the same logical membership always produces the same root hash. Every integer is unsigned big-endian, entries and children are strictly ordered, and decoding rejects duplicates, truncation, trailing bytes, and any non-canonical spelling.

The layouts below are byte-identical to the already-merged downstream consumer (weft PR #1069, docs/PLAN_MANIFEST_FORMAT.md), including the WPMF magic and the weft-plan-manifest-key-v1 routing domain. Byte compatibility with a shipped consumer outranks upstream nomenclature: this module is the normative definition of bytes that already exist, not a second, competing format.

leaf:   "WPMF" | u8(version=1) | u8(tag=0) | u16(count)
               | count  * ( u8(kind) | [u8;32](hash) | u64(decoded_size) )
branch: "WPMF" | u8(version=1) | u8(tag=1) | u8(depth) | u32(bitmap)
               | popcnt * ( [u8;32](child_hash) | u64(object_count)
                                                | u64(decoded_bytes) )

Structs§

ManifestBranch
ManifestChild
A branch’s reference to one child subtree, with the summary that lets a planner size a subtree without descending into it.
ManifestKey
The trie key: (kind, object_hash). Ordering is the canonical plan order — kind first, then the 32 hash bytes lexicographically.
ManifestLeaf
ManifestObject
One immutable content object named by a manifest leaf.
ManifestRoute
The fixed 256-bit route derived from a ManifestKey, read as successive 5-bit groups, most-significant bit first.

Enums§

ManifestDecodeError
Rejected while decoding node bytes. Each variant is a distinct corruption class and maps to a named fsck rule via ManifestDecodeError::fsck_rule.
ManifestNode
ManifestNodeError
Rejected while constructing a node in memory.
ManifestObjectKind
The object types a manifest leaf may name.

Constants§

MANIFEST_BRANCH_WIDTH
Branch fan-out — one bitmap slot per possible 5-bit route group.
MANIFEST_FORMAT_VERSION
The only manifest format version this binary reads or writes.
MANIFEST_LEAF_MAX_ENTRIES
Entries a leaf may hold before it must split into a branch, unless the route is already exhausted.
MANIFEST_NODE_MAGIC
Magic prefix on every canonical manifest node.
MANIFEST_ROUTE_BITS
Routing bits consumed per trie level (32-way branching).
MANIFEST_ROUTE_DOMAIN
Domain separator for the trie route. Hashed with the plan key to derive the 256 routing bits.
MANIFEST_ROUTE_LEVELS
Levels available before the fixed 256-bit route is exhausted (ceil(256 / 5)). A leaf at this depth may exceed MANIFEST_LEAF_MAX_ENTRIES because no routing bits remain to split it.