{"abstract":"A shift ending at 23:30 loses its last 30 night minutes.","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].","contract_signature":"shift, threshold","evaluation_group":"w2-shift-rostering-labor-rules-night-work-minutes","failed_approach":"Bounding by the start day misses windows of multi-day shifts.","family":"w2-shift-rostering-labor-rules-night-work-minutes-final-day-window","id":"FA-94016","implementations":{"attempt":{"sha256":"cad85a89a87932551615b856dffd8b0fbd3fcacf6b3368ea64c3190082b4c46f","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 - 1) // 1440):\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: final day window 1', [[900, 1410], 180], [30, False]),\n  ('regression variant: final day window 2', [[2820, 2850], 180], [30, False]),\n  ('partial repair guard 3', [[4102, 4282], 180], [22, False]),\n  ('boundary control 4', [[1380, 1559], 180], [179, False]),\n  ('boundary control 5', [[1320, 1800], 180], [420, True]),\n  ('normal control 6', [[4260, 4740], 240], [420, True]),\n  ('normal control 7', [[3240, 3359], 120], [0, False]),\n  ('normal control 8', [[7020, 7260], 120], [120, True])],\n [('regression: final day window 1', [[2820, 2850], 120], [30, False]),\n  ('partial repair guard 2', [[5580, 5760], 240], [60, False]),\n  ('boundary control 3', [[1800, 2400], 180], [0, False]),\n  ('boundary control 4', [[900, 1410], 180], [30, False]),\n  ('normal control 5', [[4740, 5404], 240], [0, False]),\n  ('normal control 6', [[5760, 5940], 240], [180, False]),\n  ('normal control 7', [[4320, 4500], 120], [180, True]),\n  ('normal control 8', [[6060, 6780], 240], [60, False])],\n [('regression: final day window 1', [[8554, 8584], 120], [4, False]),\n  ('regression variant: final day window 2', [[2840, 2870], 240], [30, False]),\n  ('partial repair guard 3', [[5700, 5730], 120], [30, False]),\n  ('boundary control 4', [[1380, 1560], 180], [180, True]),\n  ('boundary control 5', [[120, 480], 180], [240, True]),\n  ('normal control 6', [[1440, 1620], 240], [180, False]),\n  ('normal control 7', [[1400, 2120], 180], [400, True]),\n  ('normal control 8', [[2880, 3060], 180], [180, True])],\n [('regression: final day window 1', [[4260, 4290], 120], [30, False]),\n  ('regression variant: final day window 2', [[1400, 1430], 180], [30, False]),\n  ('partial repair guard 3', [[900, 1410], 180], [30, False]),\n  ('boundary control 4', [[2940, 3300], 240], [300, True]),\n  ('boundary control 5', [[1380, 1559], 180], [179, False]),\n  ('normal control 6', [[1800, 2400], 240], [0, False]),\n  ('normal control 7', [[3960, 4560], 120], [300, True]),\n  ('normal control 8', [[4102, 4282], 180], [22, False])],\n [('regression: final day window 1', [[8580, 8610], 120], [30, False]),\n  ('regression variant: final day window 2', [[7160, 7190], 180], [30, False]),\n  ('boundary control 3', [[1320, 1800], 180], [420, True]),\n  ('boundary control 4', [[1800, 2400], 180], [0, False]),\n  ('normal control 5', [[1380, 1410], 180], [30, False]),\n  ('normal control 6', [[3240, 3511], 120], [0, False]), ('normal control 7', [[420, 900], 180], [0, False]),\n  ('normal control 8', [[4280, 4520], 240], [240, True])]]\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":"e3ffd6755a54b644ac5d15da1aa21a813195c8112bd61292063b29b99e70051f","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):\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: final day window 1', [[900, 1410], 180], [30, False]),\n  ('regression variant: final day window 2', [[2820, 2850], 180], [30, False]),\n  ('partial repair guard 3', [[4102, 4282], 180], [22, False]),\n  ('boundary control 4', [[1380, 1559], 180], [179, False]),\n  ('boundary control 5', [[1320, 1800], 180], [420, True]),\n  ('normal control 6', [[4260, 4740], 240], [420, True]),\n  ('normal control 7', [[3240, 3359], 120], [0, False]),\n  ('normal control 8', [[7020, 7260], 120], [120, True])],\n [('regression: final day window 1', [[2820, 2850], 120], [30, False]),\n  ('partial repair guard 2', [[5580, 5760], 240], [60, False]),\n  ('boundary control 3', [[1800, 2400], 180], [0, False]),\n  ('boundary control 4', [[900, 1410], 180], [30, False]),\n  ('normal control 5', [[4740, 5404], 240], [0, False]),\n  ('normal control 6', [[5760, 5940], 240], [180, False]),\n  ('normal control 7', [[4320, 4500], 120], [180, True]),\n  ('normal control 8', [[6060, 6780], 240], [60, False])],\n [('regression: final day window 1', [[8554, 8584], 120], [4, False]),\n  ('regression variant: final day window 2', [[2840, 2870], 240], [30, False]),\n  ('partial repair guard 3', [[5700, 5730], 120], [30, False]),\n  ('boundary control 4', [[1380, 1560], 180], [180, True]),\n  ('boundary control 5', [[120, 480], 180], [240, True]),\n  ('normal control 6', [[1440, 1620], 240], [180, False]),\n  ('normal control 7', [[1400, 2120], 180], [400, True]),\n  ('normal control 8', [[2880, 3060], 180], [180, True])],\n [('regression: final day window 1', [[4260, 4290], 120], [30, False]),\n  ('regression variant: final day window 2', [[1400, 1430], 180], [30, False]),\n  ('partial repair guard 3', [[900, 1410], 180], [30, False]),\n  ('boundary control 4', [[2940, 3300], 240], [300, True]),\n  ('boundary control 5', [[1380, 1559], 180], [179, False]),\n  ('normal control 6', [[1800, 2400], 240], [0, False]),\n  ('normal control 7', [[3960, 4560], 120], [300, True]),\n  ('normal control 8', [[4102, 4282], 180], [22, False])],\n [('regression: final day window 1', [[8580, 8610], 120], [30, False]),\n  ('regression variant: final day window 2', [[7160, 7190], 180], [30, False]),\n  ('boundary control 3', [[1320, 1800], 180], [420, True]),\n  ('boundary control 4', [[1800, 2400], 180], [0, False]),\n  ('normal control 5', [[1380, 1410], 180], [30, False]),\n  ('normal control 6', [[3240, 3511], 120], [0, False]), ('normal control 7', [[420, 900], 180], [0, False]),\n  ('normal control 8', [[4280, 4520], 240], [240, True])]]\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-final-day-window","generated_at":"2026-09-29T14:52:00.418556+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.","root_cause":"The night window that opens on the end day is not enumerated.","sha256":"0f762d0794b635026c81529f9e0470d49653e47d1976da1309b90a96ac9e2c4a","title":"Late-evening minutes on the shift end day are ignored · 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":40.108,"exit_code":1,"observations":[{"actual":[0,false],"check":"regression: final day window 1","expected":[30,false],"passed":false},{"actual":[0,false],"check":"regression variant: final day window 2","expected":[30,false],"passed":false},{"actual":[0,false],"check":"partial repair guard 3","expected":[22,false],"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":[420,true],"check":"normal control 6","expected":[420,true],"passed":true},{"actual":[0,false],"check":"normal control 7","expected":[0,false],"passed":true},{"actual":[120,true],"check":"normal control 8","expected":[120,true],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: final day window 1\", \"actual\": [0, false], \"expected\": [30, false], \"passed\": false}, {\"check\": \"regression variant: final day window 2\", \"actual\": [0, false], \"expected\": [30, false], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [0, false], \"expected\": [22, false], \"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\": [420, true], \"expected\": [420, true], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [0, false], \"expected\": [0, false], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [120, true], \"expected\": [120, true], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.435,"exit_code":1,"observations":[{"actual":[0,false],"check":"regression: final day window 1","expected":[30,false],"passed":false},{"actual":[0,false],"check":"regression variant: final day window 2","expected":[30,false],"passed":false},{"actual":[0,false],"check":"partial repair guard 3","expected":[22,false],"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":[420,true],"check":"normal control 6","expected":[420,true],"passed":true},{"actual":[0,false],"check":"normal control 7","expected":[0,false],"passed":true},{"actual":[120,true],"check":"normal control 8","expected":[120,true],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: final day window 1\", \"actual\": [0, false], \"expected\": [30, false], \"passed\": false}, {\"check\": \"regression variant: final day window 2\", \"actual\": [0, false], \"expected\": [30, false], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [0, false], \"expected\": [22, false], \"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\": [420, true], \"expected\": [420, true], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [0, false], \"expected\": [0, false], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [120, true], \"expected\": [120, 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."}}