Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e11371b
Store the UI start month as a dataset input instead of hashing person_id
MaxGhenis Oct 25, 2026
10f47fe
Count guard findings per scope and keep test ids in int32
MaxGhenis Oct 25, 2026
d9c3893
Test every start month and length of unemployment compensation receipt
MaxGhenis Oct 25, 2026
ebb4f3a
Address Sol r1: household position, column presence, wider guard
MaxGhenis Oct 25, 2026
3a58423
Address Sol r2: input presence, may-refer-to name resolution
MaxGhenis Oct 26, 2026
8349f76
Address Sol r3: nonlocal scope, cyclic import memo, forward-only inputs
MaxGhenis Oct 26, 2026
24321c2
Address Sol r3: subsample presence, lambda scopes, module attributes,…
MaxGhenis Oct 26, 2026
4d83399
Merge upstream/main into deterministic-ui-start-month
MaxGhenis Oct 26, 2026
af33289
Keep branch subsamples and guard name resolution exact (Sol r4)
MaxGhenis Oct 26, 2026
f8fdd9e
Guard: deferred annotations, annotation-only names, star-import certa…
MaxGhenis Oct 26, 2026
90eb918
Guard: enclosing declarations, cyclic star imports, code run when used
MaxGhenis Oct 26, 2026
a3316a1
Guard: class-body lookup, walrus that may not run, star-load cycles
MaxGhenis Oct 26, 2026
692adeb
Guard: dynamic star loads and code the packages around a module may run
MaxGhenis Oct 26, 2026
cdefef8
Guard: modules reached without an import, dotted __all__, relative gl…
MaxGhenis Oct 27, 2026
36df7cd
Merge upstream/main into deterministic-ui-start-month
MaxGhenis Oct 27, 2026
070fe09
Guard: exempt the Social Security preflight's dataset checksum
MaxGhenis Oct 27, 2026
e0f3c7b
Drop the subsample export override now that core 3.33.1 is the floor
MaxGhenis Oct 27, 2026
54da7d0
Guard: resolve the scanner's relative imports by module name; last ke…
MaxGhenis Oct 27, 2026
b488b09
Guard: read unpacked entries of literal fromlists and globals dicts
MaxGhenis Oct 27, 2026
f36d09d
Guard tests: unpacked fromlist and globals entries at any depth
MaxGhenis Oct 27, 2026
71b31cb
Merge upstream/main into deterministic-ui-start-month
MaxGhenis Nov 5, 2026
1917ede
Guard tests: sys.modules holds the module itself
MaxGhenis Nov 5, 2026
e37a4ad
Supply the start month in the three YAML cases still pinned by person_id
MaxGhenis Nov 5, 2026
221f2fe
Correct the prose that still gave the start month's old hash key
MaxGhenis Nov 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ changelog.d/medicaid-ce-exclusions.md
- For scale parameters that return integers, avoid using `rate_unit: int` in metadata (use `/1` instead)
- Use `bool` instead of `int` or `/1` in `rate_unit` for scale parameters when appropriate
- Program takeup is assigned during microdata construction, not simulation time
- So is every other stochastic input (for example the month unemployment compensation receipt starts): the dataset build draws it and stores it as an input variable, and formulas only compare against it. Seeding does not make a draw acceptable, and neither does hashing entity ids. `tests/code_health/test_no_engine_time_randomness.py` fails on the draw, sample and entity-hash patterns it recognises (not a proof that none exists), outside a reviewed exemption list and a ratchet of transitional draws that only shrinks
- Changes to takeup parameters (SNAP, EITC, etc.) have no effect in the web app
- These parameters should include `economy: false` in their metadata
- **Labor Supply Response & Negative Earnings**: Use `max_(earnings, 0)` to prevent sign flips. Negative total earnings should result in zero labor supply responses.
Expand Down
1 change: 1 addition & 0 deletions changelog.d/deterministic-ui-start-month.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add the `unemployment_compensation_start_month` input, the calendar month in which unemployment compensation receipt starts, assigned when the dataset is built. A dataset that stores it must give every person a start month in every year it covers, and no longer has the start month hashed from `person_id`; one that does not, as no Populace US release does yet, keeps the hash for now and gives unchanged results. Household situations that supply no `person_id` keep their start months; ones that supply it now get the same household-position months. A code-health check fails on the draw, sample and entity-hash patterns it recognises in the model, apart from reviewed exemptions and a ratchet of transitional draws that only shrinks.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ land.
| General work registration age exemptions (under 16, 60 and older) — 7 CFR 273.7(b)(1)(i) | Modeled | `meets_snap_general_work_requirements` |
| General work registration exemption for working 30 hours weekly or earning the federal minimum wage times 30 hours — 7 U.S.C. 2015(d)(2)(E); 7 CFR 273.7(b)(1)(vii) | Modeled | `is_snap_work_registration_exempt_employed`; usual weekly hours are averaged over weeks worked (`snap_work_requirement_weekly_hours`) and annual earnings over 52 weeks (`snap_work_requirement_weekly_earnings`), compared with `gov.usda.snap.work_requirements.general.weekly_hours_threshold` and that threshold times `gov.dol.minimum_wage`; setting `gov.simulation.snap_work_tests_average_over_year` to false switches to usual hours and earnings per week worked |
| General exemptions: disability, care of child under 6, care of incapacitated person — 7 CFR 273.7(b)(1)(ii), (iv) | Modeled | Shared between general and ABAWD checks |
| Non-age work registration exemptions: student enrollment, unemployment compensation receipt — 7 CFR 273.7(b)(1)(v), (viii) | Modeled | `is_snap_work_registration_exempt_non_age`; unemployment compensation exempts only in its months of receipt (`is_receiving_unemployment_compensation`), allocated from `weeks_unemployed` as one block per year with a start month hashed from a supplied `person_id` (datasets or explicit inputs) or otherwise from the person's position in the household, so every axis copy of a household matches; or all 12 months when weeks unemployed are not reported |
| Non-age work registration exemptions: student enrollment, unemployment compensation receipt — 7 CFR 273.7(b)(1)(v), (viii) | Modeled | `is_snap_work_registration_exempt_non_age`; unemployment compensation exempts only in its months of receipt (`is_receiving_unemployment_compensation`), allocated from `weeks_unemployed` as one block per year, or all 12 months when weeks unemployed are not reported. The block starts in `unemployment_compensation_start_month`: a dataset stores it (one without the column still hashes `person_id`, for now), and a household situation may supply it or otherwise follows the person's position in the household, so every axis copy of a household matches |
| Non-age work registration exemptions: TANF-complying, drug or alcohol treatment participants, unemployment compensation applicants not yet receiving — 7 CFR 273.7(b)(1)(iii), (v), (vi) | Partially modeled | `is_snap_work_registration_exempt_non_age` consumes the input variables `is_complying_with_tanf_work_requirements` (gated on TANF enrollment), `is_in_substance_use_treatment_program` and `has_applied_for_unemployment_compensation`; they default to false unless supplied, and no Populace US stage produces them (data parity is tracked in [PolicyEngine/populace#248](https://github.com/PolicyEngine/populace/issues/248)) |
| ABAWD work requirement of 20 hours a week averaged monthly, defined as 80 hours a month — 7 CFR 273.24(a)(1)(i) | Modeled | `meets_snap_abawd_work_requirements` compares average weekly hours (worked plus work program) times 52 / 12 with `gov.usda.snap.work_requirements.abawd.monthly_hours_threshold`; hours worked are averaged over weeks worked (`snap_work_requirement_weekly_hours`) |
| ABAWD age exemption brackets, including the HR1 change of the upper bound from 55 to 65 — 7 U.S.C. 2015(o)(3)(A) | Modeled | `gov.usda.snap.work_requirements.abawd.age_threshold.exempted` |
Expand Down Expand Up @@ -69,6 +69,10 @@ supplied inputs:
- `weeks_unemployed`: weeks spent looking for work; sets the months of
unemployment compensation receipt. When it is 0 (not reported, as on
ACS-based rows), any receipt exempts the person in all 12 months.
- `unemployment_compensation_start_month`: the calendar month in which that
block of months starts. The dataset build assigns it, so it is an allocation
device, not observed timing. A dataset without the column keeps the start
month hashed from `person_id` for now.

Population-level data parity is tracked separately in
[PolicyEngine/populace#248](https://github.com/PolicyEngine/populace/issues/248).
Loading
Loading