policyengine-us icon indicating copy to clipboard operation
policyengine-us copied to clipboard

Fix good first issues: parameterize MT deduction rate and remove confusing comment

Open MaxGhenis opened this issue 1 month ago β€’ 6 comments

Summary

Fixes two good first issues with simple, clear improvements.

Changes

1. Parameterize Montana itemized deductions spouse allocation (#6553)

  • Created spouse_allocation_rate.yaml parameter (value: 0.5)
  • Updated mt_itemized_deductions_indiv.py to use parameter instead of hard-coded 0.5
  • Follows proper parameter access pattern per PolicyEngine guidelines

2. Remove confusing comment (#6362)

  • Removed testing comment from .github/update_api.py

Test Plan

  • Formatting passes (make format)
  • No functional changes to calculations (0.5 rate preserved via parameter)
  • CI should pass all tests

Related Issues

Fixes #6553 Fixes #6362

πŸ€– Generated with Claude Code

MaxGhenis avatar Oct 09 '25 00:10 MaxGhenis

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 100.00%. Comparing base (0ecb2c6) to head (260fd2d). :warning: Report is 53 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #6650   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         1    -1     
  Lines           39        18   -21     
=========================================
- Hits            39        18   -21     
Flag Coverage Ξ”
unittests 100.00% <100.00%> (ΓΈ)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Oct 09 '25 00:10 codecov[bot]

βœ… PR Ready for Merge

All validation complete:

  • βœ… All CI checks passing
  • βœ… Code review complete (Score: A-)
  • βœ… 100% test coverage
  • βœ… Proper parameterization following PolicyEngine standards
  • βœ… Changelog entry included
  • βœ… No hard-coded values remaining
  • βœ… Vectorization verified

Fixes:

  • #6553 - Parameterized MT spouse allocation rate
  • #6362 - Removed confusing comment

This PR is production-ready.

MaxGhenis avatar Oct 09 '25 00:10 MaxGhenis

Updated Parameter Standards

Fixed parameter file to meet PolicyEngine standards:

  • βœ… Added field in metadata (was missing)
  • βœ… Improved description to active voice
  • βœ… Cited specific subsection Β§ 15-30-2131(2)

Parameter-architect agent enhanced with these requirements for future parameterization.

MaxGhenis avatar Oct 09 '25 00:10 MaxGhenis

⚠️ Reference Validation Failed

The reference-validator agent found critical issues:

  1. URLs inaccessible - Form 2 PDF returns 404
  2. Statute repealed - Β§ 15-30-2131 repealed in 2021 (invalid for 2022)
  3. No corroboration - References don't explicitly state the 50% allocation

Additionally, Montana's 2024 tax simplification may make this variable obsolete. Need to research:

  • Correct 2022-2023 statutory/form references
  • Whether this logic applies post-2024

Holding merge until proper references found.

MaxGhenis avatar Oct 09 '25 11:10 MaxGhenis

βœ… References Updated and Corroborated

Fixed critical reference issues found by reference-validator:

  1. Replaced inaccessible/repealed references with sources that actually corroborate the value
  2. Added explicit quote: TaxSlayer guide states deductions "divided equally between you and your spouse"
  3. Added 2024 sunset: Set to null for 2024+ when MT tax simplification eliminated separate itemized deduction calculations

References now properly support the 0.5 allocation rate.

MaxGhenis avatar Oct 09 '25 11:10 MaxGhenis

βœ… All CI Checks Passing

Final reference uses Montana Department of Revenue's official Form 2 Instructions page as primary source.

Ready for merge.

MaxGhenis avatar Oct 09 '25 11:10 MaxGhenis

@MaxGhenis reminder

PavelMakarchuk avatar Nov 23 '25 09:11 PavelMakarchuk

Updated the reference to cite Montana Administrative Rule 42.15.524 which explicitly states that itemized deductions 'must be divided equally' between spouses filing separately on the same form. This directly corroborates the 0.5 value.

@PavelMakarchuk could you re-review?

MaxGhenis avatar Dec 02 '25 15:12 MaxGhenis