Repository navigation
Score new bills on the ACS local-area release; keep 2026 scores on theirs - #240
Conversation
…eirs App v3 runs a state report on the Microcosm ACS local-area release (policyengine.py 6.20.x routes state regions to populace-us-2024-buildo-acs-local-766b7c7-20261017T030317Z), but the tracker scored every state bill on the archived policyengine-us-data state files. New scores now use the ACS local-area release; the 2026 scores stay on the dataset they were computed on. - compute_impacts.py picks a dataset per reform (choose_state_dataset): --state-dataset or TRACKER_STATE_DATASET wins; a stored score keeps its dataset (a recompute or another year of a 2026 analysis stays on the us-data files); a new score uses `acs-local-766b7c7`. The run prints the choice and its reason for each reform. - `acs-local-766b7c7` reads the per-state slices child-poverty-impact- dashboard cut from the release (Modal Volume cpid-populace-slices, 766b7c7/<ST>.h5; each state's households, weights unchanged, 119th Congress districts). A slice is downloaded once into ~/.cache/policyengine-tracker (TRACKER_DATASET_CACHE) and must match its SHA-256 in scripts/data/acs_local_766b7c7_slices.json, which pins all 51 (1,586,908 households, the release's count). Missing parent_1_id and parent_2_id on the ASEC/PUF records become 0, as current policyengine-us refuses missing inputs. Records store dataset_name microcosm-us-2024-local and the build id as dataset_version. - publish-reform.yml installs modal and passes the Modal token to the compute step. - The analysis footer names the dataset a score ran on (src/lib/datasetLabel.js): "-microcosm:acs-local-766b7c7" linking the release, or the "-us-data:v…" label the 2026 scores always had. - score-bill and encode-bill docs describe the two datasets. Checked on Modal: under policyengine-us 2.156.9 the Kansas slice fails to load without the parent-id fill and loads with it; KS HB2620 (EITC 17% to 18%) changes state income tax by -$4.98M against the fiscal note's -$5.0M, across KS-01 to KS-04. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PavelMakarchuk
left a comment
There was a problem hiding this comment.
Review at d72a679
This PR changes the state dataset that the tracker uses for new state scores. compute_impacts.py now chooses a dataset for each reform with choose_state_dataset. An explicit choice wins. A reform with a stored score keeps the dataset of that score. A new score uses the per-state slices of the Microcosm ACS local-area release populace-us-2024-buildo-acs-local-766b7c7-20261017T030317Z. The slices come from a Modal Volume and must match the SHA-256 values in a pinned manifest. Each score records the dataset name, the build and the Hugging Face revision. The analysis footer now names the dataset of each score.
Verdict: REQUEST_CHANGES
The dataset rule, the provenance and the release are correct. The release, revision and file hash agree with the policyengine.py 6.20.0 bundle that App v3 uses. One item blocks: the PR does not say that the release has no state income tax calibration target, and it gives one state as evidence for the main use.
SHOULD ADDRESS
- New state income tax scores run on a release with no state income tax target, and the PR does not say so.
scripts/compute_impacts.py:593(compute_budgetary_impactsumsstate_income_tax),scripts/compute_impacts.py:187(DEFAULT_STATE_DATASET).- Case: the headline revenue number of every new state bill now comes from the ACS local-area slice. In the calibration dashboard, the local release has no
state_income_taxrow for any state. The national release has one for 44 states. The local release does calibrate the SOI income distribution by state (AGI and filer counts by income range), so the tax base is constrained, but total collections are not. The only evidence in the PR is one state: KS HB2620 gives -$4.98M against a fiscal note of -$5.0M. The same bill on the 2026 files gives -$4.0M, so the two datasets can differ by about 25% for one bill. - Fix: state the missing target in the description and in
score-bill.md("State Datasets"). Add a small check across more states: for example, the baselinestate_income_taxtotal on the slice against Census collections and against the 2026 files, for the states of the open 2026 bills. Put the table in the description. No code change is necessary if the totals are close.
- Case: the headline revenue number of every new state bill now comes from the ACS local-area slice. In the calibration dashboard, the local release has no
SUGGESTION
-
publish-reform.ymlalways scores on the ACS local-area release, also for an existing reform id..github/workflows/publish-reform.yml:159,scripts/compute_impacts.py:1202,scripts/publish_analysis.py:70.- Case: the offline path (
--reform-json) sets"computed": Falseand has nodataset_name, sochoose_state_datasetalways returns "new score". If the router dispatches an id that already has a 2026 score (for example, after a correction),publish_analysis.pyupserts the new row, and the 2026 score moves to the ACS release. The description says that "rule 2 holds even with--force" and that nothing recomputes the existing scores. This path is an exception. - Fix: add an optional
state_datasetworkflow input that the step passes as--state-dataset. Alternatively, makepublish_analysis.pyrefuse to replace a row whosedataset_nameis different. At a minimum, say in the description and in the workflow comment that this path always scores as new.
- Case: the offline path (
-
A stored ACS score follows the default build, not its own build.
scripts/compute_impacts.py:220.- Case: the rule compares only
dataset_name(microcosm-us-2024-local). When a later build becomesDEFAULT_STATE_DATASET, a recompute of a 766b7c7 score moves to the new build. The 2026 scores stay pinned. This does not agree with "keeps the dataset it was computed on". Also, migrated rows that storeenhanced_cps_2024go tous-data-cd119, but the printed reason says "keeps its stored score's dataset (enhanced_cps_2024)". - Fix: match on
dataset_versiontoo (find the source whosedataset_versionis the stored version), or document that "same dataset" means "same family". Print the source name in the reason, not the stored name.
- Case: the rule compares only
-
A multi-year record can mix datasets and record only one.
scripts/compute_impacts.py:1011,:1052.- Case:
impacts_by_year[year]stores no dataset name or version. The rootdataset_nameanddataset_versionare overwritten by each write. The default rule keeps all years of one bill on one dataset, so this happens only with--state-datasetorTRACKER_STATE_DATASET. Then the year selector shows years from two datasets, and the footer names only the last one. - Fix: store
datasetNameanddatasetVersionin eachimpacts_by_yearentry. Alternatively, refuse an explicit choice that differs from the stored dataset when--multi-yearis set.
- Case:
-
Bills on two datasets appear side by side with no label.
src/components/RedesignHome.jsx:1112.- Case: the home feed shows revenue, poverty and winners for each bill. After this PR, a 2026 Kansas bill on the 2026 files and a new Kansas bill on the ACS release appear next to each other. Only the footer inside the analysis names the dataset. With the HB2620 gap above, a reader can compare two numbers that do not have the same basis.
- Fix: say this in the description. As a follow-up, show the dataset (or "2026 data") on each card, or add one sentence on the state page.
-
At-large states get no district results on the ACS release.
scripts/compute_impacts.py:789.- Case: Microcosm gives at-large states and DC district
00, so Alaska is 200 and Delaware is 1000. The live district targets of this release use0200,1000,1100,3800,4600,5000and5600. The tracker expectsstate_fips * 100 + 1. A new bill in AK, DE, ND, SD, VT, WY or DC therefore prints a GEOID warning and stores nodistrict_impacts. The map shows an at-large note for these states, so the page does not change. But the stored record has no district results, and the warning looks like an error. - Fix: for a one-district state, accept
state_fips * 100as district 1. Confirm on the AK slice.
- Case: Microcosm gives at-large states and DC district
-
The data source table in
score-bill.mdis out of date..claude/commands/score-bill.md:173.- Case: the row "Statewide (budget, poverty, deciles) | PolicyEngine API | Enhanced CPS (remote)" is not correct.
compute_impacts.pycomputes all statewide results from the same state dataset as the district results. A reader can conclude that the dataset choice affects only the district map. The PR edits the next row, so this is a good time to fix it. - Fix: change the row to "Local Microsimulation" on the chosen state dataset, and remove the API polling steps above it.
- Case: the row "Statewide (budget, poverty, deciles) | PolicyEngine API | Enhanced CPS (remote)" is not correct.
-
The tracker and App v3 share a dataset, but not a model version. Description and
scripts/compute_impacts.py:160.- Case: policyengine.py 6.20.0 pins
policyengine-us==2.2.2.publish-reform.ymlinstalls the latest policyengine-us (the author used 2.156.9). The same reform can thus give different numbers in App v3 and in the tracker. The parent-id fill is necessary only because of the newer model. - Fix: add one sentence to the description and to the code comment.
- Case: policyengine.py 6.20.0 pins
What I checked
- Diff. I read all 10 files and the full
compute_impacts.py(loader, dataset choice, slice fetch, simulations, impact functions, Supabase write and main loop),publish_analysis.pyandmerge_research_metadata.py. - Dataset rule. Explicit choice, then a stored
dataset_nameequal to the ACS name, then any stored name orcomputed: truegivesus-data-cd119, else ACS. "New" means no stored score. Recompute,--forceand--multi-yearon a 2026 bill stay on the 2026 files. Every write (single year, multi-year and offline) recordsdataset_name,dataset_version, and inmodel_notesthe Congress and the source revision. The footer readsdataset_namethroughselect('*'). - Release against App v3. The policyengine.py 6.20.0 bundle uses this release for
stateregions, with revision28f355b8931d14fd9705ebe818554f578f1719d6. The Hugging Face paths-info call for that revision gives LFS SHA-2563ce781c4…838d6cand 9,819,603,807 bytes, as in the manifest. The footer link returns 200. The manifest has 51 slices (50 states and DC) with 1,586,908 households in total, the count in the PR. - Slice loading.
Microsimulationin current policyengine-us accepts aUSSingleYearDatasetand extends it.parent_1_idandparent_2_iduse 0 for "unknown" in the model, so the fill is correct. Each simulation gets its own loaded copy. - Failure behavior. A Modal error, a hash mismatch or a state that is not in the manifest raises an error for that reform. The run reports "error" and exits with 1. Nothing falls back to the 2026 files, so one score never mixes two datasets. A bad download leaves no file. A state that is not in the manifest gives only a bare
KeyError, but all 50 states and DC are present. - Workflow.
MODAL_TOKEN_IDandMODAL_TOKEN_SECRETexist as repository secrets, anddeploy.ymlandpublish-bill.ymlalready use them. I could not confirm that the token can read thecpid-populace-slicesvolume. The dry run that the description proposes would confirm it. - Tests.
pytest scripts/test_compute_impacts_datasets.py: 20 passed (one pandas FutureWarning from the test's object column).bun run test(vitest): 77 passed in 8 files. eslint on the changed JS files: clean.bun run build: passes. ruff oncompute_impacts.pygives one new style finding (f.writein a loop) and the other findings are already on main. - CI. The repository has no workflow that runs on pull requests, so no checks are reported for this branch.
- Related work. PR 239 (open) adds
{state}-{bill}-{year}ids from the 2027 sessions on. These ids have no stored score, so they score on the ACS release, as the tests here expect (ky-hb1-2027).
…' pin Addresses review of d72a679. - A stored score matches its source on dataset_version (an ACS build stays on its build after a later default) or, for the 2026 files, on its name; a stored build no source lists is an error. The printed reason names the source and what was stored. - publish-reform.yml takes an optional state_dataset input, and publish_analysis.py refuses to replace a stored score computed on another dataset unless that input (--allow-dataset-change) is set. publish-analysis.yml gets allow_dataset_change. - Each impacts_by_year entry records its dataset; older years take the stored row's. The footer lists each year's dataset when they differ. - An at-large state's district 00 (Microcosm) reads as district 1. - The us-data-cd119 pin (21280dca) was not a commit of the Hugging Face repo, so every 2026-file download failed; pin the repo's head, 6c57bd60. - score-bill.md: every result comes from the local Microsimulation on the chosen dataset; the release has no state income tax target (with the check's summary); model version and side-by-side notes. - f.writelines for the slice download. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the review. All of it is addressed in 5c6986c; the description is updated to match. Should address 1, state income tax target.
The totals aren't uniformly close, so I didn't call this settled; the description puts the table in front of the decision. S1, publish-reform always scores as new. Added an optional S2, stored ACS score follows the default. A stored score now matches on S3, multi-year mixes datasets. Each S4, cards side by side. Said in the description; a per-card label is listed as a follow-up. S5, at-large districts. On the slices every household in AK, DE, ND, SD, VT, WY and DC is in district S6, data source table. Fixed: statewide and district results both come from the local Microsimulation on the chosen dataset. I removed the API polling steps and the stale output sample. S7, model version. One sentence in the description, ruff. The slice download uses One more fix. The check turned up that the Checks: 26 + 8 Python tests, 80 vitest tests, eslint, |
PavelMakarchuk
left a comment
There was a problem hiding this comment.
Review at 5c6986c
This PR moves new state scores in the tracker to the per-state slices of the Microcosm ACS local-area release populace-us-2024-buildo-acs-local-766b7c7-20261017T030317Z. A stored score keeps the dataset it was computed on. The new commit answers the earlier review. It adds the state income tax check, a dataset guard in publish_analysis.py, a match on the stored build, per-year datasets, an at-large district fix and doc updates. It also fixes the us-data-cd119 Hugging Face pin, which pointed to a commit that does not exist.
Verdict: REQUEST_CHANGES
Thanks, David. The answer is thorough, and the 31-state table is good evidence. Eight of the nine earlier items are fixed. One fix does not reach the real code path: the loader never reads dataset_version, so a stored ACS score still follows the default build.
Earlier items
| Item | Status at 5c6986c |
|---|---|
| SHOULD ADDRESS 1: no state income tax target, one state as evidence | Fixed. The description and score-bill.md state the missing target. The description has a 31-state table against Census FY2025 collections. |
SUGGESTION 1: publish-reform.yml always scores as new |
Fixed. New state_dataset input. publish_analysis.py refuses to move a stored score without --allow-dataset-change. |
| SUGGESTION 2: a stored ACS score follows the default build | Not fixed on the real path. The new function is correct, but load_reforms_from_db does not pass dataset_version to it. See SHOULD ADDRESS 1. The printed reason now names the source (fixed). |
| SUGGESTION 3: a multi-year record mixes datasets | Fixed. Each impacts_by_year entry stores datasetName and datasetVersion. The footer lists each year when they differ. |
| SUGGESTION 4: bills on two datasets side by side | Fixed as asked. The description and score-bill.md say it. A per-card label is a follow-up. |
| SUGGESTION 5: at-large states get no district results | Fixed. at_large_district_geoids reads district 00 as district 1 for one-district states, with a test. |
| SUGGESTION 6: data source table out of date | Fixed. Statewide and district rows both say "Local Microsimulation". The API polling steps are removed. |
| SUGGESTION 7: model version differs from App v3 | Fixed. One sentence in the description, score-bill.md and two code comments. |
ruff style finding (f.write in a loop) |
Fixed. f.writelines. ruff shows the 4 findings that main has. |
SHOULD ADDRESS
- A stored ACS score still follows the default build, because the loader does not read
dataset_version.scripts/compute_impacts.py:105and:134, used bychoose_state_datasetat:262.- Case:
load_reforms_from_dbselectsreform_impacts(reform_params, computed, dataset_name)and builds each reform dict withoutdataset_version. Thuschoose_state_datasetalways getsstored_version = Nonefor a reform from the database. For a stored ACS score,stored_state_dataset_sourceskips the version match, finds the ACS family by name, and returnsDEFAULT_STATE_DATASET("no stored version; matched on its name"). When a later build becomes the default,--forceor--multi-yearon a 766b7c7 score moves it to the new build. That is the earlier SUGGESTION 2 case. The guard for a retired build never raises on this path either. The new tests passdataset_versionin the reform dict directly, so they do not catch this. The docstring,score-bill.mdand the description all say that the score "stays on 766b7c7 after a later build becomes the default". A later change ofDEFAULT_STATE_DATASETcan rely on that statement. Today only one ACS build exists, so no stored score moves yet. - Fix: add
dataset_versionto the select at line 105 and"dataset_version": impact_data.get("dataset_version")to the reform dict at line 134. Add a test that runsload_reforms_from_dbon a stub Supabase client and thenchoose_state_datasetwith a later default.
- Case:
SUGGESTION
- Old years of a record with no stored version keep no dataset.
scripts/compute_impacts.py:1081.- Case: the backfill of old
impacts_by_yearentries runs only when the stored row has adataset_version. Older 2026 rows can have none. When--multi-yearadds a year to such a row, the old years stay without a dataset, sodatasetLabelsfalls back to the root row, which now names the new year's dataset. With the default rule both years use the 2026 files, so the label is correct. With an explicit--state-datasetthe old years get the label of the new dataset. - Fix: also backfill when only
dataset_nameis stored, or when the row has neither (use "policyengine-us-data" and no version, as the loader rule does). This is a small case. A follow-up is enough.
- Case: the backfill of old
New changes checked
- Hugging Face pin. The Hugging Face revision API gives 404 for
21280dca5995e978d706740a8a4b9b7860cfd7b6and 200 for6c57bd6043d7ead3ea3e9bcc51ac509732a67cfe. The repo's current head is6c57bd60…, last modified 2026-05-31. A range request forstates/KS.h5gives 206 at the new pin and 404 at the old pin. The fix is correct, and recompute of a 2026 score on main is broken without it. publish_analysis.pyguard.dataset_changereturns no change for a row with no score, for the same unpinned name (policyengine-us-data,populace-us), and for the same pinned name and build. Any other change refuses without--allow-dataset-change. A legacy row with no name or withenhanced_cps_2024refuses a new ACS artifact, which is correct. The Supabase import moved insidemain, so--dry-runand the tests run without the package.- Workflows.
state_datasetandallow_dataset_changereach the shell throughenv, not through direct${{ }}inrun.publish-reform.ymlpasses--allow-dataset-changeonly whenstate_datasetis set. An unknownstate_datasetfails instate_dataset_sourcewith the list of valid names. - At-large districts.
num_districtsandstate_fipsare set before the new calls. DC has 0 districts inSTATE_DISTRICTS, so it returns before the mapping, as the description says. States with more than one district pass through unchanged. - Footer.
datasetLabelslists one label per year only when every year has a version and the years differ. Each label key has the year prefix, so the React keys are unique.DataContext.jsxmapsmodel_notes.impacts_by_yeartoimpactsByYear.
What I checked
- Diff.
d72a679..5c6986c: 10 files, 517 insertions, 63 deletions. I read all of it, and the loader, the main loop andwrite_to_supabasein full. - Reply and description. I read David's reply comment and the updated description, with the 31-state table. The PR has no inline review threads.
- Tests.
pytest scripts/test_compute_impacts_datasets.py scripts/test_publish_analysis.py: 34 passed (26 + 8).bun run test(vitest): 80 passed in 8 files. eslint on the changed JS files: clean.bun run build: passes. ruff oncompute_impacts.pyandpublish_analysis.py: 4 findings, the same 4 as on main. I did not run actionlint (not installed). - CI. The repository has no workflow that runs on pull requests.
- Not checked. I did not run a microsimulation, read Supabase or open Modal slices. I did not reproduce the state income tax table or the KS numbers.
Address the second review on #240: - load_reforms_from_db selects reform_impacts.dataset_version and passes it on, so choose_state_dataset matches a stored score on its build on the real path (and a retired build raises). Tested through the loader with a stub client and a later default. - A multi-year write gives old years of a row with no stored version, or no name, the source the loader rule maps it to, with no version. The footer names each year when their dataset names differ, labeling an unversioned year by its name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, Pavel. Both items are fixed in 8e3641e. Should address 1 (the loader drops
Suggestion 1 (old years of an unversioned row). A multi-year write now backfills old years whenever the stored row has no version, too. They get the dataset name of the source the loader rule maps the row to (the 2026 files' Checks. |
PavelMakarchuk
left a comment
There was a problem hiding this comment.
Review at 8e3641e
This PR moves new state scores in the tracker to the per-state slices of the Microcosm ACS local-area release populace-us-2024-buildo-acs-local-766b7c7-20261017T030317Z. A stored score keeps the dataset it was computed on. The new commit answers the last review. The loader now reads dataset_version, and a multi-year write gives old years of an unversioned row a dataset name. The footer labels a year with a name and no version.
Verdict: APPROVE
Thanks, David. Both open items are fixed, and the new tests catch the bug on the real path.
Earlier items
| Item | Status at 8e3641e |
|---|---|
SHOULD ADDRESS 1: the loader does not read dataset_version |
Fixed. The select and the reform dict both carry dataset_version. Two new tests run load_reforms_from_db on a stub client. |
| SUGGESTION 1: old years of an unversioned row keep no dataset | Fixed. The backfill runs for any stored row with no version. Old years get the loader rule's source name and no version. |
| Items from the first review (eight) | Still fixed. No change to that code in this commit. |
SHOULD ADDRESS
None.
SUGGESTION
- Two years can show the same label twice.
scripts/compute_impacts.py:1089andsrc/lib/datasetLabel.js:49.- Case: a stored row has
dataset_name = enhanced_cps_2024and a version, for example1.67.0. The backfill copies that raw name to the old years, because it maps the name only when the row has no version. A new year on the 2026 files writespolicyengine-us-datawith the same version. The names differ, sodatasetLabelssplits the footer, and both years show-us-data:v1.67.0. I reproduced this with a vitest probe. The label is correct, only repeated. - Fix: map the stored name through
stored_state_dataset_sourcealso when the row has a version. Or, indatasetLabels, split only when the label texts differ. A follow-up is enough.
- Case: a stored row has
New changes checked
- Loader.
load_reforms_from_dbselectsreform_impacts(reform_params, computed, dataset_name, dataset_version)and sets"dataset_version"in each reform dict.dataset_versionis a column ofreform_impactsinscripts/sql/001_create_tables.sql. The other selected columns are the same as on main.reform_impacts.idis the primary key and referencesresearch(id), so the embed can come back as one object. The loader handles an object and a list, and the two tests use one of each. - Loader tests. The tests call the real
load_reforms_from_dbon a stub client. The first test checks that the select namesdataset_version. It then makes a later ACS build the default and checks that the score stays on 766b7c7 ("matched on its version"). The second test checks that an unlisted build raises "no longer lists". With the old two lines restored, both tests fail. - New raise on the real path. A stored ACS score on an unlisted build now raises in
choose_state_dataset. The call is inside the per-reformtryin the main loop, so a batch run skips that reform and continues. A 2026 row stored with a package version (for example1.67.0) matches no pinned build. It then matches the 2026 files on its name and does not raise. - Backfill.
stored_state_dataset_source(name, None)cannot raise, so the write path cannot fail on it. The entry check changed from "no version" to "no name". Old entries had neither, so a versioned row backfills the same entries as before. With the old condition restored, the new Python test fails. - Footer.
namedLabelis used only for the per-year split. A year with no version shows-us-dataor-microcosm:acs-local. A year with no name blocks the split, so the footer falls back to the stored row's label. Two years with the same name, one with a version and one without, show one label.
What I checked
- Diff.
5c6986c..8e3641e: 4 files, 171 insertions, 7 deletions. I read all of it, andstored_state_dataset_source,choose_state_dataset, the main loop call andwrite_to_supabasein full. - Reply. I read David's reply comment. The PR has no inline review threads.
- Schema. I compared the selected columns with the
CREATE TABLEandALTER TABLEstatements inscripts/sql/.reform_paramsis not in those files, but main selects it too. - Tests.
pytest scripts/test_compute_impacts_datasets.py scripts/test_publish_analysis.py: 37 passed.bun run test(vitest): 82 passed in 8 files. eslint on the changed JS files: clean.bun run build: passes. ruff oncompute_impacts.pyandpublish_analysis.py: 4 findings, the same 4 as on main. - Mutation checks. I restored the old loader lines in a copy: the two loader tests fail. I disabled the new backfill branch in a copy: the backfill test fails.
- CI. The repository has no workflow that runs on pull requests.
- Not checked. I did not run the loader against the live Supabase database, run a microsimulation or open Modal slices.
App v3 runs a state report on the Microcosm ACS local-area release, but the tracker scored every state bill on the archived policyengine-us-data state files. From now on, new scores use the ACS local-area release. The 2026 scores stay on the dataset they were computed on.
Which dataset a reform scores on
compute_impacts.pynow chooses per reform (choose_state_dataset) and prints the choice and the reason for each:--state-datasetorTRACKER_STATE_DATASET, when given, decides for every reform in the run.dataset_version), so it stays on 766b7c7 after a later build becomes the default. A 2026 score matches on its name (policyengine-us-data) and stays on theus-data-cd119files, including a recompute or another year (--multi-year). A stored build thatSTATE_DATASETSno longer lists is an error, not a silent move. The printed reason names the source and what was stored.acs-local-766b7c7. That covers new bills from/encode-billand new reforms frompublish-reform.yml.In
compute_impacts.py, nothing recomputes the existing scores: the default still skips computed reforms, and rule 2 holds with--force.publish-reform.ymlis the exception: it scores from a JSON config with no stored score to read, so every run there counts as new. For that path:state_datasetinput, passed through as--state-dataset;publish_analysis.pyrefuses to replace a stored score computed on another dataset unlessstate_datasetis set (--allow-dataset-change;publish-analysis.ymlhas anallow_dataset_changeinput for locally computed artifacts). Datasets whose stored version records only the installed data package (policyengine-us-data,populace-us) compare by name; ACS local-area builds compare by build.A multi-year record now stores
datasetNameanddatasetVersionin eachimpacts_by_yearentry. Years written before this keep the stored row's dataset when a new year is added. The footer names each year's dataset when the years differ, and the row's otherwise.The ACS local-area source
populace-us-2024-buildo-acs-local-766b7c7-20261017T030317Z. policyengine.py 6.20.x names it forstateregions, so App v3's state reports and these scores share a dataset. Its districts are the 119th Congress's.cpid-populace-slicesat766b7c7/<ST>.h5; each holds one state's households and everyone in them, with weights unchanged.~/.cache/policyengine-tracker(override withTRACKER_DATASET_CACHE). It must match its SHA-256 inscripts/data/acs_local_766b7c7_slices.json, which pins all 51 slices. Together they hold 1,586,908 households, the release's own count.parent_1_idandparent_2_id, which the ASEC/PUF records leave missing, become 0 when a slice is opened. 0 is what the ACS records already store.publish-reform.ymlinstalls the newest policyengine-us; App v3 runs 2.2.2 through policyengine.py 6.20.0. The same reform can therefore give different numbers in the two. The parent-id fill is needed only because of the newer model.00(Alaska 200, Delaware 1000); the 2026 files and the map use01. For a one-district state the script now reads00as district 1. On the AK slice every household is in 200, which now maps to AK-01, so AK, DE, ND, SD, VT and WY get district results instead of a GEOID warning. (DC has no voting district in the tracker and stays skipped.)dataset_namemicrocosm-us-2024-localand the build id asdataset_version, plusdistrict_congress119.State income tax: what the release isn't calibrated to
The ACS local-area release is calibrated to each state's IRS SOI income distribution (AGI and filer counts by income range), so the tax base is constrained. It has no state income tax collections target for any state; the national release has one (Census STC FY2023) for 44 states. New scores' headline revenue numbers come from this release, so I checked the baselines.
On Modal, under policyengine-us 2.162.1 (what
publish-reform.ymlinstalls today), I computed the 2026 baselinestate_income_taxtotal on each state's slice and on the 2026 files (us-data-cd119) for the 31 states with a scored 2026 bill, and compared both with Census FY2025 individual income tax collections (STC item T40). FY2025 ends mid-2025 for most states, so a 2026 tax year should run a few percent above it before any model difference. The last column is the national build's own 2024 fit to its FY2023 target, from the calibration dashboard. Amounts in $ billions.score-bill.md("State Datasets") now says the release has no state income tax target and summarizes this check.Bills on two datasets side by side
The home feed's cards show revenue, poverty and winners for each bill without naming the dataset; only the analysis footer does. After this PR a 2026 Kansas bill on the 2026 files can sit next to a new Kansas bill on the ACS release. A per-card label (or one sentence on the state page) is a follow-up, not in this PR.
Other changes
publish-reform.ymlinstallsmodal, passesMODAL_TOKEN_IDandMODAL_TOKEN_SECRETto the compute step (the secretsdeploy.ymlandpublish-bill.ymlalready use), and takes the optionalstate_datasetinput.publish-analysis.ymltakesallow_dataset_change.src/lib/datasetLabel.js): ACS-local scores read-microcosm:acs-local-766b7c7, linking the release on Hugging Face; the 2026 scores keep-us-data:v…. A multi-year analysis whose years ran on different datasets lists each year's.us-data-cd119pin set in Draw district maps on the boundaries each analysis was computed on #235 (21280dca…) is not a commit of the Hugging Face repo, so every download of the 2026 files failed (404). It now pins the repo's head,6c57bd60…(2026-05-31), which is the commit Draw district maps on the boundaries each analysis was computed on #235 meant. Recomputing a 2026 score was broken on main until this.score-bill.mddrops the PolicyEngine API polling steps: every result, statewide and district, comes from the local Microsimulation on the chosen state dataset, so the choice moves the headline number, not only the map.encode-bill.mdlists the Modal prerequisite.Checks
scripts/test_compute_impacts_datasets.py: 26 passed. New since the review: a stored ACS score stays on its own build after a later default; a stored build no source lists is an error; a 2026 score matches on its name whatever the package version, and the reason names the source; a pre-tracking name (enhanced_cps_2024) maps tous-data-cd119with that said; multi-year writes record each year's dataset and backfill older years from the stored row; at-large00reads as district 1.scripts/test_publish_analysis.py(new): 8 passed. The upload refuses to move a stored score, moves it with--allow-dataset-change, needs no flag for a new score, compares unpinned datasets by name and builds by build.datasetLabelstests). eslint on the changed JS: clean.bun run build: passes. actionlint on both workflows: clean. ruff oncompute_impacts.py: the 4 findings main already has, none new.00) against the 2026 files (all01); KS HB2620 on both datasets. Earlier, under 2.156.9, the Kansas slice failed to load without the parent-id fill and loaded with it.For review
policyengineworkspace, where the tracker app deploys and the volume lives. Apublish-reformdry run on a state reform would confirm it end to end.dataset_name, or a name no source carries, count as us-data. Before this change, every state score was on those files.🤖 Generated with Claude Code