Skip to main content

systemprompt_loader/bundle/
mod.rs

1//! Signed services bundles: packing, fetching, verifying and composing.
2//!
3//! A bundle is a gzipped tar carrying `bundle.json` and a `services/` tree,
4//! published to any HTTPS location or OCI registry and fetched by an instance
5//! at boot. The instance is the verifier: an archive digest pin and an
6//! ed25519 signature decide whether the bytes are trusted, per-file checksums
7//! decide whether the extraction is intact, and the content hash keys the
8//! cache. Nothing here warns and continues.
9//!
10//! # Modules
11//!
12//! - [`pack`] — builds a manifest and archive from a services tree.
13//! - [`source`] — the HTTPS and OCI transports behind
14//!   [`source::BundleFetcher`].
15//! - [`verify`] — the trust chain, in order.
16//! - [`extract`] — hardened tar extraction shared with the backup path.
17//! - [`cache`] — content-addressed on-disk layout and the `current` swap.
18//! - [`provenance`] — the composed, base and per-bundle hashes behind the
19//!   active tree, for projections that record where declarations came from.
20//! - [`mod@compose`] — overlaying several bundles with an ownership check.
21//! - [`bootstrap`] — the boot path and its failure policy.
22//! - [`error`] — [`error::BundleError`] and [`error::VerifyFailure`].
23//!
24//! Copyright (c) systemprompt.io — Business Source License 1.1.
25//! See <https://systemprompt.io> for licensing details.
26
27pub mod bootstrap;
28pub mod cache;
29pub mod compose;
30pub mod degraded;
31pub mod error;
32pub mod extract;
33pub mod pack;
34pub mod provenance;
35pub mod source;
36pub mod verify;
37
38pub use bootstrap::{ServicesSourceBootstrap, cache_root};
39pub use cache::BundleCache;
40pub use compose::{BundleMember, compose, composed_hash};
41pub use degraded::DegradedRecord;
42pub use error::{BundleError, BundleResult, VerifyFailure};
43pub use extract::{BUNDLE_TREE_PREFIX, ExtractOptions, TarLayout, extract_bytes, extract_tarball};
44pub use provenance::{
45    BaseTreeHashMemo, BundleProvenance, SourcesProvenance, owning_bundle_hashes, sources_provenance,
46};
47pub use source::{AnyFetcher, BundleFetcher, FetchedBundle, RemoteRef};
48pub use verify::{verify_bundle, verify_extracted};