Fix Virginia Spouse Tax Adjustment wrongly applied to Social Security recipients#8744
Open
PavelMakarchuk wants to merge 3 commits into
Open
Fix Virginia Spouse Tax Adjustment wrongly applied to Social Security recipients#8744PavelMakarchuk wants to merge 3 commits into
PavelMakarchuk wants to merge 3 commits into
Conversation
… recipients va_agi_person prorated all non-age subtractions (including the Social Security subtraction) by federal AGI share, shifting a Social-Security-only spouse's exempt benefits onto the higher-income spouse and inflating the first spouse's separate VAGI. This pushed couples over the Spouse Tax Adjustment eligibility threshold. Per Virginia's "Worksheet for Determining Separate Virginia Adjusted Gross Income" (Form 760 instructions, Lines 8 and 15), each spouse's own taxable Social Security is attributed to and subtracted from that spouse. Apply the taxable Social Security subtraction at the person level and prorate only the remaining subtractions; the per-person values still sum to the tax unit VAGI. Adds a regression integration test (the issue scenario) and a person-level va_agi_person test; both fail before the fix and pass after. Closes #8743 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8744 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 19 2 -17
Lines 308 55 -253
Branches 0 1 +1
==========================================
- Hits 308 55 -253
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…arden tests Self-review found the Social-Security-only fix left the same bug live for other Virginia-exempt income types. Virginia's separate-VAGI worksheet attributes all subtractions to the recipient spouse (Lines 14-17), so a spouse whose only income is unemployment or railroad retirement was likewise pushed into Spouse Tax Adjustment eligibility. Attribute every person-level Virginia subtraction (taxable Social Security, railroad retirement, unemployment compensation) plus the age deduction to the recipient spouse, and prorate only the remaining tax-unit-level subtractions by federal AGI share. The per-person values still sum to the tax-unit VAGI. Tests: add unemployment regression cases (integration + person-level), an over-correction guard confirming a genuine two-earner couple still receives the adjustment, and an explicit eligible=false assertion; tighten the integration margin so a zero adjustment is asserted exactly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rson Completes the per-person attribution: rather than handling only Social Security, railroad, and unemployment, introduce va_subtractions_person which attributes every Virginia subtraction to the spouse who received the underlying income, mirroring the separate-VAGI worksheet (Lines 14-17). va_agi_person now subtracts this person-level total directly. Covered per person: age deduction, taxable Social Security, Tier 1 railroad, unemployment, US government interest, military basic pay, disability income, federal/state employee salary, and military benefit subtractions. The National Guard subtraction (capped on the household total) is allocated by each person's military service income, and the 529 deduction (a household contribution, not a person's income, so it cannot cause the bug) is prorated by federal AGI share. The per-person subtractions sum exactly to the tax-unit va_subtractions across all income types (verified), so tax-unit va_agi is unchanged. Adds a va_subtractions_person test and updates the legacy va_agi_person cases to the new per-person dependency. Full VA suite: 458 passed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #8743. Virginia's Spouse Tax Adjustment (STA) was wrongly granted to couples where one spouse's only income is Virginia-exempt (e.g. Social Security, railroad retirement, unemployment, military/disability income), because the per-person Virginia AGI used by the STA worksheet (
va_agi_less_exemptions_person) did not subtract that spouse's exempt income.Root cause
va_agi_personprorated all subtractions by each person's federal AGI share. With a high-earner spouse, exempt-income subtractions were shifted onto that spouse, leaving the exempt-income-only spouse's separate VAGI inflated by income Virginia actually exempts — pushing the couple over the STA eligibility threshold.Primary source
Virginia's "Worksheet for Determining Separate Virginia Adjusted Gross Income" (Form 760 instructions) attributes each subtraction to the spouse who received the income (STEP 2, Lines 14–17), then sets each spouse's separate VAGI.
Fix
Introduce
va_subtractions_person, which attributes every Virginia subtraction to the recipient spouse, and haveva_agi_personsubtract it directly (federal AGI per person, less that person's own subtractions, plus prorated additions).Per-person attribution covers: age deduction, taxable Social Security, Tier 1 railroad, unemployment, US government interest, military basic pay, disability income, federal/state-employee salary, and the military benefit subtraction. The National Guard subtraction (capped on the household total) is allocated by each person's military service income; the 529 deduction (a household contribution, not a person's income — so it cannot cause this bug) is prorated by federal AGI share.
The per-person subtractions sum exactly to the tax-unit
va_subtractionsacross every income type tested, so tax-unitva_agi(and all downstream tax-unit results) are unchanged. The existing tax-unit subtraction variables are untouched.Verification (issue scenario: VA MFJ, both age 70, head wages $125,714, interest $511 split, SS $28,783 split)
va_agi_less_exemptions_personva_spouse_tax_adjustmentva_income_taxAlso verified STA → $0 for a spouse whose only income is unemployment, railroad, disability, military retirement, military basic pay, or US government interest; and that a genuine two-earner couple still receives the STA ($257.50). The per-person/tax-unit invariant (
Σ va_subtractions_person == va_subtractions,Σ va_agi_person == va_agi) holds across all of these.Tests
va_subtractions_personcases (unemployment, disability, military basic pay attribution)va_agi_personcases (Social-Security-only and unemployment-only spouse → separate VAGI 0)va_agi_share→ VA EITC) — no regressions🤖 Generated with Claude Code