Expand description
Single profile-source resolver (full-return v1, SPEC §4.12 / G4).
Every consumer (report, TUI, optimize, what-if defaults, export) must resolve the tax profile
through ONE function so the app never shows two different liabilities for one year (the cardinal sin).
Precedence (SPEC §4.12): ReturnInputs (full return) → stored TaxProfile (raw override) →
pseudo-reconcile placeholder → missing.
P2 (task 5): the ReturnInputs arm now DERIVES the frozen TaxProfile via
btctax_core::tax::derive_tax_profile, gated fail-closed by the screen_inputs refuse-guard:
an input-screenable refusal — or a year without full-return tables (v1 = TY2024) — yields
profile: None rather than a wrong number, carrying the Refusal so the caller can surface it.
Structs§
- Resolved
- The resolved profile + its provenance (+ any refusal).
profileisNoneforProvenance::Missing, and forProvenance::ReturnInputswhen the inputs were refused by the fail-closed guard or the year lacks full-return tables —refusaldistinguishes those two.
Enums§
- Profile
Outcome - The result of resolving AND screening a year’s profile for a COMPUTING consumer (report / optimize /
what-if / export). Unlike
resolve_profile(which screens only the input-screenable rows), this also runs the compute-dependent refuse-guard (screen_compute_dependent) that needs the ledgerstate. - Provenance
- Which source produced the resolved profile (printed on every output so a reviewer can audit — G4).
Functions§
- placeholder_
tax_ profile - The pseudo-reconcile PLACEHOLDER profile: Single, $0 income / MAGI / qualified-dividends / carryforward.
Injected (never persisted) only when the mode is on and nothing else resolves; clears
TaxProfileMissingONLY (it is applied after the projection, so it can never clear a Hard gate). - resolve_
and_ screen - Resolve
year’s profile through the single resolver AND apply BOTH refuse-guards (input-screenable + compute-dependent) fail-closed — the one entry point every computing consumer should use so the app never shows two different liabilities, or a wrong number, for one year (SPEC §4.12 / §4.10 / G4). - resolve_
profile - Resolve the tax profile for
yearin SPEC §4.12 precedence order (ReturnInputs → stored → pseudo → missing), screening only the input-screenable refuse rows. A COMPUTING consumer that has the ledgerstateshould useresolve_and_screeninstead — it shares this exact ladder (resolve_core) and additionally runs the compute-dependent refuse-guard.full_return/tax_tableareNonefor a year v1 doesn’t support (fails the ReturnInputs arm closed).