From 68189d1e6e1a926db4eaa2d7843f35174cb75315 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 13 Nov 2026 07:03:35 +0000 Subject: [PATCH] feat(figcraft-format): define document expansion policy --- crates/figcraft-format/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/figcraft-format/src/lib.rs b/crates/figcraft-format/src/lib.rs index a06b39204..8fddd808d 100644 --- a/crates/figcraft-format/src/lib.rs +++ b/crates/figcraft-format/src/lib.rs @@ -365,6 +365,12 @@ mod seek_archive_tests { /// Largest individual ZIP member read by the native format. pub const MAX_MEMBER: u64 = 512 * 1024 * 1024; +/// The document expansion ratio that its compressed size may claim. +pub const DOCUMENT_RATIO: u64 = 16; +#[cfg(not(target_pointer_width = "32"))] +pub const MAX_DOCUMENT: u64 = 4 * 1024 * 1024 * 1024; +#[cfg(target_pointer_width = "32")] +pub const MAX_DOCUMENT: u64 = 1024 * 1024 * 1024; /// Most version snapshots kept on save and read on open. pub const MAX_VERSIONS: usize = 100; /// Maximum version and branch name lengths, in Unicode scalar values.