FAILURE MAP
← Case archive

FA-93211 / EV charging session scheduling / Open access

Connector session state machine: unplug while charging banks time · case 01

Sessions ended by pulling the cable report too little charging time.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The unplug handler does not bank the running charging interval.

VERIFIED REPAIR

Bank t - since when unplugging from Charging.

Unsuccessful approach: Measuring from plug-in adds the preparation time to charging time.

Case contract

Chronological [t, event] pairs drive states Available, Preparing, Charging, SuspendedEV, Finishing. plug: Available->Preparing. auth: Preparing->Charging. ev_pause/ev_resume toggle Charging/SuspendedEV. stop: Charging or SuspendedEV->Finishing. unplug: any non-Available state ->Available, counted abrupt from Charging or SuspendedEV. Before handling each event, a Preparing connector whose plug is more than timeout seconds old returns to Available (one timeout). Invalid events are ignored. Return [state, seconds spent in Charging, timeouts, abrupt].

Why this case matters

Depot, workplace and public EV chargers schedule sessions against prices, circuit limits and departure deadlines; a wrong decision silently strands a driver or overloads a feeder.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events, timeout):
    state = 'Available'
    plug_t = None
    since = None
    charged = 0
    timeouts = 0
    abrupt = 0
    for t, ev in events:
        if state == 'Preparing' and t - plug_t > timeout:
            state = 'Available'
            timeouts += 1
        if ev == 'plug' and state == 'Available':
            state = 'Preparing'
            plug_t = t
        elif ev == 'auth' and state == 'Preparing':
            state = 'Charging'
            since = t
        elif ev == 'ev_pause' and state == 'Charging':
            charged += t - since
            state = 'SuspendedEV'
        elif ev == 'ev_resume' and state == 'SuspendedEV':
            state = 'Charging'
            since = t
        elif ev == 'stop' and state in ('Charging', 'SuspendedEV'):
            if state == 'Charging':
                charged += t - since
            state = 'Finishing'
        elif ev == 'unplug' and state != 'Available':
            if state == 'Charging':
                pass
            if state in ('Charging', 'SuspendedEV'):
                abrupt += 1
            state = 'Available'
    return [state, charged, timeouts, abrupt]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['boundary: authorised exactly at timeout', [[[0, 'plug'], [60, 'auth'], [100, 'stop']], 60],
   ['Finishing', 40, 0, 0]],
  ['normal: pause and resume',
   [[[0, 'plug'], [5, 'auth'], [65, 'ev_pause'], [125, 'ev_resume'], [185, 'stop'],
     [190, 'unplug']],
    60],
   ['Available', 120, 0, 0]],
  ['boundary: unplug while charging', [[[0, 'plug'], [10, 'auth'], [70, 'unplug']], 60],
   ['Available', 60, 0, 1]],
  ['regression: unplug while charging banks time',
   [[[300, 'plug'], [305, 'auth'], [310, 'unplug'], [320, 'unplug']], 30], ['Available', 5, 0, 1]],
  ['regression: unplug while charging banks time (partial repair)',
   [[[30, 'ev_pause'], [91, 'unplug'], [151, 'plug'], [151, 'ev_resume'], [212, 'unplug'],
     [242, 'auth'], [252, 'plug'], [312, 'auth'], [312, 'unplug']],
    90],
   ['Available', 0, 0, 1]],
  ['control 1',
   [[[5, 'plug'], [5, 'plug'], [15, 'plug'], [315, 'auth'], [376, 'ev_resume'], [496, 'auth'],
     [796, 'auth'], [1096, 'unplug']],
    60],
   ['Available', 0, 1, 0]],
  ['control 2', [[[30, 'unplug'], [91, 'auth'], [96, 'unplug'], [106, 'ev_resume']], 90],
   ['Available', 0, 0, 0]]],
 [['boundary: authorised exactly at timeout', [[[0, 'plug'], [60, 'auth'], [100, 'stop']], 60],
   ['Finishing', 40, 0, 0]],
  ['normal: pause and resume',
   [[[0, 'plug'], [5, 'auth'], [65, 'ev_pause'], [125, 'ev_resume'], [185, 'stop'],
     [190, 'unplug']],
    60],
   ['Available', 120, 0, 0]],
  ['boundary: unplug while charging', [[[0, 'plug'], [10, 'auth'], [70, 'unplug']], 60],
   ['Available', 60, 0, 1]],
  ['regression: unplug while charging banks time',
   [[[30, 'auth'], [90, 'plug'], [90, 'ev_pause'], [150, 'auth'], [180, 'plug'], [190, 'unplug']],
    90],
   ['Available', 40, 0, 1]],
  ['regression: unplug while charging banks time (partial repair)',
   [[[30, 'ev_pause'], [91, 'unplug'], [151, 'plug'], [151, 'ev_resume'], [212, 'unplug'],
     [242, 'auth'], [252, 'plug'], [312, 'auth'], [312, 'unplug']],
    90],
   ['Available', 0, 0, 1]],
  ['control 1', [[[120, 'auth'], [240, 'ev_resume'], [540, 'unplug']], 60], ['Available', 0, 0, 0]],
  ['control 2', [[[60, 'unplug'], [180, 'stop'], [240, 'stop'], [270, 'unplug']], 60],
   ['Available', 0, 0, 0]]],
 [['boundary: authorised exactly at timeout', [[[0, 'plug'], [60, 'auth'], [100, 'stop']], 60],
   ['Finishing', 40, 0, 0]],
  ['normal: pause and resume',
   [[[0, 'plug'], [5, 'auth'], [65, 'ev_pause'], [125, 'ev_resume'], [185, 'stop'],
     [190, 'unplug']],
    60],
   ['Available', 120, 0, 0]],
  ['boundary: unplug while charging', [[[0, 'plug'], [10, 'auth'], [70, 'unplug']], 60],
   ['Available', 60, 0, 1]],
  ['regression: unplug while charging banks time',
   [[[30, 'auth'], [90, 'plug'], [90, 'ev_pause'], [150, 'auth'], [180, 'plug'], [190, 'unplug']],
    90],
   ['Available', 40, 0, 1]],
  ['regression: unplug while charging banks time (partial repair)',
   [[[120, 'stop'], [240, 'unplug'], [540, 'plug'], [570, 'auth'], [580, 'auth'], [610, 'plug'],
     [610, 'unplug']],
    90],
   ['Available', 40, 0, 1]],
  ['control 1', [[[0, 'unplug'], [10, 'ev_pause'], [10, 'plug']], 60], ['Preparing', 0, 0, 0]],
  ['control 2', [[[300, 'plug'], [360, 'ev_pause'], [421, 'ev_pause']], 30],
   ['Available', 0, 1, 0]]],
 [['boundary: authorised exactly at timeout', [[[0, 'plug'], [60, 'auth'], [100, 'stop']], 60],
   ['Finishing', 40, 0, 0]],
  ['normal: pause and resume',
   [[[0, 'plug'], [5, 'auth'], [65, 'ev_pause'], [125, 'ev_resume'], [185, 'stop'],
     [190, 'unplug']],
    60],
   ['Available', 120, 0, 0]],
  ['boundary: unplug while charging', [[[0, 'plug'], [10, 'auth'], [70, 'unplug']], 60],
   ['Available', 60, 0, 1]],
  ['regression: unplug while charging banks time',
   [[[30, 'plug'], [35, 'plug'], [45, 'auth'], [45, 'plug'], [106, 'auth'], [166, 'unplug'],
     [166, 'auth']],
    30],
   ['Available', 121, 0, 1]],
  ['regression: unplug while charging banks time (partial repair)',
   [[[120, 'stop'], [181, 'plug'], [242, 'unplug'], [252, 'plug'], [257, 'auth'], [317, 'unplug'],
     [347, 'auth'], [647, 'plug'], [947, 'plug']],
    90],
   ['Preparing', 60, 1, 1]],
  ['control 1',
   [[[61, 'auth'], [91, 'unplug'], [211, 'unplug'], [221, 'ev_resume'], [281, 'plug'],
     [311, 'ev_pause'], [321, 'unplug'], [326, 'plug']],
    30],
   ['Preparing', 0, 1, 0]],
  ['control 2',
   [[[300, 'plug'], [600, 'ev_resume'], [900, 'ev_resume'], [961, 'unplug'], [966, 'auth'],
     [971, 'unplug'], [1271, 'auth'], [1276, 'ev_pause']],
    60],
   ['Available', 0, 1, 0]]],
 [['boundary: authorised exactly at timeout', [[[0, 'plug'], [60, 'auth'], [100, 'stop']], 60],
   ['Finishing', 40, 0, 0]],
  ['normal: pause and resume',
   [[[0, 'plug'], [5, 'auth'], [65, 'ev_pause'], [125, 'ev_resume'], [185, 'stop'],
     [190, 'unplug']],
    60],
   ['Available', 120, 0, 0]],
  ['boundary: unplug while charging', [[[0, 'plug'], [10, 'auth'], [70, 'unplug']], 60],
   ['Available', 60, 0, 1]],
  ['regression: unplug while charging banks time',
   [[[60, 'plug'], [65, 'unplug'], [126, 'plug'], [131, 'ev_resume'], [141, 'auth'],
     [441, 'unplug']],
    60],
   ['Available', 300, 0, 1]],
  ['regression: unplug while charging banks time (partial repair)',
   [[[0, 'unplug'], [5, 'unplug'], [5, 'plug'], [35, 'auth'], [95, 'ev_pause'], [100, 'ev_resume'],
     [130, 'plug'], [160, 'unplug'], [160, 'plug'], [160, 'plug']],
    60],
   ['Preparing', 120, 0, 1]],
  ['control 1', [[[61, 'unplug'], [361, 'auth'], [421, 'unplug'], [426, 'ev_pause']], 60],
   ['Available', 0, 0, 0]],
  ['control 2',
   [[[5, 'ev_resume'], [305, 'unplug'], [605, 'plug'], [665, 'ev_resume'], [670, 'ev_resume']], 60],
   ['Available', 0, 1, 0]]]]
for label, args, expected in fixtures[N-1]:
    check(label, 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 fixtureActualExpectedOutcome
boundary: authorised exactly at timeout['Finishing', 40, 0, 0]['Finishing', 40, 0, 0]Passed
normal: pause and resume['Available', 120, 0, 0]['Available', 120, 0, 0]Passed
boundary: unplug while charging['Available', 0, 0, 1]['Available', 60, 0, 1]Failed
regression: unplug while charging banks time['Available', 0, 0, 1]['Available', 5, 0, 1]Failed
regression: unplug while charging banks time (partial repair)['Available', 0, 0, 1]['Available', 0, 0, 1]Passed
control 1['Available', 0, 1, 0]['Available', 0, 1, 0]Passed
control 2['Available', 0, 0, 0]['Available', 0, 0, 0]Passed

SHA-256 / 27a740e70e0598b374cfd42a11344be2a0aa93d7dd0ddf0adf5d320205c54a2f

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events, timeout):
    state = 'Available'
    plug_t = None
    since = None
    charged = 0
    timeouts = 0
    abrupt = 0
    for t, ev in events:
        if state == 'Preparing' and t - plug_t > timeout:
            state = 'Available'
            timeouts += 1
        if ev == 'plug' and state == 'Available':
            state = 'Preparing'
            plug_t = t
        elif ev == 'auth' and state == 'Preparing':
            state = 'Charging'
            since = t
        elif ev == 'ev_pause' and state == 'Charging':
            charged += t - since
            state = 'SuspendedEV'
        elif ev == 'ev_resume' and state == 'SuspendedEV':
            state = 'Charging'
            since = t
        elif ev == 'stop' and state in ('Charging', 'SuspendedEV'):
            if state == 'Charging':
                charged += t - since
            state = 'Finishing'
        elif ev == 'unplug' and state != 'Available':
            if state == 'Charging':
                charged += t - plug_t
            if state in ('Charging', 'SuspendedEV'):
                abrupt += 1
            state = 'Available'
    return [state, charged, timeouts, abrupt]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['boundary: authorised exactly at timeout', [[[0, 'plug'], [60, 'auth'], [100, 'stop']], 60],
   ['Finishing', 40, 0, 0]],
  ['normal: pause and resume',
   [[[0, 'plug'], [5, 'auth'], [65, 'ev_pause'], [125, 'ev_resume'], [185, 'stop'],
     [190, 'unplug']],
    60],
   ['Available', 120, 0, 0]],
  ['boundary: unplug while charging', [[[0, 'plug'], [10, 'auth'], [70, 'unplug']], 60],
   ['Available', 60, 0, 1]],
  ['regression: unplug while charging banks time',
   [[[300, 'plug'], [305, 'auth'], [310, 'unplug'], [320, 'unplug']], 30], ['Available', 5, 0, 1]],
  ['regression: unplug while charging banks time (partial repair)',
   [[[30, 'ev_pause'], [91, 'unplug'], [151, 'plug'], [151, 'ev_resume'], [212, 'unplug'],
     [242, 'auth'], [252, 'plug'], [312, 'auth'], [312, 'unplug']],
    90],
   ['Available', 0, 0, 1]],
  ['control 1',
   [[[5, 'plug'], [5, 'plug'], [15, 'plug'], [315, 'auth'], [376, 'ev_resume'], [496, 'auth'],
     [796, 'auth'], [1096, 'unplug']],
    60],
   ['Available', 0, 1, 0]],
  ['control 2', [[[30, 'unplug'], [91, 'auth'], [96, 'unplug'], [106, 'ev_resume']], 90],
   ['Available', 0, 0, 0]]],
 [['boundary: authorised exactly at timeout', [[[0, 'plug'], [60, 'auth'], [100, 'stop']], 60],
   ['Finishing', 40, 0, 0]],
  ['normal: pause and resume',
   [[[0, 'plug'], [5, 'auth'], [65, 'ev_pause'], [125, 'ev_resume'], [185, 'stop'],
     [190, 'unplug']],
    60],
   ['Available', 120, 0, 0]],
  ['boundary: unplug while charging', [[[0, 'plug'], [10, 'auth'], [70, 'unplug']], 60],
   ['Available', 60, 0, 1]],
  ['regression: unplug while charging banks time',
   [[[30, 'auth'], [90, 'plug'], [90, 'ev_pause'], [150, 'auth'], [180, 'plug'], [190, 'unplug']],
    90],
   ['Available', 40, 0, 1]],
  ['regression: unplug while charging banks time (partial repair)',
   [[[30, 'ev_pause'], [91, 'unplug'], [151, 'plug'], [151, 'ev_resume'], [212, 'unplug'],
     [242, 'auth'], [252, 'plug'], [312, 'auth'], [312, 'unplug']],
    90],
   ['Available', 0, 0, 1]],
  ['control 1', [[[120, 'auth'], [240, 'ev_resume'], [540, 'unplug']], 60], ['Available', 0, 0, 0]],
  ['control 2', [[[60, 'unplug'], [180, 'stop'], [240, 'stop'], [270, 'unplug']], 60],
   ['Available', 0, 0, 0]]],
 [['boundary: authorised exactly at timeout', [[[0, 'plug'], [60, 'auth'], [100, 'stop']], 60],
   ['Finishing', 40, 0, 0]],
  ['normal: pause and resume',
   [[[0, 'plug'], [5, 'auth'], [65, 'ev_pause'], [125, 'ev_resume'], [185, 'stop'],
     [190, 'unplug']],
    60],
   ['Available', 120, 0, 0]],
  ['boundary: unplug while charging', [[[0, 'plug'], [10, 'auth'], [70, 'unplug']], 60],
   ['Available', 60, 0, 1]],
  ['regression: unplug while charging banks time',
   [[[30, 'auth'], [90, 'plug'], [90, 'ev_pause'], [150, 'auth'], [180, 'plug'], [190, 'unplug']],
    90],
   ['Available', 40, 0, 1]],
  ['regression: unplug while charging banks time (partial repair)',
   [[[120, 'stop'], [240, 'unplug'], [540, 'plug'], [570, 'auth'], [580, 'auth'], [610, 'plug'],
     [610, 'unplug']],
    90],
   ['Available', 40, 0, 1]],
  ['control 1', [[[0, 'unplug'], [10, 'ev_pause'], [10, 'plug']], 60], ['Preparing', 0, 0, 0]],
  ['control 2', [[[300, 'plug'], [360, 'ev_pause'], [421, 'ev_pause']], 30],
   ['Available', 0, 1, 0]]],
 [['boundary: authorised exactly at timeout', [[[0, 'plug'], [60, 'auth'], [100, 'stop']], 60],
   ['Finishing', 40, 0, 0]],
  ['normal: pause and resume',
   [[[0, 'plug'], [5, 'auth'], [65, 'ev_pause'], [125, 'ev_resume'], [185, 'stop'],
     [190, 'unplug']],
    60],
   ['Available', 120, 0, 0]],
  ['boundary: unplug while charging', [[[0, 'plug'], [10, 'auth'], [70, 'unplug']], 60],
   ['Available', 60, 0, 1]],
  ['regression: unplug while charging banks time',
   [[[30, 'plug'], [35, 'plug'], [45, 'auth'], [45, 'plug'], [106, 'auth'], [166, 'unplug'],
     [166, 'auth']],
    30],
   ['Available', 121, 0, 1]],
  ['regression: unplug while charging banks time (partial repair)',
   [[[120, 'stop'], [181, 'plug'], [242, 'unplug'], [252, 'plug'], [257, 'auth'], [317, 'unplug'],
     [347, 'auth'], [647, 'plug'], [947, 'plug']],
    90],
   ['Preparing', 60, 1, 1]],
  ['control 1',
   [[[61, 'auth'], [91, 'unplug'], [211, 'unplug'], [221, 'ev_resume'], [281, 'plug'],
     [311, 'ev_pause'], [321, 'unplug'], [326, 'plug']],
    30],
   ['Preparing', 0, 1, 0]],
  ['control 2',
   [[[300, 'plug'], [600, 'ev_resume'], [900, 'ev_resume'], [961, 'unplug'], [966, 'auth'],
     [971, 'unplug'], [1271, 'auth'], [1276, 'ev_pause']],
    60],
   ['Available', 0, 1, 0]]],
 [['boundary: authorised exactly at timeout', [[[0, 'plug'], [60, 'auth'], [100, 'stop']], 60],
   ['Finishing', 40, 0, 0]],
  ['normal: pause and resume',
   [[[0, 'plug'], [5, 'auth'], [65, 'ev_pause'], [125, 'ev_resume'], [185, 'stop'],
     [190, 'unplug']],
    60],
   ['Available', 120, 0, 0]],
  ['boundary: unplug while charging', [[[0, 'plug'], [10, 'auth'], [70, 'unplug']], 60],
   ['Available', 60, 0, 1]],
  ['regression: unplug while charging banks time',
   [[[60, 'plug'], [65, 'unplug'], [126, 'plug'], [131, 'ev_resume'], [141, 'auth'],
     [441, 'unplug']],
    60],
   ['Available', 300, 0, 1]],
  ['regression: unplug while charging banks time (partial repair)',
   [[[0, 'unplug'], [5, 'unplug'], [5, 'plug'], [35, 'auth'], [95, 'ev_pause'], [100, 'ev_resume'],
     [130, 'plug'], [160, 'unplug'], [160, 'plug'], [160, 'plug']],
    60],
   ['Preparing', 120, 0, 1]],
  ['control 1', [[[61, 'unplug'], [361, 'auth'], [421, 'unplug'], [426, 'ev_pause']], 60],
   ['Available', 0, 0, 0]],
  ['control 2',
   [[[5, 'ev_resume'], [305, 'unplug'], [605, 'plug'], [665, 'ev_resume'], [670, 'ev_resume']], 60],
   ['Available', 0, 1, 0]]]]
for label, args, expected in fixtures[N-1]:
    check(label, 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 fixtureActualExpectedOutcome
boundary: authorised exactly at timeout['Finishing', 40, 0, 0]['Finishing', 40, 0, 0]Passed
normal: pause and resume['Available', 120, 0, 0]['Available', 120, 0, 0]Passed
boundary: unplug while charging['Available', 70, 0, 1]['Available', 60, 0, 1]Failed
regression: unplug while charging banks time['Available', 10, 0, 1]['Available', 5, 0, 1]Failed
regression: unplug while charging banks time (partial repair)['Available', 60, 0, 1]['Available', 0, 0, 1]Failed
control 1['Available', 0, 1, 0]['Available', 0, 1, 0]Passed
control 2['Available', 0, 0, 0]['Available', 0, 0, 0]Passed

SHA-256 / f6e5c3387b81e3963e841f4e20ac663c8d3c4684049864b0b113c967c29998f9

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events, timeout):
    state = 'Available'
    plug_t = None
    since = None
    charged = 0
    timeouts = 0
    abrupt = 0
    for t, ev in events:
        if state == 'Preparing' and t - plug_t > timeout:
            state = 'Available'
            timeouts += 1
        if ev == 'plug' and state == 'Available':
            state = 'Preparing'
            plug_t = t
        elif ev == 'auth' and state == 'Preparing':
            state = 'Charging'
            since = t
        elif ev == 'ev_pause' and state == 'Charging':
            charged += t - since
            state = 'SuspendedEV'
        elif ev == 'ev_resume' and state == 'SuspendedEV':
            state = 'Charging'
            since = t
        elif ev == 'stop' and state in ('Charging', 'SuspendedEV'):
            if state == 'Charging':
                charged += t - since
            state = 'Finishing'
        elif ev == 'unplug' and state != 'Available':
            if state == 'Charging':
                charged += t - since
            if state in ('Charging', 'SuspendedEV'):
                abrupt += 1
            state = 'Available'
    return [state, charged, timeouts, abrupt]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['boundary: authorised exactly at timeout', [[[0, 'plug'], [60, 'auth'], [100, 'stop']], 60],
   ['Finishing', 40, 0, 0]],
  ['normal: pause and resume',
   [[[0, 'plug'], [5, 'auth'], [65, 'ev_pause'], [125, 'ev_resume'], [185, 'stop'],
     [190, 'unplug']],
    60],
   ['Available', 120, 0, 0]],
  ['boundary: unplug while charging', [[[0, 'plug'], [10, 'auth'], [70, 'unplug']], 60],
   ['Available', 60, 0, 1]],
  ['regression: unplug while charging banks time',
   [[[300, 'plug'], [305, 'auth'], [310, 'unplug'], [320, 'unplug']], 30], ['Available', 5, 0, 1]],
  ['regression: unplug while charging banks time (partial repair)',
   [[[30, 'ev_pause'], [91, 'unplug'], [151, 'plug'], [151, 'ev_resume'], [212, 'unplug'],
     [242, 'auth'], [252, 'plug'], [312, 'auth'], [312, 'unplug']],
    90],
   ['Available', 0, 0, 1]],
  ['control 1',
   [[[5, 'plug'], [5, 'plug'], [15, 'plug'], [315, 'auth'], [376, 'ev_resume'], [496, 'auth'],
     [796, 'auth'], [1096, 'unplug']],
    60],
   ['Available', 0, 1, 0]],
  ['control 2', [[[30, 'unplug'], [91, 'auth'], [96, 'unplug'], [106, 'ev_resume']], 90],
   ['Available', 0, 0, 0]]],
 [['boundary: authorised exactly at timeout', [[[0, 'plug'], [60, 'auth'], [100, 'stop']], 60],
   ['Finishing', 40, 0, 0]],
  ['normal: pause and resume',
   [[[0, 'plug'], [5, 'auth'], [65, 'ev_pause'], [125, 'ev_resume'], [185, 'stop'],
     [190, 'unplug']],
    60],
   ['Available', 120, 0, 0]],
  ['boundary: unplug while charging', [[[0, 'plug'], [10, 'auth'], [70, 'unplug']], 60],
   ['Available', 60, 0, 1]],
  ['regression: unplug while charging banks time',
   [[[30, 'auth'], [90, 'plug'], [90, 'ev_pause'], [150, 'auth'], [180, 'plug'], [190, 'unplug']],
    90],
   ['Available', 40, 0, 1]],
  ['regression: unplug while charging banks time (partial repair)',
   [[[30, 'ev_pause'], [91, 'unplug'], [151, 'plug'], [151, 'ev_resume'], [212, 'unplug'],
     [242, 'auth'], [252, 'plug'], [312, 'auth'], [312, 'unplug']],
    90],
   ['Available', 0, 0, 1]],
  ['control 1', [[[120, 'auth'], [240, 'ev_resume'], [540, 'unplug']], 60], ['Available', 0, 0, 0]],
  ['control 2', [[[60, 'unplug'], [180, 'stop'], [240, 'stop'], [270, 'unplug']], 60],
   ['Available', 0, 0, 0]]],
 [['boundary: authorised exactly at timeout', [[[0, 'plug'], [60, 'auth'], [100, 'stop']], 60],
   ['Finishing', 40, 0, 0]],
  ['normal: pause and resume',
   [[[0, 'plug'], [5, 'auth'], [65, 'ev_pause'], [125, 'ev_resume'], [185, 'stop'],
     [190, 'unplug']],
    60],
   ['Available', 120, 0, 0]],
  ['boundary: unplug while charging', [[[0, 'plug'], [10, 'auth'], [70, 'unplug']], 60],
   ['Available', 60, 0, 1]],
  ['regression: unplug while charging banks time',
   [[[30, 'auth'], [90, 'plug'], [90, 'ev_pause'], [150, 'auth'], [180, 'plug'], [190, 'unplug']],
    90],
   ['Available', 40, 0, 1]],
  ['regression: unplug while charging banks time (partial repair)',
   [[[120, 'stop'], [240, 'unplug'], [540, 'plug'], [570, 'auth'], [580, 'auth'], [610, 'plug'],
     [610, 'unplug']],
    90],
   ['Available', 40, 0, 1]],
  ['control 1', [[[0, 'unplug'], [10, 'ev_pause'], [10, 'plug']], 60], ['Preparing', 0, 0, 0]],
  ['control 2', [[[300, 'plug'], [360, 'ev_pause'], [421, 'ev_pause']], 30],
   ['Available', 0, 1, 0]]],
 [['boundary: authorised exactly at timeout', [[[0, 'plug'], [60, 'auth'], [100, 'stop']], 60],
   ['Finishing', 40, 0, 0]],
  ['normal: pause and resume',
   [[[0, 'plug'], [5, 'auth'], [65, 'ev_pause'], [125, 'ev_resume'], [185, 'stop'],
     [190, 'unplug']],
    60],
   ['Available', 120, 0, 0]],
  ['boundary: unplug while charging', [[[0, 'plug'], [10, 'auth'], [70, 'unplug']], 60],
   ['Available', 60, 0, 1]],
  ['regression: unplug while charging banks time',
   [[[30, 'plug'], [35, 'plug'], [45, 'auth'], [45, 'plug'], [106, 'auth'], [166, 'unplug'],
     [166, 'auth']],
    30],
   ['Available', 121, 0, 1]],
  ['regression: unplug while charging banks time (partial repair)',
   [[[120, 'stop'], [181, 'plug'], [242, 'unplug'], [252, 'plug'], [257, 'auth'], [317, 'unplug'],
     [347, 'auth'], [647, 'plug'], [947, 'plug']],
    90],
   ['Preparing', 60, 1, 1]],
  ['control 1',
   [[[61, 'auth'], [91, 'unplug'], [211, 'unplug'], [221, 'ev_resume'], [281, 'plug'],
     [311, 'ev_pause'], [321, 'unplug'], [326, 'plug']],
    30],
   ['Preparing', 0, 1, 0]],
  ['control 2',
   [[[300, 'plug'], [600, 'ev_resume'], [900, 'ev_resume'], [961, 'unplug'], [966, 'auth'],
     [971, 'unplug'], [1271, 'auth'], [1276, 'ev_pause']],
    60],
   ['Available', 0, 1, 0]]],
 [['boundary: authorised exactly at timeout', [[[0, 'plug'], [60, 'auth'], [100, 'stop']], 60],
   ['Finishing', 40, 0, 0]],
  ['normal: pause and resume',
   [[[0, 'plug'], [5, 'auth'], [65, 'ev_pause'], [125, 'ev_resume'], [185, 'stop'],
     [190, 'unplug']],
    60],
   ['Available', 120, 0, 0]],
  ['boundary: unplug while charging', [[[0, 'plug'], [10, 'auth'], [70, 'unplug']], 60],
   ['Available', 60, 0, 1]],
  ['regression: unplug while charging banks time',
   [[[60, 'plug'], [65, 'unplug'], [126, 'plug'], [131, 'ev_resume'], [141, 'auth'],
     [441, 'unplug']],
    60],
   ['Available', 300, 0, 1]],
  ['regression: unplug while charging banks time (partial repair)',
   [[[0, 'unplug'], [5, 'unplug'], [5, 'plug'], [35, 'auth'], [95, 'ev_pause'], [100, 'ev_resume'],
     [130, 'plug'], [160, 'unplug'], [160, 'plug'], [160, 'plug']],
    60],
   ['Preparing', 120, 0, 1]],
  ['control 1', [[[61, 'unplug'], [361, 'auth'], [421, 'unplug'], [426, 'ev_pause']], 60],
   ['Available', 0, 0, 0]],
  ['control 2',
   [[[5, 'ev_resume'], [305, 'unplug'], [605, 'plug'], [665, 'ev_resume'], [670, 'ev_resume']], 60],
   ['Available', 0, 1, 0]]]]
for label, args, expected in fixtures[N-1]:
    check(label, 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 fixtureActualExpectedOutcome
boundary: authorised exactly at timeout['Finishing', 40, 0, 0]['Finishing', 40, 0, 0]Passed
normal: pause and resume['Available', 120, 0, 0]['Available', 120, 0, 0]Passed
boundary: unplug while charging['Available', 60, 0, 1]['Available', 60, 0, 1]Passed
regression: unplug while charging banks time['Available', 5, 0, 1]['Available', 5, 0, 1]Passed
regression: unplug while charging banks time (partial repair)['Available', 0, 0, 1]['Available', 0, 0, 1]Passed
control 1['Available', 0, 1, 0]['Available', 0, 1, 0]Passed
control 2['Available', 0, 0, 0]['Available', 0, 0, 0]Passed

SHA-256 / a9dbfb1d8958c8e0faac0a930713a1197e53529a99eb722521f424d65491881a

Verification & scope

Deterministic stipulated toy contract for teaching; no claim of conformance with any standard, vendor protocol or production controller. 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:51:53.033152+00:00.

Case digest / 8649271edfadc7eeef939a843b22df4eb5ed7f6152a7b8479c97236ff6d57568