{"abstract":"Time-band rate with calendar day cap returns a wrong result when each band segment is rounded up separately.","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":"Rounding each segment to the nearest quarter is still per-segment rounding and can also drop short segments.","family":"w2-toll_and_parking_fee_computation-time-band-rate-segment-rounding","id":"FA-68426","implementations":{"attempt":{"sha256":"de0af27895a1379e06d32021013d9e814bd15cb395da6ecfe809c6ef4428babc","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 + 7) // 15 * 15\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, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [420, 100], [810, 100]], 'entry': 779, 'exit': 924, 'daily_max': 2500}, 1000), ({'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, 25], [150, 100], [720, 25], [1110, 25]], 'entry': 1780, 'exit': 3334, 'daily_max': 2500}, 4850), ({'bands': [[0, 25], [360, 50], [780, 100]], 'entry': 1138, 'exit': 1792, 'daily_max': 2500}, 2700), ({'bands': [[0, 50], [330, 100], [1410, 25]], 'entry': 1073, 'exit': 1206, 'daily_max': 1500}, 900), ({'bands': [[0, 50], [150, 100], [720, 100]], 'entry': 698, 'exit': 889, 'daily_max': 1500}, 1300)], [({'bands': [[0, 50], [150, 25], [180, 100], [240, 100]], 'entry': 1386, 'exit': 1508, 'daily_max': 2500}, 650), ({'bands': [[0, 50], [120, 25], [690, 25], [840, 50]], 'entry': 664, 'exit': 769, 'daily_max': 4000}, 175), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 25], [270, 25], [690, 50], [930, 100]], 'entry': 1225, 'exit': 1760, 'daily_max': 1500}, 2050), ({'bands': [[0, 25], [1170, 100]], 'entry': 53, 'exit': 384, 'daily_max': 2500}, 575), ({'bands': [[0, 25], [1080, 25]], 'entry': 683, 'exit': 1355, 'daily_max': 1500}, 1125), ({'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], [60, 100], [270, 25]], 'entry': 1474, 'exit': 1937, 'daily_max': 2500}, 1825), ({'bands': [[0, 25], [120, 25], [1320, 100]], 'entry': 28, 'exit': 796, 'daily_max': 4000}, 1300), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 25], [570, 50], [840, 50], [900, 50]], 'entry': 582, 'exit': 608, 'daily_max': 1500}, 100), ({'bands': [[0, 25], [780, 50]], 'entry': 916, 'exit': 1921, 'daily_max': 4000}, 2575), ({'bands': [[0, 50], [540, 50], [1140, 100], [1380, 25]], 'entry': 800, 'exit': 1580, 'daily_max': 4000}, 3350), ({'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], [360, 25], [750, 100]], 'entry': 1444, 'exit': 1450, 'daily_max': 1500}, 50), ({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 25], [300, 25]], 'entry': 586, 'exit': 1032, 'daily_max': 1500}, 750), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [390, 100], [1230, 100], [1260, 50]], 'entry': 1138, 'exit': 1253, 'daily_max': 4000}, 800), ({'bands': [[0, 50], [330, 25]], 'entry': 694, 'exit': 727, 'daily_max': 2500}, 75), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 25], [570, 25], [1110, 25]], 'entry': 1079, 'exit': 1217, 'daily_max': 1500}, 250)], [({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [930, 25]], 'entry': 763, 'exit': 1087, 'daily_max': 1500}, 550), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 25], [420, 25], [840, 50], [1200, 100]], 'entry': 1615, 'exit': 1987, 'daily_max': 1500}, 625), ({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 25], [510, 100], [540, 100], [870, 100]], 'entry': 1841, 'exit': 1956, 'daily_max': 2500}, 300), ({'bands': [[0, 50], [540, 25], [1110, 50]], 'entry': 42, 'exit': 1833, 'daily_max': 1500}, 2850), ({'bands': [[0, 50], [870, 25]], 'entry': 1775, 'exit': 2668, 'daily_max': 1500}, 1500)]]\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":"b796d2f9f79e59692038fceb5d507fba0bd7753466357a5f04758ab0a7ecfe94","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 // 15) * 15\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, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [420, 100], [810, 100]], 'entry': 779, 'exit': 924, 'daily_max': 2500}, 1000), ({'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, 25], [150, 100], [720, 25], [1110, 25]], 'entry': 1780, 'exit': 3334, 'daily_max': 2500}, 4850), ({'bands': [[0, 25], [360, 50], [780, 100]], 'entry': 1138, 'exit': 1792, 'daily_max': 2500}, 2700), ({'bands': [[0, 50], [330, 100], [1410, 25]], 'entry': 1073, 'exit': 1206, 'daily_max': 1500}, 900), ({'bands': [[0, 50], [150, 100], [720, 100]], 'entry': 698, 'exit': 889, 'daily_max': 1500}, 1300)], [({'bands': [[0, 50], [150, 25], [180, 100], [240, 100]], 'entry': 1386, 'exit': 1508, 'daily_max': 2500}, 650), ({'bands': [[0, 50], [120, 25], [690, 25], [840, 50]], 'entry': 664, 'exit': 769, 'daily_max': 4000}, 175), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 25], [270, 25], [690, 50], [930, 100]], 'entry': 1225, 'exit': 1760, 'daily_max': 1500}, 2050), ({'bands': [[0, 25], [1170, 100]], 'entry': 53, 'exit': 384, 'daily_max': 2500}, 575), ({'bands': [[0, 25], [1080, 25]], 'entry': 683, 'exit': 1355, 'daily_max': 1500}, 1125), ({'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], [60, 100], [270, 25]], 'entry': 1474, 'exit': 1937, 'daily_max': 2500}, 1825), ({'bands': [[0, 25], [120, 25], [1320, 100]], 'entry': 28, 'exit': 796, 'daily_max': 4000}, 1300), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 25], [570, 50], [840, 50], [900, 50]], 'entry': 582, 'exit': 608, 'daily_max': 1500}, 100), ({'bands': [[0, 25], [780, 50]], 'entry': 916, 'exit': 1921, 'daily_max': 4000}, 2575), ({'bands': [[0, 50], [540, 50], [1140, 100], [1380, 25]], 'entry': 800, 'exit': 1580, 'daily_max': 4000}, 3350), ({'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], [360, 25], [750, 100]], 'entry': 1444, 'exit': 1450, 'daily_max': 1500}, 50), ({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 25], [300, 25]], 'entry': 586, 'exit': 1032, 'daily_max': 1500}, 750), ({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [390, 100], [1230, 100], [1260, 50]], 'entry': 1138, 'exit': 1253, 'daily_max': 4000}, 800), ({'bands': [[0, 50], [330, 25]], 'entry': 694, 'exit': 727, 'daily_max': 2500}, 75), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 25], [570, 25], [1110, 25]], 'entry': 1079, 'exit': 1217, 'daily_max': 1500}, 250)], [({'bands': [[0, 50], [720, 100]], 'entry': 1400, 'exit': 1500, 'daily_max': 1500}, 500), ({'bands': [[0, 25], [930, 25]], 'entry': 763, 'exit': 1087, 'daily_max': 1500}, 550), ({'bands': [[0, 25], [420, 100], [1080, 50]], 'entry': 400, 'exit': 1100, 'daily_max': 4000}, 4000), ({'bands': [[0, 25], [420, 25], [840, 50], [1200, 100]], 'entry': 1615, 'exit': 1987, 'daily_max': 1500}, 625), ({'bands': [[0, 25], [420, 100], [1080, 25]], 'entry': 350, 'exit': 1100, 'daily_max': 9000}, 4550), ({'bands': [[0, 25], [510, 100], [540, 100], [870, 100]], 'entry': 1841, 'exit': 1956, 'daily_max': 2500}, 300), ({'bands': [[0, 50], [540, 25], [1110, 50]], 'entry': 42, 'exit': 1833, 'daily_max': 1500}, 2850), ({'bands': [[0, 50], [870, 25]], 'entry': 1775, 'exit': 2668, 'daily_max': 1500}, 1500)]]\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-segment-rounding","generated_at":"2026-09-29T14:48:02.144773+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":"Rounding each band visit separately charges extra quarters when a day has several segments at the same rate.","sha256":"d7359292dd4ec545e4053f0a539444603d2a4b199a40abc752154ef747f448e4","title":"Time-band rate with calendar day cap: each band segment is rounded up separately · 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":39.775,"exit_code":1,"observations":[{"actual":500,"check":"fee oracle 0","expected":500,"passed":true},{"actual":1000,"check":"fee oracle 1","expected":1000,"passed":true},{"actual":4000,"check":"fee oracle 2","expected":4000,"passed":true},{"actual":4550,"check":"fee oracle 3","expected":4550,"passed":true},{"actual":4750,"check":"fee oracle 4","expected":4850,"passed":false},{"actual":2575,"check":"fee oracle 5","expected":2700,"passed":false},{"actual":900,"check":"fee oracle 6","expected":900,"passed":true},{"actual":1200,"check":"fee oracle 7","expected":1300,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fee oracle 0\", \"actual\": 500, \"expected\": 500, \"passed\": true}, {\"check\": \"fee oracle 1\", \"actual\": 1000, \"expected\": 1000, \"passed\": true}, {\"check\": \"fee oracle 2\", \"actual\": 4000, \"expected\": 4000, \"passed\": true}, {\"check\": \"fee oracle 3\", \"actual\": 4550, \"expected\": 4550, \"passed\": true}, {\"check\": \"fee oracle 4\", \"actual\": 4750, \"expected\": 4850, \"passed\": false}, {\"check\": \"fee oracle 5\", \"actual\": 2575, \"expected\": 2700, \"passed\": false}, {\"check\": \"fee oracle 6\", \"actual\": 900, \"expected\": 900, \"passed\": true}, {\"check\": \"fee oracle 7\", \"actual\": 1200, \"expected\": 1300, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.839,"exit_code":1,"observations":[{"actual":500,"check":"fee oracle 0","expected":500,"passed":true},{"actual":1100,"check":"fee oracle 1","expected":1000,"passed":false},{"actual":4000,"check":"fee oracle 2","expected":4000,"passed":true},{"actual":4575,"check":"fee oracle 3","expected":4550,"passed":false},{"actual":4850,"check":"fee oracle 4","expected":4850,"passed":true},{"actual":2700,"check":"fee oracle 5","expected":2700,"passed":true},{"actual":900,"check":"fee oracle 6","expected":900,"passed":true},{"actual":1400,"check":"fee oracle 7","expected":1300,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fee oracle 0\", \"actual\": 500, \"expected\": 500, \"passed\": true}, {\"check\": \"fee oracle 1\", \"actual\": 1100, \"expected\": 1000, \"passed\": false}, {\"check\": \"fee oracle 2\", \"actual\": 4000, \"expected\": 4000, \"passed\": true}, {\"check\": \"fee oracle 3\", \"actual\": 4575, \"expected\": 4550, \"passed\": false}, {\"check\": \"fee oracle 4\", \"actual\": 4850, \"expected\": 4850, \"passed\": true}, {\"check\": \"fee oracle 5\", \"actual\": 2700, \"expected\": 2700, \"passed\": true}, {\"check\": \"fee oracle 6\", \"actual\": 900, \"expected\": 900, \"passed\": true}, {\"check\": \"fee oracle 7\", \"actual\": 1400, \"expected\": 1300, \"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."}}