Skip to content

Commit 3ab04b9

Browse files
Merge pull request #6650 from MaxGhenis/fix-good-first-issues-clean
Fix good first issues: parameterize MT deduction rate and remove confusing comment
2 parents 7d6772a + 301b58e commit 3ab04b9

File tree

6 files changed

+66
-6
lines changed

6 files changed

+66
-6
lines changed

.claude/agents/parameter-architect.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,17 +192,40 @@ values:
192192
```yaml
193193
description: [Active voice sentence describing what this parameter does]
194194
metadata:
195+
label: [Short display name - REQUIRED, always include]
195196
unit: [currency-USD | /1 | month | year | bool]
196197
period: [year | month | day | eternity]
197198
reference:
198-
- title: [Specific document name and section]
199+
- title: [Specific document name and section/subsection]
199200
href: [Direct URL to source]
200201
publication_date: [YYYY-MM-DD]
201-
label: [Short display name]
202202
values:
203203
[date]: [value]
204204
```
205205
206+
### Description and Label Standards
207+
208+
**Description (REQUIRED):**
209+
- Must exist and describe what the parameter does
210+
- RECOMMENDED: Use active voice for clarity
211+
- RECOMMENDED: End with a period
212+
213+
**Examples:**
214+
- ✅ "Montana allocates itemized deductions to each spouse at this rate when filing separately."
215+
- ✅ "Montana caps the federal income tax deduction to this amount, based on filing status."
216+
- ⚠️ "Rate at which itemized deductions are allocated" (passive voice, but still acceptable)
217+
218+
**Label (RECOMMENDED):**
219+
- Should be included in metadata for better UI/documentation
220+
- Be concise (2-6 words) and descriptive
221+
- Missing label won't break functionality but reduces discoverability
222+
223+
**Reference (REQUIRED):**
224+
- MUST have at least one reference with title and href
225+
- RECOMMENDED: Cite specific statute subsections (§ 15-30-2131(2) vs § 15-30-2131)
226+
- RECOMMENDED: Include document section/page numbers when available
227+
- RECOMMENDED: Prefer official statutory citations over secondary sources
228+
206229
### Unit Types
207230
- `currency-USD`: Dollar amounts
208231
- `/1`: Ratios, percentages, factors

.claude/agents/reference-validator.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,24 @@ class variable_name(Variable):
2727
reference = "Specific regulation citation (e.g., 42 USC 601, 7 CFR 273.9)"
2828
```
2929
30-
### 2. Reference-Value Corroboration
30+
### 2. Reference-Value Corroboration (CRITICAL)
31+
32+
**⚠️ THE REFERENCE MUST ACTUALLY CORROBORATE THE VALUE ⚠️**
33+
34+
This is the most critical validation. A reference that doesn't support the value is worse than no reference.
35+
36+
**MANDATORY CHECKS:**
37+
1. **Fetch the referenced document** (if accessible via WebFetch)
38+
2. **Read the cited section/subsection**
39+
3. **Verify it explicitly states the value** (not just related content)
40+
4. **Flag if subsection citation is wrong** even if general section is correct
41+
42+
**Example of what went wrong:**
43+
- Parameter value: 0.5 (spouse allocation rate)
44+
- Citation: "Montana Code § 15-30-2131(2)"
45+
- Actual statute § 15-30-2131(2): About day-care home deductions (WRONG SUBSECTION!)
46+
- Correct subsection: § 15-30-2131(1)(c)(vi)(D): "deduction...must be divided equally"
47+
- **This MUST be flagged as non-corroborating even though the statute number is related**
3148
3249
**The reference must explicitly support the value:**
3350

.github/update_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def main():
77
# First, find the current package version number from the pyproject.toml file
88
with open("pyproject.toml", "rb") as f:
99
data = tomllib.load(f)
10-
version = data["project"]["version"] # Would give us "1.358.0"
10+
version = data["project"]["version"]
1111
# Then, clone the https://github.com/policyengine/policyengine-api repo using the GitHub CLI
1212
pat = os.environ["GITHUB_TOKEN"]
1313
os.system(

changelog_entry.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- bump: patch
2+
changes:
3+
changed:
4+
- Parameterized Montana spouse allocation factor for itemized deductions (was hardcoded 0.5)
5+
removed:
6+
- Unhelpful comment from .github/update_api.py
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
description: Share of tax unit itemized deductions allocated to each spouse when married filing separately on the same form. This is not a policy parameter but a mathematical representation of "divided equally".
2+
values:
3+
# 0.5 means each spouse gets 50% of joint deductions
4+
2021-01-01: 0.5
5+
metadata:
6+
label: Montana itemized deductions spouse allocation rate
7+
period: year
8+
unit: /1
9+
reference:
10+
- title: Montana Administrative Rule 42.15.524 - Itemized Deductions of Married Taxpayers
11+
href: https://rules.mt.gov/gateway/ruleno.asp?RN=42.15.524
12+
- title: Montana Form 2 Instructions
13+
href: https://revenue.mt.gov/publications/montana-form-2-individual-income-tax-return-forms-and-instructions-includes-form-2ec

policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/general/mt_itemized_deductions_indiv.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ class mt_itemized_deductions_indiv(Variable):
1515
defined_for = StateCode.MT
1616

1717
def formula(person, period, parameters):
18-
p = parameters(period).gov.irs.deductions
18+
p = parameters(period).gov.states.mt.tax.income.deductions.itemized
1919
# Since we only compute the federal charitable deduction at the tax unit level,
2020
# we will split the value between each spouse
2121
charitable_deduction = (
22-
person.tax_unit("charitable_deduction", period) * 0.5
22+
person.tax_unit("charitable_deduction", period)
23+
* p.spouse_allocation_rate
2324
)
2425
head_or_spouse = person("is_tax_unit_head_or_spouse", period)
2526
# The interest deduction is the sum of mortagage and investment interest expenses

0 commit comments

Comments
 (0)