Repository navigation
Conversation
…after VAGI The Commonwealth Savers (529) deduction is a deduction from Virginia adjusted gross income (Va. Code § 58.1-322.03(7); Form 760 instructions, deduction code 104, entered on Form 760 line 13), not a subtraction in computing VAGI. Code 34, which the subtraction list cited, is for distributions and refunds. Only the owner of record may claim the deduction, and an owner who has attained age 70 deducts the full contribution. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9875 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 3 -1
Lines 76 45 -31
Branches 2 0 -2
=========================================
- Hits 76 45 -31
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:
|
PR Review: Allocate Virginia's 529 deduction to the owner of record and deduct it after VAGIPR #9875 (author: MaxGhenis, head SummaryThe PR makes three changes to Virginia's Commonwealth Savers (529) deduction:
The law, the values and the code are all correct, and every caller of the changed values behaves as Virginia's forms require. All 12 new YAML cases pass on the extracted head tree, and I checked each one by hand. The only gap is one boundary test: nothing tests an owner aged exactly 70, so the new Critical (must fix)None. Should address1. Nothing tests the new age-70 rule at exactly age 70.
Suggestions
Verified correct
Axiom line assessmentThe line reads
No action is needed. CI statusAll 37 checks pass ( Branch status
Verdict: REQUEST_CHANGES |
DTrim99
left a comment
There was a problem hiding this comment.
The law, values and code are correct: the deduction comes off VAGI (Form 760 line 13), goes to the owner of record, and is uncapped for owners 70 or older, and every VAGI consumer correctly sees pre-529 VAGI. rulespec-us#1510 is dispatch-ready. One should item (see the comment above): no test pins the age-70 boundary (the >= at va_529_plan_deduction_person.py:31). Please add an age-exactly-70 owner case with $10,000 into one account, expecting 10,000.
|
@DTrim99, your 10/7 should-item is addressed at head The default dataset has no 529 contribution inputs, so the hub's population run shows zero change, as the body explains. Could you re-review? |
PR Review (round 2): Allocate Virginia's 529 deduction to the owner of record and deduct it after VAGIPR #9875 (author: MaxGhenis). Round 1 reviewed SummaryThe round-1 should item is fixed. Commit I ran a mutation check on an extracted copy of the head. With
With the original Round-1 items
New findingsCritical: none. Should: none. Suggestion 1. The CI paragraph in the PR body is out of date.
The new invariants test
Axiom line assessmentUnchanged: CI statusAll 28 checks in the latest run at Branch status
Verdict: APPROVE |
DTrim99
left a comment
There was a problem hiding this comment.
Round 2: the age-70 boundary is now pinned deterministically (a YAML case and invariants-test rows). Flipping >= to > fails exactly those cases, the invariants test ran and passed in CI, and the merge-tree against main is clean. The remaining items are optional suggestions.
Summary
Virginia's Commonwealth Savers (529) deduction previously allocated contributions between spouses by federal AGI share and reduced Virginia adjusted gross income (VAGI). This PR assigns the deduction to the contributing owner and takes it after VAGI, on Form 760 line 13. Owners aged 70 or older can deduct their full current-year contribution under the model's existing input conventions.
Virginia Code § 58.1-322.03(7)(a)–(b) specifies the owner-of-record deduction, the $4,000 per-account cap, and its exemption at age 70. The 2024 Form 760 instructions, code 104, PDF page 28 confirm those rules. Form 760 computes VAGI on line 9, takes Schedule ADJ deductions on line 13, and computes taxable income on line 15. Subtraction code 34 concerns certain plan distributions and refunds, rather than these contributions.
Correct line placement preserves each spouse's VAGI before the 529 deduction. It can affect the Spouse Tax Adjustment, the VAGI filing threshold, and low-income credit eligibility. When the deductible amount and other deductions and exemptions are unchanged, moving it between lines leaves taxable income unchanged.
Changes
va_529_plan_deductionsums the per-person deductions.va_taxable_incomesubtracts that sum after VAGI; the deduction is removed from the VAGI subtraction list.deductions/plan_529. The existingsubtractions.plan_529parameter path is retained for reform compatibility, with an explanatory comment incap.yaml.Tests
The existing variable-named YAML cases are preserved. They cover owner allocation, contribution and account caps, mixed-age spouses, dependent exclusion, age 69, age 72, and exactly 70, including the regression added at
b4fb768. The integration cases independently calculate Form 760 taxable income, the Spouse Tax Adjustment, and the filing threshold.Focused Python coverage adds relational invariants across paired synthetic Virginia returns for 2024 and 2026, using leaf inputs for wages, ages, contributions, and account counts. It compares calculated arrays across matched returns and tax-unit membership rather than reproducing a policy formula. These cross-entity relationships complement YAML's fixed external-source examples. The test lives with the existing Core simulation invariants in the Rest core group. Existing policy, property, and differential coverage is retained; no CI jobs or concurrency are added.
The relational regression fails in both years on the exact merge base,
bab1a47c6046a5f74a51f250e2ffaee171dc90e0: the former income-share allocation gives a positive deduction to a filer whose own contribution is zero. Both cases pass at the follow-up head. The existing unit YAML file passes all 10 cases with exit code 0, and the integration YAML file passes all 3 cases with exit code 0. Each YAML run reports one existing pytest plugin-rewrite warning.make formatalso passes. These are 15 passing cases from targeted single-file checks, not full-suite or statewide impact results.Local cost on macOS/Python 3.13: the passing test calls took 3.88 seconds for 2024 and 14.44 seconds for 2026. The wrapper's elapsed times differ from pytest's reported durations and are not a reliable base-versus-head performance comparison. Peak memory is unavailable: the sandbox denied the profiler's
kern.clockratesystem-statistics lookup after pytest completed. The profiler's nonzero exit is recorded separately from pytest's two passing cases.The existing CI run at the reviewed head reports the Rest core group at 9:37.22 elapsed and 6,373,348 KiB peak RSS (about 6.1 GiB). The new test follows the existing cross-entity simulation-invariant coverage in that group, with 24 synthetic tax units/72 people per year, one simulation per year, shared read-only policy, and no dataset or reform. No new full-group or Linux resource benchmark was run; the local single-file measurements do not establish the new group's total peak memory.
The CI run triggered by the follow-up commit was skipped. Full-suite validation at the new head is therefore not established by that run.
Invariants
Hub microsimulation impact (current head)
A real microsimulation on the default dataset, main at the merge base
bab1a47c60against this PR's head5324f5038f, for 2025 and 2026. The runs went one at a time under the shared heavy-job lock. Sums are weighted.va_income_taxva_agiva_529_plan_deductionstate_income_taxincome_taxhousehold_net_incomehousehold_benefitsComparison files are in
fixes/9875-impact/on the hub host.Impact
The hub table above shows zero change, and the zero is by construction: the default dataset has no 529 contribution inputs (
investment_in_529_plan_indvis not among its columns), sova_529_plan_deductionis $0 on both sides. A population run can't measure this PR. Its effect is limited to household calculations with entered contributions: married filers' Spouse Tax Adjustment, owners aged 70 or older, dependents' contributions, and filing-threshold or low-income-credit eligibility. The targeted unit, integration and invariant tests in Tests cover those.Review status
Earlier independent reviews approved the model repair. The delta review at
b4fb768found no P1 defect and one P2, missing microsimulation impact, which the hub table above closes. The round 2 delta review at5324f5038f(static read, Opus via Subfleet): APPROVE. The accepted methodology disclosures below remain in force under the October 7 leaf-input principle.Methodology
investment_in_529_plan_indvis interpreted as contributions to accounts owned by that person. A spouse paying into the other spouse's account is credited as the payer; that can affect the age test and deduction allocation.count_529_contribution_beneficiaries, imposing $4,000 times that count. For $7,000 in one account and $1,000 in another, the statute allows $5,000 while this existing aggregate approximation allows $8,000.age; the instructions test whether age 70 was attained on or before December 31.Partner contract coverage
No partner contract test files or expectations are edited. This round makes no additional formula change. A static search found no explicit Virginia or 529-contribution scenario in the partner fixtures. The overall PR can change Virginia API outputs for the affected ownership, age, VAGI, and eligibility cases; partner impact is not measured by this round's targeted tests.
axiom: Va. Code § 58.1-322.03(7) TheAxiomFoundation/rulespec-us#1510 queued