FAILURE MAP
← Case archive

FA-67706 / Elevator dispatch scheduling / Open access

Secured floor car call access: single use credential · case 01

One card read authorises several secured floors, or an unsecured call wastes the credential.

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

ROOT CAUSE

The credential is not consumed by the secured call it authorises.

VERIFIED REPAIR

Consume the credential only when it authorises a secured call.

Unsuccessful approach: Consuming it on unsecured calls leaves the passenger unable to reach the secured floor.

Case contract

Restricted floors are secured during [lo, hi) hours of day (hour = t//3600 mod 24; when lo > hi the window wraps midnight). A car call to a secured floor is accepted only within 10 s of a card read whose card allows that floor; the credential is consumed by the call it authorises. Unsecured calls are accepted without affecting the credential. Log read, accepted or denied.

Why this case matters

Lift group controllers make these decisions many times per minute; a wrong answer strands passengers, wastes trips or overrides a safety rule.

1 / The failure

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

N = 1
observations = []
def solve(x):
    cards = x['cards']
    restricted = set(x['restricted'])
    lo, hi = x['secure_hours']
    card = None
    card_t = None
    out = []
    for t, kind, v in x['events']:
        if kind == 'card':
            card = v
            card_t = t
            out.append('read')
            continue
        hour = (t // 3600) % 24
        in_window = (lo <= hour < hi) if lo <= hi else (hour >= lo or hour < hi)
        if v not in restricted or not in_window:
            out.append('accepted')
        elif card is not None and t - card_t <= 10 and v in cards.get(card, []):
            out.append('accepted')
        else:
            out.append('denied')
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: credential used twice', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [102, 'call', 5], [104, 'call', 7]]}, ['read', 'accepted', 'denied']), ('boundary: unsecured call between read and secured call', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [101, 'call', 2], [103, 'call', 7]]}, ['read', 'accepted', 'accepted']), ('boundary: call ten seconds after the read', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [110, 'call', 5]]}, ['read', 'accepted']), ('boundary: call eleven seconds after the read', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [111, 'call', 5]]}, ['read', 'denied']), ('boundary: end of the secured window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[64800, 'call', 5], [64799, 'call', 5]]}, ['accepted', 'denied']), ('control 1', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[9, 'card', 'K1'], [14, 'card', 'K1'], [23, 'call', 2]]}, ['read', 'read', 'accepted']), ('control 4', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[10, 'call', 7], [3610, 'call', 2], [3615, 'card', 'K9'], [3625, 'call', 2]]}, ['denied', 'accepted', 'read', 'accepted']), ('control 7', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[85810, 'card', 'K1'], [85811, 'call', 7], [85812, 'card', 'K1'], [85821, 'call', 5], [85831, 'card', 'K2']]}, ['read', 'accepted', 'read', 'accepted', 'read'])], [('regression: credential used twice', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [102, 'call', 5], [104, 'call', 7]]}, ['read', 'accepted', 'denied']), ('boundary: unsecured call between read and secured call', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [101, 'call', 2], [103, 'call', 7]]}, ['read', 'accepted', 'accepted']), ('boundary: end of the secured window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[64800, 'call', 5], [64799, 'call', 5]]}, ['accepted', 'denied']), ('boundary: overnight window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[82800, 'call', 9], [10800, 'call', 9], [43200, 'call', 9]]}, ['denied', 'denied', 'accepted']), ('boundary: card without the floor', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K2'], [101, 'call', 5]]}, ['read', 'denied']), ('control 12', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[5, 'card', 'K1'], [3605, 'call', 12], [3615, 'call', 9], [3616, 'call', 7]]}, ['read', 'accepted', 'denied', 'denied']), ('control 15', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[89400, 'call', 9], [93000, 'call', 7]]}, ['denied', 'denied']), ('control 18', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[85810, 'card', 'K1'], [85870, 'call', 2], [85880, 'call', 5], [85889, 'call', 12], [85900, 'card', 'K2']]}, ['read', 'accepted', 'accepted', 'accepted', 'read'])], [('regression: credential used twice', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [102, 'call', 5], [104, 'call', 7]]}, ['read', 'accepted', 'denied']), ('boundary: unsecured call between read and secured call', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [101, 'call', 2], [103, 'call', 7]]}, ['read', 'accepted', 'accepted']), ('boundary: end of the secured window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[64800, 'call', 5], [64799, 'call', 5]]}, ['accepted', 'denied']), ('boundary: overnight window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[82800, 'call', 9], [10800, 'call', 9], [43200, 'call', 9]]}, ['denied', 'denied', 'accepted']), ('boundary: card without the floor', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K2'], [101, 'call', 5]]}, ['read', 'denied']), ('control 23', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[72010, 'call', 9], [75610, 'card', 'K1'], [75615, 'call', 12], [75675, 'call', 5], [75686, 'call', 9], [75696, 'call', 5], [75705, 'call', 9]]}, ['denied', 'read', 'accepted', 'denied', 'denied', 'denied', 'denied']), ('control 26', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[85810, 'call', 2], [85819, 'card', 'K1'], [85820, 'card', 'K9'], [85825, 'call', 2]]}, ['accepted', 'read', 'read', 'accepted']), ('control 29', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[85801, 'card', 'K2'], [85812, 'call', 12], [85823, 'call', 9], [85832, 'call', 12], [85892, 'card', 'K2']]}, ['read', 'accepted', 'accepted', 'accepted', 'read'])], [('regression: credential used twice', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [102, 'call', 5], [104, 'call', 7]]}, ['read', 'accepted', 'denied']), ('boundary: unsecured call between read and secured call', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [101, 'call', 2], [103, 'call', 7]]}, ['read', 'accepted', 'accepted']), ('boundary: card without the floor', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K2'], [101, 'call', 5]]}, ['read', 'denied']), ('boundary: call ten seconds after the read', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [110, 'call', 5]]}, ['read', 'accepted']), ('boundary: call eleven seconds after the read', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [111, 'call', 5]]}, ['read', 'denied']), ('control 34', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[3600, 'call', 2], [3611, 'card', 'K2']]}, ['accepted', 'read']), ('control 37', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[3600, 'card', 'K9'], [3609, 'card', 'K1'], [3619, 'card', 'K1'], [7219, 'card', 'K1'], [7224, 'card', 'K1']]}, ['read', 'read', 'read', 'read', 'read']), ('control 40', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[72011, 'call', 12], [72022, 'call', 9]]}, ['accepted', 'denied'])], [('regression: credential used twice', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [102, 'call', 5], [104, 'call', 7]]}, ['read', 'accepted', 'denied']), ('boundary: unsecured call between read and secured call', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [101, 'call', 2], [103, 'call', 7]]}, ['read', 'accepted', 'accepted']), ('boundary: call eleven seconds after the read', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [111, 'call', 5]]}, ['read', 'denied']), ('boundary: end of the secured window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[64800, 'call', 5], [64799, 'call', 5]]}, ['accepted', 'denied']), ('boundary: overnight window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[82800, 'call', 9], [10800, 'call', 9], [43200, 'call', 9]]}, ['denied', 'denied', 'accepted']), ('control 45', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[72011, 'call', 2], [72020, 'card', 'K9'], [72021, 'call', 2]]}, ['accepted', 'read', 'accepted']), ('control 48', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[25260, 'call', 5], [25265, 'card', 'K2']]}, ['accepted', 'read']), ('control 51', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[72011, 'card', 'K9'], [75611, 'call', 5], [75620, 'call', 12], [75629, 'card', 'K1']]}, ['read', 'accepted', 'accepted', 'read'])]]
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
regression: credential used twice['read', 'accepted', 'accepted']['read', 'accepted', 'denied']Failed
boundary: unsecured call between read and secured call['read', 'accepted', 'accepted']['read', 'accepted', 'accepted']Passed
boundary: call ten seconds after the read['read', 'accepted']['read', 'accepted']Passed
boundary: call eleven seconds after the read['read', 'denied']['read', 'denied']Passed
boundary: end of the secured window['accepted', 'denied']['accepted', 'denied']Passed
control 1['read', 'read', 'accepted']['read', 'read', 'accepted']Passed
control 4['denied', 'accepted', 'read', 'accepted']['denied', 'accepted', 'read', 'accepted']Passed
control 7['read', 'accepted', 'read', 'accepted', 'read']['read', 'accepted', 'read', 'accepted', 'read']Passed

SHA-256 / 687efc3dd514420e2e50f64f2019dfc2c8fdb1efd6c6350233a9c10e2e3f6eb0

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    cards = x['cards']
    restricted = set(x['restricted'])
    lo, hi = x['secure_hours']
    card = None
    card_t = None
    out = []
    for t, kind, v in x['events']:
        if kind == 'card':
            card = v
            card_t = t
            out.append('read')
            continue
        hour = (t // 3600) % 24
        in_window = (lo <= hour < hi) if lo <= hi else (hour >= lo or hour < hi)
        if v not in restricted or not in_window:
            out.append('accepted')
            card = None
        elif card is not None and t - card_t <= 10 and v in cards.get(card, []):
            out.append('accepted')
        else:
            out.append('denied')
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: credential used twice', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [102, 'call', 5], [104, 'call', 7]]}, ['read', 'accepted', 'denied']), ('boundary: unsecured call between read and secured call', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [101, 'call', 2], [103, 'call', 7]]}, ['read', 'accepted', 'accepted']), ('boundary: call ten seconds after the read', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [110, 'call', 5]]}, ['read', 'accepted']), ('boundary: call eleven seconds after the read', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [111, 'call', 5]]}, ['read', 'denied']), ('boundary: end of the secured window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[64800, 'call', 5], [64799, 'call', 5]]}, ['accepted', 'denied']), ('control 1', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[9, 'card', 'K1'], [14, 'card', 'K1'], [23, 'call', 2]]}, ['read', 'read', 'accepted']), ('control 4', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[10, 'call', 7], [3610, 'call', 2], [3615, 'card', 'K9'], [3625, 'call', 2]]}, ['denied', 'accepted', 'read', 'accepted']), ('control 7', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[85810, 'card', 'K1'], [85811, 'call', 7], [85812, 'card', 'K1'], [85821, 'call', 5], [85831, 'card', 'K2']]}, ['read', 'accepted', 'read', 'accepted', 'read'])], [('regression: credential used twice', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [102, 'call', 5], [104, 'call', 7]]}, ['read', 'accepted', 'denied']), ('boundary: unsecured call between read and secured call', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [101, 'call', 2], [103, 'call', 7]]}, ['read', 'accepted', 'accepted']), ('boundary: end of the secured window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[64800, 'call', 5], [64799, 'call', 5]]}, ['accepted', 'denied']), ('boundary: overnight window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[82800, 'call', 9], [10800, 'call', 9], [43200, 'call', 9]]}, ['denied', 'denied', 'accepted']), ('boundary: card without the floor', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K2'], [101, 'call', 5]]}, ['read', 'denied']), ('control 12', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[5, 'card', 'K1'], [3605, 'call', 12], [3615, 'call', 9], [3616, 'call', 7]]}, ['read', 'accepted', 'denied', 'denied']), ('control 15', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[89400, 'call', 9], [93000, 'call', 7]]}, ['denied', 'denied']), ('control 18', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[85810, 'card', 'K1'], [85870, 'call', 2], [85880, 'call', 5], [85889, 'call', 12], [85900, 'card', 'K2']]}, ['read', 'accepted', 'accepted', 'accepted', 'read'])], [('regression: credential used twice', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [102, 'call', 5], [104, 'call', 7]]}, ['read', 'accepted', 'denied']), ('boundary: unsecured call between read and secured call', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [101, 'call', 2], [103, 'call', 7]]}, ['read', 'accepted', 'accepted']), ('boundary: end of the secured window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[64800, 'call', 5], [64799, 'call', 5]]}, ['accepted', 'denied']), ('boundary: overnight window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[82800, 'call', 9], [10800, 'call', 9], [43200, 'call', 9]]}, ['denied', 'denied', 'accepted']), ('boundary: card without the floor', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K2'], [101, 'call', 5]]}, ['read', 'denied']), ('control 23', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[72010, 'call', 9], [75610, 'card', 'K1'], [75615, 'call', 12], [75675, 'call', 5], [75686, 'call', 9], [75696, 'call', 5], [75705, 'call', 9]]}, ['denied', 'read', 'accepted', 'denied', 'denied', 'denied', 'denied']), ('control 26', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[85810, 'call', 2], [85819, 'card', 'K1'], [85820, 'card', 'K9'], [85825, 'call', 2]]}, ['accepted', 'read', 'read', 'accepted']), ('control 29', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[85801, 'card', 'K2'], [85812, 'call', 12], [85823, 'call', 9], [85832, 'call', 12], [85892, 'card', 'K2']]}, ['read', 'accepted', 'accepted', 'accepted', 'read'])], [('regression: credential used twice', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [102, 'call', 5], [104, 'call', 7]]}, ['read', 'accepted', 'denied']), ('boundary: unsecured call between read and secured call', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [101, 'call', 2], [103, 'call', 7]]}, ['read', 'accepted', 'accepted']), ('boundary: card without the floor', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K2'], [101, 'call', 5]]}, ['read', 'denied']), ('boundary: call ten seconds after the read', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [110, 'call', 5]]}, ['read', 'accepted']), ('boundary: call eleven seconds after the read', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [111, 'call', 5]]}, ['read', 'denied']), ('control 34', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[3600, 'call', 2], [3611, 'card', 'K2']]}, ['accepted', 'read']), ('control 37', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[3600, 'card', 'K9'], [3609, 'card', 'K1'], [3619, 'card', 'K1'], [7219, 'card', 'K1'], [7224, 'card', 'K1']]}, ['read', 'read', 'read', 'read', 'read']), ('control 40', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[72011, 'call', 12], [72022, 'call', 9]]}, ['accepted', 'denied'])], [('regression: credential used twice', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [102, 'call', 5], [104, 'call', 7]]}, ['read', 'accepted', 'denied']), ('boundary: unsecured call between read and secured call', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [101, 'call', 2], [103, 'call', 7]]}, ['read', 'accepted', 'accepted']), ('boundary: call eleven seconds after the read', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [111, 'call', 5]]}, ['read', 'denied']), ('boundary: end of the secured window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[64800, 'call', 5], [64799, 'call', 5]]}, ['accepted', 'denied']), ('boundary: overnight window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[82800, 'call', 9], [10800, 'call', 9], [43200, 'call', 9]]}, ['denied', 'denied', 'accepted']), ('control 45', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[72011, 'call', 2], [72020, 'card', 'K9'], [72021, 'call', 2]]}, ['accepted', 'read', 'accepted']), ('control 48', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[25260, 'call', 5], [25265, 'card', 'K2']]}, ['accepted', 'read']), ('control 51', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[72011, 'card', 'K9'], [75611, 'call', 5], [75620, 'call', 12], [75629, 'card', 'K1']]}, ['read', 'accepted', 'accepted', 'read'])]]
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
regression: credential used twice['read', 'accepted', 'accepted']['read', 'accepted', 'denied']Failed
boundary: unsecured call between read and secured call['read', 'accepted', 'denied']['read', 'accepted', 'accepted']Failed
boundary: call ten seconds after the read['read', 'accepted']['read', 'accepted']Passed
boundary: call eleven seconds after the read['read', 'denied']['read', 'denied']Passed
boundary: end of the secured window['accepted', 'denied']['accepted', 'denied']Passed
control 1['read', 'read', 'accepted']['read', 'read', 'accepted']Passed
control 4['denied', 'accepted', 'read', 'accepted']['denied', 'accepted', 'read', 'accepted']Passed
control 7['read', 'accepted', 'read', 'accepted', 'read']['read', 'accepted', 'read', 'accepted', 'read']Passed

SHA-256 / 5b310de458e461adbda30404809c8790564b246906ba8e8b7bc4e83b779b7a3b

3 / The verified repair

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

N = 1
observations = []
def solve(x):
    cards = x['cards']
    restricted = set(x['restricted'])
    lo, hi = x['secure_hours']
    card = None
    card_t = None
    out = []
    for t, kind, v in x['events']:
        if kind == 'card':
            card = v
            card_t = t
            out.append('read')
            continue
        hour = (t // 3600) % 24
        in_window = (lo <= hour < hi) if lo <= hi else (hour >= lo or hour < hi)
        if v not in restricted or not in_window:
            out.append('accepted')
        elif card is not None and t - card_t <= 10 and v in cards.get(card, []):
            out.append('accepted')
            card = None
        else:
            out.append('denied')
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: credential used twice', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [102, 'call', 5], [104, 'call', 7]]}, ['read', 'accepted', 'denied']), ('boundary: unsecured call between read and secured call', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [101, 'call', 2], [103, 'call', 7]]}, ['read', 'accepted', 'accepted']), ('boundary: call ten seconds after the read', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [110, 'call', 5]]}, ['read', 'accepted']), ('boundary: call eleven seconds after the read', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [111, 'call', 5]]}, ['read', 'denied']), ('boundary: end of the secured window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[64800, 'call', 5], [64799, 'call', 5]]}, ['accepted', 'denied']), ('control 1', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[9, 'card', 'K1'], [14, 'card', 'K1'], [23, 'call', 2]]}, ['read', 'read', 'accepted']), ('control 4', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[10, 'call', 7], [3610, 'call', 2], [3615, 'card', 'K9'], [3625, 'call', 2]]}, ['denied', 'accepted', 'read', 'accepted']), ('control 7', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[85810, 'card', 'K1'], [85811, 'call', 7], [85812, 'card', 'K1'], [85821, 'call', 5], [85831, 'card', 'K2']]}, ['read', 'accepted', 'read', 'accepted', 'read'])], [('regression: credential used twice', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [102, 'call', 5], [104, 'call', 7]]}, ['read', 'accepted', 'denied']), ('boundary: unsecured call between read and secured call', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [101, 'call', 2], [103, 'call', 7]]}, ['read', 'accepted', 'accepted']), ('boundary: end of the secured window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[64800, 'call', 5], [64799, 'call', 5]]}, ['accepted', 'denied']), ('boundary: overnight window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[82800, 'call', 9], [10800, 'call', 9], [43200, 'call', 9]]}, ['denied', 'denied', 'accepted']), ('boundary: card without the floor', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K2'], [101, 'call', 5]]}, ['read', 'denied']), ('control 12', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[5, 'card', 'K1'], [3605, 'call', 12], [3615, 'call', 9], [3616, 'call', 7]]}, ['read', 'accepted', 'denied', 'denied']), ('control 15', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[89400, 'call', 9], [93000, 'call', 7]]}, ['denied', 'denied']), ('control 18', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[85810, 'card', 'K1'], [85870, 'call', 2], [85880, 'call', 5], [85889, 'call', 12], [85900, 'card', 'K2']]}, ['read', 'accepted', 'accepted', 'accepted', 'read'])], [('regression: credential used twice', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [102, 'call', 5], [104, 'call', 7]]}, ['read', 'accepted', 'denied']), ('boundary: unsecured call between read and secured call', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [101, 'call', 2], [103, 'call', 7]]}, ['read', 'accepted', 'accepted']), ('boundary: end of the secured window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[64800, 'call', 5], [64799, 'call', 5]]}, ['accepted', 'denied']), ('boundary: overnight window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[82800, 'call', 9], [10800, 'call', 9], [43200, 'call', 9]]}, ['denied', 'denied', 'accepted']), ('boundary: card without the floor', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K2'], [101, 'call', 5]]}, ['read', 'denied']), ('control 23', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[72010, 'call', 9], [75610, 'card', 'K1'], [75615, 'call', 12], [75675, 'call', 5], [75686, 'call', 9], [75696, 'call', 5], [75705, 'call', 9]]}, ['denied', 'read', 'accepted', 'denied', 'denied', 'denied', 'denied']), ('control 26', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[85810, 'call', 2], [85819, 'card', 'K1'], [85820, 'card', 'K9'], [85825, 'call', 2]]}, ['accepted', 'read', 'read', 'accepted']), ('control 29', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[85801, 'card', 'K2'], [85812, 'call', 12], [85823, 'call', 9], [85832, 'call', 12], [85892, 'card', 'K2']]}, ['read', 'accepted', 'accepted', 'accepted', 'read'])], [('regression: credential used twice', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [102, 'call', 5], [104, 'call', 7]]}, ['read', 'accepted', 'denied']), ('boundary: unsecured call between read and secured call', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [101, 'call', 2], [103, 'call', 7]]}, ['read', 'accepted', 'accepted']), ('boundary: card without the floor', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K2'], [101, 'call', 5]]}, ['read', 'denied']), ('boundary: call ten seconds after the read', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [110, 'call', 5]]}, ['read', 'accepted']), ('boundary: call eleven seconds after the read', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [111, 'call', 5]]}, ['read', 'denied']), ('control 34', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[3600, 'call', 2], [3611, 'card', 'K2']]}, ['accepted', 'read']), ('control 37', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[3600, 'card', 'K9'], [3609, 'card', 'K1'], [3619, 'card', 'K1'], [7219, 'card', 'K1'], [7224, 'card', 'K1']]}, ['read', 'read', 'read', 'read', 'read']), ('control 40', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[72011, 'call', 12], [72022, 'call', 9]]}, ['accepted', 'denied'])], [('regression: credential used twice', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [102, 'call', 5], [104, 'call', 7]]}, ['read', 'accepted', 'denied']), ('boundary: unsecured call between read and secured call', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [101, 'call', 2], [103, 'call', 7]]}, ['read', 'accepted', 'accepted']), ('boundary: call eleven seconds after the read', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [0, 24], 'events': [[100, 'card', 'K1'], [111, 'call', 5]]}, ['read', 'denied']), ('boundary: end of the secured window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[64800, 'call', 5], [64799, 'call', 5]]}, ['accepted', 'denied']), ('boundary: overnight window', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[82800, 'call', 9], [10800, 'call', 9], [43200, 'call', 9]]}, ['denied', 'denied', 'accepted']), ('control 45', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[72011, 'call', 2], [72020, 'card', 'K9'], [72021, 'call', 2]]}, ['accepted', 'read', 'accepted']), ('control 48', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [20, 6], 'events': [[25260, 'call', 5], [25265, 'card', 'K2']]}, ['accepted', 'read']), ('control 51', {'restricted': [5, 7, 9], 'cards': {'K1': [5, 7], 'K2': [9]}, 'secure_hours': [8, 18], 'events': [[72011, 'card', 'K9'], [75611, 'call', 5], [75620, 'call', 12], [75629, 'card', 'K1']]}, ['read', 'accepted', 'accepted', 'read'])]]
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
regression: credential used twice['read', 'accepted', 'denied']['read', 'accepted', 'denied']Passed
boundary: unsecured call between read and secured call['read', 'accepted', 'accepted']['read', 'accepted', 'accepted']Passed
boundary: call ten seconds after the read['read', 'accepted']['read', 'accepted']Passed
boundary: call eleven seconds after the read['read', 'denied']['read', 'denied']Passed
boundary: end of the secured window['accepted', 'denied']['accepted', 'denied']Passed
control 1['read', 'read', 'accepted']['read', 'read', 'accepted']Passed
control 4['denied', 'accepted', 'read', 'accepted']['denied', 'accepted', 'read', 'accepted']Passed
control 7['read', 'accepted', 'read', 'accepted', 'read']['read', 'accepted', 'read', 'accepted', 'read']Passed

SHA-256 / ff1d2114c06a73967df60bef0e6baef828ab03e18a1451d91057c78d715b2d3f

Verification & scope

Stipulated toy lift-control contract for a bounded teaching model; it makes no claim of conformance to any lift code or vendor dispatcher and omits real safety cases. 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:47:55.302046+00:00.

Case digest / 644551194048f2dfb140982cd7aafa42af669956c5a70373c8459b80d30c161b