pub fn export_snapshot(
vault_path: &Path,
pp: &Passphrase,
out_dir: &Path,
tax_year: Option<i32>,
attest: Option<&str>,
) -> Result<ExportReport, CliError>Expand description
FR10 / NFR2 exception: decrypted SQLite image (via the store) + the projected ledger as CSV.
When tax_year is Some(y), the per-tax-year Form 8949 + Schedule D CSVs are also written,
year-scoped to y (P2-B); when None, only the all-years CSVs are written.
Sub-project 3 attestation gate: when the projection is pseudo-active (a synthetic default
contributes), producing any form/data file requires the exact ATTEST_PHRASE in attest
(trimmed, case-sensitive). Checked FIRST — before any bytes are written — so a refused export
leaves out_dir untouched. A fully-real (not-pseudo-active) ledger ignores attest entirely.