Expand description
what-if sell (task #43) — §43 READ-ONLY hypothetical-sale tax planning. Opens the vault, runs the
pure deterministic projection, and calls btctax_core::whatif::sell with the synthetic sale.
Appends NOTHING, writes NO side-table row, calls no session.save() (the vault is byte-identical
after — the whatif_never_persists KAT). Tax decision-support (consequences), NOT buy/sell advice.
Ad-hoc profile. With --filing-status + --income (+ optional --magi/--carryforward-in)
the plan runs against a NON-persisted TaxProfile so a user can plan without tax-profile set;
with no ad-hoc flags it falls back to the stored Session::tax_profile(year). [R0-M4] --magi
defaults to --income (a floor — NEVER $0, which would silently suppress every NIIT disclosure);
the caller prints the caveat when the default is used.
Structs§
- Adhoc
Profile - A validated ad-hoc (non-persisted) profile spec built from the
what-if sellflags.filing_status - Harvest
Outcome - The outcome of
what-if harvest: the report + whether--magidefaulted to--income. - Sell
Outcome - The outcome of
what-if sell: the report + whether the ad-hoc--magidefaulted to--income(so the renderer/caller can print the “MAGI assumed = ordinary income” caveat).
Functions§
- adhoc_
profile - Build a NON-persisted
TaxProfilefrom the ad-hoc spec (mirrorsplaceholder_tax_profile, but user-supplied). [R0-M4]magi_excluding_cryptodefaults toincomewhen--magiis omitted — NEVER $0 (a $0 floor would silently suppress every NIIT disclosure). - harvest
what-if harvest— READ-ONLY harvest optimizer. Resolves the profile (ad-hoc if supplied, else the stored one for the harvest year), builds theHarvestRequest, and calls the core segment-walk optimizer. Nosave().- map_
whatif_ err - Map a
WhatIfErrorto a user-facingCliError(mirrorscmd::optimize::map_opt_err). - parse_
harvest_ target - Parse
--target:zero-ltcg|fifteen-ltcg|gain=$X|tax=$X(X >= 0;$/commas optional). - sell
what-if sell— READ-ONLY hypothetical sale. Resolves the profile (ad-hoc if supplied, else the stored one for the sale year), builds theSellRequest, and calls the core engine. Nosave().