FAILURE MAP
← Case archive

FA-94176 / Shift rostering labor rules / Open access

Mutually agreed swaps charged predictability pay · case 01

Employer pays premiums for swaps the workers arranged themselves.

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

ROOT CAUSE

Only worker-initiated changes are exempted.

VERIFIED REPAIR

Exempt both worker-initiated and mutual changes.

Unsuccessful approach: Exempting only mutual changes charges premiums for worker requests.

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 != 'worker' 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: mutual swap exemption 1', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('regression variant: mutual swap exemption 2',
   [[['add', 30000, 15, 'employer'], ['cancel', 20161, 121, 'worker'], ['cancel', 60, 10, 'mutual'],
     ['add', 5000, 30, 'employer']]],
   [[0, 0, 0, 60], 60]),
  ('partial repair guard 3',
   [[['cancel', 1441, 15, 'worker'], ['cancel', 18720, 90, 'employer'], ['add', 60, 121, 'employer']]],
   [[0, 60, 60], 120]),
  ('boundary control 4', [[['cut', 1440, 240, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['add', 20159, 15, 'employer']]], [[60], 60]),
  ('normal control 6', [[['cut', 18720, 30, 'employer']]], [[60], 60]),
  ('normal control 7', [[['cut', 1440, 10, 'mutual']]], [[0], 0]),
  ('normal control 8', [[['cancel', 1439, 90, 'worker'], ['add', 1439, 30, 'worker']]], [[0, 0], 0])],
 [('regression: mutual swap exemption 1', [[['cancel', 5000, 121, 'mutual']]], [[0], 0]),
  ('regression variant: mutual swap exemption 2',
   [[['cancel', 60, 16, 'mutual'], ['cancel', 60, 60, 'employer'], ['cut', 20159, 10, 'mutual']]],
   [[0, 60, 0], 60]),
  ('partial repair guard 3',
   [[['cut', 30000, 480, 'employer'], ['cancel', 60, 60, 'worker'], ['cut', 20161, 16, 'employer'],
     ['add', 5000, 14, 'worker'], ['cut', 60, 16, 'employer']]],
   [[0, 0, 0, 0, 60], 60]),
  ('boundary control 4', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('boundary control 5', [[['cancel', 1439, 240, 'employer']]], [[120], 120]),
  ('normal control 6',
   [[['add', 20160, 10, 'employer'], ['cut', 5000, 90, 'mutual'], ['add', 1440, 10, 'mutual'],
     ['cut', 5000, 16, 'worker']]],
   [[0, 0, 0, 0], 0]),
  ('normal control 7',
   [[['add', 30000, 16, 'worker'], ['add', 20159, 14, 'employer'], ['cancel', 30000, 15, 'worker']]],
   [[0, 0, 0], 0]),
  ('normal control 8', [[['cut', 1439, 240, 'mutual'], ['add', 30000, 480, 'employer']]], [[0, 0], 0])],
 [('regression: mutual swap exemption 1',
   [[['cut', 20161, 121, 'employer'], ['cut', 5000, 16, 'mutual'], ['cancel', 18720, 240, 'worker']]],
   [[0, 0, 0], 0]),
  ('regression variant: mutual swap exemption 2',
   [[['cancel', 60, 14, 'employer'], ['cut', 1440, 14, 'mutual'], ['cancel', 1439, 16, 'employer']]],
   [[60, 0, 60], 120]),
  ('partial repair guard 3',
   [[['cancel', 20161, 16, 'employer'], ['cancel', 5000, 16, 'worker'], ['add', 1439, 240, 'worker'],
     ['add', 1440, 10, 'mutual'], ['cancel', 20161, 90, 'mutual']]],
   [[0, 0, 0, 0, 0], 0]),
  ('boundary control 4', [[['add', 1000, 14, 'employer']]], [[0], 0]),
  ('boundary control 5', [[['add', 20160, 60, 'employer']]], [[0], 0]),
  ('normal control 6',
   [[['cut', 60, 16, 'worker'], ['add', 20159, 16, 'worker'], ['cut', 20159, 60, 'worker'],
     ['cut', 5000, 16, 'worker']]],
   [[0, 0, 0, 0], 0]),
  ('normal control 7', [[['cancel', 30000, 30, 'worker']]], [[0], 0]),
  ('normal control 8',
   [[['cut', 30000, 480, 'employer'], ['cancel', 5000, 121, 'employer'], ['cancel', 1440, 10, 'mutual']]],
   [[0, 60, 0], 60])],
 [('regression: mutual swap exemption 1', [[['add', 5000, 240, 'mutual'], ['add', 18720, 10, 'employer']]],
   [[0, 0], 0]),
  ('regression variant: mutual swap exemption 2',
   [[['cancel', 18720, 14, 'worker'], ['add', 1440, 240, 'mutual'], ['cut', 1441, 30, 'worker'],
     ['cancel', 1440, 30, 'employer'], ['cut', 20161, 30, 'worker']]],
   [[0, 0, 0, 60, 0], 60]),
  ('partial repair guard 3',
   [[['add', 1441, 121, 'employer'], ['cut', 5000, 60, 'worker'], ['cancel', 1441, 480, 'worker'],
     ['cut', 1440, 90, 'mutual']]],
   [[60, 0, 0, 0], 60]),
  ('boundary control 4', [[['cancel', 100, 60, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['cut', 1440, 240, 'employer']]], [[60], 60]),
  ('normal control 6',
   [[['cancel', 60, 16, 'mutual'], ['cancel', 60, 60, 'employer'], ['cut', 20159, 10, 'mutual']]],
   [[0, 60, 0], 60]),
  ('normal control 7',
   [[['cut', 20159, 16, 'employer'], ['cut', 1439, 14, 'worker'], ['add', 60, 30, 'mutual']]],
   [[60, 0, 0], 60]),
  ('normal control 8', [[['add', 20159, 121, 'employer'], ['cancel', 1441, 15, 'employer']]],
   [[60, 60], 120])],
 [('regression: mutual swap exemption 1',
   [[['cut', 30000, 480, 'employer'], ['cancel', 5000, 121, 'employer'], ['cancel', 1440, 10, 'mutual']]],
   [[0, 60, 0], 60]),
  ('regression variant: mutual swap exemption 2',
   [[['cut', 20160, 240, 'mutual'], ['cancel', 1441, 240, 'employer'], ['cancel', 1441, 10, 'worker'],
     ['cut', 5000, 30, 'mutual'], ['cut', 5000, 240, 'employer']]],
   [[0, 60, 0, 0, 60], 120]),
  ('partial repair guard 3',
   [[['add', 20161, 240, 'mutual'], ['add', 20160, 480, 'employer'], ['cancel', 1440, 30, 'employer'],
     ['add', 60, 15, 'worker']]],
   [[0, 0, 60, 0], 60]),
  ('boundary control 4', [[['add', 20159, 15, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('normal control 6',
   [[['add', 1440, 15, 'mutual'], ['cancel', 20159, 30, 'employer'], ['cancel', 20159, 14, 'mutual']]],
   [[0, 60, 0], 60]),
  ('normal control 7',
   [[['cancel', 1440, 121, 'employer'], ['add', 1440, 60, 'worker'], ['cut', 1439, 121, 'worker'],
     ['add', 20159, 480, 'employer'], ['cancel', 1441, 16, 'mutual']]],
   [[60, 0, 0, 60, 0], 120]),
  ('normal control 8',
   [[['cut', 20159, 10, 'worker'], ['cut', 1439, 121, 'worker'], ['add', 1440, 121, 'mutual'],
     ['cancel', 20160, 16, 'employer']]],
   [[0, 0, 0, 0], 0])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: mutual swap exemption 1[[150], 150][[0], 0]Failed
regression variant: mutual swap exemption 2[[0, 0, 60, 60], 120][[0, 0, 0, 60], 60]Failed
partial repair guard 3[[0, 60, 60], 120][[0, 60, 60], 120]Passed
boundary control 4[[60], 60][[60], 60]Passed
boundary control 5[[60], 60][[60], 60]Passed
normal control 6[[60], 60][[60], 60]Passed
normal control 7[[60], 60][[0], 0]Failed
normal control 8[[0, 0], 0][[0, 0], 0]Passed

SHA-256 / cc83006c854709b87686d70dc64e8b8d74798bb73c1a8629e110a9daecc7c0d4

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 != '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: mutual swap exemption 1', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('regression variant: mutual swap exemption 2',
   [[['add', 30000, 15, 'employer'], ['cancel', 20161, 121, 'worker'], ['cancel', 60, 10, 'mutual'],
     ['add', 5000, 30, 'employer']]],
   [[0, 0, 0, 60], 60]),
  ('partial repair guard 3',
   [[['cancel', 1441, 15, 'worker'], ['cancel', 18720, 90, 'employer'], ['add', 60, 121, 'employer']]],
   [[0, 60, 60], 120]),
  ('boundary control 4', [[['cut', 1440, 240, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['add', 20159, 15, 'employer']]], [[60], 60]),
  ('normal control 6', [[['cut', 18720, 30, 'employer']]], [[60], 60]),
  ('normal control 7', [[['cut', 1440, 10, 'mutual']]], [[0], 0]),
  ('normal control 8', [[['cancel', 1439, 90, 'worker'], ['add', 1439, 30, 'worker']]], [[0, 0], 0])],
 [('regression: mutual swap exemption 1', [[['cancel', 5000, 121, 'mutual']]], [[0], 0]),
  ('regression variant: mutual swap exemption 2',
   [[['cancel', 60, 16, 'mutual'], ['cancel', 60, 60, 'employer'], ['cut', 20159, 10, 'mutual']]],
   [[0, 60, 0], 60]),
  ('partial repair guard 3',
   [[['cut', 30000, 480, 'employer'], ['cancel', 60, 60, 'worker'], ['cut', 20161, 16, 'employer'],
     ['add', 5000, 14, 'worker'], ['cut', 60, 16, 'employer']]],
   [[0, 0, 0, 0, 60], 60]),
  ('boundary control 4', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('boundary control 5', [[['cancel', 1439, 240, 'employer']]], [[120], 120]),
  ('normal control 6',
   [[['add', 20160, 10, 'employer'], ['cut', 5000, 90, 'mutual'], ['add', 1440, 10, 'mutual'],
     ['cut', 5000, 16, 'worker']]],
   [[0, 0, 0, 0], 0]),
  ('normal control 7',
   [[['add', 30000, 16, 'worker'], ['add', 20159, 14, 'employer'], ['cancel', 30000, 15, 'worker']]],
   [[0, 0, 0], 0]),
  ('normal control 8', [[['cut', 1439, 240, 'mutual'], ['add', 30000, 480, 'employer']]], [[0, 0], 0])],
 [('regression: mutual swap exemption 1',
   [[['cut', 20161, 121, 'employer'], ['cut', 5000, 16, 'mutual'], ['cancel', 18720, 240, 'worker']]],
   [[0, 0, 0], 0]),
  ('regression variant: mutual swap exemption 2',
   [[['cancel', 60, 14, 'employer'], ['cut', 1440, 14, 'mutual'], ['cancel', 1439, 16, 'employer']]],
   [[60, 0, 60], 120]),
  ('partial repair guard 3',
   [[['cancel', 20161, 16, 'employer'], ['cancel', 5000, 16, 'worker'], ['add', 1439, 240, 'worker'],
     ['add', 1440, 10, 'mutual'], ['cancel', 20161, 90, 'mutual']]],
   [[0, 0, 0, 0, 0], 0]),
  ('boundary control 4', [[['add', 1000, 14, 'employer']]], [[0], 0]),
  ('boundary control 5', [[['add', 20160, 60, 'employer']]], [[0], 0]),
  ('normal control 6',
   [[['cut', 60, 16, 'worker'], ['add', 20159, 16, 'worker'], ['cut', 20159, 60, 'worker'],
     ['cut', 5000, 16, 'worker']]],
   [[0, 0, 0, 0], 0]),
  ('normal control 7', [[['cancel', 30000, 30, 'worker']]], [[0], 0]),
  ('normal control 8',
   [[['cut', 30000, 480, 'employer'], ['cancel', 5000, 121, 'employer'], ['cancel', 1440, 10, 'mutual']]],
   [[0, 60, 0], 60])],
 [('regression: mutual swap exemption 1', [[['add', 5000, 240, 'mutual'], ['add', 18720, 10, 'employer']]],
   [[0, 0], 0]),
  ('regression variant: mutual swap exemption 2',
   [[['cancel', 18720, 14, 'worker'], ['add', 1440, 240, 'mutual'], ['cut', 1441, 30, 'worker'],
     ['cancel', 1440, 30, 'employer'], ['cut', 20161, 30, 'worker']]],
   [[0, 0, 0, 60, 0], 60]),
  ('partial repair guard 3',
   [[['add', 1441, 121, 'employer'], ['cut', 5000, 60, 'worker'], ['cancel', 1441, 480, 'worker'],
     ['cut', 1440, 90, 'mutual']]],
   [[60, 0, 0, 0], 60]),
  ('boundary control 4', [[['cancel', 100, 60, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['cut', 1440, 240, 'employer']]], [[60], 60]),
  ('normal control 6',
   [[['cancel', 60, 16, 'mutual'], ['cancel', 60, 60, 'employer'], ['cut', 20159, 10, 'mutual']]],
   [[0, 60, 0], 60]),
  ('normal control 7',
   [[['cut', 20159, 16, 'employer'], ['cut', 1439, 14, 'worker'], ['add', 60, 30, 'mutual']]],
   [[60, 0, 0], 60]),
  ('normal control 8', [[['add', 20159, 121, 'employer'], ['cancel', 1441, 15, 'employer']]],
   [[60, 60], 120])],
 [('regression: mutual swap exemption 1',
   [[['cut', 30000, 480, 'employer'], ['cancel', 5000, 121, 'employer'], ['cancel', 1440, 10, 'mutual']]],
   [[0, 60, 0], 60]),
  ('regression variant: mutual swap exemption 2',
   [[['cut', 20160, 240, 'mutual'], ['cancel', 1441, 240, 'employer'], ['cancel', 1441, 10, 'worker'],
     ['cut', 5000, 30, 'mutual'], ['cut', 5000, 240, 'employer']]],
   [[0, 60, 0, 0, 60], 120]),
  ('partial repair guard 3',
   [[['add', 20161, 240, 'mutual'], ['add', 20160, 480, 'employer'], ['cancel', 1440, 30, 'employer'],
     ['add', 60, 15, 'worker']]],
   [[0, 0, 60, 0], 60]),
  ('boundary control 4', [[['add', 20159, 15, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('normal control 6',
   [[['add', 1440, 15, 'mutual'], ['cancel', 20159, 30, 'employer'], ['cancel', 20159, 14, 'mutual']]],
   [[0, 60, 0], 60]),
  ('normal control 7',
   [[['cancel', 1440, 121, 'employer'], ['add', 1440, 60, 'worker'], ['cut', 1439, 121, 'worker'],
     ['add', 20159, 480, 'employer'], ['cancel', 1441, 16, 'mutual']]],
   [[60, 0, 0, 60, 0], 120]),
  ('normal control 8',
   [[['cut', 20159, 10, 'worker'], ['cut', 1439, 121, 'worker'], ['add', 1440, 121, 'mutual'],
     ['cancel', 20160, 16, 'employer']]],
   [[0, 0, 0, 0], 0])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: mutual swap exemption 1[[0], 0][[0], 0]Passed
regression variant: mutual swap exemption 2[[0, 0, 0, 60], 60][[0, 0, 0, 60], 60]Passed
partial repair guard 3[[60, 60, 60], 180][[0, 60, 60], 120]Failed
boundary control 4[[60], 60][[60], 60]Passed
boundary control 5[[60], 60][[60], 60]Passed
normal control 6[[60], 60][[60], 60]Passed
normal control 7[[0], 0][[0], 0]Passed
normal control 8[[60, 60], 120][[0, 0], 0]Failed

SHA-256 / 88dd09352710697bdfddc7c468b5e4c0c4b9b2d5646cf57a7ba989dc0402be57

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: mutual swap exemption 1', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('regression variant: mutual swap exemption 2',
   [[['add', 30000, 15, 'employer'], ['cancel', 20161, 121, 'worker'], ['cancel', 60, 10, 'mutual'],
     ['add', 5000, 30, 'employer']]],
   [[0, 0, 0, 60], 60]),
  ('partial repair guard 3',
   [[['cancel', 1441, 15, 'worker'], ['cancel', 18720, 90, 'employer'], ['add', 60, 121, 'employer']]],
   [[0, 60, 60], 120]),
  ('boundary control 4', [[['cut', 1440, 240, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['add', 20159, 15, 'employer']]], [[60], 60]),
  ('normal control 6', [[['cut', 18720, 30, 'employer']]], [[60], 60]),
  ('normal control 7', [[['cut', 1440, 10, 'mutual']]], [[0], 0]),
  ('normal control 8', [[['cancel', 1439, 90, 'worker'], ['add', 1439, 30, 'worker']]], [[0, 0], 0])],
 [('regression: mutual swap exemption 1', [[['cancel', 5000, 121, 'mutual']]], [[0], 0]),
  ('regression variant: mutual swap exemption 2',
   [[['cancel', 60, 16, 'mutual'], ['cancel', 60, 60, 'employer'], ['cut', 20159, 10, 'mutual']]],
   [[0, 60, 0], 60]),
  ('partial repair guard 3',
   [[['cut', 30000, 480, 'employer'], ['cancel', 60, 60, 'worker'], ['cut', 20161, 16, 'employer'],
     ['add', 5000, 14, 'worker'], ['cut', 60, 16, 'employer']]],
   [[0, 0, 0, 0, 60], 60]),
  ('boundary control 4', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('boundary control 5', [[['cancel', 1439, 240, 'employer']]], [[120], 120]),
  ('normal control 6',
   [[['add', 20160, 10, 'employer'], ['cut', 5000, 90, 'mutual'], ['add', 1440, 10, 'mutual'],
     ['cut', 5000, 16, 'worker']]],
   [[0, 0, 0, 0], 0]),
  ('normal control 7',
   [[['add', 30000, 16, 'worker'], ['add', 20159, 14, 'employer'], ['cancel', 30000, 15, 'worker']]],
   [[0, 0, 0], 0]),
  ('normal control 8', [[['cut', 1439, 240, 'mutual'], ['add', 30000, 480, 'employer']]], [[0, 0], 0])],
 [('regression: mutual swap exemption 1',
   [[['cut', 20161, 121, 'employer'], ['cut', 5000, 16, 'mutual'], ['cancel', 18720, 240, 'worker']]],
   [[0, 0, 0], 0]),
  ('regression variant: mutual swap exemption 2',
   [[['cancel', 60, 14, 'employer'], ['cut', 1440, 14, 'mutual'], ['cancel', 1439, 16, 'employer']]],
   [[60, 0, 60], 120]),
  ('partial repair guard 3',
   [[['cancel', 20161, 16, 'employer'], ['cancel', 5000, 16, 'worker'], ['add', 1439, 240, 'worker'],
     ['add', 1440, 10, 'mutual'], ['cancel', 20161, 90, 'mutual']]],
   [[0, 0, 0, 0, 0], 0]),
  ('boundary control 4', [[['add', 1000, 14, 'employer']]], [[0], 0]),
  ('boundary control 5', [[['add', 20160, 60, 'employer']]], [[0], 0]),
  ('normal control 6',
   [[['cut', 60, 16, 'worker'], ['add', 20159, 16, 'worker'], ['cut', 20159, 60, 'worker'],
     ['cut', 5000, 16, 'worker']]],
   [[0, 0, 0, 0], 0]),
  ('normal control 7', [[['cancel', 30000, 30, 'worker']]], [[0], 0]),
  ('normal control 8',
   [[['cut', 30000, 480, 'employer'], ['cancel', 5000, 121, 'employer'], ['cancel', 1440, 10, 'mutual']]],
   [[0, 60, 0], 60])],
 [('regression: mutual swap exemption 1', [[['add', 5000, 240, 'mutual'], ['add', 18720, 10, 'employer']]],
   [[0, 0], 0]),
  ('regression variant: mutual swap exemption 2',
   [[['cancel', 18720, 14, 'worker'], ['add', 1440, 240, 'mutual'], ['cut', 1441, 30, 'worker'],
     ['cancel', 1440, 30, 'employer'], ['cut', 20161, 30, 'worker']]],
   [[0, 0, 0, 60, 0], 60]),
  ('partial repair guard 3',
   [[['add', 1441, 121, 'employer'], ['cut', 5000, 60, 'worker'], ['cancel', 1441, 480, 'worker'],
     ['cut', 1440, 90, 'mutual']]],
   [[60, 0, 0, 0], 60]),
  ('boundary control 4', [[['cancel', 100, 60, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['cut', 1440, 240, 'employer']]], [[60], 60]),
  ('normal control 6',
   [[['cancel', 60, 16, 'mutual'], ['cancel', 60, 60, 'employer'], ['cut', 20159, 10, 'mutual']]],
   [[0, 60, 0], 60]),
  ('normal control 7',
   [[['cut', 20159, 16, 'employer'], ['cut', 1439, 14, 'worker'], ['add', 60, 30, 'mutual']]],
   [[60, 0, 0], 60]),
  ('normal control 8', [[['add', 20159, 121, 'employer'], ['cancel', 1441, 15, 'employer']]],
   [[60, 60], 120])],
 [('regression: mutual swap exemption 1',
   [[['cut', 30000, 480, 'employer'], ['cancel', 5000, 121, 'employer'], ['cancel', 1440, 10, 'mutual']]],
   [[0, 60, 0], 60]),
  ('regression variant: mutual swap exemption 2',
   [[['cut', 20160, 240, 'mutual'], ['cancel', 1441, 240, 'employer'], ['cancel', 1441, 10, 'worker'],
     ['cut', 5000, 30, 'mutual'], ['cut', 5000, 240, 'employer']]],
   [[0, 60, 0, 0, 60], 120]),
  ('partial repair guard 3',
   [[['add', 20161, 240, 'mutual'], ['add', 20160, 480, 'employer'], ['cancel', 1440, 30, 'employer'],
     ['add', 60, 15, 'worker']]],
   [[0, 0, 60, 0], 60]),
  ('boundary control 4', [[['add', 20159, 15, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('normal control 6',
   [[['add', 1440, 15, 'mutual'], ['cancel', 20159, 30, 'employer'], ['cancel', 20159, 14, 'mutual']]],
   [[0, 60, 0], 60]),
  ('normal control 7',
   [[['cancel', 1440, 121, 'employer'], ['add', 1440, 60, 'worker'], ['cut', 1439, 121, 'worker'],
     ['add', 20159, 480, 'employer'], ['cancel', 1441, 16, 'mutual']]],
   [[60, 0, 0, 60, 0], 120]),
  ('normal control 8',
   [[['cut', 20159, 10, 'worker'], ['cut', 1439, 121, 'worker'], ['add', 1440, 121, 'mutual'],
     ['cancel', 20160, 16, 'employer']]],
   [[0, 0, 0, 0], 0])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: mutual swap exemption 1[[0], 0][[0], 0]Passed
regression variant: mutual swap exemption 2[[0, 0, 0, 60], 60][[0, 0, 0, 60], 60]Passed
partial repair guard 3[[0, 60, 60], 120][[0, 60, 60], 120]Passed
boundary control 4[[60], 60][[60], 60]Passed
boundary control 5[[60], 60][[60], 60]Passed
normal control 6[[60], 60][[60], 60]Passed
normal control 7[[0], 0][[0], 0]Passed
normal control 8[[0, 0], 0][[0, 0], 0]Passed

SHA-256 / 8c77a1e0ae4df483b97a7d51fde29c6827f22a7e5bb9a98206244e1b4451ff96

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

Case digest / 0717960ba2ce0ce1fe4af255479234637636316e8999e822e1d40a1b1c313d15