FAILURE MAP
← Case archive

FA-94186 / Shift rostering labor rules / Open access

Short-notice cut pays half the lost time without the floor · case 01

Small last-minute cuts earn less than the ordinary 60-minute premium.

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

ROOT CAUSE

The half-lost-time premium is not floored at 60 minutes.

THE FAILURE

The half-lost-time premium is not floored at 60 minutes.

Unsuccessful approach: Capping at 60 underpays large last-minute 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 = 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 cut floor 1', [[['cancel', 100, 60, 'employer']]], [[60], 60]),
  ('regression variant: short notice cut floor 2',
   [[['cancel', 60, 16, 'mutual'], ['cancel', 60, 60, 'employer'], ['cut', 20159, 10, 'mutual']]],
   [[0, 60, 0], 60]),
  ('partial repair guard 3',
   [[['add', 60, 121, 'mutual'], ['cancel', 1439, 15, 'employer'], ['cut', 20160, 14, 'employer'],
     ['cut', 5000, 15, 'worker']]],
   [[0, 60, 0, 0], 60]),
  ('boundary control 4', [[['cut', 1440, 240, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['add', 20159, 15, 'employer']]], [[60], 60]),
  ('normal control 6',
   [[['cancel', 60, 90, 'worker'], ['add', 5000, 480, 'employer'], ['cancel', 18720, 30, 'worker'],
     ['add', 5000, 10, 'mutual']]],
   [[0, 60, 0, 0], 60]),
  ('normal control 7',
   [[['cancel', 20161, 90, 'employer'], ['cancel', 20161, 16, 'mutual'], ['cancel', 18720, 240, 'employer'],
     ['cut', 20160, 15, 'employer']]],
   [[0, 0, 60, 0], 60]),
  ('normal control 8', [[['cancel', 18720, 10, 'worker']]], [[0], 0])],
 [('regression: short notice cut floor 1', [[['add', 60, 121, 'worker'], ['cut', 1439, 30, 'employer']]],
   [[0, 60], 60]),
  ('regression variant: short notice cut floor 2',
   [[['add', 5000, 240, 'mutual'], ['add', 30000, 240, 'employer'], ['cancel', 60, 15, 'employer']]],
   [[0, 0, 60], 60]),
  ('partial repair guard 3',
   [[['cancel', 60, 16, 'mutual'], ['cancel', 60, 60, 'employer'], ['cut', 20159, 10, 'mutual']]],
   [[0, 60, 0], 60]),
  ('boundary control 4', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('boundary control 5', [[['cancel', 1439, 240, 'employer']]], [[120], 120]),
  ('normal control 6',
   [[['cancel', 1441, 480, 'employer'], ['cancel', 20161, 240, 'employer'], ['cut', 18720, 240, 'worker'],
     ['cancel', 20160, 30, 'mutual'], ['cut', 18720, 240, 'worker']]],
   [[60, 0, 0, 0, 0], 60]),
  ('normal control 7', [[['add', 1441, 480, 'mutual']]], [[0], 0]),
  ('normal control 8',
   [[['cancel', 1441, 240, 'employer'], ['add', 18720, 240, 'employer'], ['cancel', 30000, 60, 'employer'],
     ['add', 18720, 15, 'employer'], ['cut', 1440, 15, 'employer']]],
   [[60, 60, 0, 60, 60], 240])],
 [('regression: short notice cut floor 1',
   [[['add', 20160, 121, 'worker'], ['cancel', 60, 14, 'employer'], ['cut', 1441, 16, 'employer'],
     ['add', 1439, 480, 'employer'], ['cancel', 18720, 240, 'employer']]],
   [[0, 60, 60, 60, 60], 240]),
  ('regression variant: short notice cut floor 2',
   [[['add', 5000, 480, 'mutual'], ['cut', 1439, 60, 'employer'], ['cut', 20161, 15, 'mutual'],
     ['add', 30000, 14, 'employer']]],
   [[0, 60, 0, 0], 60]),
  ('partial repair guard 3', [[['cancel', 1439, 480, 'employer']]], [[240], 240]),
  ('boundary control 4', [[['add', 1000, 14, 'employer']]], [[0], 0]),
  ('boundary control 5', [[['add', 20160, 60, 'employer']]], [[0], 0]),
  ('normal control 6',
   [[['add', 20161, 480, 'employer'], ['cancel', 18720, 240, 'employer'], ['add', 1440, 240, 'mutual'],
     ['cut', 20160, 60, 'employer'], ['add', 20160, 60, 'mutual']]],
   [[0, 60, 0, 0, 0], 60]),
  ('normal control 7',
   [[['add', 18720, 121, 'employer'], ['cut', 5000, 90, 'employer'], ['cancel', 1440, 90, 'employer']]],
   [[60, 60, 60], 180]),
  ('normal control 8',
   [[['cut', 20159, 10, 'mutual'], ['cut', 18720, 90, 'employer'], ['add', 5000, 121, 'employer'],
     ['cancel', 20161, 60, 'mutual'], ['cancel', 1441, 16, 'employer']]],
   [[0, 60, 60, 0, 60], 180])],
 [('regression: short notice cut floor 1',
   [[['add', 60, 16, 'mutual'], ['cut', 1441, 10, 'employer'], ['cut', 5000, 121, 'employer'],
     ['cut', 60, 60, 'employer']]],
   [[0, 60, 60, 60], 180]),
  ('regression variant: short notice cut floor 2',
   [[['add', 18720, 16, 'employer'], ['cancel', 1441, 16, 'worker'], ['cancel', 60, 30, 'employer'],
     ['cancel', 1440, 60, 'worker'], ['add', 1439, 90, 'mutual']]],
   [[60, 0, 60, 0, 0], 120]),
  ('partial repair guard 3',
   [[['cancel', 30000, 14, 'mutual'], ['cancel', 60, 30, 'employer'], ['add', 1441, 16, 'worker']]],
   [[0, 60, 0], 60]),
  ('boundary control 4', [[['cancel', 100, 60, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['cut', 1440, 240, 'employer']]], [[60], 60]),
  ('normal control 6', [[['add', 18720, 16, 'employer'], ['cancel', 20159, 30, 'employer']]],
   [[60, 60], 120]),
  ('normal control 7',
   [[['add', 60, 121, 'mutual'], ['cancel', 1439, 15, 'employer'], ['cut', 20160, 14, 'employer'],
     ['cut', 5000, 15, 'worker']]],
   [[0, 60, 0, 0], 60]),
  ('normal control 8', [[['cancel', 18720, 10, 'worker']]], [[0], 0])],
 [('regression: short notice cut floor 1',
   [[['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]),
  ('regression variant: short notice cut floor 2',
   [[['cancel', 1439, 30, 'employer'], ['cut', 30000, 10, 'employer'], ['add', 20159, 15, 'worker'],
     ['cut', 20160, 10, 'employer'], ['cut', 20161, 10, 'employer']]],
   [[60, 0, 0, 0, 0], 60]),
  ('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', [[['add', 20159, 15, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('normal control 6',
   [[['add', 20159, 240, 'employer'], ['cancel', 5000, 15, 'employer'], ['cut', 60, 60, 'employer'],
     ['cut', 20160, 14, 'employer']]],
   [[60, 60, 60, 0], 180]),
  ('normal control 7',
   [[['cancel', 1440, 121, 'employer'], ['cancel', 1440, 90, 'worker'], ['cut', 20161, 90, 'employer'],
     ['add', 18720, 30, 'mutual']]],
   [[60, 0, 0, 0], 60]),
  ('normal control 8', [[['cancel', 60, 30, 'employer'], ['cut', 20161, 240, 'mutual']]], [[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 cut floor 1[[30], 30][[60], 60]Failed
regression variant: short notice cut floor 2[[0, 30, 0], 30][[0, 60, 0], 60]Failed
partial repair guard 3[[0, 7, 0, 0], 7][[0, 60, 0, 0], 60]Failed
boundary control 4[[60], 60][[60], 60]Passed
boundary control 5[[60], 60][[60], 60]Passed
normal control 6[[0, 60, 0, 0], 60][[0, 60, 0, 0], 60]Passed
normal control 7[[0, 0, 60, 0], 60][[0, 0, 60, 0], 60]Passed
normal control 8[[0], 0][[0], 0]Passed

SHA-256 / d17bf4ce0e80da500c7574ea5302cadf6847b4d0f17bd8c24fc0095c4ac7b606

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:
                p = min(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 cut floor 1', [[['cancel', 100, 60, 'employer']]], [[60], 60]),
  ('regression variant: short notice cut floor 2',
   [[['cancel', 60, 16, 'mutual'], ['cancel', 60, 60, 'employer'], ['cut', 20159, 10, 'mutual']]],
   [[0, 60, 0], 60]),
  ('partial repair guard 3',
   [[['add', 60, 121, 'mutual'], ['cancel', 1439, 15, 'employer'], ['cut', 20160, 14, 'employer'],
     ['cut', 5000, 15, 'worker']]],
   [[0, 60, 0, 0], 60]),
  ('boundary control 4', [[['cut', 1440, 240, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['add', 20159, 15, 'employer']]], [[60], 60]),
  ('normal control 6',
   [[['cancel', 60, 90, 'worker'], ['add', 5000, 480, 'employer'], ['cancel', 18720, 30, 'worker'],
     ['add', 5000, 10, 'mutual']]],
   [[0, 60, 0, 0], 60]),
  ('normal control 7',
   [[['cancel', 20161, 90, 'employer'], ['cancel', 20161, 16, 'mutual'], ['cancel', 18720, 240, 'employer'],
     ['cut', 20160, 15, 'employer']]],
   [[0, 0, 60, 0], 60]),
  ('normal control 8', [[['cancel', 18720, 10, 'worker']]], [[0], 0])],
 [('regression: short notice cut floor 1', [[['add', 60, 121, 'worker'], ['cut', 1439, 30, 'employer']]],
   [[0, 60], 60]),
  ('regression variant: short notice cut floor 2',
   [[['add', 5000, 240, 'mutual'], ['add', 30000, 240, 'employer'], ['cancel', 60, 15, 'employer']]],
   [[0, 0, 60], 60]),
  ('partial repair guard 3',
   [[['cancel', 60, 16, 'mutual'], ['cancel', 60, 60, 'employer'], ['cut', 20159, 10, 'mutual']]],
   [[0, 60, 0], 60]),
  ('boundary control 4', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('boundary control 5', [[['cancel', 1439, 240, 'employer']]], [[120], 120]),
  ('normal control 6',
   [[['cancel', 1441, 480, 'employer'], ['cancel', 20161, 240, 'employer'], ['cut', 18720, 240, 'worker'],
     ['cancel', 20160, 30, 'mutual'], ['cut', 18720, 240, 'worker']]],
   [[60, 0, 0, 0, 0], 60]),
  ('normal control 7', [[['add', 1441, 480, 'mutual']]], [[0], 0]),
  ('normal control 8',
   [[['cancel', 1441, 240, 'employer'], ['add', 18720, 240, 'employer'], ['cancel', 30000, 60, 'employer'],
     ['add', 18720, 15, 'employer'], ['cut', 1440, 15, 'employer']]],
   [[60, 60, 0, 60, 60], 240])],
 [('regression: short notice cut floor 1',
   [[['add', 20160, 121, 'worker'], ['cancel', 60, 14, 'employer'], ['cut', 1441, 16, 'employer'],
     ['add', 1439, 480, 'employer'], ['cancel', 18720, 240, 'employer']]],
   [[0, 60, 60, 60, 60], 240]),
  ('regression variant: short notice cut floor 2',
   [[['add', 5000, 480, 'mutual'], ['cut', 1439, 60, 'employer'], ['cut', 20161, 15, 'mutual'],
     ['add', 30000, 14, 'employer']]],
   [[0, 60, 0, 0], 60]),
  ('partial repair guard 3', [[['cancel', 1439, 480, 'employer']]], [[240], 240]),
  ('boundary control 4', [[['add', 1000, 14, 'employer']]], [[0], 0]),
  ('boundary control 5', [[['add', 20160, 60, 'employer']]], [[0], 0]),
  ('normal control 6',
   [[['add', 20161, 480, 'employer'], ['cancel', 18720, 240, 'employer'], ['add', 1440, 240, 'mutual'],
     ['cut', 20160, 60, 'employer'], ['add', 20160, 60, 'mutual']]],
   [[0, 60, 0, 0, 0], 60]),
  ('normal control 7',
   [[['add', 18720, 121, 'employer'], ['cut', 5000, 90, 'employer'], ['cancel', 1440, 90, 'employer']]],
   [[60, 60, 60], 180]),
  ('normal control 8',
   [[['cut', 20159, 10, 'mutual'], ['cut', 18720, 90, 'employer'], ['add', 5000, 121, 'employer'],
     ['cancel', 20161, 60, 'mutual'], ['cancel', 1441, 16, 'employer']]],
   [[0, 60, 60, 0, 60], 180])],
 [('regression: short notice cut floor 1',
   [[['add', 60, 16, 'mutual'], ['cut', 1441, 10, 'employer'], ['cut', 5000, 121, 'employer'],
     ['cut', 60, 60, 'employer']]],
   [[0, 60, 60, 60], 180]),
  ('regression variant: short notice cut floor 2',
   [[['add', 18720, 16, 'employer'], ['cancel', 1441, 16, 'worker'], ['cancel', 60, 30, 'employer'],
     ['cancel', 1440, 60, 'worker'], ['add', 1439, 90, 'mutual']]],
   [[60, 0, 60, 0, 0], 120]),
  ('partial repair guard 3',
   [[['cancel', 30000, 14, 'mutual'], ['cancel', 60, 30, 'employer'], ['add', 1441, 16, 'worker']]],
   [[0, 60, 0], 60]),
  ('boundary control 4', [[['cancel', 100, 60, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['cut', 1440, 240, 'employer']]], [[60], 60]),
  ('normal control 6', [[['add', 18720, 16, 'employer'], ['cancel', 20159, 30, 'employer']]],
   [[60, 60], 120]),
  ('normal control 7',
   [[['add', 60, 121, 'mutual'], ['cancel', 1439, 15, 'employer'], ['cut', 20160, 14, 'employer'],
     ['cut', 5000, 15, 'worker']]],
   [[0, 60, 0, 0], 60]),
  ('normal control 8', [[['cancel', 18720, 10, 'worker']]], [[0], 0])],
 [('regression: short notice cut floor 1',
   [[['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]),
  ('regression variant: short notice cut floor 2',
   [[['cancel', 1439, 30, 'employer'], ['cut', 30000, 10, 'employer'], ['add', 20159, 15, 'worker'],
     ['cut', 20160, 10, 'employer'], ['cut', 20161, 10, 'employer']]],
   [[60, 0, 0, 0, 0], 60]),
  ('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', [[['add', 20159, 15, 'employer']]], [[60], 60]),
  ('boundary control 5', [[['cut', 100, 300, 'mutual']]], [[0], 0]),
  ('normal control 6',
   [[['add', 20159, 240, 'employer'], ['cancel', 5000, 15, 'employer'], ['cut', 60, 60, 'employer'],
     ['cut', 20160, 14, 'employer']]],
   [[60, 60, 60, 0], 180]),
  ('normal control 7',
   [[['cancel', 1440, 121, 'employer'], ['cancel', 1440, 90, 'worker'], ['cut', 20161, 90, 'employer'],
     ['add', 18720, 30, 'mutual']]],
   [[60, 0, 0, 0], 60]),
  ('normal control 8', [[['cancel', 60, 30, 'employer'], ['cut', 20161, 240, 'mutual']]], [[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 cut floor 1[[30], 30][[60], 60]Failed
regression variant: short notice cut floor 2[[0, 30, 0], 30][[0, 60, 0], 60]Failed
partial repair guard 3[[0, 7, 0, 0], 7][[0, 60, 0, 0], 60]Failed
boundary control 4[[60], 60][[60], 60]Passed
boundary control 5[[60], 60][[60], 60]Passed
normal control 6[[0, 60, 0, 0], 60][[0, 60, 0, 0], 60]Passed
normal control 7[[0, 0, 60, 0], 60][[0, 0, 60, 0], 60]Passed
normal control 8[[0], 0][[0], 0]Passed

SHA-256 / 885dcbbc68bf9339229b59c4ce51542b964217bc1457e48793ee8e07174e4723

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

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

Case digest / 37c2aac179364c9fd3a5538633d9c9d29808b92aa11f7db8525fcc09ae43a15d