{"abstract":"Cordon congestion charge returns a wrong result when the grace window slides with every free crossing.","category":"Toll and parking fee computation","checks":8,"contract":"Input {crossings: [[day, minute]] unordered, peak: [[start, end)] windows, peak_fee, offpeak_fee, daily_cap, weekend_free, zero_emission, grace}. Zero-emission vehicles pay 0. Days with day % 7 in {5, 6} are free when weekend_free. Within a day, a crossing no more than grace minutes after the last charged crossing is free (the grace anchor is the charged crossing). Each charged crossing pays the peak fee inside a window else off-peak; each day's sum is capped at daily_cap.","evaluation_group":"w2-toll_and_parking_fee_computation-congestion-charge","failed_approach":"The strict comparison charges a return crossing at exactly the grace limit.","family":"w2-toll_and_parking_fee_computation-congestion-charge-grace-anchor","id":"FA-68536","implementations":{"attempt":{"sha256":"984f029fd89df421b9f1afafca167d3bb4210a73b1fec0b9a41d530a4e096b1a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if x['zero_emission']:\n        return 0\n    byday = {}\n    for d, m in sorted(x['crossings']):\n        byday.setdefault(d, []).append(m)\n    total = 0\n    for d, ms in byday.items():\n        if x['weekend_free'] and d % 7 >= 5:\n            continue\n        last = None\n        day_sum = 0\n        for m in ms:\n            if last is not None and m - last < x['grace']:\n                continue\n            last = m\n            peak = any(s <= m < e for s, e in x['peak'])\n            day_sum += x['peak_fee'] if peak else x['offpeak_fee']\n        total += min(day_sum, x['daily_cap'])\n    return total\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'crossings': [[1, 500], [1, 508], [1, 516], [1, 530]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2700), ({'crossings': [[7, 808], [2, 357], [7, 818], [9, 848], [7, 803], [3, 1057], [6, 1244]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1900), ({'crossings': [[1, 1077], [1, 1057]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 2000, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 1800), ({'crossings': [[2, 600], [2, 420], [2, 1140]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1400), ({'crossings': [[0, 325], [1, 437], [1, 432], [1, 877], [9, 768], [9, 1258], [1, 422]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2000), ({'crossings': [[8, 829], [6, 980], [3, 425], [1, 667], [8, 839], [8, 834]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1500), ({'crossings': [[6, 500], [0, 500], [5, 500]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 900), ({'crossings': [[9, 362], [0, 588], [0, 578], [0, 598], [4, 513]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 3000)], [({'crossings': [[1, 500], [1, 508], [1, 516], [1, 530]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2700), ({'crossings': [[6, 500], [0, 500], [5, 500]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 900), ({'crossings': [[2, 600], [2, 420], [2, 1140]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1400), ({'crossings': [[5, 1011], [5, 656], [5, 671], [5, 681]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 1500), ({'crossings': [[9, 765], [8, 888], [7, 889], [4, 754], [3, 1120], [4, 900], [3, 1140], [7, 689], [3, 1135], [0, 1056]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 3550), ({'crossings': [[3, 471], [9, 408], [7, 308], [2, 900], [3, 466], [7, 368], [3, 456]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2000), ({'crossings': [[0, 641], [4, 994], [6, 843], [3, 505], [4, 974], [8, 946], [7, 892]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 200, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 3300), ({'crossings': [[2, 1225], [2, 389]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 400)], [({'crossings': [[8, 351], [0, 745], [8, 946], [8, 341], [2, 414], [7, 1117], [4, 603]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2000), ({'crossings': [[7, 385], [6, 656], [6, 661], [6, 646]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 600), ({'crossings': [[7, 718], [6, 1027], [6, 695], [7, 701], [4, 1199], [7, 713]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 200, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 600), ({'crossings': [[1, 500], [1, 508], [1, 516], [1, 530]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2700), ({'crossings': [[3, 1273], [9, 868], [7, 364], [4, 1093], [8, 916], [3, 1283], [3, 1278]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 2100), ({'crossings': [[6, 500], [0, 500], [5, 500]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 900), ({'crossings': [[2, 600], [2, 420], [2, 1140]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1400), ({'crossings': [[6, 670], [2, 1136], [2, 1146], [5, 987], [2, 1156], [5, 556], [7, 927]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 1500)], [({'crossings': [[2, 1113], [2, 1280], [9, 567], [6, 556], [8, 1067], [9, 577], [4, 1241], [3, 1274]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 4900), ({'crossings': [[8, 927], [9, 1274], [7, 1026], [9, 1299], [9, 1289]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 3000, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 1650), ({'crossings': [[2, 600], [2, 420], [2, 1140]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1400), ({'crossings': [[1, 500], [1, 508], [1, 516], [1, 530]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2700), ({'crossings': [[6, 500], [0, 500], [5, 500]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 900), ({'crossings': [[3, 502], [3, 492], [5, 835], [9, 790], [4, 1009], [3, 461], [3, 512]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 3900), ({'crossings': [[5, 688], [5, 683], [4, 424], [7, 1235], [9, 1296], [2, 870], [5, 1119], [1, 895]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 3500), ({'crossings': [[9, 425], [2, 1292], [5, 1026], [0, 1286], [7, 717], [3, 401], [0, 1276], [9, 839]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2000)], [({'crossings': [[5, 673], [5, 683], [5, 700], [4, 508]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 1500), ({'crossings': [[9, 1004], [6, 1000], [6, 1020], [6, 1015]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 3000), ({'crossings': [[1, 500], [1, 508], [1, 516], [1, 530]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2700), ({'crossings': [[9, 830], [0, 735], [0, 706]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 750), ({'crossings': [[4, 989], [7, 961], [4, 1004]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 1800), ({'crossings': [[2, 600], [2, 420], [2, 1140]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1400), ({'crossings': [[9, 1022], [4, 445], [8, 953], [5, 461], [9, 699], [8, 573], [8, 588], [7, 514], [8, 583], [1, 1080]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 6300), ({'crossings': [[6, 500], [0, 500], [5, 500]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 900)]]\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":"1c07586cce6ad8185cf8902efcc16d1ad133d6a02eea5f2b2d4005a064bd2dd2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if x['zero_emission']:\n        return 0\n    byday = {}\n    for d, m in sorted(x['crossings']):\n        byday.setdefault(d, []).append(m)\n    total = 0\n    for d, ms in byday.items():\n        if x['weekend_free'] and d % 7 >= 5:\n            continue\n        last = None\n        day_sum = 0\n        for m in ms:\n            if last is not None and m - last <= x['grace']:\n                last = m\n                continue\n            last = m\n            peak = any(s <= m < e for s, e in x['peak'])\n            day_sum += x['peak_fee'] if peak else x['offpeak_fee']\n        total += min(day_sum, x['daily_cap'])\n    return total\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'crossings': [[1, 500], [1, 508], [1, 516], [1, 530]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2700), ({'crossings': [[7, 808], [2, 357], [7, 818], [9, 848], [7, 803], [3, 1057], [6, 1244]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1900), ({'crossings': [[1, 1077], [1, 1057]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 2000, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 1800), ({'crossings': [[2, 600], [2, 420], [2, 1140]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1400), ({'crossings': [[0, 325], [1, 437], [1, 432], [1, 877], [9, 768], [9, 1258], [1, 422]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2000), ({'crossings': [[8, 829], [6, 980], [3, 425], [1, 667], [8, 839], [8, 834]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1500), ({'crossings': [[6, 500], [0, 500], [5, 500]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 900), ({'crossings': [[9, 362], [0, 588], [0, 578], [0, 598], [4, 513]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 3000)], [({'crossings': [[1, 500], [1, 508], [1, 516], [1, 530]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2700), ({'crossings': [[6, 500], [0, 500], [5, 500]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 900), ({'crossings': [[2, 600], [2, 420], [2, 1140]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1400), ({'crossings': [[5, 1011], [5, 656], [5, 671], [5, 681]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 1500), ({'crossings': [[9, 765], [8, 888], [7, 889], [4, 754], [3, 1120], [4, 900], [3, 1140], [7, 689], [3, 1135], [0, 1056]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 3550), ({'crossings': [[3, 471], [9, 408], [7, 308], [2, 900], [3, 466], [7, 368], [3, 456]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2000), ({'crossings': [[0, 641], [4, 994], [6, 843], [3, 505], [4, 974], [8, 946], [7, 892]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 200, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 3300), ({'crossings': [[2, 1225], [2, 389]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 400)], [({'crossings': [[8, 351], [0, 745], [8, 946], [8, 341], [2, 414], [7, 1117], [4, 603]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2000), ({'crossings': [[7, 385], [6, 656], [6, 661], [6, 646]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 600), ({'crossings': [[7, 718], [6, 1027], [6, 695], [7, 701], [4, 1199], [7, 713]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 200, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 600), ({'crossings': [[1, 500], [1, 508], [1, 516], [1, 530]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2700), ({'crossings': [[3, 1273], [9, 868], [7, 364], [4, 1093], [8, 916], [3, 1283], [3, 1278]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 2100), ({'crossings': [[6, 500], [0, 500], [5, 500]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 900), ({'crossings': [[2, 600], [2, 420], [2, 1140]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1400), ({'crossings': [[6, 670], [2, 1136], [2, 1146], [5, 987], [2, 1156], [5, 556], [7, 927]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 1500)], [({'crossings': [[2, 1113], [2, 1280], [9, 567], [6, 556], [8, 1067], [9, 577], [4, 1241], [3, 1274]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 4900), ({'crossings': [[8, 927], [9, 1274], [7, 1026], [9, 1299], [9, 1289]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 3000, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 1650), ({'crossings': [[2, 600], [2, 420], [2, 1140]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1400), ({'crossings': [[1, 500], [1, 508], [1, 516], [1, 530]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2700), ({'crossings': [[6, 500], [0, 500], [5, 500]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 900), ({'crossings': [[3, 502], [3, 492], [5, 835], [9, 790], [4, 1009], [3, 461], [3, 512]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 3900), ({'crossings': [[5, 688], [5, 683], [4, 424], [7, 1235], [9, 1296], [2, 870], [5, 1119], [1, 895]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 3500), ({'crossings': [[9, 425], [2, 1292], [5, 1026], [0, 1286], [7, 717], [3, 401], [0, 1276], [9, 839]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2000)], [({'crossings': [[5, 673], [5, 683], [5, 700], [4, 508]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 1500), ({'crossings': [[9, 1004], [6, 1000], [6, 1020], [6, 1015]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 3000), ({'crossings': [[1, 500], [1, 508], [1, 516], [1, 530]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2700), ({'crossings': [[9, 830], [0, 735], [0, 706]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 750), ({'crossings': [[4, 989], [7, 961], [4, 1004]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 1800), ({'crossings': [[2, 600], [2, 420], [2, 1140]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1400), ({'crossings': [[9, 1022], [4, 445], [8, 953], [5, 461], [9, 699], [8, 573], [8, 588], [7, 514], [8, 583], [1, 1080]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 6300), ({'crossings': [[6, 500], [0, 500], [5, 500]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 900)]]\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":"7a6230c80348daa1685bfd257ab5d77b0231ec91cdf139048f5f5df3f7fa6071","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if x['zero_emission']:\n        return 0\n    byday = {}\n    for d, m in sorted(x['crossings']):\n        byday.setdefault(d, []).append(m)\n    total = 0\n    for d, ms in byday.items():\n        if x['weekend_free'] and d % 7 >= 5:\n            continue\n        last = None\n        day_sum = 0\n        for m in ms:\n            if last is not None and m - last <= x['grace']:\n                continue\n            last = m\n            peak = any(s <= m < e for s, e in x['peak'])\n            day_sum += x['peak_fee'] if peak else x['offpeak_fee']\n        total += min(day_sum, x['daily_cap'])\n    return total\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'crossings': [[1, 500], [1, 508], [1, 516], [1, 530]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2700), ({'crossings': [[7, 808], [2, 357], [7, 818], [9, 848], [7, 803], [3, 1057], [6, 1244]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1900), ({'crossings': [[1, 1077], [1, 1057]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 2000, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 1800), ({'crossings': [[2, 600], [2, 420], [2, 1140]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1400), ({'crossings': [[0, 325], [1, 437], [1, 432], [1, 877], [9, 768], [9, 1258], [1, 422]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2000), ({'crossings': [[8, 829], [6, 980], [3, 425], [1, 667], [8, 839], [8, 834]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1500), ({'crossings': [[6, 500], [0, 500], [5, 500]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 900), ({'crossings': [[9, 362], [0, 588], [0, 578], [0, 598], [4, 513]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 3000)], [({'crossings': [[1, 500], [1, 508], [1, 516], [1, 530]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2700), ({'crossings': [[6, 500], [0, 500], [5, 500]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 900), ({'crossings': [[2, 600], [2, 420], [2, 1140]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1400), ({'crossings': [[5, 1011], [5, 656], [5, 671], [5, 681]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 1500), ({'crossings': [[9, 765], [8, 888], [7, 889], [4, 754], [3, 1120], [4, 900], [3, 1140], [7, 689], [3, 1135], [0, 1056]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 3550), ({'crossings': [[3, 471], [9, 408], [7, 308], [2, 900], [3, 466], [7, 368], [3, 456]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2000), ({'crossings': [[0, 641], [4, 994], [6, 843], [3, 505], [4, 974], [8, 946], [7, 892]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 200, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 3300), ({'crossings': [[2, 1225], [2, 389]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 400)], [({'crossings': [[8, 351], [0, 745], [8, 946], [8, 341], [2, 414], [7, 1117], [4, 603]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2000), ({'crossings': [[7, 385], [6, 656], [6, 661], [6, 646]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 600), ({'crossings': [[7, 718], [6, 1027], [6, 695], [7, 701], [4, 1199], [7, 713]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 200, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 600), ({'crossings': [[1, 500], [1, 508], [1, 516], [1, 530]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2700), ({'crossings': [[3, 1273], [9, 868], [7, 364], [4, 1093], [8, 916], [3, 1283], [3, 1278]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 2100), ({'crossings': [[6, 500], [0, 500], [5, 500]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 900), ({'crossings': [[2, 600], [2, 420], [2, 1140]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1400), ({'crossings': [[6, 670], [2, 1136], [2, 1146], [5, 987], [2, 1156], [5, 556], [7, 927]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 1500)], [({'crossings': [[2, 1113], [2, 1280], [9, 567], [6, 556], [8, 1067], [9, 577], [4, 1241], [3, 1274]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 4900), ({'crossings': [[8, 927], [9, 1274], [7, 1026], [9, 1299], [9, 1289]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 3000, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 1650), ({'crossings': [[2, 600], [2, 420], [2, 1140]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1400), ({'crossings': [[1, 500], [1, 508], [1, 516], [1, 530]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2700), ({'crossings': [[6, 500], [0, 500], [5, 500]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 900), ({'crossings': [[3, 502], [3, 492], [5, 835], [9, 790], [4, 1009], [3, 461], [3, 512]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 3900), ({'crossings': [[5, 688], [5, 683], [4, 424], [7, 1235], [9, 1296], [2, 870], [5, 1119], [1, 895]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 3500), ({'crossings': [[9, 425], [2, 1292], [5, 1026], [0, 1286], [7, 717], [3, 401], [0, 1276], [9, 839]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2000)], [({'crossings': [[5, 673], [5, 683], [5, 700], [4, 508]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 1500), ({'crossings': [[9, 1004], [6, 1000], [6, 1020], [6, 1015]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 3000, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 3000), ({'crossings': [[1, 500], [1, 508], [1, 516], [1, 530]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2700), ({'crossings': [[9, 830], [0, 735], [0, 706]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 750), ({'crossings': [[4, 989], [7, 961], [4, 1004]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 1800), ({'crossings': [[2, 600], [2, 420], [2, 1140]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1400), ({'crossings': [[9, 1022], [4, 445], [8, 953], [5, 461], [9, 699], [8, 573], [8, 588], [7, 514], [8, 583], [1, 1080]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 6300), ({'crossings': [[6, 500], [0, 500], [5, 500]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 5000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 900)]]\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-congestion-charge-grace-anchor","generated_at":"2026-09-29T14:48:03.091508+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 grace anchor rule so that the step reads `if last is not None and m - last <= x['grace']:\n            continue`.","root_cause":"Re-anchoring on free crossings lets a chain of short hops stay free indefinitely.","sha256":"4149020be5285f94ac13232078dcd7b7a9859f52e6f87a5a399b3443dc39fcbe","title":"Cordon congestion charge: the grace window slides with every free crossing · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.917,"exit_code":1,"observations":[{"actual":2700,"check":"fee oracle 0","expected":2700,"passed":true},{"actual":1900,"check":"fee oracle 1","expected":1900,"passed":true},{"actual":1800,"check":"fee oracle 2","expected":1800,"passed":true},{"actual":1400,"check":"fee oracle 3","expected":1400,"passed":true},{"actual":2750,"check":"fee oracle 4","expected":2000,"passed":false},{"actual":1800,"check":"fee oracle 5","expected":1500,"passed":false},{"actual":900,"check":"fee oracle 6","expected":900,"passed":true},{"actual":3000,"check":"fee oracle 7","expected":3000,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fee oracle 0\", \"actual\": 2700, \"expected\": 2700, \"passed\": true}, {\"check\": \"fee oracle 1\", \"actual\": 1900, \"expected\": 1900, \"passed\": true}, {\"check\": \"fee oracle 2\", \"actual\": 1800, \"expected\": 1800, \"passed\": true}, {\"check\": \"fee oracle 3\", \"actual\": 1400, \"expected\": 1400, \"passed\": true}, {\"check\": \"fee oracle 4\", \"actual\": 2750, \"expected\": 2000, \"passed\": false}, {\"check\": \"fee oracle 5\", \"actual\": 1800, \"expected\": 1500, \"passed\": false}, {\"check\": \"fee oracle 6\", \"actual\": 900, \"expected\": 900, \"passed\": true}, {\"check\": \"fee oracle 7\", \"actual\": 3000, \"expected\": 3000, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.595,"exit_code":1,"observations":[{"actual":1800,"check":"fee oracle 0","expected":2700,"passed":false},{"actual":1650,"check":"fee oracle 1","expected":1900,"passed":false},{"actual":1800,"check":"fee oracle 2","expected":1800,"passed":true},{"actual":1400,"check":"fee oracle 3","expected":1400,"passed":true},{"actual":2000,"check":"fee oracle 4","expected":2000,"passed":true},{"actual":1500,"check":"fee oracle 5","expected":1500,"passed":true},{"actual":900,"check":"fee oracle 6","expected":900,"passed":true},{"actual":2100,"check":"fee oracle 7","expected":3000,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fee oracle 0\", \"actual\": 1800, \"expected\": 2700, \"passed\": false}, {\"check\": \"fee oracle 1\", \"actual\": 1650, \"expected\": 1900, \"passed\": false}, {\"check\": \"fee oracle 2\", \"actual\": 1800, \"expected\": 1800, \"passed\": true}, {\"check\": \"fee oracle 3\", \"actual\": 1400, \"expected\": 1400, \"passed\": true}, {\"check\": \"fee oracle 4\", \"actual\": 2000, \"expected\": 2000, \"passed\": true}, {\"check\": \"fee oracle 5\", \"actual\": 1500, \"expected\": 1500, \"passed\": true}, {\"check\": \"fee oracle 6\", \"actual\": 900, \"expected\": 900, \"passed\": true}, {\"check\": \"fee oracle 7\", \"actual\": 2100, \"expected\": 3000, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.92,"exit_code":0,"observations":[{"actual":2700,"check":"fee oracle 0","expected":2700,"passed":true},{"actual":1900,"check":"fee oracle 1","expected":1900,"passed":true},{"actual":1800,"check":"fee oracle 2","expected":1800,"passed":true},{"actual":1400,"check":"fee oracle 3","expected":1400,"passed":true},{"actual":2000,"check":"fee oracle 4","expected":2000,"passed":true},{"actual":1500,"check":"fee oracle 5","expected":1500,"passed":true},{"actual":900,"check":"fee oracle 6","expected":900,"passed":true},{"actual":3000,"check":"fee oracle 7","expected":3000,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fee oracle 0\", \"actual\": 2700, \"expected\": 2700, \"passed\": true}, {\"check\": \"fee oracle 1\", \"actual\": 1900, \"expected\": 1900, \"passed\": true}, {\"check\": \"fee oracle 2\", \"actual\": 1800, \"expected\": 1800, \"passed\": true}, {\"check\": \"fee oracle 3\", \"actual\": 1400, \"expected\": 1400, \"passed\": true}, {\"check\": \"fee oracle 4\", \"actual\": 2000, \"expected\": 2000, \"passed\": true}, {\"check\": \"fee oracle 5\", \"actual\": 1500, \"expected\": 1500, \"passed\": true}, {\"check\": \"fee oracle 6\", \"actual\": 900, \"expected\": 900, \"passed\": true}, {\"check\": \"fee oracle 7\", \"actual\": 3000, \"expected\": 3000, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}