Skip to content

Migrate the UK local-geography and firms contracts out of Chronicle (chronicle#166 ruling) #708

Description

@juaristi22

The chronicle#166 ruling (2026-08-13): selection contracts live in the consumer; Chronicle is a facts-only layer. The national contract re-homed in #707 (uk/uk_national_targets.json, US untyped-resource pattern). Two UK contracts remain Chronicle-side and need the same migration:

  1. uk_local_geography (25 targets, constituency + local-authority) — actively consumed by microcosm.build.uk_runtime.local_targets.metric_names_from_target_profile, which duck-types a Ledger-exported profile object. Migration: translate the profile into a UK resource (same shape as uk_national_targets.json), switch local_targets.py to load it in-repo, keep the metric-name ordering contract (profile order is load-bearing for compute_household_metrics columns).
  2. uk_firms (8 targets, country level, groupby + cross-tab dimension selectors) — declares the firm calibration surface; firm generation currently consumes Chronicle facts directly (uk_firm_source_data_from_ledger_facts), so this is a declaration move with no build-path change until the firm targets compile through the shared reference machinery.

Notes:

  • Selector semantics: both profiles use record_set_id/groupby_dimension/dimensions selectors; the national contract additionally uses dimension_values pins that the reference resolver must honor when Consume Ledger UK facts: uk_target_references, mapping module, and a compile-parity gate #622 compiles — one resolver should serve all three contracts.
  • uk_local_geography's selectors reference wave-3 facts; its own resolution coverage becomes testable consumer-side once the local packages are consumed (chronicle#134 landed the national-side packages).
  • Chronicle-side removal of the profile surface is tracked separately in the chronicle retirement issue; sequence this migration first so nothing consumes a deleted artifact.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions