Skip to main content

Module render

Module render 

Source
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§

ElectionLine
One entry in the MethodElection standing-order history reported by verify.
VerifyReport
Structured FR9 outcome (so tests assert on data, not stdout, and main keys 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).
provenance_label
The §4.12 provenance label for the resolved profile — printed on the full-return output so a reviewer can audit which source produced the figures (p2-provenance-printing).
render_accept_outcome
Render an AcceptOutcome (Task 10 optimize accept): one line per persisted LotSelection (with the appended decision id to pass to reconcile void for revocation, and the §A.5 basis label) and one line per skipped disposal (with the gate reason). A persisted attestation is noted inline on the AttestedRecording rows.
render_advisories
Render the Phase-5 full-return advisories (SPEC §3.4 / §9.2) — the loud, non-gating notes that a favorable credit was omitted conservatively (your tax is OVERSTATED), or that a disclosure is yours to make. Never changes a number and never changes the exit code.
render_consult
Render a ConsultReport (Task 11 / §C.3 Mode-2 read-only pre-trade what-if) for the optimize consult command. Returns a String with:
render_donation_appraisal_advisory
§170(f)(11)(F) year-aggregate appraisal advisory (D2) — render-time only.
render_dual_report
Render the §6 dual report: the absolute filed-return liability (Form 1040, WITH crypto) and the crypto-attribution DELTA are different questions — shown together, labeled, and NEVER reconciled to the dollar (SPEC §6). Only produced for a ReturnInputs-provenance year (a full 1040 exists). delta is the same TaxOutcome the crypto-delta block already showed above. Provenance is printed here (§4.12). ★ The absolute block renders the PRINTED figures — the whole-dollar, cross-footing lines the filed PDF carries — not the exact-cents computation behind them (ARCH-P6 Q3).
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 the optimize run command. 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, mirroring render_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 by render_tax_outcome above.
render_schedule_se
P2-D Task 2 / Chunk B (Schedule SE): render the standalone §1401 SE-tax block for year as an informational block that does NOT feed engine B (TaxResult::total_federal_tax_attributable is UNCHANGED by SE tax).
render_tax_outcome
Task 9 (B.5) + Task 10 (M4): render the TaxOutcome for report --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 to total_federal_tax_attributable.
render_verify
render_whatif_harvest
Render a what-if harvest HarvestReport (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_caveat prints the ad-hoc “MAGI assumed = ordinary income” note.
render_whatif_sell
Render a what-if sell SellReport (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_caveat prints 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 grammar eventref::parse_wallet_id accepts).
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 to snapshot.sqlite by 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 that Writer::from_path + umask would leave).
write_form_csvs
Write the four year-scoped form CSVs for year into out_dir.