Repository navigation
Bind DESNZ domestic energy by constituency (microcosm#1095) - #1404
Conversation
|
@juaristi22 round 1, at This is a careful piece of work. The split is the right one (DESNZ's own small areas, not households), it keeps every authority's total exactly, and the seat rows are labelled as Microcosm's derivation throughout. Binding both grains doesn't double-bind in any harmful way. No musts. One should: the gas-connected cells at the two grains aren't shown to agree the way the kWh cells are. How the split works, checked
Double-binding and collinearity
Findings
Checked and fine
What I ran
VerdictSound, and close to ready. Post the gas-connected gap (item 1) and keep it as a draft until CI is green. Then it's good from my side. The nits are up to you. Nothing here needs a ruling from Vahid. The decision to bind the seat rows was María's, and I agree with it. 🤖 Generated with Claude Code |
|
@vahid-ahmadi thanks. All four are addressed at
The adjudication records the two sentences added to the fence. The 9 test files that read the fence text or the register pass (326 tests). The PR stays a draft until CI is green. 🤖 Generated with Claude Code |
|
@juaristi22 round 2, at All four round 1 items are addressed, and the gas-connected gap is measured rather than argued. I could check its Great Britain figure from the committed parity receipt. No musts or shoulds, two small nits. Round 1 status
New findings
What I ran
VerdictGood from my side. It can come out of draft once CI is green. Both nits are up to you. Nothing here needs a ruling from Vahid. 🤖 Generated with Claude Code |
The English band-H deferral's rationale states the spine's band-H households and the raw FRS households behind them as national counts. Its argument rests on those and on the authorities' draws at K=15. The membership's copies of the rationale follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tals DESNZ publishes Great Britain's domestic electricity and gas consumption and meter counts by local authority and by small area (2021 LSOAs, 2022 Scottish data zones), but no constituency cut. The new resource uk/desnz_constituency_energy_facts.json splits each authority's published 2024 total over its July 2024 constituencies in proportion to DESNZ's own small-area figures for the same year, through the committed atomic supports (María's ruling of 2026-10-25 on microcosm#1095's "Constituency grain"). A census household split was measured and refused: it makes use per household uniform within each authority and moved seats' gas by a median 4% and up to 38% against the small-area split. Every authority keeps its published total, so seat and authority rows agree by construction; only the 2.4% of households in the 990 small areas that straddle two seats are split by census households. The rows keep DESNZ's concept, period and dimensions under the Microcosm-owned derived-fact namespace, and the loader refuses a resource split through other supports or built on another feed than the pin. tools/build_uk_desnz_constituency_energy_facts.py builds it from the pinned feed (streamed and hashed) and the supports; the method lives in uk_runtime/desnz_constituency_energy.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The three DESNZ targets (electricity and gas kWh, gas-connected households) gain the constituency grain beside the local-authority one, Great Britain only (microcosm#1095). The kWh selectors admit the derived seat rows by source (desnz or microcosm); the gas-connected selector reads the census households of both grains. The seat cells take the authority cells' level factor per fuel, and the gas-meter-share applier reads a seat's meters off the split. The Orkney and Shetland seat, like its two councils, has no mains gas and is signed absent for gas. The energy metrics are appended to the constituency metric list under the append-only rule, and the census lists the derived resource as the family's seat source. The cross-grain reasons now say why the single-winner rule rescales the authority cells by one: the seat cells split their totals. Every compile of the UK references reads the committed derived resources through the new uk_runtime.derived_facts (the full-build targets, the parity receipt tool, the release-cut certifier, the UC matrix diagnostic), so no compile finds the seat cells absent. A list-valued source_name now prefilters the generator's facts to its sources, in feed order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The local references and membership gain 1,896 DESNZ seat cells, 1,894 of them compiled (632 Great Britain seats, three targets; the Orkney and Shetland seat's two gas cells are signed out). The local compile-parity receipt carries the 1,894 as ledger-only under their own rationale, and the data-target parity register adds the incumbent's constituency loss script to the three targets. Pins move with them: 24,898 compiled cells, 29,029 references, 4,131 signed exclusions. The references, membership and parity receipt were generated from a cut of the pinned abf0921 artifact to the local-level rows a local contract selector matches (305,530 rows), as docs/uk-chronicle-feed-repin.md allows on a 24 GiB machine; on main's code the cut reproduces main's three files byte for byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its loader refuses a resource built on another feed than the pin, so the re-pin procedure rebuilds it beside the vendored resources. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the energy targets bound at both grains, the cross-grain rule moves every region's leg, and the off-surface step must account for each absent cell. In Scotland the gas kWh leg lacks the same territory at both tiers (Orkney and Shetland councils and their seat have no mains gas, so DESNZ publishes no gas row), nothing could imply it, and the local surface refused to compile. AreaSignedDeferral gains declared_value: the cell's value for reconciliation only, never bound, where the thing measured does not exist in the area. The membership records it, and uk_signed_cells_off_the_surface reads it in place of a compiled value or an absent one. The four no-network gas deferrals (councils and seat, kWh and gas-connected) declare zero (María's ruling of 2026-10-25); for gas-connected this replaces the census base those cells carried off the surface. A compile of the local surface on the validated feed cut now reconciles all 1,957 energy cells at a factor of exactly one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The seat resource's row keys hash its inputs, which now name the 272c987 feed, so the membership's resolved keys for the seat cells and both files' pins of the resource move. No compiled value moves: the local references and the local compile-parity receipt regenerate byte for byte. Generated from a cut of the 272c987 artifact, the local-level rows a local contract selector matches (305,530 rows). On main with the band-H commit, the same cut reproduces the local references, membership and parity receipt byte for byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
María signed the texts on 2026-10-26 and ruled that the seat rows bind. The domestic energy family gains the fence desnz_small_area_split_for_constituencies (the seat cells are Microcosm's split of each authority's total by DESNZ's own small-area figures, not a published fact) and its in-force adjudication in uk/local_binding_adjudications.json, so the family binds at both grains. The three DESNZ adjudications' reasons, the basis fence's authority and the meters fence's rule now speak of areas rather than authorities, and the gas-connected hold of the area's household reconciliation; each records its re-wording. The census is regenerated; the rowwise receipt's dormant fences gain the new one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vahid's round-1 review of microcosm#1404. The fence rule now names the second modelled step: each output area goes to one seat through ONS's best-fit lookup of 2021 output areas to July 2024 constituencies (NRS's lookup of 2022 output areas in Scotland). It also says the gas-connected cells do not agree across grains by construction, since each area's are its census households times its own meter share. On the 272c987 feed, after the census reconciliation brings both grains' households to one regional total, the seat and authority sums differ by under 0.2% in every region (0.06% over Great Britain). The adjudication records the added sentences. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rebase onto main after the policyengine-uk bump (microcosm#1400) took main's generated files where they conflicted. These are regenerated from a cut of the 272c987 artifact with the rebased contract, the local-level rows a local contract selector matches (306,418 rows). On main with the band-H commit the same cut reproduces main's local references, membership and parity receipt byte for byte. The local references and the data-target parity register regenerate unchanged. Counts: 25,192 compiled cells, 29,325 references, 4,133 signed exclusions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f1b790f to
a42ca31
Compare
Since the policyengine-uk 2.162.3 bump (microcosm#1400) the engine-uk job runs 25 to 30 minutes and more against its 30-minute cap: main's run at 5810fce lost engine-uk (3.13) to the cap, and this pull request's run lost both legs. The cap is now about twice the slowest successful leg (29 minutes), still a bound on a hung test for the shared runner pool. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The engine-free legs took 64-74 minutes on 2026-10-26, and a Python 3.14 leg on microcosm#1404 hit the 75-minute cap: it now has 120, about 1.6x the slowest. The engine-uk cap takes #1404's change verbatim (60 minutes, about twice its slowest leg after the policyengine-uk 2.162.3 bump), so the merge of main stays clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The branch takes main by a merge, keeping both published builds' commits in its history. #1404 merges cleanly: it moves no gate digest and no spine stage, and its engine-uk timeout is already on the branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test checks the energy rows' local families through uk_local_family_parents, which fed only the differencing check this branch removed with the rest of the model-figure withholding (María's ruling of 2026-10-26). The cross-grain declarations behind the families stay, and the coverage check still reads them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds the constituency grain to the three DESNZ domestic energy targets: electricity and gas consumption in kWh, and gas-connected households. They already bind by local authority (#1286). This is #1095's "Constituency grain" item for energy. Bus stays at region grain (see below).
How the seat rows are made
DESNZ publishes no constituency cut. The new committed resource
uk/desnz_constituency_energy_facts.jsonsplits each authority's published 2024 total over its July 2024 constituencies. The split is in proportion to DESNZ's own LSOA (England and Wales, 2021) and data zone (Scotland, 2022) figures, which sit in the pinned feed (272c987,desnz.lsoa.electricity.cy2024anddesnz.lsoa.gas.gy2024) on the same release, periods and temperature bases as the authority rows.tools/build_uk_desnz_constituency_energy_facts.pybuilds it from the pinned feed (streamed and hashed againstuk/chronicle_feed.json) and the atomic supports (hashed against their provenance). The method is inuk_runtime/desnz_constituency_energy.py. The loader refuses a resource built on another feed or other supports; the re-pin doc now says to rebuild it.A census household split of each authority's total was measured and not taken (public data only). It makes use per household uniform within each authority. Against the small-area split it moved seats' gas by a median 4.3% (England and Wales; p90 15%, p99 36%) and 3.5% (Scotland; up to 38%), electricity by a median 3.0%, and the gas-connected share by a median 2.3 points (up to 30).
Bus stays at region grain
The feed carries BUS01 boardings by country, region and statistical scope only, with no authority or smaller-area rows. Seat rows could only spread a region's boardings by population, which carries no information.
What changes
uk/uk_population_targets.json):area_scope;["desnz", "microcosm"]);uk_runtime/domestic_energy_targets.py): the seat cells take the authority cells' level factor per fuel; the gas-meter-share applier reads a seat's meters off the split.nation_grain_family_equal_sqrt_count, domestic energy is now a family in the constituency grain too. Its share of the loss weight rises from 1/36 (2.8%, one of nine local-authority families) to 1/36 + 1/20 (7.8%), and each other constituency family's share falls from 6.25% to 5%. Its floor is 2.5%.uk_runtime/derived_facts.pylists both committed derived resources, and the full-build targets, the parity receipt tool, the release-cut certifier and the UC matrix diagnostic read it. Both UK target kernels hash the two new modules (uk_runtime/target_compile_modules.py). A list-valuedsource_namenow prefilters the generator's facts to its sources, in feed order.AreaSignedDeferral.declared_value; María's ruling of 2026-10-25)..github/workflows/test.yml), about twice its slowest successful leg. Since the policyengine-uk 2.162.3 bump (microcosm#1400) the UK engine tests run 25 to 30 minutes and more, and the old cap cancelled both legs of this PR's run and one leg of main's.The references, membership and parity receipt were generated from a cut of the pinned 272c987 artifact: the local-level rows a local contract selector matches, 306,418 rows. docs/uk-chronicle-feed-repin.md allows this route on a 24 GiB machine. On main with the band-H commit, the same cut reproduces all three files byte for byte.
Signatures and binding
desnz_small_area_split_for_constituencieswith its in-force adjudication inuk/local_binding_adjudications.json. It is renewed on the first dense build that binds the seat cells, on the share of seat cells within 10% and 25% per fuel.Verification
test_uk_local_energy_metrics.py,test_uk_energy_price_basis.py: 4 passed.tools/ci_test_plan.py verifyand ruff clean.Tracker (#1095, "Consumption, energy and bus"): "Constituency grain" is done for energy; bus stays at region grain.
🤖 Generated with Claude Code