Skip to main content

Module admin

Module admin 

Source
Expand description

config, export-snapshot (FR10), backup-key — administrative commands. Config surfaces the TP8 (c)/(b) treatment + the pre-2025 lot method; export/backup arrive in Task 15.

Structs§

ExportReport
Outcome of the CLI export_snapshot wrapper: the written snapshot path plus the count of UNRESOLVED Hard blockers (severity() == Hard) in the projection. Any Hard blocker gates EVERY tax year (compute_tax_year short-circuits on the projection-wide first Hard blocker), so unresolved_hard > 0 means every exported Form 8949 / Schedule D / projection CSV is INFORMATIONAL, not final — the ExportSnapshot main.rs arm warns on stderr accordingly. A fully-resolved ledger yields 0 and no warning. Advisory blockers (incl. PseudoReconcileActive, SelfTransferInboundZeroBasis) never count.
IrsPdfReport
Outcome of export_irs_pdf: the written PDF paths, the unresolved-Hard-blocker count (same INFORMATIONAL disclosure as export-snapshot), whether the fill was watermarked (pseudo-active), the count of rows that MIGHT belong on a separate broker-reported 8949 (the [I5] advisory — the separate boxes are year-aware: A/B/D/E from a 1099-B pre-TY2025, G/H/J/K from a 1099-DA from TY2025), and the SP2 packet (Schedule SE + Form 8283 + Form 1040 cap-gains) with the advisories each one drives.

Functions§

backup_key
§8: export the passphrase-protected key (escape hatch; HIGH-security write).
broker_reporting_advisory
The [I5] broker-reporting advisory line, year-aware — or None when no disposition may have been broker-reported (broker_reported_rows == 0).
export_irs_pdf
export-irs-pdf: fill the OFFICIAL IRS PDFs for tax_year and write them (owner-only) to out_dir. The packet is Form 8949 + Schedule D (always applicable) plus — when applicable and selected — Schedule SE (SE income ≥ $400), Form 8283 (donations), and Form 1040 cap-gains (reportable digital-asset activity). The form data is REUSED from the projection (form_8949/schedule_d/form_8283/compute_se_tax) — nothing capital-gains is recomputed; the SE §1401 figure is computed here from the year’s stored TaxProfile. Same pseudo-active attestation gate as export-snapshot: checked FIRST, so a refused export leaves out_dir untouched; a pseudo fill is additionally DRAFT-watermarked.
export_pseudo_active
Probe: would an export be gated? true when the projection is pseudo-active (a synthetic default contributes). Used by the export-snapshot CLI arm to decide whether to PROMPT for the attestation phrase; the authoritative gate lives inside export_snapshot itself. Kept in the library so main.rs stays a thin dispatch (no session-open / projection business logic in the binary).
export_snapshot
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.
promote_export_gate
BG-D8 (Task 14) — the export COMPLETENESS gate. REFUSES the export (writing ZERO bytes: called FIRST in each export fn, before any mkdir_out/file write) when a promoted-basis DISPOSAL leg is filed in the exported range but its Form 8275 disclosure is absent or INCOMPLETE (an empty/scaffold-only Part II). Reg §1.6662-4(f) makes a disclosure adequate only on a COMPLETED Form 8275; a promoted leg filed without one is inadequate disclosure — a HARD refusal, never a warning.
set_config
Persist a new TP8 fee treatment (None = leave unchanged), then return the resulting config.
set_pre2025_method
Persist the pre-2025 lot identification method and attestation flag, then return the resulting config.
show_config