Fix NJ gross income formula that breaks API reform calculations#7743
Fix NJ gross income formula that breaks API reform calculations#7743
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
MaxGhenis
left a comment
There was a problem hiding this comment.
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).
Summary
ParameterNodeiteration (for cat in cats) with explicit category references innj_gross_incomeformulaclone()-based reform path, causing all NJ tax variables to silently returnnullunder any reformFixes #7742
Test plan
🤖 Generated with Claude Code