{"abstract":"Time-band rate with calendar day cap returns a wrong result when the last segment runs to the band boundary.","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":"Counting the exit minute inclusively adds one minute to every stay.","family":"w2-toll_and_parking_fee_computation-time-band-rate-exit-clip","id":"FA-68436","implementations":{"attempt":{"sha256":"e595d2bbc944866270d0a7f4d0c0fdb10e0088821a4e3be04813c66905bf5df0","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 + 1, 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(min(v, x['daily_max']) for v in days.values())\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'bands': [[0, 25], [270, 100], [990, 50]], 'entry': 868, 'exit': 1042, 'daily_max': 4000}, 1100), ({'bands': [[0, 50], [240, 100]], 'entry': 589, 'exit': 1071, 'daily_max': 2500}, 2500), ({'bands': [[0, 50], [240, 100], [270, 50], [1290, 100]], 'entry': 917, 'exit': 3111, 'daily_max': 4000}, 7050), ({'bands': [[0, 25], [720, 50], [1170, 50]], 'entry': 1295, 'exit': 3926, 'daily_max': 1500}, 3500), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 25], [540, 50], [570, 50], [750, 50]], 'entry': 839, 'exit': 955, 'daily_max': 4000}, 400), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000)], [({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 50], [420, 25], [870, 50]], 'entry': 1876, 'exit': 2012, 'daily_max': 4000}, 250), ({'bands': [[0, 50], [240, 25]], 'entry': 1263, 'exit': 2110, 'daily_max': 1500}, 1800), ({'bands': [[0, 25], [90, 100]], 'entry': 1185, 'exit': 1824, 'daily_max': 4000}, 3850), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [1050, 100], [1110, 100]], 'entry': 1397, 'exit': 4275, 'daily_max': 4000}, 8300), ({'bands': [[0, 50], [630, 25], [870, 50], [1020, 25]], 'entry': 1314, 'exit': 2055, 'daily_max': 1500}, 1725), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000)], [({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 50], [90, 50], [1080, 25]], 'entry': 162, 'exit': 368, 'daily_max': 1500}, 700), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 50], [180, 100], [330, 100]], 'entry': 1920, 'exit': 4850, 'daily_max': 1500}, 4500), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 50], [90, 100], [900, 50]], 'entry': 462, 'exit': 2519, 'daily_max': 2500}, 5000), ({'bands': [[0, 50], [570, 100], [630, 100], [1020, 25]], 'entry': 1999, 'exit': 2569, 'daily_max': 4000}, 3250), ({'bands': [[0, 25], [390, 100], [540, 25], [720, 100]], 'entry': 440, 'exit': 1260, 'daily_max': 2500}, 2500)], [({'bands': [[0, 50], [90, 50], [1110, 100]], 'entry': 314, 'exit': 1024, 'daily_max': 1500}, 1500), ({'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], [120, 50], [810, 50], [1260, 50]], 'entry': 224, 'exit': 385, 'daily_max': 2500}, 550), ({'bands': [[0, 50], [210, 100]], 'entry': 1190, 'exit': 3970, 'daily_max': 2500}, 6700), ({'bands': [[0, 50], [60, 50], [150, 100], [240, 100]], 'entry': 1440, 'exit': 1620, 'daily_max': 1500}, 700), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 50], [180, 25], [510, 100], [1200, 50]], 'entry': 352, 'exit': 507, 'daily_max': 1500}, 275)], [({'bands': [[0, 25], [180, 100]], 'entry': 314, 'exit': 666, 'daily_max': 2500}, 2400), ({'bands': [[0, 50], [270, 25], [570, 25]], 'entry': 1749, 'exit': 1907, 'daily_max': 4000}, 275), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 50], [690, 25]], 'entry': 1544, 'exit': 2485, 'daily_max': 2500}, 2500), ({'bands': [[0, 25], [90, 100], [690, 25]], 'entry': 1551, 'exit': 2298, 'daily_max': 2500}, 2500), ({'bands': [[0, 50], [1080, 25], [1170, 100]], 'entry': 785, 'exit': 1295, 'daily_max': 1500}, 1500), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000)]]\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":"f38d1132b7f4bfc9a467dd637e2b346f884d73b657fe3692287e01a436611ec7","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 = 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(min(v, x['daily_max']) for v in days.values())\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'bands': [[0, 25], [270, 100], [990, 50]], 'entry': 868, 'exit': 1042, 'daily_max': 4000}, 1100), ({'bands': [[0, 50], [240, 100]], 'entry': 589, 'exit': 1071, 'daily_max': 2500}, 2500), ({'bands': [[0, 50], [240, 100], [270, 50], [1290, 100]], 'entry': 917, 'exit': 3111, 'daily_max': 4000}, 7050), ({'bands': [[0, 25], [720, 50], [1170, 50]], 'entry': 1295, 'exit': 3926, 'daily_max': 1500}, 3500), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 25], [540, 50], [570, 50], [750, 50]], 'entry': 839, 'exit': 955, 'daily_max': 4000}, 400), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000)], [({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 50], [420, 25], [870, 50]], 'entry': 1876, 'exit': 2012, 'daily_max': 4000}, 250), ({'bands': [[0, 50], [240, 25]], 'entry': 1263, 'exit': 2110, 'daily_max': 1500}, 1800), ({'bands': [[0, 25], [90, 100]], 'entry': 1185, 'exit': 1824, 'daily_max': 4000}, 3850), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [1050, 100], [1110, 100]], 'entry': 1397, 'exit': 4275, 'daily_max': 4000}, 8300), ({'bands': [[0, 50], [630, 25], [870, 50], [1020, 25]], 'entry': 1314, 'exit': 2055, 'daily_max': 1500}, 1725), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000)], [({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 50], [90, 50], [1080, 25]], 'entry': 162, 'exit': 368, 'daily_max': 1500}, 700), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 50], [180, 100], [330, 100]], 'entry': 1920, 'exit': 4850, 'daily_max': 1500}, 4500), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 50], [90, 100], [900, 50]], 'entry': 462, 'exit': 2519, 'daily_max': 2500}, 5000), ({'bands': [[0, 50], [570, 100], [630, 100], [1020, 25]], 'entry': 1999, 'exit': 2569, 'daily_max': 4000}, 3250), ({'bands': [[0, 25], [390, 100], [540, 25], [720, 100]], 'entry': 440, 'exit': 1260, 'daily_max': 2500}, 2500)], [({'bands': [[0, 50], [90, 50], [1110, 100]], 'entry': 314, 'exit': 1024, 'daily_max': 1500}, 1500), ({'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], [120, 50], [810, 50], [1260, 50]], 'entry': 224, 'exit': 385, 'daily_max': 2500}, 550), ({'bands': [[0, 50], [210, 100]], 'entry': 1190, 'exit': 3970, 'daily_max': 2500}, 6700), ({'bands': [[0, 50], [60, 50], [150, 100], [240, 100]], 'entry': 1440, 'exit': 1620, 'daily_max': 1500}, 700), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 50], [180, 25], [510, 100], [1200, 50]], 'entry': 352, 'exit': 507, 'daily_max': 1500}, 275)], [({'bands': [[0, 25], [180, 100]], 'entry': 314, 'exit': 666, 'daily_max': 2500}, 2400), ({'bands': [[0, 50], [270, 25], [570, 25]], 'entry': 1749, 'exit': 1907, 'daily_max': 4000}, 275), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 50], [690, 25]], 'entry': 1544, 'exit': 2485, 'daily_max': 2500}, 2500), ({'bands': [[0, 25], [90, 100], [690, 25]], 'entry': 1551, 'exit': 2298, 'daily_max': 2500}, 2500), ({'bands': [[0, 50], [1080, 25], [1170, 100]], 'entry': 785, 'exit': 1295, 'daily_max': 1500}, 1500), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000)]]\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-exit-clip","generated_at":"2026-09-29T14:48:02.188103+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":"The final segment is not clipped at the exit time, charging until the end of the band.","sha256":"ebab38395c8c037fe03f12265ab47b71702034b35685e9c8f0c8170cee42db48","title":"Time-band rate with calendar day cap: the last segment runs to the band boundary · 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.678,"exit_code":1,"observations":[{"actual":1100,"check":"fee oracle 0","expected":1100,"passed":true},{"actual":2500,"check":"fee oracle 1","expected":2500,"passed":true},{"actual":7050,"check":"fee oracle 2","expected":7050,"passed":true},{"actual":3500,"check":"fee oracle 3","expected":3500,"passed":true},{"actual":550,"check":"fee oracle 4","expected":500,"passed":false},{"actual":4575,"check":"fee oracle 5","expected":4550,"passed":false},{"actual":400,"check":"fee oracle 6","expected":400,"passed":true},{"actual":4000,"check":"fee oracle 7","expected":4000,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fee oracle 0\", \"actual\": 1100, \"expected\": 1100, \"passed\": true}, {\"check\": \"fee oracle 1\", \"actual\": 2500, \"expected\": 2500, \"passed\": true}, {\"check\": \"fee oracle 2\", \"actual\": 7050, \"expected\": 7050, \"passed\": true}, {\"check\": \"fee oracle 3\", \"actual\": 3500, \"expected\": 3500, \"passed\": true}, {\"check\": \"fee oracle 4\", \"actual\": 550, \"expected\": 500, \"passed\": false}, {\"check\": \"fee oracle 5\", \"actual\": 4575, \"expected\": 4550, \"passed\": false}, {\"check\": \"fee oracle 6\", \"actual\": 400, \"expected\": 400, \"passed\": true}, {\"check\": \"fee oracle 7\", \"actual\": 4000, \"expected\": 4000, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.165,"exit_code":1,"observations":[{"actual":2400,"check":"fee oracle 0","expected":1100,"passed":false},{"actual":2500,"check":"fee oracle 1","expected":2500,"passed":true},{"actual":7050,"check":"fee oracle 2","expected":7050,"passed":true},{"actual":3500,"check":"fee oracle 3","expected":3500,"passed":true},{"actual":1800,"check":"fee oracle 4","expected":500,"passed":false},{"actual":5125,"check":"fee oracle 5","expected":4550,"passed":false},{"actual":2050,"check":"fee oracle 6","expected":400,"passed":false},{"actual":4000,"check":"fee oracle 7","expected":4000,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fee oracle 0\", \"actual\": 2400, \"expected\": 1100, \"passed\": false}, {\"check\": \"fee oracle 1\", \"actual\": 2500, \"expected\": 2500, \"passed\": true}, {\"check\": \"fee oracle 2\", \"actual\": 7050, \"expected\": 7050, \"passed\": true}, {\"check\": \"fee oracle 3\", \"actual\": 3500, \"expected\": 3500, \"passed\": true}, {\"check\": \"fee oracle 4\", \"actual\": 1800, \"expected\": 500, \"passed\": false}, {\"check\": \"fee oracle 5\", \"actual\": 5125, \"expected\": 4550, \"passed\": false}, {\"check\": \"fee oracle 6\", \"actual\": 2050, \"expected\": 400, \"passed\": false}, {\"check\": \"fee oracle 7\", \"actual\": 4000, \"expected\": 4000, \"passed\": true}], \"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."}}