Repository navigation
Adopt policyengine-uk's CGT retention-rate default - #633
Draft
juaristi22 wants to merge 1 commit into
Draft
juaristi22 wants to merge 1 commit into
juaristi22 wants to merge 1 commit into
Conversation
Everything that adopting policyengine-uk's default capital gains
realisation response (policyengine-uk#2396) needs apart from the pin:
- Contract 1.2.0 adds cgt_default_response_relief_gains: 45% higher and
additional rates for £50,000 of gains, £20,000 of them qualifying for
Business Asset Disposal Relief, whose response is checked at the
default elasticity of 1. Like cgt_default_response, its checks wait on
policyengine-uk#2396 until the pin moves. The golden rows add 48 rows
for it and change none.
- tests/test_uk_cgt_default.py checks the default through the
population, household and managed routes, an MTR elasticity set alone,
and that an unreformed run is unchanged. It skips until the installed
policyengine-uk has the default.
- The reforms guide gains a section on the response, and a methodology
page explains it, with the caveats from policyengine-uk's review: low
for rate changes alone, a medium-term value, large rate rises, and
household results counting deferred gains as income lost.
- The dynamic field's description says None keeps the model's defaults.
With policyengine-uk#2419's code installed, the default tests pass and
every pending check in both default cases holds on all five in-process
routes. The pin commit fills in {X} and {Y}, makes the default cases
gating, and removes the skip.
Part of #602.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Part of #602.
Blocked by: the policyengine-uk release from PolicyEngine/policyengine-uk#2419 (in the merge queue; expected 2.134.0), and the publisher's compatibility claim for that release in policyengine-uk-data 1.58.1's release manifest.
certify-datarefuses an unclaimed model version. This PR stays a draft until both exist.PR set: CGT retention-rate default (PolicyEngine/policyengine-uk#2396, #602)
Tracking checklist: checklist on #602
In this PR now
Everything adopting the default needs, apart from the pin. It passes on the current pin (policyengine-uk 2.130.1).
Contract 1.2.0. It adds
cgt_default_response_relief_gains: 45% higher and additional rates for £50,000 of gains, £20,000 of them qualifying for Business Asset Disposal Relief. It checks both the realised gains and the relief gains' own response at the default elasticity of 1, against the share-weighted rate. Like Hold CGT realisations fixed in the Budget contract's rate-blending case, and check the response #620'scgt_default_response, its checks wait onpolicyengine-uk#2396. The golden rows add 48 rows for it and change none.tests/test_uk_cgt_default.py.mtr_elasticityset alone applies on its own, with oneCapitalGainsResponseWarning, and the record says so.The module skips until the installed policyengine-uk has the default.
Docs.
dynamicon both sides of a comparison, and the assumption's limits.dynamicfield's description saysNonekeeps the model's defaults.Changelog:
602-cgt-default.changed.md.The pin commit, once step 4 is done
Following #617's recipe:
scripts/bundle.py certify-data --country uk --data-producer populace --manifest-uri hf://model/policyengine/policyengine-uk-data-private@<claim commit>/releases/1.58.1/release_manifest.json --model-version <X>.bundle.py generate --include-tros), and check them withbundle.py check --published-spm --include-tros --strict-tros.uv.lock(uv 0.12.14,--upgrade-package policyengine-ukonly), plus the test constants that pin the certified pair.test_uk_cgt_default.py.{X}(the policyengine-uk version) and{Y}(this release) in the docs and the fragment.make testwith the HF token, refresh snapshots, and attribute each drift. The jump from 2.130.1 also brings in policyengine-uk 2.131–2.133: trading-loss relief, and #2277's labour supply measurement.Evidence, aggregate-only:
Checks so far
tests/test_uk_budget_reform_contract.py,tests/test_uk_cgt_responses.pyandtests/test_uk_cgt_default.pygive 142 passed. One module is skipped: the default tests, as intended.ruff format --check .andruff check .are clean.tests/test_uk_cgt_default.pygives 6 passed.🤖 Generated with Claude Code