Skip to content

Conversation

@policyengine
Copy link

@policyengine policyengine bot commented Dec 12, 2025

Summary

Fixes #6958

The Virginia Spouse Tax Adjustment incorrectly calculated eligibility because va_agi_person prorated combined VA AGI by Federal AGI share, spreading deductions like the age deduction across both spouses instead of applying them to the correct person.

Changes

  1. Created va_age_deduction_person: Calculates age deduction per person based on their individual Federal AGI and age eligibility
  2. Created va_additions_person: Person-level Virginia additions (currently returns 0, ready for future additions)
  3. Created va_subtractions_person: Person-level Virginia subtractions (currently only age deduction)
  4. Fixed va_agi_person: Now calculates separate VAGI for each person from their individual components instead of prorating combined VA AGI
  5. Added integration test: Tests the elderly head with low income case from policyengine-taxsim Separate Additional Medicare Tax parameters by payroll / self-employment #664

Test Results

  • New integration test passes: VA Spouse Tax Adjustment correctly returns $0 for elderly head with low income
  • All 12 existing spouse tax adjustment tests pass
  • All 15 age deduction tests pass
  • Code formatted with Black

Technical Details

This matches the VA Form 760 Spouse Tax Adjustment Worksheet (page 12) which explicitly shows how to calculate "Separate Virginia Adjusted Gross Income" for each spouse:

  • Start with each person's Federal AGI
  • Apply person-specific additions
  • Apply person-specific subtractions (like age deduction)

The fix ensures that when a 75-year-old head with low income qualifies for a $12,000 age deduction, it only reduces their VAGI (potentially to negative), not the spouse's VAGI.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

PolicyEngine-Bot and others added 2 commits December 12, 2025 22:48
The Virginia Spouse Tax Adjustment incorrectly calculated eligibility
because va_agi_person prorated combined VA AGI by Federal AGI share,
spreading deductions across both spouses instead of applying them to
the correct person.

Changes:
- Created va_age_deduction_person to calculate age deduction per person
- Created va_additions_person for person-level VA additions
- Created va_subtractions_person for person-level VA subtractions
- Fixed va_agi_person to calculate separate VAGI from person-level
  components instead of prorating combined VA AGI
- Added integration test for elderly head with low income case

This matches the VA Form 760 Spouse Tax Adjustment Worksheet (page 12)
which shows separate Virginia AGI calculation for each spouse.

Fixes #6958

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with Claude Code

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

codecov bot commented Dec 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ba52386) to head (4a8e8b3).
⚠️ Report is 42 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #6960   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         4    +2     
  Lines           26        58   +32     
=========================================
+ Hits            26        58   +32     
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.

@MaxGhenis
Copy link
Contributor

@PolicyEngine it's failing tests

@policyengine
Copy link
Author

policyengine bot commented Dec 13, 2025

I ran into an issue:

Claude Code failed (exit 1): Error: spawn ps ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:483:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn ps',
  path: 'ps',
  spawnargs: [ '-o', 'pid', '--no-headers', '--ppid', 12267 ]
}

PavelMakarchuk and others added 2 commits December 14, 2025 18:22
Update tests to reflect the new correct behavior where each person's
VA AGI is calculated as their federal AGI +/- VA adjustments, rather
than prorating the combined VA AGI.

Also update uv.lock.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@PavelMakarchuk
Copy link
Collaborator

@DTrim99 please review, this PR is not a state ready to merge

@PavelMakarchuk PavelMakarchuk marked this pull request as draft December 15, 2025 21:23
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.

VA Spouse Tax Adjustment uses incorrectly prorated VAGI

4 participants