Implement Maine PTFC unknown-utilities 15% rule (Schedule PTFC line 5c) - #9267
Implement Maine PTFC unknown-utilities 15% rule (Schedule PTFC line 5c)#9267DTrim99 wants to merge 4 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9267 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 2 -1
Lines 65 26 -39
=========================================
- Hits 65 26 -39
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:
|
PavelMakarchuk
left a comment
There was a problem hiding this comment.
The implementation mechanics check out — all 34 tests in the ME PTFC suite pass on the branch, the new parameter loads with correct metadata, utilities_included_in_rent defaults to false so microsim defaults are unaffected, no partner contract tests are touched, and the worksheet math in the new test (127.5 = (1000 − 150) × 0.15) is internally consistent with the quoted form text.
Requesting changes for two findings on the rewritten formula, detailed inline:
utility_expenseis the wrong "amount known" discriminator — it's the household's general SNAP-style utility expense total, not the utility portion of rent, so the new 15% fallback only fires when the household reports zero utility expenses of any kind, and separately-paid utilities get subtracted from rent.- No clamp when utilities exceed rent — countable rent can go negative and offsets
real_estate_taxesdownstream; line 5d on the form can never be negative.
Caveat: maine.gov was unreachable from the review environment, so the line-5c rule was verified against the PR's quoted form text and worksheet example rather than the form PDF itself.
Generated by Claude Code
Fixes applied from @PavelMakarchuk's reviewBoth findings addressed and pushed (ME PTFC suite 36/36). Thanks for the catch — both were masked by the old tests. F1 — wrong known/unknown discriminator (fixed)You're right that
Your concrete case now resolves to the form's F2 — clamp when utilities exceed rent (fixed)
TestsAppended two demonstrating cases that fail if either fix is reverted:
The existing known-amount case 🤖 Generated with Claude Code |
PR Review (follow-up)Re-reviewed head 🔴 Critical (Must Fix)None. 🟡 Should Address
🟢 Suggestions
Validation Summary
Verdict: APPROVE once the changelog type is |
Follow-up review addressed — thanks @PavelMakarchukAll items from your 2026-08-18 follow-up applied (ME PTFC suite 38/38). Should
Suggestions
CI/codecov should stay green. Let me know if you'd prefer the long-form variable rename after all. Fixed with Claude Code assistance. |
PavelMakarchuk
left a comment
There was a problem hiding this comment.
PR Review (complete:review-pr — re-review after 8/18 commits)
Both findings from my 8/16 review are genuinely fixed, verified against the form text extracted mechanically (2022 Schedule PTFC/STFC p. 2; 2014 instructions p. 4; 36 M.R.S. §5219-KK(1)(E)):
- Discriminator ✓ — the new dedicated
me_ptfc_utilities_included_in_rentinput replacesutility_expense(the SPM-unit separately-paid utilities aggregate, which the form's line 5c does not mean). Countable-rent Case 4 is a regression guard that inverts if the old discriminator returns. - Negative clamp ✓ —
max_(rent - utility_portion, 0), with boundary tests at equal-to-rent and exceeding-rent.
The line 5c implementation reproduces all three form branches exactly — "If line 5b is yes and you know the amount… enter that amount… If yes, and you do not know the amount paid, multiply line 5a by 15% (.15)… If line 5b is no, enter '0'" — and the 0.15 is parameterized separately from the line-5e rent rate with correct page anchors for 2014/2022/2023 (the 2014-01-01 start date checks out against the 2014 form). All six countable-rent cases plus the end-to-end credit case (765) recompute correctly by hand; the full ME credits suite (125 tests) passes on the branch. Microsim-safe: utilities_included_in_rent is imputed nowhere, so defaults are unaffected. CI green.
🟡 Should address (non-blocking, but №1 is worth settling before merge since it's a public API name)
- Variable name breaks the folder convention — every sibling spells out
me_property_tax_fairness_credit_*;me_ptfc_has no precedent in the repo, and renaming a user-facing input after release is a breaking API change. Suggestme_property_tax_fairness_credit_utilities_included_in_rent_amount(the_amountsuffix also disambiguates from the booleanutilities_included_in_rent). - Parameter description — leads with a subordinate clause and uses "gross rent" in the opposite sense from the statute's term of art (§5219-KK(1)(E) defines "gross rent" as rent exclusive of utility charges, i.e. line 5d, not 5a). Suggest e.g. "Maine excludes this share of the rent paid as utilities included in rent when the amount is not known under the property tax fairness credit."
🟢 Suggestions
- Add the mirror-image test:
utilities_included_in_rent: falsewith a nonzero amount → no exclusion (guards theincluded *gate, form's "If line 5b is no" branch). - Label/description say "heat or utilities"; the form covers "heat, utilities, furniture, or similar items" — broaden the wording.
- Test-name labels "(F1…)"/"(F2…)" are session-internal identifiers; the comment bodies are excellent, just reword the labels.
- The clamp comment ("Line 5d (5a − 5c) can never be negative") slightly overstates the form — it's a defensive guard against user input where 5c exceeds 5a.
- Drive-by while the folder is open: sibling
rate/rent.yamlhaslabel: …income rate— copy-paste error for the rent rate.
Validation summary
| Check | Result |
|---|---|
| Regulatory accuracy | 0 issues (all three 5c branches match the form verbatim) |
| Reference quality | Anchors verified for all three form years; 2014 start corroborated |
| Code patterns | Clean (vectorized, parameterized, correct entities); naming nit above |
| Test coverage | 6 unit + 1 end-to-end recompute correctly; 125-test suite passes |
| CI | Passing (full suite) |
PR 9267 — ME Property Tax Fairness Credit: Schedule PTFC/STFC line 5c utilities-in-rent ruleProgram ReviewProgram: Maine Property Tax Fairness Credit (36 M.R.S. §5219-KK) — implements Schedule PTFC/STFC line 5c: when rent includes heat/utilities/furniture and the amount is known, subtract it; when unknown, subtract a 15% estimate of rent; when not included, subtract nothing. New 0.15 parameter, new dollar-amount input variable, rewritten countable-rent formula (drops an erroneous SPMUnit-level Source Documents
Verification-phase supplements: 2013 Schedule PTFC (NBER mirror, ext-1) and 2016/2019/2021/2024/2025 Schedule PTFC/STFC forms (ext-2 continuity sample) — text-extracted, not rendered.
CriticalNone. The three line-5c branches, the 0.15 value, the 5c → 5d → 5e ordering, the 2014-01-01 effective date, and all three reference page anchors match the extracted sources; every formula branch has at least one passing test; CI is passing. ShouldA1 — Wording understates the form's scope and misuses "gross rent" (VERIFIED mismatch, documentation-only; value 0.15 correct)
Confirmed by verifier at 600 DPI against the 2022 form (p. 2) and 2023 form (p. 1), plus the 2014 text layer (p. 2): all three forms say "heat, utilities, furniture, or similar items" (statute §5219-KK(1)(E) is broader still: "utilities, services, furniture, furnishings or personal property appliances"). The repo strings say "heat or utilities" / "utilities" throughout. Classified as documentation, not a value mismatch — the formula reads only the parameter's numeric value, which is correct. Second wording defect at the same loci: the description, variable documentation, and changelog all apply 15% to "gross rent", but §5219-KK(1)(E) defines gross rent as the figure exclusive of utility charges — i.e. the post-line-5c amount, the base of the sibling A2 — Naming:
|
| Category | Count |
|---|---|
| Confirmed correct (repo value = PDF) | 13 (+5 continuity form-years via ext-2) |
| Mismatches verified | 1 (wording-scope only, value correct → A1) |
| Mismatches rejected | 0 |
| Cross-reference checks | 1 (microsim imputation — REJECTED, cleared) |
| External-document checks | 2 (ext-1 TY2013 — cleared with reasoning above; ext-2 continuity — CONFIRMED) |
| Unmodeled program features | 1 (§5219-KK(1)(E) assessor arm's-length rent adjustment; not modelable from microdata) |
| Pre-existing (outside PR scope) | 2 (rent.yaml label misnomer; 2024 reference href → 2023 file → S7) |
Validation Summary
| Validator | Result |
|---|---|
| Regulatory | PASS — 0 critical; 3 should, 6 suggestions (consolidated above) |
| Reference | 4/4 citations corroborated with correct page anchors; effective date corroborated twice; form-only 15% citation confirmed correct |
| Code | PASS — 0 critical; naming/wording advisories consolidated (A1, A2); 10 pattern checks clean; ruff clean |
| Tests | All 7 expectations verified; 2 mutation gaps downgraded from critical per policy (every branch has coverage) → A3; further gaps → A4; margin/jargon hygiene → A5 |
| PDF audit | 13 matches, 1 wording-only mismatch across 12 rendered pages + 2 at 600 DPI |
| Verifiers | mismatch-1 CONFIRMED (doc-only); xref-1 REJECTED; ext-1 cleared (predecessor program, not an error); ext-2 continuity CONFIRMED |
| CI Passing | YES (all checks pass) |
Branch Status
The branch is 347 commits behind base (3 ahead). Rebase recommended before merge. Staleness did not affect any finding: all findings were verified against the PR snapshot at head SHA b008eae.
Review Severity: COMMENT
Zero critical findings. The value, mechanics, effective date, references, and formula are all verified correct against three cited form years, five additional sampled years, and the statute; the six SHOULD items are documentation wording, naming, and test-coverage improvements on a substantively correct fix.
Next Steps
Run the fix-pr workflow against this report: apply A1's wording broadening and gross-rent correction, A2's renames, A3's two mutation-guard tests, then the remaining A-items (coverage cases, margins, jargon scrub, clamp-comment reword) and any S-items worth taking; rebase on base and re-run CI.
Maine's property tax fairness credit computes rent constituting property taxes as 15% of rent, after excluding any heat/utilities included in the rent. Schedule PTFC/STFC line 5c provides that when the rent includes utilities but the amount is not known, 15% of gross rent is treated as the utility portion. me_property_tax_fairness_credit_countable_rent previously left that fallback unimplemented, so a filer whose rent includes utilities but who did not itemize a utility amount received no utility exclusion. Add the 15% fallback and a parameter for the fraction. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ator and clamp - F1: the known/unknown split for the utility portion of rent was keyed on the household's general utility_expense (SNAP-style total), making the line-5c 15% fallback unreachable whenever any utility expense was reported and subtracting separately-paid utilities from rent. Add a dedicated me_ptfc_utilities_included_in_rent amount and drive the split off the utilities_included_in_rent boolean + that amount: not included -> no subtraction; included & known -> subtract it; included & unknown -> subtract the 15%-of-rent estimate. - F2: clamp net rent with max_(rent - utility_portion, 0) so countable rent can never go negative and offset real_estate_taxes downstream (Schedule PTFC line 5d >= 0). - Tests: add a separately-paid-utilities case (1,530, inverts if F1 reverted) and a utilities-exceed-rent clamp case (0). ME PTFC suite 36/36. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…(ME PTFC) - Changelog: rename me-ptfc-utilities-in-rent.fixed.md -> .added.md (the PR adds a new parameter and input variable, so 'added' per repo convention). - Documentation: me_ptfc_utilities_included_in_rent now documents that 0 means the amount is unknown (triggers the 15%-of-gross-rent line-5c estimate), disambiguating a known $0. - References: utilities_included_in_rent.yaml adds the 2014 Schedule PTFC line-5c form (supports the 2014-01-01 start) alongside the 2022/2023 forms. No value/date change. - Tests: integration case (rent with unknown utilities -> line-5c estimate -> positive credit) and a known-amount-equals-rent boundary (-> 0 countable rent). ME PTFC suite 38/38. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…, add coverage (ME PTFC) - A2: rename me_ptfc_utilities_included_in_rent -> me_property_tax_fairness_credit_utilities_in_rent_amount and rate/utilities_included_in_rent.yaml -> rate/utilities_share_of_rent.yaml (spelled-out sibling convention; the amount no longer reads as the adjacent utilities_included_in_rent boolean). - A1: broaden 'heat or utilities' -> 'heat, utilities, furniture, or similar items'; replace 'gross rent' with 'rent paid (Schedule PTFC/STFC line 5a)' (gross rent is the utilities-exclusive base per 5219-KK(1)(E)). - A6: reword the line-5d clamp comment to the modelling rationale (guards inconsistent input), not unprinted form text. - A3/A4: mutation-guard tests (gate mirror; known-branch utility_expense guard) + coverage (multi-person, renter+owner, zero rent, >0 boundary, negative amount, default path, e2e known-amount credit). - A5: absolute_error_margin on all cases; rename review-jargon case names to domain terms. - S2/S3/S5/S7: statute-not-cited-for-15% note; move sentinel doc into the formula comment; comment/style polish; fix pre-existing rate/rent.yaml label + 2024 reference href. No parameter value changed (0.15 intact). ME PTFC suite 50/50. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
b008eae to
e5a551c
Compare
Follow-up review addressed — thanks @PavelMakarchukApplied all six SHOULD items and the actionable suggestions from your 2026-08-23 review (ME PTFC suite 50/50, rebased on main). No parameter value changed (0.15 intact). Should
Suggestions
Not applied — S6 (make it a generic household-level input): that conflicts with A2's state-specific rename you (and three validators) asked for, and you flagged it as "design preference, not a defect," so I kept the state-specific variable. Happy to revisit if you'd prefer the shared-input direction instead. Also annotated Cases 5/6 (amount ≥ rent → 0) as invalid-input clamp guards rather than Maine-published results, per your circularity note. Fixed with Claude Code assistance. |
Surfaced by PolicyEngine/policyengine-taxsim#1126 (ME renter with rent that includes utilities).
Problem
Maine's property tax fairness credit treats 15% of rent as "rent constituting property taxes," after first excluding any heat/utilities included in the rent. Per 2022 Schedule PTFC/STFC line 5c: if the rent includes utilities and the amount is known, subtract it; if the rent includes utilities and the amount is not known, subtract 15% of gross rent instead.
me_property_tax_fairness_credit_countable_rentonly handled the known-amount case (utilities_included_in_rent * utility_expense) and its comment noted the unknown-amount branch was "not implemented." So a filer whose rent includes utilities but who did not itemize a utility amount received no utility exclusion at all, overstating the countable rent (and the credit).Fix
utilities_included_in_rentis true and the utility amount is unknown (utility_expenseis 0), deduct 15% of gross rent before applying the 15% rent-constituting-property-tax rate.gov.states.me.tax.income.credits.fairness.property_tax.rate.utilities_included_in_rent(0.15) for the utility fraction.Example
Rent $17,139 with utilities included, amount unknown: utility portion = 15% × 17,139 = 2,571; countable rent = 15% × (17,139 − 2,571) = 2,185, matching the Maine worksheet (previously PE used the full 15% × 17,139 = 2,571). The known-amount and utilities-not-included cases are unchanged.