Skip to content

Require PolicyEngine 6.2.7 for regional simulations - #3868

Draft
anth-volk wants to merge 6 commits into
masterfrom
fix/3864-acs-local-regional-defaults
Draft

anth-volk wants to merge 6 commits into
masterfrom
fix/3864-acs-local-regional-defaults

Conversation

@anth-volk

@anth-volk anth-volk commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #3864

Summary

  • Require published policyengine[models]==6.2.7 in the API runtime and generic container image, and regenerate the frozen lockfile for that release.
  • Use the bundle's exact Core 3.33.0, US 2.2.1, UK 2.125.1 and SPM calculator 1.0.0 requirements; do not select country packages independently.
  • Verify that the national US default remains populace_us_2024, and that states and congressional districts use the certified populace_us_2024_acs_local dataset through standard region_datasets metadata rather than dataset_overlays.
  • Update complete installed-catalog expectations for the 6.2.7 bundle.
  • Support England's multi-value region filter in catalog extraction. Flat list/tuple membership values are stored as compact JSON arrays in the existing text column; scalar values retain their previous representation. Invalid, empty, nested or oversized membership values fail before database access.
  • Assert that the real installed England filter retains all nine English regions.
  • Update the existing bundle changelog fragment.

Dependency and merge order

Rebased onto API master at 21ddf3476f801d09239dc49e6352c756800f63ee.

PolicyEngine 6.2.7 is published and retains the certified regional mappings from PolicyEngine/policyengine.py#552 and the temporary ACS WIC participation fix from #566. The runtime declarations, generic Docker pin and generated lockfile all request 6.2.7; no pending-publication dependency mismatch remains.

PolicyEngine/policyengine-sim-api#746 already updated simulation main to 6.2.7. The remaining regional metadata and Stage 12 integration is PolicyEngine/policyengine-sim-api#726. Merge and successfully deploy #726 before this API PR. The existing simulation-bundle compatibility requirement is unchanged and must confirm support for 6.2.7 before API deployment.

Catalog compatibility

The real 6.2.7 import exposed England's membership filter: its variable_value is a list of nine UK regions, not a scalar. The importer now preserves the complete list without a schema migration. Both existing SQLModel columns remain unchanged, including their 255-character limit.

The installed catalog contains 7,275 variables, 29,299 parameter nodes, 104,140 parameters, 1,193,952 parameter values, three datasets and 826 regions. Exact count assertions remain in the integration test so future country-package changes require explicit review.

Validation after update

  • Installed the regenerated frozen environment and confirmed PolicyEngine 6.2.7 and its certified country/core dependencies.
  • Constants and catalog-extraction unit tests: 69 passed.
  • Catalog publication and metadata-service unit tests: 25 passed.
  • Complete installed-catalog compatibility test, including exact counts, regional dataset selection and the nine-region England filter: passed.
  • uv lock --check, changed-file Ruff lint, repository formatting and git diff --check: passed.
  • Migration quality guards: passed. Regenerated migration-contract artifacts have no tracked changes.
  • The complete API suite, database-backed integration suite, container builds and live deployment checks were not run manually for this update.

Deployment scope

Existing Flask/API v1 routes and compute delegation remain in place. This change introduces no route cutover, public HTTP schema change, Alembic revision, database provisioning, environment variable, secret, service account or deployment target. No running infrastructure or traffic was modified.

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.25%. Comparing base (21ddf34) to head (3c7c0e7).

Files with missing lines Patch % Lines
policyengine_api/data/v2/catalog/extraction.py 60.00% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3868      +/-   ##
==========================================
+ Coverage   45.22%   45.25%   +0.02%     
==========================================
  Files         183      183              
  Lines       11073    11085      +12     
  Branches     1905     1907       +2     
==========================================
+ Hits         5008     5016       +8     
- Misses       5644     5647       +3     
- Partials      421      422       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@anth-volk anth-volk changed the title Require PolicyEngine 6.2.2 for regional simulations Require PolicyEngine 6.2.5 for regional simulations Oct 9, 2026
@anth-volk
anth-volk force-pushed the fix/3864-acs-local-regional-defaults branch from 301109c to 3c7c0e7 Compare October 12, 2026 12:46
@anth-volk anth-volk changed the title Require PolicyEngine 6.2.5 for regional simulations Require PolicyEngine 6.2.7 for regional simulations Oct 12, 2026

This branch had an error being deployed

1 failed deployment
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.

State society-wide reports run on the sparse national dataset

1 participant