Skip to content

Fix NJ gross income formula that breaks API reform calculations#7743

Merged
MaxGhenis merged 1 commit intomainfrom
fix-nj-gross-income
Mar 10, 2026
Merged

Fix NJ gross income formula that breaks API reform calculations#7743
MaxGhenis merged 1 commit intomainfrom
fix-nj-gross-income

Conversation

@PavelMakarchuk
Copy link
Collaborator

Summary

  • Replace ParameterNode iteration (for cat in cats) with explicit category references in nj_gross_income formula
  • The iteration pattern is incompatible with the API's clone()-based reform path, causing all NJ tax variables to silently return null under any reform
  • NJ was the only state affected — all other 50 states + DC work correctly

Fixes #7742

Test plan

  • All 318 NJ tests pass
  • Verify NJ reform calculations work on the API after deployment

🤖 Generated with Claude Code

Replace ParameterNode iteration with explicit category references.
The `for cat in cats` pattern is incompatible with the API's
clone()-based reform path, causing all NJ tax variables to silently
return null under any reform. Fixes #7742.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (752fae4) to head (fbe4d2a).
⚠️ Report is 31 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7743   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         1    -1     
  Lines           13        18    +5     
=========================================
+ Hits            13        18    +5     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@MaxGhenis MaxGhenis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the fix and searched for similar patterns across the codebase.

Fix is correct — replacing ParameterNode directory iteration with explicit attribute access is more robust and unblocks NJ reform calculations on the API.

No other instances need fixing — checked all 12 cases of parameter iteration in the codebase. NJ loss_eligible_categories was the only directory-based ParameterNode being iterated. All other 11 instances (itemized_deductions, gross_income_sources, deductions.sources, etc.) iterate over unit: list parameter files that return plain Python lists, unaffected by clone().

Regression test not feasible — the bug can't be reproduced locally (even with clone() + parameter.update()). It's specific to the deployed API environment, compounded by silent exception swallowing (API issue #3322).

@MaxGhenis MaxGhenis merged commit 763b9f2 into main Mar 10, 2026
9 checks passed
@MaxGhenis MaxGhenis deleted the fix-nj-gross-income branch March 10, 2026 09:47
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.

NJ gross income formula breaks API reform calculations by iterating ParameterNode

2 participants