Repository navigation
Conversation
Add employer_state_payroll_premium_deduction_share (default 1) for the programs whose statute puts the premium on the employer and lets it deduct up to a share from wages: CO FAMLI, DE Paid Leave, ME and MA PFML, MN Paid Leave, NY PFL and DBL, the VT Child Care Contribution and WA PFML. The employee amount is the permitted share times the deduction share; the employer-side variables carry the part it does not deduct. Encode Acts 2026 c. 101 ss. 25-26 for Massachusetts from 2027-01-01, with DFML's 2027 family and medical rates, and cite CGS 31-49g(b)(1) for the Connecticut paid leave rate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…variants Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10285 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 4 1 -3
Lines 76 193 +117
Branches 2 0 -2
==========================================
+ Hits 76 193 +117
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Describe the deduction-share programs by the employer's choice, not by who owes the premium (NY and WA put the contribution on the worker), note that MN and NY employer costs are not modeled, state why WA PFML is in and Paid Leave Oregon is out, and note that Rev. Rul. 2025-4's treatment of an employer-paid employee share as wages is not modeled. Cap the one-worker employer's taxable total in the invariants so the employer-level path is checked for every modeled state and size, pin the 2027 Massachusetts parameter values, and add file-page anchors to the PDF references. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hand-off to the US + core hub.
|
|
Hand-off update: #10282 was closed because #10279 already landed the same NC Special Assistance test fix on main. The branch already had main merged in at 21:44Z ( |
PR Review: Let employers deduct less than the permitted state payroll premium, and apply Massachusetts' 2027 PFML cap swapPR #10285 (author: MaxGhenis). Head SummaryThe PR adds I re-read the primary sources for all eight programs and for Connecticut. Each one matches the PR's split between the "may deduct up to" programs and the mandatory-withholding programs, and each matches its employer-pays-the-rest rule. The Acts 2026 c. 101 text and DFML's 2027 split confirm the Massachusetts values. Every formula reduces to the old one at the default share, so no existing result changes. Employee plus employer equals the required remittance at any share in all six modeled states. The code is vectorized, and the share is applied only inside the state-gated program variables. I hand-checked all 20 new YAML cases and two existing capped Massachusetts cases. All eight axiom issues are OPEN, labelled One should-fix item remains: three parameter descriptions don't follow the house template. There are three optional suggestions. Critical (must fix)None. Should address1. Three parameter descriptions don't follow the house template.
Suggestions1. Federal tax treatment of the part the employer pays (documented deferral; consider a follow-up issue).
2. Optional YAML cases for two paths that only the Hypothesis test reaches.
3. Small text fixes.
Verified correct
Axiom line assessmentValid. The line has eight
CI statusAll 29 checks pass at head
Branch status
Verdict: REQUEST_CHANGES |
DTrim99
left a comment
There was a problem hiding this comment.
The mechanism, the statutes for all eight states and the Massachusetts 2027 change all check out, the default share of 1 leaves every existing output unchanged, and all 20 new cases hand-check. One should-address item: three parameter descriptions (MA family and medical employee shares, DE employee share) don't follow the house template. Three suggestions, and a note to update the branch past #10295 before merging. Full report in the comment above.
What this changes
employee_state_payroll_taxwas documented as "mandatory" employee payroll taxes, but for eight programs it counted the largest employee share the employer is allowed to deduct. In those programs the law caps what the employer may deduct from wages and leaves the amount to the employer. This PR:employer_state_payroll_premium_deduction_share(Person input, default 1). It is the share of the permitted employee premium the employer actually deducts.state_payroll_premium_deduction_shareholds it between 0 and 1, because an employer may not deduct more than the permitted share. For each optional program the employee amount is now the permitted share times that share, and the employer-side variable carries the part it does not deduct, which each law makes the employer's (MN and NY employer costs are not modeled, so there the part goes nowhere). At the default every output is unchanged.family_employee_share. The date decision is below.ct/tax/payroll/paid_leave/employee_ratecited CGS 31-49e, which is the definitions section. The contribution and its 0.5% ceiling are in 31-49g(b)(1).employee_state_payroll_tax,employer_additional_state_payroll_tax, the employer-level aggregate and every touched program variable. Each now says which programs are mandatory withholding and which are optional employer pass-through, and cites the deduction rule.Origin: the PolicyBench payroll audit of 2026-10-05 (evidence on PolicyEngine/policybench branch
payroll-state-components-20261005,reference_audit/2026-10-05-payroll/; Max ruled d972, so PolicyBench excludes the four affected outputs and no PolicyBench reference depends on this PR).Programs and the rule each follows
Unchanged, because the statute puts the contribution on the worker and requires withholding (per the 2026-10-05 audit's statute review; CT and WA Cares re-read here): CA SDI (UIC 984, 986), CT Paid Leave (CGS 31-49g(b)(1), (3)), NJ TDI/FLI/UI/workforce, Paid Leave Oregon (ORS 657B.150), Oregon statewide transit tax, PA UC, RI TDI, WA Cares (RCW 50B.04.080).
The line between the two groups is the deduction text. The input covers programs whose law caps a permissive deduction ("may deduct up to", "shall deduct not greater than", "is authorized to collect", "may deduct and withhold ... not more than") and makes a deduction not taken the employer's. It excludes programs whose law requires a fixed deduction, even where the employer may also pay the worker's contribution for them.
Employer-level aggregate.
employer_total_additional_state_payroll_taxapplies the person's share to the employer's whole payroll, as if the employer deducts the same share from everyone. 458 CMR 2.05(5)(d) allows different shares for different groups, which a single per-person input can't express.Massachusetts: why 2027-01-01 and not 2026-01-01
Acts 2026 c. 101 (approved 2026-06-12, an emergency law) §25 strikes "40" in lines 22, 33 and 39 of c. 175M §6 and inserts "100". §26 strikes "100" in lines 25, 33 and 43 and inserts "40". Each figure appears exactly three times in §6, in (c), (d) and (e), so the caps swap for employers, small employers and covered business entities. Three provisions bear on the date:
Counter-point. §49 of the same act says "Section 22 shall take effect on January 1, 2027", so the legislature could give a non-income-tax section a calendar 2027 start, and it left §§25–26 under §45 instead. That is the strongest textual case for 2026.
I encode 2027-01-01 (Max asked for the date to be decided and cited). PFML contributions have no taxable year: they accrue on wages paid, at rates "set annually for January 1–December 31" (DFML; c. 175M §7(e)). §45 is a shared applicability clause written for the act's income tax sections. Read literally, it would apply the swapped caps to 2026's rates (0.18% family, 0.70% medical). That gives a 0.772% employee maximum, which contradicts §43(a)'s instruction to keep the balance unchanged. It would also make lawful 2026 family-leave deductions above 40% unlawful after the fact. §43 and the agency that administers the program both say 2027, and in 2027 the swapped caps and swapped rates leave each worker's employee and employer amounts where they were in 2026 (property 6 below). A 2026 YAML case records that the literal reading would give $772 on $100,000 instead of $460.
Not modeled: federal tax on an employer-paid employee share. For state-run PFML funds, Rev. Rul. 2025-4 (Situation 4) treats an employer's voluntary payment of the employee's permitted share ("employer pick-up") as compensation: it is in the employee's gross income and FICA wages, and the employee may deduct it as a state tax. Notice 2026-6 ends the 2025 transition relief for 2026. The ruling doesn't address private or insured plans (its footnote 3), which covers New York, and Vermont's Child Care Contribution isn't a leave program. This PR lowers only the employee's payroll deduction when the share is below 1; it does not add the pick-up to wages. The input and aggregate docstrings say so.
Invariants
These hold for every worker, wage, employer size and share, in 2026 and 2027. They are checked by
policyengine_us/tests/core/test_state_payroll_premium_deduction_share_invariants.py(Hypothesis; three copies of each drawn worker in one vectorized simulation):employee_state_payroll_taxminus the optional components doesn't depend on the share.employer_total_additional_state_payroll_taxequalsemployer_additional_state_payroll_taxin every modeled state, at any share and employer size. This ties the employer-level path to the per-worker path.All amounts are compared to float32 precision, within a cent. A second test,
test_massachusetts_2027_swaps_deduction_caps_and_rates, pins the four 2027 MA parameter values, which the properties can't distinguish from carrying 2026 forward. A mutation check (mutants.py, 13 mutants: each breaks one formula, parameter, the clip or an aggregate's size threshold) kills 13 of 13 at 8ec5126, and the property test alone kills all 13 (mutants-r2.txtin the evidence folder).Cost (local, macOS, shared host; Linux CI not yet measured): the new test file runs in 5.0 s of test time, 23 s wall including the model import, with a peak memory footprint of 1.04 GB. It runs in the Rest Python
coregroup (makegroupcore, shard 2), which CI run 38141803955 measured at 13.3 GB / 11:51; this adds 8 small simulations of at most 150 people over two years.Tests run locally
policyengine_us/tests/core/test_payroll_contributions.pyandtest_input_variable_definitions.py: 104 passed, unchanged. That covers the default-share outputs.policyengine_us/tests/policy/baseline/gov/states/tax/payroll/state_payroll_premium_deduction_share.yaml(16 cases) and four new cases inma_employee_paid_leave_contribution.yaml: 26 passed. Expected values are computed by hand from the statutory and agency rates, in comments.Targeted files only: a capacity reservation is in force on the shared host, so the full YAML shards are left to CI.
Review
Independent adversarial review r1 (Opus 5.5, in session, since the Subfleet lanes were closed by the US hub's disk pause) found no wrong number and requested four should-fix changes plus nits: the aggregate docstrings described NY and WA as employer premiums; the MN and NY employer side; the WA and Oregon line; and an employer-level branch the properties didn't reach. All are addressed in 8ec5126. Review file:
~/reviews/payroll-employer-deduction-share-2026-10-19/runs/review-r1.md. Delta review r2 at 8ec5126: AGREE, with nits on the Rev. Rul. 2025-4 scope (now limited to the state PFML funds in 727ebcb) and on the Axiom issues (quotes and NY invariants added). Review files:runs/review-r2.md.3698893465, no P1/P2. Every program matches its statute and every changed expectation recomputes. Outputs at the default share are bit-identical to the merge base over 1,584 households × 23 variables for 2024–2028.CI
The only failure at f160968 was
nc_sa.yaml(North Carolina Special Assistance 2027 COLA:nc_sa_rate1448 vs 1436). It was main's failure, fixed on main by #10279 (#10282 was closed). Main has since been merged in, and all 29 checks pass at3698893465. Nothing here touches NC.Not in this PR
Impact
None at the default share: every formula reduces to the previous one at share = 1, and MA's 2027 swap leaves each worker's employee and employer amounts unchanged (property 6). No national impact run is needed.
axiom: M.G.L. c. 175M s. 6 / Acts 2026 c. 101 → TheAxiomFoundation/rulespec-us#1817 queued; C.R.S. 8-13.3-507 → TheAxiomFoundation/rulespec-us#1818 queued; Minn. Stat. 268B.14 → TheAxiomFoundation/rulespec-us#1819 queued; N.Y. WCL 209 → TheAxiomFoundation/rulespec-us#1820 queued; 19 Del. C. 3705 → TheAxiomFoundation/rulespec-us#1821 queued; 26 M.R.S. 850-F → TheAxiomFoundation/rulespec-us#1822 queued; 32 V.S.A. 10553 → TheAxiomFoundation/rulespec-us#1823 queued; RCW 50A.10.030 → TheAxiomFoundation/rulespec-us#1824 queued (all blocked on corpus ingestion, TheAxiomFoundation/axiom-corpus#893); CGS 31-49g(b)(1) citation fix: n/a: reference-only change.
🤖 Generated with Claude Code