FA-93326 / EV charging session scheduling / Open access
Site power profile from charge plans: merge equal levels · case 01
The profile repeats the same power level at every breakpoint.
ROOT CAUSE
Consecutive segments with equal power are not merged.
THE FAILURE
Consecutive segments with equal power are not merged.
Unsuccessful approach: Comparing with the first change point merges non-adjacent levels and drops real changes.
Case contract
plan holds [start, end, kw] charging intervals ([start, end), zero-length ignored). Build the site profile as change points [[t, total_kw]] over the interval breakpoints, merging equal consecutive levels, and close with [last breakpoint, 0] unless the profile already ends at 0. Also return the start points of segments whose total exceeds site_max. Return [profile, overloads].
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(plan, site_max):
pts = sorted({t for s, e, _ in plan for t in (s, e) if e > s})
out = []
over = []
for a, b in zip(pts, pts[1:]):
kw = sum(k for s, e, k in plan if s <= a and b <= e)
out.append([a, kw])
if kw > site_max:
over.append(a)
if pts:
if not out or out[-1][1] != 0:
out.append([pts[-1], 0])
return [out, over]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['boundary: zero-length interval before plan', [[[5, 5, 7], [10, 20, 11]], 11],
[[[10, 11], [20, 0]], []]],
['boundary: exact site limit', [[[0, 10, 7], [0, 10, 4]], 11], [[[0, 11], [10, 0]], []]],
['boundary: empty plan', [[], 11], [[], []]],
['regression: merge equal levels',
[[[23, 28, 11], [8, 13, 0], [15, 20, 0], [24, 24, 4], [16, 16, 0]], 15],
[[[8, 0], [23, 11], [28, 0]], []]],
['regression: merge equal levels (partial repair)', [[[4, 14, 11], [0, 2, 0], [16, 18, 0]], 11],
[[[0, 0], [4, 11], [14, 0]], []]],
['control 1', [[[23, 38, 0], [0, 5, 4], [18, 18, 11]], 15], [[[0, 4], [5, 0]], []]],
['control 2', [[[6, 8, 7]], 22], [[[6, 7], [8, 0]], []]]],
[['boundary: zero-length interval before plan', [[[5, 5, 7], [10, 20, 11]], 11],
[[[10, 11], [20, 0]], []]],
['boundary: exact site limit', [[[0, 10, 7], [0, 10, 4]], 11], [[[0, 11], [10, 0]], []]],
['boundary: empty plan', [[], 11], [[], []]],
['regression: merge equal levels', [[[11, 13, 4], [13, 28, 0], [17, 22, 0], [9, 11, 4]], 22],
[[[9, 4], [13, 0]], []]],
['regression: merge equal levels (partial repair)',
[[[11, 16, 0], [11, 16, 7], [19, 21, 11], [8, 18, 11], [16, 16, 0]], 15],
[[[8, 11], [11, 18], [16, 11], [18, 0], [19, 11], [21, 0]], [11]]],
['control 1', [[[12, 12, 4], [7, 12, 11], [27, 37, 4]], 22],
[[[7, 11], [12, 0], [27, 4], [37, 0]], []]],
['control 2', [[], 18], [[], []]]],
[['boundary: zero-length interval before plan', [[[5, 5, 7], [10, 20, 11]], 11],
[[[10, 11], [20, 0]], []]],
['boundary: exact site limit', [[[0, 10, 7], [0, 10, 4]], 11], [[[0, 11], [10, 0]], []]],
['boundary: empty plan', [[], 11], [[], []]],
['regression: merge equal levels', [[[9, 14, 0], [6, 8, 7]], 7], [[[6, 7], [8, 0]], []]],
['regression: merge equal levels (partial repair)',
[[[19, 19, 11], [6, 6, 7], [15, 25, 11], [8, 23, 0], [27, 32, 4]], 22],
[[[8, 0], [15, 11], [25, 0], [27, 4], [32, 0]], []]],
['control 1', [[[21, 31, 11], [23, 33, 7], [0, 10, 7], [25, 25, 0], [28, 43, 7]], 15],
[[[0, 7], [10, 0], [21, 11], [23, 18], [28, 25], [31, 14], [33, 7], [43, 0]], [23, 28]]],
['control 2', [[[17, 27, 11], [22, 37, 11], [10, 10, 7], [19, 29, 11]], 7],
[[[17, 11], [19, 22], [22, 33], [27, 22], [29, 11], [37, 0]], [17, 19, 22, 27, 29]]]],
[['boundary: zero-length interval before plan', [[[5, 5, 7], [10, 20, 11]], 11],
[[[10, 11], [20, 0]], []]],
['boundary: exact site limit', [[[0, 10, 7], [0, 10, 4]], 11], [[[0, 11], [10, 0]], []]],
['boundary: empty plan', [[], 11], [[], []]],
['regression: merge equal levels',
[[[10, 12, 7], [3, 8, 0], [29, 39, 11], [6, 11, 7], [13, 23, 7]], 11],
[[[3, 0], [6, 7], [10, 14], [11, 7], [12, 0], [13, 7], [23, 0], [29, 11], [39, 0]], [10]]],
['regression: merge equal levels (partial repair)',
[[[19, 21, 11], [15, 30, 7], [30, 45, 11]], 22],
[[[15, 7], [19, 18], [21, 7], [30, 11], [45, 0]], []]],
['control 1', [[], 22], [[], []]], ['control 2', [[], 22], [[], []]]],
[['boundary: zero-length interval before plan', [[[5, 5, 7], [10, 20, 11]], 11],
[[[10, 11], [20, 0]], []]],
['boundary: exact site limit', [[[0, 10, 7], [0, 10, 4]], 11], [[[0, 11], [10, 0]], []]],
['boundary: empty plan', [[], 11], [[], []]],
['regression: merge equal levels',
[[[26, 36, 11], [11, 26, 11], [19, 24, 11], [13, 23, 11], [0, 0, 4]], 18],
[[[11, 11], [13, 22], [19, 33], [23, 22], [24, 11], [36, 0]], [13, 19, 23]]],
['regression: merge equal levels (partial repair)', [[[30, 32, 0], [6, 16, 11], [18, 28, 7]], 11],
[[[6, 11], [16, 0], [18, 7], [28, 0]], []]],
['control 1', [[[8, 8, 11], [0, 0, 11], [7, 17, 7]], 7], [[[7, 7], [17, 0]], []]],
['control 2', [[[22, 22, 11], [5, 5, 4], [10, 15, 11], [22, 32, 11], [14, 14, 0]], 11],
[[[10, 11], [15, 0], [22, 11], [32, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| boundary: zero-length interval before plan | [[[10, 11], [20, 0]], []] | [[[10, 11], [20, 0]], []] | Passed |
| boundary: exact site limit | [[[0, 11], [10, 0]], []] | [[[0, 11], [10, 0]], []] | Passed |
| boundary: empty plan | [[], []] | [[], []] | Passed |
| regression: merge equal levels | [[[8, 0], [13, 0], [15, 0], [20, 0], [23, 11], [28, 0]], []] | [[[8, 0], [23, 11], [28, 0]], []] | Failed |
| regression: merge equal levels (partial repair) | [[[0, 0], [2, 0], [4, 11], [14, 0], [16, 0]], []] | [[[0, 0], [4, 11], [14, 0]], []] | Failed |
| control 1 | [[[0, 4], [5, 0], [23, 0]], []] | [[[0, 4], [5, 0]], []] | Failed |
| control 2 | [[[6, 7], [8, 0]], []] | [[[6, 7], [8, 0]], []] | Passed |
SHA-256 / 3fdd015b5f06aed0b5b83b83e96b6923a33ebecb3e2a19ba6cddec34499f35f4
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(plan, site_max):
pts = sorted({t for s, e, _ in plan for t in (s, e) if e > s})
out = []
over = []
for a, b in zip(pts, pts[1:]):
kw = sum(k for s, e, k in plan if s <= a and b <= e)
if out and out[0][1] == kw:
continue
out.append([a, kw])
if kw > site_max:
over.append(a)
if pts:
if not out or out[-1][1] != 0:
out.append([pts[-1], 0])
return [out, over]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['boundary: zero-length interval before plan', [[[5, 5, 7], [10, 20, 11]], 11],
[[[10, 11], [20, 0]], []]],
['boundary: exact site limit', [[[0, 10, 7], [0, 10, 4]], 11], [[[0, 11], [10, 0]], []]],
['boundary: empty plan', [[], 11], [[], []]],
['regression: merge equal levels',
[[[23, 28, 11], [8, 13, 0], [15, 20, 0], [24, 24, 4], [16, 16, 0]], 15],
[[[8, 0], [23, 11], [28, 0]], []]],
['regression: merge equal levels (partial repair)', [[[4, 14, 11], [0, 2, 0], [16, 18, 0]], 11],
[[[0, 0], [4, 11], [14, 0]], []]],
['control 1', [[[23, 38, 0], [0, 5, 4], [18, 18, 11]], 15], [[[0, 4], [5, 0]], []]],
['control 2', [[[6, 8, 7]], 22], [[[6, 7], [8, 0]], []]]],
[['boundary: zero-length interval before plan', [[[5, 5, 7], [10, 20, 11]], 11],
[[[10, 11], [20, 0]], []]],
['boundary: exact site limit', [[[0, 10, 7], [0, 10, 4]], 11], [[[0, 11], [10, 0]], []]],
['boundary: empty plan', [[], 11], [[], []]],
['regression: merge equal levels', [[[11, 13, 4], [13, 28, 0], [17, 22, 0], [9, 11, 4]], 22],
[[[9, 4], [13, 0]], []]],
['regression: merge equal levels (partial repair)',
[[[11, 16, 0], [11, 16, 7], [19, 21, 11], [8, 18, 11], [16, 16, 0]], 15],
[[[8, 11], [11, 18], [16, 11], [18, 0], [19, 11], [21, 0]], [11]]],
['control 1', [[[12, 12, 4], [7, 12, 11], [27, 37, 4]], 22],
[[[7, 11], [12, 0], [27, 4], [37, 0]], []]],
['control 2', [[], 18], [[], []]]],
[['boundary: zero-length interval before plan', [[[5, 5, 7], [10, 20, 11]], 11],
[[[10, 11], [20, 0]], []]],
['boundary: exact site limit', [[[0, 10, 7], [0, 10, 4]], 11], [[[0, 11], [10, 0]], []]],
['boundary: empty plan', [[], 11], [[], []]],
['regression: merge equal levels', [[[9, 14, 0], [6, 8, 7]], 7], [[[6, 7], [8, 0]], []]],
['regression: merge equal levels (partial repair)',
[[[19, 19, 11], [6, 6, 7], [15, 25, 11], [8, 23, 0], [27, 32, 4]], 22],
[[[8, 0], [15, 11], [25, 0], [27, 4], [32, 0]], []]],
['control 1', [[[21, 31, 11], [23, 33, 7], [0, 10, 7], [25, 25, 0], [28, 43, 7]], 15],
[[[0, 7], [10, 0], [21, 11], [23, 18], [28, 25], [31, 14], [33, 7], [43, 0]], [23, 28]]],
['control 2', [[[17, 27, 11], [22, 37, 11], [10, 10, 7], [19, 29, 11]], 7],
[[[17, 11], [19, 22], [22, 33], [27, 22], [29, 11], [37, 0]], [17, 19, 22, 27, 29]]]],
[['boundary: zero-length interval before plan', [[[5, 5, 7], [10, 20, 11]], 11],
[[[10, 11], [20, 0]], []]],
['boundary: exact site limit', [[[0, 10, 7], [0, 10, 4]], 11], [[[0, 11], [10, 0]], []]],
['boundary: empty plan', [[], 11], [[], []]],
['regression: merge equal levels',
[[[10, 12, 7], [3, 8, 0], [29, 39, 11], [6, 11, 7], [13, 23, 7]], 11],
[[[3, 0], [6, 7], [10, 14], [11, 7], [12, 0], [13, 7], [23, 0], [29, 11], [39, 0]], [10]]],
['regression: merge equal levels (partial repair)',
[[[19, 21, 11], [15, 30, 7], [30, 45, 11]], 22],
[[[15, 7], [19, 18], [21, 7], [30, 11], [45, 0]], []]],
['control 1', [[], 22], [[], []]], ['control 2', [[], 22], [[], []]]],
[['boundary: zero-length interval before plan', [[[5, 5, 7], [10, 20, 11]], 11],
[[[10, 11], [20, 0]], []]],
['boundary: exact site limit', [[[0, 10, 7], [0, 10, 4]], 11], [[[0, 11], [10, 0]], []]],
['boundary: empty plan', [[], 11], [[], []]],
['regression: merge equal levels',
[[[26, 36, 11], [11, 26, 11], [19, 24, 11], [13, 23, 11], [0, 0, 4]], 18],
[[[11, 11], [13, 22], [19, 33], [23, 22], [24, 11], [36, 0]], [13, 19, 23]]],
['regression: merge equal levels (partial repair)', [[[30, 32, 0], [6, 16, 11], [18, 28, 7]], 11],
[[[6, 11], [16, 0], [18, 7], [28, 0]], []]],
['control 1', [[[8, 8, 11], [0, 0, 11], [7, 17, 7]], 7], [[[7, 7], [17, 0]], []]],
['control 2', [[[22, 22, 11], [5, 5, 4], [10, 15, 11], [22, 32, 11], [14, 14, 0]], 11],
[[[10, 11], [15, 0], [22, 11], [32, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| boundary: zero-length interval before plan | [[[10, 11], [20, 0]], []] | [[[10, 11], [20, 0]], []] | Passed |
| boundary: exact site limit | [[[0, 11], [10, 0]], []] | [[[0, 11], [10, 0]], []] | Passed |
| boundary: empty plan | [[], []] | [[], []] | Passed |
| regression: merge equal levels | [[[8, 0], [23, 11], [28, 0]], []] | [[[8, 0], [23, 11], [28, 0]], []] | Passed |
| regression: merge equal levels (partial repair) | [[[0, 0], [4, 11], [18, 0]], []] | [[[0, 0], [4, 11], [14, 0]], []] | Failed |
| control 1 | [[[0, 4], [5, 0], [23, 0]], []] | [[[0, 4], [5, 0]], []] | Failed |
| control 2 | [[[6, 7], [8, 0]], []] | [[[6, 7], [8, 0]], []] | Passed |
SHA-256 / d774526a307f6005a9bb5c59e48e324b11b2adccf806c9f33f75736194ef682c
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:54.231790+00:00.
Case digest / 852b979e1a0346f2fb232400a81ecb252e7c1ca7d3a0de148682473948066237