Skip to content

Unify sctc to use pe-us state_ctc aggregate#853

Merged
PavelMakarchuk merged 1 commit intomainfrom
unify-sctc-state-ctc
Apr 23, 2026
Merged

Unify sctc to use pe-us state_ctc aggregate#853
PavelMakarchuk merged 1 commit intomainfrom
unify-sctc-state-ctc

Conversation

@PavelMakarchuk
Copy link
Copy Markdown
Collaborator

Summary

Removes the duplicated per-state state_variables: dict from sctc: in variable_mappings.yaml. The sctc output field now routes through pe-us's state_ctc variable, which aggregates gov.states.household.state_ctcs — the same catalog that state_cdcc / state_eitc already use via the v38 / v39 adapters.

Motivation

The sctc mapping was the last holdout using the per-state state_variables: lookup instead of the shared pe-us aggregate. That created:

  1. Duplicate logic: adding/removing a state CTC required touching both pe-us (state_ctcs.yaml) and pe-taxsim (variable_mappings.yaml).
  2. Drift risk: the pe-taxsim dict had CT: ct_child_tax_rebate, a one-time 2022 rebate, still producing phantom values for 2023+ (surfaced in policyengine-taxsim#849). The pe-us aggregate (once pe-us#8146 merges) won't have this problem.

After this change, sctc behaves consistently with v38 (CDCC) and v39 (EITC): single source of truth in pe-us, component-split overrides in the resolver for OK and MN.

Changes

  • state_output_resolver.py: taxsim_sctc moves from DIRECT_STATE_MAPPING_ADAPTERS to OUTPUT_ADAPTER_BASE_VARIABLES with base variable state_ctc.
  • variable_mappings.yaml: removes the 20-state state_variables: block under sctc:.
  • OK/MN overrides (adapter:ok_child_tax_credit_component, adapter:mn_child_tax_credit_component) stay in OUTPUT_ADAPTER_OVERRIDES["taxsim_sctc"] — unchanged behavior.

Test plan

  • All 121 existing pe-taxsim tests pass with pe-us local checkout.
  • End-to-end smoke test across AZ, CA, CT, DE, IL, MN, NY, OK — values match pre-unification except CT (improves: see pe-us#8146).
  • Lint clean (black).

Related

🤖 Generated with Claude Code

Remove the duplicated per-state `state_variables:` dict from `sctc:` in
variable_mappings.yaml. The `sctc` field now routes through pe-us's
`state_ctc` variable, which aggregates `gov.states.household.state_ctcs`
— the same catalog CDCC/EITC already use via state_cdcc/state_eitc.

- `taxsim_sctc` moves from `DIRECT_STATE_MAPPING_ADAPTERS` to
  `OUTPUT_ADAPTER_BASE_VARIABLES` with base `state_ctc`.
- OK and MN component-split overrides stay in
  `OUTPUT_ADAPTER_OVERRIDES` (legitimate special cases).
- Matches the pattern already used for v38/v39.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

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

Project Deployment Actions Updated (UTC)
policyengine-taxsim Ready Ready Preview, Comment Apr 23, 2026 10:12pm

Request Review

@PavelMakarchuk PavelMakarchuk merged commit ffc44e9 into main Apr 23, 2026
12 checks passed
@PavelMakarchuk PavelMakarchuk deleted the unify-sctc-state-ctc branch April 23, 2026 22:42
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