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;
8mod manifest;
9pub mod paths;
10mod verify;
11
12use crate::replay::manifest::ReplayManifest;
13
14/// Single file to add to the bundle: relative path (POSIX) and contents.
15#[derive(Debug, Clone)]
16pub struct BundleEntry {
17 /// Relative path with POSIX forward slashes (e.g. "files/trace.jsonl").
18 pub path: String,
19 /// File contents.
20 pub data: Vec<u8>,
21}
22
23/// Result of reading a bundle: manifest and all file entries (path -> contents).
24/// Paths are POSIX, relative to bundle root; manifest.json is not in entries.
25#[derive(Debug)]
26pub struct ReadBundle {
27 pub manifest: ReplayManifest,
28 pub entries: Vec<(String, Vec<u8>)>,
29}
30
31pub use io::{read_bundle_tar_gz, write_bundle_tar_gz};
32pub use manifest::build_file_manifest;
33pub use verify::bundle_digest;
34
35#[cfg(test)]
36mod tests;