PolicyEngine / PolicyEngine/microcosm

Bump PolicyEngine-US from 1.764.6 (generated-variable audit, take-up totality, WIC take-up migration) — prerequisite for #745

Open
#746 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
0
Forks
4
Avg merge
1d 3h
Merged PRs (30d)
94

Description

uv.lock has pinned policyengine-us 1.764.6 since #357 (July). #745 (work_experience_inputs, with engine variables in PolicyEngine/policyengine-us#9311) needs the lock to move to a release containing those variables, and a dry run against a 1.817.0-based branch shows the bump fails closed in four places, so it deserves its own reviewed PR:

  1. Generated-variable auditpackages/microcosm-frame/src/microcosm/frame/adapters/policyengine_us.py pins _GENERATED_SOURCE_VERSION = "1.764.6" and digests of seven pe-us generator files. Five are unchanged at 1.817.0; reforms/reforms.py and system.py changed. Re-derive _GENERATED_VARIABLE_GROUPS (110 generated variables today) against the exact new version, refresh the digests, and re-pin test_policyengine_us_metadata_index.py (5,770 definitions / 863 input leaves / 4,907 formula-owned at 1.764.6).
  2. Take-up contract totalityspec_engine/engine_abi.py requires us/spec/take_up.yaml to cover every engine take-up flag. New since 1.764.6: takes_up_ca_premium_subsidy_if_eligible (consumed by assigned_ca_premium_subsidy), takes_up_co_premium_assistance_if_eligible (assigned_co_premium_assistance), takes_up_nm_premium_assistance_if_eligible (assigned_nm_premium_assistance), takes_up_wic_if_eligible (wic). The three state premium programs look like the CHIP/BHP ownership: engine + engine_default / rate_unsourced precedent (no behavior change) unless someone sources a rate.
  3. WIC take-up migration — pe-us replaced would_claim_wic with takes_up_wic_if_eligible (Person, MONTH, default_value = True; wic is now defined_for = "takes_up_wic_if_eligible", and would_claim_wic no longer exists at upstream main). Microcosm's wic_claim stage emits would_claim_wic as a required release column, so the stage output, release coverage manifest, stacked-spine battery metric, transfer target, and the take-up contract entry (wic) all need the rename — and the seeded rate becomes the engine's WIC gate, which is a calibration-facing decision.
  4. Bundle + ABI lock regenerationtools/generate_us_bundle_from_constants.py regenerates us/spec/*.yaml and engine_abi.lock.json from engine metadata (test_us_spec_bundle.py enforces --check); it currently also fails on the metadata index for any unknown engine variable.

Suggested order: merge policyengine-us#9311 → bump PR (this issue) → rebase #745, regenerate the bundle, un-draft.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/microcosm-frame/src/microcosm/frame/adapters/policyengine_us.py, tools/generate_us_bundle_from_constants.py, and the metadata and ABI tests, then inspect the 1.817.0-based dry run. Regenerate the bundle and locks, update generated-variable digests and metadata, complete the take-up contract and WIC rename, and confirm test_us_spec_bundle.py --check and the affected tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, build-system, testing
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.