{"abstract":"Prepaid toll account auto-replenishment returns a wrong result when the usage-based amount is floored to 500.","category":"Toll and parking fee computation","checks":8,"contract":"Input {balance, charges, threshold, min_replenish, usage_30d, card_ok}. The replenish amount is max(min_replenish, ceil(usage_30d/4) rounded up to a multiple of 500). After each charge, if the balance is strictly below threshold and the card works, one replenishment is added. first_negative is the index of the first charge after which the balance is negative (or null). Return {balance, replenished, first_negative}.","evaluation_group":"w2-toll_and_parking_fee_computation-auto-replenish","failed_approach":"Skipping the 500 cent grid charges odd card amounts.","family":"w2-toll_and_parking_fee_computation-auto-replenish-amount-rounding","id":"FA-68621","implementations":{"attempt":{"sha256":"191d15aae5e70b1f4f02d9410d5d724c02215adcc8475ed78a79e1b8c686a264","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    bal = x['balance']\n    n = 0\n    first = None\n    amt = max(x['min_replenish'], -(-x['usage_30d'] // 4))\n    for i, c in enumerate(x['charges']):\n        bal -= c\n        if bal < x['threshold'] and x['card_ok']:\n            bal += amt\n            n += 1\n        if bal < 0 and first is None:\n            first = i\n    return {'balance': bal, 'replenished': n, 'first_negative': first}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'balance': 1400, 'charges': [400, 150], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 3350, 'replenished': 1, 'first_negative': None}), ({'balance': 2574, 'charges': [3000, 650, 650], 'threshold': 1500, 'min_replenish': 2000, 'usage_30d': 11833, 'card_ok': True}, {'balance': 4274, 'replenished': 2, 'first_negative': None}), ({'balance': 930, 'charges': [3000, 150, 275, 3000, 275, 400, 1200, 650], 'threshold': 1500, 'min_replenish': 2000, 'usage_30d': 7179, 'card_ok': True}, {'balance': 1980, 'replenished': 5, 'first_negative': 0}), ({'balance': 3406, 'charges': [3000, 650, 400, 400, 3000], 'threshold': 1500, 'min_replenish': 1000, 'usage_30d': 19012, 'card_ok': False}, {'balance': -4044, 'replenished': 0, 'first_negative': 1}), ({'balance': 288, 'charges': [3000], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 7617, 'card_ok': False}, {'balance': -2712, 'replenished': 0, 'first_negative': 0}), ({'balance': 300, 'charges': [400, 150, 275], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': -525, 'replenished': 0, 'first_negative': 0}), ({'balance': 324, 'charges': [275, 650, 1200, 1200, 400, 650, 1200, 3000], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 11394, 'card_ok': True}, {'balance': 3749, 'replenished': 4, 'first_negative': None}), ({'balance': 400, 'charges': [400], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': 0, 'replenished': 0, 'first_negative': None})], [({'balance': 1400, 'charges': [400, 150], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 3350, 'replenished': 1, 'first_negative': None}), ({'balance': 2515, 'charges': [400], 'threshold': 1500, 'min_replenish': 2500, 'usage_30d': 3531, 'card_ok': True}, {'balance': 2115, 'replenished': 0, 'first_negative': None}), ({'balance': 400, 'charges': [400], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': 0, 'replenished': 0, 'first_negative': None}), ({'balance': 1219, 'charges': [150, 400, 275, 1200, 275, 275], 'threshold': 500, 'min_replenish': 2500, 'usage_30d': 15594, 'card_ok': False}, {'balance': -1356, 'replenished': 0, 'first_negative': 3}), ({'balance': 412, 'charges': [400, 3000, 650], 'threshold': 500, 'min_replenish': 2500, 'usage_30d': 13088, 'card_ok': True}, {'balance': 3362, 'replenished': 2, 'first_negative': None}), ({'balance': 1400, 'charges': [400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 1000, 'replenished': 0, 'first_negative': None}), ({'balance': 2633, 'charges': [650, 150, 275, 1200, 3000, 150, 400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 12112, 'card_ok': False}, {'balance': -3192, 'replenished': 0, 'first_negative': 4}), ({'balance': 1282, 'charges': [1200, 150, 1200, 150, 3000], 'threshold': 1500, 'min_replenish': 2500, 'usage_30d': 15237, 'card_ok': True}, {'balance': 3582, 'replenished': 2, 'first_negative': None})], [({'balance': 26, 'charges': [150, 1200, 3000, 400], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 19243, 'card_ok': False}, {'balance': -4724, 'replenished': 0, 'first_negative': 0}), ({'balance': 2453, 'charges': [650, 275], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 7993, 'card_ok': True}, {'balance': 1528, 'replenished': 0, 'first_negative': None}), ({'balance': 1400, 'charges': [400, 150], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 3350, 'replenished': 1, 'first_negative': None}), ({'balance': 1341, 'charges': [400, 3000, 275], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 15381, 'card_ok': True}, {'balance': 1666, 'replenished': 1, 'first_negative': None}), ({'balance': -329, 'charges': [3000, 150, 1200, 400], 'threshold': 1500, 'min_replenish': 2500, 'usage_30d': 7527, 'card_ok': True}, {'balance': 2421, 'replenished': 3, 'first_negative': 0}), ({'balance': 300, 'charges': [400, 150, 275], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': -525, 'replenished': 0, 'first_negative': 0}), ({'balance': 552, 'charges': [275, 1200], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 7045, 'card_ok': True}, {'balance': 1077, 'replenished': 1, 'first_negative': None}), ({'balance': 1400, 'charges': [400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 1000, 'replenished': 0, 'first_negative': None})], [({'balance': 2290, 'charges': [1200, 650, 150, 1200, 400, 1200], 'threshold': 1500, 'min_replenish': 2500, 'usage_30d': 6040, 'card_ok': True}, {'balance': 2490, 'replenished': 2, 'first_negative': None}), ({'balance': 2621, 'charges': [3000, 150, 1200, 150], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 17666, 'card_ok': True}, {'balance': 2621, 'replenished': 1, 'first_negative': None}), ({'balance': 2757, 'charges': [1200, 3000, 150], 'threshold': 1500, 'min_replenish': 1000, 'usage_30d': 14481, 'card_ok': False}, {'balance': -1593, 'replenished': 0, 'first_negative': 1}), ({'balance': 777, 'charges': [650, 3000, 400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 17628, 'card_ok': True}, {'balance': 1227, 'replenished': 1, 'first_negative': None}), ({'balance': 1400, 'charges': [400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 1000, 'replenished': 0, 'first_negative': None}), ({'balance': 1400, 'charges': [400, 150], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 3350, 'replenished': 1, 'first_negative': None}), ({'balance': 300, 'charges': [400, 150, 275], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': -525, 'replenished': 0, 'first_negative': 0}), ({'balance': 1586, 'charges': [650, 650, 275, 1200], 'threshold': 1500, 'min_replenish': 1000, 'usage_30d': 6189, 'card_ok': True}, {'balance': 2811, 'replenished': 2, 'first_negative': None})], [({'balance': 1234, 'charges': [650, 3000, 650, 275], 'threshold': 1000, 'min_replenish': 2000, 'usage_30d': 16752, 'card_ok': False}, {'balance': -3341, 'replenished': 0, 'first_negative': 1}), ({'balance': 400, 'charges': [400], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': 0, 'replenished': 0, 'first_negative': None}), ({'balance': 767, 'charges': [3000, 275, 275, 400, 3000, 3000, 275], 'threshold': 1500, 'min_replenish': 2000, 'usage_30d': 18564, 'card_ok': True}, {'balance': 5542, 'replenished': 3, 'first_negative': None}), ({'balance': 3840, 'charges': [275, 275, 1200, 400, 150], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 4963, 'card_ok': True}, {'balance': 1540, 'replenished': 0, 'first_negative': None}), ({'balance': 300, 'charges': [400, 150, 275], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': -525, 'replenished': 0, 'first_negative': 0}), ({'balance': 979, 'charges': [275, 275], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 19904, 'card_ok': True}, {'balance': 5429, 'replenished': 1, 'first_negative': None}), ({'balance': 3921, 'charges': [275, 3000, 275], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 12856, 'card_ok': True}, {'balance': 3871, 'replenished': 1, 'first_negative': None}), ({'balance': 1400, 'charges': [400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 1000, 'replenished': 0, 'first_negative': None})]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check('fee oracle' + ' %d' % i, 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":"64c19f39de5cd1936a34fab2e23b558575196174d93b9769ff8749e45cd7c802","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    bal = x['balance']\n    n = 0\n    first = None\n    amt = max(x['min_replenish'], x['usage_30d'] // 2000 * 500)\n    for i, c in enumerate(x['charges']):\n        bal -= c\n        if bal < x['threshold'] and x['card_ok']:\n            bal += amt\n            n += 1\n        if bal < 0 and first is None:\n            first = i\n    return {'balance': bal, 'replenished': n, 'first_negative': first}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'balance': 1400, 'charges': [400, 150], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 3350, 'replenished': 1, 'first_negative': None}), ({'balance': 2574, 'charges': [3000, 650, 650], 'threshold': 1500, 'min_replenish': 2000, 'usage_30d': 11833, 'card_ok': True}, {'balance': 4274, 'replenished': 2, 'first_negative': None}), ({'balance': 930, 'charges': [3000, 150, 275, 3000, 275, 400, 1200, 650], 'threshold': 1500, 'min_replenish': 2000, 'usage_30d': 7179, 'card_ok': True}, {'balance': 1980, 'replenished': 5, 'first_negative': 0}), ({'balance': 3406, 'charges': [3000, 650, 400, 400, 3000], 'threshold': 1500, 'min_replenish': 1000, 'usage_30d': 19012, 'card_ok': False}, {'balance': -4044, 'replenished': 0, 'first_negative': 1}), ({'balance': 288, 'charges': [3000], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 7617, 'card_ok': False}, {'balance': -2712, 'replenished': 0, 'first_negative': 0}), ({'balance': 300, 'charges': [400, 150, 275], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': -525, 'replenished': 0, 'first_negative': 0}), ({'balance': 324, 'charges': [275, 650, 1200, 1200, 400, 650, 1200, 3000], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 11394, 'card_ok': True}, {'balance': 3749, 'replenished': 4, 'first_negative': None}), ({'balance': 400, 'charges': [400], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': 0, 'replenished': 0, 'first_negative': None})], [({'balance': 1400, 'charges': [400, 150], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 3350, 'replenished': 1, 'first_negative': None}), ({'balance': 2515, 'charges': [400], 'threshold': 1500, 'min_replenish': 2500, 'usage_30d': 3531, 'card_ok': True}, {'balance': 2115, 'replenished': 0, 'first_negative': None}), ({'balance': 400, 'charges': [400], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': 0, 'replenished': 0, 'first_negative': None}), ({'balance': 1219, 'charges': [150, 400, 275, 1200, 275, 275], 'threshold': 500, 'min_replenish': 2500, 'usage_30d': 15594, 'card_ok': False}, {'balance': -1356, 'replenished': 0, 'first_negative': 3}), ({'balance': 412, 'charges': [400, 3000, 650], 'threshold': 500, 'min_replenish': 2500, 'usage_30d': 13088, 'card_ok': True}, {'balance': 3362, 'replenished': 2, 'first_negative': None}), ({'balance': 1400, 'charges': [400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 1000, 'replenished': 0, 'first_negative': None}), ({'balance': 2633, 'charges': [650, 150, 275, 1200, 3000, 150, 400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 12112, 'card_ok': False}, {'balance': -3192, 'replenished': 0, 'first_negative': 4}), ({'balance': 1282, 'charges': [1200, 150, 1200, 150, 3000], 'threshold': 1500, 'min_replenish': 2500, 'usage_30d': 15237, 'card_ok': True}, {'balance': 3582, 'replenished': 2, 'first_negative': None})], [({'balance': 26, 'charges': [150, 1200, 3000, 400], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 19243, 'card_ok': False}, {'balance': -4724, 'replenished': 0, 'first_negative': 0}), ({'balance': 2453, 'charges': [650, 275], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 7993, 'card_ok': True}, {'balance': 1528, 'replenished': 0, 'first_negative': None}), ({'balance': 1400, 'charges': [400, 150], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 3350, 'replenished': 1, 'first_negative': None}), ({'balance': 1341, 'charges': [400, 3000, 275], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 15381, 'card_ok': True}, {'balance': 1666, 'replenished': 1, 'first_negative': None}), ({'balance': -329, 'charges': [3000, 150, 1200, 400], 'threshold': 1500, 'min_replenish': 2500, 'usage_30d': 7527, 'card_ok': True}, {'balance': 2421, 'replenished': 3, 'first_negative': 0}), ({'balance': 300, 'charges': [400, 150, 275], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': -525, 'replenished': 0, 'first_negative': 0}), ({'balance': 552, 'charges': [275, 1200], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 7045, 'card_ok': True}, {'balance': 1077, 'replenished': 1, 'first_negative': None}), ({'balance': 1400, 'charges': [400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 1000, 'replenished': 0, 'first_negative': None})], [({'balance': 2290, 'charges': [1200, 650, 150, 1200, 400, 1200], 'threshold': 1500, 'min_replenish': 2500, 'usage_30d': 6040, 'card_ok': True}, {'balance': 2490, 'replenished': 2, 'first_negative': None}), ({'balance': 2621, 'charges': [3000, 150, 1200, 150], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 17666, 'card_ok': True}, {'balance': 2621, 'replenished': 1, 'first_negative': None}), ({'balance': 2757, 'charges': [1200, 3000, 150], 'threshold': 1500, 'min_replenish': 1000, 'usage_30d': 14481, 'card_ok': False}, {'balance': -1593, 'replenished': 0, 'first_negative': 1}), ({'balance': 777, 'charges': [650, 3000, 400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 17628, 'card_ok': True}, {'balance': 1227, 'replenished': 1, 'first_negative': None}), ({'balance': 1400, 'charges': [400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 1000, 'replenished': 0, 'first_negative': None}), ({'balance': 1400, 'charges': [400, 150], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 3350, 'replenished': 1, 'first_negative': None}), ({'balance': 300, 'charges': [400, 150, 275], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': -525, 'replenished': 0, 'first_negative': 0}), ({'balance': 1586, 'charges': [650, 650, 275, 1200], 'threshold': 1500, 'min_replenish': 1000, 'usage_30d': 6189, 'card_ok': True}, {'balance': 2811, 'replenished': 2, 'first_negative': None})], [({'balance': 1234, 'charges': [650, 3000, 650, 275], 'threshold': 1000, 'min_replenish': 2000, 'usage_30d': 16752, 'card_ok': False}, {'balance': -3341, 'replenished': 0, 'first_negative': 1}), ({'balance': 400, 'charges': [400], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': 0, 'replenished': 0, 'first_negative': None}), ({'balance': 767, 'charges': [3000, 275, 275, 400, 3000, 3000, 275], 'threshold': 1500, 'min_replenish': 2000, 'usage_30d': 18564, 'card_ok': True}, {'balance': 5542, 'replenished': 3, 'first_negative': None}), ({'balance': 3840, 'charges': [275, 275, 1200, 400, 150], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 4963, 'card_ok': True}, {'balance': 1540, 'replenished': 0, 'first_negative': None}), ({'balance': 300, 'charges': [400, 150, 275], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': -525, 'replenished': 0, 'first_negative': 0}), ({'balance': 979, 'charges': [275, 275], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 19904, 'card_ok': True}, {'balance': 5429, 'replenished': 1, 'first_negative': None}), ({'balance': 3921, 'charges': [275, 3000, 275], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 12856, 'card_ok': True}, {'balance': 3871, 'replenished': 1, 'first_negative': None}), ({'balance': 1400, 'charges': [400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 1000, 'replenished': 0, 'first_negative': None})]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check('fee oracle' + ' %d' % i, 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":"e21f920734ddf0f6e066bcc3e60458e10ba274422e857e7c4c393caf65b502b9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    bal = x['balance']\n    n = 0\n    first = None\n    amt = max(x['min_replenish'], -(-x['usage_30d'] // 2000) * 500)\n    for i, c in enumerate(x['charges']):\n        bal -= c\n        if bal < x['threshold'] and x['card_ok']:\n            bal += amt\n            n += 1\n        if bal < 0 and first is None:\n            first = i\n    return {'balance': bal, 'replenished': n, 'first_negative': first}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'balance': 1400, 'charges': [400, 150], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 3350, 'replenished': 1, 'first_negative': None}), ({'balance': 2574, 'charges': [3000, 650, 650], 'threshold': 1500, 'min_replenish': 2000, 'usage_30d': 11833, 'card_ok': True}, {'balance': 4274, 'replenished': 2, 'first_negative': None}), ({'balance': 930, 'charges': [3000, 150, 275, 3000, 275, 400, 1200, 650], 'threshold': 1500, 'min_replenish': 2000, 'usage_30d': 7179, 'card_ok': True}, {'balance': 1980, 'replenished': 5, 'first_negative': 0}), ({'balance': 3406, 'charges': [3000, 650, 400, 400, 3000], 'threshold': 1500, 'min_replenish': 1000, 'usage_30d': 19012, 'card_ok': False}, {'balance': -4044, 'replenished': 0, 'first_negative': 1}), ({'balance': 288, 'charges': [3000], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 7617, 'card_ok': False}, {'balance': -2712, 'replenished': 0, 'first_negative': 0}), ({'balance': 300, 'charges': [400, 150, 275], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': -525, 'replenished': 0, 'first_negative': 0}), ({'balance': 324, 'charges': [275, 650, 1200, 1200, 400, 650, 1200, 3000], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 11394, 'card_ok': True}, {'balance': 3749, 'replenished': 4, 'first_negative': None}), ({'balance': 400, 'charges': [400], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': 0, 'replenished': 0, 'first_negative': None})], [({'balance': 1400, 'charges': [400, 150], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 3350, 'replenished': 1, 'first_negative': None}), ({'balance': 2515, 'charges': [400], 'threshold': 1500, 'min_replenish': 2500, 'usage_30d': 3531, 'card_ok': True}, {'balance': 2115, 'replenished': 0, 'first_negative': None}), ({'balance': 400, 'charges': [400], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': 0, 'replenished': 0, 'first_negative': None}), ({'balance': 1219, 'charges': [150, 400, 275, 1200, 275, 275], 'threshold': 500, 'min_replenish': 2500, 'usage_30d': 15594, 'card_ok': False}, {'balance': -1356, 'replenished': 0, 'first_negative': 3}), ({'balance': 412, 'charges': [400, 3000, 650], 'threshold': 500, 'min_replenish': 2500, 'usage_30d': 13088, 'card_ok': True}, {'balance': 3362, 'replenished': 2, 'first_negative': None}), ({'balance': 1400, 'charges': [400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 1000, 'replenished': 0, 'first_negative': None}), ({'balance': 2633, 'charges': [650, 150, 275, 1200, 3000, 150, 400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 12112, 'card_ok': False}, {'balance': -3192, 'replenished': 0, 'first_negative': 4}), ({'balance': 1282, 'charges': [1200, 150, 1200, 150, 3000], 'threshold': 1500, 'min_replenish': 2500, 'usage_30d': 15237, 'card_ok': True}, {'balance': 3582, 'replenished': 2, 'first_negative': None})], [({'balance': 26, 'charges': [150, 1200, 3000, 400], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 19243, 'card_ok': False}, {'balance': -4724, 'replenished': 0, 'first_negative': 0}), ({'balance': 2453, 'charges': [650, 275], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 7993, 'card_ok': True}, {'balance': 1528, 'replenished': 0, 'first_negative': None}), ({'balance': 1400, 'charges': [400, 150], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 3350, 'replenished': 1, 'first_negative': None}), ({'balance': 1341, 'charges': [400, 3000, 275], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 15381, 'card_ok': True}, {'balance': 1666, 'replenished': 1, 'first_negative': None}), ({'balance': -329, 'charges': [3000, 150, 1200, 400], 'threshold': 1500, 'min_replenish': 2500, 'usage_30d': 7527, 'card_ok': True}, {'balance': 2421, 'replenished': 3, 'first_negative': 0}), ({'balance': 300, 'charges': [400, 150, 275], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': -525, 'replenished': 0, 'first_negative': 0}), ({'balance': 552, 'charges': [275, 1200], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 7045, 'card_ok': True}, {'balance': 1077, 'replenished': 1, 'first_negative': None}), ({'balance': 1400, 'charges': [400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 1000, 'replenished': 0, 'first_negative': None})], [({'balance': 2290, 'charges': [1200, 650, 150, 1200, 400, 1200], 'threshold': 1500, 'min_replenish': 2500, 'usage_30d': 6040, 'card_ok': True}, {'balance': 2490, 'replenished': 2, 'first_negative': None}), ({'balance': 2621, 'charges': [3000, 150, 1200, 150], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 17666, 'card_ok': True}, {'balance': 2621, 'replenished': 1, 'first_negative': None}), ({'balance': 2757, 'charges': [1200, 3000, 150], 'threshold': 1500, 'min_replenish': 1000, 'usage_30d': 14481, 'card_ok': False}, {'balance': -1593, 'replenished': 0, 'first_negative': 1}), ({'balance': 777, 'charges': [650, 3000, 400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 17628, 'card_ok': True}, {'balance': 1227, 'replenished': 1, 'first_negative': None}), ({'balance': 1400, 'charges': [400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 1000, 'replenished': 0, 'first_negative': None}), ({'balance': 1400, 'charges': [400, 150], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 3350, 'replenished': 1, 'first_negative': None}), ({'balance': 300, 'charges': [400, 150, 275], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': -525, 'replenished': 0, 'first_negative': 0}), ({'balance': 1586, 'charges': [650, 650, 275, 1200], 'threshold': 1500, 'min_replenish': 1000, 'usage_30d': 6189, 'card_ok': True}, {'balance': 2811, 'replenished': 2, 'first_negative': None})], [({'balance': 1234, 'charges': [650, 3000, 650, 275], 'threshold': 1000, 'min_replenish': 2000, 'usage_30d': 16752, 'card_ok': False}, {'balance': -3341, 'replenished': 0, 'first_negative': 1}), ({'balance': 400, 'charges': [400], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': 0, 'replenished': 0, 'first_negative': None}), ({'balance': 767, 'charges': [3000, 275, 275, 400, 3000, 3000, 275], 'threshold': 1500, 'min_replenish': 2000, 'usage_30d': 18564, 'card_ok': True}, {'balance': 5542, 'replenished': 3, 'first_negative': None}), ({'balance': 3840, 'charges': [275, 275, 1200, 400, 150], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 4963, 'card_ok': True}, {'balance': 1540, 'replenished': 0, 'first_negative': None}), ({'balance': 300, 'charges': [400, 150, 275], 'threshold': 500, 'min_replenish': 1000, 'usage_30d': 0, 'card_ok': False}, {'balance': -525, 'replenished': 0, 'first_negative': 0}), ({'balance': 979, 'charges': [275, 275], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 19904, 'card_ok': True}, {'balance': 5429, 'replenished': 1, 'first_negative': None}), ({'balance': 3921, 'charges': [275, 3000, 275], 'threshold': 1000, 'min_replenish': 2500, 'usage_30d': 12856, 'card_ok': True}, {'balance': 3871, 'replenished': 1, 'first_negative': None}), ({'balance': 1400, 'charges': [400], 'threshold': 1000, 'min_replenish': 1000, 'usage_30d': 9000, 'card_ok': True}, {'balance': 1000, 'replenished': 0, 'first_negative': None})]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check('fee oracle' + ' %d' % i, 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":"A deterministic, bounded toy model with a stipulated contract; it makes no claim of conformance to any agency manual or standard. 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-toll_and_parking_fee_computation-auto-replenish-amount-rounding","generated_at":"2026-09-29T14:48:03.869083+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Fee engines bill customers in integer cents; a wrong boundary, rounding stage or cap scope silently over- or under-charges.","repair":"Restore the replenish amount rounding rule so that the step reads `-(-x['usage_30d'] // 2000) * 500`.","root_cause":"Flooring to 500 cents sizes replenishments below a quarter of monthly usage.","sha256":"551ff772d7cf2bf73d5a0acc13864a58f153177d7b9e10df67cebf2fd704d1d7","title":"Prepaid toll account auto-replenishment: the usage-based amount is floored to 500 · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.686,"exit_code":1,"observations":[{"actual":{"balance":3100,"first_negative":null,"replenished":1},"check":"fee oracle 0","expected":{"balance":3350,"first_negative":null,"replenished":1},"passed":false},{"actual":{"balance":4192,"first_negative":null,"replenished":2},"check":"fee oracle 1","expected":{"balance":4274,"first_negative":null,"replenished":2},"passed":false},{"actual":{"balance":1980,"first_negative":0,"replenished":5},"check":"fee oracle 2","expected":{"balance":1980,"first_negative":0,"replenished":5},"passed":true},{"actual":{"balance":-4044,"first_negative":1,"replenished":0},"check":"fee oracle 3","expected":{"balance":-4044,"first_negative":1,"replenished":0},"passed":true},{"actual":{"balance":-2712,"first_negative":0,"replenished":0},"check":"fee oracle 4","expected":{"balance":-2712,"first_negative":0,"replenished":0},"passed":true},{"actual":{"balance":-525,"first_negative":0,"replenished":0},"check":"fee oracle 5","expected":{"balance":-525,"first_negative":0,"replenished":0},"passed":true},{"actual":{"balance":3145,"first_negative":null,"replenished":4},"check":"fee oracle 6","expected":{"balance":3749,"first_negative":null,"replenished":4},"passed":false},{"actual":{"balance":0,"first_negative":null,"replenished":0},"check":"fee oracle 7","expected":{"balance":0,"first_negative":null,"replenished":0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fee oracle 0\", \"actual\": {\"balance\": 3100, \"replenished\": 1, \"first_negative\": null}, \"expected\": {\"balance\": 3350, \"replenished\": 1, \"first_negative\": null}, \"passed\": false}, {\"check\": \"fee oracle 1\", \"actual\": {\"balance\": 4192, \"replenished\": 2, \"first_negative\": null}, \"expected\": {\"balance\": 4274, \"replenished\": 2, \"first_negative\": null}, \"passed\": false}, {\"check\": \"fee oracle 2\", \"actual\": {\"balance\": 1980, \"replenished\": 5, \"first_negative\": 0}, \"expected\": {\"balance\": 1980, \"replenished\": 5, \"first_negative\": 0}, \"passed\": true}, {\"check\": \"fee oracle 3\", \"actual\": {\"balance\": -4044, \"replenished\": 0, \"first_negative\": 1}, \"expected\": {\"balance\": -4044, \"replenished\": 0, \"first_negative\": 1}, \"passed\": true}, {\"check\": \"fee oracle 4\", \"actual\": {\"balance\": -2712, \"replenished\": 0, \"first_negative\": 0}, \"expected\": {\"balance\": -2712, \"replenished\": 0, \"first_negative\": 0}, \"passed\": true}, {\"check\": \"fee oracle 5\", \"actual\": {\"balance\": -525, \"replenished\": 0, \"first_negative\": 0}, \"expected\": {\"balance\": -525, \"replenished\": 0, \"first_negative\": 0}, \"passed\": true}, {\"check\": \"fee oracle 6\", \"actual\": {\"balance\": 3145, \"replenished\": 4, \"first_negative\": null}, \"expected\": {\"balance\": 3749, \"replenished\": 4, \"first_negative\": null}, \"passed\": false}, {\"check\": \"fee oracle 7\", \"actual\": {\"balance\": 0, \"replenished\": 0, \"first_negative\": null}, \"expected\": {\"balance\": 0, \"replenished\": 0, \"first_negative\": null}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.796,"exit_code":1,"observations":[{"actual":{"balance":2850,"first_negative":null,"replenished":1},"check":"fee oracle 0","expected":{"balance":3350,"first_negative":null,"replenished":1},"passed":false},{"actual":{"balance":3274,"first_negative":null,"replenished":2},"check":"fee oracle 1","expected":{"balance":4274,"first_negative":null,"replenished":2},"passed":false},{"actual":{"balance":1980,"first_negative":0,"replenished":5},"check":"fee oracle 2","expected":{"balance":1980,"first_negative":0,"replenished":5},"passed":true},{"actual":{"balance":-4044,"first_negative":1,"replenished":0},"check":"fee oracle 3","expected":{"balance":-4044,"first_negative":1,"replenished":0},"passed":true},{"actual":{"balance":-2712,"first_negative":0,"replenished":0},"check":"fee oracle 4","expected":{"balance":-2712,"first_negative":0,"replenished":0},"passed":true},{"actual":{"balance":-525,"first_negative":0,"replenished":0},"check":"fee oracle 5","expected":{"balance":-525,"first_negative":0,"replenished":0},"passed":true},{"actual":{"balance":1749,"first_negative":null,"replenished":4},"check":"fee oracle 6","expected":{"balance":3749,"first_negative":null,"replenished":4},"passed":false},{"actual":{"balance":0,"first_negative":null,"replenished":0},"check":"fee oracle 7","expected":{"balance":0,"first_negative":null,"replenished":0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fee oracle 0\", \"actual\": {\"balance\": 2850, \"replenished\": 1, \"first_negative\": null}, \"expected\": {\"balance\": 3350, \"replenished\": 1, \"first_negative\": null}, \"passed\": false}, {\"check\": \"fee oracle 1\", \"actual\": {\"balance\": 3274, \"replenished\": 2, \"first_negative\": null}, \"expected\": {\"balance\": 4274, \"replenished\": 2, \"first_negative\": null}, \"passed\": false}, {\"check\": \"fee oracle 2\", \"actual\": {\"balance\": 1980, \"replenished\": 5, \"first_negative\": 0}, \"expected\": {\"balance\": 1980, \"replenished\": 5, \"first_negative\": 0}, \"passed\": true}, {\"check\": \"fee oracle 3\", \"actual\": {\"balance\": -4044, \"replenished\": 0, \"first_negative\": 1}, \"expected\": {\"balance\": -4044, \"replenished\": 0, \"first_negative\": 1}, \"passed\": true}, {\"check\": \"fee oracle 4\", \"actual\": {\"balance\": -2712, \"replenished\": 0, \"first_negative\": 0}, \"expected\": {\"balance\": -2712, \"replenished\": 0, \"first_negative\": 0}, \"passed\": true}, {\"check\": \"fee oracle 5\", \"actual\": {\"balance\": -525, \"replenished\": 0, \"first_negative\": 0}, \"expected\": {\"balance\": -525, \"replenished\": 0, \"first_negative\": 0}, \"passed\": true}, {\"check\": \"fee oracle 6\", \"actual\": {\"balance\": 1749, \"replenished\": 4, \"first_negative\": null}, \"expected\": {\"balance\": 3749, \"replenished\": 4, \"first_negative\": null}, \"passed\": false}, {\"check\": \"fee oracle 7\", \"actual\": {\"balance\": 0, \"replenished\": 0, \"first_negative\": null}, \"expected\": {\"balance\": 0, \"replenished\": 0, \"first_negative\": null}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.225,"exit_code":0,"observations":[{"actual":{"balance":3350,"first_negative":null,"replenished":1},"check":"fee oracle 0","expected":{"balance":3350,"first_negative":null,"replenished":1},"passed":true},{"actual":{"balance":4274,"first_negative":null,"replenished":2},"check":"fee oracle 1","expected":{"balance":4274,"first_negative":null,"replenished":2},"passed":true},{"actual":{"balance":1980,"first_negative":0,"replenished":5},"check":"fee oracle 2","expected":{"balance":1980,"first_negative":0,"replenished":5},"passed":true},{"actual":{"balance":-4044,"first_negative":1,"replenished":0},"check":"fee oracle 3","expected":{"balance":-4044,"first_negative":1,"replenished":0},"passed":true},{"actual":{"balance":-2712,"first_negative":0,"replenished":0},"check":"fee oracle 4","expected":{"balance":-2712,"first_negative":0,"replenished":0},"passed":true},{"actual":{"balance":-525,"first_negative":0,"replenished":0},"check":"fee oracle 5","expected":{"balance":-525,"first_negative":0,"replenished":0},"passed":true},{"actual":{"balance":3749,"first_negative":null,"replenished":4},"check":"fee oracle 6","expected":{"balance":3749,"first_negative":null,"replenished":4},"passed":true},{"actual":{"balance":0,"first_negative":null,"replenished":0},"check":"fee oracle 7","expected":{"balance":0,"first_negative":null,"replenished":0},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fee oracle 0\", \"actual\": {\"balance\": 3350, \"replenished\": 1, \"first_negative\": null}, \"expected\": {\"balance\": 3350, \"replenished\": 1, \"first_negative\": null}, \"passed\": true}, {\"check\": \"fee oracle 1\", \"actual\": {\"balance\": 4274, \"replenished\": 2, \"first_negative\": null}, \"expected\": {\"balance\": 4274, \"replenished\": 2, \"first_negative\": null}, \"passed\": true}, {\"check\": \"fee oracle 2\", \"actual\": {\"balance\": 1980, \"replenished\": 5, \"first_negative\": 0}, \"expected\": {\"balance\": 1980, \"replenished\": 5, \"first_negative\": 0}, \"passed\": true}, {\"check\": \"fee oracle 3\", \"actual\": {\"balance\": -4044, \"replenished\": 0, \"first_negative\": 1}, \"expected\": {\"balance\": -4044, \"replenished\": 0, \"first_negative\": 1}, \"passed\": true}, {\"check\": \"fee oracle 4\", \"actual\": {\"balance\": -2712, \"replenished\": 0, \"first_negative\": 0}, \"expected\": {\"balance\": -2712, \"replenished\": 0, \"first_negative\": 0}, \"passed\": true}, {\"check\": \"fee oracle 5\", \"actual\": {\"balance\": -525, \"replenished\": 0, \"first_negative\": 0}, \"expected\": {\"balance\": -525, \"replenished\": 0, \"first_negative\": 0}, \"passed\": true}, {\"check\": \"fee oracle 6\", \"actual\": {\"balance\": 3749, \"replenished\": 4, \"first_negative\": null}, \"expected\": {\"balance\": 3749, \"replenished\": 4, \"first_negative\": null}, \"passed\": true}, {\"check\": \"fee oracle 7\", \"actual\": {\"balance\": 0, \"replenished\": 0, \"first_negative\": null}, \"expected\": {\"balance\": 0, \"replenished\": 0, \"first_negative\": null}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}