{"abstract":"Only 23:00-24:00 counts as night; early morning hours are lost.","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":"Wrapping 06:00 as a clock time produces an end before the start, so no night minutes count.","family":"w2-shift-rostering-labor-rules-night-work-minutes-window-clamped-at-midnight","id":"FA-94021","implementations":{"attempt":{"sha256":"52498d019b8c9ca4dff586d80a14369df3aae7e6873a019a903be246536afff4","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) % 1440\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: window clamped at midnight 1', [[120, 480], 180], [240, True]),\n  ('regression variant: window clamped at midnight 2', [[1560, 2040], 120], [240, True]),\n  ('partial repair guard 3', [[8580, 8820], 180], [240, True]),\n  ('boundary control 4', [[1380, 1559], 180], [179, False]),\n  ('boundary control 5', [[1320, 1800], 180], [420, True]),\n  ('normal control 6', [[5880, 6600], 240], [240, True]),\n  ('normal control 7', [[6120, 6600], 180], [0, False]),\n  ('normal control 8', [[5580, 6300], 120], [420, True])],\n [('regression: window clamped at midnight 1', [[1320, 1800], 180], [420, True]),\n  ('regression variant: window clamped at midnight 2', [[7200, 7920], 240], [360, True]),\n  ('partial repair guard 3', [[4200, 4380], 180], [120, False]),\n  ('boundary control 4', [[1800, 2400], 180], [0, False]),\n  ('boundary control 5', [[900, 1410], 180], [30, False]),\n  ('normal control 6', [[1800, 2400], 240], [0, False]),\n  ('normal control 7', [[4280, 5141], 120], [400, True]),\n  ('normal control 8', [[5760, 6000], 120], [240, True])],\n [('regression: window clamped at midnight 1', [[1380, 1560], 180], [180, True]),\n  ('regression variant: window clamped at midnight 2', [[5880, 5910], 120], [30, False]),\n  ('partial repair guard 3', [[2840, 3020], 240], [180, False]),\n  ('boundary control 4', [[120, 480], 180], [240, True]),\n  ('normal control 5', [[4200, 4920], 180], [420, True]),\n  ('normal control 6', [[8600, 8710], 240], [110, False]),\n  ('normal control 7', [[1576, 2176], 120], [224, True]),\n  ('normal control 8', [[1500, 1560], 180], [60, False])],\n [('regression: window clamped at midnight 1', [[1380, 1559], 180], [179, False]),\n  ('regression variant: window clamped at midnight 2', [[6060, 6300], 180], [60, False]),\n  ('partial repair guard 3', [[8051, 8771], 180], [191, True]),\n  ('boundary control 4', [[2940, 3300], 240], [300, True]),\n  ('normal control 5', [[4200, 4920], 180], [420, True]),\n  ('normal control 6', [[1320, 1496], 180], [116, False]),\n  ('normal control 7', [[6660, 7369], 120], [229, True]),\n  ('normal control 8', [[3780, 4500], 120], [240, True])],\n [('regression: window clamped at midnight 1', [[2940, 3300], 240], [300, True]),\n  ('regression variant: window clamped at midnight 2', [[5820, 6000], 180], [180, True]),\n  ('partial repair guard 3', [[1783, 1813], 120], [17, False]),\n  ('boundary control 4', [[1320, 1800], 180], [420, True]),\n  ('boundary control 5', [[1800, 2400], 180], [0, False]),\n  ('normal control 6', [[1440, 2253], 180], [360, True]),\n  ('normal control 7', [[4200, 4230], 180], [0, False]),\n  ('normal control 8', [[4260, 4860], 240], [420, 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":"7d512e30f412836b31c7278f9f47c9058a7de2a2f3ee14b187f860ec11f0c993","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 + 1440\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: window clamped at midnight 1', [[120, 480], 180], [240, True]),\n  ('regression variant: window clamped at midnight 2', [[1560, 2040], 120], [240, True]),\n  ('partial repair guard 3', [[8580, 8820], 180], [240, True]),\n  ('boundary control 4', [[1380, 1559], 180], [179, False]),\n  ('boundary control 5', [[1320, 1800], 180], [420, True]),\n  ('normal control 6', [[5880, 6600], 240], [240, True]),\n  ('normal control 7', [[6120, 6600], 180], [0, False]),\n  ('normal control 8', [[5580, 6300], 120], [420, True])],\n [('regression: window clamped at midnight 1', [[1320, 1800], 180], [420, True]),\n  ('regression variant: window clamped at midnight 2', [[7200, 7920], 240], [360, True]),\n  ('partial repair guard 3', [[4200, 4380], 180], [120, False]),\n  ('boundary control 4', [[1800, 2400], 180], [0, False]),\n  ('boundary control 5', [[900, 1410], 180], [30, False]),\n  ('normal control 6', [[1800, 2400], 240], [0, False]),\n  ('normal control 7', [[4280, 5141], 120], [400, True]),\n  ('normal control 8', [[5760, 6000], 120], [240, True])],\n [('regression: window clamped at midnight 1', [[1380, 1560], 180], [180, True]),\n  ('regression variant: window clamped at midnight 2', [[5880, 5910], 120], [30, False]),\n  ('partial repair guard 3', [[2840, 3020], 240], [180, False]),\n  ('boundary control 4', [[120, 480], 180], [240, True]),\n  ('normal control 5', [[4200, 4920], 180], [420, True]),\n  ('normal control 6', [[8600, 8710], 240], [110, False]),\n  ('normal control 7', [[1576, 2176], 120], [224, True]),\n  ('normal control 8', [[1500, 1560], 180], [60, False])],\n [('regression: window clamped at midnight 1', [[1380, 1559], 180], [179, False]),\n  ('regression variant: window clamped at midnight 2', [[6060, 6300], 180], [60, False]),\n  ('partial repair guard 3', [[8051, 8771], 180], [191, True]),\n  ('boundary control 4', [[2940, 3300], 240], [300, True]),\n  ('normal control 5', [[4200, 4920], 180], [420, True]),\n  ('normal control 6', [[1320, 1496], 180], [116, False]),\n  ('normal control 7', [[6660, 7369], 120], [229, True]),\n  ('normal control 8', [[3780, 4500], 120], [240, True])],\n [('regression: window clamped at midnight 1', [[2940, 3300], 240], [300, True]),\n  ('regression variant: window clamped at midnight 2', [[5820, 6000], 180], [180, True]),\n  ('partial repair guard 3', [[1783, 1813], 120], [17, False]),\n  ('boundary control 4', [[1320, 1800], 180], [420, True]),\n  ('boundary control 5', [[1800, 2400], 180], [0, False]),\n  ('normal control 6', [[1440, 2253], 180], [360, True]),\n  ('normal control 7', [[4200, 4230], 180], [0, False]),\n  ('normal control 8', [[4260, 4860], 240], [420, 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"},"fixed":{"sha256":"52024a6344192edcd672fc623f2983ae5d3ab98edce8749b649561f02f46e28c","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: window clamped at midnight 1', [[120, 480], 180], [240, True]),\n  ('regression variant: window clamped at midnight 2', [[1560, 2040], 120], [240, True]),\n  ('partial repair guard 3', [[8580, 8820], 180], [240, True]),\n  ('boundary control 4', [[1380, 1559], 180], [179, False]),\n  ('boundary control 5', [[1320, 1800], 180], [420, True]),\n  ('normal control 6', [[5880, 6600], 240], [240, True]),\n  ('normal control 7', [[6120, 6600], 180], [0, False]),\n  ('normal control 8', [[5580, 6300], 120], [420, True])],\n [('regression: window clamped at midnight 1', [[1320, 1800], 180], [420, True]),\n  ('regression variant: window clamped at midnight 2', [[7200, 7920], 240], [360, True]),\n  ('partial repair guard 3', [[4200, 4380], 180], [120, False]),\n  ('boundary control 4', [[1800, 2400], 180], [0, False]),\n  ('boundary control 5', [[900, 1410], 180], [30, False]),\n  ('normal control 6', [[1800, 2400], 240], [0, False]),\n  ('normal control 7', [[4280, 5141], 120], [400, True]),\n  ('normal control 8', [[5760, 6000], 120], [240, True])],\n [('regression: window clamped at midnight 1', [[1380, 1560], 180], [180, True]),\n  ('regression variant: window clamped at midnight 2', [[5880, 5910], 120], [30, False]),\n  ('partial repair guard 3', [[2840, 3020], 240], [180, False]),\n  ('boundary control 4', [[120, 480], 180], [240, True]),\n  ('normal control 5', [[4200, 4920], 180], [420, True]),\n  ('normal control 6', [[8600, 8710], 240], [110, False]),\n  ('normal control 7', [[1576, 2176], 120], [224, True]),\n  ('normal control 8', [[1500, 1560], 180], [60, False])],\n [('regression: window clamped at midnight 1', [[1380, 1559], 180], [179, False]),\n  ('regression variant: window clamped at midnight 2', [[6060, 6300], 180], [60, False]),\n  ('partial repair guard 3', [[8051, 8771], 180], [191, True]),\n  ('boundary control 4', [[2940, 3300], 240], [300, True]),\n  ('normal control 5', [[4200, 4920], 180], [420, True]),\n  ('normal control 6', [[1320, 1496], 180], [116, False]),\n  ('normal control 7', [[6660, 7369], 120], [229, True]),\n  ('normal control 8', [[3780, 4500], 120], [240, True])],\n [('regression: window clamped at midnight 1', [[2940, 3300], 240], [300, True]),\n  ('regression variant: window clamped at midnight 2', [[5820, 6000], 180], [180, True]),\n  ('partial repair guard 3', [[1783, 1813], 120], [17, False]),\n  ('boundary control 4', [[1320, 1800], 180], [420, True]),\n  ('boundary control 5', [[1800, 2400], 180], [0, False]),\n  ('normal control 6', [[1440, 2253], 180], [360, True]),\n  ('normal control 7', [[4200, 4230], 180], [0, False]),\n  ('normal control 8', [[4260, 4860], 240], [420, 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-window-clamped-at-midnight","generated_at":"2026-09-29T14:52:00.634507+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":"The night window ends 1800 minutes after its day start.","root_cause":"The window end is set to midnight rather than 06:00 the next day.","sha256":"7b843dcd73480a00950918716a6176c012358401ae73582e0324e5f1b62c05a1","title":"Night period truncated at midnight · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.343,"exit_code":1,"observations":[{"actual":[240,true],"check":"regression: window clamped at midnight 1","expected":[240,true],"passed":true},{"actual":[0,false],"check":"regression variant: window clamped at midnight 2","expected":[240,true],"passed":false},{"actual":[0,false],"check":"partial repair guard 3","expected":[240,true],"passed":false},{"actual":[0,false],"check":"boundary control 4","expected":[179,false],"passed":false},{"actual":[0,false],"check":"boundary control 5","expected":[420,true],"passed":false},{"actual":[0,false],"check":"normal control 6","expected":[240,true],"passed":false},{"actual":[0,false],"check":"normal control 7","expected":[0,false],"passed":true},{"actual":[0,false],"check":"normal control 8","expected":[420,true],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: window clamped at midnight 1\", \"actual\": [240, true], \"expected\": [240, true], \"passed\": true}, {\"check\": \"regression variant: window clamped at midnight 2\", \"actual\": [0, false], \"expected\": [240, true], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [0, false], \"expected\": [240, true], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [0, false], \"expected\": [179, false], \"passed\": false}, {\"check\": \"boundary control 5\", \"actual\": [0, false], \"expected\": [420, true], \"passed\": false}, {\"check\": \"normal control 6\", \"actual\": [0, false], \"expected\": [240, true], \"passed\": false}, {\"check\": \"normal control 7\", \"actual\": [0, false], \"expected\": [0, false], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [0, false], \"expected\": [420, true], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.985,"exit_code":1,"observations":[{"actual":[0,false],"check":"regression: window clamped at midnight 1","expected":[240,true],"passed":false},{"actual":[0,false],"check":"regression variant: window clamped at midnight 2","expected":[240,true],"passed":false},{"actual":[60,false],"check":"partial repair guard 3","expected":[240,true],"passed":false},{"actual":[60,false],"check":"boundary control 4","expected":[179,false],"passed":false},{"actual":[60,false],"check":"boundary control 5","expected":[420,true],"passed":false},{"actual":[0,false],"check":"normal control 6","expected":[240,true],"passed":false},{"actual":[0,false],"check":"normal control 7","expected":[0,false],"passed":true},{"actual":[60,false],"check":"normal control 8","expected":[420,true],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: window clamped at midnight 1\", \"actual\": [0, false], \"expected\": [240, true], \"passed\": false}, {\"check\": \"regression variant: window clamped at midnight 2\", \"actual\": [0, false], \"expected\": [240, true], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [60, false], \"expected\": [240, true], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [60, false], \"expected\": [179, false], \"passed\": false}, {\"check\": \"boundary control 5\", \"actual\": [60, false], \"expected\": [420, true], \"passed\": false}, {\"check\": \"normal control 6\", \"actual\": [0, false], \"expected\": [240, true], \"passed\": false}, {\"check\": \"normal control 7\", \"actual\": [0, false], \"expected\": [0, false], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [60, false], \"expected\": [420, true], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.97,"exit_code":0,"observations":[{"actual":[240,true],"check":"regression: window clamped at midnight 1","expected":[240,true],"passed":true},{"actual":[240,true],"check":"regression variant: window clamped at midnight 2","expected":[240,true],"passed":true},{"actual":[240,true],"check":"partial repair guard 3","expected":[240,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":[420,true],"check":"normal control 8","expected":[420,true],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: window clamped at midnight 1\", \"actual\": [240, true], \"expected\": [240, true], \"passed\": true}, {\"check\": \"regression variant: window clamped at midnight 2\", \"actual\": [240, true], \"expected\": [240, true], \"passed\": true}, {\"check\": \"partial repair guard 3\", \"actual\": [240, true], \"expected\": [240, 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\": [420, true], \"expected\": [420, true], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}