Skip to main content

Module tax

Module tax 

Source
Expand description

tax-profile command helpers — set/show the per-year TaxProfile side-table entry. report_tax_year (Task 9) provides the standalone “tax owed / what-if” calculator. report_tax_year also runs the M4 carryforward-consistency advisory (Task 10).

Structs§

TaxYearReport
The full report --tax-year bundle, in print order. A NAMED STRUCT (was a 7-tuple) so a new field can never silently transpose with an existing one at a call site (Fable IMPL-P4 r1 N1, p4-r1-n1).

Functions§

clear_return_inputs
income clear — remove the stored full-return inputs for year (recovery path so a year with ReturnInputs isn’t a dead end while derivation is pending — review I3). Returns whether a row existed.
import_return_inputs
income import — parse a full-return ReturnInputs from a TOML file (offline; key order in the file is irrelevant to deserialization) and persist it in the return_inputs side-table for year.
report_tax_year
Task 9 (B.5) + Task 10 (M4) + P2-D Task 2 + Chunk-1 D2 + Chunk-3a: load events + project once, read the year’s TaxProfile + BundledTaxTables, call compute_tax_year, and assemble the standalone Schedule D / Form 709 / Schedule SE artifacts + the M4 carryforward-consistency advisory + the §170(f)(11)(F) year-aggregate donation appraisal advisory. See TaxYearReport for the returned bundle. The advisory is Some(msg) iff BOTH the current-year and the prior-year profiles exist AND the prior-year computes successfully AND the declared carryforward_in does not match the prior year’s carryforward_out. The advisory and the Schedule SE figure are never hard blockers and do not change the exit code (non-gating).
set_profile
Persist p as the tax profile for year in the vault at vault, then save.
show_profile
Return the stored TaxProfile for year from the vault at vault, or None.
show_return_inputs
income show — the stored ReturnInputs for year as pretty JSON with PII redacted, or None. (JSON, not TOML: serde-toml requires scalar keys before nested tables, which the nested model violates; a TOML round-trip-out is a follow-on. Import accepts TOML.)
write_back_carryover
§4 R3-M6 carryover write-back — persist year year’s computed charitable + QBI-REIT/PTP carryover-OUT as year (year+1)’s carryover-IN in the side-table. Only for a ReturnInputs-provenance full-return year (else there is no absolute return). Errors if the absolute return refuses (screen_absolute) or if a user-entered next-year carryover would be overwritten without force. Returns a human summary.