Repository navigation
Conversation
- Connecticut Paid Leave and the Oregon statewide transit tax read zero before contributions began (January 2021, July 2018) instead of carrying their first value back to 2015. - Massachusetts PFML (from October 2019), New Jersey TDI and FLI, New York Paid Family Leave (from 2018) and Rhode Island TDI take each year's published rate and wage base for 2018-2023, where they read zero. - New rate variables for Massachusetts PFML, the Oregon transit tax and the Vermont Child Care Contribution average the rates in force at the four quarter starts, so a partial first year counts only its months in force. - YAML tests pin a pre-start year and historical years for each state. A property-based test compares every month's stored values with the published tables, and each contribution with the published rate times taxable wages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er-averaged rates #10285 (merged 2026-11-09) added employer_state_payroll_premium_deduction_share and Massachusetts' 2027 swap of the family and medical deduction caps. This merge resolves its conflicts with the 2018-2027 histories: - The MA employee and employer rate variables read family_employee_share beside medical_employee_share at each quarter start. - The MA and VT employee contributions multiply the averaged permitted amount by state_payroll_premium_deduction_share. The employer contributions and employer_total_additional_state_payroll_tax add the undeducted part, as #10285 does at January 1. - family_employee_share starts at 1 on 2019-10-01, when contributions began: DFML's 2019-2023 rate pages let the employer withhold the whole family contribution. medical_employee_share keeps 0.4 from 2019-10-01 and takes #10285's 2027 value of 1. - The history invariants check the family share in the schedule, draw a deduction share for each worker in the differential, and widen the employer bound by the employee part the employer may cover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ates Six YAML cases whose expected values apply the published rates by hand: - Massachusetts 2019 at a 0.5 deduction share: the worker pays half of the October-December permitted amount (47.25 on $100,000) and the employer pays its own share plus the other half (140.25); the employer total adds the same half of the employee rate on $1,000,000 (1,402.50). - Vermont 2024 at a 0.5 deduction share: 27.50 and 192.50 on $100,000, and 1,925 for the employer total on $1,000,000. - The 2027 rate variables after the swap of caps and rates: 0.46% for the employee and 0.42% for an employer with 25 covered individuals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apply New York's 2018 weekly cap and Rhode Island's age exemption. Use covered first-year wages for Massachusetts, Oregon, and Vermont with an estimate when only annual wages are available. Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use reported employer payroll to estimate 2019 Massachusetts PFML wages. Preserve explicitly supplied zero wages and rates when other workers rely on calculated values. Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DTrim99
left a comment
There was a problem hiding this comment.
Program review
Base repository: PolicyEngine/policyengine-us
PR number: 10695
Reviewed head SHA: f2ccf5e
Merge base SHA: 094934a
Mode: full
Scope: changed behavior and affected dependencies
Source manifest: /private/tmp/policyengine-command-runs/ea33c0bb2b64/pr-10695-review-sources.json
Review status: COMPLETE
Source Documents
- ct_cgs_chap557.html — cached original.
- ma_delay_notice_2019.html — cached original.
- ma_rates_2019.html — cached original.
- ma_rates_2020.html — cached original.
- ma_rates_2021.html — cached original.
- ma_rates_2023.html — cached original.
- nj_rate_info.html — cached original.
- ny_dfs_2018.html — cached original.
- ny_dfs_2019.html — cached original.
- ny_dfs_2020.html — cached original.
- ny_dfs_2021.html — cached original.
- ny_dfs_2022.html — cached original.
- ny_dfs_2023.html — cached original.
- ny_osc_1619.html — cached original.
- ny_wcb_dbl.html — cached original.
- or_dor_stt.html — cached original.
- or_ors320.html — cached original.
- ri_28_40_2_1.html — cached original.
- ri_adv_2017_47.pdf — cached original.
- ri_adv_2019_37.pdf — cached original.
- ri_adv_2020_63.pdf — cached original.
- ri_quickref_2022.pdf — cached original.
- ri_quickref_2023.pdf — cached original.
- vt_ccc.html — cached original.
- vt_gb1326.pdf — cached original.
Critical
None.
Should Address
A1 — Axiom parity is not queued for the new RI age exemption, NY per-week cap and first-year covered-wage provisions (OPEN)
- Location: the PR body
axiom:line and the paragraph after it. Provisions:ri_employee_temporary_disability_insurance_contribution.py:19(§ 28-40-2.1),ny_paid_family_leave_taxable_wages.py(2018 per-week cap, OSC switch), and the MA, OR and VT first-year covered-wage inputs. - Requirement: repository
CLAUDE.md, "Axiom Parity (required for policy changes)": "Any PR that adds, updates or fixes policy must also leave the same provision correct in rulespec-us." Aqueuedissue must be dispatch-ready, with "the verbatim law, the required outputs, and companion tests from the same external source as your YAML tests". - Observed:
- The PR body says the queued issues "cover the original historical cases; the weekly cap, age exemption and covered-wage cases added here still need parity evidence."
- I checked this with
gh issue view. TheAxiomFoundation/rulespec-us#2069 (RI TDI, open,pe-parity) contains no § 28-40-2.1 text, "fourteen" or "14 and 15" in its body or comments. - #1820 (NY) quotes the 2018 DFS and OSC text. Its only 2018 companion case is an annual one ($100,000 → $85.56), with no per-week or OSC-switch case.
- #2070 (OR) has no covered-wage case.
- Expected: each provision this PR adds has a queued, dispatch-ready issue (or comment) with verbatim law and companion tests, or an
axiom:line that accounts for it. - Impact: an explicit repository completion requirement is unmet for provisions the PR itself names. No model output is wrong.
- Fix: add § 28-40-2.1 text and age 14/15/16 companion tests to #2069. Add per-week and OSC-switch cases to #1820, and supplied-covered-wage cases to #1817, #2070 and #1823.
Coordinator assessment: Rated should-address here, consistent with how Axiom-line gaps were rated on the other PRs in this batch; the verdict is the same. No model output is wrong. The fix is to extend rulespec-us #2069, #1820 and #2070 with these provisions and their cases, which the PR body already says are missing.
A2 — The NJ and RI 2015–2017 carry-back contradicts values in the PR's own cited sources (OPEN)
- Location: first value lines of these files:
parameters/gov/states/nj/tax/payroll/temporary_disability_insurance/employee_rate.yaml:5nj/.../family_leave_insurance/employee_rate.yaml:5nj/.../temporary_disability_insurance/taxable_wage_base.yaml:7ri/.../temporary_disability_insurance/employee_rate.yaml:5ri/.../temporary_disability_insurance/taxable_wage_base.yaml:5
- Trigger: any NJ or RI worker in 2015–2017. These years are reachable because
backdate_parametersruns from 2015. This PR changes them from 0 to the 2018 values. - Expected (cited sources):
- The NJDOL rate-info page (already in the NJ metadata) lists worker TDI/FLI/base of 0.25%/0.09%/$32,000 for 2015, 0.20%/0.08%/$32,600 for 2016 and 0.24%/0.10%/$33,500 for 2017.
- RI ADV 2017-47 (already in the RI metadata) shows 1.2% and $68,100 for 2017.
- Observed: the 2018 values (NJ 0.19%/0.09%/$33,700; RI 1.1%/$69,300). The comment says "The model does not encode earlier years".
- Impact: small understatements:
- NJ 2017 worker at $15,000: 0.28% vs 0.34%, about $9. At the cap: $94.36 vs $113.90.
- RI 2017 maximum: $762.30 vs $817.20.
- The approximation is disclosed and improves on main's zero. However, the exact values sit on pages the files already cite, so adding the rows is cheap and removes the disclosed approximation. I did not find RI 2015–2016 values in the fetched sources. This is outside the 2018–2027 brief but inside the changed behavior.
A3 — First-year start dates and covered fractions are hardcoded in Python, duplicating the parameter dates (OPEN)
- Location:
variables/gov/states/ma/tax/payroll/paid_leave/ma_paid_leave_taxable_wages.py:7(1 / 4 if period.start.year == 2019),:48and:108variables/gov/states/vt/tax/payroll/child_care/vt_child_care_contribution_wages.py:7(1 / 2 if period.start.year == 2024)variables/gov/states/or/tax/payroll/statewide_transit/or_statewide_transit_taxable_wages.py:21(wages / 2) and:39(wages * 2)- The quotient
rate / covered_year_fraction(period)is repeated inma_employee_paid_leave_contribution.py,ma_employer_paid_leave_contribution.py,vt_employee_child_care_contribution.py,vt_employer_child_care_contribution.pyandemployer_total_additional_state_payroll_tax.py:556-576.
- Trigger: any MA 2019, VT 2024 or OR 2018 calculation.
- Expected versus observed: the model-development rule is that policy values come from parameters. The new rate variables read the parameters correctly, averaging quarter starts for MA and VT and month starts for OR. The covered share of the year, however, repeats the same start dates (2019-10-01, 2024-07-01, 2018-07-01) as literals. Under current law the two encodings agree, and every current-law YAML and invariant case passes. A correction to a start-date parameter or a parametric reform that moves a start would change the rate average but not the wage fraction.
- Impact: with the even-pay fallback the two scalings cancel, so the error stays hidden. The OR repeal test (
test_oregon_2018_transit_tax_honors_monthly_rate_repeal) passes for this reason. With supplied first-year covered wages, the result depends on a hardcoded window that the parameters no longer govern. The*_ratevariables also report a year-average (MA 2019 = 0.0945%, not the 0.378% on covered wages), so every consumer must remember to divide by the hardcoded fraction. That convention is repeated in five places. - Suggested direction: derive the covered fraction from the same parameter reads, i.e. the share of quarter or month starts with a nonzero rate. Alternatively, keep one helper and express the start as a parameter. Use
WEEKS_IN_YEARinstead of the literal52atny_paid_family_leave_taxable_wages.py:40. - Severity: SHOULD ADDRESS (repo standard and maintainability; current-law outputs are correct).
Coordinator assessment: The policy review found the same thing (policy-4). Current-law results are correct.
A4 — RI TDI age exemption hardcodes ages 14 and 16 in the formula, and the lower boundary is untested (OPEN)
- Location:
variables/gov/states/ri/tax/payroll/temporary_disability_insurance/ri_employee_temporary_disability_insurance_contribution.py:18-19(exempt = (age >= 14) & (age < 16)). Test:tests/.../ri_employee_temporary_disability_insurance_contribution.yaml:110-117covers ages 14, 15 and 16 only. - Trigger: RI workers aged 14–15, any year. The exemption has no date, so it applies to every modeled year.
- Expected versus observed: the age bounds should be parameters with a statutory reference, as the existing TDI rate and wage base are. Observed results are correct: diagnostic ages 13 / 15.5 / 16 with $10,000 wages in 2018 give $110 / $0 / $110 (
pr-10695-review-code-diag.log, case 6). The age period handling is correct: YEARageis read in a YEAR formula and the float age is handled by< 16. - Coverage: no case below 14 exists. A mutation that drops
age >= 14(exempting everyone under 16) would pass the current YAML. - Severity: SHOULD ADDRESS (hardcoded policy values, plus a missing boundary on a changed branch).
Coordinator assessment: The policy review found the same hardcoding (policy-3) and confirmed the ages are right under R.I. Gen. Laws § 28-40-2.1.
A5 — The MA 2019 employer-estimate fallback headcount * cap has no test (OPEN)
- Location:
variables/gov/states/ma/tax/payroll/paid_leave/ma_paid_leave_taxable_wages.py:114(limit = where(ss_wages > 0, ss_wages, headcount * cap)) inemployer_ma_paid_leave_wage_estimate. - Trigger: MA 2019,
employer_total_payroll_tax_gross_wages> 0,employer_total_taxable_earnings_for_social_security= 0 or omitted (default 0). - Observed: diagnostic case 3, with gross $4,000,000 and default headcount 100, gives
employer_ma_paid_leave_covered_wages= $1,000,000 andemployer_total_additional_state_payroll_tax= $3,720. That is consistent with the documented intent. - Coverage: every 2019 employer-total YAML case supplies either Social Security payroll or the covered wages directly (
ma_employer_paid_leave_contribution_rate.yaml, cases from line 84 on). The invariants file suppliesemployer_total_ma_paid_leave_taxable_wagesdirectly. A mutation tolimit = ss_wageswould zero gross-only employers in 2019, and no test would fail. Covered branches: (gross > 0, SS > 0), (gross = 0 → SS/4), and cap boundary cases. - Severity: SHOULD ADDRESS (missing coverage on a changed branch; behavior verified correct by diagnostic).
Suggestions
None.
Evidence Gaps
No material gaps reported.
Notes
- Every 2018–2027 rate, wage base, deduction share and start date checked matches its cited primary source. That covers CT, MA, NJ (including the 2027 0.24% additions), NY (including the 2018 weekly cap, the OSC switch and the $31.20 Disability Benefits maximum), OR, RI and VT. Ten changed cells of the PR body's "Before and after" table recompute to the cent from the parameters. The MA Q4 2019, OR H2 2018 and VT H2 2024 even-pay estimates match the October 1 and July 1 start dates and are documented.
- Massachusetts 2019 cap: DFML's 2019 guidance says the 2019 income limit is calculated on wages paid October 1 to December 31, 2019. So capping Q4 wages alone at the $132,900 base is correct, and high earners are not overstated.
- Entity, period and vectorization are correct in the MA, OR, VT, NY, RI, CT and NJ paths. Only the MA and VT terms of the employer aggregator change, and no other state's results move. #10700 merged into main today and edits the same aggregators. The merge with current main is textually clean, and the touched tests pass on the merged tree. #10674, an open draft, edits
employer_payroll.pyand both aggregators too, so whichever lands second rebases.
Validation Summary
Local tests at the reviewed head (review venv, policyengine-core 3.37.2, matching uv.lock; imports resolved to the snapshot): 160 YAML cases in the ct, ma, nj, ny, or, ri and vt payroll folders plus gov/states/tax/payroll, and 218 pytest cases across six core payroll files, passed with 0 failures. On a merge with current main, 251 YAML cases and 9 invariant tests passed. Sources: 25 primary sources retrieved (NY DFS pages through Internet Archive copies after HTTP 403); the manifest check passed. The Axiom issues were checked with gh issue view. CI: 36/36 checks pass at f2ccf5e.
Timing
setup seconds: 5.00s; scope seconds: 60.00s; parallel review seconds: 497.80s; policy role seconds: 497.80s; code role seconds: 413.00s; adjudication seconds: 90.00s; consolidation cleanup seconds: 26.70s; elapsed seconds: 764.00s
Review Severity
COMMENT. Open findings: 0 critical, 5 should address, 0 suggestions.
What and why
PolicyEngine-US modeled most state employee payroll taxes only under current law. A 2018-2024 run therefore charged contributions before some programs began and left out others that were already collecting. This PR gives each affected parameter its published history from 2018 on:
2021-01-01: 0.005) and the Oregon statewide transit tax (2018-07-01: 0.001) had no zero entry, sobackdate_parameterscarried their first value back to 2015 (FIRST_MODELED_YEAR). Both now read zero before contributions began.ct/.../paid_leave/employee_ratefamily_rate,medical_rate,family_employee_share,medical_employee_share,employer_headcount_thresholdny_paid_family_leave_2018_osc_annual_cap_appliesto use the $85.56 annual maximum. For pay spanning the switch, also supply the sum of pre-switch wages after biweekly caps and uncapped post-switch wages asny_paid_family_leave_weekly_capped_wages. Annual maxima from 2019 follow the DFS determinations in the parameter references.statewide_transit/employee_rateEvery parameter cites its sources in its metadata. For 2019-2023 the MA files cite Wayback captures of the DFML rate pages and of its notice of the delayed start.
Before and after
An audit script,
state_payroll_at_15k.py, computes employee state payroll tax for one household in every state and year: a single parent aged 30 with a child aged 5, earning $15,000 in 2019 dollars, which PE's CPI-U carries to each year. The table shows only the states whose values change; CA, CO, DE, ME, MN, PA and WA keep theirs.Each changed cell equals the published rate times the year's earnings ($14,770.87 in 2018 ... $17,828.11 in 2023), with even pay assumed in partial start years. For example, MA 2019 applies 0.378% to one quarter of $15,000 ($14.17); NY 2018 adds New York's $31.20 Disability Benefits maximum to the 0.126% PFL contribution ($49.81 combined); OR 2018 applies 0.1% to half the year's wages ($7.39).
Already right on main, so unchanged here: CO FAMLI starts in 2023, Oregon Paid Leave in 2023, WA Cares counts half of 2023 (the 2023 WA figure is 0.5821% PFML plus half of 0.58%), CA SDI carries the full DE 3395 history (#10255), and Pennsylvania's UC employee rate is 0.06% through 2022 and 0.07% from 2023.
Years before 2018
NJ and RI carry the 2018 values back to 2015–2017 as an intended approximation. Rates for programs that began later read zero before launch. The NY weekly cap has a
0000-01-01: nullentry and is active only in 2018.Invariants
policyengine_us/tests/core/test_state_payroll_tax_history_invariants.pycopies the published tables (not the model's parameters) and checks:employer_total_additional_state_payroll_taxequals the worker-level employer contribution for Massachusetts and Vermont when both paths use the same covered taxable wages.On the branch, a test failed under each of three targeted mutations: the Massachusetts employer-payroll attribution heuristic, the mixed Oregon rate override, and the missing-input marker on the four public wage queries.
Test plan
source_conflicts/candidates.yaml.changelog.d/state-payroll-tax-history.fixed.mdThe 12 PR-changed YAML files contain 130 cases. State payroll YAML directories contain 298 cases, compared with 207 at the merge base with main.
The new core invariant file contains seven tests, including one that calls
Simulation.calculatedirectly for the four omitted wage inputs. Oregon reads all 12 month starts. Parameters with quarter-averaged rates use four quarter starts.On Linux with Python 3.14.8 and Core 3.37.2, the 12 YAML files that cover the changed variables passed all 157 cases on the branch and on a clean merge with main at 8e81d66. On the branch, seven history invariants, two deduction-share invariants and 108 payroll integration cases passed.
Overlap with other PRs
employer_state_payroll_premium_deduction_shareand Massachusetts' 2027 swap of the family and medical deduction caps. This PR merges main and resolves the conflicts:ma_employee_paid_leave_contribution_rateandma_employer_paid_leave_contribution_rate, which now readfamily_employee_shareas well asmedical_employee_share.family_employee_sharestarts at 1 on October 1, 2019, not 2024: DFML's 2019-2023 rate pages let the employer withhold the whole family contribution from the start.employer_total_additional_state_payroll_tax.py.employee_state_payroll_tax.py.Follow-ups, not in this PR
#10700 takes on all four:
A merge-tree check against #10700 at 8cf5f12 reports conflicts in
employer_additional_state_payroll_tax.py,employer_total_additional_state_payroll_tax.py, andsource_conflicts/candidates.yaml.axiom: TheAxiomFoundation/rulespec-us#2069 (RI TDI, new), TheAxiomFoundation/rulespec-us#2070 (OR statewide transit, new), and TheAxiomFoundation/rulespec-us#1817 (MA), TheAxiomFoundation/rulespec-us#1820 (NY), TheAxiomFoundation/rulespec-us#1823 (VT), TheAxiomFoundation/rulespec-us#1826 (CT) and TheAxiomFoundation/rulespec-us#1827 (NJ), each extended with its 2018-2023 history, queued
All seven wait on corpus ingestion of the historical sources, requested in axiom-corpus#893. Each issue carries the verbatim sources and companion tests from the same published values as the YAML tests here. Those issues cover the original historical cases; the weekly cap, age exemption and covered-wage cases added here still need parity evidence.
🤖 Generated with Claude Code