Expand description
Text rendering of CLI outputs (FR9 verify, FR4 report/show) + FR10 CSV export. Pure string-building over engine data — the CLI displays; the engine computes (NFR4/NFR5).
Structs§
- Election
Line - One entry in the
MethodElectionstanding-order history reported byverify. - Verify
Report - Structured FR9 outcome (so tests assert on data, not stdout, and
mainkeys the exit code).
Constants§
- FORM_
8283_ AGGREGATION_ CAVEAT - The standing Section A/B aggregation note — emitted as the first (comment) line of form8283.csv and reused by any text/advisory path. Reflects the §170(f)(11)(F) year-aggregate implementation: all BTC is “similar property”; the YEAR-total BTC donation deduction determines Section A/B uniformly for all rows. CCA 202302012 confirms the readily-valued exception does not apply to crypto, so a year-aggregate > $5,000 requires a qualified appraisal.
Functions§
- build_
verify - filing_
status_ tag - Stable display tag for
FilingStatus(lowercase, matches the CLI value-enum strings). - render_
accept_ outcome - Render an
AcceptOutcome(Task 10optimize accept): one line per persistedLotSelection(with the appended decision id to pass toreconcile voidfor revocation, and the §A.5 basis label) and one line per skipped disposal (with the gate reason). A persisted attestation is noted inline on theAttestedRecordingrows. - render_
consult - Render a
ConsultReport(Task 11 / §C.3 Mode-2 read-only pre-trade what-if) for theoptimize consultcommand. Returns a String with: - render_
donation_ appraisal_ advisory - §170(f)(11)(F) year-aggregate appraisal advisory (D2) — render-time only.
- render_
file_ reports - FR1/FR2: per-source drop/unclassified counts + the append/duplicate/conflict tally.
- render_
gift_ advisory - P2-C Task 3 (D3): Form 709 gift per-donee advisory (§2503(b) annual exclusion applied independently per donee, not in aggregate).
- render_
optimize_ proposal - Render a
OptimizeProposal(Mode-1 what-if) for theoptimize runcommand. Returns a String containing the proposal header, any approximate banner, the aggregate tax delta, per-disposal rows (with proposed selection + compliance status + persistability), and the R0-M2 caveat footer. - render_
report - FR4 render: holdings (always current) + realized disposals/removals/income (year-filtered).
- render_
schedule_ d - P2-B Task 3: render the RAW pre-netting Schedule D part totals (Part I ST, Part II LT) for
year, mirroringrender_tax_outcome. These are the Form 8949/Schedule D part totals BEFORE §1222/§1211/§1212 netting + carryforward — that netting is applied in the tax computation (report --tax-year), and the netted figures are shown byrender_tax_outcomeabove. - render_
schedule_ se - P2-D Task 2 / Chunk B (Schedule SE): render the standalone §1401 SE-tax block for
yearas an informational block that does NOT feed engine B (TaxResult::total_federal_tax_attributableis UNCHANGED by SE tax). - render_
tax_ outcome - Task 9 (B.5) + Task 10 (M4): render the
TaxOutcomeforreport --tax-year <y>. Exact Decimal Display; no float (NFR5). B-M2 fold: surfaces the ordinary-rate attributable delta so the three printed attributable components visibly reconcile tototal_federal_tax_attributable. - render_
verify - render_
whatif_ harvest - Render a
what-if harvestHarvestReport(task #43). Headlines the MAX BTC to sell (N*), the binding constraint, the realized ST/LT split at N*, which §1(h) bracket the surviving preferential dollars land in, the exact marginal federal tax, and the MANDATORY disclosures — the §1212(b) carryforward delta/burn, the §1411 NIIT kink (a 0%/15% answer can still cost +3.8%), and the plateau note. The answer is engine-verified.magi_caveatprints the ad-hoc “MAGI assumed = ordinary income” note. - render_
whatif_ sell - Render a
what-if sellSellReport(task #43). Headlines the MARGINAL federal tax (the sale’s OWN effect —withhyp − baseline), then the §1(h) bracket + room, the effective rate (or n/a for a loss), the §1212 carryforward disclosure (delta-based — the this-year ordinary offset AND the amount carried, NEVER a hard-coded $3,000), and the §1411 NIIT delta with its sign.magi_caveatprints the ad-hoc-profile “MAGI assumed = ordinary income” note. Read-only; the vault is never touched. - wallet_
label exchange:provider:account|self:label(the same grammareventref::parse_wallet_idaccepts).- write_
csv_ exports - FR10: write the projected ledger as CSV (the NFR2 plaintext exception). One row per disposal/removal
leg (flattened) + one per lot/income record. Exact values (Decimal/i64) as strings (NFR5).
Each CSV is opened via
fsperms::open_owner_only(0o600 on Unix) so decrypted PII matches the hardened permissions already applied tosnapshot.sqliteby the store crate. The out-dir is created owner-only (0o700) if absent; when the dir PRE-EXISTS, open_owner_only still forces 0o600 on each new CSV file (the hole thatWriter::from_path+ umask would leave). - write_
form_ csvs - Write the four year-scoped form CSVs for
yearintoout_dir.