FAILURE MAP
← Case archive

FA-58518 / Loan amortization schedules / Member archive

Late fee after grace period: shortfall tolerance · case 03

Payments a few cents short are treated as late.

Member previewVariant 3 · 3 implementations · 7 checks per implementation

Case contract

x = {'due_day', 'grace', 'paid_day' or None, 'payment_due', 'paid_amount', 'tolerance', 'fee_bp', 'fee_min', 'fee_max', 'as_of'}. A payment is on time when paid_day is not None, paid_day <= due_day + grace and payment_due - paid_amount <= tolerance. Otherwise fee = clamp(round_half_up(payment_due*fee_bp/10000), fee_min, fee_max) and days_late = max(0, (paid_day or as_of when unpaid) - due_day). Return {'late', 'fee', 'days_late'}.

Why this case matters

Amortization engines drive borrower statements, payoff quotes and investor remittances; a misplaced rounding step, boundary or ordering rule compounds across hundreds of periods.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression: shortfall tolerance{"days_late": 15, "fee": 4000, "late": true}{"days_late": 0, "fee": 0, "late": false}Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗