Add dedicated South Carolina dependent exemption parameter#8691
Conversation
SC's dependent exemption (Section 12-6-1140(13)) had no parameter of its own — both sc_dependent_exemption and sc_young_child_deduction read the young child deduction's amount param (gov.states.sc.tax.income.deductions.young_child.amount), which is backwards: Section 12-6-1160 defines the young child deduction as "equal to the dependent exemption amount," so the amount belongs to 12-6-1140. Move the amount param to gov.states.sc.tax.income.deductions.dependent_exemption. amount, point sc_dependent_exemption at it, and have sc_young_child_deduction reference it (keeping its own ineligible_age). No change to calculated values — the existing SC baseline tests pass unchanged. This also lets the amount be adjusted independently of the young child deduction's age gate (useful for the Child Poverty Impact Dashboard). 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 #8691 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 18 1 -17
Lines 292 13 -279
==========================================
- Hits 292 13 -279
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:
|
Per review, give the South Carolina young child deduction (Section 12-6-1160) its own amount parameter rather than referencing the dependent exemption amount. There are now two independent parameters in their correct folders: - gov.states.sc.tax.income.deductions.dependent_exemption.amount (Section 12-6-1140) - gov.states.sc.tax.income.deductions.young_child.amount (Section 12-6-1160) Values are identical (the statute sets 1160 equal to 1140), so no calculated values change; the existing SC baseline tests pass unchanged. Keeping them separate lets the two be modelled independently. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PavelMakarchuk
left a comment
There was a problem hiding this comment.
Program Review — Add dedicated South Carolina dependent exemption parameter
Scope: SC income tax parameter restructure (no-op), 2019–2025 · CI: ✅ 27/27 passing
Clean, well-justified restructure: it splits the shared parameter so sc_dependent_exemption (§12-6-1140(13)) and sc_young_child_deduction (§12-6-1160) each read their own dedicated parameter, with identical values and no calculated-value change. The statute is verified (§12-6-1140(13) is a genuine per-dependent exemption; §12-6-1160 sets the young-child deduction equal to it; the two stack), references corroborate every value 2019–2025, and the variable repoint is wired correctly with no dangling references. Requesting changes to add test coverage that locks in the separation this PR enables before merge.
Requested changes
-
Add a test that guards the split. Because both parameters currently carry identical values, the existing
sc_dependent_exemption.yaml(2 cases, both 2022) would pass even if the variable still read the oldyoung_childparameter — so nothing actually pins the repoint. Since the whole point of the split is to let the two diverge (Child Poverty Impact Dashboard), please add a case that exercises the dependent exemption against its own parameter so future drift is caught. -
Test the stacking claim. The PR states a dependent under 6 receives both deductions (~$8,220 combined), but no test combines them — each existing test exercises only one provision. Add a single case asserting both the dependent exemption and the young-child deduction fire for an under-6 dependent, to lock in the headline behavior.
-
Add per-year symmetry (lower priority).
sc_dependent_exemptionis tested only at 2022 whileyoung_childcovers 2022 + 2025. Now that the dependent exemption has its own parameter, add a 2025 dependent-exemption case for symmetry.
Suggestions (non-blocking, pre-existing)
- The SC statute text reads "four thousand one hundred ten" ($4,110) for the base, while the 2019 parameter value is
4_100(carried unchanged into the new file, not introduced here). Worth a one-time confirmation against the earliest SC1040 instructions. - The 2022 reference points to the SC1040 form (p.2) rather than the instructions — confirm the value appears there.
Validation Summary
| Check | Result |
|---|---|
| Regulatory Accuracy | ✅ Statute verified — §12-6-1140(13) per-dependent exemption; §12-6-1160 equal to it; the two stack |
| Reference Quality | ✅ Every value 2019–2025 corroborated; new file complete metadata + references; young_child edits reorder (don't weaken) citations |
| Code Patterns | ✅ Variable repointed correctly; no dangling references; values identical; changelog present; folder convention correct |
| Test Coverage | |
| CI Status | ✅ Passing (27/27) |
To auto-fix: /fix-pr 8691
🤖 Generated with Claude Code
- Add a parameter-override test proving sc_dependent_exemption reads the new dependent_exemption parameter, not young_child (would yield 18000 vs 2000 if it still read young_child) - Add a stacking test confirming an under-6 dependent receives both the dependent exemption and the young-child deduction independently - Add a 2025 case for per-year symmetry Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixes AppliedAddressed the review (no critical issues; CI was green throughout). All changes are test additions — no model/parameter logic changed. Should-address
Suggestion
Out of scope (pre-existing, untouched)
Verification
|
PavelMakarchuk
left a comment
There was a problem hiding this comment.
Re-reviewed after the latest commit — all three requested test changes are addressed:
- Case 3 (repoint pin): overrides both parameters to distinct values and asserts the variable reads
dependent_exemption(2 × $9,000 = $18,000), so a future mis-pointing now fails. - Case 4 (stacking): an under-6 dependent gets both
sc_dependent_exemptionandsc_young_child_deduction($4,930 each, 2025), proving §12-6-1140 / §12-6-1160 stack. - Case 5 (2025 symmetry): 3 dependents → $14,790.
CI is green. Approving. 🤖
What this does
South Carolina's dependent exemption (§12-6-1140(13)) had no parameter of its own — both
sc_dependent_exemptionandsc_young_child_deductionread the young-child deduction's amount. This adds proper, separate parameters for the two distinct statutory provisions, each in its own folder:gov.states.sc.tax.income.deductions.dependent_exemption.amount— §12-6-1140(13), a deduction for every dependent (read bysc_dependent_exemption).gov.states.sc.tax.income.deductions.young_child.amount— §12-6-1160, the additional deduction for dependents under 6 (read bysc_young_child_deduction).§12-6-1160 sets its amount equal to the §12-6-1140 amount, so both parameters carry identical values — but keeping them separate lets each be modelled/adjusted independently (e.g. in the Child Poverty Impact Dashboard).
No behavior change
Pure restructure — values are identical. A dependent under 6 still correctly receives both deductions (~$8,220 combined), which is real SC policy. The existing SC baseline tests pass unchanged:
sc_young_child_deduction.yaml(4) +sc_dependent_exemption.yaml(2) — 6 passed.🤖 Generated with Claude Code