Repository navigation
Conversation
…uction tests Follow-up to #9636 from its review: - Add Act 732 of 2007, § 8 (Ark. Code § 26-51-1310(f)) and DFA Subject 208 to the Arkansas gross income source references; the YAML comment already cites them for the electronic games of skill exclusion. - The no-2%-floor property test now checks ar_itemized_deductions_indiv as well as _joint, for 2019 and 2025, and drops AGI 0, where a 2% floor is invisible. - Pin status-4 proration of pooled itemized deductions, gambling losses included, by AGI (AR3 lines 31-35). - Say that the 2014 case guards the formula only: Arkansas income tax is computed from 2015, where its parameters are backdated to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
policyengine_us/variables/gov/states/ar/tax/income/deductions/itemized/ar_itemized_deductions_indiv.py: Keep the Arkansas references and subtract disallowed interest before splitting deductions by the rounded primary share and spouse remainder. Co-Authored-By: GPT-6.2 Sol <noreply@openai.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 #10222 +/- ##
===========================================
- Coverage 100.00% 97.67% -2.33%
===========================================
Files 1 2 +1
Lines 24 43 +19
Branches 0 1 +1
===========================================
+ Hits 24 42 +18
- Partials 0 1 +1
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:
|
Clarify half-up Status 4 rounding and cover both primary assignments, dependent gambling activity, and mortgage premium exclusion before proration. Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DTrim99
left a comment
There was a problem hiding this comment.
Program review
Base repository: PolicyEngine/policyengine-us
PR number: 10222
Reviewed head SHA: 5add9a9
Merge base SHA: 094934a
Mode: full
Scope: changed behavior and affected dependencies
Source manifest: /private/tmp/policyengine-command-runs/ea33c0bb2b64/pr-10222-review-sources.json
Review status: COMPLETE
Source Documents
- act732_2007.pdf — cached original.
- dfa208.pdf — cached original.
- ar3_2025.pdf — cached original.
- instr_2025.pdf — cached original.
- ar3_2022.pdf — cached original.
- instr_2021.pdf — cached original.
- act155_2017.pdf — cached original.
Critical
None.
Should Address
A1 — Axiom line uses the external-contributor form for a maintainer PR and leaves the Status 4 change unmapped (OPEN)
- Severity: SHOULD ADDRESS (repository-standard issue; consistent with how this run graded the axiom line on PR 10670).
- Location: PR body, line
axiom: needed. - Trigger: the CLAUDE.md "Axiom Parity" rule (snapshot CLAUDE.md:151-155) requires one of
<legal id> encoded-correct | <rulespec PR> encoded | <rulespec issue> queued | n/a: <reason>. It reservesaxiom: neededfor "an external contributor [who] cannot complete the Axiom work". - Expected: the PR author (MaxGhenis) has
author_association: MEMBER(gh api), so a conforming value is needed.- TheAxiomFoundation/rulespec-us#1417 is OPEN and labelled
pe-parity. It records a blocker (blocked_primary_sourcefor the Title 26 corpus). It covers Arkansas gambling winnings and losses (§§ 26-51-404, 26-51-424(a)(2)(B)) and the § 26-51-1310(f) games-of-skill exclusion. That supportsaxiom: TheAxiomFoundation/rulespec-us#1417 queuedfor the gambling parts. - #1417's title and body do not cover the Status 4 itemized-deduction proration (AR3 lines 31–35 rounding/remainder), which this PR fixes. No dependent-attribution companion case appears either.
- TheAxiomFoundation/rulespec-us#1417 is OPEN and labelled
- Observed:
axiom: needed, plus a prose pointer to #1417 described as existing "encoding debt". - Impact: no modeled-output effect. Parity tracking for the changed Status 4 rule is missing, and the line does not meet a required PR-body standard.
- Fix: use the
queuedform. Extend #1417, or open a dispatch-readype-parityissue, to include AR3 lines 31–35 (2025 instructions p. 22) and a dependent-winnings companion case built from external values. - Source: snapshot CLAUDE.md and CONTRIBUTING.md#axiom-parity;
gh issue view 1417 -R TheAxiomFoundation/rulespec-us.
Coordinator assessment: This has no effect on model output. I've rated it should-address to match how this round rated the same Axiom-line problem on #10670. Using TheAxiomFoundation/rulespec-us#1417 queued and extending #1417, or opening a companion issue, to cover AR3 lines 31-35 would resolve it.
Suggestions
S1 — The games-of-skill loss bar (§ 26-51-1310(f)(3)) is cited only on the gross-income parameters, not on the deduction it limits (OPEN)
- Severity: SUGGESTION (documentation).
- Location:
policyengine_us/variables/gov/states/ar/tax/income/deductions/itemized/ar_gambling_loss_deduction.py(reference tuple and formula comment). Compareparameters/gov/states/ar/tax/income/gross_income/sources/{individual,joint}.yaml, where the PR adds the Act 732 reference titled "...their losses are not deductible". - Trigger: a TY2015–2019 household whose
gambling_lossesinclude electronic-games-of-skill wager losses incurred before July 1, 2019. - Expected: under § 26-51-1310(f)(3), those losses are not deductible. The deduction variable should say, as the gross-income comment does, that the single input cannot separate them.
- Observed: the deduction counts all filer gambling losses up to winnings. Its comment and references are silent on (f)(3), and the model has no separate input.
- Impact: no change to the tested values. This is a known input limitation that is documented on one side only.
- Source: Act 732 of 2007 § 8, physical p. 5; DFA Subject 208.
S2 — swap-invariance test still claims every state's tax is label-invariant, which the PR now deliberately breaks for Arkansas Status 4 ties (OPEN)
- Severity: SUGGESTION
- Location:
policyengine_us/tests/core/test_state_tax_head_spouse_swap_invariance.py:1-9(module docstring) and:46-47(check 1), together with:515-518. The PR changed only the comment at check 1. - Trigger: an Arkansas married couple filing separately on the same return (Status 4) who itemize, with an AGI share of exactly k.5%. The PR's own paired YAML cases (
ar_gambling_winnings_and_losses.yaml, the 62.5% and 37.5% primary cases) give $1,374 and $1,379 for the two labellings. - Expected: the docstring states the exception, and the assertion excludes exact Arkansas Status 4 ties or checks them separately.
- Observed: the docstring still says swapping labels "must leave each state's income tax unchanged". Check 1 still asserts equality to the cent for every sampled couple. The test passes at head only because the derandomized and seeded draws contain no Arkansas Status 4 itemizer with an exact half-percent share.
- Impact: no output or behavior impact. If someone adds a crafted edge case at such a share, or a Hypothesis upgrade changes the derandomized examples, the test fails falsely, and the module documentation misstates the intended model behavior.
- Fix: one docstring sentence, plus an exclusion or a separate tie assertion.
Evidence Gaps
No material gaps reported.
Notes
- The model changes, tests and new references match Arkansas law and the DFA forms. Status 4 filers pool both spouses' itemized deductions; the primary filer takes their AGI share rounded to the nearest whole percent (2025 AR3 instructions, p. 22), and the spouse takes the remainder. Gambling losses are limited to winnings with no 2% floor (Ark. Code § 26-51-424(a)(2)(B)), and both spouses' amounts pool on one return. Dependents are left out, which matches how both Arkansas AGI variables already zero a dependent's income. Winnings from electronic games of skill are excluded under § 26-51-1310(f) (Act 732 of 2007), and DFA applies that only to winnings before July 1, 2019.
- The remainder method fixes a real over-allocation. With 45.5% and 54.5% shares, the old formula gave out 101% of a $10,000 pool ($4,600 + $5,500).
- No source says which way an exact half-percent tie rounds. The PR rounds it up, inferring that from DFA's dollar-rounding example, and says so.
Validation Summary
Local tests at the reviewed head (review venv, policyengine-core 3.37.2, matching uv.lock; imports resolved to the snapshot): 851 passed and 0 failed. They cover the four changed Python test files and all 55 Arkansas income tax YAML files. Every changed branch has a YAML case that fails on the base code. The property tests use a fixed grid and the swap test is seeded, so both are deterministic. The policy review re-derived every new expected value, including the tax-table rows and credits, and a diagnostic run reproduced the PR's $1,374 and $1,379. Sources: 7, and the manifest check passed. CI: 37/37 checks pass at 5add9a9.
Timing
setup seconds: 5.00s; scope seconds: 60.00s; parallel review seconds: 323.30s; policy role seconds: 323.30s; code role seconds: 297.30s; adjudication seconds: 120.00s; consolidation cleanup seconds: 34.50s; elapsed seconds: 516.00s
Review Severity
COMMENT. Open findings: 0 critical, 1 should address, 2 suggestions.
Summary
Follow-up to #9636. Adds official Arkansas games-of-skill references, fixes Status 4 itemized deduction proration, limits the gambling loss deduction to filers on the Arkansas return, and expands regression coverage.
gov.states.ar.tax.income.gross_income.sources.{joint,individual}comment that winnings from Arkansas electronic games of skill are not income "(Ark. Code § 26-51-1310(f), Act 732 of 2007); DFA applies this to winnings before July 1, 2019", but neither source was inmetadata.reference. Added:732.pdf#page=5, which has (f)(1) "Gaming winnings are not includable as income" and (f)(3) losses not deductible).Tests
This PR passed 173 scoped cases across 13 YAML and three Python files on Linux. The same 13 YAML files passed 128 cases after merging main at version 2.156.7.
ar_gambling_winnings_and_losses.yamlandar_gambling_loss_deduction.yamlpassed 28 cases. The winnings-and-losses file contains main’s 10 cases and this PR’s eight.test_ar_gambling_properties.py: 35 passed.test_ar_gross_income_source_line_comments.py: 2 passed.test_state_tax_head_spouse_swap_invariance.pypass. Two paired 2025 Status 4 YAML cases verify $1,374 and $1,379 in Arkansas tax for the two primary assignments at an exact half-percent share.ar_itemized_deductions_indiv.yamleach give $10,000 of Arkansas itemized deductions. A two-spouse 2021 case verifies that the formula subtracts $2,000 in premiums from $12,000 of federal interest before splitting the $10,000 pool into $4,600 and $5,400.axiom: needed
The existing gambling income and loss encoding debt is tracked in TheAxiomFoundation/rulespec-us#1417.
🤖 Generated with Claude Code