FAILURE MAP
← Case archive

FA-94191 / Shift rostering labor rules / Open access

Exactly twenty-four hours notice treated as short notice · case 01

Cuts with a full day of notice pay the enhanced premium.

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

ROOT CAUSE

The 24-hour comparison is inclusive.

VERIFIED REPAIR

Enhanced premiums apply only below 1440 minutes notice.

Unsuccessful approach: Restricting the enhanced premium to cancellations underpays late partial cuts.

Case contract

Each change is [kind (add/cut/cancel), notice minutes before the shift, changed minutes, initiator]. Changes initiated by the worker or mutual swaps, or with at least 14 days (20160 minutes) notice, earn nothing. Additions of at least 15 minutes earn 60 premium minutes. Cuts or cancellations earn 60, or max(60, lost // 2) with less than 24 hours notice. Return [per-change premiums, total].

Why this case matters

Fair-workweek predictability pay depends on precise notice thresholds and exemptions.

1 / The failure

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

N = 1
observations = []
def solve(changes):
    out = []
    for kind, notice, delta, by in changes:
        p = 0
        if by not in ('worker', 'mutual') and notice < 20160:
            if kind == 'add':
                p = 60 if delta >= 15 else 0
            elif notice <= 1440:
                p = max(60, delta // 2)
            else:
                p = 60
        out.append(p)
    return [out, sum(out)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: short notice window 1', [[['cut', 1440, 240, 'employer']]], [[60], 60]),
  ('partial repair guard 2', [[['cut', 1439, 240, 'employer'], ['add', 18720, 480, 'employer']]],
   [[120, 60], 180]),
  ('boundary control 3', [[['add', 20159, 15, 'employer']]], [[60], 60]),
  ('normal control 4',
   [[['cut', 20160, 240, 'employer'], ['cancel', 1441, 15, 'employer'], ['add', 60, 30, 'worker'],
     ['cut', 1439, 240, 'employer']]],
   [[0, 60, 0, 120], 180]),
  ('normal control 5',
   [[['cut', 1439, 60, 'employer'], ['add', 30000, 480, 'employer'], ['cut', 20160, 121, 'employer']]],
   [[60, 0, 0], 60]),
  ('normal control 6',
   [[['cancel', 1439, 15, 'employer'], ['cut', 60, 30, 'employer'], ['cancel', 1441, 90, 'mutual']]],
   [[60, 60, 0], 120]),
  ('normal control 7',
   [[['cancel', 1441, 15, 'worker'], ['cancel', 18720, 90, 'employer'], ['add', 60, 121, 'employer']]],
   [[0, 60, 60], 120]),
  ('normal control 8', [[['cut', 20161, 240, 'worker'], ['cut', 20161, 14, 'employer']]], [[0, 0], 0])],
 [('regression: short notice window 1',
   [[['add', 1439, 90, 'mutual'], ['cut', 18720, 16, 'employer'], ['cancel', 1441, 240, 'mutual'],
     ['cancel', 20161, 15, 'mutual'], ['cancel', 1440, 480, 'employer']]],
   [[0, 60, 0, 0, 60], 120]),
  ('regression variant: short notice window 2',
   [[['add', 18720, 90, 'employer'], ['cancel', 60, 15, 'worker'], ['add', 20161, 480, 'mutual'],
     ['cut', 30000, 90, 'mutual'], ['cancel', 1440, 240, 'employer']]],
   [[60, 0, 0, 0, 60], 120]),
  ('partial repair guard 3',
   [[['add', 1440, 16, 'worker'], ['cut', 1441, 15, 'employer'], ['cut', 5000, 14, 'worker'],
     ['cut', 1439, 240, 'employer']]],
   [[0, 60, 0, 120], 180]),
  ('boundary control 4', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('boundary control 5', [[['cancel', 1439, 240, 'employer']]], [[120], 120]),
  ('normal control 6',
   [[['cancel', 1441, 15, 'employer'], ['add', 20161, 10, 'worker'], ['cut', 1440, 90, 'employer']]],
   [[60, 0, 60], 120]),
  ('normal control 7',
   [[['cut', 1439, 60, 'worker'], ['cut', 1441, 480, 'employer'], ['cancel', 1440, 14, 'worker']]],
   [[0, 60, 0], 60]),
  ('normal control 8',
   [[['add', 30000, 15, 'employer'], ['cancel', 20161, 121, 'worker'], ['cancel', 60, 10, 'mutual'],
     ['add', 5000, 30, 'employer']]],
   [[0, 0, 0, 60], 60])],
 [('regression: short notice window 1',
   [[['add', 18720, 90, 'employer'], ['cancel', 60, 15, 'worker'], ['add', 20161, 480, 'mutual'],
     ['cut', 30000, 90, 'mutual'], ['cancel', 1440, 240, 'employer']]],
   [[60, 0, 0, 0, 60], 120]),
  ('regression variant: short notice window 2',
   [[['cancel', 1440, 15, 'employer'], ['cancel', 1440, 480, 'employer']]], [[60, 60], 120]),
  ('partial repair guard 3',
   [[['cancel', 1441, 16, 'employer'], ['cut', 1441, 121, 'worker'], ['cancel', 20159, 30, 'worker'],
     ['cut', 1439, 480, 'employer']]],
   [[60, 0, 0, 240], 300]),
  ('boundary control 4', [[['add', 1000, 14, 'employer']]], [[0], 0]),
  ('boundary control 5', [[['add', 20160, 60, 'employer']]], [[0], 0]),
  ('normal control 6',
   [[['add', 60, 121, 'mutual'], ['cancel', 1439, 15, 'employer'], ['cut', 20160, 14, 'employer'],
     ['cut', 5000, 15, 'worker']]],
   [[0, 60, 0, 0], 60]),
  ('normal control 7',
   [[['add', 1440, 15, 'worker'], ['add', 1441, 15, 'mutual'], ['cancel', 18720, 480, 'mutual'],
     ['add', 18720, 480, 'mutual'], ['add', 20160, 90, 'employer']]],
   [[0, 0, 0, 0, 0], 0]),
  ('normal control 8',
   [[['cancel', 20160, 15, 'employer'], ['add', 30000, 121, 'worker'], ['add', 1440, 60, 'mutual'],
     ['cancel', 1441, 121, 'worker']]],
   [[0, 0, 0, 0], 0])],
 [('regression: short notice window 1',
   [[['cut', 5000, 14, 'mutual'], ['add', 5000, 30, 'mutual'], ['cancel', 1440, 480, 'employer'],
     ['cut', 30000, 90, 'worker'], ['cut', 18720, 15, 'worker']]],
   [[0, 0, 60, 0, 0], 60]),
  ('regression variant: short notice window 2',
   [[['add', 1439, 90, 'mutual'], ['cut', 18720, 16, 'employer'], ['cancel', 1441, 240, 'mutual'],
     ['cancel', 20161, 15, 'mutual'], ['cancel', 1440, 480, 'employer']]],
   [[0, 60, 0, 0, 60], 120]),
  ('partial repair guard 3',
   [[['cut', 60, 480, 'employer'], ['cancel', 20160, 15, 'worker'], ['add', 1439, 90, 'employer'],
     ['add', 20161, 16, 'employer']]],
   [[240, 0, 60, 0], 300]),
  ('boundary control 4', [[['cancel', 100, 60, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['cut', 1440, 240, 'employer']]], [[60], 60]),
  ('normal control 6',
   [[['add', 1441, 15, 'employer'], ['cancel', 5000, 16, 'employer'], ['cut', 20160, 60, 'mutual'],
     ['cancel', 1440, 60, 'employer'], ['cancel', 18720, 30, 'employer']]],
   [[60, 60, 0, 60, 60], 240]),
  ('normal control 7',
   [[['cut', 1441, 16, 'worker'], ['cut', 1440, 90, 'employer'], ['cut', 20159, 240, 'employer'],
     ['cancel', 1440, 121, 'worker']]],
   [[0, 60, 60, 0], 120]),
  ('normal control 8', [[['cancel', 20161, 30, 'employer']]], [[0], 0])],
 [('regression: short notice window 1',
   [[['cancel', 1440, 15, 'employer'], ['cancel', 1440, 480, 'employer']]], [[60, 60], 120]),
  ('regression variant: short notice window 2',
   [[['cut', 5000, 14, 'mutual'], ['add', 5000, 30, 'mutual'], ['cancel', 1440, 480, 'employer'],
     ['cut', 30000, 90, 'worker'], ['cut', 18720, 15, 'worker']]],
   [[0, 0, 60, 0, 0], 60]),
  ('partial repair guard 3',
   [[['cancel', 5000, 60, 'employer'], ['cut', 60, 240, 'employer'], ['add', 20159, 240, 'mutual'],
     ['cancel', 5000, 30, 'worker'], ['cut', 1440, 10, 'mutual']]],
   [[60, 120, 0, 0, 0], 180]),
  ('boundary control 4', [[['add', 20159, 15, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('normal control 6',
   [[['add', 60, 16, 'mutual'], ['add', 1441, 10, 'employer'], ['cut', 1440, 16, 'worker'],
     ['cancel', 20159, 30, 'mutual']]],
   [[0, 0, 0, 0], 0]),
  ('normal control 7',
   [[['cancel', 1441, 240, 'employer'], ['cut', 5000, 14, 'employer'], ['cut', 18720, 30, 'employer']]],
   [[60, 60, 60], 180]),
  ('normal control 8',
   [[['add', 30000, 90, 'mutual'], ['add', 20160, 121, 'worker'], ['cut', 5000, 30, 'employer'],
     ['cut', 1441, 15, 'worker']]],
   [[0, 0, 60, 0], 60])]]
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: short notice window 1[[120], 120][[60], 60]Failed
partial repair guard 2[[120, 60], 180][[120, 60], 180]Passed
boundary control 3[[60], 60][[60], 60]Passed
normal control 4[[0, 60, 0, 120], 180][[0, 60, 0, 120], 180]Passed
normal control 5[[60, 0, 0], 60][[60, 0, 0], 60]Passed
normal control 6[[60, 60, 0], 120][[60, 60, 0], 120]Passed
normal control 7[[0, 60, 60], 120][[0, 60, 60], 120]Passed
normal control 8[[0, 0], 0][[0, 0], 0]Passed

SHA-256 / ba07d2447108a234b740fefa57a216875e42040bf8240c6fda6136c1f9069268

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(changes):
    out = []
    for kind, notice, delta, by in changes:
        p = 0
        if by not in ('worker', 'mutual') and notice < 20160:
            if kind == 'add':
                p = 60 if delta >= 15 else 0
            elif notice < 1440 and kind == 'cancel':
                p = max(60, delta // 2)
            else:
                p = 60
        out.append(p)
    return [out, sum(out)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: short notice window 1', [[['cut', 1440, 240, 'employer']]], [[60], 60]),
  ('partial repair guard 2', [[['cut', 1439, 240, 'employer'], ['add', 18720, 480, 'employer']]],
   [[120, 60], 180]),
  ('boundary control 3', [[['add', 20159, 15, 'employer']]], [[60], 60]),
  ('normal control 4',
   [[['cut', 20160, 240, 'employer'], ['cancel', 1441, 15, 'employer'], ['add', 60, 30, 'worker'],
     ['cut', 1439, 240, 'employer']]],
   [[0, 60, 0, 120], 180]),
  ('normal control 5',
   [[['cut', 1439, 60, 'employer'], ['add', 30000, 480, 'employer'], ['cut', 20160, 121, 'employer']]],
   [[60, 0, 0], 60]),
  ('normal control 6',
   [[['cancel', 1439, 15, 'employer'], ['cut', 60, 30, 'employer'], ['cancel', 1441, 90, 'mutual']]],
   [[60, 60, 0], 120]),
  ('normal control 7',
   [[['cancel', 1441, 15, 'worker'], ['cancel', 18720, 90, 'employer'], ['add', 60, 121, 'employer']]],
   [[0, 60, 60], 120]),
  ('normal control 8', [[['cut', 20161, 240, 'worker'], ['cut', 20161, 14, 'employer']]], [[0, 0], 0])],
 [('regression: short notice window 1',
   [[['add', 1439, 90, 'mutual'], ['cut', 18720, 16, 'employer'], ['cancel', 1441, 240, 'mutual'],
     ['cancel', 20161, 15, 'mutual'], ['cancel', 1440, 480, 'employer']]],
   [[0, 60, 0, 0, 60], 120]),
  ('regression variant: short notice window 2',
   [[['add', 18720, 90, 'employer'], ['cancel', 60, 15, 'worker'], ['add', 20161, 480, 'mutual'],
     ['cut', 30000, 90, 'mutual'], ['cancel', 1440, 240, 'employer']]],
   [[60, 0, 0, 0, 60], 120]),
  ('partial repair guard 3',
   [[['add', 1440, 16, 'worker'], ['cut', 1441, 15, 'employer'], ['cut', 5000, 14, 'worker'],
     ['cut', 1439, 240, 'employer']]],
   [[0, 60, 0, 120], 180]),
  ('boundary control 4', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('boundary control 5', [[['cancel', 1439, 240, 'employer']]], [[120], 120]),
  ('normal control 6',
   [[['cancel', 1441, 15, 'employer'], ['add', 20161, 10, 'worker'], ['cut', 1440, 90, 'employer']]],
   [[60, 0, 60], 120]),
  ('normal control 7',
   [[['cut', 1439, 60, 'worker'], ['cut', 1441, 480, 'employer'], ['cancel', 1440, 14, 'worker']]],
   [[0, 60, 0], 60]),
  ('normal control 8',
   [[['add', 30000, 15, 'employer'], ['cancel', 20161, 121, 'worker'], ['cancel', 60, 10, 'mutual'],
     ['add', 5000, 30, 'employer']]],
   [[0, 0, 0, 60], 60])],
 [('regression: short notice window 1',
   [[['add', 18720, 90, 'employer'], ['cancel', 60, 15, 'worker'], ['add', 20161, 480, 'mutual'],
     ['cut', 30000, 90, 'mutual'], ['cancel', 1440, 240, 'employer']]],
   [[60, 0, 0, 0, 60], 120]),
  ('regression variant: short notice window 2',
   [[['cancel', 1440, 15, 'employer'], ['cancel', 1440, 480, 'employer']]], [[60, 60], 120]),
  ('partial repair guard 3',
   [[['cancel', 1441, 16, 'employer'], ['cut', 1441, 121, 'worker'], ['cancel', 20159, 30, 'worker'],
     ['cut', 1439, 480, 'employer']]],
   [[60, 0, 0, 240], 300]),
  ('boundary control 4', [[['add', 1000, 14, 'employer']]], [[0], 0]),
  ('boundary control 5', [[['add', 20160, 60, 'employer']]], [[0], 0]),
  ('normal control 6',
   [[['add', 60, 121, 'mutual'], ['cancel', 1439, 15, 'employer'], ['cut', 20160, 14, 'employer'],
     ['cut', 5000, 15, 'worker']]],
   [[0, 60, 0, 0], 60]),
  ('normal control 7',
   [[['add', 1440, 15, 'worker'], ['add', 1441, 15, 'mutual'], ['cancel', 18720, 480, 'mutual'],
     ['add', 18720, 480, 'mutual'], ['add', 20160, 90, 'employer']]],
   [[0, 0, 0, 0, 0], 0]),
  ('normal control 8',
   [[['cancel', 20160, 15, 'employer'], ['add', 30000, 121, 'worker'], ['add', 1440, 60, 'mutual'],
     ['cancel', 1441, 121, 'worker']]],
   [[0, 0, 0, 0], 0])],
 [('regression: short notice window 1',
   [[['cut', 5000, 14, 'mutual'], ['add', 5000, 30, 'mutual'], ['cancel', 1440, 480, 'employer'],
     ['cut', 30000, 90, 'worker'], ['cut', 18720, 15, 'worker']]],
   [[0, 0, 60, 0, 0], 60]),
  ('regression variant: short notice window 2',
   [[['add', 1439, 90, 'mutual'], ['cut', 18720, 16, 'employer'], ['cancel', 1441, 240, 'mutual'],
     ['cancel', 20161, 15, 'mutual'], ['cancel', 1440, 480, 'employer']]],
   [[0, 60, 0, 0, 60], 120]),
  ('partial repair guard 3',
   [[['cut', 60, 480, 'employer'], ['cancel', 20160, 15, 'worker'], ['add', 1439, 90, 'employer'],
     ['add', 20161, 16, 'employer']]],
   [[240, 0, 60, 0], 300]),
  ('boundary control 4', [[['cancel', 100, 60, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['cut', 1440, 240, 'employer']]], [[60], 60]),
  ('normal control 6',
   [[['add', 1441, 15, 'employer'], ['cancel', 5000, 16, 'employer'], ['cut', 20160, 60, 'mutual'],
     ['cancel', 1440, 60, 'employer'], ['cancel', 18720, 30, 'employer']]],
   [[60, 60, 0, 60, 60], 240]),
  ('normal control 7',
   [[['cut', 1441, 16, 'worker'], ['cut', 1440, 90, 'employer'], ['cut', 20159, 240, 'employer'],
     ['cancel', 1440, 121, 'worker']]],
   [[0, 60, 60, 0], 120]),
  ('normal control 8', [[['cancel', 20161, 30, 'employer']]], [[0], 0])],
 [('regression: short notice window 1',
   [[['cancel', 1440, 15, 'employer'], ['cancel', 1440, 480, 'employer']]], [[60, 60], 120]),
  ('regression variant: short notice window 2',
   [[['cut', 5000, 14, 'mutual'], ['add', 5000, 30, 'mutual'], ['cancel', 1440, 480, 'employer'],
     ['cut', 30000, 90, 'worker'], ['cut', 18720, 15, 'worker']]],
   [[0, 0, 60, 0, 0], 60]),
  ('partial repair guard 3',
   [[['cancel', 5000, 60, 'employer'], ['cut', 60, 240, 'employer'], ['add', 20159, 240, 'mutual'],
     ['cancel', 5000, 30, 'worker'], ['cut', 1440, 10, 'mutual']]],
   [[60, 120, 0, 0, 0], 180]),
  ('boundary control 4', [[['add', 20159, 15, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('normal control 6',
   [[['add', 60, 16, 'mutual'], ['add', 1441, 10, 'employer'], ['cut', 1440, 16, 'worker'],
     ['cancel', 20159, 30, 'mutual']]],
   [[0, 0, 0, 0], 0]),
  ('normal control 7',
   [[['cancel', 1441, 240, 'employer'], ['cut', 5000, 14, 'employer'], ['cut', 18720, 30, 'employer']]],
   [[60, 60, 60], 180]),
  ('normal control 8',
   [[['add', 30000, 90, 'mutual'], ['add', 20160, 121, 'worker'], ['cut', 5000, 30, 'employer'],
     ['cut', 1441, 15, 'worker']]],
   [[0, 0, 60, 0], 60])]]
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: short notice window 1[[60], 60][[60], 60]Passed
partial repair guard 2[[60, 60], 120][[120, 60], 180]Failed
boundary control 3[[60], 60][[60], 60]Passed
normal control 4[[0, 60, 0, 60], 120][[0, 60, 0, 120], 180]Failed
normal control 5[[60, 0, 0], 60][[60, 0, 0], 60]Passed
normal control 6[[60, 60, 0], 120][[60, 60, 0], 120]Passed
normal control 7[[0, 60, 60], 120][[0, 60, 60], 120]Passed
normal control 8[[0, 0], 0][[0, 0], 0]Passed

SHA-256 / bd8994dc1682b2abd9a344b82a9de80f8bc3c8922766b5b2dc410bb5ff077c95

3 / The verified repair

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

N = 1
observations = []
def solve(changes):
    out = []
    for kind, notice, delta, by in changes:
        p = 0
        if by not in ('worker', 'mutual') and notice < 20160:
            if kind == 'add':
                p = 60 if delta >= 15 else 0
            elif notice < 1440:
                p = max(60, delta // 2)
            else:
                p = 60
        out.append(p)
    return [out, sum(out)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: short notice window 1', [[['cut', 1440, 240, 'employer']]], [[60], 60]),
  ('partial repair guard 2', [[['cut', 1439, 240, 'employer'], ['add', 18720, 480, 'employer']]],
   [[120, 60], 180]),
  ('boundary control 3', [[['add', 20159, 15, 'employer']]], [[60], 60]),
  ('normal control 4',
   [[['cut', 20160, 240, 'employer'], ['cancel', 1441, 15, 'employer'], ['add', 60, 30, 'worker'],
     ['cut', 1439, 240, 'employer']]],
   [[0, 60, 0, 120], 180]),
  ('normal control 5',
   [[['cut', 1439, 60, 'employer'], ['add', 30000, 480, 'employer'], ['cut', 20160, 121, 'employer']]],
   [[60, 0, 0], 60]),
  ('normal control 6',
   [[['cancel', 1439, 15, 'employer'], ['cut', 60, 30, 'employer'], ['cancel', 1441, 90, 'mutual']]],
   [[60, 60, 0], 120]),
  ('normal control 7',
   [[['cancel', 1441, 15, 'worker'], ['cancel', 18720, 90, 'employer'], ['add', 60, 121, 'employer']]],
   [[0, 60, 60], 120]),
  ('normal control 8', [[['cut', 20161, 240, 'worker'], ['cut', 20161, 14, 'employer']]], [[0, 0], 0])],
 [('regression: short notice window 1',
   [[['add', 1439, 90, 'mutual'], ['cut', 18720, 16, 'employer'], ['cancel', 1441, 240, 'mutual'],
     ['cancel', 20161, 15, 'mutual'], ['cancel', 1440, 480, 'employer']]],
   [[0, 60, 0, 0, 60], 120]),
  ('regression variant: short notice window 2',
   [[['add', 18720, 90, 'employer'], ['cancel', 60, 15, 'worker'], ['add', 20161, 480, 'mutual'],
     ['cut', 30000, 90, 'mutual'], ['cancel', 1440, 240, 'employer']]],
   [[60, 0, 0, 0, 60], 120]),
  ('partial repair guard 3',
   [[['add', 1440, 16, 'worker'], ['cut', 1441, 15, 'employer'], ['cut', 5000, 14, 'worker'],
     ['cut', 1439, 240, 'employer']]],
   [[0, 60, 0, 120], 180]),
  ('boundary control 4', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('boundary control 5', [[['cancel', 1439, 240, 'employer']]], [[120], 120]),
  ('normal control 6',
   [[['cancel', 1441, 15, 'employer'], ['add', 20161, 10, 'worker'], ['cut', 1440, 90, 'employer']]],
   [[60, 0, 60], 120]),
  ('normal control 7',
   [[['cut', 1439, 60, 'worker'], ['cut', 1441, 480, 'employer'], ['cancel', 1440, 14, 'worker']]],
   [[0, 60, 0], 60]),
  ('normal control 8',
   [[['add', 30000, 15, 'employer'], ['cancel', 20161, 121, 'worker'], ['cancel', 60, 10, 'mutual'],
     ['add', 5000, 30, 'employer']]],
   [[0, 0, 0, 60], 60])],
 [('regression: short notice window 1',
   [[['add', 18720, 90, 'employer'], ['cancel', 60, 15, 'worker'], ['add', 20161, 480, 'mutual'],
     ['cut', 30000, 90, 'mutual'], ['cancel', 1440, 240, 'employer']]],
   [[60, 0, 0, 0, 60], 120]),
  ('regression variant: short notice window 2',
   [[['cancel', 1440, 15, 'employer'], ['cancel', 1440, 480, 'employer']]], [[60, 60], 120]),
  ('partial repair guard 3',
   [[['cancel', 1441, 16, 'employer'], ['cut', 1441, 121, 'worker'], ['cancel', 20159, 30, 'worker'],
     ['cut', 1439, 480, 'employer']]],
   [[60, 0, 0, 240], 300]),
  ('boundary control 4', [[['add', 1000, 14, 'employer']]], [[0], 0]),
  ('boundary control 5', [[['add', 20160, 60, 'employer']]], [[0], 0]),
  ('normal control 6',
   [[['add', 60, 121, 'mutual'], ['cancel', 1439, 15, 'employer'], ['cut', 20160, 14, 'employer'],
     ['cut', 5000, 15, 'worker']]],
   [[0, 60, 0, 0], 60]),
  ('normal control 7',
   [[['add', 1440, 15, 'worker'], ['add', 1441, 15, 'mutual'], ['cancel', 18720, 480, 'mutual'],
     ['add', 18720, 480, 'mutual'], ['add', 20160, 90, 'employer']]],
   [[0, 0, 0, 0, 0], 0]),
  ('normal control 8',
   [[['cancel', 20160, 15, 'employer'], ['add', 30000, 121, 'worker'], ['add', 1440, 60, 'mutual'],
     ['cancel', 1441, 121, 'worker']]],
   [[0, 0, 0, 0], 0])],
 [('regression: short notice window 1',
   [[['cut', 5000, 14, 'mutual'], ['add', 5000, 30, 'mutual'], ['cancel', 1440, 480, 'employer'],
     ['cut', 30000, 90, 'worker'], ['cut', 18720, 15, 'worker']]],
   [[0, 0, 60, 0, 0], 60]),
  ('regression variant: short notice window 2',
   [[['add', 1439, 90, 'mutual'], ['cut', 18720, 16, 'employer'], ['cancel', 1441, 240, 'mutual'],
     ['cancel', 20161, 15, 'mutual'], ['cancel', 1440, 480, 'employer']]],
   [[0, 60, 0, 0, 60], 120]),
  ('partial repair guard 3',
   [[['cut', 60, 480, 'employer'], ['cancel', 20160, 15, 'worker'], ['add', 1439, 90, 'employer'],
     ['add', 20161, 16, 'employer']]],
   [[240, 0, 60, 0], 300]),
  ('boundary control 4', [[['cancel', 100, 60, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['cut', 1440, 240, 'employer']]], [[60], 60]),
  ('normal control 6',
   [[['add', 1441, 15, 'employer'], ['cancel', 5000, 16, 'employer'], ['cut', 20160, 60, 'mutual'],
     ['cancel', 1440, 60, 'employer'], ['cancel', 18720, 30, 'employer']]],
   [[60, 60, 0, 60, 60], 240]),
  ('normal control 7',
   [[['cut', 1441, 16, 'worker'], ['cut', 1440, 90, 'employer'], ['cut', 20159, 240, 'employer'],
     ['cancel', 1440, 121, 'worker']]],
   [[0, 60, 60, 0], 120]),
  ('normal control 8', [[['cancel', 20161, 30, 'employer']]], [[0], 0])],
 [('regression: short notice window 1',
   [[['cancel', 1440, 15, 'employer'], ['cancel', 1440, 480, 'employer']]], [[60, 60], 120]),
  ('regression variant: short notice window 2',
   [[['cut', 5000, 14, 'mutual'], ['add', 5000, 30, 'mutual'], ['cancel', 1440, 480, 'employer'],
     ['cut', 30000, 90, 'worker'], ['cut', 18720, 15, 'worker']]],
   [[0, 0, 60, 0, 0], 60]),
  ('partial repair guard 3',
   [[['cancel', 5000, 60, 'employer'], ['cut', 60, 240, 'employer'], ['add', 20159, 240, 'mutual'],
     ['cancel', 5000, 30, 'worker'], ['cut', 1440, 10, 'mutual']]],
   [[60, 120, 0, 0, 0], 180]),
  ('boundary control 4', [[['add', 20159, 15, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('normal control 6',
   [[['add', 60, 16, 'mutual'], ['add', 1441, 10, 'employer'], ['cut', 1440, 16, 'worker'],
     ['cancel', 20159, 30, 'mutual']]],
   [[0, 0, 0, 0], 0]),
  ('normal control 7',
   [[['cancel', 1441, 240, 'employer'], ['cut', 5000, 14, 'employer'], ['cut', 18720, 30, 'employer']]],
   [[60, 60, 60], 180]),
  ('normal control 8',
   [[['add', 30000, 90, 'mutual'], ['add', 20160, 121, 'worker'], ['cut', 5000, 30, 'employer'],
     ['cut', 1441, 15, 'worker']]],
   [[0, 0, 60, 0], 60])]]
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: short notice window 1[[60], 60][[60], 60]Passed
partial repair guard 2[[120, 60], 180][[120, 60], 180]Passed
boundary control 3[[60], 60][[60], 60]Passed
normal control 4[[0, 60, 0, 120], 180][[0, 60, 0, 120], 180]Passed
normal control 5[[60, 0, 0], 60][[60, 0, 0], 60]Passed
normal control 6[[60, 60, 0], 120][[60, 60, 0], 120]Passed
normal control 7[[0, 60, 60], 120][[0, 60, 60], 120]Passed
normal control 8[[0, 0], 0][[0, 0], 0]Passed

SHA-256 / 43e0c3a7bd291ecb716d5034e11c1ffba1d29f42baf22291fb08834dd6cb9995

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

Case digest / 986669a0fc68fd28c4714c7280e2cc2251022113d8cb0a050f1a3a0e3bf74590