FA-94111 / Shift rostering labor rules / Open access
Given-away shift kept on the requester after the swap · case 01
Swaps fail on overlap or hours cap caused by the shift being handed over.
ROOT CAUSE
The requester's post-swap roster still contains the outgoing shift.
VERIFIED REPAIR
Remove the outgoing shift by its id before validating.
Unsuccessful approach: Removing by the partner's shift id leaves the outgoing shift in place.
Case contract
roster maps worker to shifts [id, start, end, skill]; req = [a, b, a_gives, b_gives or None]. After the swap a holds its shifts minus a_gives plus b's shift, b holds its shifts minus b_gives plus a's shift. Checks in order: receiver qualified for each received shift (a then b), then for a then b sorted by start: overlap, then rest below the minimum, then total minutes above cap. Return the first failure [reason, worker] or ["ok", None].
Why this case matters
Self-service shift swaps must be revalidated against labor rules for both parties after the exchange.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(roster, quals, req, rest, cap):
a, b, ga, gb = req
sa = [t for t in roster[a] if t[0] == ga][0]
sb = [t for t in roster[b] if t[0] == gb]
sb = sb[0] if sb else None
new = {a: list(roster[a]) + ([sb] if sb else []),
b: [t for t in roster[b] if t[0] != gb] + [sa]}
got = {a: sb, b: sa}
for w in (a, b):
if got[w] and got[w][3] not in quals[w]:
return ['qual', w]
for w in (a, b):
seq = sorted(new[w], key=lambda t: t[1])
for p, q in zip(seq, seq[1:]):
if q[1] < p[2]:
return ['overlap', w]
if q[1] - p[2] < rest:
return ['rest', w]
for w in (a, b):
if sum(t[2] - t[1] for t in new[w]) > cap:
return ['cap', w]
return ['ok', None]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: giver shift removed 1',
[{'a': [['s', 0, 600, 'rn'], ['t', 1200, 1680, 'rn']], 'b': [['u', 3000, 3480, 'rn']]},
{'a': ['rn'], 'b': ['rn']}, ['a', 'b', 's', 'u'], 600, 960],
['ok', None]),
('regression variant: giver shift removed 2',
[{'a': [['s', 0, 600, 'icu'], ['t', 1200, 1680, 'rn'], ['u', 2680, 3160, 'icu']],
'b': [['v', 60, 660, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['icu', 'rn']}, ['a', 'b', 's', 'v'], 600, 960],
['rest', 'a']),
('partial repair guard 3',
[{'a': [['t', 1300, 1900, 'rn'], ['s', 60, 300, 'icu'], ['u', 2900, 3140, 'rn']],
'b': [['w', 1540, 2140, 'rn'], ['v', 60, 540, 'rn'], ['x', 2739, 3339, 'rn']]},
{'a': ['rn'], 'b': ['rn']}, ['a', 'b', 'u', 'x'], 600, 960],
['cap', 'a']),
('boundary control 4',
[{'a': [['s', 0, 480, 'rn']], 'b': [['u', 1080, 1560, 'rn']]}, {'a': ['rn'], 'b': ['rn']},
['a', 'b', 's', None], 600, 960],
['ok', None]),
('normal control 5',
[{'a': [['s', 0, 240, 'rn'], ['t', 839, 1079, 'rn'], ['u', 1379, 1859, 'icu']],
'b': [['w', 1240, 1720, 'rn'], ['v', 60, 540, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'w'], 600, 960],
['rest', 'a']),
('normal control 6',
[{'a': [['s', 60, 300, 'rn'], ['t', 899, 1499, 'icu']],
'b': [['u', 60, 660, 'icu'], ['v', 960, 1440, 'rn']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 't', 'v'], 600, 960],
['rest', 'b']),
('normal control 7',
[{'a': [['s', 60, 300, 'rn']], 'b': [['t', 60, 300, 'rn']]}, {'a': ['rn'], 'b': ['icu', 'rn']},
['a', 'b', 's', 't'], 600, 1200],
['ok', None]),
('normal control 8',
[{'a': [['s', 60, 300, 'rn']], 'b': [['t', 0, 240, 'rn'], ['u', 1240, 1480, 'icu']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 's', None], 600, 960],
['overlap', 'b'])],
[('regression: giver shift removed 1',
[{'a': [['s', 0, 720, 'rn'], ['t', 1400, 1880, 'rn']], 'b': [['u', 3000, 3240, 'rn']]},
{'a': ['rn'], 'b': ['rn']}, ['a', 'b', 's', 'u'], 600, 720],
['ok', None]),
('regression variant: giver shift removed 2',
[{'a': [['t', 1240, 1720, 'icu'], ['s', 0, 240, 'rn'], ['u', 2420, 3020, 'rn']],
'b': [['w', 1139, 1619, 'rn'], ['v', 60, 540, 'rn'], ['x', 2219, 2459, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'v'], 600, 1200],
['cap', 'a']),
('partial repair guard 3',
[{'a': [['s', 0, 600, 'rn']], 'b': [['t', 0, 240, 'rn']]}, {'a': ['rn', 'icu'], 'b': ['icu', 'rn']},
['a', 'b', 's', 't'], 600, 1440],
['ok', None]),
('normal control 4',
[{'a': [['u', 1320, 1800, 'rn'], ['s', 0, 480, 'rn'], ['t', 780, 1020, 'icu']],
'b': [['v', 60, 660, 'icu']]},
{'a': ['rn', 'icu'], 'b': ['rn']}, ['a', 'b', 't', None], 600, 1440],
['qual', 'b']),
('normal control 5',
[{'a': [['s', 0, 480, 'rn'], ['t', 1080, 1320, 'rn']],
'b': [['v', 839, 1319, 'rn'], ['w', 1919, 2159, 'rn'], ['u', 0, 240, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['icu', 'rn']}, ['a', 'b', 's', 'v'], 600, 1200],
['overlap', 'a']),
('normal control 6',
[{'a': [['s', 0, 600, 'rn']], 'b': [['t', 0, 240, 'rn'], ['u', 1240, 1480, 'icu']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 960],
['overlap', 'b']),
('normal control 7',
[{'a': [['t', 1200, 1440, 'icu'], ['s', 0, 600, 'rn']],
'b': [['v', 780, 1260, 'rn'], ['u', 0, 480, 'rn']]},
{'a': ['rn'], 'b': ['rn']}, ['a', 'b', 's', 'u'], 600, 960],
['rest', 'b']),
('normal control 8',
[{'a': [['s', 0, 600, 'rn']], 'b': [['t', 60, 660, 'rn'], ['u', 1259, 1499, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 1200],
['overlap', 'b'])],
[('regression: giver shift removed 1',
[{'a': [['t', 1200, 1680, 'rn'], ['s', 0, 700, 'icu']], 'b': [['u', 3000, 3700, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 1180],
['ok', None]),
('regression variant: giver shift removed 2',
[{'a': [['s', 60, 300, 'rn']], 'b': [['u', 899, 1139, 'rn'], ['t', 60, 300, 'icu']]},
{'a': ['rn', 'icu'], 'b': ['rn']}, ['a', 'b', 's', 'u'], 600, 1200],
['overlap', 'b']),
('partial repair guard 3',
[{'a': [['s', 60, 300, 'rn'], ['t', 899, 1499, 'icu']],
'b': [['v', 1300, 1540, 'icu'], ['u', 0, 600, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'v'], 600, 1200],
['overlap', 'a']),
('boundary control 4',
[{'a': [['s', 0, 480, 'icu']], 'b': [['u', 2000, 2480, 'rn']]}, {'a': ['rn', 'icu'], 'b': ['rn']},
['a', 'b', 's', 'u'], 600, 960],
['qual', 'b']),
('normal control 5',
[{'a': [['s', 60, 300, 'rn'], ['t', 1000, 1600, 'icu']], 'b': [['u', 0, 480, 'icu']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 1440],
['qual', 'a']),
('normal control 6',
[{'a': [['t', 1140, 1620, 'icu'], ['s', 60, 540, 'rn']],
'b': [['w', 2140, 2620, 'rn'], ['u', 60, 540, 'rn'], ['v', 840, 1440, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'v'], 600, 1440],
['overlap', 'a']),
('normal control 7',
[{'a': [['t', 1300, 1780, 'rn'], ['s', 0, 600, 'rn'], ['u', 2380, 2980, 'rn']],
'b': [['v', 0, 600, 'icu']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 'u', 'v'], 600, 1200],
['qual', 'a']),
('normal control 8',
[{'a': [['t', 1240, 1480, 'rn'], ['s', 0, 240, 'icu']],
'b': [['u', 0, 600, 'rn'], ['v', 1200, 1800, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 't', None], 600, 1200],
['overlap', 'b'])],
[('regression: giver shift removed 1',
[{'a': [['t', 960, 1200, 'rn'], ['s', 60, 660, 'rn']],
'b': [['v', 1200, 1440, 'rn'], ['u', 0, 600, 'icu']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 's', None], 600, 1200],
['overlap', 'b']),
('regression variant: giver shift removed 2',
[{'a': [['t', 1079, 1679, 'rn'], ['u', 2679, 2919, 'rn'], ['s', 0, 480, 'rn']],
'b': [['v', 0, 240, 'rn'], ['w', 1240, 1480, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 't', 'w'], 600, 1440],
['ok', None]),
('partial repair guard 3',
[{'a': [['t', 1300, 1540, 'rn'], ['s', 0, 600, 'rn']],
'b': [['u', 0, 480, 'rn'], ['w', 2380, 2620, 'rn'], ['v', 780, 1380, 'icu']]},
{'a': ['rn', 'icu'], 'b': ['icu', 'rn']}, ['a', 'b', 's', 'u'], 600, 960],
['rest', 'b']),
('boundary control 4',
[{'a': [['t', 1200, 1680, 'rn'], ['s', 0, 700, 'icu']], 'b': [['u', 3000, 3700, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 1180],
['ok', None]),
('normal control 5',
[{'a': [['s', 0, 240, 'icu'], ['t', 840, 1440, 'icu']], 'b': [['u', 0, 480, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['icu', 'rn']}, ['a', 'b', 't', None], 600, 1440],
['rest', 'b']),
('normal control 6',
[{'a': [['s', 0, 480, 'rn']],
'b': [['v', 2080, 2320, 'icu'], ['u', 1000, 1480, 'icu'], ['t', 60, 300, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 't'], 600, 960],
['rest', 'b']),
('normal control 7',
[{'a': [['t', 1540, 2140, 'rn'], ['u', 2840, 3440, 'icu'], ['s', 60, 540, 'rn']],
'b': [['w', 1480, 1960, 'rn'], ['v', 0, 480, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 't', 'w'], 600, 960],
['cap', 'a']),
('normal control 8',
[{'a': [['t', 1200, 1440, 'rn'], ['s', 0, 600, 'rn']], 'b': [['u', 0, 480, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 960],
['ok', None])],
[('regression: giver shift removed 1',
[{'a': [['s', 0, 480, 'icu'], ['t', 1180, 1660, 'rn'], ['u', 2259, 2499, 'rn']],
'b': [['v', 0, 480, 'rn'], ['x', 1919, 2399, 'icu'], ['w', 1079, 1319, 'rn']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 's', 'w'], 600, 960],
['overlap', 'a']),
('regression variant: giver shift removed 2',
[{'a': [['s', 0, 240, 'rn']], 'b': [['t', 60, 300, 'rn']]}, {'a': ['rn'], 'b': ['rn']},
['a', 'b', 's', 't'], 600, 1200],
['ok', None]),
('partial repair guard 3',
[{'a': [['s', 60, 660, 'rn']],
'b': [['t', 0, 240, 'icu'], ['u', 840, 1440, 'icu'], ['v', 2440, 2680, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn']}, ['a', 'b', 's', 't'], 600, 1200],
['rest', 'b']),
('boundary control 4',
[{'a': [['s', 0, 600, 'rn'], ['t', 1200, 1680, 'rn']], 'b': [['u', 3000, 3480, 'rn']]},
{'a': ['rn'], 'b': ['rn']}, ['a', 'b', 's', 'u'], 600, 960],
['ok', None]),
('normal control 5',
[{'a': [['s', 60, 660, 'rn']],
'b': [['v', 1720, 2320, 'rn'], ['u', 780, 1020, 'rn'], ['t', 0, 480, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['icu', 'rn']}, ['a', 'b', 's', 'v'], 600, 960],
['overlap', 'b']),
('normal control 6',
[{'a': [['u', 1840, 2080, 'icu'], ['s', 0, 600, 'rn'], ['t', 900, 1140, 'rn']],
'b': [['w', 840, 1320, 'rn'], ['v', 60, 540, 'icu'], ['x', 1920, 2160, 'rn']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 't', 'v'], 600, 1200],
['qual', 'a']),
('normal control 7',
[{'a': [['t', 1480, 1960, 'rn'], ['u', 2560, 3040, 'icu'], ['s', 0, 480, 'rn']],
'b': [['w', 1300, 1540, 'rn'], ['v', 60, 300, 'icu'], ['x', 2140, 2740, 'rn']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 'u', 'v'], 600, 960],
['qual', 'a']),
('normal control 8',
[{'a': [['s', 0, 600, 'rn']], 'b': [['t', 0, 480, 'rn']]}, {'a': ['rn'], 'b': ['rn']},
['a', 'b', 's', None], 600, 960],
['overlap', 'b'])]]
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 |
|---|---|---|---|
| regression: giver shift removed 1 | ['cap', 'a'] | ['ok', None] | Failed |
| regression variant: giver shift removed 2 | ['overlap', 'a'] | ['rest', 'a'] | Failed |
| partial repair guard 3 | ['overlap', 'a'] | ['cap', 'a'] | Failed |
| boundary control 4 | ['ok', None] | ['ok', None] | Passed |
| normal control 5 | ['rest', 'a'] | ['rest', 'a'] | Passed |
| normal control 6 | ['rest', 'a'] | ['rest', 'b'] | Failed |
| normal control 7 | ['overlap', 'a'] | ['ok', None] | Failed |
| normal control 8 | ['overlap', 'b'] | ['overlap', 'b'] | Passed |
SHA-256 / d9a19a485e2847d74919544c7e9d81087b49fd34d07422f76b55a91828041a00
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(roster, quals, req, rest, cap):
a, b, ga, gb = req
sa = [t for t in roster[a] if t[0] == ga][0]
sb = [t for t in roster[b] if t[0] == gb]
sb = sb[0] if sb else None
new = {a: [t for t in roster[a] if t[0] != gb] + ([sb] if sb else []),
b: [t for t in roster[b] if t[0] != gb] + [sa]}
got = {a: sb, b: sa}
for w in (a, b):
if got[w] and got[w][3] not in quals[w]:
return ['qual', w]
for w in (a, b):
seq = sorted(new[w], key=lambda t: t[1])
for p, q in zip(seq, seq[1:]):
if q[1] < p[2]:
return ['overlap', w]
if q[1] - p[2] < rest:
return ['rest', w]
for w in (a, b):
if sum(t[2] - t[1] for t in new[w]) > cap:
return ['cap', w]
return ['ok', None]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: giver shift removed 1',
[{'a': [['s', 0, 600, 'rn'], ['t', 1200, 1680, 'rn']], 'b': [['u', 3000, 3480, 'rn']]},
{'a': ['rn'], 'b': ['rn']}, ['a', 'b', 's', 'u'], 600, 960],
['ok', None]),
('regression variant: giver shift removed 2',
[{'a': [['s', 0, 600, 'icu'], ['t', 1200, 1680, 'rn'], ['u', 2680, 3160, 'icu']],
'b': [['v', 60, 660, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['icu', 'rn']}, ['a', 'b', 's', 'v'], 600, 960],
['rest', 'a']),
('partial repair guard 3',
[{'a': [['t', 1300, 1900, 'rn'], ['s', 60, 300, 'icu'], ['u', 2900, 3140, 'rn']],
'b': [['w', 1540, 2140, 'rn'], ['v', 60, 540, 'rn'], ['x', 2739, 3339, 'rn']]},
{'a': ['rn'], 'b': ['rn']}, ['a', 'b', 'u', 'x'], 600, 960],
['cap', 'a']),
('boundary control 4',
[{'a': [['s', 0, 480, 'rn']], 'b': [['u', 1080, 1560, 'rn']]}, {'a': ['rn'], 'b': ['rn']},
['a', 'b', 's', None], 600, 960],
['ok', None]),
('normal control 5',
[{'a': [['s', 0, 240, 'rn'], ['t', 839, 1079, 'rn'], ['u', 1379, 1859, 'icu']],
'b': [['w', 1240, 1720, 'rn'], ['v', 60, 540, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'w'], 600, 960],
['rest', 'a']),
('normal control 6',
[{'a': [['s', 60, 300, 'rn'], ['t', 899, 1499, 'icu']],
'b': [['u', 60, 660, 'icu'], ['v', 960, 1440, 'rn']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 't', 'v'], 600, 960],
['rest', 'b']),
('normal control 7',
[{'a': [['s', 60, 300, 'rn']], 'b': [['t', 60, 300, 'rn']]}, {'a': ['rn'], 'b': ['icu', 'rn']},
['a', 'b', 's', 't'], 600, 1200],
['ok', None]),
('normal control 8',
[{'a': [['s', 60, 300, 'rn']], 'b': [['t', 0, 240, 'rn'], ['u', 1240, 1480, 'icu']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 's', None], 600, 960],
['overlap', 'b'])],
[('regression: giver shift removed 1',
[{'a': [['s', 0, 720, 'rn'], ['t', 1400, 1880, 'rn']], 'b': [['u', 3000, 3240, 'rn']]},
{'a': ['rn'], 'b': ['rn']}, ['a', 'b', 's', 'u'], 600, 720],
['ok', None]),
('regression variant: giver shift removed 2',
[{'a': [['t', 1240, 1720, 'icu'], ['s', 0, 240, 'rn'], ['u', 2420, 3020, 'rn']],
'b': [['w', 1139, 1619, 'rn'], ['v', 60, 540, 'rn'], ['x', 2219, 2459, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'v'], 600, 1200],
['cap', 'a']),
('partial repair guard 3',
[{'a': [['s', 0, 600, 'rn']], 'b': [['t', 0, 240, 'rn']]}, {'a': ['rn', 'icu'], 'b': ['icu', 'rn']},
['a', 'b', 's', 't'], 600, 1440],
['ok', None]),
('normal control 4',
[{'a': [['u', 1320, 1800, 'rn'], ['s', 0, 480, 'rn'], ['t', 780, 1020, 'icu']],
'b': [['v', 60, 660, 'icu']]},
{'a': ['rn', 'icu'], 'b': ['rn']}, ['a', 'b', 't', None], 600, 1440],
['qual', 'b']),
('normal control 5',
[{'a': [['s', 0, 480, 'rn'], ['t', 1080, 1320, 'rn']],
'b': [['v', 839, 1319, 'rn'], ['w', 1919, 2159, 'rn'], ['u', 0, 240, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['icu', 'rn']}, ['a', 'b', 's', 'v'], 600, 1200],
['overlap', 'a']),
('normal control 6',
[{'a': [['s', 0, 600, 'rn']], 'b': [['t', 0, 240, 'rn'], ['u', 1240, 1480, 'icu']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 960],
['overlap', 'b']),
('normal control 7',
[{'a': [['t', 1200, 1440, 'icu'], ['s', 0, 600, 'rn']],
'b': [['v', 780, 1260, 'rn'], ['u', 0, 480, 'rn']]},
{'a': ['rn'], 'b': ['rn']}, ['a', 'b', 's', 'u'], 600, 960],
['rest', 'b']),
('normal control 8',
[{'a': [['s', 0, 600, 'rn']], 'b': [['t', 60, 660, 'rn'], ['u', 1259, 1499, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 1200],
['overlap', 'b'])],
[('regression: giver shift removed 1',
[{'a': [['t', 1200, 1680, 'rn'], ['s', 0, 700, 'icu']], 'b': [['u', 3000, 3700, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 1180],
['ok', None]),
('regression variant: giver shift removed 2',
[{'a': [['s', 60, 300, 'rn']], 'b': [['u', 899, 1139, 'rn'], ['t', 60, 300, 'icu']]},
{'a': ['rn', 'icu'], 'b': ['rn']}, ['a', 'b', 's', 'u'], 600, 1200],
['overlap', 'b']),
('partial repair guard 3',
[{'a': [['s', 60, 300, 'rn'], ['t', 899, 1499, 'icu']],
'b': [['v', 1300, 1540, 'icu'], ['u', 0, 600, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'v'], 600, 1200],
['overlap', 'a']),
('boundary control 4',
[{'a': [['s', 0, 480, 'icu']], 'b': [['u', 2000, 2480, 'rn']]}, {'a': ['rn', 'icu'], 'b': ['rn']},
['a', 'b', 's', 'u'], 600, 960],
['qual', 'b']),
('normal control 5',
[{'a': [['s', 60, 300, 'rn'], ['t', 1000, 1600, 'icu']], 'b': [['u', 0, 480, 'icu']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 1440],
['qual', 'a']),
('normal control 6',
[{'a': [['t', 1140, 1620, 'icu'], ['s', 60, 540, 'rn']],
'b': [['w', 2140, 2620, 'rn'], ['u', 60, 540, 'rn'], ['v', 840, 1440, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'v'], 600, 1440],
['overlap', 'a']),
('normal control 7',
[{'a': [['t', 1300, 1780, 'rn'], ['s', 0, 600, 'rn'], ['u', 2380, 2980, 'rn']],
'b': [['v', 0, 600, 'icu']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 'u', 'v'], 600, 1200],
['qual', 'a']),
('normal control 8',
[{'a': [['t', 1240, 1480, 'rn'], ['s', 0, 240, 'icu']],
'b': [['u', 0, 600, 'rn'], ['v', 1200, 1800, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 't', None], 600, 1200],
['overlap', 'b'])],
[('regression: giver shift removed 1',
[{'a': [['t', 960, 1200, 'rn'], ['s', 60, 660, 'rn']],
'b': [['v', 1200, 1440, 'rn'], ['u', 0, 600, 'icu']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 's', None], 600, 1200],
['overlap', 'b']),
('regression variant: giver shift removed 2',
[{'a': [['t', 1079, 1679, 'rn'], ['u', 2679, 2919, 'rn'], ['s', 0, 480, 'rn']],
'b': [['v', 0, 240, 'rn'], ['w', 1240, 1480, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 't', 'w'], 600, 1440],
['ok', None]),
('partial repair guard 3',
[{'a': [['t', 1300, 1540, 'rn'], ['s', 0, 600, 'rn']],
'b': [['u', 0, 480, 'rn'], ['w', 2380, 2620, 'rn'], ['v', 780, 1380, 'icu']]},
{'a': ['rn', 'icu'], 'b': ['icu', 'rn']}, ['a', 'b', 's', 'u'], 600, 960],
['rest', 'b']),
('boundary control 4',
[{'a': [['t', 1200, 1680, 'rn'], ['s', 0, 700, 'icu']], 'b': [['u', 3000, 3700, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 1180],
['ok', None]),
('normal control 5',
[{'a': [['s', 0, 240, 'icu'], ['t', 840, 1440, 'icu']], 'b': [['u', 0, 480, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['icu', 'rn']}, ['a', 'b', 't', None], 600, 1440],
['rest', 'b']),
('normal control 6',
[{'a': [['s', 0, 480, 'rn']],
'b': [['v', 2080, 2320, 'icu'], ['u', 1000, 1480, 'icu'], ['t', 60, 300, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 't'], 600, 960],
['rest', 'b']),
('normal control 7',
[{'a': [['t', 1540, 2140, 'rn'], ['u', 2840, 3440, 'icu'], ['s', 60, 540, 'rn']],
'b': [['w', 1480, 1960, 'rn'], ['v', 0, 480, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 't', 'w'], 600, 960],
['cap', 'a']),
('normal control 8',
[{'a': [['t', 1200, 1440, 'rn'], ['s', 0, 600, 'rn']], 'b': [['u', 0, 480, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 960],
['ok', None])],
[('regression: giver shift removed 1',
[{'a': [['s', 0, 480, 'icu'], ['t', 1180, 1660, 'rn'], ['u', 2259, 2499, 'rn']],
'b': [['v', 0, 480, 'rn'], ['x', 1919, 2399, 'icu'], ['w', 1079, 1319, 'rn']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 's', 'w'], 600, 960],
['overlap', 'a']),
('regression variant: giver shift removed 2',
[{'a': [['s', 0, 240, 'rn']], 'b': [['t', 60, 300, 'rn']]}, {'a': ['rn'], 'b': ['rn']},
['a', 'b', 's', 't'], 600, 1200],
['ok', None]),
('partial repair guard 3',
[{'a': [['s', 60, 660, 'rn']],
'b': [['t', 0, 240, 'icu'], ['u', 840, 1440, 'icu'], ['v', 2440, 2680, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn']}, ['a', 'b', 's', 't'], 600, 1200],
['rest', 'b']),
('boundary control 4',
[{'a': [['s', 0, 600, 'rn'], ['t', 1200, 1680, 'rn']], 'b': [['u', 3000, 3480, 'rn']]},
{'a': ['rn'], 'b': ['rn']}, ['a', 'b', 's', 'u'], 600, 960],
['ok', None]),
('normal control 5',
[{'a': [['s', 60, 660, 'rn']],
'b': [['v', 1720, 2320, 'rn'], ['u', 780, 1020, 'rn'], ['t', 0, 480, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['icu', 'rn']}, ['a', 'b', 's', 'v'], 600, 960],
['overlap', 'b']),
('normal control 6',
[{'a': [['u', 1840, 2080, 'icu'], ['s', 0, 600, 'rn'], ['t', 900, 1140, 'rn']],
'b': [['w', 840, 1320, 'rn'], ['v', 60, 540, 'icu'], ['x', 1920, 2160, 'rn']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 't', 'v'], 600, 1200],
['qual', 'a']),
('normal control 7',
[{'a': [['t', 1480, 1960, 'rn'], ['u', 2560, 3040, 'icu'], ['s', 0, 480, 'rn']],
'b': [['w', 1300, 1540, 'rn'], ['v', 60, 300, 'icu'], ['x', 2140, 2740, 'rn']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 'u', 'v'], 600, 960],
['qual', 'a']),
('normal control 8',
[{'a': [['s', 0, 600, 'rn']], 'b': [['t', 0, 480, 'rn']]}, {'a': ['rn'], 'b': ['rn']},
['a', 'b', 's', None], 600, 960],
['overlap', 'b'])]]
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 |
|---|---|---|---|
| regression: giver shift removed 1 | ['cap', 'a'] | ['ok', None] | Failed |
| regression variant: giver shift removed 2 | ['overlap', 'a'] | ['rest', 'a'] | Failed |
| partial repair guard 3 | ['overlap', 'a'] | ['cap', 'a'] | Failed |
| boundary control 4 | ['ok', None] | ['ok', None] | Passed |
| normal control 5 | ['rest', 'a'] | ['rest', 'a'] | Passed |
| normal control 6 | ['rest', 'a'] | ['rest', 'b'] | Failed |
| normal control 7 | ['overlap', 'a'] | ['ok', None] | Failed |
| normal control 8 | ['overlap', 'b'] | ['overlap', 'b'] | Passed |
SHA-256 / 5e38180ab7d29f23db45b24b5ac25eaeca2e83d90398706b8c4927b4d309526f
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(roster, quals, req, rest, cap):
a, b, ga, gb = req
sa = [t for t in roster[a] if t[0] == ga][0]
sb = [t for t in roster[b] if t[0] == gb]
sb = sb[0] if sb else None
new = {a: [t for t in roster[a] if t[0] != ga] + ([sb] if sb else []),
b: [t for t in roster[b] if t[0] != gb] + [sa]}
got = {a: sb, b: sa}
for w in (a, b):
if got[w] and got[w][3] not in quals[w]:
return ['qual', w]
for w in (a, b):
seq = sorted(new[w], key=lambda t: t[1])
for p, q in zip(seq, seq[1:]):
if q[1] < p[2]:
return ['overlap', w]
if q[1] - p[2] < rest:
return ['rest', w]
for w in (a, b):
if sum(t[2] - t[1] for t in new[w]) > cap:
return ['cap', w]
return ['ok', None]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: giver shift removed 1',
[{'a': [['s', 0, 600, 'rn'], ['t', 1200, 1680, 'rn']], 'b': [['u', 3000, 3480, 'rn']]},
{'a': ['rn'], 'b': ['rn']}, ['a', 'b', 's', 'u'], 600, 960],
['ok', None]),
('regression variant: giver shift removed 2',
[{'a': [['s', 0, 600, 'icu'], ['t', 1200, 1680, 'rn'], ['u', 2680, 3160, 'icu']],
'b': [['v', 60, 660, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['icu', 'rn']}, ['a', 'b', 's', 'v'], 600, 960],
['rest', 'a']),
('partial repair guard 3',
[{'a': [['t', 1300, 1900, 'rn'], ['s', 60, 300, 'icu'], ['u', 2900, 3140, 'rn']],
'b': [['w', 1540, 2140, 'rn'], ['v', 60, 540, 'rn'], ['x', 2739, 3339, 'rn']]},
{'a': ['rn'], 'b': ['rn']}, ['a', 'b', 'u', 'x'], 600, 960],
['cap', 'a']),
('boundary control 4',
[{'a': [['s', 0, 480, 'rn']], 'b': [['u', 1080, 1560, 'rn']]}, {'a': ['rn'], 'b': ['rn']},
['a', 'b', 's', None], 600, 960],
['ok', None]),
('normal control 5',
[{'a': [['s', 0, 240, 'rn'], ['t', 839, 1079, 'rn'], ['u', 1379, 1859, 'icu']],
'b': [['w', 1240, 1720, 'rn'], ['v', 60, 540, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'w'], 600, 960],
['rest', 'a']),
('normal control 6',
[{'a': [['s', 60, 300, 'rn'], ['t', 899, 1499, 'icu']],
'b': [['u', 60, 660, 'icu'], ['v', 960, 1440, 'rn']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 't', 'v'], 600, 960],
['rest', 'b']),
('normal control 7',
[{'a': [['s', 60, 300, 'rn']], 'b': [['t', 60, 300, 'rn']]}, {'a': ['rn'], 'b': ['icu', 'rn']},
['a', 'b', 's', 't'], 600, 1200],
['ok', None]),
('normal control 8',
[{'a': [['s', 60, 300, 'rn']], 'b': [['t', 0, 240, 'rn'], ['u', 1240, 1480, 'icu']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 's', None], 600, 960],
['overlap', 'b'])],
[('regression: giver shift removed 1',
[{'a': [['s', 0, 720, 'rn'], ['t', 1400, 1880, 'rn']], 'b': [['u', 3000, 3240, 'rn']]},
{'a': ['rn'], 'b': ['rn']}, ['a', 'b', 's', 'u'], 600, 720],
['ok', None]),
('regression variant: giver shift removed 2',
[{'a': [['t', 1240, 1720, 'icu'], ['s', 0, 240, 'rn'], ['u', 2420, 3020, 'rn']],
'b': [['w', 1139, 1619, 'rn'], ['v', 60, 540, 'rn'], ['x', 2219, 2459, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'v'], 600, 1200],
['cap', 'a']),
('partial repair guard 3',
[{'a': [['s', 0, 600, 'rn']], 'b': [['t', 0, 240, 'rn']]}, {'a': ['rn', 'icu'], 'b': ['icu', 'rn']},
['a', 'b', 's', 't'], 600, 1440],
['ok', None]),
('normal control 4',
[{'a': [['u', 1320, 1800, 'rn'], ['s', 0, 480, 'rn'], ['t', 780, 1020, 'icu']],
'b': [['v', 60, 660, 'icu']]},
{'a': ['rn', 'icu'], 'b': ['rn']}, ['a', 'b', 't', None], 600, 1440],
['qual', 'b']),
('normal control 5',
[{'a': [['s', 0, 480, 'rn'], ['t', 1080, 1320, 'rn']],
'b': [['v', 839, 1319, 'rn'], ['w', 1919, 2159, 'rn'], ['u', 0, 240, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['icu', 'rn']}, ['a', 'b', 's', 'v'], 600, 1200],
['overlap', 'a']),
('normal control 6',
[{'a': [['s', 0, 600, 'rn']], 'b': [['t', 0, 240, 'rn'], ['u', 1240, 1480, 'icu']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 960],
['overlap', 'b']),
('normal control 7',
[{'a': [['t', 1200, 1440, 'icu'], ['s', 0, 600, 'rn']],
'b': [['v', 780, 1260, 'rn'], ['u', 0, 480, 'rn']]},
{'a': ['rn'], 'b': ['rn']}, ['a', 'b', 's', 'u'], 600, 960],
['rest', 'b']),
('normal control 8',
[{'a': [['s', 0, 600, 'rn']], 'b': [['t', 60, 660, 'rn'], ['u', 1259, 1499, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 1200],
['overlap', 'b'])],
[('regression: giver shift removed 1',
[{'a': [['t', 1200, 1680, 'rn'], ['s', 0, 700, 'icu']], 'b': [['u', 3000, 3700, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 1180],
['ok', None]),
('regression variant: giver shift removed 2',
[{'a': [['s', 60, 300, 'rn']], 'b': [['u', 899, 1139, 'rn'], ['t', 60, 300, 'icu']]},
{'a': ['rn', 'icu'], 'b': ['rn']}, ['a', 'b', 's', 'u'], 600, 1200],
['overlap', 'b']),
('partial repair guard 3',
[{'a': [['s', 60, 300, 'rn'], ['t', 899, 1499, 'icu']],
'b': [['v', 1300, 1540, 'icu'], ['u', 0, 600, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'v'], 600, 1200],
['overlap', 'a']),
('boundary control 4',
[{'a': [['s', 0, 480, 'icu']], 'b': [['u', 2000, 2480, 'rn']]}, {'a': ['rn', 'icu'], 'b': ['rn']},
['a', 'b', 's', 'u'], 600, 960],
['qual', 'b']),
('normal control 5',
[{'a': [['s', 60, 300, 'rn'], ['t', 1000, 1600, 'icu']], 'b': [['u', 0, 480, 'icu']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 1440],
['qual', 'a']),
('normal control 6',
[{'a': [['t', 1140, 1620, 'icu'], ['s', 60, 540, 'rn']],
'b': [['w', 2140, 2620, 'rn'], ['u', 60, 540, 'rn'], ['v', 840, 1440, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'v'], 600, 1440],
['overlap', 'a']),
('normal control 7',
[{'a': [['t', 1300, 1780, 'rn'], ['s', 0, 600, 'rn'], ['u', 2380, 2980, 'rn']],
'b': [['v', 0, 600, 'icu']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 'u', 'v'], 600, 1200],
['qual', 'a']),
('normal control 8',
[{'a': [['t', 1240, 1480, 'rn'], ['s', 0, 240, 'icu']],
'b': [['u', 0, 600, 'rn'], ['v', 1200, 1800, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 't', None], 600, 1200],
['overlap', 'b'])],
[('regression: giver shift removed 1',
[{'a': [['t', 960, 1200, 'rn'], ['s', 60, 660, 'rn']],
'b': [['v', 1200, 1440, 'rn'], ['u', 0, 600, 'icu']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 's', None], 600, 1200],
['overlap', 'b']),
('regression variant: giver shift removed 2',
[{'a': [['t', 1079, 1679, 'rn'], ['u', 2679, 2919, 'rn'], ['s', 0, 480, 'rn']],
'b': [['v', 0, 240, 'rn'], ['w', 1240, 1480, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 't', 'w'], 600, 1440],
['ok', None]),
('partial repair guard 3',
[{'a': [['t', 1300, 1540, 'rn'], ['s', 0, 600, 'rn']],
'b': [['u', 0, 480, 'rn'], ['w', 2380, 2620, 'rn'], ['v', 780, 1380, 'icu']]},
{'a': ['rn', 'icu'], 'b': ['icu', 'rn']}, ['a', 'b', 's', 'u'], 600, 960],
['rest', 'b']),
('boundary control 4',
[{'a': [['t', 1200, 1680, 'rn'], ['s', 0, 700, 'icu']], 'b': [['u', 3000, 3700, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 1180],
['ok', None]),
('normal control 5',
[{'a': [['s', 0, 240, 'icu'], ['t', 840, 1440, 'icu']], 'b': [['u', 0, 480, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['icu', 'rn']}, ['a', 'b', 't', None], 600, 1440],
['rest', 'b']),
('normal control 6',
[{'a': [['s', 0, 480, 'rn']],
'b': [['v', 2080, 2320, 'icu'], ['u', 1000, 1480, 'icu'], ['t', 60, 300, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 't'], 600, 960],
['rest', 'b']),
('normal control 7',
[{'a': [['t', 1540, 2140, 'rn'], ['u', 2840, 3440, 'icu'], ['s', 60, 540, 'rn']],
'b': [['w', 1480, 1960, 'rn'], ['v', 0, 480, 'rn']]},
{'a': ['rn'], 'b': ['rn', 'icu']}, ['a', 'b', 't', 'w'], 600, 960],
['cap', 'a']),
('normal control 8',
[{'a': [['t', 1200, 1440, 'rn'], ['s', 0, 600, 'rn']], 'b': [['u', 0, 480, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn', 'icu']}, ['a', 'b', 's', 'u'], 600, 960],
['ok', None])],
[('regression: giver shift removed 1',
[{'a': [['s', 0, 480, 'icu'], ['t', 1180, 1660, 'rn'], ['u', 2259, 2499, 'rn']],
'b': [['v', 0, 480, 'rn'], ['x', 1919, 2399, 'icu'], ['w', 1079, 1319, 'rn']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 's', 'w'], 600, 960],
['overlap', 'a']),
('regression variant: giver shift removed 2',
[{'a': [['s', 0, 240, 'rn']], 'b': [['t', 60, 300, 'rn']]}, {'a': ['rn'], 'b': ['rn']},
['a', 'b', 's', 't'], 600, 1200],
['ok', None]),
('partial repair guard 3',
[{'a': [['s', 60, 660, 'rn']],
'b': [['t', 0, 240, 'icu'], ['u', 840, 1440, 'icu'], ['v', 2440, 2680, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['rn']}, ['a', 'b', 's', 't'], 600, 1200],
['rest', 'b']),
('boundary control 4',
[{'a': [['s', 0, 600, 'rn'], ['t', 1200, 1680, 'rn']], 'b': [['u', 3000, 3480, 'rn']]},
{'a': ['rn'], 'b': ['rn']}, ['a', 'b', 's', 'u'], 600, 960],
['ok', None]),
('normal control 5',
[{'a': [['s', 60, 660, 'rn']],
'b': [['v', 1720, 2320, 'rn'], ['u', 780, 1020, 'rn'], ['t', 0, 480, 'rn']]},
{'a': ['rn', 'icu'], 'b': ['icu', 'rn']}, ['a', 'b', 's', 'v'], 600, 960],
['overlap', 'b']),
('normal control 6',
[{'a': [['u', 1840, 2080, 'icu'], ['s', 0, 600, 'rn'], ['t', 900, 1140, 'rn']],
'b': [['w', 840, 1320, 'rn'], ['v', 60, 540, 'icu'], ['x', 1920, 2160, 'rn']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 't', 'v'], 600, 1200],
['qual', 'a']),
('normal control 7',
[{'a': [['t', 1480, 1960, 'rn'], ['u', 2560, 3040, 'icu'], ['s', 0, 480, 'rn']],
'b': [['w', 1300, 1540, 'rn'], ['v', 60, 300, 'icu'], ['x', 2140, 2740, 'rn']]},
{'a': ['rn'], 'b': ['icu', 'rn']}, ['a', 'b', 'u', 'v'], 600, 960],
['qual', 'a']),
('normal control 8',
[{'a': [['s', 0, 600, 'rn']], 'b': [['t', 0, 480, 'rn']]}, {'a': ['rn'], 'b': ['rn']},
['a', 'b', 's', None], 600, 960],
['overlap', 'b'])]]
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 |
|---|---|---|---|
| regression: giver shift removed 1 | ['ok', None] | ['ok', None] | Passed |
| regression variant: giver shift removed 2 | ['rest', 'a'] | ['rest', 'a'] | Passed |
| partial repair guard 3 | ['cap', 'a'] | ['cap', 'a'] | Passed |
| boundary control 4 | ['ok', None] | ['ok', None] | Passed |
| normal control 5 | ['rest', 'a'] | ['rest', 'a'] | Passed |
| normal control 6 | ['rest', 'b'] | ['rest', 'b'] | Passed |
| normal control 7 | ['ok', None] | ['ok', None] | Passed |
| normal control 8 | ['overlap', 'b'] | ['overlap', 'b'] | Passed |
SHA-256 / 24662065dd2747974148ef03a66cbfcbb1ebc9410f6032bf66d0925a9a7cbef6
Verification & scope
Stipulated toy labor rule for a bounded roster model; it is not legal advice and does not claim conformance with any jurisdiction, award, or collective agreement. 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:52:01.310681+00:00.
Case digest / fdd901988a5a4a0745000d5867ce813232fee3103c43c9d48e8beff37e079972