CGT band-aware calc + realisation hook; pensions tax relief & annual allowance#79
Open
vahid-ahmadi wants to merge 1 commit into
Open
CGT band-aware calc + realisation hook; pensions tax relief & annual allowance#79vahid-ahmadi wants to merge 1 commit into
vahid-ahmadi wants to merge 1 commit into
Conversation
…nual allowance Port a coherent slice of HMRC capital gains tax and pensions tax (issue #45). CGT (TCGA 1992): new band-aware calculate_capital_gains_tax_banded stacks gains on top of adjusted net income, taxing the slice within the remaining basic-rate band at the basic rate and the rest at the higher rate (matching PolicyEngine-UK), reusing the residential surcharge. Wired into Phase 2c. A configurable realisation behavioural response (CgtResponseParams) scales gains by (reform_rate/baseline_rate)^elasticity as the documented hook; static calc complete. Pensions (FA 2004 Part 4): new PensionsParams. Net pay reduces taxable income; relief at source extends the basic-rate band by the grossed-up contribution. Tapered annual allowance and the annual-allowance charge are applied in income tax. Carry-forward not modelled (documented simplification). 2025/26 parameters set for pensions and cgt_response. Unit tests cover worked examples for each. cargo build and cargo test pass (204 tests). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #45.
Scope
Capital gains tax (TCGA 1992; FA 2024 s.7)
calculate_capital_gains_tax_banded: gains (after the £3,000 AEA) stack on top ofadjusted_net_income; the slice within the remaining basic-rate band is taxed at the basic CGT rate (18%) and the rest at the higher rate (24%), matching PolicyEngine-UKcapital_gains_tax. Replaces the previous all-or-nothing higher/basic split in simulation Phase 2c.cgt_responseparameter (CgtResponseParams { elasticity, baseline_rate }).apply_cgt_realisation_responsescales realised gains by(reform_rate / baseline_rate) ^ elasticitybefore tax — mirroring PolicyEngine-UK's log-differencecapital_gains_behavioural_response.calculate_capital_gains_tax(person, params, is_higher_rate)form is kept unchanged (still used by the residential-surcharge benchmark).Pensions tax (FA 2004 Part 4) — new optional
pensionsparameter (PensionsParams)gross_up_contribution,extend_basic_rate_band) to deliver higher-rate relief.tapered_annual_allowance): £60,000, reduced £1-per-£2 above £260,000 adjusted income down to a £10,000 minimum.annual_allowance_charge): excess contributions taxed at the member's marginal rate, applied in income tax.Parameters: 2025/26 values added for
pensionsandcgt_response. Legislative citations added (new §13A CGT, §13B Pensions Tax). Changelog fragment added.Tests
cargo buildandcargo testpass (204 tests). New worked-example unit tests:Remaining
cgt_response.baseline_rate, because the engine has no automatic baseline-vs-reform CGT plumbing threaded throughSimulation::newyet (cf.baseline_old_sp_weeklyfor state pension). The static CGT calc is fully implemented.🤖 Generated with Claude Code