Skip to content

Fix Stage 12 comparison and UK geography metadata - #702

Draft
anth-volk wants to merge 6 commits into
mainfrom
fix/stage12-comparison-geography
Draft

anth-volk wants to merge 6 commits into
mainfrom
fix/stage12-comparison-geography

Conversation

@anth-volk

@anth-volk anth-volk commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #701

Summary

This PR makes Stage 12 result comparison ignore numeric differences of 0.01 or less and requires complete UK geography metadata before a child simulation reports success.

Changes

  • Compare numeric leaves with decimal arithmetic and an inclusive absolute tolerance of 0.01 while retaining exact artifact digests.
  • Resolve constituency and local-authority names and coordinates from the two canonical PolicyEngine UK lookup files.
  • Fail explicitly when lookup files, result records, names, or coordinates are unavailable.
  • Validate that the Stage 12 service credentials can read the required lookup objects.
  • Document the lookup dependency and its restricted GCS permissions.
  • Add unit tests for the exact 0.01 comparison boundary, UK geography resolution, and deployment validation.

Testing

  • Executor test suite: 611 passed, 24 skipped, and 2 deselected.
  • Focused comparison tests: 6 passed.
  • Black and Ruff checks for the changed comparison modules: passed.
  • git diff --check: passed.

Deployment notes

The staging and production Stage 12 service accounts already have conditional read access to only the two required lookup objects. Activating the runtime changes requires a Stage 12 Modal deployment; this PR does not redirect user traffic.

This branch has not been deployed

No deployments
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.

Fix Stage 12 comparison tolerance and UK geography metadata

1 participant