Pin England-scoped SLC and scotgov targets to their publication geographies - #758
Merged
Conversation
…aphies Adjudicates the 14 UK target references still held as no_fact_at_or_before_period after #754 and activates the 11 that are mechanical geography-pin bugs: scotgov.scottish_child_payment_spending (Scotland-stamped Scottish Budget facts vs a UK pin) and the ten slc.borrowers.*/slc.support.* ids (England-stamped publications whose contract bindings and model variables are England-scoped vs GB pins). Also treats ay-prefixed academic-year record-set tokens as period-bearing so the multi-year SLC series collapse to one period-invariant series and resolve to the latest fact at or before the target period. Active references 397 -> 408; the seven remaining holds (four obr council-tax ids, two dwp.pip claimant counts, slc.repayments.devolved_total) are deliberate and documented in the pin rule and tests. Co-Authored-By: Claude Fable 5 <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.
Follow-up to #754. That PR fixed the nine
scotgov.council_tax_stock.*geography pins and deliberately left the other 14no_fact_at_or_before_periodholds unadjudicated. This PR adjudicates all 14 individually and activates the 11 that are mechanical pin bugs, leaving 7 deliberate holds with their rationales recorded below and in the pin-rule comments.Per-id adjudication
Every hold was diagnosed against the pinned consumer feed (
consumer_facts_uk.jsonl, sha226358e7…, chronicle at1cab809) by matching each target's non-geography selector and listing the geographies, periods and assertions of the facts it reaches, then checking the contract binding and the policyengine-uk model code for the country scope.Fixed here (11):
scotgov.scottish_child_payment_spendingallow_source_projection.slc.borrowers.plan_{2,5}_{above_threshold,liable}(4)country == ENGLANDexplicitly, and the facts are England-stamped; the GB default pin could never match. Resolve at AY2025.slc.support.{maintenance_loan,parents_learning_allowance,adult_dependants_grant}_{recipients,spend}(6)maintenance_loan_in_england_system,parents_learning_allowance_eligible,adult_dependants_grant_eligibleall requirecountry == ENGLANDin policyengine-uk), and the facts are England-stamped. Resolve at AY2024 with uprating holds 2024→2025 recorded.Deliberately still held (7): these are not pin bugs and activating them via a pin change would be wrong.
obr.council_tax_{england,scotland,wales},obr.domestic_ratesobr.council_taxtarget is row 19, which includes NI domestic rates and an accruals adjustment with no household counterpart; the redesign should prefer publisher administrative targets or row 15).dwp.pip.daily_living_{standard,enhanced}_claimantspip_dl_categoryis derived from FRS-reported amounts with no country restriction, so the model metric's footprint is GB. Activating with a K04000001 pin would compare a GB metric to an E&W count. Needs a binding decision (an England-and-Wales country filter), not a pin change.slc.repayments.devolved_totalslc/student_loan_repayment/devolvedis not computable by the compute path (its country map has no "devolved" entry). Needs a per-nation redesign of the contract target, not a pin.Changes
tools/generate_uk_target_references.py— replaces the Pin the scotgov council-tax stock targets to Scotland (activates the nine held CTAXBASE references) #754 stock-prefix special case with aTARGET_PREFIX_GEOGRAPHY_PINStable:scotgov.→ Scotland,slc.borrowers.→ England,slc.support.→ England, each entry commented with the layer that fixes the geography (fact stamp, contract binding, or model country gate).slc.repayments.*intentionally stays with the substring rule.packages/microcosm-build/src/microcosm/build/ledger_targets.py— one-token fix:_is_period_tokennow strips theayprefix alongsidety/cy/fy. The SLC series key one record set per academic year (…ay2013……ay2029); without this the per-year record sets defeat the period-invariant key, the latest-at-or-before tiebreak refuses, and all ten SLC ids landed inmulti_factinstead of activating. New unit testtest__given_academic_year_record_sets__then_latest_source_period_is_usedlocks the behaviour.target_references.json(+11 references) andtarget_reference_membership.json: active 397 → 408,no_fact_at_or_before_period18 → 7,multi_factstays 1 (the documented genuine ONS residue). Reference-level diff verified: 11 added, 0 removed, 0 existing references changed — theaynormalisation perturbs nothing already active.test_uk_target_references.py,test_uk_national_calibration.py,test_country_spec.py; the Pin the scotgov council-tax stock targets to Scotland (activates the nine held CTAXBASE references) #754 scoped-pin test is rewritten astest_prefix_geography_pins_carry_scotgov_and_england_scoped_slc_families, which also asserts the seven deliberate holds stay held.Verification
slc.repayments.england_*ones.packages/microcosm-buildpytest suite green locally; ruff format/check clean.🤖 Generated with Claude Code