{"abstract":"Suspense loses its prior balance when another short payment arrives.","category":"Loan amortization schedules","checks":7,"contract":"x = {'due': {'interest', 'principal', 'late_fee', 'fees'}, 'payment', 'suspense', 'threshold', 'balance'}. Available = payment + suspense. If available < threshold, everything goes to suspense and nothing is applied. Otherwise apply in order interest, principal, late_fee, fees, then curtail principal with the remainder up to balance - applied principal; the rest is refunded. Return {'applied', 'curtailment', 'refund', 'suspense', 'new_balance'}.","contract_signature":"x","evaluation_group":"w2-loan-amortization-schedules-payment-application-waterfall","failed_approach":"Holding only prior suspense drops the new payment.","family":"w2-loan-amortization-schedules-payment-application-waterfall-held-funds-amount","id":"FA-58506","implementations":{"attempt":{"sha256":"ad9b3fed4ab805580285d45067ff657e800efb242e0e1d23c7891355f6dc9af0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    avail = x['payment'] + x['suspense']\n    applied = {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}\n    if avail < x['threshold']:\n        return {'applied': applied, 'curtailment': 0, 'refund': 0, 'suspense': x['suspense'], 'new_balance': x['balance']}\n    for k in ('interest', 'principal', 'late_fee', 'fees'):\n        take = min(avail, x['due'][k])\n        applied[k] = take\n        avail -= take\n    room = x['balance'] - applied['principal']\n    curt = min(avail, room)\n    refund = avail - curt\n    return {'applied': applied, 'curtailment': curt, 'refund': refund, 'suspense': 0, 'new_balance': x['balance'] - applied['principal'] - curt}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: held funds amount', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': 300, 'suspense': 200, 'threshold': 1000, 'balance': 2000}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 500, 'new_balance': 2000}], ['control 1', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': 300, 'suspense': 0, 'threshold': 1250, 'balance': 800}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 300, 'new_balance': 800}], ['control 2', {'due': {'interest': 1250, 'principal': 800, 'late_fee': 150, 'fees': 0}, 'payment': 7200, 'suspense': 200, 'threshold': 1250, 'balance': 2000}, {'applied': {'interest': 1250, 'principal': 800, 'late_fee': 150, 'fees': 0}, 'curtailment': 1200, 'refund': 4000, 'suspense': 0, 'new_balance': 0}], ['control 3', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 35}, 'payment': 0, 'suspense': 0, 'threshold': 1000, 'balance': 800}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 800}], ['control 4', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': 1250, 'suspense': 700, 'threshold': 1250, 'balance': 100000}, {'applied': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 700, 'refund': 0, 'suspense': 0, 'new_balance': 99300}], ['control 5', {'due': {'interest': 500, 'principal': 800, 'late_fee': 0, 'fees': 0}, 'payment': 300, 'suspense': 0, 'threshold': 1300, 'balance': 800}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 300, 'new_balance': 800}], ['control 6', {'due': {'interest': 500, 'principal': 800, 'late_fee': 0, 'fees': 0}, 'payment': 300, 'suspense': 700, 'threshold': 1000, 'balance': 5000}, {'applied': {'interest': 500, 'principal': 500, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 4500}]], [['regression: held funds amount', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 150, 'fees': 0}, 'payment': 0, 'suspense': 700, 'threshold': 1250, 'balance': 800}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 700, 'new_balance': 800}], ['regression: held funds amount, partial-repair probe', {'due': {'interest': 500, 'principal': 0, 'late_fee': 150, 'fees': 0}, 'payment': 649, 'suspense': 0, 'threshold': 650, 'balance': 100000}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 649, 'new_balance': 100000}], ['control 1', {'due': {'interest': 500, 'principal': 2000, 'late_fee': 0, 'fees': 35}, 'payment': 300, 'suspense': 700, 'threshold': 1000, 'balance': 2000}, {'applied': {'interest': 500, 'principal': 500, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 1500}], ['control 2', {'due': {'interest': 500, 'principal': 2000, 'late_fee': 0, 'fees': 35}, 'payment': 2500, 'suspense': 200, 'threshold': 0, 'balance': 5000}, {'applied': {'interest': 500, 'principal': 2000, 'late_fee': 0, 'fees': 35}, 'curtailment': 165, 'refund': 0, 'suspense': 0, 'new_balance': 2835}], ['control 3', {'due': {'interest': 0, 'principal': 800, 'late_fee': 150, 'fees': 0}, 'payment': 2500, 'suspense': 0, 'threshold': 950, 'balance': 2000}, {'applied': {'interest': 0, 'principal': 800, 'late_fee': 150, 'fees': 0}, 'curtailment': 1200, 'refund': 350, 'suspense': 0, 'new_balance': 0}], ['control 4', {'due': {'interest': 1250, 'principal': 800, 'late_fee': 150, 'fees': 0}, 'payment': 2201, 'suspense': 200, 'threshold': 1250, 'balance': 5000}, {'applied': {'interest': 1250, 'principal': 800, 'late_fee': 150, 'fees': 0}, 'curtailment': 201, 'refund': 0, 'suspense': 0, 'new_balance': 3999}], ['control 5', {'due': {'interest': 0, 'principal': 800, 'late_fee': 150, 'fees': 0}, 'payment': 2500, 'suspense': 0, 'threshold': 0, 'balance': 800}, {'applied': {'interest': 0, 'principal': 800, 'late_fee': 150, 'fees': 0}, 'curtailment': 0, 'refund': 1550, 'suspense': 0, 'new_balance': 0}]], [['regression: held funds amount', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': 0, 'suspense': 200, 'threshold': 1000, 'balance': 800}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 200, 'new_balance': 800}], ['regression: held funds amount, partial-repair probe', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': 300, 'suspense': 200, 'threshold': 1250, 'balance': 2000}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 500, 'new_balance': 2000}], ['control 1', {'due': {'interest': 0, 'principal': 2000, 'late_fee': 150, 'fees': 0}, 'payment': 300, 'suspense': 700, 'threshold': 0, 'balance': 800}, {'applied': {'interest': 0, 'principal': 1000, 'late_fee': 0, 'fees': 0}, 'curtailment': -200, 'refund': 200, 'suspense': 0, 'new_balance': 0}], ['control 2', {'due': {'interest': 0, 'principal': 2000, 'late_fee': 0, 'fees': 0}, 'payment': 1000, 'suspense': 0, 'threshold': 1000, 'balance': 5000}, {'applied': {'interest': 0, 'principal': 1000, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 4000}], ['control 3', {'due': {'interest': 0, 'principal': 800, 'late_fee': 0, 'fees': 35}, 'payment': 835, 'suspense': 0, 'threshold': 835, 'balance': 5000}, {'applied': {'interest': 0, 'principal': 800, 'late_fee': 0, 'fees': 35}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 4200}], ['control 4', {'due': {'interest': 0, 'principal': 800, 'late_fee': 0, 'fees': 0}, 'payment': 5800, 'suspense': 0, 'threshold': 800, 'balance': 100000}, {'applied': {'interest': 0, 'principal': 800, 'late_fee': 0, 'fees': 0}, 'curtailment': 5000, 'refund': 0, 'suspense': 0, 'new_balance': 94200}], ['control 5', {'due': {'interest': 500, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': 499, 'suspense': 200, 'threshold': 500, 'balance': 2000}, {'applied': {'interest': 500, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 199, 'refund': 0, 'suspense': 0, 'new_balance': 1801}]], [['regression: held funds amount', {'due': {'interest': 0, 'principal': 2000, 'late_fee': 0, 'fees': 35}, 'payment': 1000, 'suspense': 700, 'threshold': 2035, 'balance': 2000}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 1700, 'new_balance': 2000}], ['control 1', {'due': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 35}, 'payment': 36, 'suspense': 700, 'threshold': 35, 'balance': 800}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 35}, 'curtailment': 701, 'refund': 0, 'suspense': 0, 'new_balance': 99}], ['control 2', {'due': {'interest': 0, 'principal': 2000, 'late_fee': 150, 'fees': 0}, 'payment': 1000, 'suspense': 700, 'threshold': 1000, 'balance': 5000}, {'applied': {'interest': 0, 'principal': 1700, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 3300}], ['control 3', {'due': {'interest': 0, 'principal': 800, 'late_fee': 0, 'fees': 0}, 'payment': 5800, 'suspense': 200, 'threshold': 1000, 'balance': 5000}, {'applied': {'interest': 0, 'principal': 800, 'late_fee': 0, 'fees': 0}, 'curtailment': 4200, 'refund': 1000, 'suspense': 0, 'new_balance': 0}], ['control 4', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 150, 'fees': 0}, 'payment': 1000, 'suspense': 0, 'threshold': 1000, 'balance': 2000}, {'applied': {'interest': 1000, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 2000}], ['control 5', {'due': {'interest': 1250, 'principal': 2000, 'late_fee': 0, 'fees': 0}, 'payment': 8250, 'suspense': 200, 'threshold': 3250, 'balance': 800}, {'applied': {'interest': 1250, 'principal': 2000, 'late_fee': 0, 'fees': 0}, 'curtailment': -1200, 'refund': 6400, 'suspense': 0, 'new_balance': 0}], ['control 6', {'due': {'interest': 500, 'principal': 2000, 'late_fee': 0, 'fees': 0}, 'payment': 1000, 'suspense': 200, 'threshold': 1000, 'balance': 800}, {'applied': {'interest': 500, 'principal': 700, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 100}]], [['regression: held funds amount', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': 0, 'suspense': 700, 'threshold': 1250, 'balance': 5000}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 700, 'new_balance': 5000}], ['regression: held funds amount, partial-repair probe', {'due': {'interest': 0, 'principal': 800, 'late_fee': 0, 'fees': 35}, 'payment': 834, 'suspense': 0, 'threshold': 835, 'balance': 100000}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 834, 'new_balance': 100000}], ['control 1', {'due': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': -1, 'suspense': 200, 'threshold': 0, 'balance': 2000}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 199, 'refund': 0, 'suspense': 0, 'new_balance': 1801}], ['control 2', {'due': {'interest': 500, 'principal': 800, 'late_fee': 0, 'fees': 0}, 'payment': 1300, 'suspense': 0, 'threshold': 1000, 'balance': 800}, {'applied': {'interest': 500, 'principal': 800, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 0}], ['control 3', {'due': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 35}, 'payment': 300, 'suspense': 700, 'threshold': 0, 'balance': 800}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 35}, 'curtailment': 800, 'refund': 165, 'suspense': 0, 'new_balance': 0}], ['control 4', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 150, 'fees': 0}, 'payment': 300, 'suspense': 0, 'threshold': 0, 'balance': 100000}, {'applied': {'interest': 300, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 100000}], ['control 5', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': 1000, 'suspense': 0, 'threshold': 1000, 'balance': 2000}, {'applied': {'interest': 1000, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 2000}]]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'raised ' + type(exc).__name__\n    check(label, actual, expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"8770cc2e79512db3027b3c4634ae6b14be45c4f6b7dc24a92b6b93ab607d2b6e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    avail = x['payment'] + x['suspense']\n    applied = {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}\n    if avail < x['threshold']:\n        return {'applied': applied, 'curtailment': 0, 'refund': 0, 'suspense': x['payment'], 'new_balance': x['balance']}\n    for k in ('interest', 'principal', 'late_fee', 'fees'):\n        take = min(avail, x['due'][k])\n        applied[k] = take\n        avail -= take\n    room = x['balance'] - applied['principal']\n    curt = min(avail, room)\n    refund = avail - curt\n    return {'applied': applied, 'curtailment': curt, 'refund': refund, 'suspense': 0, 'new_balance': x['balance'] - applied['principal'] - curt}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: held funds amount', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': 300, 'suspense': 200, 'threshold': 1000, 'balance': 2000}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 500, 'new_balance': 2000}], ['control 1', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': 300, 'suspense': 0, 'threshold': 1250, 'balance': 800}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 300, 'new_balance': 800}], ['control 2', {'due': {'interest': 1250, 'principal': 800, 'late_fee': 150, 'fees': 0}, 'payment': 7200, 'suspense': 200, 'threshold': 1250, 'balance': 2000}, {'applied': {'interest': 1250, 'principal': 800, 'late_fee': 150, 'fees': 0}, 'curtailment': 1200, 'refund': 4000, 'suspense': 0, 'new_balance': 0}], ['control 3', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 35}, 'payment': 0, 'suspense': 0, 'threshold': 1000, 'balance': 800}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 800}], ['control 4', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': 1250, 'suspense': 700, 'threshold': 1250, 'balance': 100000}, {'applied': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 700, 'refund': 0, 'suspense': 0, 'new_balance': 99300}], ['control 5', {'due': {'interest': 500, 'principal': 800, 'late_fee': 0, 'fees': 0}, 'payment': 300, 'suspense': 0, 'threshold': 1300, 'balance': 800}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 300, 'new_balance': 800}], ['control 6', {'due': {'interest': 500, 'principal': 800, 'late_fee': 0, 'fees': 0}, 'payment': 300, 'suspense': 700, 'threshold': 1000, 'balance': 5000}, {'applied': {'interest': 500, 'principal': 500, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 4500}]], [['regression: held funds amount', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 150, 'fees': 0}, 'payment': 0, 'suspense': 700, 'threshold': 1250, 'balance': 800}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 700, 'new_balance': 800}], ['regression: held funds amount, partial-repair probe', {'due': {'interest': 500, 'principal': 0, 'late_fee': 150, 'fees': 0}, 'payment': 649, 'suspense': 0, 'threshold': 650, 'balance': 100000}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 649, 'new_balance': 100000}], ['control 1', {'due': {'interest': 500, 'principal': 2000, 'late_fee': 0, 'fees': 35}, 'payment': 300, 'suspense': 700, 'threshold': 1000, 'balance': 2000}, {'applied': {'interest': 500, 'principal': 500, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 1500}], ['control 2', {'due': {'interest': 500, 'principal': 2000, 'late_fee': 0, 'fees': 35}, 'payment': 2500, 'suspense': 200, 'threshold': 0, 'balance': 5000}, {'applied': {'interest': 500, 'principal': 2000, 'late_fee': 0, 'fees': 35}, 'curtailment': 165, 'refund': 0, 'suspense': 0, 'new_balance': 2835}], ['control 3', {'due': {'interest': 0, 'principal': 800, 'late_fee': 150, 'fees': 0}, 'payment': 2500, 'suspense': 0, 'threshold': 950, 'balance': 2000}, {'applied': {'interest': 0, 'principal': 800, 'late_fee': 150, 'fees': 0}, 'curtailment': 1200, 'refund': 350, 'suspense': 0, 'new_balance': 0}], ['control 4', {'due': {'interest': 1250, 'principal': 800, 'late_fee': 150, 'fees': 0}, 'payment': 2201, 'suspense': 200, 'threshold': 1250, 'balance': 5000}, {'applied': {'interest': 1250, 'principal': 800, 'late_fee': 150, 'fees': 0}, 'curtailment': 201, 'refund': 0, 'suspense': 0, 'new_balance': 3999}], ['control 5', {'due': {'interest': 0, 'principal': 800, 'late_fee': 150, 'fees': 0}, 'payment': 2500, 'suspense': 0, 'threshold': 0, 'balance': 800}, {'applied': {'interest': 0, 'principal': 800, 'late_fee': 150, 'fees': 0}, 'curtailment': 0, 'refund': 1550, 'suspense': 0, 'new_balance': 0}]], [['regression: held funds amount', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': 0, 'suspense': 200, 'threshold': 1000, 'balance': 800}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 200, 'new_balance': 800}], ['regression: held funds amount, partial-repair probe', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': 300, 'suspense': 200, 'threshold': 1250, 'balance': 2000}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 500, 'new_balance': 2000}], ['control 1', {'due': {'interest': 0, 'principal': 2000, 'late_fee': 150, 'fees': 0}, 'payment': 300, 'suspense': 700, 'threshold': 0, 'balance': 800}, {'applied': {'interest': 0, 'principal': 1000, 'late_fee': 0, 'fees': 0}, 'curtailment': -200, 'refund': 200, 'suspense': 0, 'new_balance': 0}], ['control 2', {'due': {'interest': 0, 'principal': 2000, 'late_fee': 0, 'fees': 0}, 'payment': 1000, 'suspense': 0, 'threshold': 1000, 'balance': 5000}, {'applied': {'interest': 0, 'principal': 1000, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 4000}], ['control 3', {'due': {'interest': 0, 'principal': 800, 'late_fee': 0, 'fees': 35}, 'payment': 835, 'suspense': 0, 'threshold': 835, 'balance': 5000}, {'applied': {'interest': 0, 'principal': 800, 'late_fee': 0, 'fees': 35}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 4200}], ['control 4', {'due': {'interest': 0, 'principal': 800, 'late_fee': 0, 'fees': 0}, 'payment': 5800, 'suspense': 0, 'threshold': 800, 'balance': 100000}, {'applied': {'interest': 0, 'principal': 800, 'late_fee': 0, 'fees': 0}, 'curtailment': 5000, 'refund': 0, 'suspense': 0, 'new_balance': 94200}], ['control 5', {'due': {'interest': 500, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': 499, 'suspense': 200, 'threshold': 500, 'balance': 2000}, {'applied': {'interest': 500, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 199, 'refund': 0, 'suspense': 0, 'new_balance': 1801}]], [['regression: held funds amount', {'due': {'interest': 0, 'principal': 2000, 'late_fee': 0, 'fees': 35}, 'payment': 1000, 'suspense': 700, 'threshold': 2035, 'balance': 2000}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 1700, 'new_balance': 2000}], ['control 1', {'due': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 35}, 'payment': 36, 'suspense': 700, 'threshold': 35, 'balance': 800}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 35}, 'curtailment': 701, 'refund': 0, 'suspense': 0, 'new_balance': 99}], ['control 2', {'due': {'interest': 0, 'principal': 2000, 'late_fee': 150, 'fees': 0}, 'payment': 1000, 'suspense': 700, 'threshold': 1000, 'balance': 5000}, {'applied': {'interest': 0, 'principal': 1700, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 3300}], ['control 3', {'due': {'interest': 0, 'principal': 800, 'late_fee': 0, 'fees': 0}, 'payment': 5800, 'suspense': 200, 'threshold': 1000, 'balance': 5000}, {'applied': {'interest': 0, 'principal': 800, 'late_fee': 0, 'fees': 0}, 'curtailment': 4200, 'refund': 1000, 'suspense': 0, 'new_balance': 0}], ['control 4', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 150, 'fees': 0}, 'payment': 1000, 'suspense': 0, 'threshold': 1000, 'balance': 2000}, {'applied': {'interest': 1000, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 2000}], ['control 5', {'due': {'interest': 1250, 'principal': 2000, 'late_fee': 0, 'fees': 0}, 'payment': 8250, 'suspense': 200, 'threshold': 3250, 'balance': 800}, {'applied': {'interest': 1250, 'principal': 2000, 'late_fee': 0, 'fees': 0}, 'curtailment': -1200, 'refund': 6400, 'suspense': 0, 'new_balance': 0}], ['control 6', {'due': {'interest': 500, 'principal': 2000, 'late_fee': 0, 'fees': 0}, 'payment': 1000, 'suspense': 200, 'threshold': 1000, 'balance': 800}, {'applied': {'interest': 500, 'principal': 700, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 100}]], [['regression: held funds amount', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': 0, 'suspense': 700, 'threshold': 1250, 'balance': 5000}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 700, 'new_balance': 5000}], ['regression: held funds amount, partial-repair probe', {'due': {'interest': 0, 'principal': 800, 'late_fee': 0, 'fees': 35}, 'payment': 834, 'suspense': 0, 'threshold': 835, 'balance': 100000}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 834, 'new_balance': 100000}], ['control 1', {'due': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': -1, 'suspense': 200, 'threshold': 0, 'balance': 2000}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 199, 'refund': 0, 'suspense': 0, 'new_balance': 1801}], ['control 2', {'due': {'interest': 500, 'principal': 800, 'late_fee': 0, 'fees': 0}, 'payment': 1300, 'suspense': 0, 'threshold': 1000, 'balance': 800}, {'applied': {'interest': 500, 'principal': 800, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 0}], ['control 3', {'due': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 35}, 'payment': 300, 'suspense': 700, 'threshold': 0, 'balance': 800}, {'applied': {'interest': 0, 'principal': 0, 'late_fee': 0, 'fees': 35}, 'curtailment': 800, 'refund': 165, 'suspense': 0, 'new_balance': 0}], ['control 4', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 150, 'fees': 0}, 'payment': 300, 'suspense': 0, 'threshold': 0, 'balance': 100000}, {'applied': {'interest': 300, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 100000}], ['control 5', {'due': {'interest': 1250, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'payment': 1000, 'suspense': 0, 'threshold': 1000, 'balance': 2000}, {'applied': {'interest': 1000, 'principal': 0, 'late_fee': 0, 'fees': 0}, 'curtailment': 0, 'refund': 0, 'suspense': 0, 'new_balance': 2000}]]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'raised ' + type(exc).__name__\n    check(label, actual, expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic bounded teaching model with stipulated toy lending rules stated in the contract; money is integer cents and rates are basis points; it makes no claim of conformance to any regulation, servicing standard or product. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-loan-amortization-schedules-payment-application-waterfall-held-funds-amount","generated_at":"2026-09-29T14:46:27.401087+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Amortization engines drive borrower statements, payoff quotes and investor remittances; a misplaced rounding step, boundary or ordering rule compounds across hundreds of periods.","root_cause":"Only the new payment is held; prior suspense is dropped.","sha256":"828552345c0ce67878e4c9859cf7c09490ddeacad097500bd7e1eb90edfa9c63","title":"Payment application waterfall: held funds amount · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":44.103,"exit_code":1,"observations":[{"actual":{"applied":{"fees":0,"interest":0,"late_fee":0,"principal":0},"curtailment":0,"new_balance":2000,"refund":0,"suspense":200},"check":"regression: held funds amount","expected":{"applied":{"fees":0,"interest":0,"late_fee":0,"principal":0},"curtailment":0,"new_balance":2000,"refund":0,"suspense":500},"passed":false},{"actual":{"applied":{"fees":0,"interest":0,"late_fee":0,"principal":0},"curtailment":0,"new_balance":800,"refund":0,"suspense":0},"check":"control 1","expected":{"applied":{"fees":0,"interest":0,"late_fee":0,"principal":0},"curtailment":0,"new_balance":800,"refund":0,"suspense":300},"passed":false},{"actual":{"applied":{"fees":0,"interest":1250,"late_fee":150,"principal":800},"curtailment":1200,"new_balance":0,"refund":4000,"suspense":0},"check":"control 2","expected":{"applied":{"fees":0,"interest":1250,"late_fee":150,"principal":800},"curtailment":1200,"new_balance":0,"refund":4000,"suspense":0},"passed":true},{"actual":{"applied":{"fees":0,"interest":0,"late_fee":0,"principal":0},"curtailment":0,"new_balance":800,"refund":0,"suspense":0},"check":"control 3","expected":{"applied":{"fees":0,"interest":0,"late_fee":0,"principal":0},"curtailment":0,"new_balance":800,"refund":0,"suspense":0},"passed":true},{"actual":{"applied":{"fees":0,"interest":1250,"late_fee":0,"principal":0},"curtailment":700,"new_balance":99300,"refund":0,"suspense":0},"check":"control 4","expected":{"applied":{"fees":0,"interest":1250,"late_fee":0,"principal":0},"curtailment":700,"new_balance":99300,"refund":0,"suspense":0},"passed":true},{"actual":{"applied":{"fees":0,"interest":0,"late_fee":0,"principal":0},"curtailment":0,"new_balance":800,"refund":0,"suspense":0},"check":"control 5","expected":{"applied":{"fees":0,"interest":0,"late_fee":0,"principal":0},"curtailment":0,"new_balance":800,"refund":0,"suspense":300},"passed":false},{"actual":{"applied":{"fees":0,"interest":500,"late_fee":0,"principal":500},"curtailment":0,"new_balance":4500,"refund":0,"suspense":0},"check":"control 6","expected":{"applied":{"fees":0,"interest":500,"late_fee":0,"principal":500},"curtailment":0,"new_balance":4500,"refund":0,"suspense":0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: held funds amount\", \"actual\": {\"applied\": {\"interest\": 0, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 200, \"new_balance\": 2000}, \"expected\": {\"applied\": {\"interest\": 0, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 500, \"new_balance\": 2000}, \"passed\": false}, {\"check\": \"control 1\", \"actual\": {\"applied\": {\"interest\": 0, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 0, \"new_balance\": 800}, \"expected\": {\"applied\": {\"interest\": 0, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 300, \"new_balance\": 800}, \"passed\": false}, {\"check\": \"control 2\", \"actual\": {\"applied\": {\"interest\": 1250, \"principal\": 800, \"late_fee\": 150, \"fees\": 0}, \"curtailment\": 1200, \"refund\": 4000, \"suspense\": 0, \"new_balance\": 0}, \"expected\": {\"applied\": {\"interest\": 1250, \"principal\": 800, \"late_fee\": 150, \"fees\": 0}, \"curtailment\": 1200, \"refund\": 4000, \"suspense\": 0, \"new_balance\": 0}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"applied\": {\"interest\": 0, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 0, \"new_balance\": 800}, \"expected\": {\"applied\": {\"interest\": 0, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 0, \"new_balance\": 800}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"applied\": {\"interest\": 1250, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 700, \"refund\": 0, \"suspense\": 0, \"new_balance\": 99300}, \"expected\": {\"applied\": {\"interest\": 1250, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 700, \"refund\": 0, \"suspense\": 0, \"new_balance\": 99300}, \"passed\": true}, {\"check\": \"control 5\", \"actual\": {\"applied\": {\"interest\": 0, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 0, \"new_balance\": 800}, \"expected\": {\"applied\": {\"interest\": 0, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 300, \"new_balance\": 800}, \"passed\": false}, {\"check\": \"control 6\", \"actual\": {\"applied\": {\"interest\": 500, \"principal\": 500, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 0, \"new_balance\": 4500}, \"expected\": {\"applied\": {\"interest\": 500, \"principal\": 500, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 0, \"new_balance\": 4500}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.81,"exit_code":1,"observations":[{"actual":{"applied":{"fees":0,"interest":0,"late_fee":0,"principal":0},"curtailment":0,"new_balance":2000,"refund":0,"suspense":300},"check":"regression: held funds amount","expected":{"applied":{"fees":0,"interest":0,"late_fee":0,"principal":0},"curtailment":0,"new_balance":2000,"refund":0,"suspense":500},"passed":false},{"actual":{"applied":{"fees":0,"interest":0,"late_fee":0,"principal":0},"curtailment":0,"new_balance":800,"refund":0,"suspense":300},"check":"control 1","expected":{"applied":{"fees":0,"interest":0,"late_fee":0,"principal":0},"curtailment":0,"new_balance":800,"refund":0,"suspense":300},"passed":true},{"actual":{"applied":{"fees":0,"interest":1250,"late_fee":150,"principal":800},"curtailment":1200,"new_balance":0,"refund":4000,"suspense":0},"check":"control 2","expected":{"applied":{"fees":0,"interest":1250,"late_fee":150,"principal":800},"curtailment":1200,"new_balance":0,"refund":4000,"suspense":0},"passed":true},{"actual":{"applied":{"fees":0,"interest":0,"late_fee":0,"principal":0},"curtailment":0,"new_balance":800,"refund":0,"suspense":0},"check":"control 3","expected":{"applied":{"fees":0,"interest":0,"late_fee":0,"principal":0},"curtailment":0,"new_balance":800,"refund":0,"suspense":0},"passed":true},{"actual":{"applied":{"fees":0,"interest":1250,"late_fee":0,"principal":0},"curtailment":700,"new_balance":99300,"refund":0,"suspense":0},"check":"control 4","expected":{"applied":{"fees":0,"interest":1250,"late_fee":0,"principal":0},"curtailment":700,"new_balance":99300,"refund":0,"suspense":0},"passed":true},{"actual":{"applied":{"fees":0,"interest":0,"late_fee":0,"principal":0},"curtailment":0,"new_balance":800,"refund":0,"suspense":300},"check":"control 5","expected":{"applied":{"fees":0,"interest":0,"late_fee":0,"principal":0},"curtailment":0,"new_balance":800,"refund":0,"suspense":300},"passed":true},{"actual":{"applied":{"fees":0,"interest":500,"late_fee":0,"principal":500},"curtailment":0,"new_balance":4500,"refund":0,"suspense":0},"check":"control 6","expected":{"applied":{"fees":0,"interest":500,"late_fee":0,"principal":500},"curtailment":0,"new_balance":4500,"refund":0,"suspense":0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: held funds amount\", \"actual\": {\"applied\": {\"interest\": 0, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 300, \"new_balance\": 2000}, \"expected\": {\"applied\": {\"interest\": 0, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 500, \"new_balance\": 2000}, \"passed\": false}, {\"check\": \"control 1\", \"actual\": {\"applied\": {\"interest\": 0, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 300, \"new_balance\": 800}, \"expected\": {\"applied\": {\"interest\": 0, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 300, \"new_balance\": 800}, \"passed\": true}, {\"check\": \"control 2\", \"actual\": {\"applied\": {\"interest\": 1250, \"principal\": 800, \"late_fee\": 150, \"fees\": 0}, \"curtailment\": 1200, \"refund\": 4000, \"suspense\": 0, \"new_balance\": 0}, \"expected\": {\"applied\": {\"interest\": 1250, \"principal\": 800, \"late_fee\": 150, \"fees\": 0}, \"curtailment\": 1200, \"refund\": 4000, \"suspense\": 0, \"new_balance\": 0}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"applied\": {\"interest\": 0, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 0, \"new_balance\": 800}, \"expected\": {\"applied\": {\"interest\": 0, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 0, \"new_balance\": 800}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"applied\": {\"interest\": 1250, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 700, \"refund\": 0, \"suspense\": 0, \"new_balance\": 99300}, \"expected\": {\"applied\": {\"interest\": 1250, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 700, \"refund\": 0, \"suspense\": 0, \"new_balance\": 99300}, \"passed\": true}, {\"check\": \"control 5\", \"actual\": {\"applied\": {\"interest\": 0, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 300, \"new_balance\": 800}, \"expected\": {\"applied\": {\"interest\": 0, \"principal\": 0, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 300, \"new_balance\": 800}, \"passed\": true}, {\"check\": \"control 6\", \"actual\": {\"applied\": {\"interest\": 500, \"principal\": 500, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 0, \"new_balance\": 4500}, \"expected\": {\"applied\": {\"interest\": 500, \"principal\": 500, \"late_fee\": 0, \"fees\": 0}, \"curtailment\": 0, \"refund\": 0, \"suspense\": 0, \"new_balance\": 4500}, \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}