FAILURE MAP
← Case archive

FA-94201 / Shift rostering labor rules / Open access

Excused absence disqualifies holiday pay · case 01

Workers on approved sick leave the day before a holiday lose holiday pay.

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

ROOT CAUSE

Only worked days qualify as surrounding days.

VERIFIED REPAIR

Treat worked and excused-absence days as qualifying.

Unsuccessful approach: Letting a missing neighbour qualify pays holidays at the roster edge.

Case contract

A day-status string (W worked, A unexcused absence, X excused absence, O not scheduled) and holiday indices. A holiday is paid if the nearest scheduled day before it and the nearest after it (skipping O days and other holidays) are both W or X; if either does not exist in the roster, it is not paid. Return [holiday, eligible] in holiday order.

Why this case matters

Last-and-first-shift holiday pay rules are frequently misapplied around days off and adjacent holidays.

1 / The failure

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

N = 1
observations = []
def solve(days, holidays):
    hs = set(holidays)
    ok = ('W',)
    def near(i, step):
        j = i + step
        while 0 <= j < len(days) and (days[j] == 'O' or j in hs):
            j += step
        return days[j] if 0 <= j < len(days) else None
    return [[h, near(h, -1) in ok and near(h, 1) in ok] for h in sorted(holidays)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: excused absence qualifies 1', ['WXOWX', [2]], [[2, True]]),
  ('regression variant: excused absence qualifies 2', ['WWWXWOOWO', [4, 6, 8]],
   [[4, True], [6, True], [8, False]]),
  ('partial repair guard 3', ['WAWWWWWWOO', [8]], [[8, False]]),
  ('boundary control 4', ['OWOOW', [2]], [[2, True]]), ('boundary control 5', ['WAOWW', [2]], [[2, False]]),
  ('normal control 6', ['WOWWWOWWOOOW', [1, 6]], [[1, True], [6, True]]),
  ('normal control 7', ['AOWWWAWWOWO', [10, 1]], [[1, False], [10, False]]),
  ('normal control 8', ['WWWXOOOWWOW', [7, 6]], [[6, True], [7, True]])],
 [('regression: excused absence qualifies 1', ['WWOWXXXWO', [3]], [[3, True]]),
  ('regression variant: excused absence qualifies 2', ['OWOWXXWXW', [0, 3, 2]],
   [[0, False], [2, True], [3, True]]),
  ('partial repair guard 3', ['XAOOXO', [5, 2]], [[2, False], [5, False]]),
  ('boundary control 4', ['WWOWA', [2]], [[2, True]]),
  ('boundary control 5', ['WOOOW', [1, 2]], [[1, True], [2, True]]),
  ('normal control 6', ['WOWAWWWXXW', [6, 2]], [[2, False], [6, True]]),
  ('normal control 7', ['XWOWOOAW', [2, 3]], [[2, False], [3, False]]),
  ('normal control 8', ['AWXWOXWXOW', [8]], [[8, True]])],
 [('regression: excused absence qualifies 1', ['XOWOAWW', [3, 1, 6]], [[1, True], [3, False], [6, False]]),
  ('regression variant: excused absence qualifies 2', ['WWWXOOOXX', [2, 6]], [[2, True], [6, True]]),
  ('partial repair guard 3', ['OWWWWWOAWXWW', [11, 0, 5]], [[0, False], [5, False], [11, False]]),
  ('boundary control 4', ['WXOWX', [2]], [[2, True]]), ('boundary control 5', ['WOOWW', [2]], [[2, True]]),
  ('normal control 6', ['OOXWWWWXWWO', [6]], [[6, True]]),
  ('normal control 7', ['OWWWWOOWOA', [5]], [[5, True]]),
  ('normal control 8', ['WOWWOXWAAAW', [6]], [[6, False]])],
 [('regression: excused absence qualifies 1', ['WOXOWW', [4, 3]], [[3, True], [4, True]]),
  ('regression variant: excused absence qualifies 2', ['WWWWWXWWWAO', [2, 6]], [[2, True], [6, True]]),
  ('partial repair guard 3', ['AOWOWOO', [5, 1]], [[1, False], [5, False]]),
  ('boundary control 4', ['OOWWW', [0]], [[0, False]]), ('boundary control 5', ['OWOOW', [2]], [[2, True]]),
  ('normal control 6', ['XWOXWWXWOAXO', [2]], [[2, True]]),
  ('normal control 7', ['WAXWAXWWWXOO', [11]], [[11, False]]),
  ('normal control 8', ['WOAOXWWWWWXW', [1, 3, 6]], [[1, False], [3, False], [6, True]])],
 [('regression: excused absence qualifies 1', ['WOWWAWAXXOWW', [0, 9, 10]],
   [[0, False], [9, True], [10, True]]),
  ('regression variant: excused absence qualifies 2', ['WOWWAWOWXOOW', [9, 6, 7]],
   [[6, True], [7, True], [9, True]]),
  ('partial repair guard 3', ['OWAAWWWWOOW', [9, 0, 8]], [[0, False], [8, True], [9, True]]),
  ('boundary control 4', ['WAOWW', [2]], [[2, False]]), ('boundary control 5', ['WWOWA', [2]], [[2, True]]),
  ('normal control 6', ['AWXOWOA', [5, 1, 3]], [[1, False], [3, True], [5, False]]),
  ('normal control 7', ['OWAAOOA', [5, 0, 4]], [[0, False], [4, False], [5, False]]),
  ('normal control 8', ['AWAOWWAWW', [3]], [[3, False]])]]
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: excused absence qualifies 1[[2, False]][[2, True]]Failed
regression variant: excused absence qualifies 2[[4, False], [6, False], [8, False]][[4, True], [6, True], [8, False]]Failed
partial repair guard 3[[8, False]][[8, False]]Passed
boundary control 4[[2, True]][[2, True]]Passed
boundary control 5[[2, False]][[2, False]]Passed
normal control 6[[1, True], [6, True]][[1, True], [6, True]]Passed
normal control 7[[1, False], [10, False]][[1, False], [10, False]]Passed
normal control 8[[6, False], [7, False]][[6, True], [7, True]]Failed

SHA-256 / 84de4a9012c4e750c811464b7ef3284dd0505832c33d153257c22c62e3aa550d

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(days, holidays):
    hs = set(holidays)
    ok = ('W', 'X', None)
    def near(i, step):
        j = i + step
        while 0 <= j < len(days) and (days[j] == 'O' or j in hs):
            j += step
        return days[j] if 0 <= j < len(days) else None
    return [[h, near(h, -1) in ok and near(h, 1) in ok] for h in sorted(holidays)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: excused absence qualifies 1', ['WXOWX', [2]], [[2, True]]),
  ('regression variant: excused absence qualifies 2', ['WWWXWOOWO', [4, 6, 8]],
   [[4, True], [6, True], [8, False]]),
  ('partial repair guard 3', ['WAWWWWWWOO', [8]], [[8, False]]),
  ('boundary control 4', ['OWOOW', [2]], [[2, True]]), ('boundary control 5', ['WAOWW', [2]], [[2, False]]),
  ('normal control 6', ['WOWWWOWWOOOW', [1, 6]], [[1, True], [6, True]]),
  ('normal control 7', ['AOWWWAWWOWO', [10, 1]], [[1, False], [10, False]]),
  ('normal control 8', ['WWWXOOOWWOW', [7, 6]], [[6, True], [7, True]])],
 [('regression: excused absence qualifies 1', ['WWOWXXXWO', [3]], [[3, True]]),
  ('regression variant: excused absence qualifies 2', ['OWOWXXWXW', [0, 3, 2]],
   [[0, False], [2, True], [3, True]]),
  ('partial repair guard 3', ['XAOOXO', [5, 2]], [[2, False], [5, False]]),
  ('boundary control 4', ['WWOWA', [2]], [[2, True]]),
  ('boundary control 5', ['WOOOW', [1, 2]], [[1, True], [2, True]]),
  ('normal control 6', ['WOWAWWWXXW', [6, 2]], [[2, False], [6, True]]),
  ('normal control 7', ['XWOWOOAW', [2, 3]], [[2, False], [3, False]]),
  ('normal control 8', ['AWXWOXWXOW', [8]], [[8, True]])],
 [('regression: excused absence qualifies 1', ['XOWOAWW', [3, 1, 6]], [[1, True], [3, False], [6, False]]),
  ('regression variant: excused absence qualifies 2', ['WWWXOOOXX', [2, 6]], [[2, True], [6, True]]),
  ('partial repair guard 3', ['OWWWWWOAWXWW', [11, 0, 5]], [[0, False], [5, False], [11, False]]),
  ('boundary control 4', ['WXOWX', [2]], [[2, True]]), ('boundary control 5', ['WOOWW', [2]], [[2, True]]),
  ('normal control 6', ['OOXWWWWXWWO', [6]], [[6, True]]),
  ('normal control 7', ['OWWWWOOWOA', [5]], [[5, True]]),
  ('normal control 8', ['WOWWOXWAAAW', [6]], [[6, False]])],
 [('regression: excused absence qualifies 1', ['WOXOWW', [4, 3]], [[3, True], [4, True]]),
  ('regression variant: excused absence qualifies 2', ['WWWWWXWWWAO', [2, 6]], [[2, True], [6, True]]),
  ('partial repair guard 3', ['AOWOWOO', [5, 1]], [[1, False], [5, False]]),
  ('boundary control 4', ['OOWWW', [0]], [[0, False]]), ('boundary control 5', ['OWOOW', [2]], [[2, True]]),
  ('normal control 6', ['XWOXWWXWOAXO', [2]], [[2, True]]),
  ('normal control 7', ['WAXWAXWWWXOO', [11]], [[11, False]]),
  ('normal control 8', ['WOAOXWWWWWXW', [1, 3, 6]], [[1, False], [3, False], [6, True]])],
 [('regression: excused absence qualifies 1', ['WOWWAWAXXOWW', [0, 9, 10]],
   [[0, False], [9, True], [10, True]]),
  ('regression variant: excused absence qualifies 2', ['WOWWAWOWXOOW', [9, 6, 7]],
   [[6, True], [7, True], [9, True]]),
  ('partial repair guard 3', ['OWAAWWWWOOW', [9, 0, 8]], [[0, False], [8, True], [9, True]]),
  ('boundary control 4', ['WAOWW', [2]], [[2, False]]), ('boundary control 5', ['WWOWA', [2]], [[2, True]]),
  ('normal control 6', ['AWXOWOA', [5, 1, 3]], [[1, False], [3, True], [5, False]]),
  ('normal control 7', ['OWAAOOA', [5, 0, 4]], [[0, False], [4, False], [5, False]]),
  ('normal control 8', ['AWAOWWAWW', [3]], [[3, False]])]]
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: excused absence qualifies 1[[2, True]][[2, True]]Passed
regression variant: excused absence qualifies 2[[4, True], [6, True], [8, True]][[4, True], [6, True], [8, False]]Failed
partial repair guard 3[[8, True]][[8, False]]Failed
boundary control 4[[2, True]][[2, True]]Passed
boundary control 5[[2, False]][[2, False]]Passed
normal control 6[[1, True], [6, True]][[1, True], [6, True]]Passed
normal control 7[[1, False], [10, True]][[1, False], [10, False]]Failed
normal control 8[[6, True], [7, True]][[6, True], [7, True]]Passed

SHA-256 / 8f535e835b45de8b9b99f87808ce87c7a7d957ac71c989e8f6464ddab97772c6

3 / The verified repair

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

N = 1
observations = []
def solve(days, holidays):
    hs = set(holidays)
    ok = ('W', 'X')
    def near(i, step):
        j = i + step
        while 0 <= j < len(days) and (days[j] == 'O' or j in hs):
            j += step
        return days[j] if 0 <= j < len(days) else None
    return [[h, near(h, -1) in ok and near(h, 1) in ok] for h in sorted(holidays)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: excused absence qualifies 1', ['WXOWX', [2]], [[2, True]]),
  ('regression variant: excused absence qualifies 2', ['WWWXWOOWO', [4, 6, 8]],
   [[4, True], [6, True], [8, False]]),
  ('partial repair guard 3', ['WAWWWWWWOO', [8]], [[8, False]]),
  ('boundary control 4', ['OWOOW', [2]], [[2, True]]), ('boundary control 5', ['WAOWW', [2]], [[2, False]]),
  ('normal control 6', ['WOWWWOWWOOOW', [1, 6]], [[1, True], [6, True]]),
  ('normal control 7', ['AOWWWAWWOWO', [10, 1]], [[1, False], [10, False]]),
  ('normal control 8', ['WWWXOOOWWOW', [7, 6]], [[6, True], [7, True]])],
 [('regression: excused absence qualifies 1', ['WWOWXXXWO', [3]], [[3, True]]),
  ('regression variant: excused absence qualifies 2', ['OWOWXXWXW', [0, 3, 2]],
   [[0, False], [2, True], [3, True]]),
  ('partial repair guard 3', ['XAOOXO', [5, 2]], [[2, False], [5, False]]),
  ('boundary control 4', ['WWOWA', [2]], [[2, True]]),
  ('boundary control 5', ['WOOOW', [1, 2]], [[1, True], [2, True]]),
  ('normal control 6', ['WOWAWWWXXW', [6, 2]], [[2, False], [6, True]]),
  ('normal control 7', ['XWOWOOAW', [2, 3]], [[2, False], [3, False]]),
  ('normal control 8', ['AWXWOXWXOW', [8]], [[8, True]])],
 [('regression: excused absence qualifies 1', ['XOWOAWW', [3, 1, 6]], [[1, True], [3, False], [6, False]]),
  ('regression variant: excused absence qualifies 2', ['WWWXOOOXX', [2, 6]], [[2, True], [6, True]]),
  ('partial repair guard 3', ['OWWWWWOAWXWW', [11, 0, 5]], [[0, False], [5, False], [11, False]]),
  ('boundary control 4', ['WXOWX', [2]], [[2, True]]), ('boundary control 5', ['WOOWW', [2]], [[2, True]]),
  ('normal control 6', ['OOXWWWWXWWO', [6]], [[6, True]]),
  ('normal control 7', ['OWWWWOOWOA', [5]], [[5, True]]),
  ('normal control 8', ['WOWWOXWAAAW', [6]], [[6, False]])],
 [('regression: excused absence qualifies 1', ['WOXOWW', [4, 3]], [[3, True], [4, True]]),
  ('regression variant: excused absence qualifies 2', ['WWWWWXWWWAO', [2, 6]], [[2, True], [6, True]]),
  ('partial repair guard 3', ['AOWOWOO', [5, 1]], [[1, False], [5, False]]),
  ('boundary control 4', ['OOWWW', [0]], [[0, False]]), ('boundary control 5', ['OWOOW', [2]], [[2, True]]),
  ('normal control 6', ['XWOXWWXWOAXO', [2]], [[2, True]]),
  ('normal control 7', ['WAXWAXWWWXOO', [11]], [[11, False]]),
  ('normal control 8', ['WOAOXWWWWWXW', [1, 3, 6]], [[1, False], [3, False], [6, True]])],
 [('regression: excused absence qualifies 1', ['WOWWAWAXXOWW', [0, 9, 10]],
   [[0, False], [9, True], [10, True]]),
  ('regression variant: excused absence qualifies 2', ['WOWWAWOWXOOW', [9, 6, 7]],
   [[6, True], [7, True], [9, True]]),
  ('partial repair guard 3', ['OWAAWWWWOOW', [9, 0, 8]], [[0, False], [8, True], [9, True]]),
  ('boundary control 4', ['WAOWW', [2]], [[2, False]]), ('boundary control 5', ['WWOWA', [2]], [[2, True]]),
  ('normal control 6', ['AWXOWOA', [5, 1, 3]], [[1, False], [3, True], [5, False]]),
  ('normal control 7', ['OWAAOOA', [5, 0, 4]], [[0, False], [4, False], [5, False]]),
  ('normal control 8', ['AWAOWWAWW', [3]], [[3, False]])]]
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: excused absence qualifies 1[[2, True]][[2, True]]Passed
regression variant: excused absence qualifies 2[[4, True], [6, True], [8, False]][[4, True], [6, True], [8, False]]Passed
partial repair guard 3[[8, False]][[8, False]]Passed
boundary control 4[[2, True]][[2, True]]Passed
boundary control 5[[2, False]][[2, False]]Passed
normal control 6[[1, True], [6, True]][[1, True], [6, True]]Passed
normal control 7[[1, False], [10, False]][[1, False], [10, False]]Passed
normal control 8[[6, True], [7, True]][[6, True], [7, True]]Passed

SHA-256 / 1192a4a2b348a1e87ead1c157b152a92ec8e6871b0215d30976d8e035f2040c5

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

Case digest / ead9566ed2f4e802254d51ae9155ddab881d4b6d7bf5e379ddcd3f88e5933c18