UK parity increment 1: frs/cps-transfer tier identity, standardized diagnostics, consolidated terminal gates (#578) - #588
Merged
Merged
Conversation
…ables-extra convention
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.
What
This is UK parity increment 1 for #578: backlog items 1–3 only.
1. Freeze UK source-tier identity
frsandcps-transfer. Values are exact and case-sensitive; quality adjectives includingtrue,full, andpublicfail closed.populace-uk-<year>-<tier>-k<N>.frsthrough the certified June candidate identity, HMRC source-stage evidence, release-input-coverage family contract, regenerated coverage evidence, and currentness checks.f17306…933), byte size (1,315,880,118), and stable-file hash gate unchanged. No release was re-cut.2. Standardize UK calibration diagnostics
Adds a strict, atomic UK diagnostics writer that preserves the shared calibration-diagnostics schema and nests UK additions under
uk_diagnosticsschema version 1:weights: shipped record, positive-weight, and zero-weight counts; total weight; Kish ESS andess_fraction; positive-weight median; maximum weight; max/median ratio; and top-1% weight share.zero_weight_rows_by_stratum: stratum selectors, total rows, positive/zero rows, and weight sum. A June-shaped fixture records 535,080 households, including exactly 200,000 zero-weight SPI-synthetic rows (100,000 in each capital-gains flag stratum).target_pass_rates_by_geography_level:n_targets,n_scored,n_skipped,n_within_10pct, andpass_ratefornational,region,country,local_authority, andconstituency;lais accepted as an input alias forlocal_authority.The canonical UK release contract now requires this block and verifies count reconciliation, geography coverage, ESS arithmetic/shared-scalar consistency, and the max/median fields. This makes diagnostics a publication requirement rather than an optional helper. The current national command is a no-calibration staging seam, so it cannot honestly emit target residuals; a release calibration must call the writer with a real
CalibrationResultand exact UKTargetRegistry.3. Consolidate terminal gates
Adds one
GateReportevaluated after all UK national stages and before the staging H5 is written. The strict JSON report is written before a single combined named failure is raised.Always-applicable gates:
uk_release_input_coveragedegenerate_release_surface(all-null, all-zero, and constant columns across person, benefit-unit, and household release tables)zero_weight_strata(undeclared, ambiguous, missing-selector, and over-limit findings; June declarations are 100,000 rows per SPI/CG stratum)weight_ess(minimum ESS fraction 0.01)weight_ratio(maximum max/positive-median ratio 2,000)Evidence-dependent current gates:
weights_auditwhenever the HMRC production fit stage ran; missing/empty fit evidence fails by name.export_surface,target_surface, andtarget_fit(25% maximum absolute relative error) when complete, validatedUKReleaseParityEvidenceis available.The current national staging path deliberately performs no calibration and therefore has no truthful target surface or residual vector. Its report omits the June parity trio rather than recording fabricated passes. The terminal API and fixture tests run all three when real evidence is supplied.
The national driver now defaults to
<staging>.terminal_gates.json, retains--input-coverage-jsonas a mutually exclusive compatibility alias, records the complete report in its console/build evidence, and keepsinput_coverageas a compatibility projection.Why
The UK audit found ambiguous lineage naming, no standardized ESS/zero-support/geography diagnostics, and split or incomplete gate evidence. These changes make provenance explicit, turn the June zero-support finding into routine emitted evidence, and ensure one build returns the full applicable failure set instead of failing one gate at a time.
Explicit non-goals
Backlog items 4–8 remain later increments and are not represented by placeholder passes:
There is no US runtime behavior change, no publication/push, and no modification to historical June release receipts.
Verification
ruff check .: clean.ruff format --checkon all 22 changed Python files: clean.git diff --check: clean.Repository-wide
ruff format --check .identifies 38 pre-existing unformatted files outside this change (including US runtime and experiment files). They were left untouched to avoid unrelated formatting churn; every Python file changed here is formatted.Part of #578 (UK backlog items 1–3; audit receipts in the epic thread).
🤖 Generated with Claude Code