FA-68716 / Toll and parking fee computation / Open access
EV charging session and idle fee: the minimum applies only to the energy charge · case 01
EV charging session and idle fee returns a wrong result when the minimum applies only to the energy charge.
ROOT CAUSE
The session fee is added on top of the minimum instead of counting toward it.
THE FAILURE
The session fee is added on top of the minimum instead of counting toward it.
Unsuccessful approach: Applying the minimum to energy only ignores idle fees that already exceed it.
Case contract
Input {plug_in, charge_end, unplug (minutes), wh, price_per_kwh, idle_grace, idle_rate (per started 10 min), idle_cap, session_fee, min_fee}. Energy = ceil(wh*price/1000). Idle minutes = max(0, unplug - charge_end - grace); idle fee = min(idle_cap, started 10-minute blocks * idle_rate). Total = max(min_fee, session_fee + energy + idle). Return {energy, idle, total}.
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):
energy = -(-x['wh'] * x['price_per_kwh'] // 1000)
idle = max(0, x['unplug'] - x['charge_end'] - x['idle_grace'])
idle_fee = min(x['idle_cap'], -(-idle // 10) * x['idle_rate'])
total = x['session_fee'] + energy + idle_fee
return {'energy': energy, 'idle': idle_fee, 'total': x['session_fee'] + max(x['min_fee'], energy + idle_fee)}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'plug_in': 0, 'charge_end': 90, 'unplug': 106, 'wh': 12500, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 300}, {'energy': 438, 'idle': 50, 'total': 588}), ({'plug_in': 93, 'charge_end': 112, 'unplug': 312, 'wh': 46598, 'price_per_kwh': 35, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 2000, 'session_fee': 0, 'min_fee': 500}, {'energy': 1631, 'idle': 1900, 'total': 3531}), ({'plug_in': 548, 'charge_end': 701, 'unplug': 706, 'wh': 9990, 'price_per_kwh': 29, 'idle_grace': 15, 'idle_rate': 40, 'idle_cap': 3000, 'session_fee': 150, 'min_fee': 500}, {'energy': 290, 'idle': 0, 'total': 500}), ({'plug_in': 502, 'charge_end': 683, 'unplug': 698, 'wh': 5462, 'price_per_kwh': 45, 'idle_grace': 10, 'idle_rate': 50, 'idle_cap': 1000, 'session_fee': 0, 'min_fee': 300}, {'energy': 246, 'idle': 50, 'total': 300}), ({'plug_in': 119, 'charge_end': 199, 'unplug': 215, 'wh': 5114, 'price_per_kwh': 29, 'idle_grace': 15, 'idle_rate': 100, 'idle_cap': 3000, 'session_fee': 100, 'min_fee': 500}, {'energy': 149, 'idle': 100, 'total': 500}), ({'plug_in': 74, 'charge_end': 111, 'unplug': 171, 'wh': 4221, 'price_per_kwh': 29, 'idle_grace': 15, 'idle_rate': 40, 'idle_cap': 3000, 'session_fee': 150, 'min_fee': 500}, {'energy': 123, 'idle': 200, 'total': 500}), ({'plug_in': 585, 'charge_end': 800, 'unplug': 810, 'wh': 39441, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 40, 'idle_cap': 2000, 'session_fee': 0, 'min_fee': 500}, {'energy': 1381, 'idle': 0, 'total': 1381}), ({'plug_in': 30, 'charge_end': 45, 'unplug': 400, 'wh': 800, 'price_per_kwh': 29, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 1000, 'session_fee': 0, 'min_fee': 500}, {'energy': 24, 'idle': 1000, 'total': 1024})], [({'plug_in': 30, 'charge_end': 45, 'unplug': 400, 'wh': 800, 'price_per_kwh': 29, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 1000, 'session_fee': 0, 'min_fee': 500}, {'energy': 24, 'idle': 1000, 'total': 1024}), ({'plug_in': 4, 'charge_end': 296, 'unplug': 312, 'wh': 3717, 'price_per_kwh': 52, 'idle_grace': 10, 'idle_rate': 40, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 500}, {'energy': 194, 'idle': 40, 'total': 500}), ({'plug_in': 73, 'charge_end': 83, 'unplug': 283, 'wh': 4230, 'price_per_kwh': 35, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 1000, 'session_fee': 100, 'min_fee': 200}, {'energy': 149, 'idle': 1000, 'total': 1249}), ({'plug_in': 115, 'charge_end': 331, 'unplug': 346, 'wh': 4709, 'price_per_kwh': 52, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 3000, 'session_fee': 150, 'min_fee': 200}, {'energy': 245, 'idle': 0, 'total': 395}), ({'plug_in': 0, 'charge_end': 90, 'unplug': 106, 'wh': 12500, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 300}, {'energy': 438, 'idle': 50, 'total': 588}), ({'plug_in': 490, 'charge_end': 569, 'unplug': 569, 'wh': 4974, 'price_per_kwh': 52, 'idle_grace': 15, 'idle_rate': 100, 'idle_cap': 3000, 'session_fee': 100, 'min_fee': 300}, {'energy': 259, 'idle': 0, 'total': 359}), ({'plug_in': 157, 'charge_end': 214, 'unplug': 274, 'wh': 2276, 'price_per_kwh': 45, 'idle_grace': 10, 'idle_rate': 50, 'idle_cap': 1000, 'session_fee': 150, 'min_fee': 500}, {'energy': 103, 'idle': 250, 'total': 503}), ({'plug_in': 230, 'charge_end': 290, 'unplug': 306, 'wh': 27281, 'price_per_kwh': 45, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 3000, 'session_fee': 150, 'min_fee': 300}, {'energy': 1228, 'idle': 100, 'total': 1478})], [({'plug_in': 0, 'charge_end': 90, 'unplug': 106, 'wh': 12500, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 300}, {'energy': 438, 'idle': 50, 'total': 588}), ({'plug_in': 361, 'charge_end': 626, 'unplug': 626, 'wh': 29818, 'price_per_kwh': 52, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 2000, 'session_fee': 150, 'min_fee': 300}, {'energy': 1551, 'idle': 0, 'total': 1701}), ({'plug_in': 58, 'charge_end': 244, 'unplug': 260, 'wh': 4184, 'price_per_kwh': 45, 'idle_grace': 15, 'idle_rate': 100, 'idle_cap': 3000, 'session_fee': 100, 'min_fee': 300}, {'energy': 189, 'idle': 100, 'total': 389}), ({'plug_in': 34, 'charge_end': 215, 'unplug': 215, 'wh': 13150, 'price_per_kwh': 35, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 1000, 'session_fee': 100, 'min_fee': 500}, {'energy': 461, 'idle': 0, 'total': 561}), ({'plug_in': 30, 'charge_end': 45, 'unplug': 400, 'wh': 800, 'price_per_kwh': 29, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 1000, 'session_fee': 0, 'min_fee': 500}, {'energy': 24, 'idle': 1000, 'total': 1024}), ({'plug_in': 437, 'charge_end': 628, 'unplug': 628, 'wh': 6615, 'price_per_kwh': 45, 'idle_grace': 15, 'idle_rate': 100, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 300}, {'energy': 298, 'idle': 0, 'total': 398}), ({'plug_in': 86, 'charge_end': 283, 'unplug': 288, 'wh': 13385, 'price_per_kwh': 52, 'idle_grace': 15, 'idle_rate': 100, 'idle_cap': 1000, 'session_fee': 0, 'min_fee': 500}, {'energy': 697, 'idle': 0, 'total': 697}), ({'plug_in': 433, 'charge_end': 493, 'unplug': 893, 'wh': 1131, 'price_per_kwh': 45, 'idle_grace': 15, 'idle_rate': 40, 'idle_cap': 2000, 'session_fee': 0, 'min_fee': 200}, {'energy': 51, 'idle': 1560, 'total': 1611})], [({'plug_in': 30, 'charge_end': 45, 'unplug': 400, 'wh': 800, 'price_per_kwh': 29, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 1000, 'session_fee': 0, 'min_fee': 500}, {'energy': 24, 'idle': 1000, 'total': 1024}), ({'plug_in': 63, 'charge_end': 346, 'unplug': 406, 'wh': 5005, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 3000, 'session_fee': 150, 'min_fee': 500}, {'energy': 176, 'idle': 250, 'total': 576}), ({'plug_in': 197, 'charge_end': 253, 'unplug': 263, 'wh': 7897, 'price_per_kwh': 45, 'idle_grace': 15, 'idle_rate': 40, 'idle_cap': 3000, 'session_fee': 100, 'min_fee': 500}, {'energy': 356, 'idle': 0, 'total': 500}), ({'plug_in': 0, 'charge_end': 90, 'unplug': 106, 'wh': 12500, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 300}, {'energy': 438, 'idle': 50, 'total': 588}), ({'plug_in': 484, 'charge_end': 672, 'unplug': 682, 'wh': 3159, 'price_per_kwh': 52, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 3000, 'session_fee': 150, 'min_fee': 200}, {'energy': 165, 'idle': 0, 'total': 315}), ({'plug_in': 540, 'charge_end': 691, 'unplug': 691, 'wh': 40240, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 40, 'idle_cap': 3000, 'session_fee': 150, 'min_fee': 300}, {'energy': 1409, 'idle': 0, 'total': 1559}), ({'plug_in': 530, 'charge_end': 706, 'unplug': 722, 'wh': 19196, 'price_per_kwh': 29, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 200}, {'energy': 557, 'idle': 100, 'total': 757}), ({'plug_in': 103, 'charge_end': 177, 'unplug': 377, 'wh': 8629, 'price_per_kwh': 45, 'idle_grace': 10, 'idle_rate': 40, 'idle_cap': 3000, 'session_fee': 0, 'min_fee': 500}, {'energy': 389, 'idle': 760, 'total': 1149})], [({'plug_in': 537, 'charge_end': 679, 'unplug': 704, 'wh': 2203, 'price_per_kwh': 29, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 300}, {'energy': 64, 'idle': 200, 'total': 364}), ({'plug_in': 358, 'charge_end': 474, 'unplug': 484, 'wh': 14178, 'price_per_kwh': 29, 'idle_grace': 15, 'idle_rate': 40, 'idle_cap': 2000, 'session_fee': 150, 'min_fee': 500}, {'energy': 412, 'idle': 0, 'total': 562}), ({'plug_in': 193, 'charge_end': 361, 'unplug': 386, 'wh': 58152, 'price_per_kwh': 52, 'idle_grace': 15, 'idle_rate': 40, 'idle_cap': 1000, 'session_fee': 0, 'min_fee': 300}, {'energy': 3024, 'idle': 40, 'total': 3064}), ({'plug_in': 0, 'charge_end': 90, 'unplug': 106, 'wh': 12500, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 300}, {'energy': 438, 'idle': 50, 'total': 588}), ({'plug_in': 80, 'charge_end': 341, 'unplug': 346, 'wh': 6794, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 100, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 500}, {'energy': 238, 'idle': 0, 'total': 500}), ({'plug_in': 473, 'charge_end': 503, 'unplug': 519, 'wh': 7069, 'price_per_kwh': 45, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 3000, 'session_fee': 0, 'min_fee': 500}, {'energy': 319, 'idle': 100, 'total': 500}), ({'plug_in': 30, 'charge_end': 45, 'unplug': 400, 'wh': 800, 'price_per_kwh': 29, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 1000, 'session_fee': 0, 'min_fee': 500}, {'energy': 24, 'idle': 1000, 'total': 1024}), ({'plug_in': 411, 'charge_end': 481, 'unplug': 541, 'wh': 51535, 'price_per_kwh': 52, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 3000, 'session_fee': 150, 'min_fee': 500}, {'energy': 2680, 'idle': 250, 'total': 3080})]]
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 | {'energy': 438, 'idle': 50, 'total': 588} | {'energy': 438, 'idle': 50, 'total': 588} | Passed |
| fee oracle 1 | {'energy': 1631, 'idle': 1900, 'total': 3531} | {'energy': 1631, 'idle': 1900, 'total': 3531} | Passed |
| fee oracle 2 | {'energy': 290, 'idle': 0, 'total': 650} | {'energy': 290, 'idle': 0, 'total': 500} | Failed |
| fee oracle 3 | {'energy': 246, 'idle': 50, 'total': 300} | {'energy': 246, 'idle': 50, 'total': 300} | Passed |
| fee oracle 4 | {'energy': 149, 'idle': 100, 'total': 600} | {'energy': 149, 'idle': 100, 'total': 500} | Failed |
| fee oracle 5 | {'energy': 123, 'idle': 200, 'total': 650} | {'energy': 123, 'idle': 200, 'total': 500} | Failed |
| fee oracle 6 | {'energy': 1381, 'idle': 0, 'total': 1381} | {'energy': 1381, 'idle': 0, 'total': 1381} | Passed |
| fee oracle 7 | {'energy': 24, 'idle': 1000, 'total': 1024} | {'energy': 24, 'idle': 1000, 'total': 1024} | Passed |
SHA-256 / 0d841b6449c768e265558ffce829e1cb9ce54ffa6ab5b3075054457a82a2cbc3
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
energy = -(-x['wh'] * x['price_per_kwh'] // 1000)
idle = max(0, x['unplug'] - x['charge_end'] - x['idle_grace'])
idle_fee = min(x['idle_cap'], -(-idle // 10) * x['idle_rate'])
total = x['session_fee'] + energy + idle_fee
return {'energy': energy, 'idle': idle_fee, 'total': max(x['min_fee'], energy) + x['session_fee'] + idle_fee}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'plug_in': 0, 'charge_end': 90, 'unplug': 106, 'wh': 12500, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 300}, {'energy': 438, 'idle': 50, 'total': 588}), ({'plug_in': 93, 'charge_end': 112, 'unplug': 312, 'wh': 46598, 'price_per_kwh': 35, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 2000, 'session_fee': 0, 'min_fee': 500}, {'energy': 1631, 'idle': 1900, 'total': 3531}), ({'plug_in': 548, 'charge_end': 701, 'unplug': 706, 'wh': 9990, 'price_per_kwh': 29, 'idle_grace': 15, 'idle_rate': 40, 'idle_cap': 3000, 'session_fee': 150, 'min_fee': 500}, {'energy': 290, 'idle': 0, 'total': 500}), ({'plug_in': 502, 'charge_end': 683, 'unplug': 698, 'wh': 5462, 'price_per_kwh': 45, 'idle_grace': 10, 'idle_rate': 50, 'idle_cap': 1000, 'session_fee': 0, 'min_fee': 300}, {'energy': 246, 'idle': 50, 'total': 300}), ({'plug_in': 119, 'charge_end': 199, 'unplug': 215, 'wh': 5114, 'price_per_kwh': 29, 'idle_grace': 15, 'idle_rate': 100, 'idle_cap': 3000, 'session_fee': 100, 'min_fee': 500}, {'energy': 149, 'idle': 100, 'total': 500}), ({'plug_in': 74, 'charge_end': 111, 'unplug': 171, 'wh': 4221, 'price_per_kwh': 29, 'idle_grace': 15, 'idle_rate': 40, 'idle_cap': 3000, 'session_fee': 150, 'min_fee': 500}, {'energy': 123, 'idle': 200, 'total': 500}), ({'plug_in': 585, 'charge_end': 800, 'unplug': 810, 'wh': 39441, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 40, 'idle_cap': 2000, 'session_fee': 0, 'min_fee': 500}, {'energy': 1381, 'idle': 0, 'total': 1381}), ({'plug_in': 30, 'charge_end': 45, 'unplug': 400, 'wh': 800, 'price_per_kwh': 29, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 1000, 'session_fee': 0, 'min_fee': 500}, {'energy': 24, 'idle': 1000, 'total': 1024})], [({'plug_in': 30, 'charge_end': 45, 'unplug': 400, 'wh': 800, 'price_per_kwh': 29, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 1000, 'session_fee': 0, 'min_fee': 500}, {'energy': 24, 'idle': 1000, 'total': 1024}), ({'plug_in': 4, 'charge_end': 296, 'unplug': 312, 'wh': 3717, 'price_per_kwh': 52, 'idle_grace': 10, 'idle_rate': 40, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 500}, {'energy': 194, 'idle': 40, 'total': 500}), ({'plug_in': 73, 'charge_end': 83, 'unplug': 283, 'wh': 4230, 'price_per_kwh': 35, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 1000, 'session_fee': 100, 'min_fee': 200}, {'energy': 149, 'idle': 1000, 'total': 1249}), ({'plug_in': 115, 'charge_end': 331, 'unplug': 346, 'wh': 4709, 'price_per_kwh': 52, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 3000, 'session_fee': 150, 'min_fee': 200}, {'energy': 245, 'idle': 0, 'total': 395}), ({'plug_in': 0, 'charge_end': 90, 'unplug': 106, 'wh': 12500, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 300}, {'energy': 438, 'idle': 50, 'total': 588}), ({'plug_in': 490, 'charge_end': 569, 'unplug': 569, 'wh': 4974, 'price_per_kwh': 52, 'idle_grace': 15, 'idle_rate': 100, 'idle_cap': 3000, 'session_fee': 100, 'min_fee': 300}, {'energy': 259, 'idle': 0, 'total': 359}), ({'plug_in': 157, 'charge_end': 214, 'unplug': 274, 'wh': 2276, 'price_per_kwh': 45, 'idle_grace': 10, 'idle_rate': 50, 'idle_cap': 1000, 'session_fee': 150, 'min_fee': 500}, {'energy': 103, 'idle': 250, 'total': 503}), ({'plug_in': 230, 'charge_end': 290, 'unplug': 306, 'wh': 27281, 'price_per_kwh': 45, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 3000, 'session_fee': 150, 'min_fee': 300}, {'energy': 1228, 'idle': 100, 'total': 1478})], [({'plug_in': 0, 'charge_end': 90, 'unplug': 106, 'wh': 12500, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 300}, {'energy': 438, 'idle': 50, 'total': 588}), ({'plug_in': 361, 'charge_end': 626, 'unplug': 626, 'wh': 29818, 'price_per_kwh': 52, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 2000, 'session_fee': 150, 'min_fee': 300}, {'energy': 1551, 'idle': 0, 'total': 1701}), ({'plug_in': 58, 'charge_end': 244, 'unplug': 260, 'wh': 4184, 'price_per_kwh': 45, 'idle_grace': 15, 'idle_rate': 100, 'idle_cap': 3000, 'session_fee': 100, 'min_fee': 300}, {'energy': 189, 'idle': 100, 'total': 389}), ({'plug_in': 34, 'charge_end': 215, 'unplug': 215, 'wh': 13150, 'price_per_kwh': 35, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 1000, 'session_fee': 100, 'min_fee': 500}, {'energy': 461, 'idle': 0, 'total': 561}), ({'plug_in': 30, 'charge_end': 45, 'unplug': 400, 'wh': 800, 'price_per_kwh': 29, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 1000, 'session_fee': 0, 'min_fee': 500}, {'energy': 24, 'idle': 1000, 'total': 1024}), ({'plug_in': 437, 'charge_end': 628, 'unplug': 628, 'wh': 6615, 'price_per_kwh': 45, 'idle_grace': 15, 'idle_rate': 100, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 300}, {'energy': 298, 'idle': 0, 'total': 398}), ({'plug_in': 86, 'charge_end': 283, 'unplug': 288, 'wh': 13385, 'price_per_kwh': 52, 'idle_grace': 15, 'idle_rate': 100, 'idle_cap': 1000, 'session_fee': 0, 'min_fee': 500}, {'energy': 697, 'idle': 0, 'total': 697}), ({'plug_in': 433, 'charge_end': 493, 'unplug': 893, 'wh': 1131, 'price_per_kwh': 45, 'idle_grace': 15, 'idle_rate': 40, 'idle_cap': 2000, 'session_fee': 0, 'min_fee': 200}, {'energy': 51, 'idle': 1560, 'total': 1611})], [({'plug_in': 30, 'charge_end': 45, 'unplug': 400, 'wh': 800, 'price_per_kwh': 29, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 1000, 'session_fee': 0, 'min_fee': 500}, {'energy': 24, 'idle': 1000, 'total': 1024}), ({'plug_in': 63, 'charge_end': 346, 'unplug': 406, 'wh': 5005, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 3000, 'session_fee': 150, 'min_fee': 500}, {'energy': 176, 'idle': 250, 'total': 576}), ({'plug_in': 197, 'charge_end': 253, 'unplug': 263, 'wh': 7897, 'price_per_kwh': 45, 'idle_grace': 15, 'idle_rate': 40, 'idle_cap': 3000, 'session_fee': 100, 'min_fee': 500}, {'energy': 356, 'idle': 0, 'total': 500}), ({'plug_in': 0, 'charge_end': 90, 'unplug': 106, 'wh': 12500, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 300}, {'energy': 438, 'idle': 50, 'total': 588}), ({'plug_in': 484, 'charge_end': 672, 'unplug': 682, 'wh': 3159, 'price_per_kwh': 52, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 3000, 'session_fee': 150, 'min_fee': 200}, {'energy': 165, 'idle': 0, 'total': 315}), ({'plug_in': 540, 'charge_end': 691, 'unplug': 691, 'wh': 40240, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 40, 'idle_cap': 3000, 'session_fee': 150, 'min_fee': 300}, {'energy': 1409, 'idle': 0, 'total': 1559}), ({'plug_in': 530, 'charge_end': 706, 'unplug': 722, 'wh': 19196, 'price_per_kwh': 29, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 200}, {'energy': 557, 'idle': 100, 'total': 757}), ({'plug_in': 103, 'charge_end': 177, 'unplug': 377, 'wh': 8629, 'price_per_kwh': 45, 'idle_grace': 10, 'idle_rate': 40, 'idle_cap': 3000, 'session_fee': 0, 'min_fee': 500}, {'energy': 389, 'idle': 760, 'total': 1149})], [({'plug_in': 537, 'charge_end': 679, 'unplug': 704, 'wh': 2203, 'price_per_kwh': 29, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 300}, {'energy': 64, 'idle': 200, 'total': 364}), ({'plug_in': 358, 'charge_end': 474, 'unplug': 484, 'wh': 14178, 'price_per_kwh': 29, 'idle_grace': 15, 'idle_rate': 40, 'idle_cap': 2000, 'session_fee': 150, 'min_fee': 500}, {'energy': 412, 'idle': 0, 'total': 562}), ({'plug_in': 193, 'charge_end': 361, 'unplug': 386, 'wh': 58152, 'price_per_kwh': 52, 'idle_grace': 15, 'idle_rate': 40, 'idle_cap': 1000, 'session_fee': 0, 'min_fee': 300}, {'energy': 3024, 'idle': 40, 'total': 3064}), ({'plug_in': 0, 'charge_end': 90, 'unplug': 106, 'wh': 12500, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 300}, {'energy': 438, 'idle': 50, 'total': 588}), ({'plug_in': 80, 'charge_end': 341, 'unplug': 346, 'wh': 6794, 'price_per_kwh': 35, 'idle_grace': 15, 'idle_rate': 100, 'idle_cap': 2000, 'session_fee': 100, 'min_fee': 500}, {'energy': 238, 'idle': 0, 'total': 500}), ({'plug_in': 473, 'charge_end': 503, 'unplug': 519, 'wh': 7069, 'price_per_kwh': 45, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 3000, 'session_fee': 0, 'min_fee': 500}, {'energy': 319, 'idle': 100, 'total': 500}), ({'plug_in': 30, 'charge_end': 45, 'unplug': 400, 'wh': 800, 'price_per_kwh': 29, 'idle_grace': 10, 'idle_rate': 100, 'idle_cap': 1000, 'session_fee': 0, 'min_fee': 500}, {'energy': 24, 'idle': 1000, 'total': 1024}), ({'plug_in': 411, 'charge_end': 481, 'unplug': 541, 'wh': 51535, 'price_per_kwh': 52, 'idle_grace': 15, 'idle_rate': 50, 'idle_cap': 3000, 'session_fee': 150, 'min_fee': 500}, {'energy': 2680, 'idle': 250, 'total': 3080})]]
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 | {'energy': 438, 'idle': 50, 'total': 588} | {'energy': 438, 'idle': 50, 'total': 588} | Passed |
| fee oracle 1 | {'energy': 1631, 'idle': 1900, 'total': 3531} | {'energy': 1631, 'idle': 1900, 'total': 3531} | Passed |
| fee oracle 2 | {'energy': 290, 'idle': 0, 'total': 650} | {'energy': 290, 'idle': 0, 'total': 500} | Failed |
| fee oracle 3 | {'energy': 246, 'idle': 50, 'total': 350} | {'energy': 246, 'idle': 50, 'total': 300} | Failed |
| fee oracle 4 | {'energy': 149, 'idle': 100, 'total': 700} | {'energy': 149, 'idle': 100, 'total': 500} | Failed |
| fee oracle 5 | {'energy': 123, 'idle': 200, 'total': 850} | {'energy': 123, 'idle': 200, 'total': 500} | Failed |
| fee oracle 6 | {'energy': 1381, 'idle': 0, 'total': 1381} | {'energy': 1381, 'idle': 0, 'total': 1381} | Passed |
| fee oracle 7 | {'energy': 24, 'idle': 1000, 'total': 1500} | {'energy': 24, 'idle': 1000, 'total': 1024} | Failed |
SHA-256 / 8415f323688c07c78804c1b4a84dc57b00ad18d27cca03179b5319aba9006187
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:04.838482+00:00.
Case digest / dce671fb935aaafa93417312d58e5714f1dc1452a4914f4b2266967213ad11db