Repository navigation
Adopt policyengine-uk's CGT retention-rate default - #633
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>
|
@juaristi22 thanks, this is my review at The content before the pin is ready for the pin commit once the body, the fragment and the docs point (4) are fixed. The new case, the default tests and the docs check out, and they pass unskipped on policyengine-uk 2.134.0 and 2.134.3. The pin commit itself needs a look when it lands.
What looks right
What I checked
🤖 Generated with Claude Code |
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