{"abstract":"Members who bought earlier in the year get the top bonus tier on a small purchase.","category":"Loyalty points ledgers","checks":8,"contract":"Input {requests:[pts], price_per_1000, tiers:[[min_base, bonus_bp]] ascending, annual_limit, bought_ytd}. Each request is floored to whole thousands (\"too small\" when that is 0). A request whose base would push purchased base points above annual_limit is rejected whole (\"limit\"); bonus points never count toward the limit. Bonus = floor(base*bp/10000) with bp from the highest tier whose min_base <= this request base. Price = base/1000*price_per_1000. Return {results:[[base,bonus,price]|reason], bought_ytd}.","evaluation_group":"w2-loyalty-points-ledgers-buy-points","failed_approach":"Selecting the tier from the unfloored request crosses tiers on fractional thousands.","family":"w2-loyalty-points-ledgers-buy-points-tier-basis-per-request","id":"FA-60791","implementations":{"attempt":{"sha256":"4b36b6c43d0dd66ca474fea66d681d70133ca8d3f459a74109fbc2ffab25a8c2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    bought = x['bought_ytd']\n    out = []\n    for req in x['requests']:\n        base = req // 1000 * 1000\n        if base == 0:\n            out.append('too small')\n            continue\n        if bought + base > x['annual_limit']:\n            out.append('limit')\n            continue\n        bp = 0\n        for mn, b in x['tiers']:\n            if req >= mn:\n                bp = b\n        bonus = base * bp // 10000\n        price = base // 1000 * x['price_per_1000']\n        bought += base\n        out.append([base, bonus, price])\n    return {'results': out, 'bought_ytd': bought}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['small buy', {'requests': [3501], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[3000, 0, 3750]], 'bought_ytd': 3000}], ['tier edge', {'requests': [5000], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 1000000, 'bought_ytd': 20000}, {'results': [[5000, 500, 6250]], 'bought_ytd': 25000}], ['big buy', {'requests': [21000], 'price_per_1000': 1100, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[21000, 5250, 23100]], 'bought_ytd': 21000}], ['too small', {'requests': [999, 1001], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': ['too small', [1000, 0, 1000]], 'bought_ytd': 1000}], ['limit hit', {'requests': [30000, 30000, 11000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 70000, 'bought_ytd': 5000}, {'results': [[30000, 7500, 30000], [30000, 7500, 30000], 'limit'], 'bought_ytd': 65000}], ['bonus not limited', {'requests': [20000, 20001], 'price_per_1000': 900, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 40000, 'bought_ytd': 0}, {'results': [[20000, 5000, 18000], [20000, 5000, 18000]], 'bought_ytd': 40000}], ['near limit', {'requests': [7000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 10000, 'bought_ytd': 4001}, {'results': ['limit'], 'bought_ytd': 4001}], ['fraction crosses tier', {'requests': [4701], 'price_per_1000': 1000, 'tiers': [[0, 0], [4500, 1000]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[4000, 0, 4000]], 'bought_ytd': 4000}]], [['small buy', {'requests': [3502], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[3000, 0, 3750]], 'bought_ytd': 3000}], ['tier edge', {'requests': [5000], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 1000000, 'bought_ytd': 40000}, {'results': [[5000, 500, 6250]], 'bought_ytd': 45000}], ['big buy', {'requests': [21001], 'price_per_1000': 1100, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[21000, 5250, 23100]], 'bought_ytd': 21000}], ['too small', {'requests': [999, 1002], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': ['too small', [1000, 0, 1000]], 'bought_ytd': 1000}], ['limit hit', {'requests': [30000, 30000, 12000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 70000, 'bought_ytd': 5000}, {'results': [[30000, 7500, 30000], [30000, 7500, 30000], 'limit'], 'bought_ytd': 65000}], ['bonus not limited', {'requests': [20000, 20002], 'price_per_1000': 900, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 40000, 'bought_ytd': 0}, {'results': [[20000, 5000, 18000], [20000, 5000, 18000]], 'bought_ytd': 40000}], ['near limit', {'requests': [7000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 10000, 'bought_ytd': 4002}, {'results': ['limit'], 'bought_ytd': 4002}], ['fraction crosses tier', {'requests': [4702], 'price_per_1000': 1000, 'tiers': [[0, 0], [4500, 1000]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[4000, 0, 4000]], 'bought_ytd': 4000}]], [['small buy', {'requests': [3503], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[3000, 0, 3750]], 'bought_ytd': 3000}], ['tier edge', {'requests': [5000], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 1000000, 'bought_ytd': 60000}, {'results': [[5000, 500, 6250]], 'bought_ytd': 65000}], ['big buy', {'requests': [21002], 'price_per_1000': 1100, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[21000, 5250, 23100]], 'bought_ytd': 21000}], ['too small', {'requests': [999, 1003], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': ['too small', [1000, 0, 1000]], 'bought_ytd': 1000}], ['limit hit', {'requests': [30000, 30000, 13000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 70000, 'bought_ytd': 5000}, {'results': [[30000, 7500, 30000], [30000, 7500, 30000], 'limit'], 'bought_ytd': 65000}], ['bonus not limited', {'requests': [20000, 20003], 'price_per_1000': 900, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 40000, 'bought_ytd': 0}, {'results': [[20000, 5000, 18000], [20000, 5000, 18000]], 'bought_ytd': 40000}], ['near limit', {'requests': [7000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 10000, 'bought_ytd': 4003}, {'results': ['limit'], 'bought_ytd': 4003}], ['fraction crosses tier', {'requests': [4703], 'price_per_1000': 1000, 'tiers': [[0, 0], [4500, 1000]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[4000, 0, 4000]], 'bought_ytd': 4000}]], [['small buy', {'requests': [3504], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[3000, 0, 3750]], 'bought_ytd': 3000}], ['tier edge', {'requests': [5000], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 1000000, 'bought_ytd': 80000}, {'results': [[5000, 500, 6250]], 'bought_ytd': 85000}], ['big buy', {'requests': [21003], 'price_per_1000': 1100, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[21000, 5250, 23100]], 'bought_ytd': 21000}], ['too small', {'requests': [999, 1004], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': ['too small', [1000, 0, 1000]], 'bought_ytd': 1000}], ['limit hit', {'requests': [30000, 30000, 14000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 70000, 'bought_ytd': 5000}, {'results': [[30000, 7500, 30000], [30000, 7500, 30000], 'limit'], 'bought_ytd': 65000}], ['bonus not limited', {'requests': [20000, 20004], 'price_per_1000': 900, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 40000, 'bought_ytd': 0}, {'results': [[20000, 5000, 18000], [20000, 5000, 18000]], 'bought_ytd': 40000}], ['near limit', {'requests': [7000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 10000, 'bought_ytd': 4004}, {'results': ['limit'], 'bought_ytd': 4004}], ['fraction crosses tier', {'requests': [4704], 'price_per_1000': 1000, 'tiers': [[0, 0], [4500, 1000]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[4000, 0, 4000]], 'bought_ytd': 4000}]], [['small buy', {'requests': [3505], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[3000, 0, 3750]], 'bought_ytd': 3000}], ['tier edge', {'requests': [5000], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 1000000, 'bought_ytd': 100000}, {'results': [[5000, 500, 6250]], 'bought_ytd': 105000}], ['big buy', {'requests': [21004], 'price_per_1000': 1100, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[21000, 5250, 23100]], 'bought_ytd': 21000}], ['too small', {'requests': [999, 1005], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': ['too small', [1000, 0, 1000]], 'bought_ytd': 1000}], ['limit hit', {'requests': [30000, 30000, 15000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 70000, 'bought_ytd': 5000}, {'results': [[30000, 7500, 30000], [30000, 7500, 30000], 'limit'], 'bought_ytd': 65000}], ['bonus not limited', {'requests': [20000, 20005], 'price_per_1000': 900, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 40000, 'bought_ytd': 0}, {'results': [[20000, 5000, 18000], [20000, 5000, 18000]], 'bought_ytd': 40000}], ['near limit', {'requests': [7000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 10000, 'bought_ytd': 4005}, {'results': ['limit'], 'bought_ytd': 4005}], ['fraction crosses tier', {'requests': [4705], 'price_per_1000': 1000, 'tiers': [[0, 0], [4500, 1000]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[4000, 0, 4000]], 'bought_ytd': 4000}]]]\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":"e7afb2b6a04e0e76129c4be4f6d1eaa20ea57e538bf31ccc54c253ee7369f663","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    bought = x['bought_ytd']\n    out = []\n    for req in x['requests']:\n        base = req // 1000 * 1000\n        if base == 0:\n            out.append('too small')\n            continue\n        if bought + base > x['annual_limit']:\n            out.append('limit')\n            continue\n        bp = 0\n        for mn, b in x['tiers']:\n            if bought + base >= mn:\n                bp = b\n        bonus = base * bp // 10000\n        price = base // 1000 * x['price_per_1000']\n        bought += base\n        out.append([base, bonus, price])\n    return {'results': out, 'bought_ytd': bought}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['small buy', {'requests': [3501], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[3000, 0, 3750]], 'bought_ytd': 3000}], ['tier edge', {'requests': [5000], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 1000000, 'bought_ytd': 20000}, {'results': [[5000, 500, 6250]], 'bought_ytd': 25000}], ['big buy', {'requests': [21000], 'price_per_1000': 1100, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[21000, 5250, 23100]], 'bought_ytd': 21000}], ['too small', {'requests': [999, 1001], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': ['too small', [1000, 0, 1000]], 'bought_ytd': 1000}], ['limit hit', {'requests': [30000, 30000, 11000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 70000, 'bought_ytd': 5000}, {'results': [[30000, 7500, 30000], [30000, 7500, 30000], 'limit'], 'bought_ytd': 65000}], ['bonus not limited', {'requests': [20000, 20001], 'price_per_1000': 900, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 40000, 'bought_ytd': 0}, {'results': [[20000, 5000, 18000], [20000, 5000, 18000]], 'bought_ytd': 40000}], ['near limit', {'requests': [7000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 10000, 'bought_ytd': 4001}, {'results': ['limit'], 'bought_ytd': 4001}], ['fraction crosses tier', {'requests': [4701], 'price_per_1000': 1000, 'tiers': [[0, 0], [4500, 1000]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[4000, 0, 4000]], 'bought_ytd': 4000}]], [['small buy', {'requests': [3502], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[3000, 0, 3750]], 'bought_ytd': 3000}], ['tier edge', {'requests': [5000], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 1000000, 'bought_ytd': 40000}, {'results': [[5000, 500, 6250]], 'bought_ytd': 45000}], ['big buy', {'requests': [21001], 'price_per_1000': 1100, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[21000, 5250, 23100]], 'bought_ytd': 21000}], ['too small', {'requests': [999, 1002], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': ['too small', [1000, 0, 1000]], 'bought_ytd': 1000}], ['limit hit', {'requests': [30000, 30000, 12000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 70000, 'bought_ytd': 5000}, {'results': [[30000, 7500, 30000], [30000, 7500, 30000], 'limit'], 'bought_ytd': 65000}], ['bonus not limited', {'requests': [20000, 20002], 'price_per_1000': 900, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 40000, 'bought_ytd': 0}, {'results': [[20000, 5000, 18000], [20000, 5000, 18000]], 'bought_ytd': 40000}], ['near limit', {'requests': [7000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 10000, 'bought_ytd': 4002}, {'results': ['limit'], 'bought_ytd': 4002}], ['fraction crosses tier', {'requests': [4702], 'price_per_1000': 1000, 'tiers': [[0, 0], [4500, 1000]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[4000, 0, 4000]], 'bought_ytd': 4000}]], [['small buy', {'requests': [3503], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[3000, 0, 3750]], 'bought_ytd': 3000}], ['tier edge', {'requests': [5000], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 1000000, 'bought_ytd': 60000}, {'results': [[5000, 500, 6250]], 'bought_ytd': 65000}], ['big buy', {'requests': [21002], 'price_per_1000': 1100, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[21000, 5250, 23100]], 'bought_ytd': 21000}], ['too small', {'requests': [999, 1003], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': ['too small', [1000, 0, 1000]], 'bought_ytd': 1000}], ['limit hit', {'requests': [30000, 30000, 13000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 70000, 'bought_ytd': 5000}, {'results': [[30000, 7500, 30000], [30000, 7500, 30000], 'limit'], 'bought_ytd': 65000}], ['bonus not limited', {'requests': [20000, 20003], 'price_per_1000': 900, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 40000, 'bought_ytd': 0}, {'results': [[20000, 5000, 18000], [20000, 5000, 18000]], 'bought_ytd': 40000}], ['near limit', {'requests': [7000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 10000, 'bought_ytd': 4003}, {'results': ['limit'], 'bought_ytd': 4003}], ['fraction crosses tier', {'requests': [4703], 'price_per_1000': 1000, 'tiers': [[0, 0], [4500, 1000]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[4000, 0, 4000]], 'bought_ytd': 4000}]], [['small buy', {'requests': [3504], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[3000, 0, 3750]], 'bought_ytd': 3000}], ['tier edge', {'requests': [5000], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 1000000, 'bought_ytd': 80000}, {'results': [[5000, 500, 6250]], 'bought_ytd': 85000}], ['big buy', {'requests': [21003], 'price_per_1000': 1100, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[21000, 5250, 23100]], 'bought_ytd': 21000}], ['too small', {'requests': [999, 1004], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': ['too small', [1000, 0, 1000]], 'bought_ytd': 1000}], ['limit hit', {'requests': [30000, 30000, 14000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 70000, 'bought_ytd': 5000}, {'results': [[30000, 7500, 30000], [30000, 7500, 30000], 'limit'], 'bought_ytd': 65000}], ['bonus not limited', {'requests': [20000, 20004], 'price_per_1000': 900, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 40000, 'bought_ytd': 0}, {'results': [[20000, 5000, 18000], [20000, 5000, 18000]], 'bought_ytd': 40000}], ['near limit', {'requests': [7000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 10000, 'bought_ytd': 4004}, {'results': ['limit'], 'bought_ytd': 4004}], ['fraction crosses tier', {'requests': [4704], 'price_per_1000': 1000, 'tiers': [[0, 0], [4500, 1000]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[4000, 0, 4000]], 'bought_ytd': 4000}]], [['small buy', {'requests': [3505], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[3000, 0, 3750]], 'bought_ytd': 3000}], ['tier edge', {'requests': [5000], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 1000000, 'bought_ytd': 100000}, {'results': [[5000, 500, 6250]], 'bought_ytd': 105000}], ['big buy', {'requests': [21004], 'price_per_1000': 1100, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[21000, 5250, 23100]], 'bought_ytd': 21000}], ['too small', {'requests': [999, 1005], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': ['too small', [1000, 0, 1000]], 'bought_ytd': 1000}], ['limit hit', {'requests': [30000, 30000, 15000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 70000, 'bought_ytd': 5000}, {'results': [[30000, 7500, 30000], [30000, 7500, 30000], 'limit'], 'bought_ytd': 65000}], ['bonus not limited', {'requests': [20000, 20005], 'price_per_1000': 900, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 40000, 'bought_ytd': 0}, {'results': [[20000, 5000, 18000], [20000, 5000, 18000]], 'bought_ytd': 40000}], ['near limit', {'requests': [7000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 10000, 'bought_ytd': 4005}, {'results': ['limit'], 'bought_ytd': 4005}], ['fraction crosses tier', {'requests': [4705], 'price_per_1000': 1000, 'tiers': [[0, 0], [4500, 1000]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[4000, 0, 4000]], 'bought_ytd': 4000}]]]\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":"4d77170eab7486ab482d1d1eb5f269583da0a188ea4bbc38f156e5eec5b74c93","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    bought = x['bought_ytd']\n    out = []\n    for req in x['requests']:\n        base = req // 1000 * 1000\n        if base == 0:\n            out.append('too small')\n            continue\n        if bought + base > x['annual_limit']:\n            out.append('limit')\n            continue\n        bp = 0\n        for mn, b in x['tiers']:\n            if base >= mn:\n                bp = b\n        bonus = base * bp // 10000\n        price = base // 1000 * x['price_per_1000']\n        bought += base\n        out.append([base, bonus, price])\n    return {'results': out, 'bought_ytd': bought}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['small buy', {'requests': [3501], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[3000, 0, 3750]], 'bought_ytd': 3000}], ['tier edge', {'requests': [5000], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 1000000, 'bought_ytd': 20000}, {'results': [[5000, 500, 6250]], 'bought_ytd': 25000}], ['big buy', {'requests': [21000], 'price_per_1000': 1100, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[21000, 5250, 23100]], 'bought_ytd': 21000}], ['too small', {'requests': [999, 1001], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': ['too small', [1000, 0, 1000]], 'bought_ytd': 1000}], ['limit hit', {'requests': [30000, 30000, 11000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 70000, 'bought_ytd': 5000}, {'results': [[30000, 7500, 30000], [30000, 7500, 30000], 'limit'], 'bought_ytd': 65000}], ['bonus not limited', {'requests': [20000, 20001], 'price_per_1000': 900, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 40000, 'bought_ytd': 0}, {'results': [[20000, 5000, 18000], [20000, 5000, 18000]], 'bought_ytd': 40000}], ['near limit', {'requests': [7000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 10000, 'bought_ytd': 4001}, {'results': ['limit'], 'bought_ytd': 4001}], ['fraction crosses tier', {'requests': [4701], 'price_per_1000': 1000, 'tiers': [[0, 0], [4500, 1000]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[4000, 0, 4000]], 'bought_ytd': 4000}]], [['small buy', {'requests': [3502], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[3000, 0, 3750]], 'bought_ytd': 3000}], ['tier edge', {'requests': [5000], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 1000000, 'bought_ytd': 40000}, {'results': [[5000, 500, 6250]], 'bought_ytd': 45000}], ['big buy', {'requests': [21001], 'price_per_1000': 1100, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[21000, 5250, 23100]], 'bought_ytd': 21000}], ['too small', {'requests': [999, 1002], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': ['too small', [1000, 0, 1000]], 'bought_ytd': 1000}], ['limit hit', {'requests': [30000, 30000, 12000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 70000, 'bought_ytd': 5000}, {'results': [[30000, 7500, 30000], [30000, 7500, 30000], 'limit'], 'bought_ytd': 65000}], ['bonus not limited', {'requests': [20000, 20002], 'price_per_1000': 900, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 40000, 'bought_ytd': 0}, {'results': [[20000, 5000, 18000], [20000, 5000, 18000]], 'bought_ytd': 40000}], ['near limit', {'requests': [7000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 10000, 'bought_ytd': 4002}, {'results': ['limit'], 'bought_ytd': 4002}], ['fraction crosses tier', {'requests': [4702], 'price_per_1000': 1000, 'tiers': [[0, 0], [4500, 1000]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[4000, 0, 4000]], 'bought_ytd': 4000}]], [['small buy', {'requests': [3503], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[3000, 0, 3750]], 'bought_ytd': 3000}], ['tier edge', {'requests': [5000], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 1000000, 'bought_ytd': 60000}, {'results': [[5000, 500, 6250]], 'bought_ytd': 65000}], ['big buy', {'requests': [21002], 'price_per_1000': 1100, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[21000, 5250, 23100]], 'bought_ytd': 21000}], ['too small', {'requests': [999, 1003], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': ['too small', [1000, 0, 1000]], 'bought_ytd': 1000}], ['limit hit', {'requests': [30000, 30000, 13000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 70000, 'bought_ytd': 5000}, {'results': [[30000, 7500, 30000], [30000, 7500, 30000], 'limit'], 'bought_ytd': 65000}], ['bonus not limited', {'requests': [20000, 20003], 'price_per_1000': 900, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 40000, 'bought_ytd': 0}, {'results': [[20000, 5000, 18000], [20000, 5000, 18000]], 'bought_ytd': 40000}], ['near limit', {'requests': [7000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 10000, 'bought_ytd': 4003}, {'results': ['limit'], 'bought_ytd': 4003}], ['fraction crosses tier', {'requests': [4703], 'price_per_1000': 1000, 'tiers': [[0, 0], [4500, 1000]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[4000, 0, 4000]], 'bought_ytd': 4000}]], [['small buy', {'requests': [3504], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[3000, 0, 3750]], 'bought_ytd': 3000}], ['tier edge', {'requests': [5000], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 1000000, 'bought_ytd': 80000}, {'results': [[5000, 500, 6250]], 'bought_ytd': 85000}], ['big buy', {'requests': [21003], 'price_per_1000': 1100, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[21000, 5250, 23100]], 'bought_ytd': 21000}], ['too small', {'requests': [999, 1004], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': ['too small', [1000, 0, 1000]], 'bought_ytd': 1000}], ['limit hit', {'requests': [30000, 30000, 14000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 70000, 'bought_ytd': 5000}, {'results': [[30000, 7500, 30000], [30000, 7500, 30000], 'limit'], 'bought_ytd': 65000}], ['bonus not limited', {'requests': [20000, 20004], 'price_per_1000': 900, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 40000, 'bought_ytd': 0}, {'results': [[20000, 5000, 18000], [20000, 5000, 18000]], 'bought_ytd': 40000}], ['near limit', {'requests': [7000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 10000, 'bought_ytd': 4004}, {'results': ['limit'], 'bought_ytd': 4004}], ['fraction crosses tier', {'requests': [4704], 'price_per_1000': 1000, 'tiers': [[0, 0], [4500, 1000]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[4000, 0, 4000]], 'bought_ytd': 4000}]], [['small buy', {'requests': [3505], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[3000, 0, 3750]], 'bought_ytd': 3000}], ['tier edge', {'requests': [5000], 'price_per_1000': 1250, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 1000000, 'bought_ytd': 100000}, {'results': [[5000, 500, 6250]], 'bought_ytd': 105000}], ['big buy', {'requests': [21004], 'price_per_1000': 1100, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[21000, 5250, 23100]], 'bought_ytd': 21000}], ['too small', {'requests': [999, 1005], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': ['too small', [1000, 0, 1000]], 'bought_ytd': 1000}], ['limit hit', {'requests': [30000, 30000, 15000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 70000, 'bought_ytd': 5000}, {'results': [[30000, 7500, 30000], [30000, 7500, 30000], 'limit'], 'bought_ytd': 65000}], ['bonus not limited', {'requests': [20000, 20005], 'price_per_1000': 900, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 40000, 'bought_ytd': 0}, {'results': [[20000, 5000, 18000], [20000, 5000, 18000]], 'bought_ytd': 40000}], ['near limit', {'requests': [7000], 'price_per_1000': 1000, 'tiers': [[0, 0], [5000, 1000], [20000, 2500]], 'annual_limit': 10000, 'bought_ytd': 4005}, {'results': ['limit'], 'bought_ytd': 4005}], ['fraction crosses tier', {'requests': [4705], 'price_per_1000': 1000, 'tiers': [[0, 0], [4500, 1000]], 'annual_limit': 100000, 'bought_ytd': 0}, {'results': [[4000, 0, 4000]], 'bought_ytd': 4000}]]]\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-buy-points-tier-basis-per-request","generated_at":"2026-09-29T14:46:48.947209+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":"Select the tier from this request base alone.","root_cause":"The bonus tier is looked up with year-to-date purchases plus this request.","sha256":"8b1be2eeb9f8e51935a299a53e42fce9172ec81a70bfcba34ab4efb2e666d1a3","title":"Purchased points with volume bonus: tier basis per request · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.648,"exit_code":1,"observations":[{"actual":{"bought_ytd":3000,"results":[[3000,0,3750]]},"check":"small buy","expected":{"bought_ytd":3000,"results":[[3000,0,3750]]},"passed":true},{"actual":{"bought_ytd":25000,"results":[[5000,500,6250]]},"check":"tier edge","expected":{"bought_ytd":25000,"results":[[5000,500,6250]]},"passed":true},{"actual":{"bought_ytd":21000,"results":[[21000,5250,23100]]},"check":"big buy","expected":{"bought_ytd":21000,"results":[[21000,5250,23100]]},"passed":true},{"actual":{"bought_ytd":1000,"results":["too small",[1000,0,1000]]},"check":"too small","expected":{"bought_ytd":1000,"results":["too small",[1000,0,1000]]},"passed":true},{"actual":{"bought_ytd":65000,"results":[[30000,7500,30000],[30000,7500,30000],"limit"]},"check":"limit hit","expected":{"bought_ytd":65000,"results":[[30000,7500,30000],[30000,7500,30000],"limit"]},"passed":true},{"actual":{"bought_ytd":40000,"results":[[20000,5000,18000],[20000,5000,18000]]},"check":"bonus not limited","expected":{"bought_ytd":40000,"results":[[20000,5000,18000],[20000,5000,18000]]},"passed":true},{"actual":{"bought_ytd":4001,"results":["limit"]},"check":"near limit","expected":{"bought_ytd":4001,"results":["limit"]},"passed":true},{"actual":{"bought_ytd":4000,"results":[[4000,400,4000]]},"check":"fraction crosses tier","expected":{"bought_ytd":4000,"results":[[4000,0,4000]]},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"small buy\", \"actual\": {\"results\": [[3000, 0, 3750]], \"bought_ytd\": 3000}, \"expected\": {\"results\": [[3000, 0, 3750]], \"bought_ytd\": 3000}, \"passed\": true}, {\"check\": \"tier edge\", \"actual\": {\"results\": [[5000, 500, 6250]], \"bought_ytd\": 25000}, \"expected\": {\"results\": [[5000, 500, 6250]], \"bought_ytd\": 25000}, \"passed\": true}, {\"check\": \"big buy\", \"actual\": {\"results\": [[21000, 5250, 23100]], \"bought_ytd\": 21000}, \"expected\": {\"results\": [[21000, 5250, 23100]], \"bought_ytd\": 21000}, \"passed\": true}, {\"check\": \"too small\", \"actual\": {\"results\": [\"too small\", [1000, 0, 1000]], \"bought_ytd\": 1000}, \"expected\": {\"results\": [\"too small\", [1000, 0, 1000]], \"bought_ytd\": 1000}, \"passed\": true}, {\"check\": \"limit hit\", \"actual\": {\"results\": [[30000, 7500, 30000], [30000, 7500, 30000], \"limit\"], \"bought_ytd\": 65000}, \"expected\": {\"results\": [[30000, 7500, 30000], [30000, 7500, 30000], \"limit\"], \"bought_ytd\": 65000}, \"passed\": true}, {\"check\": \"bonus not limited\", \"actual\": {\"results\": [[20000, 5000, 18000], [20000, 5000, 18000]], \"bought_ytd\": 40000}, \"expected\": {\"results\": [[20000, 5000, 18000], [20000, 5000, 18000]], \"bought_ytd\": 40000}, \"passed\": true}, {\"check\": \"near limit\", \"actual\": {\"results\": [\"limit\"], \"bought_ytd\": 4001}, \"expected\": {\"results\": [\"limit\"], \"bought_ytd\": 4001}, \"passed\": true}, {\"check\": \"fraction crosses tier\", \"actual\": {\"results\": [[4000, 400, 4000]], \"bought_ytd\": 4000}, \"expected\": {\"results\": [[4000, 0, 4000]], \"bought_ytd\": 4000}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.199,"exit_code":1,"observations":[{"actual":{"bought_ytd":3000,"results":[[3000,0,3750]]},"check":"small buy","expected":{"bought_ytd":3000,"results":[[3000,0,3750]]},"passed":true},{"actual":{"bought_ytd":25000,"results":[[5000,1250,6250]]},"check":"tier edge","expected":{"bought_ytd":25000,"results":[[5000,500,6250]]},"passed":false},{"actual":{"bought_ytd":21000,"results":[[21000,5250,23100]]},"check":"big buy","expected":{"bought_ytd":21000,"results":[[21000,5250,23100]]},"passed":true},{"actual":{"bought_ytd":1000,"results":["too small",[1000,0,1000]]},"check":"too small","expected":{"bought_ytd":1000,"results":["too small",[1000,0,1000]]},"passed":true},{"actual":{"bought_ytd":65000,"results":[[30000,7500,30000],[30000,7500,30000],"limit"]},"check":"limit hit","expected":{"bought_ytd":65000,"results":[[30000,7500,30000],[30000,7500,30000],"limit"]},"passed":true},{"actual":{"bought_ytd":40000,"results":[[20000,5000,18000],[20000,5000,18000]]},"check":"bonus not limited","expected":{"bought_ytd":40000,"results":[[20000,5000,18000],[20000,5000,18000]]},"passed":true},{"actual":{"bought_ytd":4001,"results":["limit"]},"check":"near limit","expected":{"bought_ytd":4001,"results":["limit"]},"passed":true},{"actual":{"bought_ytd":4000,"results":[[4000,0,4000]]},"check":"fraction crosses tier","expected":{"bought_ytd":4000,"results":[[4000,0,4000]]},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"small buy\", \"actual\": {\"results\": [[3000, 0, 3750]], \"bought_ytd\": 3000}, \"expected\": {\"results\": [[3000, 0, 3750]], \"bought_ytd\": 3000}, \"passed\": true}, {\"check\": \"tier edge\", \"actual\": {\"results\": [[5000, 1250, 6250]], \"bought_ytd\": 25000}, \"expected\": {\"results\": [[5000, 500, 6250]], \"bought_ytd\": 25000}, \"passed\": false}, {\"check\": \"big buy\", \"actual\": {\"results\": [[21000, 5250, 23100]], \"bought_ytd\": 21000}, \"expected\": {\"results\": [[21000, 5250, 23100]], \"bought_ytd\": 21000}, \"passed\": true}, {\"check\": \"too small\", \"actual\": {\"results\": [\"too small\", [1000, 0, 1000]], \"bought_ytd\": 1000}, \"expected\": {\"results\": [\"too small\", [1000, 0, 1000]], \"bought_ytd\": 1000}, \"passed\": true}, {\"check\": \"limit hit\", \"actual\": {\"results\": [[30000, 7500, 30000], [30000, 7500, 30000], \"limit\"], \"bought_ytd\": 65000}, \"expected\": {\"results\": [[30000, 7500, 30000], [30000, 7500, 30000], \"limit\"], \"bought_ytd\": 65000}, \"passed\": true}, {\"check\": \"bonus not limited\", \"actual\": {\"results\": [[20000, 5000, 18000], [20000, 5000, 18000]], \"bought_ytd\": 40000}, \"expected\": {\"results\": [[20000, 5000, 18000], [20000, 5000, 18000]], \"bought_ytd\": 40000}, \"passed\": true}, {\"check\": \"near limit\", \"actual\": {\"results\": [\"limit\"], \"bought_ytd\": 4001}, \"expected\": {\"results\": [\"limit\"], \"bought_ytd\": 4001}, \"passed\": true}, {\"check\": \"fraction crosses tier\", \"actual\": {\"results\": [[4000, 0, 4000]], \"bought_ytd\": 4000}, \"expected\": {\"results\": [[4000, 0, 4000]], \"bought_ytd\": 4000}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.25,"exit_code":0,"observations":[{"actual":{"bought_ytd":3000,"results":[[3000,0,3750]]},"check":"small buy","expected":{"bought_ytd":3000,"results":[[3000,0,3750]]},"passed":true},{"actual":{"bought_ytd":25000,"results":[[5000,500,6250]]},"check":"tier edge","expected":{"bought_ytd":25000,"results":[[5000,500,6250]]},"passed":true},{"actual":{"bought_ytd":21000,"results":[[21000,5250,23100]]},"check":"big buy","expected":{"bought_ytd":21000,"results":[[21000,5250,23100]]},"passed":true},{"actual":{"bought_ytd":1000,"results":["too small",[1000,0,1000]]},"check":"too small","expected":{"bought_ytd":1000,"results":["too small",[1000,0,1000]]},"passed":true},{"actual":{"bought_ytd":65000,"results":[[30000,7500,30000],[30000,7500,30000],"limit"]},"check":"limit hit","expected":{"bought_ytd":65000,"results":[[30000,7500,30000],[30000,7500,30000],"limit"]},"passed":true},{"actual":{"bought_ytd":40000,"results":[[20000,5000,18000],[20000,5000,18000]]},"check":"bonus not limited","expected":{"bought_ytd":40000,"results":[[20000,5000,18000],[20000,5000,18000]]},"passed":true},{"actual":{"bought_ytd":4001,"results":["limit"]},"check":"near limit","expected":{"bought_ytd":4001,"results":["limit"]},"passed":true},{"actual":{"bought_ytd":4000,"results":[[4000,0,4000]]},"check":"fraction crosses tier","expected":{"bought_ytd":4000,"results":[[4000,0,4000]]},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"small buy\", \"actual\": {\"results\": [[3000, 0, 3750]], \"bought_ytd\": 3000}, \"expected\": {\"results\": [[3000, 0, 3750]], \"bought_ytd\": 3000}, \"passed\": true}, {\"check\": \"tier edge\", \"actual\": {\"results\": [[5000, 500, 6250]], \"bought_ytd\": 25000}, \"expected\": {\"results\": [[5000, 500, 6250]], \"bought_ytd\": 25000}, \"passed\": true}, {\"check\": \"big buy\", \"actual\": {\"results\": [[21000, 5250, 23100]], \"bought_ytd\": 21000}, \"expected\": {\"results\": [[21000, 5250, 23100]], \"bought_ytd\": 21000}, \"passed\": true}, {\"check\": \"too small\", \"actual\": {\"results\": [\"too small\", [1000, 0, 1000]], \"bought_ytd\": 1000}, \"expected\": {\"results\": [\"too small\", [1000, 0, 1000]], \"bought_ytd\": 1000}, \"passed\": true}, {\"check\": \"limit hit\", \"actual\": {\"results\": [[30000, 7500, 30000], [30000, 7500, 30000], \"limit\"], \"bought_ytd\": 65000}, \"expected\": {\"results\": [[30000, 7500, 30000], [30000, 7500, 30000], \"limit\"], \"bought_ytd\": 65000}, \"passed\": true}, {\"check\": \"bonus not limited\", \"actual\": {\"results\": [[20000, 5000, 18000], [20000, 5000, 18000]], \"bought_ytd\": 40000}, \"expected\": {\"results\": [[20000, 5000, 18000], [20000, 5000, 18000]], \"bought_ytd\": 40000}, \"passed\": true}, {\"check\": \"near limit\", \"actual\": {\"results\": [\"limit\"], \"bought_ytd\": 4001}, \"expected\": {\"results\": [\"limit\"], \"bought_ytd\": 4001}, \"passed\": true}, {\"check\": \"fraction crosses tier\", \"actual\": {\"results\": [[4000, 0, 4000]], \"bought_ytd\": 4000}, \"expected\": {\"results\": [[4000, 0, 4000]], \"bought_ytd\": 4000}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}