{"abstract":"A shift starting at 02:00 earns no night minutes for its first four hours.","category":"Shift rostering labor rules","checks":8,"contract":"A shift [start, end] in absolute minutes (day 0 starts at minute 0) and a night-shift threshold. The night period runs 23:00 to 06:00 across midnight. Return [night minutes, whether night minutes reach the threshold].","evaluation_group":"w2-shift-rostering-labor-rules-night-work-minutes","failed_approach":"Adding a window at the end instead of the start still misses the previous evening.","family":"w2-shift-rostering-labor-rules-night-work-minutes-previous-evening-window","id":"FA-94011","implementations":{"attempt":{"sha256":"10af7acb385aea5caf992aeb3d5acae98b7c745090076e9299901478f197871a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(shift, threshold):\n    s, e = shift\n    night = 0\n    for d in range(s // 1440, e // 1440 + 2):\n        lo = d * 1440 + 1380\n        hi = d * 1440 + 1800\n        night += max(0, min(e, hi) - max(s, lo))\n    return [night, night >= threshold]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: previous evening window 1', [[120, 480], 180], [240, True]),\n  ('regression variant: previous evening window 2', [[6060, 6300], 240], [60, False]),\n  ('partial repair guard 3', [[7200, 7920], 240], [360, True]),\n  ('boundary control 4', [[1380, 1559], 180], [179, False]),\n  ('boundary control 5', [[1320, 1800], 180], [420, True]),\n  ('normal control 6', [[8100, 8820], 180], [240, True]),\n  ('normal control 7', [[4680, 5160], 180], [0, False]),\n  ('normal control 8', [[5640, 5703], 120], [3, False])],\n [('regression: previous evening window 1', [[2940, 3300], 240], [300, True]),\n  ('regression variant: previous evening window 2', [[5760, 6500], 240], [360, True]),\n  ('partial repair guard 3', [[4620, 4800], 180], [60, False]),\n  ('boundary control 4', [[1800, 2400], 180], [0, False]),\n  ('boundary control 5', [[900, 1410], 180], [30, False]),\n  ('normal control 6', [[5720, 6440], 240], [400, True]),\n  ('normal control 7', [[7080, 7560], 240], [420, True]),\n  ('normal control 8', [[8460, 8940], 120], [360, True])],\n [('regression: previous evening window 1', [[4380, 4560], 120], [180, True]),\n  ('regression variant: previous evening window 2', [[7200, 7920], 180], [360, True]),\n  ('partial repair guard 3', [[328, 508], 180], [32, False]),\n  ('boundary control 4', [[1380, 1560], 180], [180, True]),\n  ('boundary control 5', [[120, 480], 180], [240, True]),\n  ('normal control 6', [[3000, 3030], 120], [30, False]),\n  ('normal control 7', [[3000, 3480], 240], [240, True]),\n  ('normal control 8', [[5720, 6440], 120], [400, True])],\n [('regression: previous evening window 1', [[1560, 2040], 120], [240, True]),\n  ('regression variant: previous evening window 2', [[60, 660], 120], [300, True]),\n  ('partial repair guard 3', [[3000, 3030], 120], [30, False]),\n  ('boundary control 4', [[2940, 3300], 240], [300, True]),\n  ('boundary control 5', [[1380, 1559], 180], [179, False]),\n  ('normal control 6', [[5700, 6300], 180], [420, True]),\n  ('normal control 7', [[3180, 3360], 120], [60, False]),\n  ('normal control 8', [[6060, 6780], 240], [60, False])],\n [('regression: previous evening window 1', [[3000, 3600], 240], [240, True]),\n  ('regression variant: previous evening window 2', [[0, 203], 180], [203, True]),\n  ('partial repair guard 3', [[1740, 2220], 240], [60, False]),\n  ('boundary control 4', [[1320, 1800], 180], [420, True]),\n  ('boundary control 5', [[1800, 2400], 180], [0, False]),\n  ('normal control 6', [[4440, 4636], 180], [196, True]), ('normal control 7', [[420, 450], 180], [0, False]),\n  ('normal control 8', [[6120, 6150], 120], [0, 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":"9638cf5cd90d0016816baa935ec5d406c1040bce34dd4b5535a994093c7ada9f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(shift, threshold):\n    s, e = shift\n    night = 0\n    for d in range(s // 1440, e // 1440 + 1):\n        lo = d * 1440 + 1380\n        hi = d * 1440 + 1800\n        night += max(0, min(e, hi) - max(s, lo))\n    return [night, night >= threshold]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: previous evening window 1', [[120, 480], 180], [240, True]),\n  ('regression variant: previous evening window 2', [[6060, 6300], 240], [60, False]),\n  ('partial repair guard 3', [[7200, 7920], 240], [360, True]),\n  ('boundary control 4', [[1380, 1559], 180], [179, False]),\n  ('boundary control 5', [[1320, 1800], 180], [420, True]),\n  ('normal control 6', [[8100, 8820], 180], [240, True]),\n  ('normal control 7', [[4680, 5160], 180], [0, False]),\n  ('normal control 8', [[5640, 5703], 120], [3, False])],\n [('regression: previous evening window 1', [[2940, 3300], 240], [300, True]),\n  ('regression variant: previous evening window 2', [[5760, 6500], 240], [360, True]),\n  ('partial repair guard 3', [[4620, 4800], 180], [60, False]),\n  ('boundary control 4', [[1800, 2400], 180], [0, False]),\n  ('boundary control 5', [[900, 1410], 180], [30, False]),\n  ('normal control 6', [[5720, 6440], 240], [400, True]),\n  ('normal control 7', [[7080, 7560], 240], [420, True]),\n  ('normal control 8', [[8460, 8940], 120], [360, True])],\n [('regression: previous evening window 1', [[4380, 4560], 120], [180, True]),\n  ('regression variant: previous evening window 2', [[7200, 7920], 180], [360, True]),\n  ('partial repair guard 3', [[328, 508], 180], [32, False]),\n  ('boundary control 4', [[1380, 1560], 180], [180, True]),\n  ('boundary control 5', [[120, 480], 180], [240, True]),\n  ('normal control 6', [[3000, 3030], 120], [30, False]),\n  ('normal control 7', [[3000, 3480], 240], [240, True]),\n  ('normal control 8', [[5720, 6440], 120], [400, True])],\n [('regression: previous evening window 1', [[1560, 2040], 120], [240, True]),\n  ('regression variant: previous evening window 2', [[60, 660], 120], [300, True]),\n  ('partial repair guard 3', [[3000, 3030], 120], [30, False]),\n  ('boundary control 4', [[2940, 3300], 240], [300, True]),\n  ('boundary control 5', [[1380, 1559], 180], [179, False]),\n  ('normal control 6', [[5700, 6300], 180], [420, True]),\n  ('normal control 7', [[3180, 3360], 120], [60, False]),\n  ('normal control 8', [[6060, 6780], 240], [60, False])],\n [('regression: previous evening window 1', [[3000, 3600], 240], [240, True]),\n  ('regression variant: previous evening window 2', [[0, 203], 180], [203, True]),\n  ('partial repair guard 3', [[1740, 2220], 240], [60, False]),\n  ('boundary control 4', [[1320, 1800], 180], [420, True]),\n  ('boundary control 5', [[1800, 2400], 180], [0, False]),\n  ('normal control 6', [[4440, 4636], 180], [196, True]), ('normal control 7', [[420, 450], 180], [0, False]),\n  ('normal control 8', [[6120, 6150], 120], [0, 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"},"fixed":{"sha256":"56ca5d778837db13a1435e95498198e6dbffd014197285affb738559a4b442fe","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(shift, threshold):\n    s, e = shift\n    night = 0\n    for d in range(s // 1440 - 1, e // 1440 + 1):\n        lo = d * 1440 + 1380\n        hi = d * 1440 + 1800\n        night += max(0, min(e, hi) - max(s, lo))\n    return [night, night >= threshold]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: previous evening window 1', [[120, 480], 180], [240, True]),\n  ('regression variant: previous evening window 2', [[6060, 6300], 240], [60, False]),\n  ('partial repair guard 3', [[7200, 7920], 240], [360, True]),\n  ('boundary control 4', [[1380, 1559], 180], [179, False]),\n  ('boundary control 5', [[1320, 1800], 180], [420, True]),\n  ('normal control 6', [[8100, 8820], 180], [240, True]),\n  ('normal control 7', [[4680, 5160], 180], [0, False]),\n  ('normal control 8', [[5640, 5703], 120], [3, False])],\n [('regression: previous evening window 1', [[2940, 3300], 240], [300, True]),\n  ('regression variant: previous evening window 2', [[5760, 6500], 240], [360, True]),\n  ('partial repair guard 3', [[4620, 4800], 180], [60, False]),\n  ('boundary control 4', [[1800, 2400], 180], [0, False]),\n  ('boundary control 5', [[900, 1410], 180], [30, False]),\n  ('normal control 6', [[5720, 6440], 240], [400, True]),\n  ('normal control 7', [[7080, 7560], 240], [420, True]),\n  ('normal control 8', [[8460, 8940], 120], [360, True])],\n [('regression: previous evening window 1', [[4380, 4560], 120], [180, True]),\n  ('regression variant: previous evening window 2', [[7200, 7920], 180], [360, True]),\n  ('partial repair guard 3', [[328, 508], 180], [32, False]),\n  ('boundary control 4', [[1380, 1560], 180], [180, True]),\n  ('boundary control 5', [[120, 480], 180], [240, True]),\n  ('normal control 6', [[3000, 3030], 120], [30, False]),\n  ('normal control 7', [[3000, 3480], 240], [240, True]),\n  ('normal control 8', [[5720, 6440], 120], [400, True])],\n [('regression: previous evening window 1', [[1560, 2040], 120], [240, True]),\n  ('regression variant: previous evening window 2', [[60, 660], 120], [300, True]),\n  ('partial repair guard 3', [[3000, 3030], 120], [30, False]),\n  ('boundary control 4', [[2940, 3300], 240], [300, True]),\n  ('boundary control 5', [[1380, 1559], 180], [179, False]),\n  ('normal control 6', [[5700, 6300], 180], [420, True]),\n  ('normal control 7', [[3180, 3360], 120], [60, False]),\n  ('normal control 8', [[6060, 6780], 240], [60, False])],\n [('regression: previous evening window 1', [[3000, 3600], 240], [240, True]),\n  ('regression variant: previous evening window 2', [[0, 203], 180], [203, True]),\n  ('partial repair guard 3', [[1740, 2220], 240], [60, False]),\n  ('boundary control 4', [[1320, 1800], 180], [420, True]),\n  ('boundary control 5', [[1800, 2400], 180], [0, False]),\n  ('normal control 6', [[4440, 4636], 180], [196, True]), ('normal control 7', [[420, 450], 180], [0, False]),\n  ('normal control 8', [[6120, 6150], 120], [0, 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-night-work-minutes-previous-evening-window","generated_at":"2026-09-29T14:52:00.381395+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Night-work classification drives night-worker limits and premiums and must handle shifts that start after midnight.","repair":"Start enumerating night windows one day before the shift start day.","root_cause":"Night windows are enumerated from the shift start day, missing the window that opened at 23:00 the day before.","sha256":"8b3c2757584d2269a0cae1fbe41a293a9623afc645846c7ad98c7af8b5212d89","title":"Night window that began the previous evening is skipped · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.858,"exit_code":1,"observations":[{"actual":[0,false],"check":"regression: previous evening window 1","expected":[240,true],"passed":false},{"actual":[0,false],"check":"regression variant: previous evening window 2","expected":[60,false],"passed":false},{"actual":[0,false],"check":"partial repair guard 3","expected":[360,true],"passed":false},{"actual":[179,false],"check":"boundary control 4","expected":[179,false],"passed":true},{"actual":[420,true],"check":"boundary control 5","expected":[420,true],"passed":true},{"actual":[240,true],"check":"normal control 6","expected":[240,true],"passed":true},{"actual":[0,false],"check":"normal control 7","expected":[0,false],"passed":true},{"actual":[3,false],"check":"normal control 8","expected":[3,false],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: previous evening window 1\", \"actual\": [0, false], \"expected\": [240, true], \"passed\": false}, {\"check\": \"regression variant: previous evening window 2\", \"actual\": [0, false], \"expected\": [60, false], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [0, false], \"expected\": [360, true], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [179, false], \"expected\": [179, false], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [420, true], \"expected\": [420, true], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [240, true], \"expected\": [240, true], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [0, false], \"expected\": [0, false], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [3, false], \"expected\": [3, false], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.04,"exit_code":1,"observations":[{"actual":[0,false],"check":"regression: previous evening window 1","expected":[240,true],"passed":false},{"actual":[0,false],"check":"regression variant: previous evening window 2","expected":[60,false],"passed":false},{"actual":[0,false],"check":"partial repair guard 3","expected":[360,true],"passed":false},{"actual":[179,false],"check":"boundary control 4","expected":[179,false],"passed":true},{"actual":[420,true],"check":"boundary control 5","expected":[420,true],"passed":true},{"actual":[240,true],"check":"normal control 6","expected":[240,true],"passed":true},{"actual":[0,false],"check":"normal control 7","expected":[0,false],"passed":true},{"actual":[3,false],"check":"normal control 8","expected":[3,false],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: previous evening window 1\", \"actual\": [0, false], \"expected\": [240, true], \"passed\": false}, {\"check\": \"regression variant: previous evening window 2\", \"actual\": [0, false], \"expected\": [60, false], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [0, false], \"expected\": [360, true], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [179, false], \"expected\": [179, false], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [420, true], \"expected\": [420, true], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [240, true], \"expected\": [240, true], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [0, false], \"expected\": [0, false], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [3, false], \"expected\": [3, false], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.214,"exit_code":0,"observations":[{"actual":[240,true],"check":"regression: previous evening window 1","expected":[240,true],"passed":true},{"actual":[60,false],"check":"regression variant: previous evening window 2","expected":[60,false],"passed":true},{"actual":[360,true],"check":"partial repair guard 3","expected":[360,true],"passed":true},{"actual":[179,false],"check":"boundary control 4","expected":[179,false],"passed":true},{"actual":[420,true],"check":"boundary control 5","expected":[420,true],"passed":true},{"actual":[240,true],"check":"normal control 6","expected":[240,true],"passed":true},{"actual":[0,false],"check":"normal control 7","expected":[0,false],"passed":true},{"actual":[3,false],"check":"normal control 8","expected":[3,false],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: previous evening window 1\", \"actual\": [240, true], \"expected\": [240, true], \"passed\": true}, {\"check\": \"regression variant: previous evening window 2\", \"actual\": [60, false], \"expected\": [60, false], \"passed\": true}, {\"check\": \"partial repair guard 3\", \"actual\": [360, true], \"expected\": [360, true], \"passed\": true}, {\"check\": \"boundary control 4\", \"actual\": [179, false], \"expected\": [179, false], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [420, true], \"expected\": [420, true], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [240, true], \"expected\": [240, true], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [0, false], \"expected\": [0, false], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [3, false], \"expected\": [3, false], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}