Skip to main content

Crate yah_mesofact_bundle

Crate yah_mesofact_bundle 

Source
Expand description

The W272 mesofact bundle format — the content-addressed unit a mesofact app distributes as, plus (behind the store feature) the R2 blob store that publishes and materializes it.

A bundle is one immutable, content-addressed directory shape:

<bundle>/
  manifest.toml                     # identity + runtime selection
  app/                              # routes/config + built TS/assets
  bins/<triple>/serve               # ONLY when runtime = "self"
# manifest.toml
schema_version = 1
name    = "yah-marketing"
runtime = "mesofact/0.8.18"   # vanilla: resolve stock runtime from node cache
# runtime = "self"            # custom: bins/<triple>/serve ships in the bundle

[content]
"app/mesofact.routes.ts" = "b3f1…"   # path → blake3, one row per file

There is exactly one format; “vanilla” is the degenerate case where runtime = "mesofact/<ver>" and no bins/ are carried. Immutability is the whole coherence story: any change produces a new BundleManifest::digest, “update” is publish-new-digest + drain-old, and rollback is a pointer flip.

This crate is deliberately light: the default feature set is serde + blake3

  • toml only, so the mesofact-build subcamp (R599-F2, a separate Cargo workspace) can link it to emit manifests without dragging the object-store / reqwest stack across the boundary. The store feature adds that surface for the cloud publish path (R599) and kamaji node materialize (R599-F4).

Home of R599-F1 (the W272 bundle format + store) — the canonical @yah: ticket annotation lives in oss/yubaba/crates/cloud/src/release_manifest.rs to keep one block per ID; see W272 for the design.

Structs§

BundleHash
A BLAKE3 content hash: exactly 64 lowercase ASCII hex digits.
BundleManifest
The parsed manifest.toml at a bundle’s root — the bundle’s identity plus the per-file content map that makes it content-addressed.

Enums§

BundleError
Error surface for parsing / hashing a bundle manifest. The store feature adds I/O + object-store variants (see store.rs).
BundleRuntime
Which runtime serves a bundle — the runtime = "..." manifest field.

Constants§

SCHEMA_VERSION
Bundle-manifest schema version. Bumping this is a wire-format change: the materialize side rejects a manifest whose schema_version it does not know.

Functions§

assemble_bundle
Assemble a bundle tree at dest from files, returning the BundleManifest.
assemble_self_bundle
Assemble a self-contained (runtime = "self") bundle: the vanilla tree plus bins/<triple>/serve, so the node serves it with the binary the bundle carries and resolves no runtime asset at all.
assemble_vanilla_bundle
Assemble a vanilla bundle from a finished mesofact build: app/ holds the routes file plus the built dist/ tree, no bins/, and runtime = "mesofact/<runtime_version>" so the node resolves the stock serve runtime.
blob_key
Object-store key for a content blob: blobs/<blake3>. Every file across every bundle dedupes on this key — two bundles sharing a byte-identical file share the one blob.
collect_dir
Recursively enumerate the regular files under dir, mapping each to a bundle path "<prefix>/<relative-path>". Results are sorted for determinism.
manifest_key
Object-store key for a bundle manifest: manifests/<digest>. Immutable — the digest is derived from the manifest, so re-publishing an identical bundle writes the same key with the same bytes.

Type Aliases§

BundleFile
One file destined for a bundle: (path within the bundle, source on disk). The bundle path is always relative and forward-slashed, e.g. "app/dist/index.html" or "bins/x86_64-unknown-linux-musl/serve".