assay_core/replay/bundle/mod.rs
1//! Replay bundle container writer (E9).
2//!
3//! Writes a hermetic .tar.gz with canonical layout: manifest.json, then
4//! files under files/, outputs/, cassettes/ in deterministic order.
5//! No user-facing CLI here (E9c); this is the core library for bundle creation.
6
7mod io;
8pub(crate) mod limits;
9mod manifest;
10pub mod paths;
11mod verify;
12
13use crate::replay::manifest::ReplayManifest;
14
15/// Single file to add to the bundle: relative path (POSIX) and contents.
16#[derive(Debug, Clone)]
17pub struct BundleEntry {
18 /// Relative path with POSIX forward slashes (e.g. "files/trace.jsonl").
19 pub path: String,
20 /// File contents.
21 pub data: Vec<u8>,
22}
23
24/// Result of reading a bundle: manifest and all file entries (path -> contents).
25/// Paths are POSIX, relative to bundle root; manifest.json is not in entries.
26#[derive(Debug)]
27pub struct ReadBundle {
28 pub manifest: ReplayManifest,
29 pub entries: Vec<(String, Vec<u8>)>,
30}
31
32pub use io::{read_bundle_tar_gz, read_bundle_tar_gz_with_limits, write_bundle_tar_gz};
33pub use limits::{ReplayContractError, ReplayIngestError, ReplayLimits};
34pub use manifest::build_file_manifest;
35pub use verify::bundle_digest;
36
37#[cfg(test)]
38mod tests;