FA-58946 / Payroll withholding rules / Open access
Wage garnishment limits with support priority: other-family support percentage · case 01
Obligors supporting a second family have more withheld for support than the lower limit allows.
ROOT CAUSE
The 50% and 60% support caps are assigned to the wrong household situations.
VERIFIED REPAIR
Restore the contract rule at the other-family support percentage step: use `pct = 50 if x['supports_other_family'] else 60`.
Unsuccessful approach: The attempt always uses 50%, under-collecting from obligors without a second family.
Case contract
Input weekly {gross, taxes, voluntary, support_ordered, supports_other_family, arrears_weeks, creditor_ordered, min_wage}. Disposable = max(0, gross - taxes); voluntary deductions are not subtracted. Support cap is 60% of disposable (50% if supporting another family), +5 points when arrears exceed 12 weeks, floored to cents. Creditor cap is min(25% of disposable, disposable - 30*min_wage floored at 0) less support already taken, floored at 0. Return [disposable, support, creditor].
Why this case matters
Garnishment limits hinge on the legal definition of disposable earnings and on ordering support before creditor orders.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
disposable = x['gross'] - x['taxes']
disposable = max(0, disposable)
pct = 60 if x['supports_other_family'] else 50
if x['arrears_weeks'] > 12:
pct += 5
support_cap = disposable * pct // 100
support = min(x['support_ordered'], support_cap)
general_cap = min(disposable * 25 // 100, max(0, disposable - 30 * x['min_wage']))
creditor_room = max(0, general_cap - support)
creditor = min(x['creditor_ordered'], creditor_room)
return [disposable, support, creditor]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'gross': 46826, 'taxes': 741, 'voluntary': 4492, 'support_ordered': 65174, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 1500}, [46085, 27651, 0]), ('regression', {'gross': 148773, 'taxes': 37141, 'voluntary': 0, 'support_ordered': 142131, 'supports_other_family': True, 'arrears_weeks': 0, 'creditor_ordered': 65400, 'min_wage': 1000}, [111632, 55816, 0]), ('partial-repair probe', {'gross': 33225, 'taxes': 530, 'voluntary': 0, 'support_ordered': 97991, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [32695, 19617, 0]), ('partial-repair probe', {'gross': 44831, 'taxes': 4578, 'voluntary': 17862, 'support_ordered': 124565, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 725}, [40253, 24151, 0]), ('normal control', {'gross': 44578, 'taxes': 13638, 'voluntary': 18352, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 0, 'creditor_ordered': 12101, 'min_wage': 1000}, [30940, 0, 940]), ('normal control', {'gross': 49885, 'taxes': 7577, 'voluntary': 0, 'support_ordered': 11010, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 76774, 'min_wage': 725}, [42308, 11010, 0]), ('normal control', {'gross': 57348, 'taxes': 14511, 'voluntary': 6333, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 37, 'creditor_ordered': 25506, 'min_wage': 1000}, [42837, 0, 10709]), ('normal control', {'gross': 60837, 'taxes': 6384, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 8, 'creditor_ordered': 99104, 'min_wage': 725}, [54453, 0, 13613])], [('regression', {'gross': 33225, 'taxes': 530, 'voluntary': 0, 'support_ordered': 97991, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [32695, 19617, 0]), ('regression', {'gross': 46826, 'taxes': 741, 'voluntary': 4492, 'support_ordered': 65174, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 1500}, [46085, 27651, 0]), ('partial-repair probe', {'gross': 44831, 'taxes': 4578, 'voluntary': 17862, 'support_ordered': 124565, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 725}, [40253, 24151, 0]), ('partial-repair probe', {'gross': 97698, 'taxes': 10309, 'voluntary': 18929, 'support_ordered': 119941, 'supports_other_family': False, 'arrears_weeks': 16, 'creditor_ordered': 20227, 'min_wage': 1500}, [87389, 56802, 0]), ('normal control', {'gross': 34053, 'taxes': 8230, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [25823, 0, 0]), ('normal control', {'gross': 49631, 'taxes': 10694, 'voluntary': 12100, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 29, 'creditor_ordered': 0, 'min_wage': 1500}, [38937, 0, 0]), ('normal control', {'gross': 152311, 'taxes': 3320, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 0, 'min_wage': 725}, [148991, 0, 0]), ('normal control', {'gross': 27004, 'taxes': 2084, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 8, 'creditor_ordered': 0, 'min_wage': 725}, [24920, 0, 0])], [('regression', {'gross': 44831, 'taxes': 4578, 'voluntary': 17862, 'support_ordered': 124565, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 725}, [40253, 24151, 0]), ('regression', {'gross': 17708, 'taxes': 3346, 'voluntary': 3682, 'support_ordered': 144082, 'supports_other_family': True, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [14362, 7181, 0]), ('partial-repair probe', {'gross': 36086, 'taxes': 5477, 'voluntary': 0, 'support_ordered': 110046, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 38371, 'min_wage': 725}, [30609, 18365, 0]), ('partial-repair probe', {'gross': 40096, 'taxes': 4629, 'voluntary': 0, 'support_ordered': 113660, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 0, 'min_wage': 1500}, [35467, 23053, 0]), ('normal control', {'gross': 101914, 'taxes': 33517, 'voluntary': 11339, 'support_ordered': 29483, 'supports_other_family': False, 'arrears_weeks': 8, 'creditor_ordered': 0, 'min_wage': 1000}, [68397, 29483, 0]), ('normal control', {'gross': 108575, 'taxes': 133, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 13, 'creditor_ordered': 98815, 'min_wage': 725}, [108442, 0, 27110]), ('normal control', {'gross': 36727, 'taxes': 8624, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 0, 'min_wage': 725}, [28103, 0, 0]), ('normal control', {'gross': 62104, 'taxes': 11775, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1000}, [50329, 0, 0])], [('regression', {'gross': 97698, 'taxes': 10309, 'voluntary': 18929, 'support_ordered': 119941, 'supports_other_family': False, 'arrears_weeks': 16, 'creditor_ordered': 20227, 'min_wage': 1500}, [87389, 56802, 0]), ('regression', {'gross': 92812, 'taxes': 14753, 'voluntary': 4255, 'support_ordered': 102328, 'supports_other_family': True, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1000}, [78059, 39029, 0]), ('partial-repair probe', {'gross': 184223, 'taxes': 58096, 'voluntary': 13702, 'support_ordered': 115259, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 38756, 'min_wage': 725}, [126127, 75676, 0]), ('partial-repair probe', {'gross': 28444, 'taxes': 5961, 'voluntary': 0, 'support_ordered': 34693, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 72600, 'min_wage': 1000}, [22483, 14613, 0]), ('normal control', {'gross': 190387, 'taxes': 5582, 'voluntary': 18751, 'support_ordered': 13845, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 1000}, [184805, 13845, 0]), ('normal control', {'gross': 47364, 'taxes': 15560, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 93206, 'min_wage': 725}, [31804, 0, 7951]), ('normal control', {'gross': 50694, 'taxes': 14190, 'voluntary': 8627, 'support_ordered': 11691, 'supports_other_family': True, 'arrears_weeks': 13, 'creditor_ordered': 0, 'min_wage': 725}, [36504, 11691, 0]), ('normal control', {'gross': 154270, 'taxes': 17528, 'voluntary': 0, 'support_ordered': 12515, 'supports_other_family': True, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 725}, [136742, 12515, 0])], [('regression', {'gross': 36086, 'taxes': 5477, 'voluntary': 0, 'support_ordered': 110046, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 38371, 'min_wage': 725}, [30609, 18365, 0]), ('regression', {'gross': 33225, 'taxes': 530, 'voluntary': 0, 'support_ordered': 97991, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [32695, 19617, 0]), ('partial-repair probe', {'gross': 34472, 'taxes': 898, 'voluntary': 2236, 'support_ordered': 26388, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 87958, 'min_wage': 725}, [33574, 21823, 0]), ('partial-repair probe', {'gross': 80106, 'taxes': 11143, 'voluntary': 2882, 'support_ordered': 50325, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 0, 'min_wage': 1000}, [68963, 44825, 0]), ('normal control', {'gross': 132732, 'taxes': 30387, 'voluntary': 14017, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [102345, 0, 0]), ('normal control', {'gross': 52318, 'taxes': 13495, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 725}, [38823, 0, 0]), ('normal control', {'gross': 41424, 'taxes': 1052, 'voluntary': 0, 'support_ordered': 3123, 'supports_other_family': True, 'arrears_weeks': 13, 'creditor_ordered': 47455, 'min_wage': 725}, [40372, 3123, 6970]), ('normal control', {'gross': 66488, 'taxes': 5345, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1000}, [61143, 0, 0])]]
for i, (label, args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (label, i), solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [46085, 23042, 0] | [46085, 27651, 0] | Failed |
| regression 1 | [111632, 66979, 0] | [111632, 55816, 0] | Failed |
| partial-repair probe 2 | [32695, 16347, 0] | [32695, 19617, 0] | Failed |
| partial-repair probe 3 | [40253, 20126, 0] | [40253, 24151, 0] | Failed |
| normal control 4 | [30940, 0, 940] | [30940, 0, 940] | Passed |
| normal control 5 | [42308, 11010, 0] | [42308, 11010, 0] | Passed |
| normal control 6 | [42837, 0, 10709] | [42837, 0, 10709] | Passed |
| normal control 7 | [54453, 0, 13613] | [54453, 0, 13613] | Passed |
SHA-256 / 085631d0a0630f183e8d382ffa14993278579ca0384f3bae7ad1a8ee70416597
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
disposable = x['gross'] - x['taxes']
disposable = max(0, disposable)
pct = 50
if x['arrears_weeks'] > 12:
pct += 5
support_cap = disposable * pct // 100
support = min(x['support_ordered'], support_cap)
general_cap = min(disposable * 25 // 100, max(0, disposable - 30 * x['min_wage']))
creditor_room = max(0, general_cap - support)
creditor = min(x['creditor_ordered'], creditor_room)
return [disposable, support, creditor]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'gross': 46826, 'taxes': 741, 'voluntary': 4492, 'support_ordered': 65174, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 1500}, [46085, 27651, 0]), ('regression', {'gross': 148773, 'taxes': 37141, 'voluntary': 0, 'support_ordered': 142131, 'supports_other_family': True, 'arrears_weeks': 0, 'creditor_ordered': 65400, 'min_wage': 1000}, [111632, 55816, 0]), ('partial-repair probe', {'gross': 33225, 'taxes': 530, 'voluntary': 0, 'support_ordered': 97991, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [32695, 19617, 0]), ('partial-repair probe', {'gross': 44831, 'taxes': 4578, 'voluntary': 17862, 'support_ordered': 124565, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 725}, [40253, 24151, 0]), ('normal control', {'gross': 44578, 'taxes': 13638, 'voluntary': 18352, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 0, 'creditor_ordered': 12101, 'min_wage': 1000}, [30940, 0, 940]), ('normal control', {'gross': 49885, 'taxes': 7577, 'voluntary': 0, 'support_ordered': 11010, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 76774, 'min_wage': 725}, [42308, 11010, 0]), ('normal control', {'gross': 57348, 'taxes': 14511, 'voluntary': 6333, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 37, 'creditor_ordered': 25506, 'min_wage': 1000}, [42837, 0, 10709]), ('normal control', {'gross': 60837, 'taxes': 6384, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 8, 'creditor_ordered': 99104, 'min_wage': 725}, [54453, 0, 13613])], [('regression', {'gross': 33225, 'taxes': 530, 'voluntary': 0, 'support_ordered': 97991, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [32695, 19617, 0]), ('regression', {'gross': 46826, 'taxes': 741, 'voluntary': 4492, 'support_ordered': 65174, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 1500}, [46085, 27651, 0]), ('partial-repair probe', {'gross': 44831, 'taxes': 4578, 'voluntary': 17862, 'support_ordered': 124565, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 725}, [40253, 24151, 0]), ('partial-repair probe', {'gross': 97698, 'taxes': 10309, 'voluntary': 18929, 'support_ordered': 119941, 'supports_other_family': False, 'arrears_weeks': 16, 'creditor_ordered': 20227, 'min_wage': 1500}, [87389, 56802, 0]), ('normal control', {'gross': 34053, 'taxes': 8230, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [25823, 0, 0]), ('normal control', {'gross': 49631, 'taxes': 10694, 'voluntary': 12100, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 29, 'creditor_ordered': 0, 'min_wage': 1500}, [38937, 0, 0]), ('normal control', {'gross': 152311, 'taxes': 3320, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 0, 'min_wage': 725}, [148991, 0, 0]), ('normal control', {'gross': 27004, 'taxes': 2084, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 8, 'creditor_ordered': 0, 'min_wage': 725}, [24920, 0, 0])], [('regression', {'gross': 44831, 'taxes': 4578, 'voluntary': 17862, 'support_ordered': 124565, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 725}, [40253, 24151, 0]), ('regression', {'gross': 17708, 'taxes': 3346, 'voluntary': 3682, 'support_ordered': 144082, 'supports_other_family': True, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [14362, 7181, 0]), ('partial-repair probe', {'gross': 36086, 'taxes': 5477, 'voluntary': 0, 'support_ordered': 110046, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 38371, 'min_wage': 725}, [30609, 18365, 0]), ('partial-repair probe', {'gross': 40096, 'taxes': 4629, 'voluntary': 0, 'support_ordered': 113660, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 0, 'min_wage': 1500}, [35467, 23053, 0]), ('normal control', {'gross': 101914, 'taxes': 33517, 'voluntary': 11339, 'support_ordered': 29483, 'supports_other_family': False, 'arrears_weeks': 8, 'creditor_ordered': 0, 'min_wage': 1000}, [68397, 29483, 0]), ('normal control', {'gross': 108575, 'taxes': 133, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 13, 'creditor_ordered': 98815, 'min_wage': 725}, [108442, 0, 27110]), ('normal control', {'gross': 36727, 'taxes': 8624, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 0, 'min_wage': 725}, [28103, 0, 0]), ('normal control', {'gross': 62104, 'taxes': 11775, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1000}, [50329, 0, 0])], [('regression', {'gross': 97698, 'taxes': 10309, 'voluntary': 18929, 'support_ordered': 119941, 'supports_other_family': False, 'arrears_weeks': 16, 'creditor_ordered': 20227, 'min_wage': 1500}, [87389, 56802, 0]), ('regression', {'gross': 92812, 'taxes': 14753, 'voluntary': 4255, 'support_ordered': 102328, 'supports_other_family': True, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1000}, [78059, 39029, 0]), ('partial-repair probe', {'gross': 184223, 'taxes': 58096, 'voluntary': 13702, 'support_ordered': 115259, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 38756, 'min_wage': 725}, [126127, 75676, 0]), ('partial-repair probe', {'gross': 28444, 'taxes': 5961, 'voluntary': 0, 'support_ordered': 34693, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 72600, 'min_wage': 1000}, [22483, 14613, 0]), ('normal control', {'gross': 190387, 'taxes': 5582, 'voluntary': 18751, 'support_ordered': 13845, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 1000}, [184805, 13845, 0]), ('normal control', {'gross': 47364, 'taxes': 15560, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 93206, 'min_wage': 725}, [31804, 0, 7951]), ('normal control', {'gross': 50694, 'taxes': 14190, 'voluntary': 8627, 'support_ordered': 11691, 'supports_other_family': True, 'arrears_weeks': 13, 'creditor_ordered': 0, 'min_wage': 725}, [36504, 11691, 0]), ('normal control', {'gross': 154270, 'taxes': 17528, 'voluntary': 0, 'support_ordered': 12515, 'supports_other_family': True, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 725}, [136742, 12515, 0])], [('regression', {'gross': 36086, 'taxes': 5477, 'voluntary': 0, 'support_ordered': 110046, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 38371, 'min_wage': 725}, [30609, 18365, 0]), ('regression', {'gross': 33225, 'taxes': 530, 'voluntary': 0, 'support_ordered': 97991, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [32695, 19617, 0]), ('partial-repair probe', {'gross': 34472, 'taxes': 898, 'voluntary': 2236, 'support_ordered': 26388, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 87958, 'min_wage': 725}, [33574, 21823, 0]), ('partial-repair probe', {'gross': 80106, 'taxes': 11143, 'voluntary': 2882, 'support_ordered': 50325, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 0, 'min_wage': 1000}, [68963, 44825, 0]), ('normal control', {'gross': 132732, 'taxes': 30387, 'voluntary': 14017, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [102345, 0, 0]), ('normal control', {'gross': 52318, 'taxes': 13495, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 725}, [38823, 0, 0]), ('normal control', {'gross': 41424, 'taxes': 1052, 'voluntary': 0, 'support_ordered': 3123, 'supports_other_family': True, 'arrears_weeks': 13, 'creditor_ordered': 47455, 'min_wage': 725}, [40372, 3123, 6970]), ('normal control', {'gross': 66488, 'taxes': 5345, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1000}, [61143, 0, 0])]]
for i, (label, args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (label, i), solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [46085, 23042, 0] | [46085, 27651, 0] | Failed |
| regression 1 | [111632, 55816, 0] | [111632, 55816, 0] | Passed |
| partial-repair probe 2 | [32695, 16347, 0] | [32695, 19617, 0] | Failed |
| partial-repair probe 3 | [40253, 20126, 0] | [40253, 24151, 0] | Failed |
| normal control 4 | [30940, 0, 940] | [30940, 0, 940] | Passed |
| normal control 5 | [42308, 11010, 0] | [42308, 11010, 0] | Passed |
| normal control 6 | [42837, 0, 10709] | [42837, 0, 10709] | Passed |
| normal control 7 | [54453, 0, 13613] | [54453, 0, 13613] | Passed |
SHA-256 / b084acb512bfc840f0cad8e65fdc610d4f233aa60b781e6122c8a17acf4ad531
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
disposable = x['gross'] - x['taxes']
disposable = max(0, disposable)
pct = 50 if x['supports_other_family'] else 60
if x['arrears_weeks'] > 12:
pct += 5
support_cap = disposable * pct // 100
support = min(x['support_ordered'], support_cap)
general_cap = min(disposable * 25 // 100, max(0, disposable - 30 * x['min_wage']))
creditor_room = max(0, general_cap - support)
creditor = min(x['creditor_ordered'], creditor_room)
return [disposable, support, creditor]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'gross': 46826, 'taxes': 741, 'voluntary': 4492, 'support_ordered': 65174, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 1500}, [46085, 27651, 0]), ('regression', {'gross': 148773, 'taxes': 37141, 'voluntary': 0, 'support_ordered': 142131, 'supports_other_family': True, 'arrears_weeks': 0, 'creditor_ordered': 65400, 'min_wage': 1000}, [111632, 55816, 0]), ('partial-repair probe', {'gross': 33225, 'taxes': 530, 'voluntary': 0, 'support_ordered': 97991, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [32695, 19617, 0]), ('partial-repair probe', {'gross': 44831, 'taxes': 4578, 'voluntary': 17862, 'support_ordered': 124565, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 725}, [40253, 24151, 0]), ('normal control', {'gross': 44578, 'taxes': 13638, 'voluntary': 18352, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 0, 'creditor_ordered': 12101, 'min_wage': 1000}, [30940, 0, 940]), ('normal control', {'gross': 49885, 'taxes': 7577, 'voluntary': 0, 'support_ordered': 11010, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 76774, 'min_wage': 725}, [42308, 11010, 0]), ('normal control', {'gross': 57348, 'taxes': 14511, 'voluntary': 6333, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 37, 'creditor_ordered': 25506, 'min_wage': 1000}, [42837, 0, 10709]), ('normal control', {'gross': 60837, 'taxes': 6384, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 8, 'creditor_ordered': 99104, 'min_wage': 725}, [54453, 0, 13613])], [('regression', {'gross': 33225, 'taxes': 530, 'voluntary': 0, 'support_ordered': 97991, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [32695, 19617, 0]), ('regression', {'gross': 46826, 'taxes': 741, 'voluntary': 4492, 'support_ordered': 65174, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 1500}, [46085, 27651, 0]), ('partial-repair probe', {'gross': 44831, 'taxes': 4578, 'voluntary': 17862, 'support_ordered': 124565, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 725}, [40253, 24151, 0]), ('partial-repair probe', {'gross': 97698, 'taxes': 10309, 'voluntary': 18929, 'support_ordered': 119941, 'supports_other_family': False, 'arrears_weeks': 16, 'creditor_ordered': 20227, 'min_wage': 1500}, [87389, 56802, 0]), ('normal control', {'gross': 34053, 'taxes': 8230, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [25823, 0, 0]), ('normal control', {'gross': 49631, 'taxes': 10694, 'voluntary': 12100, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 29, 'creditor_ordered': 0, 'min_wage': 1500}, [38937, 0, 0]), ('normal control', {'gross': 152311, 'taxes': 3320, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 0, 'min_wage': 725}, [148991, 0, 0]), ('normal control', {'gross': 27004, 'taxes': 2084, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 8, 'creditor_ordered': 0, 'min_wage': 725}, [24920, 0, 0])], [('regression', {'gross': 44831, 'taxes': 4578, 'voluntary': 17862, 'support_ordered': 124565, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 725}, [40253, 24151, 0]), ('regression', {'gross': 17708, 'taxes': 3346, 'voluntary': 3682, 'support_ordered': 144082, 'supports_other_family': True, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [14362, 7181, 0]), ('partial-repair probe', {'gross': 36086, 'taxes': 5477, 'voluntary': 0, 'support_ordered': 110046, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 38371, 'min_wage': 725}, [30609, 18365, 0]), ('partial-repair probe', {'gross': 40096, 'taxes': 4629, 'voluntary': 0, 'support_ordered': 113660, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 0, 'min_wage': 1500}, [35467, 23053, 0]), ('normal control', {'gross': 101914, 'taxes': 33517, 'voluntary': 11339, 'support_ordered': 29483, 'supports_other_family': False, 'arrears_weeks': 8, 'creditor_ordered': 0, 'min_wage': 1000}, [68397, 29483, 0]), ('normal control', {'gross': 108575, 'taxes': 133, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 13, 'creditor_ordered': 98815, 'min_wage': 725}, [108442, 0, 27110]), ('normal control', {'gross': 36727, 'taxes': 8624, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 0, 'min_wage': 725}, [28103, 0, 0]), ('normal control', {'gross': 62104, 'taxes': 11775, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1000}, [50329, 0, 0])], [('regression', {'gross': 97698, 'taxes': 10309, 'voluntary': 18929, 'support_ordered': 119941, 'supports_other_family': False, 'arrears_weeks': 16, 'creditor_ordered': 20227, 'min_wage': 1500}, [87389, 56802, 0]), ('regression', {'gross': 92812, 'taxes': 14753, 'voluntary': 4255, 'support_ordered': 102328, 'supports_other_family': True, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1000}, [78059, 39029, 0]), ('partial-repair probe', {'gross': 184223, 'taxes': 58096, 'voluntary': 13702, 'support_ordered': 115259, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 38756, 'min_wage': 725}, [126127, 75676, 0]), ('partial-repair probe', {'gross': 28444, 'taxes': 5961, 'voluntary': 0, 'support_ordered': 34693, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 72600, 'min_wage': 1000}, [22483, 14613, 0]), ('normal control', {'gross': 190387, 'taxes': 5582, 'voluntary': 18751, 'support_ordered': 13845, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 1000}, [184805, 13845, 0]), ('normal control', {'gross': 47364, 'taxes': 15560, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 93206, 'min_wage': 725}, [31804, 0, 7951]), ('normal control', {'gross': 50694, 'taxes': 14190, 'voluntary': 8627, 'support_ordered': 11691, 'supports_other_family': True, 'arrears_weeks': 13, 'creditor_ordered': 0, 'min_wage': 725}, [36504, 11691, 0]), ('normal control', {'gross': 154270, 'taxes': 17528, 'voluntary': 0, 'support_ordered': 12515, 'supports_other_family': True, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 725}, [136742, 12515, 0])], [('regression', {'gross': 36086, 'taxes': 5477, 'voluntary': 0, 'support_ordered': 110046, 'supports_other_family': False, 'arrears_weeks': 12, 'creditor_ordered': 38371, 'min_wage': 725}, [30609, 18365, 0]), ('regression', {'gross': 33225, 'taxes': 530, 'voluntary': 0, 'support_ordered': 97991, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [32695, 19617, 0]), ('partial-repair probe', {'gross': 34472, 'taxes': 898, 'voluntary': 2236, 'support_ordered': 26388, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 87958, 'min_wage': 725}, [33574, 21823, 0]), ('partial-repair probe', {'gross': 80106, 'taxes': 11143, 'voluntary': 2882, 'support_ordered': 50325, 'supports_other_family': False, 'arrears_weeks': 13, 'creditor_ordered': 0, 'min_wage': 1000}, [68963, 44825, 0]), ('normal control', {'gross': 132732, 'taxes': 30387, 'voluntary': 14017, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1500}, [102345, 0, 0]), ('normal control', {'gross': 52318, 'taxes': 13495, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': True, 'arrears_weeks': 12, 'creditor_ordered': 0, 'min_wage': 725}, [38823, 0, 0]), ('normal control', {'gross': 41424, 'taxes': 1052, 'voluntary': 0, 'support_ordered': 3123, 'supports_other_family': True, 'arrears_weeks': 13, 'creditor_ordered': 47455, 'min_wage': 725}, [40372, 3123, 6970]), ('normal control', {'gross': 66488, 'taxes': 5345, 'voluntary': 0, 'support_ordered': 0, 'supports_other_family': False, 'arrears_weeks': 0, 'creditor_ordered': 0, 'min_wage': 1000}, [61143, 0, 0])]]
for i, (label, args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (label, i), solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [46085, 27651, 0] | [46085, 27651, 0] | Passed |
| regression 1 | [111632, 55816, 0] | [111632, 55816, 0] | Passed |
| partial-repair probe 2 | [32695, 19617, 0] | [32695, 19617, 0] | Passed |
| partial-repair probe 3 | [40253, 24151, 0] | [40253, 24151, 0] | Passed |
| normal control 4 | [30940, 0, 940] | [30940, 0, 940] | Passed |
| normal control 5 | [42308, 11010, 0] | [42308, 11010, 0] | Passed |
| normal control 6 | [42837, 0, 10709] | [42837, 0, 10709] | Passed |
| normal control 7 | [54453, 0, 13613] | [54453, 0, 13613] | Passed |
SHA-256 / b1fd9fb8ac7a5d51f7ab8ac367b3af6ee92cbe2f3f7821d66f4b9c5daf36508e
Verification & scope
A deterministic teaching model of a stipulated payroll rule with toy thresholds and rates. It makes no claim of conformance to any tax authority, statute or jurisdiction and is not payroll software. 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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:46:31.509439+00:00.
Case digest / 95e67f424d0904e02fc5d4b438816f2c583f4e59bf3beefd669f27b8fef985a2