FA-92961 / EV charging session scheduling / Open access
Charging profile stack resolution: tx replaces default · case 01
A transaction profile raising the limit is ignored because the default profile still applies.
ROOT CAUSE
The default profile is considered alongside the tx profile instead of being replaced by it.
THE FAILURE
The default profile is considered alongside the tx profile instead of being replaced by it.
Unsuccessful approach: Preferring default when both exist inverts the override.
Case contract
Each profile has purpose max/default/tx, stack level, validity [valid_from, valid_to) (valid_to None = open), kind absolute (origin valid_from) or relative (origin session_start; skipped when no session) and periods [[offset, amps]] in any order. A profile yields the amps of the last period with offset <= t-origin, or nothing before its first period. Per purpose the highest stack wins (ties: earlier profile). tx replaces default. Effective limit is the minimum of max, tx-or-default and hw_max, ties resolved in that order. Return [amps, source].
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(profiles, t, session_start, hw_max):
best = {}
for p in profiles:
if not (p['valid_from'] <= t and (p['valid_to'] is None or t < p['valid_to'])):
continue
if p['kind'] == 'relative':
if session_start is None:
continue
origin = session_start
else:
origin = p['valid_from']
el = t - origin
lim = None
for off, val in sorted(p['periods']):
if off <= el:
lim = val
if lim is None:
continue
cur = best.get(p['purpose'])
if cur is None or p['stack'] > cur[0]:
best[p['purpose']] = [p['stack'], lim]
cands = []
if 'max' in best:
cands.append(['max', best['max'][1]])
if 'tx' in best:
cands.append(['tx', best['tx'][1]])
if 'default' in best:
cands.append(['default', best['default'][1]])
cands.append(['hw', hw_max])
win = cands[0]
for c in cands[1:]:
if c[1] < win[1]:
win = c
return [win[1], win[0]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: tx replaces default',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 43,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 32]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 44,
'valid_to': None,
'kind': 'relative',
'periods': [[45, 32], [45, 6], [20, 20]]}],
88, 57, 24],
[24, 'hw']],
['regression: tx replaces default (partial repair)',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 44,
'valid_to': None,
'kind': 'absolute',
'periods': [[5, 6], [0, 20], [0, 32]]},
{'purpose': 'default',
'stack': 2,
'valid_from': 26,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 20], [5, 20]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 30,
'valid_to': 62,
'kind': 'relative',
'periods': [[10, 6], [10, 6], [45, 32]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 10,
'valid_to': None,
'kind': 'absolute',
'periods': [[5, 10], [0, 20]]},
{'purpose': 'max',
'stack': 1,
'valid_from': 4,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 20]]}],
48, None, 32],
[10, 'tx']],
['control 1',
[[{'purpose': 'max',
'stack': 1,
'valid_from': 44,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 10], [0, 10], [5, 10]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 7,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 10], [30, 20]]}],
3, None, 24],
[24, 'hw']],
['control 2',
[[{'purpose': 'max',
'stack': 2,
'valid_from': 11,
'valid_to': 21,
'kind': 'relative',
'periods': [[30, 32], [10, 20], [45, 6]]},
{'purpose': 'max',
'stack': 1,
'valid_from': 14,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 32]]},
{'purpose': 'max',
'stack': 0,
'valid_from': 19,
'valid_to': 56,
'kind': 'absolute',
'periods': [[0, 6], [45, 10], [20, 16]]},
{'purpose': 'max',
'stack': 1,
'valid_from': 53,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 10], [0, 32], [0, 20]]}],
97, None, 16],
[16, 'hw']]],
[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: tx replaces default',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 43,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 32]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 44,
'valid_to': None,
'kind': 'relative',
'periods': [[45, 32], [45, 6], [20, 20]]}],
88, 57, 24],
[24, 'hw']],
['regression: tx replaces default (partial repair)',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 10,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 16], [20, 32], [45, 10]]},
{'purpose': 'default',
'stack': 0,
'valid_from': 24,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 16], [5, 32], [5, 10]]}],
90, 50, 24],
[10, 'tx']],
['control 1',
[[{'purpose': 'default',
'stack': 2,
'valid_from': 20,
'valid_to': 56,
'kind': 'relative',
'periods': [[20, 10], [10, 20]]}],
53, 38, 24],
[20, 'default']],
['control 2',
[[{'purpose': 'max',
'stack': 1,
'valid_from': 51,
'valid_to': None,
'kind': 'absolute',
'periods': [[30, 16]]}],
48, None, 16],
[16, 'hw']]],
[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: tx replaces default',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 5,
'valid_to': None,
'kind': 'absolute',
'periods': [[10, 6]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 56,
'valid_to': 120,
'kind': 'absolute',
'periods': [[45, 32], [45, 16]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 56,
'valid_to': 77,
'kind': 'absolute',
'periods': [[10, 10], [0, 32]]},
{'purpose': 'default',
'stack': 0,
'valid_from': 4,
'valid_to': None,
'kind': 'absolute',
'periods': [[10, 16], [20, 16], [5, 6]]},
{'purpose': 'tx',
'stack': 1,
'valid_from': 53,
'valid_to': 121,
'kind': 'relative',
'periods': [[0, 32], [0, 6]]}],
58, 13, 16],
[16, 'hw']],
['regression: tx replaces default (partial repair)',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 31,
'valid_to': 101,
'kind': 'absolute',
'periods': [[0, 32], [0, 10]]},
{'purpose': 'default',
'stack': 0,
'valid_from': 2,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 10]]}],
36, 10, 24],
[24, 'hw']],
['control 1',
[[{'purpose': 'tx',
'stack': 2,
'valid_from': 29,
'valid_to': 52,
'kind': 'absolute',
'periods': [[30, 16], [45, 32], [0, 16]]},
{'purpose': 'max',
'stack': 0,
'valid_from': 13,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6], [0, 10], [45, 16]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 58,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 16]]}],
74, None, 24],
[16, 'max']],
['control 2',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 8,
'valid_to': None,
'kind': 'absolute',
'periods': [[30, 6], [10, 6], [20, 32]]},
{'purpose': 'max',
'stack': 0,
'valid_from': 59,
'valid_to': 85,
'kind': 'absolute',
'periods': [[5, 6], [5, 20], [30, 20]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 29,
'valid_to': None,
'kind': 'absolute',
'periods': [[20, 10], [30, 10]]}],
15, 48, 16],
[16, 'hw']]],
[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: tx replaces default',
[[{'purpose': 'default',
'stack': 2,
'valid_from': 53,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 16], [0, 10], [10, 10]]},
{'purpose': 'tx',
'stack': 1,
'valid_from': 51,
'valid_to': None,
'kind': 'absolute',
'periods': [[10, 20], [30, 10]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 27,
'valid_to': 96,
'kind': 'absolute',
'periods': [[0, 10]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 52,
'valid_to': 128,
'kind': 'absolute',
'periods': [[20, 6]]},
{'purpose': 'default',
'stack': 2,
'valid_from': 5,
'valid_to': 62,
'kind': 'absolute',
'periods': [[30, 6], [20, 6], [0, 16]]}],
75, 4, 24],
[20, 'tx']],
['regression: tx replaces default (partial repair)',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 27,
'valid_to': 95,
'kind': 'absolute',
'periods': [[0, 16]]},
{'purpose': 'default',
'stack': 0,
'valid_from': 48,
'valid_to': 111,
'kind': 'relative',
'periods': [[20, 6]]}],
68, 14, 32],
[16, 'tx']],
['control 1',
[[{'purpose': 'max',
'stack': 2,
'valid_from': 22,
'valid_to': None,
'kind': 'relative',
'periods': [[30, 6]]},
{'purpose': 'default',
'stack': 0,
'valid_from': 34,
'valid_to': 106,
'kind': 'absolute',
'periods': [[30, 16], [30, 10]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 11,
'valid_to': None,
'kind': 'absolute',
'periods': [[10, 6], [30, 20]]},
{'purpose': 'default',
'stack': 2,
'valid_from': 26,
'valid_to': None,
'kind': 'relative',
'periods': [[5, 6], [5, 6], [45, 10]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 12,
'valid_to': None,
'kind': 'absolute',
'periods': [[20, 32], [20, 6]]}],
77, None, 24],
[20, 'tx']],
['control 2',
[[{'purpose': 'default',
'stack': 2,
'valid_from': 55,
'valid_to': None,
'kind': 'absolute',
'periods': [[5, 10], [30, 10]]}],
25, 14, 16],
[16, 'hw']]],
[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: tx replaces default',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 18,
'valid_to': 60,
'kind': 'absolute',
'periods': [[5, 6]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 47,
'valid_to': None,
'kind': 'relative',
'periods': [[20, 20], [0, 32], [20, 32]]},
{'purpose': 'default',
'stack': 2,
'valid_from': 15,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 16], [0, 6], [0, 16]]}],
100, 43, 32],
[32, 'tx']],
['regression: tx replaces default (partial repair)',
[[{'purpose': 'default',
'stack': 2,
'valid_from': 6,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 32], [10, 16]]},
{'purpose': 'max',
'stack': 2,
'valid_from': 18,
'valid_to': 73,
'kind': 'relative',
'periods': [[30, 32], [0, 6]]},
{'purpose': 'tx',
'stack': 1,
'valid_from': 12,
'valid_to': 36,
'kind': 'relative',
'periods': [[45, 16], [45, 20], [10, 6]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 2,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 32], [0, 6]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 13,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
73, 46, 16],
[16, 'hw']],
['control 1',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 8,
'valid_to': None,
'kind': 'absolute',
'periods': [[30, 6]]}],
71, 15, 16],
[6, 'tx']],
['control 2',
[[{'purpose': 'tx',
'stack': 2,
'valid_from': 39,
'valid_to': 108,
'kind': 'absolute',
'periods': [[20, 16], [30, 32], [20, 20]]},
{'purpose': 'max',
'stack': 0,
'valid_from': 45,
'valid_to': None,
'kind': 'relative',
'periods': [[5, 20]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 21,
'valid_to': 46,
'kind': 'absolute',
'periods': [[5, 20]]}],
34, None, 24],
[20, 'default']]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| boundary: profile expires at t | [32, 'hw'] | [32, 'hw'] | Passed |
| boundary: relative profile without session | [32, 'hw'] | [32, 'hw'] | Passed |
| boundary: tx overrides lower default | [6, 'default'] | [20, 'tx'] | Failed |
| regression: tx replaces default | [20, 'default'] | [24, 'hw'] | Failed |
| regression: tx replaces default (partial repair) | [10, 'tx'] | [10, 'tx'] | Passed |
| control 1 | [24, 'hw'] | [24, 'hw'] | Passed |
| control 2 | [16, 'hw'] | [16, 'hw'] | Passed |
SHA-256 / 112ed0347b47a026525844a79c96b11c2906cb0045936612e5fe844088ef6b96
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(profiles, t, session_start, hw_max):
best = {}
for p in profiles:
if not (p['valid_from'] <= t and (p['valid_to'] is None or t < p['valid_to'])):
continue
if p['kind'] == 'relative':
if session_start is None:
continue
origin = session_start
else:
origin = p['valid_from']
el = t - origin
lim = None
for off, val in sorted(p['periods']):
if off <= el:
lim = val
if lim is None:
continue
cur = best.get(p['purpose'])
if cur is None or p['stack'] > cur[0]:
best[p['purpose']] = [p['stack'], lim]
cands = []
if 'max' in best:
cands.append(['max', best['max'][1]])
if 'tx' in best and 'default' not in best:
cands.append(['tx', best['tx'][1]])
elif 'default' in best:
cands.append(['default', best['default'][1]])
cands.append(['hw', hw_max])
win = cands[0]
for c in cands[1:]:
if c[1] < win[1]:
win = c
return [win[1], win[0]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: tx replaces default',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 43,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 32]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 44,
'valid_to': None,
'kind': 'relative',
'periods': [[45, 32], [45, 6], [20, 20]]}],
88, 57, 24],
[24, 'hw']],
['regression: tx replaces default (partial repair)',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 44,
'valid_to': None,
'kind': 'absolute',
'periods': [[5, 6], [0, 20], [0, 32]]},
{'purpose': 'default',
'stack': 2,
'valid_from': 26,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 20], [5, 20]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 30,
'valid_to': 62,
'kind': 'relative',
'periods': [[10, 6], [10, 6], [45, 32]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 10,
'valid_to': None,
'kind': 'absolute',
'periods': [[5, 10], [0, 20]]},
{'purpose': 'max',
'stack': 1,
'valid_from': 4,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 20]]}],
48, None, 32],
[10, 'tx']],
['control 1',
[[{'purpose': 'max',
'stack': 1,
'valid_from': 44,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 10], [0, 10], [5, 10]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 7,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 10], [30, 20]]}],
3, None, 24],
[24, 'hw']],
['control 2',
[[{'purpose': 'max',
'stack': 2,
'valid_from': 11,
'valid_to': 21,
'kind': 'relative',
'periods': [[30, 32], [10, 20], [45, 6]]},
{'purpose': 'max',
'stack': 1,
'valid_from': 14,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 32]]},
{'purpose': 'max',
'stack': 0,
'valid_from': 19,
'valid_to': 56,
'kind': 'absolute',
'periods': [[0, 6], [45, 10], [20, 16]]},
{'purpose': 'max',
'stack': 1,
'valid_from': 53,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 10], [0, 32], [0, 20]]}],
97, None, 16],
[16, 'hw']]],
[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: tx replaces default',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 43,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 32]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 44,
'valid_to': None,
'kind': 'relative',
'periods': [[45, 32], [45, 6], [20, 20]]}],
88, 57, 24],
[24, 'hw']],
['regression: tx replaces default (partial repair)',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 10,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 16], [20, 32], [45, 10]]},
{'purpose': 'default',
'stack': 0,
'valid_from': 24,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 16], [5, 32], [5, 10]]}],
90, 50, 24],
[10, 'tx']],
['control 1',
[[{'purpose': 'default',
'stack': 2,
'valid_from': 20,
'valid_to': 56,
'kind': 'relative',
'periods': [[20, 10], [10, 20]]}],
53, 38, 24],
[20, 'default']],
['control 2',
[[{'purpose': 'max',
'stack': 1,
'valid_from': 51,
'valid_to': None,
'kind': 'absolute',
'periods': [[30, 16]]}],
48, None, 16],
[16, 'hw']]],
[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: tx replaces default',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 5,
'valid_to': None,
'kind': 'absolute',
'periods': [[10, 6]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 56,
'valid_to': 120,
'kind': 'absolute',
'periods': [[45, 32], [45, 16]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 56,
'valid_to': 77,
'kind': 'absolute',
'periods': [[10, 10], [0, 32]]},
{'purpose': 'default',
'stack': 0,
'valid_from': 4,
'valid_to': None,
'kind': 'absolute',
'periods': [[10, 16], [20, 16], [5, 6]]},
{'purpose': 'tx',
'stack': 1,
'valid_from': 53,
'valid_to': 121,
'kind': 'relative',
'periods': [[0, 32], [0, 6]]}],
58, 13, 16],
[16, 'hw']],
['regression: tx replaces default (partial repair)',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 31,
'valid_to': 101,
'kind': 'absolute',
'periods': [[0, 32], [0, 10]]},
{'purpose': 'default',
'stack': 0,
'valid_from': 2,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 10]]}],
36, 10, 24],
[24, 'hw']],
['control 1',
[[{'purpose': 'tx',
'stack': 2,
'valid_from': 29,
'valid_to': 52,
'kind': 'absolute',
'periods': [[30, 16], [45, 32], [0, 16]]},
{'purpose': 'max',
'stack': 0,
'valid_from': 13,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6], [0, 10], [45, 16]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 58,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 16]]}],
74, None, 24],
[16, 'max']],
['control 2',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 8,
'valid_to': None,
'kind': 'absolute',
'periods': [[30, 6], [10, 6], [20, 32]]},
{'purpose': 'max',
'stack': 0,
'valid_from': 59,
'valid_to': 85,
'kind': 'absolute',
'periods': [[5, 6], [5, 20], [30, 20]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 29,
'valid_to': None,
'kind': 'absolute',
'periods': [[20, 10], [30, 10]]}],
15, 48, 16],
[16, 'hw']]],
[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: tx replaces default',
[[{'purpose': 'default',
'stack': 2,
'valid_from': 53,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 16], [0, 10], [10, 10]]},
{'purpose': 'tx',
'stack': 1,
'valid_from': 51,
'valid_to': None,
'kind': 'absolute',
'periods': [[10, 20], [30, 10]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 27,
'valid_to': 96,
'kind': 'absolute',
'periods': [[0, 10]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 52,
'valid_to': 128,
'kind': 'absolute',
'periods': [[20, 6]]},
{'purpose': 'default',
'stack': 2,
'valid_from': 5,
'valid_to': 62,
'kind': 'absolute',
'periods': [[30, 6], [20, 6], [0, 16]]}],
75, 4, 24],
[20, 'tx']],
['regression: tx replaces default (partial repair)',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 27,
'valid_to': 95,
'kind': 'absolute',
'periods': [[0, 16]]},
{'purpose': 'default',
'stack': 0,
'valid_from': 48,
'valid_to': 111,
'kind': 'relative',
'periods': [[20, 6]]}],
68, 14, 32],
[16, 'tx']],
['control 1',
[[{'purpose': 'max',
'stack': 2,
'valid_from': 22,
'valid_to': None,
'kind': 'relative',
'periods': [[30, 6]]},
{'purpose': 'default',
'stack': 0,
'valid_from': 34,
'valid_to': 106,
'kind': 'absolute',
'periods': [[30, 16], [30, 10]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 11,
'valid_to': None,
'kind': 'absolute',
'periods': [[10, 6], [30, 20]]},
{'purpose': 'default',
'stack': 2,
'valid_from': 26,
'valid_to': None,
'kind': 'relative',
'periods': [[5, 6], [5, 6], [45, 10]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 12,
'valid_to': None,
'kind': 'absolute',
'periods': [[20, 32], [20, 6]]}],
77, None, 24],
[20, 'tx']],
['control 2',
[[{'purpose': 'default',
'stack': 2,
'valid_from': 55,
'valid_to': None,
'kind': 'absolute',
'periods': [[5, 10], [30, 10]]}],
25, 14, 16],
[16, 'hw']]],
[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: tx replaces default',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 18,
'valid_to': 60,
'kind': 'absolute',
'periods': [[5, 6]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 47,
'valid_to': None,
'kind': 'relative',
'periods': [[20, 20], [0, 32], [20, 32]]},
{'purpose': 'default',
'stack': 2,
'valid_from': 15,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 16], [0, 6], [0, 16]]}],
100, 43, 32],
[32, 'tx']],
['regression: tx replaces default (partial repair)',
[[{'purpose': 'default',
'stack': 2,
'valid_from': 6,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 32], [10, 16]]},
{'purpose': 'max',
'stack': 2,
'valid_from': 18,
'valid_to': 73,
'kind': 'relative',
'periods': [[30, 32], [0, 6]]},
{'purpose': 'tx',
'stack': 1,
'valid_from': 12,
'valid_to': 36,
'kind': 'relative',
'periods': [[45, 16], [45, 20], [10, 6]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 2,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 32], [0, 6]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 13,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
73, 46, 16],
[16, 'hw']],
['control 1',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 8,
'valid_to': None,
'kind': 'absolute',
'periods': [[30, 6]]}],
71, 15, 16],
[6, 'tx']],
['control 2',
[[{'purpose': 'tx',
'stack': 2,
'valid_from': 39,
'valid_to': 108,
'kind': 'absolute',
'periods': [[20, 16], [30, 32], [20, 20]]},
{'purpose': 'max',
'stack': 0,
'valid_from': 45,
'valid_to': None,
'kind': 'relative',
'periods': [[5, 20]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 21,
'valid_to': 46,
'kind': 'absolute',
'periods': [[5, 20]]}],
34, None, 24],
[20, 'default']]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| boundary: profile expires at t | [32, 'hw'] | [32, 'hw'] | Passed |
| boundary: relative profile without session | [32, 'hw'] | [32, 'hw'] | Passed |
| boundary: tx overrides lower default | [6, 'default'] | [20, 'tx'] | Failed |
| regression: tx replaces default | [20, 'default'] | [24, 'hw'] | Failed |
| regression: tx replaces default (partial repair) | [32, 'default'] | [10, 'tx'] | Failed |
| control 1 | [24, 'hw'] | [24, 'hw'] | Passed |
| control 2 | [16, 'hw'] | [16, 'hw'] | Passed |
SHA-256 / 4f3cd7150d95d1f2c7aefce452448d738caea6721f94e0be2b2d188f98e54b61
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 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
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:50.735543+00:00.
Case digest / 8bdc861e3a61354b08f9fd01545c49fd2cc38d41ff31f46f05b17770209037a8