Skip to content

Bridge to PolicyEngine-US: federal and state tax-benefit effect of the minimum benefit on sample households - #496

Merged
MaxGhenis merged 16 commits into
masterfrom
pe-us-bridge-sample-household-20260930
Sep 30, 2026
Merged

MaxGhenis merged 16 commits into
masterfrom
pe-us-bridge-sample-household-20260930

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What this adds

This is the first bridge from Microcosm Dynamics to PolicyEngine-US's tax-benefit model. It shows what exercise 4's headline minimum benefit becomes after federal and state taxes and means-tested transfers: a minimum benefit set at 73% of the aged poverty threshold for 22 years of work (Favreault, Mermin and Steuerle 2006, option 2). It does this for illustrative households, not survey data. Microcosm's four DYNASIM3 comparisons report pre-tax benefit changes; this is the after-tax, after-transfer view.

Every result comes from policyengine-us 2.18.0 from PyPI (uploaded 2026-09-30, policyengine-core 3.32.11). The wheel's SHA-256 is 28e32bc1339e8ffc1ed676ac1c9ecd468d191685608039643915f63e1357085f. All 17,551 installed policyengine_us/ files match the wheel's RECORD.

  • src/populace_dynamics/bridge/policyengine_us.py is pure Python and does not import policyengine_us.

    • Situations. BridgePerson and BridgeHousehold build PolicyEngine-US situations: people, Social Security by type, pensions and other income, assets, rent, and tax-unit, SPM-unit, marital-unit and family membership.

    • Source check. inspect_installation and check_published_source refuse a PolicyEngine-US source that is not published:

      • a git revision no branch of origin contains, as git ls-remote reports it now;
      • an origin that is unreachable or not on GitHub;
      • a checkout with modified, untracked or git-ignored package files;
      • any VCS, archive or local-directory install.

      verify_record hashes the installed files against the RECORD and reports added files. The runner and tracer check an index install's files and can require a pinned RECORD digest; the script pins 2.18.0's.

    • Runner. run_policyengine_us runs each case in its own simulation in a separate interpreter, located by POPULACE_DYNAMICS_PE_US_PYTHON (default ~/.venvs/policyengine-us-2.18.0/bin/python). Cases with the same overrides share one reformed tax-benefit system. It reads the component tree of household_net_income from the model.

    • Decomposition. decompose splits the change into leaf components that sum exactly, in cents, to the net change. It first checks every aggregate against its parts, refuses non-finite values, and checks the root against the definition read in 2.18.0.

    • Float32 guard. trace_policyengine_us and uncaused_changes report any variable that changed by a cent or more while everything it read held within float noise: a step at a bracket edge taken on float32 noise.

      • Noise is a cent, or four float32 steps at the read's size where that is more.
      • An exact one-cent step stored in float32 counts as a change: the threshold is a cent less one float32 step at the variable's size, never under half a cent.
      • Branch simulations' nodes are keyed apart from the main calculation.
    • COLAs. carry_pia_forward and cola_rates_from_cpi_w apply the 42 USC 415(i) COLAs.

  • scripts/pe_us_minimum_benefit_sample_households.py computes the worker's PIA and minimum with the repo's oracle and Track M rule code. Its SSA parameters come from the same pinned release. It carries both PIAs to 2026 and runs three households in three states. It refuses any release but 2.18.0 and traces every changed component before writing.

    • Households. A has no other income, B a $4,800 pension and C a $31,200 pension.
    • States. California has a modeled SSI supplement. Montana taxes federally taxable Social Security and has an elderly renter credit that counts all of it. Florida has no income tax.
    • California's 2026 payment standard. It is set to CDSS's published $1,233.94 a month ("SSI Total Monthly Payment Amounts 2026", Rev. 1/26, effective 2026-01-01; retrieved 2026-09-30). PolicyEngine-US 2.18.0 has no 2026 entry and would hold 2025's $1,206.94. The override appears in the JSON, the Markdown and every chart footer. Fixing the upstream parameter is a separate task.
  • docs/design/pe_us_bridge.md covers:

    • what the bridge does and does not do;
    • what household_net_income includes and excludes (health coverage is excluded by default);
    • how to run it, and its provenance;
    • the payment-year parameters;
    • the minimum-benefit rule as applied to a 2026 household.

    Every file:line citation is against policyengine-us 2.18.0 or the statute. Two independent review rounds audited them; round 2 found one wrong mechanism (Montana's credit) and a few imprecise citations, all fixed below.

  • Outputs. docs/analysis/pe_us_bridge_20260930/ holds the JSON with provenance (repository- and release-relative paths only), the Markdown tables, and PNG and SVG waterfalls per household. They were generated at the source commit a915b96 and committed at d21171e, the head of this PR.

Results (annual 2026 dollars, current law to the reform)

The worker was born in 1958, has 22 years of covered earnings at 25% of the average wage index, and was entitled in 2024.

  • PIA. P = $613.80. With Y = 22, the share is s = 0.73, and T is the 2020 aged one-person threshold, $12,413. So M = $755.12, above the cut PIA of $535.17: she is on the minimum.
  • 2026 benefit. $8,916 a year under current law and $10,968 under the reform, a difference of +$2,052.
Household State Social Security Net income Share kept Net income with health coverage
A CA +2,052 0 0% 0
A MT +2,052 0 0% 0
A FL +2,052 0 0% 0
B CA +2,052 +397 19% +397
B MT +2,052 +1,845 90% +1,845
B FL +2,052 +1,128 55% −2,737
C CA +2,052 +1,942 95% +1,942
C MT +2,052 +1,887 92% +1,887
C FL +2,052 +1,942 95% +1,942

Each figure is rounded to the dollar on its own, with half-dollars rounded up in magnitude. Household C's change in Montana is $1,886.50, so it shows as $1,887.

The last column values Medicaid as policyengine-us 2.18.0 does: the state's 2023 Medicaid spending divided by its October 2024 Medicaid and CHIP enrollment. That is an average over enrollees of all ages, not uprated to 2026. It is not a same-year average and not specific to aged enrollees, so it could overstate or understate what covering an aged enrollee costs. The years matter: with 2023 enrollment, Florida's $9,200 would be $7,034. It values coverage at average program cost; it is not a cash loss.

  • A. Federal SSI falls dollar for dollar ($3,252 to $1,200). SNAP and California's supplement ($2,879) do not move.
  • B, California. She loses her $1,331 state supplement and $324 of SNAP.
    • In 2.18.0 SNAP counts the supplement as unearned income (unearned_spm_unit.yaml:13), so SNAP sees only $721 of new income and falls by 45% of that.
    • The earlier +$25 came from a run on the 1.822.5 checkout, which did not count the supplement, so SNAP fell by $696 there.
  • B, Florida. SNAP falls by 45% of the increase (−$924). With health coverage counted, she loses $2,737.
    • Her countable income for Florida's optional aged Medicaid pathway rises from $13,476 to $15,528, past the 88%-of-poverty limit of $14,045, so Medicaid ends.
    • She is QMB-eligible in every month of both runs. PolicyEngine-US counts the Medicare Savings Program only once full Medicaid ends (msp_cost.py:28).
  • C. Taxable Social Security rises from $5,867 to $6,781.
    • Federal tax rises $110 in every state (12%).
    • Montana adds $43 of tax (4.7%). Her elderly homeowner and renter credit falls from $13 to zero:
      • her net household income, gross household income less the $12,600 exclusion (MCA 15-30-2337(8)), rises from $27,516 to $29,568;
      • the credit's income reduction, 5% of net household income (MCA 15-30-2340(4)), rises from $1,376 to $1,478 and passes her $1,440 of countable rent.
    • California does not move: its AGI excludes Social Security.

Review round 1 (all findings addressed)

Finding Fix Pinned by
1 High: California's stale 2026 payment standard CDSS $1,233.94 override, with source, for the California cases test__california_payment_standard_override__then_it_sets_the_supplement (oracle), test__artifact__then_california_uses_the_published_standard, ..._the_california_supplement_follows_the_standard
2 Medium: $1 use-tax float32 artifact Pension C moves $30,000 → $31,200; float32 guard; the doc now calls it an artifact test__use_tax_at_a_bracket_edge__then_the_float32_guard_flags_it (oracle, both pensions), test__given_step_on_float32_noise__then_the_guard_reports_its_origin + 10 other guard tests, test__artifact__then_the_float32_guard_found_nothing
3 Medium: unpublished revision e4363903f3 PyPI 2.18.0 pinned by wheel and RECORD digest; unpublished sources refused test__given_local_commit_not_on_origin__then_source_is_refused + 8 other source-check cases, test__live_interpreter__then_its_source_is_published_and_intact, test__artifact__then_the_release_is_the_pinned_pypi_one
4 NaN aggregate accepted math.isfinite refusal test__given_nan_intermediate_aggregate__then_decomposition_is_refused (the review's counterexample), test__given_any_nonfinite_value__then_decomposition_is_refused
5 Zero-step carry first > last refused test__given_first_year_after_last__then_carry_is_refused
6 Unnamed $651 line Commodity Supplemental Food Program row; take-up caveat (no take-up input; caseload-limited) category test, test__artifact__then_rows_name_each_program_and_credit
7 Montana "state income tax +1,150" Taxes before refundable credits and refundable credits are separate rows test__given_refundable_credit_on_zero_tax__then_it_is_not_a_tax_row, artifact test
8 QMB wording QMB-eligible in all 12 months of both runs; MSP counted once Medicaid ends test__artifact__then_florida_medicaid_loss_is_explained
9 SNAP caveat Rerun on 2.18.0 (USDA's FY2027 allotment and deduction encoded; state utility allowances held, disclosed) amounts read from the release in the caveat
10 Benefits list All 24 entries listed doc
11 Local paths in the JSON Repository- or release-relative only; the script refuses to write an absolute path test__artifact__then_no_local_path_is_written
12 Tier counts Corrected below tier-policy test
Code review of the fix round (independent Opus 5.5 reviewer) Every finding fixed, none of which changes a committed number: (1) branch trace nodes keyed apart, and copies read their main node; (2) scale-aware noise above $131,072; (3) ls-remote, GitHub origin, ignored files; (4) the runner and tracer verify files and can pin the digest; (5) added files detected; (6) pip bytecode rows ignored in the digest; (7, 8) one simulation per case with a shared system; (9) the QMB sentence needs MSP to appear; (10) explicit raises, not assert; (11) 29 unit tests of the script's own logic; nits: the tracer checks the installation is unchanged, and household groups are read once (generators work) test__given_branch_copy_of_a_main_value__then_it_reads_the_main_node, test__given_step_on_noise_above_131072__then_the_guard_still_sees_it, test__given_branch_deleted_on_origin__then_a_stale_ref_does_not_count, test__given_modified_checkout__then_source_is_refused[ignored], test__given_installed_files__then_record_verification_checks_each, test__given_a_digest_other_than_the_release__then_the_run_is_refused (oracle), tests/bridge/test_pe_us_sample_households_script.py
Nits Bare string refused as a group; PSID fields dropped from the invented history; the "holds earlier values" sentence replaced by four checked groups test__given_bare_string_group__then_household_is_refused, test__artifact__then_the_invented_history_has_no_psid_fields

Review round 2 (all findings addressed)

Round 2 reran all nine cases independently and confirmed every number. Its findings were wording, one display rounding and one test gap. No computed result changed: the regenerated JSON's results equal those at 9e104e2.

The fixes are in aab4960. An independent Opus 5.5 reviewer then read them against the 2.18.0 code and MCA 15-30-2337 and 15-30-2340, and confirmed every new mechanism statement and number. Its follow-ups are in a915b96: the Medicaid check also covers the with-health leaf, the guard's two float32 limits are stated and tested, _money refuses non-numbers, and the doc's rounding and statute wording is tightened.

Finding Fix Pinned by
M: Montana's credit described with the wrong quantity The doc and the JSON evidence (fixed in the generator) keep net household income ($27,516 → $29,568) apart from the credit's income reduction, 5% of it ($1,376 → $1,478), citing the 2.18.0 code and MCA 15-30-2337(8) and 15-30-2340(4). They also note that PolicyEngine-US's …_net_household_income variable returns the reduction test__montana_evidence__then_income_and_its_reduction_are_separate, test__artifact__then_montana_credit_is_described_exactly
L1: this body's Medicaid sentence, head reference and results were stale Rewritten against the current artifacts and head n/a
L2: Medicaid valuation one-sided and not exact Exact construction (2023 spending over October 2024 Medicaid and CHIP enrollment) and a two-sided caveat, with "coverage at average program cost, not a cash loss" kept. The script computes the same-year ratios from the release (Florida $7,034, California $8,751, Montana $7,223), refuses other entry dates, and checks every Medicaid figure, in the memo and in the with-health decomposition's medicaid_cost leaf, against the release's ratio test__given_the_release_totals__then_both_ratios_are_computed, test__given_other_enrollment_dates__then_the_valuation_is_refused, test__valuation_text__then_it_is_exact_and_two_sided, test__given_memo_off_the_ratio__then_writing_is_refused, test__given_with_health_medicaid_off_the_ratio__then_it_is_refused, test__artifact__then_the_medicaid_valuation_is_exact_both_ways
L3: California uprating described as California CPI gov.states.ca.cpi ends in 2025 and is extended with gov.irs.uprating (ca/cpi.yaml:3-9,15). The exemption credit is uprated too. Household C's $21 is derived in the doc (tax $393.99, less two $156.47 exemption credits and the $60 renter's credit), checked on a 2.18.0 run doc
L4: doc claimed a credit check the script lacked Implemented: WRONG_WAY_CATEGORIES adds federal and state refundable credits test__given_a_refundable_credit_rising__then_writing_is_refused (2 cases), test__wrong_way_categories__then_they_cover_benefits_taxes_and_credits, test__artifact__then_the_script_checked_refundable_credits
L5: every invariant called a Hypothesis property The doc and this body list Hypothesis properties and example tests separately n/a
L6: batch-equals-alone oracle test had no override New oracle test: household B in California, with the payment-standard override, runs batched on a system built from household A's simulation and alone, and every value, the tree and the memo match test__override_cases_run_with_others__then_each_equals_the_case_alone (oracle)
Nit N1: +1,886.50 shown as +1,886 _money rounds half-dollars up in magnitude, in integer cents, for every table and chart label, and refuses a value that is not a number; the Markdown and chart footers say each amount is rounded on its own test__given_cents__then_half_dollars_round_up (11 cases), test__given_any_cents__then_money_is_the_half_up_dollar (Hypothesis), test__artifact__then_half_dollars_round_up
N2: guard text said "within a cent" The text states the rule: a cent, or four float32 steps where that is more test__artifact__then_the_guard_text_states_its_noise_band
N3: exact one-cent float32 step missed _counts_as_change: a variable's own change counts from a cent less one float32 step at its size, never under half a cent. Two limits are stated and pinned: from $32,768 to $131,072 one or two float32 steps of noise also count (a false alarm, not a miss), and the bound covers a stored value, not one computed from larger operands test__given_exact_one_cent_float32_step__then_it_is_reported (the review's counterexample), test__given_any_one_cent_float32_step__then_it_is_reported and test__given_change_under_half_a_cent__then_it_is_not_reported (Hypothesis), test__given_one_float32_step_of_noise_at_70000__then_it_is_reported, test__given_one_cent_step_computed_from_larger_operands__then_missed
N4: private folder named in the doc and body Repository paths only; the edge scans are described as review checks outside the repository test__artifact__then_no_public_file_points_outside_the_repository
N5: citations Use-tax table :14-23; the full Medicaid limit path everywhere; CSFP's age from csfp/min_age.yaml:3 test__artifact__then_the_medicaid_limit_is_cited_in_full
N6: origin message said "public" "is not a GitHub repository"; _GITHUB_ORIGIN checks the host only test__given_origin_not_on_github__then_source_is_refused, test__given_origin_url__then_only_github_urls_match
N7: SNAP caveat wording "losing the supplement lowers the income SNAP counts, and SNAP falls by less" n/a
N8: guard false alarms undocumented The doc says a variable whose only changed read is not numeric is reported n/a

Invariants

Hypothesis properties (unit tier), checked over generated inputs:

  • Situation builder. Every person lands in exactly one tax unit, SPM unit, marital unit, family and household. Amounts, ages and the state round-trip, output is deterministic JSON, and negative amounts are refused.
  • Decomposition. Leaf changes sum exactly (integer cents) to the net change, and the categories sum to the same total, for arbitrary floats too. When the reform equals the baseline, every change is zero. The result is deterministic and invariant to the order of parts. An inconsistent aggregate and any non-finite value are refused. Whole cents round-trip.
  • COLAs. Carried PIAs are whole dimes, monotone in the PIA, and lose less than a dime a step. Carrying composes over split year ranges; with no COLAs the PIA is only truncated to a dime; a range whose first year follows its last is refused. CPI-W COLAs are nonnegative tenths.
  • RECORD digest. It ignores installer lines and line order.
  • Float32 guard. float32_step is the float32 spacing. A jump of a cent or more over a sub-cent read, and a one-cent float32 step at any magnitude float32 can resolve, are always reported. A chain of real changes, identical runs and a change under half a cent never are.
  • Display. Every amount shows as its whole dollar, with half-dollars rounded up in magnitude.

Example tests (unit tier), on chosen inputs:

  • Situation builder. Non-finite, non-numeric and bad-age inputs, bad partitions, bare strings as groups, unknown states and duplicate ids are refused.
  • Decomposition. A drifted household_net_income definition, a cyclic tree and a minimal NaN counterexample are refused; categories and a refundable credit on a zero liability are labelled as documented.
  • COLAs. A missing COLA is refused; SSA's CPI-W averages give the published COLAs; the base carries forward past a zero year.
  • Source and RECORD. Published sources pass and unpublished ones are refused (temporary git repositories and invented distributions); changed, missing and added files are flagged.
  • Float32 guard. The first draft's use-tax case, a step above $131,072, branches taken in one run only, branch copies of main values, and the exact 3.00 → 3.01 step are handled as documented. One float32 step of noise at $70,000 is reported, and a one-cent step computed from larger operands is not: the guard's two stated limits.
  • The script's own logic, with the runner replaced by fakes: parameter updates, overrides, the release pin, local paths, the invariants (including refundable credits), the traced-versus-untraced check, the Medicaid valuation and text, Montana's evidence, and rounding.
  • The committed outputs: release, override, guard, identity, rows, reform name, Montana wording, Medicaid valuation, rounding, and no pointer outside the repository.

Oracle tests (live policyengine-us 2.18.0):

  • a case run with others equals the same case run alone: household A in Florida with no override, and household B in California with the override on a system built from household A's simulation;
  • the runtime tree equals the definition read;
  • the source is published, the RECORD verifies with no added file, and a run pinned to another digest is refused;
  • SSI never rises with Social Security and falls dollar for dollar while positive (household A, California and Florida);
  • SNAP is unchanged for A (California and Florida) and falls for B in Florida;
  • California's supplement is constant for A, and the override reaches it;
  • federal and state income taxes do not fall for C in Montana;
  • the identity holds on four live cases;
  • the guard flags ca_use_tax at a $30,000 pension and nothing at $31,200, and keys the itemizing branches apart;
  • all 51 FIPS codes resolve to their state.

The script checks every household-state pair, with and without health coverage, before writing:

  • the identity holds;
  • the Social Security component equals the Microcosm change;
  • no means-tested benefit or refundable credit rises, and no income tax falls;
  • PolicyEngine-US's own net-income change is within a cent of the definition's sum;
  • Medicaid at cost, wherever she is enrolled, equals the release's spending over enrollment, in the memo and in the with-health medicaid_cost leaf;
  • every changed leaf, from its traced simulation, equals its untraced value within a cent;
  • the float32 guard finds nothing (44 leaves, 18 comparisons, 65,907 traced variable-periods).

The per-case runner reproduces the earlier batched runner's decompositions exactly, all 18. Only Medicaid-at-cost memo values move, by one float32 step, from the cross-case aggregation that per-case simulations remove.

Tests run (targeted; CI runs the full suite)

  • tests/bridge/, all four modules, with POPULACE_DYNAMICS_PE_US_PYTHON set to the 2.18.0 interpreter, run from a git archive export of d21171e: 228 passed, 0 skipped (28 min on a heavily loaded host).
    • test_policyengine_us_bridge.py: 136 passed.
    • test_pe_us_sample_households_script.py: 55 passed.
    • test_pe_us_bridge_artifact.py: 19 passed.
    • test_policyengine_us_bridge_oracle.py: 18 passed, against live policyengine-us 2.18.0.
  • pytest -p no:xdist tests -k test__given_collected_suite__then_tiers_match_policy_manifest: passed, 11,027 collected.
    • Tier counts against master: unit 5,418 → 5,628 (+210); oracle_policyengine 189 → 207 (+18); the other tiers are unchanged.
    • Oracle-tier rule. tests/conftest.py also treats POPULACE_DYNAMICS_PE_US_PYTHON as an oracle-tier indicator.
  • black -l 79 --check and ruff check are clean on all 11 changed Python files.
  • No protected file changed: engine/loop.py, engine/steps.py, gates.yaml and runs/* are untouched.
  • Outputs. Regenerated at the clean commit a915b96. The JSON results equal those at 9e104e2 exactly. Of 492 Markdown table cells, the only changes are household C in Montana's +1,886 → +1,887 (three cells: the summary's two columns and its table's net change).

Caveats

  • Illustrative households, not survey data. The worker was chosen so the minimum binds. A worker above it would lose option 2's 12.81% cut. The baseline is current-law scheduled benefits, and the option 1 (reduced current law) PIA is a memo that is not run.
  • The bridge passes amounts as inputs. It does not run over the projected population, and it applies no behavioral response.
  • Take-up follows PolicyEngine-US's defaults: full for SSI, SNAP and Medicaid.
    • The Commodity Supplemental Food Program has no take-up input, although the program is caseload-limited.
    • Housing-voucher take-up is switched off.
  • Payment year 2026. SNAP's October-December amounts use USDA's FY2027 allotment and standard deduction as encoded in 2.18.0. The state utility allowances hold their FY2026 values. California's income-tax parameters end at 2025 and are extended with gov.states.ca.cpi, which is itself the federal IRS uprating index after 2025. Medicaid at cost is 2023 spending over October 2024 Medicaid and CHIP enrollment.
  • Household C's pension is $115 above the gross-income edge ($40,001) of Montana's elderly credit multiplier at baseline. Every other component is linear within ±$200, per finite-difference scans run during review (not part of this repository).
  • Carrying the reform's minimum forward with the statutory COLAs is the bridge's assumption. Track M compares at first calculation only.
  • Upstream (not changed here). PolicyEngine-US 2.18.0 lacks California's 2026 payment standard, and its mt_elderly_homeowner_or_renter_credit_net_household_income variable returns the income reduction despite its name. Fixing either is a PolicyEngine-US change.

axiom: n/a: this PR encodes and changes no PolicyEngine-US policy; it reads the published 2.18.0 release and overrides one parameter at run time, with its source.

🤖 Generated with Claude Code

MaxGhenis and others added 2 commits September 29, 2026 22:29
The bridge (src/populace_dynamics/bridge/policyengine_us.py, pure Python)
turns bridge households into PolicyEngine-US situations, runs them in a
separate policyengine-us interpreter (POPULACE_DYNAMICS_PE_US_PYTHON), and
decomposes the change in household_net_income into leaf components that
sum exactly, in cents, to the net change, after checking every aggregate
against its parts and the root against the definition read at e4363903f3.

scripts/pe_us_minimum_benefit_sample_households.py computes an
illustrative worker's PIA and exercise 4's headline minimum (option 2)
with the Track M rule code, carries both to 2026 with statutory COLAs,
and runs three households (no other income, a $4,800 pension, a $30,000
pension) in California, Montana and Florida.

Tests: Hypothesis properties for the situation builder, the
decomposition identity and the COLA helpers (unit tier), and a live
oracle-tier test that skips without the policyengine-us interpreter.
The bridge modules join the birth-evidence historical exclusions; tier
counts move to unit 5,179 and oracle_policyengine 194.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Output of scripts/pe_us_minimum_benefit_sample_households.py at 212a966
(code clean) with policyengine-us 1.822.5 at e4363903f3, payment year
2026: the JSON of inputs, results and provenance, the Markdown tables and
one waterfall chart per household (PNG and SVG). Illustrative households,
not survey data. Two runs gave byte-identical files; the same files are in
the dynasim-parity evidence folder pe-us-bridge-20260930.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
social-security-model Ready Ready Preview Sep 30, 2026 2:22pm UTC

Request Review

…branch

Recount test tiers after the merge: unit 5,505 and oracle_policyengine
201 (master 5,418 and 189, plus this branch's 87 and 12).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 3 commits September 30, 2026 04:05
Fix round 1 of the review of PR #496 (code and tests; the regenerated
results follow in the next commit).

- Source check (finding 3): inspect_installation reads which
  policyengine-us the interpreter imports; check_published_source refuses
  a git revision no origin branch contains, a modified checkout and any
  VCS, archive or local-directory install; verify_record hashes every
  installed file against the RECORD. The default interpreter is a uv
  venv with policyengine-us==2.18.0 from PyPI; the script pins that
  release (wheel SHA-256 and package RECORD digest) and reads the
  oracle's SSA parameters from it.
- California (finding 1): the script sets the 2026 aged or disabled
  payment standard to CDSS's published $1,233.94 (SSI Total Monthly
  Payment Amounts 2026, Rev. 1/26) for the California cases, refusing if
  the release already has a different 2026 value.
- Float32 guard (finding 2): trace_policyengine_us reruns cases with the
  tracer on and uncaused_changes reports any variable that changed while
  every variable it read held within a cent. The script traces every
  changed component, checks each traced value against the batched run,
  and refuses to write on a finding. Household C's pension moves from
  $30,000 (on the California use-tax edge) to $31,200.
- Lows: non-finite aggregates are refused (4); carry_pia_forward refuses
  an empty range (5); the Commodity Supplemental Food Program (6) and
  federal and state refundable credits (7) get their own rows; a bare
  string is refused as a group; the invented history drops PSID fields;
  no absolute path is written (11).
- Presentation: the reform is named plainly; tables and charts show the
  same rows everywhere; each chart adds a with-health-coverage row and
  explains Florida household B's Medicaid loss.
- Tests: +27 unit, +12 artifact-pinning (unit tier) and +4 oracle
  tests; the oracle tier now also recognizes
  POPULACE_DYNAMICS_PE_US_PYTHON.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The memo reads is_qmb_eligible (a monthly variable) for all 12 months
  of 2026, and the text says "in every month of both runs" only when
  that holds.
- The with-health valuation now says what policyengine-us 2.18.0
  computes for one household: the state's 2023 Medicaid spending over
  its October 2024 enrollment, an average over enrollees of all ages,
  not uprated to 2026 (medicaid_cost_if_enrolled.py:11-22,
  medicaid_slcsp_state_denominator.py:28-33).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….18.0

Results from scripts/pe_us_minimum_benefit_sample_households.py at
287a118 (code clean), on policyengine-us 2.18.0 from PyPI with
California's 2026 payment standard set to CDSS's $1,233.94:

- B in California keeps $397 of the $2,052 increase (19%): she loses
  the $1,331 supplement and $324 of SNAP, which in 2.18.0 counts the
  supplement as unearned income. A in California keeps a $2,879 state
  benefit.
- C (pension now $31,200) keeps $1,942 in California and Florida and
  $1,886 in Montana; nothing in California moves.
- The float32 guard traced 44 changed leaves in 18 comparisons and
  found no step without a cause.

The design doc is updated to 2.18.0 citations (checked line by line),
the new numbers, the payment-year parameter groups, the Medicaid
valuation, and the $30,000 use-tax artifact described as an artifact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 2 commits September 30, 2026 05:18
Fixes from an independent code review of the fix round (none changes a
committed number):

- Runner: every case runs in its own simulation, and cases with the same
  overrides share one reformed tax-benefit system passed as
  tax_benefit_system. 2.18.0 aggregates Medicaid's state-average cost
  index over the whole simulation, so batched households were not
  independent, and only the first reformed case had a baseline branch.
- Float32 guard: trace nodes of branch simulations (2.18.0's itemizing
  and not_itemizing federal tax branches) are keyed apart from the main
  calculation; a branch node traced without reads is a copied value and
  reads its main node. A read counts as noise up to a cent or four
  float32 steps at its size, so the guard still sees steps above
  $131,072, where one float32 step exceeds a cent.
- Source check: reachability is asked of origin now (ls-remote), not of
  stale remote-tracking refs; origin must be a GitHub repository and
  reachable; git-ignored package files count as modifications.
- RECORD: verify_record also reports files the RECORD does not list;
  the package digest ignores pip's bytecode rows; run_policyengine_us and
  trace_policyengine_us verify an index install's files and can require
  a pinned package digest (the script passes 2.18.0's).
- Script: the invariants raise InvariantError instead of assert; the QMB
  sentence needs the Medicare Savings Program to appear in the reform.
- Tests: +16 unit (bridge), +29 unit for the script's own logic with
  fakes, +1 oracle (a wrong pinned digest is refused); the oracle guard
  test also checks the branch keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Results from scripts/pe_us_minimum_benefit_sample_households.py at
472f290 (code clean), policyengine-us 2.18.0 from PyPI, the pinned
RECORD digest checked by the runner and the tracer, and no file added
to, changed in or missing from the installed package.

Every decomposition equals the previous run's to the cent. Only
Medicaid-at-cost memo values move, by one float32 step (for example
9,236.4785 to 9,236.4795), now that each case has its own simulation.
The float32 guard traced 65,907 variable-periods (branch simulations'
nodes now counted apart) and found no step without a cause.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 2 commits September 30, 2026 05:32
_groups iterated its input twice (once for the bare-string check, once
to build the groups), so a generator arrived empty the second time and
failed the partition check with a misleading message. Nit from the code
review of the fix round; +1 unit test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Results from scripts/pe_us_minimum_benefit_sample_households.py at
2f0bf63 (code clean); only the recorded commit changes (JSON, Markdown
and chart footers). Numbers, guard statistics and provenance are
otherwise identical to the previous run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 2 commits September 30, 2026 06:41
The with-health figure values Medicaid at the state's average spending
per enrollee of all ages. Nothing in the code shows that is an upper
bound for an aged enrollee (an all-ages average may understate it), so
the label now says what the number is: coverage at average program cost,
not a cash loss.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Numbers are unchanged (results identical to the previous JSON); only the
Medicaid valuation wording and the recorded commit differ.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

The upstream fix for the stale California 2026 payment standard (review finding 1) is PolicyEngine/policyengine-us#9709. It is a draft, pending CI and a partner-test sign-off.

  • It adds 2026-01-01 entries to all ten California state-supplement payment-standard parameters. The aged individual living independently gets $1,233.94, matching the CDSS "SSI Total Monthly Payment Amounts 2026" figure this PR uses as its override. A couple gets $2,098.83.
  • Each value is also checked against SSA POMS SI 01415.058 (California, January 2026). The two sources agree on every row except couple non-medical out-of-home care, which doesn't affect households A–C.
  • Its 2026 tests include an aged individual with no income, who gets $994 SSI plus a $239.94 supplement, and a couple.

This PR pins policyengine-us 2.18.0, which does not include the fix. The override stays necessary until the bridge moves to a release that does.

🤖 Generated with Claude Code

MaxGhenis and others added 3 commits September 30, 2026 09:20
No computed result changes; the outputs are regenerated in the next
commit.

- M1: Montana's elderly homeowner and renter credit subtracts an income
  reduction, 5 percent of net household income, not net household
  income. The doc and the script's JSON evidence now keep the two apart
  ($27,516 -> $29,568 of income; $1,376 -> $1,478 of reduction), citing
  the 2.18.0 code and MCA 15-30-2337(8) and 15-30-2340(4).
- L2: the Medicaid valuation is described exactly (2023 spending over
  October 2024 Medicaid and CHIP enrollment) and both ways. The script
  computes the same-year ratio from the release (Florida $7,034 against
  $9,200), refuses other entry dates, and checks every Medicaid memo
  against the ratio.
- L3: California's CPI ends in 2025 and is extended with the federal
  uprating index; household C's $21 is derived in the doc.
- L4: the wrong-way check now covers federal and state refundable
  credits, as the doc says.
- L5: the doc labels Hypothesis properties and example tests apart.
- L6: an oracle test runs a California override case batched, on a
  shared system built from another household, and alone.
- Rounding: half-dollars round up in every table and chart label
  (+1,886.50 shows as +1,887).
- N2, N3, N5-N8: the guard text states its noise band; an exact one-cent
  float32 step now counts as a change; full citations; the origin check
  says GitHub, not public GitHub; clearer SNAP caveat; the guard's false
  alarm is documented.
- N4: public files name repository paths only.
- The script's policyengine-us children may run up to two hours
  (--timeout), for loaded machines.
- Tier counts: unit 5,590 -> 5,624; oracle_policyengine 206 -> 207.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The Medicaid check also covers the with-health decomposition's
  medicaid_cost leaf, the figure the with-health column counts.
- The float32 guard's two limits are stated and pinned by tests: from
  $32,768 to $131,072 one or two float32 steps of noise count as a cent
  (a false alarm, not a miss), and the one-cent bound covers a stored
  value, not one computed from larger operands.
- The guard summary states the threshold it applies.
- _money refuses a non-number, such as a string.
- The doc says half-dollars round up in magnitude, notes that MCA
  15-30-2340(5)'s table uses gross household income, and describes the
  earlier cases instead of pointing at an unpublished review.
- Tier counts: unit 5,624 -> 5,628.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generated from the clean commit a915b96. The JSON results equal those
at 9e104e2 exactly. The only table change is display rounding:
household C in Montana gains $1,886.50, now shown as +1,887 rather than
+1,886. The text changes are the round-2 fixes: Montana's credit
evidence, the Medicaid valuation (with same-year ratios), the guard
summary, the SNAP caveat, the full Medicaid limit path, and the checks
list. The float32 guard, under the one-cent rule, found nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Merge audit (head d21171e)

Round 1: request changes (independent Opus 5.5 lane, at 45fe6d2)

  • It rebuilt the situations by hand and matched all nine cases to within $0.01, and it matched every carried COLA to SSA's.
  • High: California's 2026 SSP payment standard was stale. It is fixed with a cited CDSS override, which moves household B in California.
  • Medium: a float32 use-tax artifact had been described as a mechanism. The pension was moved off the bracket edge, and a guard was added.
  • Medium: the pinned PolicyEngine-US revision was not public. The run moved to the PyPI release policyengine-us 2.18.0, with a hash check on the wheel.
  • Nine lows were also fixed.

Round 2: request changes (a fresh independent lane, at 9e104e2)

  • It re-ran all nine cases on 2.18.0 by hand, and all 297 table cells match.
  • It confirmed California's SSP counts as SNAP unearned income (unearned_spm_unit.yaml:13; 7 CFR 273.9(b)(2)).
  • Medium: the Montana credit wording, now fixed.
  • Six lows were also fixed. The Medicaid valuation is now described exactly and two-sided, with no "upper-end" wording. Public files contain no private paths.

Final check (an independent Opus 5.5 agent, at d21171e): approve.

  • JSON results are identical to 9e104e2.
  • The only display change is half-dollar rounding: household C Montana, +1,886.50, now shows as +1,887.
  • 155 unit tests pass, and the lane ran 228 in tests/bridge/, including the live oracle tier.
  • CI passes on d21171e.

Results. Annual 2026 dollars, illustrative households, not survey data. Social Security rises by $2,052 in every case; the net change is:

Household California Montana Florida
A (on SSI) 0 0 0
B ($400/mo pension) +397 +1,845 +1,128
B, with health coverage +397 +1,845 −2,737
C ($31,200 pension) +1,942 +1,887 +1,942

Upstream follow-ups. California's 2026 payment standard in policyengine-us is a separate task. The misleadingly named Montana variable is noted in the PR body.

@MaxGhenis
MaxGhenis merged commit dd222b9 into master Sep 30, 2026
12 checks passed
MaxGhenis added a commit that referenced this pull request Oct 1, 2026
- The artifact test reads the default variant's offsets where the script
  writes them (beside the decomposition), which failed 3 of its 24 tests.
- When the cut starts SSI in a state where SSI receipt confers Medicaid
  in PolicyEngine-US (read from the release's ssi_recipient parameters;
  Montana is covered and section 1634), the health text names that route
  too. The described pattern is refused for a couple, whose household
  memo sums would double the limit.
- The category cross-check is described as it is: category_for names
  Social Security, SSI, SNAP and the income taxes, and places state
  benefits, state refundable credits and health by position.
- The no-joint-change-without-health check moves into check_invariants,
  before anything is written.
- #496's SNAP caveat, which describes losing California's supplement, is
  replaced by the direction-free fact it rests on.
- An unrecorded counterfactual is cut from the design note; the summary
  chart's legend no longer sits on the 100 percent line.
- Tests for each; unit tier 5,762.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — d21171e9 Deployed Sep 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant