{"abstract":"Exempt promotional bonus uses up the monthly cap.","category":"Loyalty points ledgers","checks":7,"contract":"Input {cap, txns:[[yyyy-mm, base, bonus, exempt_bonus]]}. Base points are never capped. Regular bonus points are capped per calendar month: each transaction receives min(bonus, cap - bonus already awarded that month). Exempt bonus is always awarded and never uses the cap. Return {awards (base + awarded bonus + exempt per txn), total}.","evaluation_group":"w2-loyalty-points-ledgers-monthly-bonus-cap","failed_approach":"Capping exempt and regular bonus together still limits exempt bonus.","family":"w2-loyalty-points-ledgers-monthly-bonus-cap-exempt-bonus-and-cap","id":"FA-60731","implementations":{"attempt":{"sha256":"ac7e974bca69034cb889f7197b1d3dd2a765e650be262011f8bfadc32347ab41","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    used = {}\n    out = []\n    for m, base, bonus, exempt in x['txns']:\n        k = m\n        rem = x['cap'] - used.get(k, 0)\n        b = min(bonus + exempt, rem)\n        used[k] = used.get(k, 0) + b\n        out.append(base + b)\n    return {'awards': out, 'total': sum(out)}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['cap within month', {'cap': 5000, 'txns': [['2024-03', 100, 3000, 0], ['2024-03', 50, 2501, 0], ['2024-03', 10, 400, 0]]}, {'awards': [3100, 2050, 10], 'total': 5160}], ['new month resets', {'cap': 5000, 'txns': [['2024-03', 0, 5000, 0], ['2024-04', 0, 1001, 0]]}, {'awards': [5000, 1001], 'total': 6001}], ['same month next year', {'cap': 1000, 'txns': [['2023-07', 5, 900, 0], ['2024-07', 5, 901, 0]]}, {'awards': [905, 906], 'total': 1811}], ['exempt promo', {'cap': 2000, 'txns': [['2024-01', 200, 1500, 700], ['2024-01', 200, 401, 0]]}, {'awards': [2400, 601], 'total': 3001}], ['base never capped', {'cap': 1000, 'txns': [['2024-02', 5000, 600, 0], ['2024-02', 3000, 301, 0]]}, {'awards': [5600, 3301], 'total': 8901}], ['exempt only', {'cap': 100, 'txns': [['2024-05', 1, 0, 251], ['2024-05', 1, 90, 0]]}, {'awards': [252, 91], 'total': 343}], ['many small', {'cap': 300, 'txns': [['2024-06', 1, 100, 0], ['2024-06', 1, 100, 1], ['2024-06', 1, 101, 0], ['2024-06', 1, 100, 0]]}, {'awards': [101, 102, 101, 1], 'total': 305}]], [['cap within month', {'cap': 5000, 'txns': [['2024-03', 100, 3000, 0], ['2024-03', 50, 2502, 0], ['2024-03', 10, 400, 0]]}, {'awards': [3100, 2050, 10], 'total': 5160}], ['new month resets', {'cap': 5000, 'txns': [['2024-03', 0, 5000, 0], ['2024-04', 0, 1002, 0]]}, {'awards': [5000, 1002], 'total': 6002}], ['same month next year', {'cap': 1000, 'txns': [['2023-07', 5, 900, 0], ['2024-07', 5, 902, 0]]}, {'awards': [905, 907], 'total': 1812}], ['exempt promo', {'cap': 2000, 'txns': [['2024-01', 200, 1500, 700], ['2024-01', 200, 402, 0]]}, {'awards': [2400, 602], 'total': 3002}], ['base never capped', {'cap': 1000, 'txns': [['2024-02', 5000, 600, 0], ['2024-02', 3000, 302, 0]]}, {'awards': [5600, 3302], 'total': 8902}], ['exempt only', {'cap': 100, 'txns': [['2024-05', 1, 0, 252], ['2024-05', 1, 90, 0]]}, {'awards': [253, 91], 'total': 344}], ['many small', {'cap': 300, 'txns': [['2024-06', 1, 100, 0], ['2024-06', 1, 100, 1], ['2024-06', 1, 102, 0], ['2024-06', 1, 100, 0]]}, {'awards': [101, 102, 101, 1], 'total': 305}]], [['cap within month', {'cap': 5000, 'txns': [['2024-03', 100, 3000, 0], ['2024-03', 50, 2503, 0], ['2024-03', 10, 400, 0]]}, {'awards': [3100, 2050, 10], 'total': 5160}], ['new month resets', {'cap': 5000, 'txns': [['2024-03', 0, 5000, 0], ['2024-04', 0, 1003, 0]]}, {'awards': [5000, 1003], 'total': 6003}], ['same month next year', {'cap': 1000, 'txns': [['2023-07', 5, 900, 0], ['2024-07', 5, 903, 0]]}, {'awards': [905, 908], 'total': 1813}], ['exempt promo', {'cap': 2000, 'txns': [['2024-01', 200, 1500, 700], ['2024-01', 200, 403, 0]]}, {'awards': [2400, 603], 'total': 3003}], ['base never capped', {'cap': 1000, 'txns': [['2024-02', 5000, 600, 0], ['2024-02', 3000, 303, 0]]}, {'awards': [5600, 3303], 'total': 8903}], ['exempt only', {'cap': 100, 'txns': [['2024-05', 1, 0, 253], ['2024-05', 1, 90, 0]]}, {'awards': [254, 91], 'total': 345}], ['many small', {'cap': 300, 'txns': [['2024-06', 1, 100, 0], ['2024-06', 1, 100, 1], ['2024-06', 1, 103, 0], ['2024-06', 1, 100, 0]]}, {'awards': [101, 102, 101, 1], 'total': 305}]], [['cap within month', {'cap': 5000, 'txns': [['2024-03', 100, 3000, 0], ['2024-03', 50, 2504, 0], ['2024-03', 10, 400, 0]]}, {'awards': [3100, 2050, 10], 'total': 5160}], ['new month resets', {'cap': 5000, 'txns': [['2024-03', 0, 5000, 0], ['2024-04', 0, 1004, 0]]}, {'awards': [5000, 1004], 'total': 6004}], ['same month next year', {'cap': 1000, 'txns': [['2023-07', 5, 900, 0], ['2024-07', 5, 904, 0]]}, {'awards': [905, 909], 'total': 1814}], ['exempt promo', {'cap': 2000, 'txns': [['2024-01', 200, 1500, 700], ['2024-01', 200, 404, 0]]}, {'awards': [2400, 604], 'total': 3004}], ['base never capped', {'cap': 1000, 'txns': [['2024-02', 5000, 600, 0], ['2024-02', 3000, 304, 0]]}, {'awards': [5600, 3304], 'total': 8904}], ['exempt only', {'cap': 100, 'txns': [['2024-05', 1, 0, 254], ['2024-05', 1, 90, 0]]}, {'awards': [255, 91], 'total': 346}], ['many small', {'cap': 300, 'txns': [['2024-06', 1, 100, 0], ['2024-06', 1, 100, 1], ['2024-06', 1, 104, 0], ['2024-06', 1, 100, 0]]}, {'awards': [101, 102, 101, 1], 'total': 305}]], [['cap within month', {'cap': 5000, 'txns': [['2024-03', 100, 3000, 0], ['2024-03', 50, 2505, 0], ['2024-03', 10, 400, 0]]}, {'awards': [3100, 2050, 10], 'total': 5160}], ['new month resets', {'cap': 5000, 'txns': [['2024-03', 0, 5000, 0], ['2024-04', 0, 1005, 0]]}, {'awards': [5000, 1005], 'total': 6005}], ['same month next year', {'cap': 1000, 'txns': [['2023-07', 5, 900, 0], ['2024-07', 5, 905, 0]]}, {'awards': [905, 910], 'total': 1815}], ['exempt promo', {'cap': 2000, 'txns': [['2024-01', 200, 1500, 700], ['2024-01', 200, 405, 0]]}, {'awards': [2400, 605], 'total': 3005}], ['base never capped', {'cap': 1000, 'txns': [['2024-02', 5000, 600, 0], ['2024-02', 3000, 305, 0]]}, {'awards': [5600, 3305], 'total': 8905}], ['exempt only', {'cap': 100, 'txns': [['2024-05', 1, 0, 255], ['2024-05', 1, 90, 0]]}, {'awards': [256, 91], 'total': 347}], ['many small', {'cap': 300, 'txns': [['2024-06', 1, 100, 0], ['2024-06', 1, 100, 1], ['2024-06', 1, 105, 0], ['2024-06', 1, 100, 0]]}, {'awards': [101, 102, 101, 1], 'total': 305}]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), 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":"5855b4a92a8decda20deac61bc3cbd03ae621caeb96e45706a1e9b84a2991446","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    used = {}\n    out = []\n    for m, base, bonus, exempt in x['txns']:\n        k = m\n        rem = x['cap'] - used.get(k, 0)\n        b = min(bonus, rem)\n        used[k] = used.get(k, 0) + b + exempt\n        out.append(base + b + exempt)\n    return {'awards': out, 'total': sum(out)}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['cap within month', {'cap': 5000, 'txns': [['2024-03', 100, 3000, 0], ['2024-03', 50, 2501, 0], ['2024-03', 10, 400, 0]]}, {'awards': [3100, 2050, 10], 'total': 5160}], ['new month resets', {'cap': 5000, 'txns': [['2024-03', 0, 5000, 0], ['2024-04', 0, 1001, 0]]}, {'awards': [5000, 1001], 'total': 6001}], ['same month next year', {'cap': 1000, 'txns': [['2023-07', 5, 900, 0], ['2024-07', 5, 901, 0]]}, {'awards': [905, 906], 'total': 1811}], ['exempt promo', {'cap': 2000, 'txns': [['2024-01', 200, 1500, 700], ['2024-01', 200, 401, 0]]}, {'awards': [2400, 601], 'total': 3001}], ['base never capped', {'cap': 1000, 'txns': [['2024-02', 5000, 600, 0], ['2024-02', 3000, 301, 0]]}, {'awards': [5600, 3301], 'total': 8901}], ['exempt only', {'cap': 100, 'txns': [['2024-05', 1, 0, 251], ['2024-05', 1, 90, 0]]}, {'awards': [252, 91], 'total': 343}], ['many small', {'cap': 300, 'txns': [['2024-06', 1, 100, 0], ['2024-06', 1, 100, 1], ['2024-06', 1, 101, 0], ['2024-06', 1, 100, 0]]}, {'awards': [101, 102, 101, 1], 'total': 305}]], [['cap within month', {'cap': 5000, 'txns': [['2024-03', 100, 3000, 0], ['2024-03', 50, 2502, 0], ['2024-03', 10, 400, 0]]}, {'awards': [3100, 2050, 10], 'total': 5160}], ['new month resets', {'cap': 5000, 'txns': [['2024-03', 0, 5000, 0], ['2024-04', 0, 1002, 0]]}, {'awards': [5000, 1002], 'total': 6002}], ['same month next year', {'cap': 1000, 'txns': [['2023-07', 5, 900, 0], ['2024-07', 5, 902, 0]]}, {'awards': [905, 907], 'total': 1812}], ['exempt promo', {'cap': 2000, 'txns': [['2024-01', 200, 1500, 700], ['2024-01', 200, 402, 0]]}, {'awards': [2400, 602], 'total': 3002}], ['base never capped', {'cap': 1000, 'txns': [['2024-02', 5000, 600, 0], ['2024-02', 3000, 302, 0]]}, {'awards': [5600, 3302], 'total': 8902}], ['exempt only', {'cap': 100, 'txns': [['2024-05', 1, 0, 252], ['2024-05', 1, 90, 0]]}, {'awards': [253, 91], 'total': 344}], ['many small', {'cap': 300, 'txns': [['2024-06', 1, 100, 0], ['2024-06', 1, 100, 1], ['2024-06', 1, 102, 0], ['2024-06', 1, 100, 0]]}, {'awards': [101, 102, 101, 1], 'total': 305}]], [['cap within month', {'cap': 5000, 'txns': [['2024-03', 100, 3000, 0], ['2024-03', 50, 2503, 0], ['2024-03', 10, 400, 0]]}, {'awards': [3100, 2050, 10], 'total': 5160}], ['new month resets', {'cap': 5000, 'txns': [['2024-03', 0, 5000, 0], ['2024-04', 0, 1003, 0]]}, {'awards': [5000, 1003], 'total': 6003}], ['same month next year', {'cap': 1000, 'txns': [['2023-07', 5, 900, 0], ['2024-07', 5, 903, 0]]}, {'awards': [905, 908], 'total': 1813}], ['exempt promo', {'cap': 2000, 'txns': [['2024-01', 200, 1500, 700], ['2024-01', 200, 403, 0]]}, {'awards': [2400, 603], 'total': 3003}], ['base never capped', {'cap': 1000, 'txns': [['2024-02', 5000, 600, 0], ['2024-02', 3000, 303, 0]]}, {'awards': [5600, 3303], 'total': 8903}], ['exempt only', {'cap': 100, 'txns': [['2024-05', 1, 0, 253], ['2024-05', 1, 90, 0]]}, {'awards': [254, 91], 'total': 345}], ['many small', {'cap': 300, 'txns': [['2024-06', 1, 100, 0], ['2024-06', 1, 100, 1], ['2024-06', 1, 103, 0], ['2024-06', 1, 100, 0]]}, {'awards': [101, 102, 101, 1], 'total': 305}]], [['cap within month', {'cap': 5000, 'txns': [['2024-03', 100, 3000, 0], ['2024-03', 50, 2504, 0], ['2024-03', 10, 400, 0]]}, {'awards': [3100, 2050, 10], 'total': 5160}], ['new month resets', {'cap': 5000, 'txns': [['2024-03', 0, 5000, 0], ['2024-04', 0, 1004, 0]]}, {'awards': [5000, 1004], 'total': 6004}], ['same month next year', {'cap': 1000, 'txns': [['2023-07', 5, 900, 0], ['2024-07', 5, 904, 0]]}, {'awards': [905, 909], 'total': 1814}], ['exempt promo', {'cap': 2000, 'txns': [['2024-01', 200, 1500, 700], ['2024-01', 200, 404, 0]]}, {'awards': [2400, 604], 'total': 3004}], ['base never capped', {'cap': 1000, 'txns': [['2024-02', 5000, 600, 0], ['2024-02', 3000, 304, 0]]}, {'awards': [5600, 3304], 'total': 8904}], ['exempt only', {'cap': 100, 'txns': [['2024-05', 1, 0, 254], ['2024-05', 1, 90, 0]]}, {'awards': [255, 91], 'total': 346}], ['many small', {'cap': 300, 'txns': [['2024-06', 1, 100, 0], ['2024-06', 1, 100, 1], ['2024-06', 1, 104, 0], ['2024-06', 1, 100, 0]]}, {'awards': [101, 102, 101, 1], 'total': 305}]], [['cap within month', {'cap': 5000, 'txns': [['2024-03', 100, 3000, 0], ['2024-03', 50, 2505, 0], ['2024-03', 10, 400, 0]]}, {'awards': [3100, 2050, 10], 'total': 5160}], ['new month resets', {'cap': 5000, 'txns': [['2024-03', 0, 5000, 0], ['2024-04', 0, 1005, 0]]}, {'awards': [5000, 1005], 'total': 6005}], ['same month next year', {'cap': 1000, 'txns': [['2023-07', 5, 900, 0], ['2024-07', 5, 905, 0]]}, {'awards': [905, 910], 'total': 1815}], ['exempt promo', {'cap': 2000, 'txns': [['2024-01', 200, 1500, 700], ['2024-01', 200, 405, 0]]}, {'awards': [2400, 605], 'total': 3005}], ['base never capped', {'cap': 1000, 'txns': [['2024-02', 5000, 600, 0], ['2024-02', 3000, 305, 0]]}, {'awards': [5600, 3305], 'total': 8905}], ['exempt only', {'cap': 100, 'txns': [['2024-05', 1, 0, 255], ['2024-05', 1, 90, 0]]}, {'awards': [256, 91], 'total': 347}], ['many small', {'cap': 300, 'txns': [['2024-06', 1, 100, 0], ['2024-06', 1, 100, 1], ['2024-06', 1, 105, 0], ['2024-06', 1, 100, 0]]}, {'awards': [101, 102, 101, 1], 'total': 305}]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), 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"},"fixed":{"sha256":"04b65353a5c3f310ece00e881a23156cdde5dac6c46795cc80a2a196dcd61f7e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    used = {}\n    out = []\n    for m, base, bonus, exempt in x['txns']:\n        k = m\n        rem = x['cap'] - used.get(k, 0)\n        b = min(bonus, rem)\n        used[k] = used.get(k, 0) + b\n        out.append(base + b + exempt)\n    return {'awards': out, 'total': sum(out)}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['cap within month', {'cap': 5000, 'txns': [['2024-03', 100, 3000, 0], ['2024-03', 50, 2501, 0], ['2024-03', 10, 400, 0]]}, {'awards': [3100, 2050, 10], 'total': 5160}], ['new month resets', {'cap': 5000, 'txns': [['2024-03', 0, 5000, 0], ['2024-04', 0, 1001, 0]]}, {'awards': [5000, 1001], 'total': 6001}], ['same month next year', {'cap': 1000, 'txns': [['2023-07', 5, 900, 0], ['2024-07', 5, 901, 0]]}, {'awards': [905, 906], 'total': 1811}], ['exempt promo', {'cap': 2000, 'txns': [['2024-01', 200, 1500, 700], ['2024-01', 200, 401, 0]]}, {'awards': [2400, 601], 'total': 3001}], ['base never capped', {'cap': 1000, 'txns': [['2024-02', 5000, 600, 0], ['2024-02', 3000, 301, 0]]}, {'awards': [5600, 3301], 'total': 8901}], ['exempt only', {'cap': 100, 'txns': [['2024-05', 1, 0, 251], ['2024-05', 1, 90, 0]]}, {'awards': [252, 91], 'total': 343}], ['many small', {'cap': 300, 'txns': [['2024-06', 1, 100, 0], ['2024-06', 1, 100, 1], ['2024-06', 1, 101, 0], ['2024-06', 1, 100, 0]]}, {'awards': [101, 102, 101, 1], 'total': 305}]], [['cap within month', {'cap': 5000, 'txns': [['2024-03', 100, 3000, 0], ['2024-03', 50, 2502, 0], ['2024-03', 10, 400, 0]]}, {'awards': [3100, 2050, 10], 'total': 5160}], ['new month resets', {'cap': 5000, 'txns': [['2024-03', 0, 5000, 0], ['2024-04', 0, 1002, 0]]}, {'awards': [5000, 1002], 'total': 6002}], ['same month next year', {'cap': 1000, 'txns': [['2023-07', 5, 900, 0], ['2024-07', 5, 902, 0]]}, {'awards': [905, 907], 'total': 1812}], ['exempt promo', {'cap': 2000, 'txns': [['2024-01', 200, 1500, 700], ['2024-01', 200, 402, 0]]}, {'awards': [2400, 602], 'total': 3002}], ['base never capped', {'cap': 1000, 'txns': [['2024-02', 5000, 600, 0], ['2024-02', 3000, 302, 0]]}, {'awards': [5600, 3302], 'total': 8902}], ['exempt only', {'cap': 100, 'txns': [['2024-05', 1, 0, 252], ['2024-05', 1, 90, 0]]}, {'awards': [253, 91], 'total': 344}], ['many small', {'cap': 300, 'txns': [['2024-06', 1, 100, 0], ['2024-06', 1, 100, 1], ['2024-06', 1, 102, 0], ['2024-06', 1, 100, 0]]}, {'awards': [101, 102, 101, 1], 'total': 305}]], [['cap within month', {'cap': 5000, 'txns': [['2024-03', 100, 3000, 0], ['2024-03', 50, 2503, 0], ['2024-03', 10, 400, 0]]}, {'awards': [3100, 2050, 10], 'total': 5160}], ['new month resets', {'cap': 5000, 'txns': [['2024-03', 0, 5000, 0], ['2024-04', 0, 1003, 0]]}, {'awards': [5000, 1003], 'total': 6003}], ['same month next year', {'cap': 1000, 'txns': [['2023-07', 5, 900, 0], ['2024-07', 5, 903, 0]]}, {'awards': [905, 908], 'total': 1813}], ['exempt promo', {'cap': 2000, 'txns': [['2024-01', 200, 1500, 700], ['2024-01', 200, 403, 0]]}, {'awards': [2400, 603], 'total': 3003}], ['base never capped', {'cap': 1000, 'txns': [['2024-02', 5000, 600, 0], ['2024-02', 3000, 303, 0]]}, {'awards': [5600, 3303], 'total': 8903}], ['exempt only', {'cap': 100, 'txns': [['2024-05', 1, 0, 253], ['2024-05', 1, 90, 0]]}, {'awards': [254, 91], 'total': 345}], ['many small', {'cap': 300, 'txns': [['2024-06', 1, 100, 0], ['2024-06', 1, 100, 1], ['2024-06', 1, 103, 0], ['2024-06', 1, 100, 0]]}, {'awards': [101, 102, 101, 1], 'total': 305}]], [['cap within month', {'cap': 5000, 'txns': [['2024-03', 100, 3000, 0], ['2024-03', 50, 2504, 0], ['2024-03', 10, 400, 0]]}, {'awards': [3100, 2050, 10], 'total': 5160}], ['new month resets', {'cap': 5000, 'txns': [['2024-03', 0, 5000, 0], ['2024-04', 0, 1004, 0]]}, {'awards': [5000, 1004], 'total': 6004}], ['same month next year', {'cap': 1000, 'txns': [['2023-07', 5, 900, 0], ['2024-07', 5, 904, 0]]}, {'awards': [905, 909], 'total': 1814}], ['exempt promo', {'cap': 2000, 'txns': [['2024-01', 200, 1500, 700], ['2024-01', 200, 404, 0]]}, {'awards': [2400, 604], 'total': 3004}], ['base never capped', {'cap': 1000, 'txns': [['2024-02', 5000, 600, 0], ['2024-02', 3000, 304, 0]]}, {'awards': [5600, 3304], 'total': 8904}], ['exempt only', {'cap': 100, 'txns': [['2024-05', 1, 0, 254], ['2024-05', 1, 90, 0]]}, {'awards': [255, 91], 'total': 346}], ['many small', {'cap': 300, 'txns': [['2024-06', 1, 100, 0], ['2024-06', 1, 100, 1], ['2024-06', 1, 104, 0], ['2024-06', 1, 100, 0]]}, {'awards': [101, 102, 101, 1], 'total': 305}]], [['cap within month', {'cap': 5000, 'txns': [['2024-03', 100, 3000, 0], ['2024-03', 50, 2505, 0], ['2024-03', 10, 400, 0]]}, {'awards': [3100, 2050, 10], 'total': 5160}], ['new month resets', {'cap': 5000, 'txns': [['2024-03', 0, 5000, 0], ['2024-04', 0, 1005, 0]]}, {'awards': [5000, 1005], 'total': 6005}], ['same month next year', {'cap': 1000, 'txns': [['2023-07', 5, 900, 0], ['2024-07', 5, 905, 0]]}, {'awards': [905, 910], 'total': 1815}], ['exempt promo', {'cap': 2000, 'txns': [['2024-01', 200, 1500, 700], ['2024-01', 200, 405, 0]]}, {'awards': [2400, 605], 'total': 3005}], ['base never capped', {'cap': 1000, 'txns': [['2024-02', 5000, 600, 0], ['2024-02', 3000, 305, 0]]}, {'awards': [5600, 3305], 'total': 8905}], ['exempt only', {'cap': 100, 'txns': [['2024-05', 1, 0, 255], ['2024-05', 1, 90, 0]]}, {'awards': [256, 91], 'total': 347}], ['many small', {'cap': 300, 'txns': [['2024-06', 1, 100, 0], ['2024-06', 1, 100, 1], ['2024-06', 1, 105, 0], ['2024-06', 1, 100, 0]]}, {'awards': [101, 102, 101, 1], 'total': 305}]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), 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":"Stipulated bounded loyalty-program model with explicit toy rules; not any real program terms. 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-loyalty-points-ledgers-monthly-bonus-cap-exempt-bonus-and-cap","generated_at":"2026-09-29T14:46:48.343850+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Member point balances, statements and the program liability depend on this ledger rule.","repair":"Keep exempt bonus out of the cap counter.","root_cause":"Exempt bonus is added to the cap counter.","sha256":"9f33f9f18d02f82da25c0aa150fa51fe5b6bd2f5c07dacf6a461d079c98cee1a","title":"Monthly promotional bonus cap: exempt bonus and cap · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.266,"exit_code":1,"observations":[{"actual":{"awards":[3100,2050,10],"total":5160},"check":"cap within month","expected":{"awards":[3100,2050,10],"total":5160},"passed":true},{"actual":{"awards":[5000,1001],"total":6001},"check":"new month resets","expected":{"awards":[5000,1001],"total":6001},"passed":true},{"actual":{"awards":[905,906],"total":1811},"check":"same month next year","expected":{"awards":[905,906],"total":1811},"passed":true},{"actual":{"awards":[2200,200],"total":2400},"check":"exempt promo","expected":{"awards":[2400,601],"total":3001},"passed":false},{"actual":{"awards":[5600,3301],"total":8901},"check":"base never capped","expected":{"awards":[5600,3301],"total":8901},"passed":true},{"actual":{"awards":[101,1],"total":102},"check":"exempt only","expected":{"awards":[252,91],"total":343},"passed":false},{"actual":{"awards":[101,102,100,1],"total":304},"check":"many small","expected":{"awards":[101,102,101,1],"total":305},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"cap within month\", \"actual\": {\"awards\": [3100, 2050, 10], \"total\": 5160}, \"expected\": {\"awards\": [3100, 2050, 10], \"total\": 5160}, \"passed\": true}, {\"check\": \"new month resets\", \"actual\": {\"awards\": [5000, 1001], \"total\": 6001}, \"expected\": {\"awards\": [5000, 1001], \"total\": 6001}, \"passed\": true}, {\"check\": \"same month next year\", \"actual\": {\"awards\": [905, 906], \"total\": 1811}, \"expected\": {\"awards\": [905, 906], \"total\": 1811}, \"passed\": true}, {\"check\": \"exempt promo\", \"actual\": {\"awards\": [2200, 200], \"total\": 2400}, \"expected\": {\"awards\": [2400, 601], \"total\": 3001}, \"passed\": false}, {\"check\": \"base never capped\", \"actual\": {\"awards\": [5600, 3301], \"total\": 8901}, \"expected\": {\"awards\": [5600, 3301], \"total\": 8901}, \"passed\": true}, {\"check\": \"exempt only\", \"actual\": {\"awards\": [101, 1], \"total\": 102}, \"expected\": {\"awards\": [252, 91], \"total\": 343}, \"passed\": false}, {\"check\": \"many small\", \"actual\": {\"awards\": [101, 102, 100, 1], \"total\": 304}, \"expected\": {\"awards\": [101, 102, 101, 1], \"total\": 305}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.519,"exit_code":1,"observations":[{"actual":{"awards":[3100,2050,10],"total":5160},"check":"cap within month","expected":{"awards":[3100,2050,10],"total":5160},"passed":true},{"actual":{"awards":[5000,1001],"total":6001},"check":"new month resets","expected":{"awards":[5000,1001],"total":6001},"passed":true},{"actual":{"awards":[905,906],"total":1811},"check":"same month next year","expected":{"awards":[905,906],"total":1811},"passed":true},{"actual":{"awards":[2400,0],"total":2400},"check":"exempt promo","expected":{"awards":[2400,601],"total":3001},"passed":false},{"actual":{"awards":[5600,3301],"total":8901},"check":"base never capped","expected":{"awards":[5600,3301],"total":8901},"passed":true},{"actual":{"awards":[252,-150],"total":102},"check":"exempt only","expected":{"awards":[252,91],"total":343},"passed":false},{"actual":{"awards":[101,102,100,1],"total":304},"check":"many small","expected":{"awards":[101,102,101,1],"total":305},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"cap within month\", \"actual\": {\"awards\": [3100, 2050, 10], \"total\": 5160}, \"expected\": {\"awards\": [3100, 2050, 10], \"total\": 5160}, \"passed\": true}, {\"check\": \"new month resets\", \"actual\": {\"awards\": [5000, 1001], \"total\": 6001}, \"expected\": {\"awards\": [5000, 1001], \"total\": 6001}, \"passed\": true}, {\"check\": \"same month next year\", \"actual\": {\"awards\": [905, 906], \"total\": 1811}, \"expected\": {\"awards\": [905, 906], \"total\": 1811}, \"passed\": true}, {\"check\": \"exempt promo\", \"actual\": {\"awards\": [2400, 0], \"total\": 2400}, \"expected\": {\"awards\": [2400, 601], \"total\": 3001}, \"passed\": false}, {\"check\": \"base never capped\", \"actual\": {\"awards\": [5600, 3301], \"total\": 8901}, \"expected\": {\"awards\": [5600, 3301], \"total\": 8901}, \"passed\": true}, {\"check\": \"exempt only\", \"actual\": {\"awards\": [252, -150], \"total\": 102}, \"expected\": {\"awards\": [252, 91], \"total\": 343}, \"passed\": false}, {\"check\": \"many small\", \"actual\": {\"awards\": [101, 102, 100, 1], \"total\": 304}, \"expected\": {\"awards\": [101, 102, 101, 1], \"total\": 305}, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.028,"exit_code":0,"observations":[{"actual":{"awards":[3100,2050,10],"total":5160},"check":"cap within month","expected":{"awards":[3100,2050,10],"total":5160},"passed":true},{"actual":{"awards":[5000,1001],"total":6001},"check":"new month resets","expected":{"awards":[5000,1001],"total":6001},"passed":true},{"actual":{"awards":[905,906],"total":1811},"check":"same month next year","expected":{"awards":[905,906],"total":1811},"passed":true},{"actual":{"awards":[2400,601],"total":3001},"check":"exempt promo","expected":{"awards":[2400,601],"total":3001},"passed":true},{"actual":{"awards":[5600,3301],"total":8901},"check":"base never capped","expected":{"awards":[5600,3301],"total":8901},"passed":true},{"actual":{"awards":[252,91],"total":343},"check":"exempt only","expected":{"awards":[252,91],"total":343},"passed":true},{"actual":{"awards":[101,102,101,1],"total":305},"check":"many small","expected":{"awards":[101,102,101,1],"total":305},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"cap within month\", \"actual\": {\"awards\": [3100, 2050, 10], \"total\": 5160}, \"expected\": {\"awards\": [3100, 2050, 10], \"total\": 5160}, \"passed\": true}, {\"check\": \"new month resets\", \"actual\": {\"awards\": [5000, 1001], \"total\": 6001}, \"expected\": {\"awards\": [5000, 1001], \"total\": 6001}, \"passed\": true}, {\"check\": \"same month next year\", \"actual\": {\"awards\": [905, 906], \"total\": 1811}, \"expected\": {\"awards\": [905, 906], \"total\": 1811}, \"passed\": true}, {\"check\": \"exempt promo\", \"actual\": {\"awards\": [2400, 601], \"total\": 3001}, \"expected\": {\"awards\": [2400, 601], \"total\": 3001}, \"passed\": true}, {\"check\": \"base never capped\", \"actual\": {\"awards\": [5600, 3301], \"total\": 8901}, \"expected\": {\"awards\": [5600, 3301], \"total\": 8901}, \"passed\": true}, {\"check\": \"exempt only\", \"actual\": {\"awards\": [252, 91], \"total\": 343}, \"expected\": {\"awards\": [252, 91], \"total\": 343}, \"passed\": true}, {\"check\": \"many small\", \"actual\": {\"awards\": [101, 102, 101, 1], \"total\": 305}, \"expected\": {\"awards\": [101, 102, 101, 1], \"total\": 305}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}