Repository navigation
Conversation
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11051 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 6 +5
Lines 24 108 +84
Branches 0 2 +2
=========================================
+ Hits 24 108 +84
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:
|
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preserve the legacy death benefit exclusion and count separately reported proceeds. Apply residence timing before netting spouse business income and include linked nonfilers claimed as dependents. 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: 11051
Reviewed head SHA: aeea088
Merge base SHA: 094934a
Mode: full
Scope: changed behavior and affected dependencies
Source manifest: /private/tmp/policyengine-command-runs/ea33c0bb2b64/pr-11051-review-sources.json
Review status: COMPLETE
Source Documents
- bulletin-1061.html — cached original.
- bulletin-56-30-not.pdf — cached original.
- pa1000-2025-inst.pdf — cached original.
- dfo-03.pdf — cached original.
- rulespec-2298.json — cached original.
Critical
C1 — A nonfiling dependent spouse's capital gains are counted gross, while the same spouse on their own return is netted (OPEN)
- Location:
pa_property_tax_or_rent_rebate_income.py:158-166(nonfiler_incomestarts fromdependent_gross_income).dependent_gross_income.py:63-71countsmax_(0, LTCG) + max_(0, STCG)without netting, because it was built for the IRC 152(d) gross-income test ("gains but not losses"). The filer path starts from AGI plus ATL deductions, which includesmax_(0, capital_gains)(net). - Trigger (2026): the claimant, 66, has $40,000 in wages on a SEPARATE return. The linked spouse has $5,000 in long-term gains and -$3,000 in short-term gains.
- Observed: when the spouse files their own SEPARATE return, the claimant's PTRR income is $42,000 (+$2,000 net). When the same spouse is a dependent on an adult child's return (the PR's nonfiler case), it is $45,000 (+$5,000).
- Expected: PA-1000 household income should not depend on whether the spouse is someone else's tax dependent, so one path is wrong. The filer path is the long-standing pre-PR treatment. The nonfiler path is new. A smaller gap of the same kind:
dependent_gross_incomeswaps taxable for total unemployment compensation and drops taxable dependent care benefits. - Question for the policy reviewer: does PA-1000 (2025 instructions, the gains line) count gains net of losses from property dispositions? If yes, this is CRITICAL on the rubric's eligibility basis, because a $3,000 swing can cross the $50,080 limit or a band edge. Otherwise it is a documentation item.
- Evidence:
pr-11051-review-code-evidence/repro_nonfiler_gains.pyand.out.
Coordinator assessment: The code reviewer rated this critical if the PA-1000 nets gains against losses, and the policy review confirmed that it does. The 2025 PA-1000 booklet (pp. 7–9) and the DFO-03 guide (p. 39) net gains and losses for each owner and treat a net loss as zero. So a dependent spouse with $5,000 of gains and a $3,000 loss should add $2,000, not $5,000. The dependent-nonfiler path is new in this PR, and the extra $3,000 can push a claimant over a band edge or the $50,080 limit. That is wrong eligibility or a wrong rebate amount, so I've rated it critical. Netting the spouse's gains and losses the same way as the separate-return path, and adding a test, would resolve it.
Should Address
A1 — Explicit marital units ignore cohabitating_spouses: false, so the PA rebate counts an apart spouse's income (OPEN)
- Location:
variables/household/demographic/marital_unit/marital_unit_lived_apart.py:14-15(the formula always returns False);pa_property_tax_or_rent_rebate_income.py:108-113(living_togetherreads only that flag);tools/marital_units.py:240,309-324(the flag is set only for inferred pairs). - Trigger (2026): two SEPARATE returns in one PA household. Claimant is 66 with $30,000 in wages and $2,000 in property tax; spouse has $25,000 in wages. Both returns say
cohabitating_spouses: {2026: false}. - Observed: when marital units are inferred, each return counts only its own income ($30,000 / $25,000) and the claimant gets $380. With an explicit
marital_units: {couple: [claimant, spouse]}and otherwise identical inputs, both returns count $55,000, are ineligible and get $0. Only an explicitmarital_unit_lived_apart: truerestores $30,000 and $380. - Expected: the PR's own rule (docstring at
tools/marital_units.py:160-164) treats a return's explicitcohabitating_spouses: falseas living apart for that year. That rule should not depend on whether the caller listed the marital unit. - Why this PR: it adds a second, marital-unit-level apart concept beside the existing tax-unit
cohabitating_spouses, and fills it only in the inference hook. API callers and datasets that supply marital units never get it from the existing input. Other marital-unit consumers (dependent_lives_with_spouse, SSI couple status) also ignore it in apart years. - Severity: SHOULD ADDRESS, not critical. "Spouses in one modeled household who did not live together at any time" is partly contradictory. The
cohabitating_spousesdefault of False also rules out reading it directly. The fix is to document on the variable and the input that explicit marital units needmarital_unit_lived_apart, or to derive it from explicitcohabitating_spousesinputs. Either way, add a test with explicit marital units. - Evidence:
pr-11051-review-code-evidence/repro_apart_flag.pyand.out.
A2 — The axiom line covers only the 2026 bands, not the household-income change (OPEN)
- Location: the PR body line
axiom: https://github.com/TheAxiomFoundation/rulespec-us/issues/2298 queued, plus the PR body's statement "The spouse-income change has no parity case yet". The rule is at snapshotCLAUDE.md:151-155. - Trigger: CLAUDE.md "Axiom Parity" says any PR that "adds, updates or fixes policy must also leave the same provision correct in rulespec-us". A
queuedissue must be dispatch-ready and labelledpe-parity, with the required outputs and companion tests. - Expected: every provision the PR changes has an axiom entry. That means the 2026 schedule plus the household-income change: counting a cohabiting spouse across returns and for a nonfiler, the while-apart exclusion, and the order of the death-benefit and business-loss steps.
- Observed: #2298 (OPEN, labelled
pe-parity) is dispatch-ready for the base schedule only. Its 18 controls cover the band boundaries. Its scope text keeps "the income-definition modules outside this request". No issue, PR orn/acovers the spouse-income provisions. - Impact: none on model output. The repository's completion requirement is unmet for half of the policy change.
- Fix: add a second entry, either a
pe-parityissue for the spouse-income rule (booklet pp. 3 and 9, DFO-03 p. 38, with companion cases from the same source) orn/a: <reason>. The rating follows the coordinator's should-address treatment of partial axiom coverage on PRs 11038 and 11094 in this run root. - Source:
gh issue view 2298 -R TheAxiomFoundation/rulespec-us, saved aspr-11051-policy-sources/rulespec-2298.json. Snapshot CLAUDE.md lines 151-155.
Suggestions
S1 — The new variable's conventions and the changelog could be tighter (OPEN)
marital_unit_lived_apartuses a formula that returnsfilled_array(False)where the usual pattern is an input withdefault_value = False. Its label ("during the claim year") uses PA wording on a variable named as a general household concept.- The changelog fragment does not mention that line 10 now nets business sources per owner and floors them for every PA filer. Single filers with mixed-sign Schedule C, F or K-1 amounts will see lower PTRR income.
- Severity: SUGGESTION.
S2 — The new history cases do not follow the repo's YAML test naming convention (OPEN)
- Location:
tests/.../property_tax_or_rent_rebate/history/pa_property_tax_or_rent_rebate.yaml. 20 of 23 cases (from line 239 on) have noCase N,prefix and no trailing period. Cases 1–3 in the same file do. - Severity: Numbering the cases makes them easier to cite in review and failure output.
Evidence Gaps
No material gaps reported.
Notes
- The 2026 bands and limit match 56 Pa.B. 4456 (July 25, 2026), which is headed "CLAIM YEAR 2026": $0–8,900 → $1,000; $8,901–16,700 → $770; $16,701–20,030 → $460; $20,031–50,080 → $380. The policy review downloaded the Bulletin with a browser user agent, and its hashes match those recorded in rulespec-us #2298.
- The spouse-income rules match the 2025 PA-1000 booklet (pp. 3, 8, 9) and the DFO-03 guide (pp. 38, 40). A cohabiting spouse's income counts whatever the filing status, while-apart income isn't reported, the first $5,000 of death benefits is excluded, and one spouse's business loss can't offset the other's gain. Removing while-apart amounts before the $5,000 exclusion and the business-income floor is correct.
- Entity, period and vectorization are correct, and old
life_insurance_benefitsinputs keep their treatment. Two corrections to my brief to the reviewers:tools/marital_units.pyisn't new (it came from #10000 and this PR changes it), andmarital_unit_lived_apartis a marital-unit variable. PA income tax reads none of the changed variables. - Before this PR, on a joint return, federal AGI nets one spouse's loss against the other's gain, which DFO-03 p. 38 disallows. This PR doesn't change that, so it isn't a finding here. The model also computes the rebate per tax unit, so two spouses filing separately could each get one. That too predates this PR.
Validation Summary
Local tests at the reviewed head (review venv, policyengine-core 3.37.2; imports resolved to the snapshot): 566 of 566 passed. They cover the PA PTRR folder, the spouse and SSI couple tests, all 22 YAML files that use cohabitating_spouses, and two Python test files for the marital-unit code. Each changed branch has a test that fails without it. Reproductions covered explicit marital units with an apart spouse (code-1) and the dependent spouse's gains (code-2). Sources: 5 valid in the manifest, including the Bulletin, the 2025 PA-1000 booklet and DFO-03. CI: 38/38 checks pass at aeea088.
Timing
setup seconds: 6.00s; scope seconds: 60.00s; parallel review seconds: 620.70s; policy role seconds: 620.70s; code role seconds: 563.40s; adjudication seconds: 150.00s; consolidation cleanup seconds: 33.80s; elapsed seconds: 693.00s
Review Severity
REQUEST_CHANGES. Open findings: 1 critical, 2 should address, 2 suggestions.
Update Pennsylvania’s ordinary Property Tax/Rent Rebate schedule for claim year 2026. Count income from linked cohabiting spouses on joint and separate returns, including a nonfiler represented as a dependent on another return.
The July 25, 2026 Bulletin citation, 56 Pa.B. 4456, is for claim year 2026. Pennsylvania Revenue accepts claims for 2025 through December 31, 2026 under the 2025 schedule. The Bulletin HTML and issue PDF, physical page 63 returned HTTP 403 on recheck. The schedule change covers the ordinary base component.
Append 2026 entries and an official reference to the amount and income limit parameters. Exclude reported while-apart amounts before applying the shared death benefit exclusion and before flooring the spouse’s business income. Preserve the death benefit exclusion for legacy
life_insurance_benefitsinputs. Use the dedicated death benefit and overlap inputs to distinguish ordinary, shared, and separate payments. Update the changelog. All existing expected outputs are preserved.The history file has 23 cases covering 52 households and 237 checks, comprising 167 numeric values and 70 eligibility flags. It covers the 2026 boundaries, 2025 ceiling, insurance inputs, spouse links, residence timing, business losses, nonfiling spouses, and the renter expense cap.
Validation
9ef244cb, 584 targeted cases passed on Linux across 32 YAML files, and 584 cases across the same files passed on a merge with main.make formatand targetedruff format --checkandruff checkpassed for the eight changed Python files.The 2026 schedule covers the ordinary base rebate. In the spouse-income calculation, modeled co-residents use full-year amounts when no within-year timing is reported. The tax-unit head is the joint-return claimant. Inference can pair two otherwise unmarked separate filers who share a modeled household. Explicit singleton marital units or an apart flag can resolve that ambiguity. The linked-spouse age eligibility defect is a separate issue.
Fixes #11050
axiom: TheAxiomFoundation/rulespec-us#2298 queued
The RuleSpec request contains 18 external source-control cases and 36 expected cells; all remain unrun, and the typed executable mapping remains unknown. Source admission and approval for signed encoding remain pending. The spouse-income change has no parity case yet.
Full CI run 43968624649, attempt 1, passed all 38 jobs at
c0e290ff. The branch and a merge with main each passed 584 targeted Linux household cases.At
9ef244cb2ef2f2629079bb1798c0e13b5fc98aa9, six regression tests detected the corresponding faults when the fixes were removed. The older-spouse age case remains a separate issue.🤖 Generated with Claude Code