Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
232 changes: 232 additions & 0 deletions reference_audit/2026-10-05-payroll/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
"""Candidate output-definition adapter: keep optional employer pass-through out of payroll_tax.

PolicyBench defines payroll_tax as "annual household employee-side payroll tax: employee
Social Security tax, employee Medicare tax, Additional Medicare Tax, and mandatory
employee state payroll taxes. Exclude employer payroll taxes, ..."
(policybench/benchmark_specs.json, output prompt).

policyengine-us 2.15.17 builds the output from ``employee_state_payroll_tax``
(variables/gov/states/tax/payroll/employee_state_payroll_tax.py), whose documentation
reads "Employee-side mandatory state payroll taxes and payroll-funded contributions".
It adds one ``<st>_employee_state_payroll_tax`` aggregate per state, and those add each
program's employee contribution. For programs whose premium the law places on the
employer, with the employer allowed but not required to deduct a share from wages, the
engine counts the largest share the employer may deduct. Its Minnesota variable says so:
"assuming the employer withholds the maximum permitted employee share"
(variables/gov/states/mn/tax/payroll/paid_leave/mn_employee_paid_leave_contribution.py).

This module removes the reviewed programs of that kind that reach a benchmark household
(``OPTIONAL``, classified from primary law in ``../program_classification.json``) from
the list behind ``employee_state_payroll_tax``, so the scored output reads "mandatory"
as the amount the law requires of the employee. Only the list changes; no formula, rate
or amount changes, and every mandatory employee contribution stays in. It has the form
of the 2026-09-28 Maryland output-scope adapter
(reference_audit/2026-09-28/fixes/latest_md_local_output_scope.py).

It leaves in Delaware's, Maine's and Vermont's employee shares, which the same research
classifies as optional pass-throughs, and Washington's paid leave share (mixed). No
benchmark household earns wages in those states, and they were not adversarially
reviewed, so an upstream change would need to settle them first.
"""

from policyengine_core.reforms import Reform
from policyengine_core.variables import Variable

FIX_ID = "payroll_mandatory_scope"
DESCRIPTION = (
"Exclude employee shares the employer may but need not deduct from the payroll "
"tax output (output definition)"
)
AGGREGATE = "employee_state_payroll_tax"
# Employee shares the employer may, but need not, deduct from wages
# (program_classification.json, classification optional_employer_pass_through).
OPTIONAL = (
"co_employee_famli_contribution",
"ma_employee_paid_leave_contribution",
"mn_employee_paid_leave_contribution",
"ny_employee_disability_benefits_contribution",
"ny_employee_paid_family_leave_contribution",
)


def leaves(system) -> list[str]:
"""Every program contribution under the engine's state aggregates, in order.

CountryTaxBenefitSystem applies a reform twice to the same system, so on the second
pass the aggregate already lists programs; those are kept as they are.
"""
out = []
for name in system.variables[AGGREGATE].adds:
if name.endswith("_" + AGGREGATE):
out.extend(system.variables[name].adds)
else:
out.append(name)
return out


class reform(Reform):
def apply(self):
listed = self.variables[AGGREGATE].adds
if not any(name.endswith("_" + AGGREGATE) for name in listed):
# Second pass: the list already holds the kept programs.
assert not set(OPTIONAL) & set(listed)
return
current = leaves(self)
unknown = sorted(set(OPTIONAL) - set(current))
if unknown:
raise ValueError(f"not under {AGGREGATE}: {unknown}")
kept = [name for name in current if name not in OPTIONAL]

class employee_state_payroll_tax(Variable):
adds = kept

self.update_variable(employee_state_payroll_tax)
assert list(self.variables[AGGREGATE].adds) == kept
346 changes: 346 additions & 0 deletions reference_audit/2026-10-05-payroll/program_classification.json

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions reference_audit/2026-10-05-payroll/proposed_exclusions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"schema_version": 1,
"status": "proposed 2026-10-05; changes published scores, so it waits for Max's ruling (cos decision). decided_on is the draft date; a release sets it to the ruling's date. proposed_regenerations.json and proposed_exclusions.json are alternatives: a release adopts one of them, not both.",
"classification": "program_classification.json",
"sweep": "verification/sweep_payroll_scope.csv",
"basis": "A reference that turns on an input or definition the prompt never states is excluded (reference_audit/2026-09-22 rule 4; reference_audit/2026-09-28 rule 4). The input here is an employer-arrangement fact with no engine input, as in r24 (who paid for the coverage behind listed disability benefits) and r25 (whether the federal output includes the net investment income tax), both recorded as reference_depends_on_unlisted_input.",
"exclusions": [
{
"scenario_id": "scenario_032",
"variable": "payroll_tax",
"reason_code": "reference_depends_on_unlisted_input",
"alternative_reading": "The prompt defines payroll_tax as employee Social Security, Medicare and Additional Medicare Tax plus mandatory employee state payroll taxes, and says to exclude employer payroll taxes. Minnesota Paid Leave premiums \"accrue and become payable by each employer\" (Minn. Stat. 268B.14, subd. 1); the employer must pay at least 50 percent (small employers: at least a quarter of the full rate, subd. 5a), and employees pay through wage deductions only \"the remaining portion, if any, of the premium not paid by the employer\" (subd. 3), so the employee share runs from 0 to 0.44% of wages at the employer's choice. The reference reads 'mandatory' as the employee share the statute sets, withheld unless the employer elects to pay it, and counts the largest share the employer may deduct (mn_employee_paid_leave_contribution $127.60), as policyengine-us assumes. Read as the amount the law requires of the employee whatever the employer does, which is $0, the output is employee federal payroll tax alone: the alternative value (policyengine-us 2.15.17 with latest_final and payroll_mandatory_scope).",
"frozen_value": 2346.10009765625,
"alternative_value": 2218.5,
"engine_version": "policyengine-us 2.15.17",
"decided_on": "2026-10-05",
"decided_by": "developer",
"unlisted_input": "whether the employer deducts the employee share of a state paid-leave or disability premium that the law lets it deduct but does not require, which decides whether that share is a mandatory employee state payroll tax",
"note": "Found 2026-10-05 by classifying every state program in the payroll references from primary law (reference_audit/2026-10-05-payroll/program_classification.json) and sweeping all 1,984 outputs with the programs classified as optional employer pass-through left out of employee state payroll tax; that moves this output alone in its household and no other output. The law: Minn. Stat. 268B.14, subds. 1, 3 and 5a. The frozen value has been the reference since the first run (references generated 2026-06-12)."
},
{
"scenario_id": "scenario_043",
"variable": "payroll_tax",
"reason_code": "reference_depends_on_unlisted_input",
"alternative_reading": "The prompt defines payroll_tax as employee Social Security, Medicare and Additional Medicare Tax plus mandatory employee state payroll taxes, and says to exclude employer payroll taxes. Colorado FAMLI premiums are remitted by the employer (C.R.S. 8-13.3-507(2)), which \"may deduct up to 50 percent of the premium\" from wages (507(5)); an employer that deducts less is considered to have elected to pay the rest (7 CCR 1107-1 s. 1.4(6)(A)). The reference reads 'mandatory' as the employee share the statute sets, withheld unless the employer elects to pay it, and counts the largest share the employer may deduct (co_employee_famli_contribution $17.99), as policyengine-us assumes. Read as the amount the law requires of the employee whatever the employer does, which is $0, the output is employee federal payroll tax alone: the alternative value (policyengine-us 2.15.17 with latest_final and payroll_mandatory_scope).",
"frozen_value": 330.7310791015625,
"alternative_value": 312.74322509765625,
"engine_version": "policyengine-us 2.15.17",
"decided_on": "2026-10-05",
"decided_by": "developer",
"unlisted_input": "whether the employer deducts the employee share of a state paid-leave or disability premium that the law lets it deduct but does not require, which decides whether that share is a mandatory employee state payroll tax",
"note": "Found 2026-10-05 by classifying every state program in the payroll references from primary law (reference_audit/2026-10-05-payroll/program_classification.json) and sweeping all 1,984 outputs with the programs classified as optional employer pass-through left out of employee state payroll tax; that moves this output alone in its household and no other output. The law: C.R.S. 8-13.3-507(2), (3)(b) and (5); 7 CCR 1107-1 s. 1.4(6)(A). The frozen value has been the reference since the first run (references generated 2026-06-12)."
},
{
"scenario_id": "scenario_081",
"variable": "payroll_tax",
"reason_code": "reference_depends_on_unlisted_input",
"alternative_reading": "The prompt defines payroll_tax as employee Social Security, Medicare and Additional Medicare Tax plus mandatory employee state payroll taxes, and says to exclude employer payroll taxes. Massachusetts PFML contributions are remitted by the employer (M.G.L. c. 175M, s. 6(a)), which may deduct up to 100 percent of the family and 40 percent of the medical contribution from wages (s. 6(c)) and may choose to deduct less (458 CMR 2.05(5)(c)). The reference reads 'mandatory' as the employee share the statute sets, withheld unless the employer elects to pay it, and counts the largest share the employer may deduct (ma_employee_paid_leave_contribution $805.01), as policyengine-us assumes. Read as the amount the law requires of the employee whatever the employer does, which is $0, the output is employee federal payroll tax alone: the alternative value (policyengine-us 2.15.17 with latest_final and payroll_mandatory_scope).",
"frozen_value": 14192.662109375,
"alternative_value": 13387.65234375,
"engine_version": "policyengine-us 2.15.17",
"decided_on": "2026-10-05",
"decided_by": "developer",
"unlisted_input": "whether the employer deducts the employee share of a state paid-leave or disability premium that the law lets it deduct but does not require, which decides whether that share is a mandatory employee state payroll tax",
"note": "Found 2026-10-05 by classifying every state program in the payroll references from primary law (reference_audit/2026-10-05-payroll/program_classification.json) and sweeping all 1,984 outputs with the programs classified as optional employer pass-through left out of employee state payroll tax; that moves this output alone in its household and no other output. The law: M.G.L. c. 175M, s. 6(a), (c) and (d); 458 CMR 2.05(5). The frozen value has been the reference since the first run (references generated 2026-06-12)."
},
{
"scenario_id": "scenario_082",
"variable": "payroll_tax",
"reason_code": "reference_depends_on_unlisted_input",
"alternative_reading": "The prompt defines payroll_tax as employee Social Security, Medicare and Additional Medicare Tax plus mandatory employee state payroll taxes, and says to exclude employer payroll taxes. New York's covered employer must provide disability and Paid Family Leave coverage; it pays the disability cost beyond what it collects (N.Y. Workers' Compensation Law s. 210(1)), no employer is required to fund Paid Family Leave (s. 209(3)(b)), and the employer \"is authorized to collect\" employee contributions up to the statutory caps by payroll deduction (s. 209(4)). The Workers' Compensation Board says an employer \"is allowed, but not required\" to collect them. The reference reads 'mandatory' as the employee share the statute sets, withheld unless the employer elects to pay it, and counts the largest share the employer may deduct (ny_employee_disability_benefits_contribution $31.20, ny_employee_paid_family_leave_contribution $411.91), as policyengine-us assumes. Read as the amount the law requires of the employee whatever the employer does, which is $0, the output is employee federal payroll tax alone: the alternative value (policyengine-us 2.15.17 with latest_final and payroll_mandatory_scope).",
"frozen_value": 8108.02734375,
"alternative_value": 7664.91748046875,
"engine_version": "policyengine-us 2.15.17",
"decided_on": "2026-10-05",
"decided_by": "developer",
"unlisted_input": "whether the employer deducts the employee share of a state paid-leave or disability premium that the law lets it deduct but does not require, which decides whether that share is a mandatory employee state payroll tax",
"note": "Found 2026-10-05 by classifying every state program in the payroll references from primary law (reference_audit/2026-10-05-payroll/program_classification.json) and sweeping all 1,984 outputs with the programs classified as optional employer pass-through left out of employee state payroll tax; that moves this output alone in its household and no other output. The law: N.Y. Workers' Compensation Law ss. 209(3)-(4) and 210(1). The frozen value has been the reference since the first run (references generated 2026-06-12)."
}
]
}
86 changes: 86 additions & 0 deletions reference_audit/2026-10-05-payroll/proposed_regenerations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"schema_version": 1,
"status": "proposed 2026-10-05; changes published scores, so it waits for Max's ruling (cos decision). decided_on is the draft date; a release sets it to the ruling's date. proposed_regenerations.json and proposed_exclusions.json are alternatives: a release adopts one of them, not both.",
"classification": "program_classification.json",
"sweep": "verification/sweep_payroll_scope.csv",
"basis": "The benchmark's output definitions hold (reference_audit/2026-09-28 rule 3), reading 'mandatory employee state payroll taxes' as the amount the law requires of the employee. An output-scope adapter applies that reading, in the form of latest_md_local_output_scope.py.",
"regenerated": [
{
"scenario_id": "scenario_032",
"variable": "payroll_tax",
"state": "MN",
"frozen_value": 2346.10009765625,
"regenerated_value": 2218.5,
"removed": {
"mn_employee_paid_leave_contribution": 127.6
},
"cause": "payroll_mandatory_scope",
"basis": "The output's definition counts mandatory employee state payroll taxes and excludes employer payroll taxes. Minnesota Paid Leave premiums \"accrue and become payable by each employer\" (Minn. Stat. 268B.14, subd. 1); the employer must pay at least 50 percent (small employers: at least a quarter of the full rate, subd. 5a), and employees pay through wage deductions only \"the remaining portion, if any, of the premium not paid by the employer\" (subd. 3), so the employee share runs from 0 to 0.44% of wages at the employer's choice. The frozen reference counts the largest share the employer may deduct (mn_employee_paid_leave_contribution $127.60); the regenerated value leaves it out and keeps employee Social Security and Medicare tax.",
"law": "Minn. Stat. 268B.14, subds. 1, 3 and 5a",
"engine_version": "policyengine-us 2.15.17",
"fix_module": "payroll_mandatory_scope.py",
"fix_module_sha256": "e139fe6f4dded9723721def83b03facc466bff19930532024d6262166846dc54",
"applied_together_with": [
"latest_final"
]
},
{
"scenario_id": "scenario_043",
"variable": "payroll_tax",
"state": "CO",
"frozen_value": 330.7310791015625,
"regenerated_value": 312.74322509765625,
"removed": {
"co_employee_famli_contribution": 17.99
},
"cause": "payroll_mandatory_scope",
"basis": "The output's definition counts mandatory employee state payroll taxes and excludes employer payroll taxes. Colorado FAMLI premiums are remitted by the employer (C.R.S. 8-13.3-507(2)), which \"may deduct up to 50 percent of the premium\" from wages (507(5)); an employer that deducts less is considered to have elected to pay the rest (7 CCR 1107-1 s. 1.4(6)(A)). The frozen reference counts the largest share the employer may deduct (co_employee_famli_contribution $17.99); the regenerated value leaves it out and keeps employee Social Security and Medicare tax.",
"law": "C.R.S. 8-13.3-507(2), (3)(b) and (5); 7 CCR 1107-1 s. 1.4(6)(A)",
"engine_version": "policyengine-us 2.15.17",
"fix_module": "payroll_mandatory_scope.py",
"fix_module_sha256": "e139fe6f4dded9723721def83b03facc466bff19930532024d6262166846dc54",
"applied_together_with": [
"latest_final"
]
},
{
"scenario_id": "scenario_081",
"variable": "payroll_tax",
"state": "MA",
"frozen_value": 14192.662109375,
"regenerated_value": 13387.65234375,
"removed": {
"ma_employee_paid_leave_contribution": 805.01
},
"cause": "payroll_mandatory_scope",
"basis": "The output's definition counts mandatory employee state payroll taxes and excludes employer payroll taxes. Massachusetts PFML contributions are remitted by the employer (M.G.L. c. 175M, s. 6(a)), which may deduct up to 100 percent of the family and 40 percent of the medical contribution from wages (s. 6(c)) and may choose to deduct less (458 CMR 2.05(5)(c)). The frozen reference counts the largest share the employer may deduct (ma_employee_paid_leave_contribution $805.01); the regenerated value leaves it out and keeps employee Social Security and Medicare tax.",
"law": "M.G.L. c. 175M, s. 6(a), (c) and (d); 458 CMR 2.05(5)",
"engine_version": "policyengine-us 2.15.17",
"fix_module": "payroll_mandatory_scope.py",
"fix_module_sha256": "e139fe6f4dded9723721def83b03facc466bff19930532024d6262166846dc54",
"applied_together_with": [
"latest_final"
]
},
{
"scenario_id": "scenario_082",
"variable": "payroll_tax",
"state": "NY",
"frozen_value": 8108.02734375,
"regenerated_value": 7664.91748046875,
"removed": {
"ny_employee_disability_benefits_contribution": 31.2,
"ny_employee_paid_family_leave_contribution": 411.91
},
"cause": "payroll_mandatory_scope",
"basis": "The output's definition counts mandatory employee state payroll taxes and excludes employer payroll taxes. New York's covered employer must provide disability and Paid Family Leave coverage; it pays the disability cost beyond what it collects (N.Y. Workers' Compensation Law s. 210(1)), no employer is required to fund Paid Family Leave (s. 209(3)(b)), and the employer \"is authorized to collect\" employee contributions up to the statutory caps by payroll deduction (s. 209(4)). The Workers' Compensation Board says an employer \"is allowed, but not required\" to collect them. The frozen reference counts the largest share the employer may deduct (ny_employee_disability_benefits_contribution $31.20, ny_employee_paid_family_leave_contribution $411.91); the regenerated value leaves it out and keeps employee Social Security and Medicare tax.",
"law": "N.Y. Workers' Compensation Law ss. 209(3)-(4) and 210(1)",
"engine_version": "policyengine-us 2.15.17",
"fix_module": "payroll_mandatory_scope.py",
"fix_module_sha256": "e139fe6f4dded9723721def83b03facc466bff19930532024d6262166846dc54",
"applied_together_with": [
"latest_final"
]
}
]
}
Loading
Loading