Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

NJ Child Tax Credit uses the lower amount at exact table thresholds

Aperta Adatta ai principianti
#10,072 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Il bug si trova in variables/gov/states/nj/tax/income/credits/ctc/nj_ctc.py, dove l'importo per figlio deriva da p.amount.calc(taxable_income), che è inclusivo al limite inferiore. Confrontalo con la gestione right=True nella variabile nm_ctc, quindi riproduci il problema con lo snippet nell'issue a 30.000 $ e 29.999 $. È completato quando i casi esatti di soglia corrispondono alla tabella NJ in tutti e cinque i limiti, i valori adiacenti restano invariati e esistono test YAML per ciascun limite.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

The New Jersey Child Tax Credit table is upper-inclusive, but nj_ctc uses the next lower amount at each exact threshold.

The Division of Taxation's 2025 table (https://www.nj.gov/treasury/taxation/individuals/childtaxcredit.shtml, also NJ-1040 instructions line 65, https://www.nj.gov/treasury/taxation/pdf/current/1040i.pdf) gives per child: $1,000 at $30,000 or less; $800 over $30,000 through $40,000; $600 over $40,000 through $50,000; $400 over $50,000 through $60,000; $200 over $60,000 through $80,000.

PolicyEngine-US 2.38.9, single filer, one dependent child age 5, nj_taxable_income set directly, 2025:

NJ taxable income Official nj_ctc
$29,999 $1,000 $1,000
$30,000 $1,000 $800
$40,000 $800 $600
$50,000 $600 $400
$60,000 $400 $200
$80,000 $200 $0

A wider 67-case panel (single, head of household, joint and surviving spouse at each boundary and adjacent value, plus age, dependency and separate-filer controls) fails only at these 20 exact boundaries, by $200 per child, on 2.2.1, 2.30.1 and 2.30.3 as well. All adjacent values and controls match.

Cause and possible fix

policyengine_us/variables/gov/states/nj/tax/income/credits/ctc/nj_ctc.py calls p.amount.calc(taxable_income), which is lower-inclusive. Using right=True (as nm_ctc already does) while keeping the first bracket at its $0 lower endpoint fixes all 20 cases in that panel without changing the other 47:

amount_per_qualifying_child = where(
    taxable_income == p.amount.thresholds[0],
    p.amount.amounts[0],
    p.amount.calc(taxable_income, right=True),
)

Reproduce

from policyengine_us import Simulation
Y = 2025
sim = Simulation(situation={
    "people": {"p": {"age": {Y: 35}}, "c": {"age": {Y: 5}, "is_tax_unit_dependent": {Y: True}}},
    "tax_units": {"t": {"members": ["p", "c"], "filing_status": {Y: "SINGLE"}, "nj_taxable_income": {Y: 30_000}}},
    "households": {"h": {"members": ["p", "c"], "state_code": {Y: "NJ"}}},
    "families": {"f": {"members": ["p", "c"]}}, "spm_units": {"s": {"members": ["p", "c"]}},
    "marital_units": {"m": {"members": ["p"]}},
})
print(sim.calculate("nj_ctc", Y))  # 800, official table gives 1,000

Happy to open a PR with YAML tests at each boundary if that is useful.

Lingua principale
Python
Stelle
168
Fork
216
Merge medio
3g 2m
PR unite (30g)
339

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PolicyEngine/policyengine-us

Tutte le issue di PolicyEngine/policyengine-us

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.