| 523 | /// Convert to assembly options. |
| 524 | #[must_use] |
| 525 | pub fn to_assembly_options(&self) -> AssemblyOptions { |
| 526 | // CB-9C: the assembled change must carry the full tracked content — |
| 527 | // the 500 MB opaque-binary corpus exceeds the default 100 MB |
| 528 | // assembly content cap, and an import refusal for a tracked blob is |
| 529 | // exactly the silent-loss class the corpus forbids. The record-side |
| 530 | // file-size policy still governs ordinary local records; assembly |
| 531 | // follows this option's file-size budget when it is set, otherwise |
| 532 | // the default applies. |
| 533 | let assembly = { |
| 534 | let bytes_budget = self.max_file_size.saturating_mul(4).max(1024 * 1024); |
| 535 | AssemblyOptions::new().max_content_size(bytes_budget as usize) |
| 536 | }; |
| 537 | assembly |
| 538 | .include_empty_files(self.record_empty_files) |
| 539 | .globalize_options( |
| 540 | GlobalizeOptions::new() |
| 541 | .with_include_empty_files(self.record_empty_files) |
| 542 | .with_default_encoding(self.default_encoding), |
| 543 | ) |
| 544 | .provenance(self.provenance.clone()) |
| 545 | .metadata_bytes(self.metadata_bytes.clone()) |
| 546 | } |
| 547 | } |
| 548 | |
| 549 | impl Default for RecordOptions { |