Harden income_ytd year filtering (string prefix match) #30

Open
opened 2026-06-06 19:58:15 +00:00 by tonym · 0 comments

Severity: low
Category: tech-debt
Location: income.py:56

Problem

mk.startswith(str(year)) is fragile and would mismatch malformed month keys, corrupting YTD totals.

Suggested fix

Parse the year: mk.partition('-')[0] != str(year) continue; validate month keys at write time.

Filed by automated code review.

**Severity:** low **Category:** tech-debt **Location:** `income.py:56` ### Problem `mk.startswith(str(year))` is fragile and would mismatch malformed month keys, corrupting YTD totals. ### Suggested fix Parse the year: `mk.partition('-')[0] != str(year)` continue; validate month keys at write time. _Filed by automated code review._
tonym added the
tech-debt
severity:low
labels 2026-06-06 19:58:15 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bonna61/Moon-Household-Budget#30
No description provided.