FA-68551 / Toll and parking fee computation / Open access
Cordon congestion charge: the cap applies to the whole billing period · case 01
Cordon congestion charge returns a wrong result when the cap applies to the whole billing period.
ROOT CAUSE
Days with many crossings are not capped.
THE FAILURE
Days with many crossings are not capped.
Unsuccessful approach: Capping the running total limits the whole period to one day of charges.
Case 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.
Why this case matters
Fee engines bill customers in integer cents; a wrong boundary, rounding stage or cap scope silently over- or under-charges.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
if x['zero_emission']:
return 0
byday = {}
for d, m in sorted(x['crossings']):
byday.setdefault(d, []).append(m)
total = 0
for d, ms in byday.items():
if x['weekend_free'] and d % 7 >= 5:
continue
last = None
day_sum = 0
for m in ms:
if last is not None and m - last <= x['grace']:
continue
last = m
peak = any(s <= m < e for s, e in x['peak'])
day_sum += x['peak_fee'] if peak else x['offpeak_fee']
total += day_sum
return total
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'crossings': [[6, 520], [8, 430], [8, 435], [0, 1106], [0, 1013]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2500), ({'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, 497], [3, 958], [1, 326], [6, 1096], [1, 331], [8, 1070]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 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': [[0, 1287], [0, 1302], [0, 1307], [2, 1091], [4, 959], [8, 998], [3, 769], [4, 644], [7, 461]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 4500), ({'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, 347], [2, 352], [5, 726], [2, 1038], [7, 922], [8, 903], [2, 332]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2200), ({'crossings': [[0, 1186], [0, 531], [0, 807], [8, 437], [0, 975], [0, 1159], [0, 1154]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 2000, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 2900)], [({'crossings': [[2, 1073], [7, 669], [4, 1136], [8, 1182], [8, 391], [4, 492]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 200, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 3000), ({'crossings': [[2, 416], [1, 1238], [2, 1124], [2, 431], [8, 952], [3, 965], [3, 1300]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 3400), ({'crossings': [[7, 869], [3, 859], [0, 544], [0, 1122], [4, 1253], [3, 675], [1, 929], [0, 1142], [6, 420]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2750), ({'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': [[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': [[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, 1035], [7, 844], [2, 726], [2, 1037]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 2500), ({'crossings': [[1, 1185], [2, 606], [6, 710], [6, 812], [1, 719], [6, 721], [6, 736], [8, 822], [9, 1267]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': False, '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': [[8, 1127], [7, 1208], [3, 443], [8, 415], [8, 1132], [8, 1112]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2700), ({'crossings': [[9, 1283], [2, 592], [4, 827], [4, 842], [8, 922], [7, 1070], [9, 1194], [2, 341]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 3300), ({'crossings': [[4, 502], [0, 1272], [7, 731], [4, 344], [4, 492], [2, 337], [4, 512]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 2000, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 2750), ({'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': [[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': [[7, 586], [5, 897], [1, 745], [2, 423], [7, 357], [2, 777], [4, 503], [1, 1075], [7, 362]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 4600), ({'crossings': [[8, 962], [8, 974]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1500)], [({'crossings': [[0, 930], [9, 511], [3, 655], [4, 476], [3, 1099], [0, 471], [3, 665], [3, 645], [3, 1032], [5, 1136]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 5300), ({'crossings': [[1, 972], [1, 992]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 1500), ({'crossings': [[5, 821], [1, 1260], [3, 425], [1, 614], [1, 604], [7, 629], [0, 651], [4, 469]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 200, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2600), ({'crossings': [[9, 475], [4, 460], [2, 477], [5, 386], [4, 651], [9, 455], [7, 710], [9, 1205], [4, 992]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 4150), ({'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': [[7, 475], [7, 455], [0, 1155], [1, 872]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2400), ({'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, 573], [3, 585]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 1500, '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': [[3, 1246], [3, 413], [4, 534], [3, 1261]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': True, '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': [[5, 1280], [4, 1116], [7, 944], [4, 1096]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 1750), ({'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, 629], [6, 481], [5, 417], [5, 1096], [7, 856], [3, 1083], [6, 452], [4, 996]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 2000, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 5400), ({'crossings': [[9, 418], [2, 613], [9, 470], [9, 480], [9, 788], [3, 753], [7, 486]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 3200)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check('fee oracle' + ' %d' % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fee oracle 0 | 3000 | 2500 | Failed |
| fee oracle 1 | 1400 | 1400 | Passed |
| fee oracle 2 | 3300 | 3000 | Failed |
| fee oracle 3 | 2700 | 2700 | Passed |
| fee oracle 4 | 4500 | 4500 | Passed |
| fee oracle 5 | 900 | 900 | Passed |
| fee oracle 6 | 2200 | 2200 | Passed |
| fee oracle 7 | 3450 | 2900 | Failed |
SHA-256 / fe5f84a8af5e5ff3120ebd3e5a15b4811f48361b2e229833ae8bdd4f8f86d814
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
if x['zero_emission']:
return 0
byday = {}
for d, m in sorted(x['crossings']):
byday.setdefault(d, []).append(m)
total = 0
for d, ms in byday.items():
if x['weekend_free'] and d % 7 >= 5:
continue
last = None
day_sum = 0
for m in ms:
if last is not None and m - last <= x['grace']:
continue
last = m
peak = any(s <= m < e for s, e in x['peak'])
day_sum += x['peak_fee'] if peak else x['offpeak_fee']
total = min(total + day_sum, x['daily_cap'])
return total
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'crossings': [[6, 520], [8, 430], [8, 435], [0, 1106], [0, 1013]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2500), ({'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, 497], [3, 958], [1, 326], [6, 1096], [1, 331], [8, 1070]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 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': [[0, 1287], [0, 1302], [0, 1307], [2, 1091], [4, 959], [8, 998], [3, 769], [4, 644], [7, 461]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 4500), ({'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, 347], [2, 352], [5, 726], [2, 1038], [7, 922], [8, 903], [2, 332]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2200), ({'crossings': [[0, 1186], [0, 531], [0, 807], [8, 437], [0, 975], [0, 1159], [0, 1154]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 2000, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 2900)], [({'crossings': [[2, 1073], [7, 669], [4, 1136], [8, 1182], [8, 391], [4, 492]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 200, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 3000), ({'crossings': [[2, 416], [1, 1238], [2, 1124], [2, 431], [8, 952], [3, 965], [3, 1300]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 3400), ({'crossings': [[7, 869], [3, 859], [0, 544], [0, 1122], [4, 1253], [3, 675], [1, 929], [0, 1142], [6, 420]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2750), ({'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': [[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': [[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, 1035], [7, 844], [2, 726], [2, 1037]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 2500), ({'crossings': [[1, 1185], [2, 606], [6, 710], [6, 812], [1, 719], [6, 721], [6, 736], [8, 822], [9, 1267]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': False, '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': [[8, 1127], [7, 1208], [3, 443], [8, 415], [8, 1132], [8, 1112]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2700), ({'crossings': [[9, 1283], [2, 592], [4, 827], [4, 842], [8, 922], [7, 1070], [9, 1194], [2, 341]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 3300), ({'crossings': [[4, 502], [0, 1272], [7, 731], [4, 344], [4, 492], [2, 337], [4, 512]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 2000, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 2750), ({'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': [[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': [[7, 586], [5, 897], [1, 745], [2, 423], [7, 357], [2, 777], [4, 503], [1, 1075], [7, 362]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 3000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 4600), ({'crossings': [[8, 962], [8, 974]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 1500)], [({'crossings': [[0, 930], [9, 511], [3, 655], [4, 476], [3, 1099], [0, 471], [3, 665], [3, 645], [3, 1032], [5, 1136]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 5300), ({'crossings': [[1, 972], [1, 992]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': False, 'zero_emission': False, 'grace': 10}, 1500), ({'crossings': [[5, 821], [1, 1260], [3, 425], [1, 614], [1, 604], [7, 629], [0, 651], [4, 469]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 200, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 2600), ({'crossings': [[9, 475], [4, 460], [2, 477], [5, 386], [4, 651], [9, 455], [7, 710], [9, 1205], [4, 992]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 10}, 4150), ({'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': [[7, 475], [7, 455], [0, 1155], [1, 872]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 2400), ({'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, 573], [3, 585]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 250, 'daily_cap': 1500, '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': [[3, 1246], [3, 413], [4, 534], [3, 1261]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 900, 'offpeak_fee': 300, 'daily_cap': 1500, 'weekend_free': True, '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': [[5, 1280], [4, 1116], [7, 944], [4, 1096]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 250, 'daily_cap': 1500, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 1750), ({'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, 629], [6, 481], [5, 417], [5, 1096], [7, 856], [3, 1083], [6, 452], [4, 996]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 200, 'daily_cap': 2000, 'weekend_free': False, 'zero_emission': False, 'grace': 15}, 5400), ({'crossings': [[9, 418], [2, 613], [9, 470], [9, 480], [9, 788], [3, 753], [7, 486]], 'peak': [[420, 600], [960, 1140]], 'peak_fee': 1000, 'offpeak_fee': 300, 'daily_cap': 2000, 'weekend_free': True, 'zero_emission': False, 'grace': 15}, 3200)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check('fee oracle' + ' %d' % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fee oracle 0 | 1500 | 2500 | Failed |
| fee oracle 1 | 1400 | 1400 | Passed |
| fee oracle 2 | 1500 | 3000 | Failed |
| fee oracle 3 | 2700 | 2700 | Passed |
| fee oracle 4 | 2000 | 4500 | Failed |
| fee oracle 5 | 900 | 900 | Passed |
| fee oracle 6 | 2000 | 2200 | Failed |
| fee oracle 7 | 2000 | 2900 | Failed |
SHA-256 / c6f6bb6e8f3f0d09c1dbf38d801aa821e65140f491c1d261de3cdbff36f75399
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:48:03.186896+00:00.
Case digest / 15f6f488970fbe2f459cc20eda72224af5e651bb4d6d8444f08f811ff0ec6053