Skip to content

Add experimental UK firm generator#223

Merged
MaxGhenis merged 3 commits into
mainfrom
codex/experimental-uk-firm-generator-20260629
Jun 30, 2026
Merged

Add experimental UK firm generator#223
MaxGhenis merged 3 commits into
mainfrom
codex/experimental-uk-firm-generator-20260629

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add an experimental UK firm generator under populace.build.uk_runtime
  • add uk_firm_source_data_from_ledger_facts, which consumes Ledger/Arch consumer facts from the uk_firms target profile and reshapes them into the temporary firm-generator matrix contract
  • consume the detailed Ledger firm target surface: ONS SIC-by-turnover, ONS SIC-by-employment, HMRC VAT-registered firms by SIC, and HMRC net VAT liability by SIC
  • use Populace's shared calibration optimizer for firm weights
  • document the hard target-source boundary: production Populace calibration targets are Ledger-owned, and raw administrative tables are only Ledger inputs or explicitly experimental migration-comparison inputs
  • keep the processed-table reader only for paper-repository comparisons

Ledger dependency

Tests

  • uv run ruff check packages/populace-build/src/populace/build/uk_runtime/firm_generation.py packages/populace-build/tests/test_uk_firm_generation.py packages/populace-build/README.md
  • uv run python -m pytest packages/populace-build/tests/test_uk_firm_generation.py
  • cross-repo smoke: emitted 1,439 consumer facts from arch-data#67, rebuilt 88 ONS turnover rows, 88 ONS employment rows, 88 HMRC sector rows, and generated ~2.946M firm rows with a 4-iteration calibration

Review cycle

  • addressed reviewer findings on VAT-registered target alignment, preserved employment calibration assignments, data_vintage target selection, and exact zero-turnover allocation
  • final read-only review reported no actionable findings before the detailed Ledger-target follow-up

@MaxGhenis MaxGhenis force-pushed the codex/experimental-uk-firm-generator-20260629 branch from 99428fc to 243b47f Compare June 29, 2026 22:10
@MaxGhenis MaxGhenis force-pushed the codex/experimental-uk-firm-generator-20260629 branch from 243b47f to a1491e8 Compare June 29, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant