Skip to main content

Module resolve

Module resolve 

Source
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). profile is None for Provenance::Missing, and for Provenance::ReturnInputs when the inputs were refused by the fail-closed guard or the year lacks full-return tables — refusal distinguishes those two.

Enums§

ProfileOutcome
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 ledger state.
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 TaxProfileMissing ONLY (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 year in SPEC §4.12 precedence order (ReturnInputs → stored → pseudo → missing), screening only the input-screenable refuse rows. A COMPUTING consumer that has the ledger state should use resolve_and_screen instead — it shares this exact ladder (resolve_core) and additionally runs the compute-dependent refuse-guard. full_return/tax_table are None for a year v1 doesn’t support (fails the ReturnInputs arm closed).