FAILURE MAP
← Case archive

FA-92976 / EV charging session scheduling / Open access

Connector reservation conflict check: trailing buffer boundary · case 01

A reservation starting exactly one buffer after the previous one is rejected.

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

ROOT CAUSE

The gap after an existing reservation is compared inclusively.

THE FAILURE

The gap after an existing reservation is compared inclusively.

Unsuccessful approach: Dropping the buffer on the trailing side lets back-to-back reservations skip turnover time.

Case contract

Connectors are numbered 1..n_conn. existing holds [connector, start, end) reservations. req is [start, end, connector or None]. end <= start or an out-of-range connector returns 'invalid'. Two reservations on the same connector conflict unless separated by at least buffer minutes on both sides. Return the requested connector if free, or the lowest free connector when None was requested, else None.

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(existing, req, buffer, n_conn):
    s, e, want = req
    if e <= s:
        return 'invalid'
    if want is not None and not 1 <= want <= n_conn:
        return 'invalid'
    conns = [want] if want is not None else list(range(1, n_conn + 1))
    for c in conns:
        clash = False
        for c2, s2, e2 in existing:
            if c2 == c and s <= e2 + buffer and s2 < e + buffer:
                clash = True
                break
        if not clash:
            return c
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['boundary: back-to-back with buffer', [[[1, 0, 30]], [40, 60, 1], 10, 1], 1],
  ['boundary: zero-length request', [[], [10, 10, None], 0, 2], 'invalid'],
  ['boundary: last connector requested', [[[1, 0, 30]], [0, 30, 3], 0, 3], 3],
  ['regression: trailing buffer boundary (partial repair)',
   [[[1, 86, 145], [2, 154, 168]], [154, 199, None], 10, 2], None],
  ['control 1', [[[2, 157, 203], [1, 191, 236]], [179, 224, None], 5, 2], None],
  ['control 2',
   [[[3, 190, 210], [4, 11, 28], [2, 54, 68], [4, 54, 104], [3, 134, 162]], [79, 139, 4], 5, 4],
   None],
  ['control 3', [[[3, 29, 48], [3, 135, 149]], [-1, -11, 2], 0, 3], 'invalid']],
 [['boundary: back-to-back with buffer', [[[1, 0, 30]], [40, 60, 1], 10, 1], 1],
  ['boundary: zero-length request', [[], [10, 10, None], 0, 2], 'invalid'],
  ['boundary: last connector requested', [[[1, 0, 30]], [0, 30, 3], 0, 3], 3],
  ['regression: trailing buffer boundary (partial repair)',
   [[[1, 162, 178], [1, 168, 179], [4, 176, 201], [3, 128, 179]], [187, 232, None], 10, 4], 2],
  ['control 1',
   [[[2, 130, 150], [3, 5, 36], [3, 174, 193], [2, 18, 78], [1, 61, 115], [4, 68, 95]],
    [171, 201, 2], 10, 4],
   2],
  ['control 2',
   [[[3, 116, 135], [1, 178, 208], [1, 83, 123], [1, 136, 157], [3, 111, 126], [1, 97, 137]],
    [217, 222, 2], 0, 3],
   2],
  ['control 3',
   [[[3, 146, 171], [4, 164, 212], [1, 43, 89], [4, 118, 155], [1, 93, 116], [4, 116, 130]],
    [171, 231, 5], 10, 4],
   'invalid']],
 [['boundary: back-to-back with buffer', [[[1, 0, 30]], [40, 60, 1], 10, 1], 1],
  ['boundary: zero-length request', [[], [10, 10, None], 0, 2], 'invalid'],
  ['boundary: last connector requested', [[[1, 0, 30]], [0, 30, 3], 0, 3], 3],
  ['regression: trailing buffer boundary (partial repair)',
   [[[1, 152, 196], [4, 119, 151], [4, 121, 177], [3, 128, 156], [3, 113, 137], [3, 41, 66]],
    [199, 204, None], 5, 4],
   2],
  ['control 1', [[[3, 198, 211], [1, 147, 191], [4, 137, 178]], [148, 208, None], 10, 4], 2],
  ['control 2',
   [[[1, 75, 109], [1, 5, 46], [3, 128, 161], [3, 171, 198], [2, 190, 240], [1, 13, 36]],
    [58, 73, 1], 10, 3],
   None],
  ['control 3', [[[3, 91, 130], [3, 83, 131], [1, 156, 209]], [4, 19, None], 10, 3], 1]],
 [['boundary: back-to-back with buffer', [[[1, 0, 30]], [40, 60, 1], 10, 1], 1],
  ['boundary: zero-length request', [[], [10, 10, None], 0, 2], 'invalid'],
  ['boundary: last connector requested', [[[1, 0, 30]], [0, 30, 3], 0, 3], 3],
  ['regression: trailing buffer boundary (partial repair)',
   [[[1, 1, 57], [2, 28, 64]], [70, 75, 2], 15, 2], None],
  ['control 1', [[[3, 69, 129], [1, 134, 154], [4, 142, 167]], [67, 72, 0], 15, 4], 'invalid'],
  ['control 2', [[[2, 188, 212]], [190, 180, 2], 15, 2], 'invalid'],
  ['control 3', [[[1, 174, 218], [1, 116, 174], [3, 45, 62]], [74, 64, 1], 10, 4], 'invalid']],
 [['boundary: back-to-back with buffer', [[[1, 0, 30]], [40, 60, 1], 10, 1], 1],
  ['boundary: zero-length request', [[], [10, 10, None], 0, 2], 'invalid'],
  ['boundary: last connector requested', [[[1, 0, 30]], [0, 30, 3], 0, 3], 3],
  ['regression: trailing buffer boundary (partial repair)',
   [[[1, 78, 106], [2, 99, 116], [1, 194, 210], [1, 175, 230]], [120, 180, None], 15, 2], None],
  ['control 1', [[[4, 7, 51], [4, 60, 108], [1, 80, 129]], [8, 68, None], 0, 4], 1],
  ['control 2',
   [[[1, 169, 199], [1, 193, 217], [1, 118, 149], [1, 4, 58], [1, 125, 169], [1, 1, 52]],
    [156, 146, None], 10, 1],
   'invalid'],
  ['control 3', [[], [214, 229, 2], 10, 2], 2]]]
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: back-to-back with bufferNone1Failed
boundary: zero-length requestinvalidinvalidPassed
boundary: last connector requested33Passed
regression: trailing buffer boundary (partial repair)NoneNonePassed
control 1NoneNonePassed
control 2NoneNonePassed
control 3invalidinvalidPassed

SHA-256 / c0205cc6f7f5fcfc7fd91f566745ab02918f65654e8187f729d85ebbb5cfada3

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(existing, req, buffer, n_conn):
    s, e, want = req
    if e <= s:
        return 'invalid'
    if want is not None and not 1 <= want <= n_conn:
        return 'invalid'
    conns = [want] if want is not None else list(range(1, n_conn + 1))
    for c in conns:
        clash = False
        for c2, s2, e2 in existing:
            if c2 == c and s < e2 and s2 < e + buffer:
                clash = True
                break
        if not clash:
            return c
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['boundary: back-to-back with buffer', [[[1, 0, 30]], [40, 60, 1], 10, 1], 1],
  ['boundary: zero-length request', [[], [10, 10, None], 0, 2], 'invalid'],
  ['boundary: last connector requested', [[[1, 0, 30]], [0, 30, 3], 0, 3], 3],
  ['regression: trailing buffer boundary (partial repair)',
   [[[1, 86, 145], [2, 154, 168]], [154, 199, None], 10, 2], None],
  ['control 1', [[[2, 157, 203], [1, 191, 236]], [179, 224, None], 5, 2], None],
  ['control 2',
   [[[3, 190, 210], [4, 11, 28], [2, 54, 68], [4, 54, 104], [3, 134, 162]], [79, 139, 4], 5, 4],
   None],
  ['control 3', [[[3, 29, 48], [3, 135, 149]], [-1, -11, 2], 0, 3], 'invalid']],
 [['boundary: back-to-back with buffer', [[[1, 0, 30]], [40, 60, 1], 10, 1], 1],
  ['boundary: zero-length request', [[], [10, 10, None], 0, 2], 'invalid'],
  ['boundary: last connector requested', [[[1, 0, 30]], [0, 30, 3], 0, 3], 3],
  ['regression: trailing buffer boundary (partial repair)',
   [[[1, 162, 178], [1, 168, 179], [4, 176, 201], [3, 128, 179]], [187, 232, None], 10, 4], 2],
  ['control 1',
   [[[2, 130, 150], [3, 5, 36], [3, 174, 193], [2, 18, 78], [1, 61, 115], [4, 68, 95]],
    [171, 201, 2], 10, 4],
   2],
  ['control 2',
   [[[3, 116, 135], [1, 178, 208], [1, 83, 123], [1, 136, 157], [3, 111, 126], [1, 97, 137]],
    [217, 222, 2], 0, 3],
   2],
  ['control 3',
   [[[3, 146, 171], [4, 164, 212], [1, 43, 89], [4, 118, 155], [1, 93, 116], [4, 116, 130]],
    [171, 231, 5], 10, 4],
   'invalid']],
 [['boundary: back-to-back with buffer', [[[1, 0, 30]], [40, 60, 1], 10, 1], 1],
  ['boundary: zero-length request', [[], [10, 10, None], 0, 2], 'invalid'],
  ['boundary: last connector requested', [[[1, 0, 30]], [0, 30, 3], 0, 3], 3],
  ['regression: trailing buffer boundary (partial repair)',
   [[[1, 152, 196], [4, 119, 151], [4, 121, 177], [3, 128, 156], [3, 113, 137], [3, 41, 66]],
    [199, 204, None], 5, 4],
   2],
  ['control 1', [[[3, 198, 211], [1, 147, 191], [4, 137, 178]], [148, 208, None], 10, 4], 2],
  ['control 2',
   [[[1, 75, 109], [1, 5, 46], [3, 128, 161], [3, 171, 198], [2, 190, 240], [1, 13, 36]],
    [58, 73, 1], 10, 3],
   None],
  ['control 3', [[[3, 91, 130], [3, 83, 131], [1, 156, 209]], [4, 19, None], 10, 3], 1]],
 [['boundary: back-to-back with buffer', [[[1, 0, 30]], [40, 60, 1], 10, 1], 1],
  ['boundary: zero-length request', [[], [10, 10, None], 0, 2], 'invalid'],
  ['boundary: last connector requested', [[[1, 0, 30]], [0, 30, 3], 0, 3], 3],
  ['regression: trailing buffer boundary (partial repair)',
   [[[1, 1, 57], [2, 28, 64]], [70, 75, 2], 15, 2], None],
  ['control 1', [[[3, 69, 129], [1, 134, 154], [4, 142, 167]], [67, 72, 0], 15, 4], 'invalid'],
  ['control 2', [[[2, 188, 212]], [190, 180, 2], 15, 2], 'invalid'],
  ['control 3', [[[1, 174, 218], [1, 116, 174], [3, 45, 62]], [74, 64, 1], 10, 4], 'invalid']],
 [['boundary: back-to-back with buffer', [[[1, 0, 30]], [40, 60, 1], 10, 1], 1],
  ['boundary: zero-length request', [[], [10, 10, None], 0, 2], 'invalid'],
  ['boundary: last connector requested', [[[1, 0, 30]], [0, 30, 3], 0, 3], 3],
  ['regression: trailing buffer boundary (partial repair)',
   [[[1, 78, 106], [2, 99, 116], [1, 194, 210], [1, 175, 230]], [120, 180, None], 15, 2], None],
  ['control 1', [[[4, 7, 51], [4, 60, 108], [1, 80, 129]], [8, 68, None], 0, 4], 1],
  ['control 2',
   [[[1, 169, 199], [1, 193, 217], [1, 118, 149], [1, 4, 58], [1, 125, 169], [1, 1, 52]],
    [156, 146, None], 10, 1],
   'invalid'],
  ['control 3', [[], [214, 229, 2], 10, 2], 2]]]
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: back-to-back with buffer11Passed
boundary: zero-length requestinvalidinvalidPassed
boundary: last connector requested33Passed
regression: trailing buffer boundary (partial repair)1NoneFailed
control 1NoneNonePassed
control 2NoneNonePassed
control 3invalidinvalidPassed

SHA-256 / dae48c22c9d965aac62ecf3c921bd4309d08ab2716ad50eaad6e12ebc1d416ec

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:51.030896+00:00.

Case digest / 09f372f21ee6bd7b969fac00bc3f7ddc3cc577c056fa30bd8ffac78dbb787c0e