{"abstract":"Time-band rate with calendar day cap returns a wrong result when the daily maximum caps the whole stay once.","category":"Toll and parking fee computation","checks":8,"contract":"Input {bands: [[start minute of day, cents per quarter hour]] sorted with first start 0, entry, exit (absolute minutes), daily_max}. Minutes of the stay are totalled per calendar day and band; each total is rounded up to whole quarter hours and priced at its band rate. Each calendar day's charge is capped at daily_max.","contract_signature":"x","evaluation_group":"w2-toll_and_parking_fee_computation-time-band-rate","failed_approach":"Removing the cap overcharges any day whose band charges exceed daily_max.","family":"w2-toll_and_parking_fee_computation-time-band-rate-day-cap-scope","id":"FA-68441","implementations":{"attempt":{"sha256":"40e56b14fac00158054b439515ef3a5e2fb87a4bb75527f22f19a5e36c20b6c6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    bands = x['bands']\n    per = {}\n    t = x['entry']\n    while t < x['exit']:\n        day, tod = divmod(t, 1440)\n        i = max(k for k in range(len(bands)) if bands[k][0] <= tod)\n        nxt = bands[i + 1][0] if i + 1 < len(bands) else 1440\n        step = min(x['exit'] - t, nxt - tod)\n        key = (day, bands[i][1])\n        per[key] = per.get(key, 0) + step\n        t += step\n    days = {}\n    for (day, rate), m in per.items():\n        days[day] = days.get(day, 0) + -(-m // 15) * rate\n    return sum(days.values())\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'bands': [[0, 25], [1290, 50]], 'entry': 895, 'exit': 2743, 'daily_max': 2500}, 3375), ({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 50], [60, 25], [900, 50], [1410, 50]], 'entry': 1980, 'exit': 2097, 'daily_max': 1500}, 200), ({'bands': [[0, 50], [390, 50], [810, 100]], 'entry': 261, 'exit': 1911, 'daily_max': 1500}, 3000), ({'bands': [[0, 25], [1410, 25]], 'entry': 43, 'exit': 1160, 'daily_max': 1500}, 1500), ({'bands': [[0, 25], [360, 100], [570, 50], [750, 25]], 'entry': 1882, 'exit': 4277, 'daily_max': 1500}, 3000)], [({'bands': [[0, 25], [1260, 100], [1410, 50]], 'entry': 202, 'exit': 2677, 'daily_max': 1500}, 3000), ({'bands': [[0, 25], [780, 50]], 'entry': 342, 'exit': 1611, 'daily_max': 1500}, 1800), ({'bands': [[0, 25], [1140, 50]], 'entry': 231, 'exit': 350, 'daily_max': 4000}, 200), ({'bands': [[0, 50], [270, 100], [570, 50], [1200, 25]], 'entry': 833, 'exit': 1582, 'daily_max': 2500}, 2150), ({'bands': [[0, 25], [750, 100]], 'entry': 788, 'exit': 1556, 'daily_max': 4000}, 4200), ({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500)], [({'bands': [[0, 25], [330, 100], [990, 100]], 'entry': 1845, 'exit': 1894, 'daily_max': 4000}, 400), ({'bands': [[0, 50], [750, 50], [1110, 25]], 'entry': 602, 'exit': 2580, 'daily_max': 1500}, 3000), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 50], [270, 25], [390, 50], [930, 100]], 'entry': 1006, 'exit': 2590, 'daily_max': 2500}, 5000), ({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 50], [450, 50], [1050, 25]], 'entry': 1879, 'exit': 4090, 'daily_max': 2500}, 5000), ({'bands': [[0, 25], [90, 100], [1230, 100]], 'entry': 1447, 'exit': 1546, 'daily_max': 1500}, 350)], [({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [150, 50], [300, 100], [1260, 100]], 'entry': 268, 'exit': 1452, 'daily_max': 4000}, 4025), ({'bands': [[0, 50], [210, 50], [840, 100], [1170, 50]], 'entry': 1552, 'exit': 4168, 'daily_max': 2500}, 5000), ({'bands': [[0, 25], [180, 25], [1260, 50]], 'entry': 1244, 'exit': 3629, 'daily_max': 4000}, 4600), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 25], [780, 50]], 'entry': 1711, 'exit': 2270, 'daily_max': 4000}, 1050), ({'bands': [[0, 25], [420, 50]], 'entry': 1579, 'exit': 1614, 'daily_max': 1500}, 75)], [({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [180, 25], [900, 50], [1230, 100]], 'entry': 310, 'exit': 2308, 'daily_max': 2500}, 3950), ({'bands': [[0, 25], [1170, 50]], 'entry': 263, 'exit': 547, 'daily_max': 1500}, 475), ({'bands': [[0, 25], [270, 25], [660, 50]], 'entry': 200, 'exit': 1095, 'daily_max': 2500}, 2225), ({'bands': [[0, 25], [1230, 100]], 'entry': 1750, 'exit': 4442, 'daily_max': 2500}, 5225), ({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 25], [90, 50], [270, 50]], 'entry': 291, 'exit': 1639, 'daily_max': 1500}, 2050)]]\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":"1c574f8715f8ef95fb6e2f218b6aa15d5e74d786c971d076c7d321c6f4905e72","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    bands = x['bands']\n    per = {}\n    t = x['entry']\n    while t < x['exit']:\n        day, tod = divmod(t, 1440)\n        i = max(k for k in range(len(bands)) if bands[k][0] <= tod)\n        nxt = bands[i + 1][0] if i + 1 < len(bands) else 1440\n        step = min(x['exit'] - t, nxt - tod)\n        key = (day, bands[i][1])\n        per[key] = per.get(key, 0) + step\n        t += step\n    days = {}\n    for (day, rate), m in per.items():\n        days[day] = days.get(day, 0) + -(-m // 15) * rate\n    return min(sum(days.values()), x['daily_max'])\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'bands': [[0, 25], [1290, 50]], 'entry': 895, 'exit': 2743, 'daily_max': 2500}, 3375), ({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 50], [60, 25], [900, 50], [1410, 50]], 'entry': 1980, 'exit': 2097, 'daily_max': 1500}, 200), ({'bands': [[0, 50], [390, 50], [810, 100]], 'entry': 261, 'exit': 1911, 'daily_max': 1500}, 3000), ({'bands': [[0, 25], [1410, 25]], 'entry': 43, 'exit': 1160, 'daily_max': 1500}, 1500), ({'bands': [[0, 25], [360, 100], [570, 50], [750, 25]], 'entry': 1882, 'exit': 4277, 'daily_max': 1500}, 3000)], [({'bands': [[0, 25], [1260, 100], [1410, 50]], 'entry': 202, 'exit': 2677, 'daily_max': 1500}, 3000), ({'bands': [[0, 25], [780, 50]], 'entry': 342, 'exit': 1611, 'daily_max': 1500}, 1800), ({'bands': [[0, 25], [1140, 50]], 'entry': 231, 'exit': 350, 'daily_max': 4000}, 200), ({'bands': [[0, 50], [270, 100], [570, 50], [1200, 25]], 'entry': 833, 'exit': 1582, 'daily_max': 2500}, 2150), ({'bands': [[0, 25], [750, 100]], 'entry': 788, 'exit': 1556, 'daily_max': 4000}, 4200), ({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500)], [({'bands': [[0, 25], [330, 100], [990, 100]], 'entry': 1845, 'exit': 1894, 'daily_max': 4000}, 400), ({'bands': [[0, 50], [750, 50], [1110, 25]], 'entry': 602, 'exit': 2580, 'daily_max': 1500}, 3000), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 50], [270, 25], [390, 50], [930, 100]], 'entry': 1006, 'exit': 2590, 'daily_max': 2500}, 5000), ({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 50], [450, 50], [1050, 25]], 'entry': 1879, 'exit': 4090, 'daily_max': 2500}, 5000), ({'bands': [[0, 25], [90, 100], [1230, 100]], 'entry': 1447, 'exit': 1546, 'daily_max': 1500}, 350)], [({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [150, 50], [300, 100], [1260, 100]], 'entry': 268, 'exit': 1452, 'daily_max': 4000}, 4025), ({'bands': [[0, 50], [210, 50], [840, 100], [1170, 50]], 'entry': 1552, 'exit': 4168, 'daily_max': 2500}, 5000), ({'bands': [[0, 25], [180, 25], [1260, 50]], 'entry': 1244, 'exit': 3629, 'daily_max': 4000}, 4600), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 25], [780, 50]], 'entry': 1711, 'exit': 2270, 'daily_max': 4000}, 1050), ({'bands': [[0, 25], [420, 50]], 'entry': 1579, 'exit': 1614, 'daily_max': 1500}, 75)], [({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [180, 25], [900, 50], [1230, 100]], 'entry': 310, 'exit': 2308, 'daily_max': 2500}, 3950), ({'bands': [[0, 25], [1170, 50]], 'entry': 263, 'exit': 547, 'daily_max': 1500}, 475), ({'bands': [[0, 25], [270, 25], [660, 50]], 'entry': 200, 'exit': 1095, 'daily_max': 2500}, 2225), ({'bands': [[0, 25], [1230, 100]], 'entry': 1750, 'exit': 4442, 'daily_max': 2500}, 5225), ({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 25], [90, 50], [270, 50]], 'entry': 291, 'exit': 1639, 'daily_max': 1500}, 2050)]]\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-time-band-rate-day-cap-scope","generated_at":"2026-09-29T14:48:02.216291+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.","root_cause":"Multi-day stays are capped at a single daily maximum.","sha256":"00b925d13a4a28bcedd79bbc8712c8a865e6394ee4a590137dc714b898cf95f5","title":"Time-band rate with calendar day cap: the daily maximum caps the whole stay once · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":41.733,"exit_code":1,"observations":[{"actual":3375,"check":"fee oracle 0","expected":3375,"passed":true},{"actual":4550,"check":"fee oracle 1","expected":4550,"passed":true},{"actual":500,"check":"fee oracle 2","expected":500,"passed":true},{"actual":4550,"check":"fee oracle 3","expected":4000,"passed":false},{"actual":200,"check":"fee oracle 4","expected":200,"passed":true},{"actual":7650,"check":"fee oracle 5","expected":3000,"passed":false},{"actual":1875,"check":"fee oracle 6","expected":1500,"passed":false},{"actual":6350,"check":"fee oracle 7","expected":3000,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fee oracle 0\", \"actual\": 3375, \"expected\": 3375, \"passed\": true}, {\"check\": \"fee oracle 1\", \"actual\": 4550, \"expected\": 4550, \"passed\": true}, {\"check\": \"fee oracle 2\", \"actual\": 500, \"expected\": 500, \"passed\": true}, {\"check\": \"fee oracle 3\", \"actual\": 4550, \"expected\": 4000, \"passed\": false}, {\"check\": \"fee oracle 4\", \"actual\": 200, \"expected\": 200, \"passed\": true}, {\"check\": \"fee oracle 5\", \"actual\": 7650, \"expected\": 3000, \"passed\": false}, {\"check\": \"fee oracle 6\", \"actual\": 1875, \"expected\": 1500, \"passed\": false}, {\"check\": \"fee oracle 7\", \"actual\": 6350, \"expected\": 3000, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.943,"exit_code":1,"observations":[{"actual":2500,"check":"fee oracle 0","expected":3375,"passed":false},{"actual":4550,"check":"fee oracle 1","expected":4550,"passed":true},{"actual":500,"check":"fee oracle 2","expected":500,"passed":true},{"actual":4000,"check":"fee oracle 3","expected":4000,"passed":true},{"actual":200,"check":"fee oracle 4","expected":200,"passed":true},{"actual":1500,"check":"fee oracle 5","expected":3000,"passed":false},{"actual":1500,"check":"fee oracle 6","expected":1500,"passed":true},{"actual":1500,"check":"fee oracle 7","expected":3000,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fee oracle 0\", \"actual\": 2500, \"expected\": 3375, \"passed\": false}, {\"check\": \"fee oracle 1\", \"actual\": 4550, \"expected\": 4550, \"passed\": true}, {\"check\": \"fee oracle 2\", \"actual\": 500, \"expected\": 500, \"passed\": true}, {\"check\": \"fee oracle 3\", \"actual\": 4000, \"expected\": 4000, \"passed\": true}, {\"check\": \"fee oracle 4\", \"actual\": 200, \"expected\": 200, \"passed\": true}, {\"check\": \"fee oracle 5\", \"actual\": 1500, \"expected\": 3000, \"passed\": false}, {\"check\": \"fee oracle 6\", \"actual\": 1500, \"expected\": 1500, \"passed\": true}, {\"check\": \"fee oracle 7\", \"actual\": 1500, \"expected\": 3000, \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}