{"abstract":"Workers who skip the shift after a holiday still receive holiday pay.","category":"Shift rostering labor rules","checks":8,"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.","contract_signature":"days, holidays","evaluation_group":"w2-shift-rostering-labor-rules-holiday-pay-eligibility","failed_approach":"Checking only the prior day ignores the first shift after the holiday.","family":"w2-shift-rostering-labor-rules-holiday-pay-eligibility-both-sides-required","id":"FA-94206","implementations":{"attempt":{"sha256":"16247207c97988e6f2d05dc1aee7b5eb6aa67404cbe510571c8a68a2c505dd28","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(days, holidays):\n    hs = set(holidays)\n    ok = ('W', 'X')\n    def near(i, step):\n        j = i + step\n        while 0 <= j < len(days) and (days[j] == 'O' or j in hs):\n            j += step\n        return days[j] if 0 <= j < len(days) else None\n    return [[h, near(h, -1) in ok] for h in sorted(holidays)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: both sides required 1', ['WAOWW', [2]], [[2, False]]),\n  ('regression variant: both sides required 2', ['WXWAAAWW', [7]], [[7, False]]),\n  ('partial repair guard 3', ['OWWOOO', [2, 0]], [[0, False], [2, False]]),\n  ('boundary control 4', ['OWOOW', [2]], [[2, True]]),\n  ('normal control 5', ['WWWWWOWO', [7, 5]], [[5, True], [7, False]]),\n  ('normal control 6', ['OWXWOOAWWW', [0, 5]], [[0, False], [5, False]]),\n  ('normal control 7', ['WAWOWXXW', [3, 4, 2]], [[2, False], [3, False], [4, False]]),\n  ('normal control 8', ['WOXOWXWW', [1]], [[1, True]])],\n [('regression: both sides required 1', ['OOWWW', [0]], [[0, False]]),\n  ('regression variant: both sides required 2', ['WWOWWXAOOW', [8, 7]], [[7, False], [8, False]]),\n  ('partial repair guard 3', ['OOWAWWXOWWO', [9]], [[9, False]]),\n  ('boundary control 4', ['WWOWA', [2]], [[2, True]]),\n  ('boundary control 5', ['WOOOW', [1, 2]], [[1, True], [2, True]]),\n  ('normal control 6', ['WOWAWWOWOW', [4, 8, 1]], [[1, True], [4, False], [8, True]]),\n  ('normal control 7', ['WWWWOAXAWWAW', [8, 4]], [[4, False], [8, False]]),\n  ('normal control 8', ['OWOWWX', [3, 4, 0]], [[0, False], [3, True], [4, True]])],\n [('regression: both sides required 1', ['OWWXAAXO', [7]], [[7, False]]),\n  ('regression variant: both sides required 2', ['XWWWWWAOOWA', [2, 5, 8]],\n   [[2, True], [5, False], [8, False]]),\n  ('partial repair guard 3', ['WOAOWWAO', [5, 7, 3]], [[3, False], [5, False], [7, False]]),\n  ('boundary control 4', ['WXOWX', [2]], [[2, True]]), ('boundary control 5', ['WOOWW', [2]], [[2, True]]),\n  ('normal control 6', ['WXWXOWAWWOW', [7, 9, 4]], [[4, True], [7, False], [9, True]]),\n  ('normal control 7', ['WWWWWW', [5, 0]], [[0, False], [5, False]]),\n  ('normal control 8', ['WOAWAAWOWW', [0, 7, 9]], [[0, False], [7, True], [9, False]])],\n [('regression: both sides required 1', ['OOAOWW', [3, 1, 0]], [[0, False], [1, False], [3, False]]),\n  ('regression variant: both sides required 2', ['WAOWOXWOXXWO', [4, 2, 6]],\n   [[2, False], [4, True], [6, True]]),\n  ('partial repair guard 3', ['XOOXOW', [1, 4, 5]], [[1, True], [4, False], [5, False]]),\n  ('boundary control 4', ['OOWWW', [0]], [[0, False]]), ('boundary control 5', ['OWOOW', [2]], [[2, True]]),\n  ('normal control 6', ['XOOWWWWWAO', [2, 6]], [[2, True], [6, True]]),\n  ('normal control 7', ['OWAAOOA', [5, 0, 4]], [[0, False], [4, False], [5, False]]),\n  ('normal control 8', ['OAWWOWAWX', [0]], [[0, False]])],\n [('regression: both sides required 1', ['WOWOWWO', [6, 2, 1]], [[1, True], [2, True], [6, False]]),\n  ('regression variant: both sides required 2', ['OWAAWWWWOOW', [9, 0, 8]],\n   [[0, False], [8, True], [9, True]]),\n  ('partial repair guard 3', ['WWWXWOOWO', [4, 6, 8]], [[4, True], [6, True], [8, False]]),\n  ('boundary control 4', ['WAOWW', [2]], [[2, False]]), ('boundary control 5', ['WWOWA', [2]], [[2, True]]),\n  ('normal control 6', ['WWWOWWAX', [4]], [[4, True]]),\n  ('normal control 7', ['OOAOOW', [1, 3, 0]], [[0, False], [1, False], [3, False]]),\n  ('normal control 8', ['WWWWWAOOWW', [6, 9, 7]], [[6, False], [7, False], [9, False]])]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"7b88449eb639dc48bf14135c8654ad2bf3fb5a0a556d5ea4291ff805f66b8965","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(days, holidays):\n    hs = set(holidays)\n    ok = ('W', 'X')\n    def near(i, step):\n        j = i + step\n        while 0 <= j < len(days) and (days[j] == 'O' or j in hs):\n            j += step\n        return days[j] if 0 <= j < len(days) else None\n    return [[h, near(h, -1) in ok or near(h, 1) in ok] for h in sorted(holidays)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: both sides required 1', ['WAOWW', [2]], [[2, False]]),\n  ('regression variant: both sides required 2', ['WXWAAAWW', [7]], [[7, False]]),\n  ('partial repair guard 3', ['OWWOOO', [2, 0]], [[0, False], [2, False]]),\n  ('boundary control 4', ['OWOOW', [2]], [[2, True]]),\n  ('normal control 5', ['WWWWWOWO', [7, 5]], [[5, True], [7, False]]),\n  ('normal control 6', ['OWXWOOAWWW', [0, 5]], [[0, False], [5, False]]),\n  ('normal control 7', ['WAWOWXXW', [3, 4, 2]], [[2, False], [3, False], [4, False]]),\n  ('normal control 8', ['WOXOWXWW', [1]], [[1, True]])],\n [('regression: both sides required 1', ['OOWWW', [0]], [[0, False]]),\n  ('regression variant: both sides required 2', ['WWOWWXAOOW', [8, 7]], [[7, False], [8, False]]),\n  ('partial repair guard 3', ['OOWAWWXOWWO', [9]], [[9, False]]),\n  ('boundary control 4', ['WWOWA', [2]], [[2, True]]),\n  ('boundary control 5', ['WOOOW', [1, 2]], [[1, True], [2, True]]),\n  ('normal control 6', ['WOWAWWOWOW', [4, 8, 1]], [[1, True], [4, False], [8, True]]),\n  ('normal control 7', ['WWWWOAXAWWAW', [8, 4]], [[4, False], [8, False]]),\n  ('normal control 8', ['OWOWWX', [3, 4, 0]], [[0, False], [3, True], [4, True]])],\n [('regression: both sides required 1', ['OWWXAAXO', [7]], [[7, False]]),\n  ('regression variant: both sides required 2', ['XWWWWWAOOWA', [2, 5, 8]],\n   [[2, True], [5, False], [8, False]]),\n  ('partial repair guard 3', ['WOAOWWAO', [5, 7, 3]], [[3, False], [5, False], [7, False]]),\n  ('boundary control 4', ['WXOWX', [2]], [[2, True]]), ('boundary control 5', ['WOOWW', [2]], [[2, True]]),\n  ('normal control 6', ['WXWXOWAWWOW', [7, 9, 4]], [[4, True], [7, False], [9, True]]),\n  ('normal control 7', ['WWWWWW', [5, 0]], [[0, False], [5, False]]),\n  ('normal control 8', ['WOAWAAWOWW', [0, 7, 9]], [[0, False], [7, True], [9, False]])],\n [('regression: both sides required 1', ['OOAOWW', [3, 1, 0]], [[0, False], [1, False], [3, False]]),\n  ('regression variant: both sides required 2', ['WAOWOXWOXXWO', [4, 2, 6]],\n   [[2, False], [4, True], [6, True]]),\n  ('partial repair guard 3', ['XOOXOW', [1, 4, 5]], [[1, True], [4, False], [5, False]]),\n  ('boundary control 4', ['OOWWW', [0]], [[0, False]]), ('boundary control 5', ['OWOOW', [2]], [[2, True]]),\n  ('normal control 6', ['XOOWWWWWAO', [2, 6]], [[2, True], [6, True]]),\n  ('normal control 7', ['OWAAOOA', [5, 0, 4]], [[0, False], [4, False], [5, False]]),\n  ('normal control 8', ['OAWWOWAWX', [0]], [[0, False]])],\n [('regression: both sides required 1', ['WOWOWWO', [6, 2, 1]], [[1, True], [2, True], [6, False]]),\n  ('regression variant: both sides required 2', ['OWAAWWWWOOW', [9, 0, 8]],\n   [[0, False], [8, True], [9, True]]),\n  ('partial repair guard 3', ['WWWXWOOWO', [4, 6, 8]], [[4, True], [6, True], [8, False]]),\n  ('boundary control 4', ['WAOWW', [2]], [[2, False]]), ('boundary control 5', ['WWOWA', [2]], [[2, True]]),\n  ('normal control 6', ['WWWOWWAX', [4]], [[4, True]]),\n  ('normal control 7', ['OOAOOW', [1, 3, 0]], [[0, False], [1, False], [3, False]]),\n  ('normal control 8', ['WWWWWAOOWW', [6, 9, 7]], [[6, False], [7, False], [9, False]])]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-shift-rostering-labor-rules-holiday-pay-eligibility-both-sides-required","generated_at":"2026-09-29T14:52:02.137572+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Last-and-first-shift holiday pay rules are frequently misapplied around days off and adjacent holidays.","root_cause":"The last-and-first test uses or.","sha256":"86dd94322377846eda37d9e2d8b758a74588e823d3a9b1d878a213d3917fb5e3","title":"Holiday pay granted when only one surrounding shift is worked · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":43.221,"exit_code":1,"observations":[{"actual":[[2,false]],"check":"regression: both sides required 1","expected":[[2,false]],"passed":true},{"actual":[[7,true]],"check":"regression variant: both sides required 2","expected":[[7,false]],"passed":false},{"actual":[[0,false],[2,true]],"check":"partial repair guard 3","expected":[[0,false],[2,false]],"passed":false},{"actual":[[2,true]],"check":"boundary control 4","expected":[[2,true]],"passed":true},{"actual":[[5,true],[7,true]],"check":"normal control 5","expected":[[5,true],[7,false]],"passed":false},{"actual":[[0,false],[5,true]],"check":"normal control 6","expected":[[0,false],[5,false]],"passed":false},{"actual":[[2,false],[3,false],[4,false]],"check":"normal control 7","expected":[[2,false],[3,false],[4,false]],"passed":true},{"actual":[[1,true]],"check":"normal control 8","expected":[[1,true]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: both sides required 1\", \"actual\": [[2, false]], \"expected\": [[2, false]], \"passed\": true}, {\"check\": \"regression variant: both sides required 2\", \"actual\": [[7, true]], \"expected\": [[7, false]], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [[0, false], [2, true]], \"expected\": [[0, false], [2, false]], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [[2, true]], \"expected\": [[2, true]], \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": [[5, true], [7, true]], \"expected\": [[5, true], [7, false]], \"passed\": false}, {\"check\": \"normal control 6\", \"actual\": [[0, false], [5, true]], \"expected\": [[0, false], [5, false]], \"passed\": false}, {\"check\": \"normal control 7\", \"actual\": [[2, false], [3, false], [4, false]], \"expected\": [[2, false], [3, false], [4, false]], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [[1, true]], \"expected\": [[1, true]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.049,"exit_code":1,"observations":[{"actual":[[2,true]],"check":"regression: both sides required 1","expected":[[2,false]],"passed":false},{"actual":[[7,true]],"check":"regression variant: both sides required 2","expected":[[7,false]],"passed":false},{"actual":[[0,true],[2,true]],"check":"partial repair guard 3","expected":[[0,false],[2,false]],"passed":false},{"actual":[[2,true]],"check":"boundary control 4","expected":[[2,true]],"passed":true},{"actual":[[5,true],[7,true]],"check":"normal control 5","expected":[[5,true],[7,false]],"passed":false},{"actual":[[0,true],[5,true]],"check":"normal control 6","expected":[[0,false],[5,false]],"passed":false},{"actual":[[2,true],[3,true],[4,true]],"check":"normal control 7","expected":[[2,false],[3,false],[4,false]],"passed":false},{"actual":[[1,true]],"check":"normal control 8","expected":[[1,true]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: both sides required 1\", \"actual\": [[2, true]], \"expected\": [[2, false]], \"passed\": false}, {\"check\": \"regression variant: both sides required 2\", \"actual\": [[7, true]], \"expected\": [[7, false]], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [[0, true], [2, true]], \"expected\": [[0, false], [2, false]], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [[2, true]], \"expected\": [[2, true]], \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": [[5, true], [7, true]], \"expected\": [[5, true], [7, false]], \"passed\": false}, {\"check\": \"normal control 6\", \"actual\": [[0, true], [5, true]], \"expected\": [[0, false], [5, false]], \"passed\": false}, {\"check\": \"normal control 7\", \"actual\": [[2, true], [3, true], [4, true]], \"expected\": [[2, false], [3, false], [4, false]], \"passed\": false}, {\"check\": \"normal control 8\", \"actual\": [[1, true]], \"expected\": [[1, true]], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}