From 927cf40ab44cf09088efbeba2f67b6f059277581 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 13 Aug 2026 13:01:59 -0400 Subject: [PATCH 1/5] Update bundle to policyengine-uk 2.90.2 and policyengine-core 3.30.1 Brings Universal Credit deductions into the certified bundle: the Fair Repayment Rate cap history, latent deduction demand calibrated to DWP deductions statistics, and reform levers (cap changes, per-type abolition, protected minimum floor). Core moves to 3.30.1 to satisfy policyengine-uk 2.90.x. Regenerates the trace TRO sidecars and the UK model version surface snapshot to match. Co-Authored-By: Claude Fable 5 --- changelog.d/bump-pe-uk-deductions.fixed.md | 1 + pyproject.toml | 14 +++++----- src/policyengine/data/bundle/manifest.json | 8 +++--- .../data/bundle/uk.trace.tro.jsonld | 23 ++------------- .../data/bundle/us.trace.tro.jsonld | 4 +-- .../uk_model_surface.json | 2 +- uv.lock | 28 +++++++++---------- 7 files changed, 32 insertions(+), 48 deletions(-) create mode 100644 changelog.d/bump-pe-uk-deductions.fixed.md diff --git a/changelog.d/bump-pe-uk-deductions.fixed.md b/changelog.d/bump-pe-uk-deductions.fixed.md new file mode 100644 index 00000000..6ea53cb6 --- /dev/null +++ b/changelog.d/bump-pe-uk-deductions.fixed.md @@ -0,0 +1 @@ +Update the certified bundle to policyengine-uk 2.90.2 (Universal Credit deductions: Fair Repayment Rate cap, protected floor and abolition reform levers) and policyengine-core 3.30.1. diff --git a/pyproject.toml b/pyproject.toml index 4b9d0118..ca53225c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,16 +44,16 @@ graph = [ "networkx>=3.0", ] models = [ - "policyengine-core==3.30.0", + "policyengine-core==3.30.1", "policyengine-us==1.764.6", - "policyengine-uk==2.89.2", + "policyengine-uk==2.90.2", ] uk = [ - "policyengine-core==3.30.0", - "policyengine-uk==2.89.2", + "policyengine-core==3.30.1", + "policyengine-uk==2.90.2", ] us = [ - "policyengine-core==3.30.0", + "policyengine-core==3.30.1", "policyengine-us==1.764.6", ] dev = [ @@ -70,9 +70,9 @@ dev = [ "towncrier>=24.8.0", "mypy>=1.11.0", "pytest-cov>=5.0.0", - "policyengine-core==3.30.0", + "policyengine-core==3.30.1", "policyengine-us==1.764.6", - "policyengine-uk==2.89.2", + "policyengine-uk==2.90.2", ] [tool.setuptools] diff --git a/src/policyengine/data/bundle/manifest.json b/src/policyengine/data/bundle/manifest.json index d959ce01..61b336e4 100644 --- a/src/policyengine/data/bundle/manifest.json +++ b/src/policyengine/data/bundle/manifest.json @@ -219,18 +219,18 @@ }, "policyengine-core": { "import_name": "policyengine_core", - "install_requirement": "policyengine-core==3.30.0", + "install_requirement": "policyengine-core==3.30.1", "name": "policyengine-core", "role": "runtime_dependency", - "version": "3.30.0" + "version": "3.30.1" }, "policyengine-uk": { "country": "uk", "import_name": "policyengine_uk", - "install_requirement": "policyengine-uk==2.89.2", + "install_requirement": "policyengine-uk==2.90.2", "name": "policyengine-uk", "role": "country_model", - "version": "2.89.2" + "version": "2.90.2" }, "policyengine-us": { "country": "us", diff --git a/src/policyengine/data/bundle/uk.trace.tro.jsonld b/src/policyengine/data/bundle/uk.trace.tro.jsonld index 6f9339c6..094bf378 100644 --- a/src/policyengine/data/bundle/uk.trace.tro.jsonld +++ b/src/policyengine/data/bundle/uk.trace.tro.jsonld @@ -17,7 +17,6 @@ "schema:name": "PolicyEngine", "schema:url": "https://policyengine.org" }, - "schema:dateCreated": "2026-06-19T02:38:00Z", "schema:description": "TRACE TRO for certified runtime bundle uk-5.0.1 covering the bundle manifest, the certified dataset artifact, the country model wheel, and the country data release manifest when it is available.", "schema:name": "policyengine uk certified bundle TRO", "trov:createdWith": { @@ -39,14 +38,6 @@ }, "trov:hasLocation": "data/bundle/manifest.json" }, - { - "@id": "arrangement/1/location/data_release_manifest", - "@type": "trov:ArtifactLocation", - "trov:hasArtifact": { - "@id": "composition/1/artifact/data_release_manifest" - }, - "trov:hasLocation": "https://huggingface.co/datasets/policyengine/populace-uk-private/resolve/populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z/releases/populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z/release_manifest.json" - }, { "@id": "arrangement/1/location/dataset", "@type": "trov:ArtifactLocation", @@ -75,20 +66,12 @@ "@type": "trov:ResearchArtifact", "schema:name": "policyengine.py bundle manifest for uk", "trov:mimeType": "application/json", - "trov:sha256": "2a5575ca561fe577be2bbd1929f5f1b71fa62a9a2c76afe49245b16af5cc9919" - }, - { - "@id": "composition/1/artifact/data_release_manifest", - "@type": "trov:ResearchArtifact", - "schema:name": "populace-data release manifest 0.1.0", - "trov:mimeType": "application/json", - "trov:sha256": "687c5c19ee75aa7959d4eaedf310b10a00036dd8f9c46af4cb712c3f30f02921" + "trov:sha256": "5d9aa3205e131b0dc85aa9419628511d9c72adcb949e4d33fcfb746d46d5d68b" }, { "@id": "composition/1/artifact/dataset", "@type": "trov:ResearchArtifact", "schema:name": "populace_uk_2023", - "trov:mimeType": "application/x-hdf5", "trov:sha256": "f17306ccb2aad7ff0130be3589b560afb2e2a12a943570911cd0c77f07934833" }, { @@ -102,7 +85,7 @@ "trov:hasFingerprint": { "@id": "composition/1/fingerprint", "@type": "trov:CompositionFingerprint", - "trov:sha256": "5efe19004a8447da2a54f30bc8ac840a5f0751298aeda0cd5ef2c07b8068d3cc" + "trov:sha256": "6e5968139d86853070c75cf68b4c6175957d4cae73126e0d2ce867bf7dcee466" } }, "trov:hasPerformance": { @@ -113,12 +96,12 @@ "pe:certifiedForModelVersion": "2.89.2", "pe:compatibilityBasis": "built_with_model_package", "pe:dataBuildId": "populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z", + "pe:dataReleaseManifestStatus": "unavailable", "pe:emittedIn": "repository-bundle", "rdfs:comment": "Certification of build populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z for policyengine-uk 2.89.2.", "trov:accessedArrangement": { "@id": "arrangement/1" }, - "trov:startedAtTime": "2026-06-19T02:38:00Z", "trov:wasConductedBy": { "@id": "trs" } diff --git a/src/policyengine/data/bundle/us.trace.tro.jsonld b/src/policyengine/data/bundle/us.trace.tro.jsonld index f71a6fea..a3a81cec 100644 --- a/src/policyengine/data/bundle/us.trace.tro.jsonld +++ b/src/policyengine/data/bundle/us.trace.tro.jsonld @@ -75,7 +75,7 @@ "@type": "trov:ResearchArtifact", "schema:name": "policyengine.py bundle manifest for us", "trov:mimeType": "application/json", - "trov:sha256": "2a5575ca561fe577be2bbd1929f5f1b71fa62a9a2c76afe49245b16af5cc9919" + "trov:sha256": "5d9aa3205e131b0dc85aa9419628511d9c72adcb949e4d33fcfb746d46d5d68b" }, { "@id": "composition/1/artifact/data_release_manifest", @@ -102,7 +102,7 @@ "trov:hasFingerprint": { "@id": "composition/1/fingerprint", "@type": "trov:CompositionFingerprint", - "trov:sha256": "2b1130fc1d037bca0e294ef98682625a6386043da5b46b29aad97894ec8c865b" + "trov:sha256": "779d704ef9efcc224d088068f7abb4b23fb13b7618e2f8fa360d3b4d0c790109" } }, "trov:hasPerformance": { diff --git a/tests/fixtures/household_calculator_snapshots/uk_model_surface.json b/tests/fixtures/household_calculator_snapshots/uk_model_surface.json index db163a3a..4881a39d 100644 --- a/tests/fixtures/household_calculator_snapshots/uk_model_surface.json +++ b/tests/fixtures/household_calculator_snapshots/uk_model_surface.json @@ -5,7 +5,7 @@ "has_income_tax": true, "has_region_registry": true, "model_package_name": "policyengine-uk", - "num_parameters_bucketed_100s": 22, + "num_parameters_bucketed_100s": 23, "num_variables_bucketed_100s": 8, "region_registry_country": "uk" } diff --git a/uv.lock b/uv.lock index 88c7f22d..66d249aa 100644 --- a/uv.lock +++ b/uv.lock @@ -2820,7 +2820,7 @@ wheels = [ [[package]] name = "policyengine" -version = "5.0.0" +version = "5.0.1" source = { editable = "." } dependencies = [ { name = "diskcache" }, @@ -2897,13 +2897,13 @@ requires-dist = [ { name = "pandas", specifier = ">=2.0.0" }, { name = "plotly", marker = "extra == 'dev'", specifier = ">=5.0.0" }, { name = "plotly", marker = "extra == 'plotting'", specifier = ">=5.0.0" }, - { name = "policyengine-core", marker = "extra == 'dev'", specifier = "==3.30.0" }, - { name = "policyengine-core", marker = "extra == 'models'", specifier = "==3.30.0" }, - { name = "policyengine-core", marker = "extra == 'uk'", specifier = "==3.30.0" }, - { name = "policyengine-core", marker = "extra == 'us'", specifier = "==3.30.0" }, - { name = "policyengine-uk", marker = "extra == 'dev'", specifier = "==2.89.2" }, - { name = "policyengine-uk", marker = "extra == 'models'", specifier = "==2.89.2" }, - { name = "policyengine-uk", marker = "extra == 'uk'", specifier = "==2.89.2" }, + { name = "policyengine-core", marker = "extra == 'dev'", specifier = "==3.30.1" }, + { name = "policyengine-core", marker = "extra == 'models'", specifier = "==3.30.1" }, + { name = "policyengine-core", marker = "extra == 'uk'", specifier = "==3.30.1" }, + { name = "policyengine-core", marker = "extra == 'us'", specifier = "==3.30.1" }, + { name = "policyengine-uk", marker = "extra == 'dev'", specifier = "==2.90.2" }, + { name = "policyengine-uk", marker = "extra == 'models'", specifier = "==2.90.2" }, + { name = "policyengine-uk", marker = "extra == 'uk'", specifier = "==2.90.2" }, { name = "policyengine-us", marker = "extra == 'dev'", specifier = "==1.764.6" }, { name = "policyengine-us", marker = "extra == 'models'", specifier = "==1.764.6" }, { name = "policyengine-us", marker = "extra == 'us'", specifier = "==1.764.6" }, @@ -2921,7 +2921,7 @@ provides-extras = ["plotting", "graph", "models", "uk", "us", "dev"] [[package]] name = "policyengine-core" -version = "3.30.0" +version = "3.30.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "dpath" }, @@ -2945,14 +2945,14 @@ dependencies = [ { name = "standard-imghdr" }, { name = "wheel" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/c0/04/1934fe401c2f654b1e483c08cdbe4b9cd8007a57b4c89e6556cd2bec8cbf/policyengine_core-3.30.0.tar.gz", hash = "sha256:f922e096efa59e748210202b5023ba56d1a1326963e4dc7fed57030247308a35", size = 498324, upload-time = "2026-07-09T17:08:31.67Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a1/9d/f71da3e348ddc52e058c76b72bbc4b2f20abcf0e7389ecd5aca5d550fd14/policyengine_core-3.30.1.tar.gz", hash = "sha256:a16f29fe51ec01a7be2171386f8bd26b9ba55ffc338adb70adcadafe33d9c55f", size = 500419, upload-time = "2026-07-19T15:50:41.288Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/1d/fa/47e01d9f6c62e6fcacc1c9aa62d181e157bcb14beff7a1a4fe39974f52ea/policyengine_core-3.30.0-py3-none-any.whl", hash = "sha256:5e896b469ca1af04d783e84e033c7479344ba4c51a65e8fd043bf44c6b6cd646", size = 244334, upload-time = "2026-07-09T17:08:30.223Z" }, + { url = "https://files.pythonhosted.org/packages/b9/7e/07624d8add8889af1b4af796d36c38b2e2af494b1d78a064fab29e9bea00/policyengine_core-3.30.1-py3-none-any.whl", hash = "sha256:2dbcf5f590a0199a7b7c77fcbbda2ff6bc289f6c6169ca0af3beace35d8b3e63", size = 244846, upload-time = "2026-07-19T15:50:39.651Z" }, ] [[package]] name = "policyengine-uk" -version = "2.89.2" +version = "2.90.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "microdf-python" }, @@ -2962,9 +2962,9 @@ dependencies = [ { name = "tables", version = "3.10.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version == '3.10.*'" }, { name = "tables", version = "3.11.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/55/bc/d9cadc5b91804dab0937506e02463a4146a4c996b3d6cc400599b688eb7a/policyengine_uk-2.89.2.tar.gz", hash = "sha256:9eefdc321799f1b610dc1d72b465b6d35a0595469d67c2e4445529c3063a6ef7", size = 1217538, upload-time = "2026-06-18T10:09:46.6Z" } +sdist = { url = "https://files.pythonhosted.org/packages/40/e1/6652fd4ff8806d81b7c846ce2baeef4b9a8457ed380bb0853419d3cf36d9/policyengine_uk-2.90.2.tar.gz", hash = "sha256:c9baeaded1bb6d6f5ca5fcd962b80a198509513737c194aa867b0ef6d13d6a09", size = 1237478, upload-time = "2026-08-13T05:30:05.961Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/83/db/ce3154ba69b6fcd1e9e922ceee705ef4ddb1f81553da1e63b9296e74a4dc/policyengine_uk-2.89.2-py3-none-any.whl", hash = "sha256:80965d3dd7dc767db9b083820d40262ce543020d5a8880a0cf88da10ae641b24", size = 2001007, upload-time = "2026-06-18T10:09:44.808Z" }, + { url = "https://files.pythonhosted.org/packages/ec/da/658bff2df6094bd7bf2b0f561ff60fd41508adbd0a3af29b4553c83bc678/policyengine_uk-2.90.2-py3-none-any.whl", hash = "sha256:f100ef97e20b29b84138078f1dbc5b83f8857e6bc74b745fc6abef7ea1eeadf2", size = 2034933, upload-time = "2026-08-13T05:30:03.884Z" }, ] [[package]] From bc4d4d70016f7b716e111234e972b73364bf9aed Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 20 Aug 2026 20:12:41 -0400 Subject: [PATCH 2/5] Revert UK certified default to policyengine-uk-data enhanced FRS 2024-25 (1.56.16) Per the UC caseload postmortem (policyengine-uk-data discussion #464): populace_uk_2023 carries 3.26m UC benefit units / GBP36.9bn against ~6.7m / GBP75.8bn admin-OBR truth, because its calibration surface has no benefit targets (microcosm#701). enhanced_frs_2024_25 @1.56.16 measures 6.35m / GBP75.3bn with deductions within ~5-8% of DWP. Certified on the publisher's compatibility claim (manifest commit 2966541f); full suite green (783 passed) as the arbiter. Also fixes the publisher-claim basis vocabulary so claims-certified bundles pass the offline import fallback, and keeps populace_uk_2023 plus the 2023-24 FRS names resolvable via dataset overlays at pinned revisions. Co-Authored-By: Claude Fable 5 --- ...uk-policyengine-uk-data-1.56.16.changed.md | 1 + src/policyengine/data/bundle/manifest.json | 130 +++++++++++------- .../data/bundle/uk.trace.tro.jsonld | 45 ++++-- .../data/bundle/us.trace.tro.jsonld | 4 +- src/policyengine/provenance/certification.py | 5 +- .../uk_model_surface.json | 2 +- tests/test_bundle.py | 18 ++- tests/test_bundle_metadata.py | 12 +- tests/test_certify_data_release.py | 2 +- tests/test_models.py | 10 +- tests/test_release_manifests.py | 54 +++++--- tests/test_uk_regions.py | 4 +- 12 files changed, 183 insertions(+), 104 deletions(-) create mode 100644 changelog.d/certify-uk-policyengine-uk-data-1.56.16.changed.md diff --git a/changelog.d/certify-uk-policyengine-uk-data-1.56.16.changed.md b/changelog.d/certify-uk-policyengine-uk-data-1.56.16.changed.md new file mode 100644 index 00000000..13bc50dc --- /dev/null +++ b/changelog.d/certify-uk-policyengine-uk-data-1.56.16.changed.md @@ -0,0 +1 @@ +Certify the UK populace data release `policyengine-uk-data-1.56.16` (enhanced_frs_2024_25, policyengine-uk 2.90.2) into the PolicyEngine bundle manifest. diff --git a/src/policyengine/data/bundle/manifest.json b/src/policyengine/data/bundle/manifest.json index 61b336e4..e6e002ae 100644 --- a/src/policyengine/data/bundle/manifest.json +++ b/src/policyengine/data/bundle/manifest.json @@ -16,85 +16,99 @@ }, "data_releases": { "uk": { - "build_id": "populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z", + "build_id": "policyengine-uk-data-1.56.16", "bundle_id": "uk-5.0.1", "certification": { + "built_with_model_git_sha": "12a1e028afeef08d8b2d74ee03fd9de3a78b2dd3", "built_with_model_version": "2.89.2", "certified_by": "policyengine.py bundle certification", - "certified_for_model_version": "2.89.2", - "compatibility_basis": "built_with_model_package", - "data_build_id": "populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z" + "certified_for_model_version": "2.90.2", + "compatibility_basis": "legacy_compatible_model_package", + "data_build_fingerprint": "sha256:6bfff835b504094c05342d2b4d770d2d94c8c1adcb15c4468931f53b21a89ea9", + "data_build_id": "policyengine-uk-data-1.56.16" }, "certified_data_artifact": { - "build_id": "populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z", + "build_id": "policyengine-uk-data-1.56.16", "data_package": { - "name": "populace-data", - "version": "0.1.0" + "name": "policyengine-uk-data", + "version": "1.56.16" }, - "dataset": "populace_uk_2023", - "sha256": "f17306ccb2aad7ff0130be3589b560afb2e2a12a943570911cd0c77f07934833", - "uri": "hf://policyengine/populace-uk-private/populace_uk_2023.h5@populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z" + "dataset": "enhanced_frs_2024_25", + "sha256": "e433e532b17bd8ce76030156285816e33d44e93edabd2204adbef71d19a68712", + "uri": "hf://policyengine/policyengine-uk-data-private/enhanced_frs_2024_25.h5@1.56.16" }, "country_id": "uk", "data_package": { - "name": "populace-data", - "release_manifest_path": "releases/populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z/release_manifest.json", - "release_manifest_revision": "populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z", - "repo_id": "policyengine/populace-uk-private", - "repo_type": "dataset", - "version": "0.1.0" + "name": "policyengine-uk-data", + "release_manifest_path": "releases/1.56.16/release_manifest.json", + "release_manifest_revision": "2966541fca275ab5ccb6cfb659b010b1db37ad49", + "repo_id": "policyengine/policyengine-uk-data-private", + "repo_type": "model", + "version": "1.56.16" }, "data_producer": "populace", "datasets": { - "calibration_diagnostics": { - "path": "releases/populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z/calibration_diagnostics.json", - "repo_id": "policyengine/populace-uk-private", - "revision": "populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z", - "sha256": "80b98127020aafb049846e0877a3818476aaf7adf13539d62d512fdd6727745d" + "enhanced_frs_2024_25": { + "path": "enhanced_frs_2024_25.h5", + "repo_id": "policyengine/policyengine-uk-data-private", + "revision": "1.56.16", + "sha256": "e433e532b17bd8ce76030156285816e33d44e93edabd2204adbef71d19a68712" }, - "enhanced_frs_2023_24": { - "path": "enhanced_frs_2023_24.h5", + "enhanced_frs_2024_25_tiny": { + "path": "enhanced_frs_2024_25_tiny.h5", "repo_id": "policyengine/policyengine-uk-data-private", - "revision": "655dd07e4bb9c777b00dac044949611f1feb824f", - "sha256": "584ae33d80ca0431254610a3f8254d132da73477d31966d6446282861ecae50d" + "revision": "1.56.16", + "sha256": "6cbbda7eef1b0b16d62e24a3099dc7959906287d659868d31aa7fc82af598871" }, - "frs_2023_24": { - "path": "frs_2023_24.h5", + "frs_2024_25": { + "path": "frs_2024_25.h5", "repo_id": "policyengine/policyengine-uk-data-private", - "revision": "655dd07e4bb9c777b00dac044949611f1feb824f", - "sha256": "df26d4d7af9d164aa2d064181b39290292d2f62bb26fee6126fc095fc06da292" + "revision": "1.56.16", + "sha256": "d4d29901d7ea0c1f636060d4177a411a39c1977fa9fd23a61af3bb0f030769bd" }, - "populace_uk_2023": { - "path": "populace_uk_2023.h5", - "repo_id": "policyengine/populace-uk-private", - "revision": "populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z", - "sha256": "f17306ccb2aad7ff0130be3589b560afb2e2a12a943570911cd0c77f07934833" + "frs_2024_25_tiny": { + "path": "frs_2024_25_tiny.h5", + "repo_id": "policyengine/policyengine-uk-data-private", + "revision": "1.56.16", + "sha256": "74ca086be959b2942ecbf7755034d94dc6a817f4d9d54f2585a1c6df849d9588" }, - "populace_uk_2023_calibration": { - "path": "populace_uk_2023_calibration.npz", - "repo_id": "policyengine/populace-uk-private", - "revision": "populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z", - "sha256": "fb2fc115fbae53a501b8acbc1529f319b9e07b74478c7bd02d00c674d4c10022" + "local_authority_weights": { + "path": "local_authority_weights.h5", + "repo_id": "policyengine/policyengine-uk-data-private", + "revision": "1.56.16", + "sha256": "6d634d69fb472b80cc17ffe696e028c54d7b739166bb7d9a57860f9d73537aa5" + }, + "local_geography_weights": { + "path": "local_geography_weights.csv.gz", + "repo_id": "policyengine/policyengine-uk-data-private", + "revision": "1.56.16", + "sha256": "6f623e277089d06c2c50ec3d8ab766635f695c8579d360410e3dcb4214ea9709" + }, + "parliamentary_constituency_weights": { + "path": "parliamentary_constituency_weights.h5", + "repo_id": "policyengine/policyengine-uk-data-private", + "revision": "1.56.16", + "sha256": "6870c36072a0c34d2e6ce3ebf58664b7932ca46a9e3808d387988773e63b66d5" } }, - "default_dataset": "populace_uk_2023", - "default_dataset_uri": "hf://policyengine/populace-uk-private/populace_uk_2023.h5@populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z", + "default_dataset": "enhanced_frs_2024_25", + "default_dataset_uri": "hf://policyengine/policyengine-uk-data-private/enhanced_frs_2024_25.h5@1.56.16", "model_package": { "name": "policyengine-uk", - "sha256": "80965d3dd7dc767db9b083820d40262ce543020d5a8880a0cf88da10ae641b24", - "version": "2.89.2", - "wheel_url": "https://files.pythonhosted.org/packages/83/db/ce3154ba69b6fcd1e9e922ceee705ef4ddb1f81553da1e63b9296e74a4dc/policyengine_uk-2.89.2-py3-none-any.whl" + "sha256": "f100ef97e20b29b84138078f1dbc5b83f8857e6bc74b745fc6abef7ea1eeadf2", + "version": "2.90.2", + "wheel_url": "https://files.pythonhosted.org/packages/ec/da/658bff2df6094bd7bf2b0f561ff60fd41508adbd0a3af29b4553c83bc678/policyengine_uk-2.90.2-py3-none-any.whl" }, "policyengine_version": "5.0.1", "region_datasets": { "national": { - "path_template": "populace_uk_2023.h5" + "path_template": "enhanced_frs_2024_25.h5" } }, - "release_manifest_uri": "https://huggingface.co/datasets/policyengine/populace-uk-private/resolve/populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z/releases/populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z/release_manifest.json", + "release_manifest_uri": "https://huggingface.co/policyengine/policyengine-uk-data-private/resolve/2966541fca275ab5ccb6cfb659b010b1db37ad49/releases/1.56.16/release_manifest.json", "schema_version": 1, - "source_manifest_uri": "hf://dataset/policyengine/populace-uk-private@populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z/releases/populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z/release_manifest.json", - "version": "populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z" + "source_manifest_uri": "hf://model/policyengine/policyengine-uk-data-private@2966541fca275ab5ccb6cfb659b010b1db37ad49/releases/1.56.16/release_manifest.json", + "version": "policyengine-uk-data-1.56.16" }, "us": { "build_id": "populace-us-2024-buildp-sparse-rmloss100-cae8640-20260728T011454Z", @@ -185,6 +199,26 @@ } }, "dataset_overlays": { + "uk": { + "enhanced_frs_2023_24": { + "path": "enhanced_frs_2023_24.h5", + "repo_id": "policyengine/policyengine-uk-data-private", + "revision": "655dd07e4bb9c777b00dac044949611f1feb824f", + "sha256": "584ae33d80ca0431254610a3f8254d132da73477d31966d6446282861ecae50d" + }, + "frs_2023_24": { + "path": "frs_2023_24.h5", + "repo_id": "policyengine/policyengine-uk-data-private", + "revision": "655dd07e4bb9c777b00dac044949611f1feb824f", + "sha256": "df26d4d7af9d164aa2d064181b39290292d2f62bb26fee6126fc095fc06da292" + }, + "populace_uk_2023": { + "path": "populace_uk_2023.h5", + "repo_id": "policyengine/populace-uk-private", + "revision": "populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z", + "sha256": "f17306ccb2aad7ff0130be3589b560afb2e2a12a943570911cd0c77f07934833" + } + }, "us": { "populace_us_2024_acs_local": { "path": "populace_us_2024_acs_local.h5", diff --git a/src/policyengine/data/bundle/uk.trace.tro.jsonld b/src/policyengine/data/bundle/uk.trace.tro.jsonld index 094bf378..277655a9 100644 --- a/src/policyengine/data/bundle/uk.trace.tro.jsonld +++ b/src/policyengine/data/bundle/uk.trace.tro.jsonld @@ -17,6 +17,7 @@ "schema:name": "PolicyEngine", "schema:url": "https://policyengine.org" }, + "schema:dateCreated": "2026-08-18T14:20:32.100961Z", "schema:description": "TRACE TRO for certified runtime bundle uk-5.0.1 covering the bundle manifest, the certified dataset artifact, the country model wheel, and the country data release manifest when it is available.", "schema:name": "policyengine uk certified bundle TRO", "trov:createdWith": { @@ -38,13 +39,21 @@ }, "trov:hasLocation": "data/bundle/manifest.json" }, + { + "@id": "arrangement/1/location/data_release_manifest", + "@type": "trov:ArtifactLocation", + "trov:hasArtifact": { + "@id": "composition/1/artifact/data_release_manifest" + }, + "trov:hasLocation": "https://huggingface.co/policyengine/policyengine-uk-data-private/resolve/2966541fca275ab5ccb6cfb659b010b1db37ad49/releases/1.56.16/release_manifest.json" + }, { "@id": "arrangement/1/location/dataset", "@type": "trov:ArtifactLocation", "trov:hasArtifact": { "@id": "composition/1/artifact/dataset" }, - "trov:hasLocation": "https://huggingface.co/datasets/policyengine/populace-uk-private/resolve/populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z/populace_uk_2023.h5" + "trov:hasLocation": "https://huggingface.co/policyengine/policyengine-uk-data-private/resolve/1.56.16/enhanced_frs_2024_25.h5" }, { "@id": "arrangement/1/location/model_wheel", @@ -52,7 +61,7 @@ "trov:hasArtifact": { "@id": "composition/1/artifact/model_wheel" }, - "trov:hasLocation": "https://files.pythonhosted.org/packages/83/db/ce3154ba69b6fcd1e9e922ceee705ef4ddb1f81553da1e63b9296e74a4dc/policyengine_uk-2.89.2-py3-none-any.whl" + "trov:hasLocation": "https://files.pythonhosted.org/packages/ec/da/658bff2df6094bd7bf2b0f561ff60fd41508adbd0a3af29b4553c83bc678/policyengine_uk-2.90.2-py3-none-any.whl" } ] } @@ -66,42 +75,52 @@ "@type": "trov:ResearchArtifact", "schema:name": "policyengine.py bundle manifest for uk", "trov:mimeType": "application/json", - "trov:sha256": "5d9aa3205e131b0dc85aa9419628511d9c72adcb949e4d33fcfb746d46d5d68b" + "trov:sha256": "a7e9b4cd58bf8df9d5c16a01ec78e6c33f708440710bf36bfae4cd3c73db8520" + }, + { + "@id": "composition/1/artifact/data_release_manifest", + "@type": "trov:ResearchArtifact", + "schema:name": "policyengine-uk-data release manifest 1.56.16", + "trov:mimeType": "application/json", + "trov:sha256": "9bfccac472d74b044596205ee153b0c81fcd8d93e84f5820c7081e30f2cab0c5" }, { "@id": "composition/1/artifact/dataset", "@type": "trov:ResearchArtifact", - "schema:name": "populace_uk_2023", - "trov:sha256": "f17306ccb2aad7ff0130be3589b560afb2e2a12a943570911cd0c77f07934833" + "schema:name": "enhanced_frs_2024_25", + "trov:mimeType": "application/x-hdf5", + "trov:sha256": "e433e532b17bd8ce76030156285816e33d44e93edabd2204adbef71d19a68712" }, { "@id": "composition/1/artifact/model_wheel", "@type": "trov:ResearchArtifact", - "schema:name": "policyengine-uk==2.89.2 wheel", + "schema:name": "policyengine-uk==2.90.2 wheel", "trov:mimeType": "application/zip", - "trov:sha256": "80965d3dd7dc767db9b083820d40262ce543020d5a8880a0cf88da10ae641b24" + "trov:sha256": "f100ef97e20b29b84138078f1dbc5b83f8857e6bc74b745fc6abef7ea1eeadf2" } ], "trov:hasFingerprint": { "@id": "composition/1/fingerprint", "@type": "trov:CompositionFingerprint", - "trov:sha256": "6e5968139d86853070c75cf68b4c6175957d4cae73126e0d2ce867bf7dcee466" + "trov:sha256": "62d2502e2797544f5c24156c481e29abe6469ae89f9401ac1182ffa8bf66fe56" } }, "trov:hasPerformance": { "@id": "trp/1", "@type": "trov:TransparentResearchPerformance", + "pe:builtWithModelGitSha": "12a1e028afeef08d8b2d74ee03fd9de3a78b2dd3", "pe:builtWithModelVersion": "2.89.2", "pe:certifiedBy": "policyengine.py bundle certification", - "pe:certifiedForModelVersion": "2.89.2", - "pe:compatibilityBasis": "built_with_model_package", - "pe:dataBuildId": "populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z", - "pe:dataReleaseManifestStatus": "unavailable", + "pe:certifiedForModelVersion": "2.90.2", + "pe:compatibilityBasis": "legacy_compatible_model_package", + "pe:dataBuildFingerprint": "sha256:6bfff835b504094c05342d2b4d770d2d94c8c1adcb15c4468931f53b21a89ea9", + "pe:dataBuildId": "policyengine-uk-data-1.56.16", "pe:emittedIn": "repository-bundle", - "rdfs:comment": "Certification of build populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z for policyengine-uk 2.89.2.", + "rdfs:comment": "Certification of build policyengine-uk-data-1.56.16 for policyengine-uk 2.90.2.", "trov:accessedArrangement": { "@id": "arrangement/1" }, + "trov:startedAtTime": "2026-08-18T14:20:32.100961Z", "trov:wasConductedBy": { "@id": "trs" } diff --git a/src/policyengine/data/bundle/us.trace.tro.jsonld b/src/policyengine/data/bundle/us.trace.tro.jsonld index a3a81cec..38b58f29 100644 --- a/src/policyengine/data/bundle/us.trace.tro.jsonld +++ b/src/policyengine/data/bundle/us.trace.tro.jsonld @@ -75,7 +75,7 @@ "@type": "trov:ResearchArtifact", "schema:name": "policyengine.py bundle manifest for us", "trov:mimeType": "application/json", - "trov:sha256": "5d9aa3205e131b0dc85aa9419628511d9c72adcb949e4d33fcfb746d46d5d68b" + "trov:sha256": "a7e9b4cd58bf8df9d5c16a01ec78e6c33f708440710bf36bfae4cd3c73db8520" }, { "@id": "composition/1/artifact/data_release_manifest", @@ -102,7 +102,7 @@ "trov:hasFingerprint": { "@id": "composition/1/fingerprint", "@type": "trov:CompositionFingerprint", - "trov:sha256": "779d704ef9efcc224d088068f7abb4b23fb13b7618e2f8fa360d3b4d0c790109" + "trov:sha256": "5975fc242e042084987f04f553998bba5426ff36de04d47a80c2acea986e792e" } }, "trov:hasPerformance": { diff --git a/src/policyengine/provenance/certification.py b/src/policyengine/provenance/certification.py index 119558e1..73e4f1db 100644 --- a/src/policyengine/provenance/certification.py +++ b/src/policyengine/provenance/certification.py @@ -65,7 +65,10 @@ CERTIFIED_BY = "policyengine.py bundle certification" BASIS_BUILT_WITH = "built_with_model_package" -BASIS_PUBLISHER_CLAIM = "compatible_model_packages" +# Must match the runtime claims basis in provenance/manifest.py: the offline +# fallback there exempts exactly this string from the fingerprint identity +# check, so a claims-certified bundle stays importable without network access. +BASIS_PUBLISHER_CLAIM = "legacy_compatible_model_package" POPULACE_US_SOURCE_COVERAGE_FILE = "us_source_coverage.json" US_STATE_CODES = ( "AL", diff --git a/tests/fixtures/household_calculator_snapshots/uk_model_surface.json b/tests/fixtures/household_calculator_snapshots/uk_model_surface.json index 4881a39d..80334585 100644 --- a/tests/fixtures/household_calculator_snapshots/uk_model_surface.json +++ b/tests/fixtures/household_calculator_snapshots/uk_model_surface.json @@ -1,6 +1,6 @@ { "country_id": "uk", - "data_package_name": "populace-data", + "data_package_name": "policyengine-uk-data", "has_employment_income": true, "has_income_tax": true, "has_region_registry": true, diff --git a/tests/test_bundle.py b/tests/test_bundle.py index c7f004bd..8e26cd86 100644 --- a/tests/test_bundle.py +++ b/tests/test_bundle.py @@ -34,10 +34,16 @@ def test_bundle_manifest_exposes_data_releases(): assert manifest["bundle_version"] == manifest["policyengine_version"] assert manifest["data_releases"]["us"]["data_producer"] == "populace" assert manifest["data_releases"]["us"]["version"].startswith("populace-us-2024-") + # UK certified default reverted to the policyengine-uk-data enhanced FRS per + # the UC caseload postmortem (policyengine-uk-data discussion #464); the + # "populace" producer label names the strict verification contract, not the + # producing repo. assert manifest["data_releases"]["uk"]["data_producer"] == "populace" - assert manifest["data_releases"]["uk"]["version"].startswith("populace-uk-2023-") + assert manifest["data_releases"]["uk"]["version"].startswith( + "policyengine-uk-data-" + ) assert manifest["data_releases"]["uk"]["default_dataset_uri"].startswith( - "hf://policyengine/populace-uk-private/" + "hf://policyengine/policyengine-uk-data-private/enhanced_frs_" ) @@ -70,14 +76,14 @@ def test_dataset_plans_use_certified_release_metadata(tmp_path): assert len(plans) == 1 assert plans[0].country == "uk" - assert plans[0].data_version.startswith("populace-uk-2023-") + assert plans[0].data_version.startswith("policyengine-uk-data-") assert plans[0].data_producer == "populace" - assert plans[0].repo_type == "dataset" - assert plans[0].destination == tmp_path / "populace_uk_2023.h5" + assert plans[0].repo_type == "model" + assert plans[0].destination == tmp_path / "enhanced_frs_2024_25.h5" assert ( plans[0].expected_sha256 == bundle.get_current_bundle()["data_releases"]["uk"]["datasets"][ - "populace_uk_2023" + "enhanced_frs_2024_25" ]["sha256"] ) diff --git a/tests/test_bundle_metadata.py b/tests/test_bundle_metadata.py index 6975a2d5..f92bb526 100644 --- a/tests/test_bundle_metadata.py +++ b/tests/test_bundle_metadata.py @@ -42,16 +42,16 @@ def test_bundle_manifest_exposes_model_and_country_extras(): assert "policyengine-us-data" not in manifest["packages"] -def test_bundle_manifest_carries_populace_uk_data_release(): +def test_bundle_manifest_carries_uk_data_release(): release = bundle.get_current_bundle()["data_releases"]["uk"] assert release["data_producer"] == "populace" - assert release["data_package"]["name"] == "populace-data" - assert release["data_package"]["repo_type"] == "dataset" - assert release["default_dataset"] == "populace_uk_2023" - assert release["version"].startswith("populace-uk-2023-") + assert release["data_package"]["name"] == "policyengine-uk-data" + assert release["data_package"]["repo_type"] == "model" + assert release["default_dataset"] == "enhanced_frs_2024_25" + assert release["version"].startswith("policyengine-uk-data-") assert release["default_dataset_uri"].startswith( - "hf://policyengine/populace-uk-private/" + "hf://policyengine/policyengine-uk-data-private/" ) diff --git a/tests/test_certify_data_release.py b/tests/test_certify_data_release.py index 48255200..ebc8a9fe 100644 --- a/tests/test_certify_data_release.py +++ b/tests/test_certify_data_release.py @@ -246,7 +246,7 @@ def test__given_claim_only_match__then_publisher_basis_with_warning(self): "1.730.0", ) - assert basis == "compatible_model_packages" + assert basis == "legacy_compatible_model_package" assert len(warnings) == 1 assert "built with 1.723.0" in warnings[0] diff --git a/tests/test_models.py b/tests/test_models.py index c8674811..7e05a69a 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -29,13 +29,13 @@ def test_has_release_manifest_metadata(self): assert uk_latest.release_manifest is not None assert uk_latest.release_manifest.country_id == "uk" assert uk_latest.model_package.name == "policyengine-uk" - assert uk_latest.model_package.version == "2.89.2" - assert uk_latest.data_package.name == "populace-data" - assert uk_latest.data_package.version == "0.1.0" + assert uk_latest.model_package.version == "2.90.2" + assert uk_latest.data_package.name == "policyengine-uk-data" + assert uk_latest.data_package.version == "1.56.16" assert ( uk_latest.default_dataset_uri - == "hf://policyengine/populace-uk-private/populace_uk_2023.h5" - "@populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z" + == "hf://policyengine/policyengine-uk-data-private/enhanced_frs_2024_25.h5" + "@1.56.16" ) def test_has_hundreds_of_parameters(self): diff --git a/tests/test_release_manifests.py b/tests/test_release_manifests.py index c9480798..2768766d 100644 --- a/tests/test_release_manifests.py +++ b/tests/test_release_manifests.py @@ -68,16 +68,21 @@ "hf://policyengine/populace-us/populace_us_2024_acs_local.h5" f"@{US_LOCAL_AREA_RELEASE_ID}" ) -UK_MODEL_VERSION = "2.89.2" +UK_MODEL_VERSION = "2.90.2" UK_BUILT_WITH_MODEL_VERSION = "2.89.2" -UK_DATA_RELEASE_VERSION = "0.1.0" -UK_DATA_RELEASE_ID = "populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z" -UK_DATA_RELEASE_REVISION = UK_DATA_RELEASE_ID -UK_DATA_RELEASE_PATH = f"releases/{UK_DATA_RELEASE_ID}/release_manifest.json" +UK_DATA_RELEASE_VERSION = "1.56.16" +UK_DATA_RELEASE_ID = "policyengine-uk-data-1.56.16" +UK_DATA_RELEASE_REVISION = "2966541fca275ab5ccb6cfb659b010b1db37ad49" +UK_DATA_RELEASE_PATH = "releases/1.56.16/release_manifest.json" +# The prior certified default, kept resolvable via dataset_overlays. +UK_POPULACE_RELEASE_ID = "populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z" +UK_POPULACE_DATASET_URI = ( + f"hf://policyengine/populace-uk-private/populace_uk_2023.h5" + f"@{UK_POPULACE_RELEASE_ID}" +) UK_CERTIFICATION_SOURCE = "policyengine.py bundle certification" UK_CERTIFIED_DATASET_URI = ( - f"hf://policyengine/populace-uk-private/populace_uk_2023.h5" - f"@{UK_DATA_RELEASE_REVISION}" + "hf://policyengine/policyengine-uk-data-private/enhanced_frs_2024_25.h5@1.56.16" ) UK_LEGACY_DATA_RELEASE_REVISION = "655dd07e4bb9c777b00dac044949611f1feb824f" UK_LEGACY_FRS_DATASET_URI = ( @@ -185,20 +190,25 @@ def test__given_uk_manifest__then_has_pinned_model_and_data_packages(self): assert manifest.policyengine_version == POLICYENGINE_VERSION assert manifest.model_package.name == "policyengine-uk" assert manifest.model_package.version == UK_MODEL_VERSION - assert manifest.data_package.name == "populace-data" + assert manifest.data_package.name == "policyengine-uk-data" assert manifest.data_package.version == UK_DATA_RELEASE_VERSION - assert manifest.data_package.repo_id == "policyengine/populace-uk-private" + assert manifest.data_package.repo_id == ( + "policyengine/policyengine-uk-data-private" + ) assert manifest.data_package.release_manifest_path == UK_DATA_RELEASE_PATH assert ( manifest.data_package.release_manifest_revision == UK_DATA_RELEASE_REVISION ) assert manifest.certified_data_artifact is not None assert manifest.certified_data_artifact.build_id == UK_DATA_RELEASE_ID - assert manifest.certified_data_artifact.dataset == "populace_uk_2023" + assert manifest.certified_data_artifact.dataset == "enhanced_frs_2024_25" assert manifest.certified_data_artifact.uri == UK_CERTIFIED_DATASET_URI assert manifest.certification is not None assert manifest.certification.data_build_id == UK_DATA_RELEASE_ID - assert manifest.certification.compatibility_basis == "built_with_model_package" + assert ( + manifest.certification.compatibility_basis + == "legacy_compatible_model_package" + ) assert manifest.certification.certified_by == UK_CERTIFICATION_SOURCE assert ( manifest.certification.built_with_model_version @@ -231,7 +241,7 @@ def test__given_dataset_explicit_revision__then_resolves_to_that_revision(self): ) def test__given_uk_dataset_name__then_resolves_to_versioned_hf_url(self): - resolved = resolve_dataset_reference("uk", "populace_uk_2023") + resolved = resolve_dataset_reference("uk", "enhanced_frs_2024_25") assert resolved == UK_CERTIFIED_DATASET_URI @@ -243,6 +253,10 @@ def test__given_uk_legacy_dataset_names__then_resolves_bundled_aliases(self): resolve_dataset_reference("uk", "enhanced_frs_2023_24") == UK_LEGACY_ENHANCED_FRS_DATASET_URI ) + assert ( + resolve_dataset_reference("uk", "populace_uk_2023") + == UK_POPULACE_DATASET_URI + ) def test__given_explicit_url__then_resolution_is_noop(self): url = "hf://policyengine/policyengine-us-data/cps_2023.h5@1.73.0" @@ -850,11 +864,11 @@ def test__given_manifest_certification__then_release_bundle_exposes_it(self): bundle = model_version.release_bundle assert bundle["bundle_id"] == f"uk-{POLICYENGINE_VERSION}" - assert bundle["default_dataset"] == "populace_uk_2023" + assert bundle["default_dataset"] == "enhanced_frs_2024_25" assert bundle["default_dataset_uri"] == manifest.default_dataset_uri assert bundle["certified_data_build_id"] == UK_DATA_RELEASE_ID assert bundle["data_build_model_version"] == UK_BUILT_WITH_MODEL_VERSION - assert bundle["compatibility_basis"] == "built_with_model_package" + assert bundle["compatibility_basis"] == "legacy_compatible_model_package" assert bundle["certified_by"] == UK_CERTIFICATION_SOURCE def test__given_runtime_certification__then_release_bundle_prefers_runtime_value( @@ -1020,21 +1034,23 @@ def test__given_uk_managed_dataset_name__then_resolves_within_bundle(self): with patch.object( uk_model, "materialize_dataset_source", - return_value="/tmp/populace_uk_2023.h5", + return_value="/tmp/enhanced_frs_2024_25.h5", ): - microsim = uk_model.managed_microsimulation(dataset="populace_uk_2023") + microsim = uk_model.managed_microsimulation( + dataset="enhanced_frs_2024_25" + ) dataset = mock_microsimulation.call_args.kwargs["dataset"] - assert dataset == "/tmp/populace_uk_2023.h5" + assert dataset == "/tmp/enhanced_frs_2024_25.h5" assert ( microsim.policyengine_bundle["policyengine_version"] == POLICYENGINE_VERSION ) - assert microsim.policyengine_bundle["runtime_dataset"] == "populace_uk_2023" + assert microsim.policyengine_bundle["runtime_dataset"] == "enhanced_frs_2024_25" assert microsim.policyengine_bundle["runtime_dataset_uri"] == ( UK_CERTIFIED_DATASET_URI ) dataset_source = microsim.policyengine_bundle["runtime_dataset_source"] - assert dataset_source == "/tmp/populace_uk_2023.h5" + assert dataset_source == "/tmp/enhanced_frs_2024_25.h5" def test__given_uk_unmanaged_dataset_uri__then_source_is_not_rewritten(self): dataset = "hf://policyengine/policyengine-uk-data-private/frs_2022_23.h5@1.40.4" diff --git a/tests/test_uk_regions.py b/tests/test_uk_regions.py index 87a2edd3..8327cee2 100644 --- a/tests/test_uk_regions.py +++ b/tests/test_uk_regions.py @@ -72,8 +72,8 @@ def test__given_uk_registry__then_has_national_region(self): assert national.region_type == "national" assert ( national.dataset_path - == "hf://policyengine/populace-uk-private/populace_uk_2023.h5" - "@populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z" + == "hf://policyengine/policyengine-uk-data-private/enhanced_frs_2024_25.h5" + "@1.56.16" ) assert not national.requires_filter From a97d3f41b6cb99c3f129fc587f396528d2c92c2b Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 20 Aug 2026 20:16:00 -0400 Subject: [PATCH 3/5] Trigger CI Co-Authored-By: Claude Fable 5 From 195351b867dffe7ad5eb30e7623c2e8592a4f791 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 20 Aug 2026 20:56:40 -0400 Subject: [PATCH 4/5] Align core pin, lock, and bundle metadata after the main merge The merge took main's policyengine-core==3.30.0 pins while policyengine-uk 2.90.2 requires 3.30.1; synced via bundle.py update-packages, regenerated derived artifacts and the lock, and stamped the UK bundle id at the current package version (the editable install's stale dist-info had pinned it at 5.0.1). Co-Authored-By: Claude Fable 5 --- changelog.d/bundle-update.fixed.md | 1 + pyproject.toml | 8 ++++---- src/policyengine/data/bundle/manifest.json | 4 ++-- src/policyengine/data/bundle/uk.trace.tro.jsonld | 4 ++-- src/policyengine/data/bundle/us.trace.tro.jsonld | 4 ++-- uv.lock | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 changelog.d/bundle-update.fixed.md diff --git a/changelog.d/bundle-update.fixed.md b/changelog.d/bundle-update.fixed.md new file mode 100644 index 00000000..85318282 --- /dev/null +++ b/changelog.d/bundle-update.fixed.md @@ -0,0 +1 @@ +Update the certified PolicyEngine bundle pins. diff --git a/pyproject.toml b/pyproject.toml index 418ab470..08adbc67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,16 +44,16 @@ graph = [ "networkx>=3.0", ] models = [ - "policyengine-core==3.30.0", + "policyengine-core==3.30.1", "policyengine-us==1.764.6", "policyengine-uk==2.90.2", ] uk = [ - "policyengine-core==3.30.0", + "policyengine-core==3.30.1", "policyengine-uk==2.90.2", ] us = [ - "policyengine-core==3.30.0", + "policyengine-core==3.30.1", "policyengine-us==1.764.6", ] dev = [ @@ -70,7 +70,7 @@ dev = [ "towncrier>=24.8.0", "mypy>=1.11.0", "pytest-cov>=5.0.0", - "policyengine-core==3.30.0", + "policyengine-core==3.30.1", "policyengine-us==1.764.6", "policyengine-uk==2.90.2", ] diff --git a/src/policyengine/data/bundle/manifest.json b/src/policyengine/data/bundle/manifest.json index 3409c343..aac15652 100644 --- a/src/policyengine/data/bundle/manifest.json +++ b/src/policyengine/data/bundle/manifest.json @@ -253,10 +253,10 @@ }, "policyengine-core": { "import_name": "policyengine_core", - "install_requirement": "policyengine-core==3.30.0", + "install_requirement": "policyengine-core==3.30.1", "name": "policyengine-core", "role": "runtime_dependency", - "version": "3.30.0" + "version": "3.30.1" }, "policyengine-uk": { "country": "uk", diff --git a/src/policyengine/data/bundle/uk.trace.tro.jsonld b/src/policyengine/data/bundle/uk.trace.tro.jsonld index 7a46db6b..5e1b57a5 100644 --- a/src/policyengine/data/bundle/uk.trace.tro.jsonld +++ b/src/policyengine/data/bundle/uk.trace.tro.jsonld @@ -75,7 +75,7 @@ "@type": "trov:ResearchArtifact", "schema:name": "policyengine.py bundle manifest for uk", "trov:mimeType": "application/json", - "trov:sha256": "2b3af8a115263426f9bb05f0c01a110ccf36599e8518711ed2b0fe5c389a2440" + "trov:sha256": "05ddf9730091a5002e80ba3784341db21ec3a897581b43e841db4daa82660984" }, { "@id": "composition/1/artifact/data_release_manifest", @@ -102,7 +102,7 @@ "trov:hasFingerprint": { "@id": "composition/1/fingerprint", "@type": "trov:CompositionFingerprint", - "trov:sha256": "aa57d5797cbb677c41ea6fa5ff735f611c7c092e755f748daf475313a936bf47" + "trov:sha256": "6ad9deafcf7e6fd3c4055f46c63f3842ea6ffa9d2780810e5575c75ba710c2cb" } }, "trov:hasPerformance": { diff --git a/src/policyengine/data/bundle/us.trace.tro.jsonld b/src/policyengine/data/bundle/us.trace.tro.jsonld index 6d543b6c..bc9572bb 100644 --- a/src/policyengine/data/bundle/us.trace.tro.jsonld +++ b/src/policyengine/data/bundle/us.trace.tro.jsonld @@ -75,7 +75,7 @@ "@type": "trov:ResearchArtifact", "schema:name": "policyengine.py bundle manifest for us", "trov:mimeType": "application/json", - "trov:sha256": "2b3af8a115263426f9bb05f0c01a110ccf36599e8518711ed2b0fe5c389a2440" + "trov:sha256": "05ddf9730091a5002e80ba3784341db21ec3a897581b43e841db4daa82660984" }, { "@id": "composition/1/artifact/data_release_manifest", @@ -102,7 +102,7 @@ "trov:hasFingerprint": { "@id": "composition/1/fingerprint", "@type": "trov:CompositionFingerprint", - "trov:sha256": "c18fc372ad1c1526ba0097c96b78b266f3121dad539f7ab27a362bb234400cdf" + "trov:sha256": "e4a9712269f9bcefbcec83673bbb2afdb5f2e37effc9124a4323250237a9fe42" } }, "trov:hasPerformance": { diff --git a/uv.lock b/uv.lock index 66d249aa..4b5b4430 100644 --- a/uv.lock +++ b/uv.lock @@ -2820,7 +2820,7 @@ wheels = [ [[package]] name = "policyengine" -version = "5.0.1" +version = "5.0.2" source = { editable = "." } dependencies = [ { name = "diskcache" }, From 2505c344d4668fcbf90691332c90fea99b0fc2db Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 21 Aug 2026 06:48:40 -0400 Subject: [PATCH 5/5] Update docs for the claims basis string and the UK default dataset Addresses the second reviewer's findings: the certification docs taught the retired compatibility_basis value, and countries.md still named the previous UK default. Co-Authored-By: Claude Fable 5 --- docs/countries.md | 2 +- docs/engineering/skills/data-certification.md | 2 +- docs/release-bundles.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/countries.md b/docs/countries.md index b8d63bc2..26553627 100644 --- a/docs/countries.md +++ b/docs/countries.md @@ -33,7 +33,7 @@ Override in any output with `income_variable=`. | | Dataset | |---|---| | US | Populace US 2024 (`populace_us_2024.h5`) | -| UK | Populace UK 2023 (`populace_uk_2023.h5`) | +| UK | Enhanced FRS 2024-25 (`enhanced_frs_2024_25.h5`, policyengine-uk-data) | ## State / regional breakdown diff --git a/docs/engineering/skills/data-certification.md b/docs/engineering/skills/data-certification.md index 8c61e5ea..f5319517 100644 --- a/docs/engineering/skills/data-certification.md +++ b/docs/engineering/skills/data-certification.md @@ -80,7 +80,7 @@ state overlay artifacts when `--regional-manifest-uri` is used, unknown country. Certification gate: the model version must either exactly match the build-time model (`compatibility_basis: built_with_model_package`) or be covered by the publisher's `compatible_model_packages` claim -(`compatibility_basis: compatible_model_packages`, recorded with a +(`compatibility_basis: legacy_compatible_model_package`, recorded with a warning — the publisher's claim is made good only by this repo's test suite passing on the pinned pair). Neither basis means certification is refused: a new data build or a published compatibility claim is required. diff --git a/docs/release-bundles.md b/docs/release-bundles.md index a362630e..cc9c5126 100644 --- a/docs/release-bundles.md +++ b/docs/release-bundles.md @@ -544,7 +544,7 @@ Things that should usually not affect the fingerprint: 1. the model version exactly matches the `built_with_model_package.version` (`compatibility_basis: built_with_model_package`) 2. the data publisher's `compatible_model_packages` covers the model version - (`compatibility_basis: compatible_model_packages` — the publisher's claim, + (`compatibility_basis: legacy_compatible_model_package` — the publisher's claim, recorded with a warning and made good by the test suite passing on the pinned pair)