Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/uk-890-target-binding.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bind the transport and energy facts of chronicle #254/#257 on the UK national surface (#890, the target-binding half of the #790 "bind facts and calibrate" ruling). The DfT London bus rows bind at region level through a region-aware generator pin and a compile-time roster check; England outside London is derived from the bound England and London rows; BUS05ai fare receipts are aligned from the year ending March to the calibration calendar year with the BUS0415 fares index (England ×1.057, London ×1.0; net support never aligned). The alignment is a declaration on the contract rows (`uprating_index: dft.local_bus_fares_index`) that the generator applies while authoring and the runtime applies through the same applier, so the committed membership, the compile-parity receipts and the run manifest carry one value with the factor, months, source record ids and pre-alignment value declared; the index series is read from the vendored `dft_bus_value_anchors.json`, hash-pinned to the same feed, so the production factors reproduce under test without the licensed feed. Eight net-new national targets bind pinned facts: OBR fuel duty receipts from cars on the engine's cars-only `fuel_duty`, bound at FY2024-25 (the FRS 2024-25 base year, GBP 14.4bn from the April 2024 vehicle-type vintage, held to 2025) rather than a later fiscal-year projection, with the all-road-users `obr.fuel_duties` row signed out and its #757 measure exclusion retired; ORR table 7270 rail support (Great Britain) on `rail_subsidy_spending`; ONS Consumer Trends COICOP 04.5 on `domestic_energy_consumption`; and the Scotland, Wales and Northern Ireland local-bus legs (Scottish Transport Statistics passenger revenue and government support; StatsWales outturn support through local authorities; DfI Translink receipts; NITHC public transport support as a joint bus-plus-rail cell), with the UK support row signed out as replaced by those heterogeneous legs rather than covered by them. Contract 236 → 244 targets, active references 415 → 424, national compile 424/0 unsupported. No reviewed target-fit exclusion is needed: on the spine-p baseline every new row, the cars fuel duty included (−16.7% after the solve, from −41.0%), sits inside the 25% bound; the receipts in `experiments/890-fuel-bus-energy-receipts.md` record that the bus, rail and devolved rows fit by weight stretch alone, which is what the spine half is built to remove. The eight targets declare their schema-8 hierarchy (providers ORR, Welsh Government, DfI Northern Ireland and NITHC; categories for rail industry finance, consumer trends and the devolved local-bus finances; the cars fuel duty under `obr.efo_receipts`).
1 change: 1 addition & 0 deletions changelog.d/uk-chronicle-repin-890.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Re-pin the UK Chronicle consumer feed to `474a0ae` (#890, from `ec7169b`; the intermediate `c6f9361` pin never shipped) as one declaration for both calibration grains: `uk/national_chronicle_feed.json` becomes `uk/chronicle_feed.json`, and the local census, local references, local validation levels and vendored fact resources now restate that pin instead of carrying their own (the target contract was already one file for both grains). The artifact carries the 16 packages of chronicle #254/#255, the six of #257/#258 and the nine of #259/#260 (141,400 rows, +9,950), and its rows are `chronicle.consumer_fact.v2` (chronicle #263), which carries the dimension and value labels the schema-8 target hierarchy completes from: HMRC hydrocarbon oils quantities, OBR fuel duty receipts by vehicle category, DESNZ pump prices, DfT licensed cars by fuel type, Scotland/Wales/NI bus finance, ORR rail finance and fares index, NEED consumption tables, Ofgem cap levels for every charge restriction period and region, ONS Consumer Trends COICOP expenditure with `coicop` as a row dimension on both sheets, and NTS0313/NTS0621 frequency of local bus use. The consumer-fact schema moved from `ledger.consumer_fact.v1` (`76ac268e…`) to `chronicle.consumer_fact.v2` (`6a42e4a5…`): `quarter` and `week` period types and the label fields were added. No existing reference on either surface resolves a different fact or value: the national surface regenerates byte-identical apart from the feed identity (415 active, 7 deferred, 8 signed out before the #890 bindings) and the local surface likewise (20,430 active, 1,586 no-fact, 513 signed deferred, 1 signed compile error, unchanged). Adds `tools/vendor_uk_ledger_facts.py` with `uk/ledger_fact_vendor_selections.json`: pinned Chronicle facts the spine stages and target diagnostics consume are copied verbatim into per-concern resources (`dft_bus_value_anchors.json`, `road_fuel_anchors.json`, `licensed_cars_fuel_type.json`, `need_energy_facts.json`, `ofgem_price_cap_facts.json`, `nts_bus_use_frequency.json`, `devolved_bus_finance.json`, `orr_rail_facts.json`, `ons_household_expenditure_facts.json`), each recording the feed identity it was taken from, the readers it has today and the readers planned for the spine half, and regenerating byte-identical from the pinned feed under test; no value in a vendored resource is derived.
69 changes: 43 additions & 26 deletions docs/uk-chronicle-feed-repin.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,55 @@
# Re-pin the UK Chronicle consumer feed

The national and local target surfaces have independently reviewed Chronicle
artifact pins. National calibration reads `uk/national_chronicle_feed.json`;
local calibration and validation retain their existing pins. A national
update does not authorize changes to local census membership or values.
One reviewed Chronicle artifact identity, `uk/chronicle_feed.json`, governs
every UK consumer of the feed: the national references and membership, the
local census, the local references, the local validation levels and the
vendored per-concern fact resources. The target contract
(`uk/uk_population_targets.json`) is likewise one file for both grains. A
re-pin is therefore one reviewed change; the surfaces regenerate from the same
artifact and cannot drift apart silently (the local census and the validation
register restate the pin and are drift-gated against it).

Rebuild the complete UK bundle and consumer artifact in
`PolicyEngine/chronicle` at the declared commit. Keep the resulting
`consumer_facts.jsonl` and `manifest.json` together; do not commit either file.
`consumer_facts.jsonl` and `manifest.json` together; do not commit either
file. The untracked default location is `.codex-work/consumer_facts_uk.jsonl`
+ `.codex-work/consumer_facts_uk_manifest.json` (also mirrored as the artifact
directory `.codex-work/uk-artifact/` for the calibration runner); the hermetic
regeneration tests accept a `CHRONICLE_UK_FACTS` override and skip only when
neither is present.

Verify both SHA-256 digests and the manifest's `facts_sha256`, row count, and
schema version. For a national update, update
`uk/national_chronicle_feed.json` and regenerate the national references and
membership with `tools/generate_uk_target_references.py`. Verify the complete
compiled target diff, including targets outside the intended policy area.
The hermetic national regeneration test accepts `CHRONICLE_UK_FACTS`.
schema version, then update `uk/chronicle_feed.json` and regenerate, in this
order:

For a separately reviewed local update, update `_LEDGER_FACT_FEED_PIN` in
`uk_runtime/local_target_census.py`, the local validation-level pin, and their
tests together. Regenerate the local census with
`uv run --no-sync python tools/census_uk_local_targets.py`.
1. the national references and membership with
`tools/generate_uk_target_references.py` (pass the stable
`--source-fact-feed` label recorded in the membership);
2. the local census with `uv run --no-sync python tools/census_uk_local_targets.py`
(it restates the pin from the shared declaration);
3. the local references and membership with
`tools/generate_uk_local_target_references.py` (same label);
4. the local validation-level register's `source_feed` block
(`uk/local_validation_levels.json`), which the loader checks against the pin;
5. the vendored fact resources with `tools/vendor_uk_ledger_facts.py`
(`uk/ledger_fact_vendor_selections.json` names them; each records the feed
identity it was taken from);
6. the signed compile parity receipts with
`tools/build_uk_ledger_compile_parity_signed_differences.py --surface all`.

Regenerate the local reference surface with
`tools/generate_uk_local_target_references.py`, then rebuild the signed compile
parity receipts affected by that update with
`tools/build_uk_ledger_compile_parity_signed_differences.py`. The hermetic
local regeneration test accepts either the default `.codex-work` files or a
`CHRONICLE_UK_LOCAL_FACTS` override and skips only when neither is present.
Verify the complete compiled target diff on both surfaces, including targets
outside the intended policy area, and record the value moves in the changelog
fragment.

The national calibration runner refuses a feed whose facts or manifest digest
differs from its committed pin. `--allow-unpinned-feed` is an explicit diagnostic override and
is recorded in the run manifest; it is not a re-pin procedure.
differs from the committed pin. `--allow-unpinned-feed` is an explicit
diagnostic override recorded in the run manifest; it is not a re-pin procedure.

After the `ec7169b` re-pin, census household targets use the same Chronicle
compile path as every other bound UK local family. The OA ladder now supplies
geography assignment and diagnostic household dispersion only; it no longer
creates calibration targets or a non-contract reconciliation surface.
History: the `ec7169b` re-pin (#887/#900) moved census household targets onto
the same Chronicle compile path as every other bound UK local family; the
`c6f9361` re-pin (#890) added the chronicle #254/#255 and #257/#258 transport
and energy packages and unified the national and local pins into this one
declaration; the `474a0ae` re-pin (#904, chronicle #263) moved the rows to
`chronicle.consumer_fact.v2`, which carries the dimension and value labels the
schema-8 target hierarchy completes from (141,400 rows, including chronicle #260's
Universal Credit packages).
5 changes: 3 additions & 2 deletions docs/uk-uc-paid-target-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ calibration residual. Related work remains in [#882](https://github.com/PolicyEn
payment indicator × child entitlement crossed separately with family type and
reported child count. The pinned complete UK artifact comes from
`ec7169b5db40b9f54117c80f70f14efc1dd0fedd`: all 100 source suites pass and its
131,450 facts validate. The packaged `uk/national_chronicle_feed.json` records
131,450 facts validate. The packaged `uk/chronicle_feed.json` records
the facts, manifest and schema hashes. National calibration checks both artifact
digests before compiling targets; local surfaces retain their separate pins.
digests before compiling targets; since #890 the local surfaces restate the same
pin (the artifact has since moved on, see `uk/chronicle_feed.json`).

| Target group | Source operation | Model counterpart |
|---|---|---|
Expand Down
Loading
Loading