PolicyEngine / PolicyEngine/policyengine-api

Expose federal vs. state budgetary impact in compare.py

Open
#3,481 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
18
Forks
33
Avg merge
23h 40m
Merged PRs (30d)
22

Description

Context

PolicyEngine-US now models federal/state cost attribution for Medicaid and CHIP via medicaid_federal_cost / medicaid_state_cost / chip_federal_cost / chip_state_cost, plus cross-program aggregates federal_benefit_cost / state_benefit_cost. See PolicyEngine/policyengine-us#8075 and #8076.

Today, policyengine_api/endpoints/economy/compare.py::budgetary_impact returns a single scalar:

budgetary_impact = tax_revenue_impact - benefit_spending_impact

This conflates federal and state fiscal effects. A reform that shifts cost between federal and state (e.g., Medicaid expansion rollback, OBBBA SNAP state-match, FMAP changes) currently shows as a single number that doesn't answer the policy question "what does this cost the federal government vs. states?"

Proposed change

Extend budgetary_impact to return:

{
  "budgetary_impact": <total>,
  "federal_budgetary_impact": <tax_revenue_change - federal_benefit_spending_change>,
  "state_budgetary_impact": <state_supplement_change - state_benefit_spending_change>,
  ...existing keys...
}

Where:

  • federal_benefit_spending_change comes from aggregating federal_benefit_cost across the microsim (baseline vs. reform)
  • state_benefit_spending_change from state_benefit_cost
  • Tax revenue is overwhelmingly federal (federal income tax, payroll tax); state income taxes attributed to states. If the economy-summary payload already splits tax_revenue by level, use that; otherwise add per-level aggregates to the economy summary.

Why this matters

CBO-style reform scoring, state budget impact analysis, and any comparative advocacy depend on separating federal and state fiscal effects. The per-program microsim work is done in PE-US; this is the API-layer surface to expose it.

Related

  • PolicyEngine/policyengine-us#8075 (scoping)
  • PolicyEngine/policyengine-us#8076 (Medicaid + CHIP, merged/in-review)
  • Follow-up issue for policyengine-app-v2 UI

Contributor guide

Open the contributing guide

First steps

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

Research direction

Read policyengine_api/endpoints/economy/compare.py, starting at budgetary_impact, and inspect the economy-summary payload for any existing tax split. Trace how federal_benefit_cost and state_benefit_cost would be aggregated between baseline and reform. Done means the response preserves existing keys and exposes total, federal, and state budgetary impacts with the requested attribution.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.