{"abstract":"A shift with exactly three night hours is not treated as night work.","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":"Multiplying the minute threshold by 60 treats it as hours and almost nothing qualifies.","family":"w2-shift-rostering-labor-rules-night-work-minutes-night-shift-threshold","id":"FA-94031","implementations":{"attempt":{"sha256":"ff6d4b2cc047ac212e957d7eca49ccf194d72c76b6d696b58baf9ca9495242e8","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 * 60]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: night shift threshold 1', [[1380, 1560], 180], [180, True]),\n  ('regression variant: night shift threshold 2', [[3780, 4500], 240], [240, True]),\n  ('partial repair guard 3', [[2760, 3480], 240], [420, True]),\n  ('boundary control 4', [[1380, 1559], 180], [179, False]),\n  ('boundary control 5', [[1320, 1800], 180], [420, True]),\n  ('normal control 6', [[3000, 3030], 120], [30, False]),\n  ('normal control 7', [[3780, 4380], 120], [120, True]),\n  ('normal control 8', [[8520, 8700], 180], [120, False])],\n [('regression: night shift threshold 1', [[8600, 8780], 180], [180, True]),\n  ('regression variant: night shift threshold 2', [[2880, 3060], 180], [180, True]),\n  ('partial repair guard 3', [[1440, 2253], 180], [360, True]),\n  ('boundary control 4', [[1800, 2400], 180], [0, False]),\n  ('boundary control 5', [[900, 1410], 180], [30, False]),\n  ('normal control 6', [[360, 390], 180], [0, False]), ('normal control 7', [[7500, 8220], 120], [60, False]),\n  ('normal control 8', [[4200, 4230], 180], [0, False])],\n [('regression: night shift threshold 1', [[3000, 3600], 240], [240, True]),\n  ('partial repair guard 2', [[1320, 1911], 240], [420, True]),\n  ('boundary control 3', [[1380, 1560], 180], [180, True]),\n  ('boundary control 4', [[120, 480], 180], [240, True]),\n  ('normal control 5', [[2340, 2670], 240], [0, False]),\n  ('normal control 6', [[1260, 2159], 240], [420, True]),\n  ('normal control 7', [[4320, 4920], 240], [360, True]),\n  ('normal control 8', [[4200, 4230], 120], [0, False])],\n [('regression: night shift threshold 1', [[8600, 8840], 240], [240, True]),\n  ('regression variant: night shift threshold 2', [[900, 1620], 240], [240, True]),\n  ('partial repair guard 3', [[2820, 3540], 180], [420, True]),\n  ('boundary control 4', [[2940, 3300], 240], [300, True]),\n  ('boundary control 5', [[1380, 1559], 180], [179, False]),\n  ('normal control 6', [[6060, 6300], 240], [60, False]),\n  ('normal control 7', [[7020, 7260], 120], [120, True]),\n  ('normal control 8', [[4102, 4282], 180], [22, False])],\n [('regression: night shift threshold 1', [[5820, 6000], 180], [180, True]),\n  ('regression variant: night shift threshold 2', [[2700, 2940], 120], [120, True]),\n  ('boundary control 3', [[1320, 1800], 180], [420, True]),\n  ('boundary control 4', [[1800, 2400], 180], [0, False]),\n  ('normal control 5', [[6180, 6256], 240], [0, False]),\n  ('normal control 6', [[4200, 4230], 240], [0, False]),\n  ('normal control 7', [[2700, 2880], 120], [60, False]),\n  ('normal control 8', [[6060, 6300], 240], [60, 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":"494a2670c54f2ae6a0117f60be9d8bc3c288623bed96542e88eac85fc0e3f916","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: night shift threshold 1', [[1380, 1560], 180], [180, True]),\n  ('regression variant: night shift threshold 2', [[3780, 4500], 240], [240, True]),\n  ('partial repair guard 3', [[2760, 3480], 240], [420, True]),\n  ('boundary control 4', [[1380, 1559], 180], [179, False]),\n  ('boundary control 5', [[1320, 1800], 180], [420, True]),\n  ('normal control 6', [[3000, 3030], 120], [30, False]),\n  ('normal control 7', [[3780, 4380], 120], [120, True]),\n  ('normal control 8', [[8520, 8700], 180], [120, False])],\n [('regression: night shift threshold 1', [[8600, 8780], 180], [180, True]),\n  ('regression variant: night shift threshold 2', [[2880, 3060], 180], [180, True]),\n  ('partial repair guard 3', [[1440, 2253], 180], [360, True]),\n  ('boundary control 4', [[1800, 2400], 180], [0, False]),\n  ('boundary control 5', [[900, 1410], 180], [30, False]),\n  ('normal control 6', [[360, 390], 180], [0, False]), ('normal control 7', [[7500, 8220], 120], [60, False]),\n  ('normal control 8', [[4200, 4230], 180], [0, False])],\n [('regression: night shift threshold 1', [[3000, 3600], 240], [240, True]),\n  ('partial repair guard 2', [[1320, 1911], 240], [420, True]),\n  ('boundary control 3', [[1380, 1560], 180], [180, True]),\n  ('boundary control 4', [[120, 480], 180], [240, True]),\n  ('normal control 5', [[2340, 2670], 240], [0, False]),\n  ('normal control 6', [[1260, 2159], 240], [420, True]),\n  ('normal control 7', [[4320, 4920], 240], [360, True]),\n  ('normal control 8', [[4200, 4230], 120], [0, False])],\n [('regression: night shift threshold 1', [[8600, 8840], 240], [240, True]),\n  ('regression variant: night shift threshold 2', [[900, 1620], 240], [240, True]),\n  ('partial repair guard 3', [[2820, 3540], 180], [420, True]),\n  ('boundary control 4', [[2940, 3300], 240], [300, True]),\n  ('boundary control 5', [[1380, 1559], 180], [179, False]),\n  ('normal control 6', [[6060, 6300], 240], [60, False]),\n  ('normal control 7', [[7020, 7260], 120], [120, True]),\n  ('normal control 8', [[4102, 4282], 180], [22, False])],\n [('regression: night shift threshold 1', [[5820, 6000], 180], [180, True]),\n  ('regression variant: night shift threshold 2', [[2700, 2940], 120], [120, True]),\n  ('boundary control 3', [[1320, 1800], 180], [420, True]),\n  ('boundary control 4', [[1800, 2400], 180], [0, False]),\n  ('normal control 5', [[6180, 6256], 240], [0, False]),\n  ('normal control 6', [[4200, 4230], 240], [0, False]),\n  ('normal control 7', [[2700, 2880], 120], [60, False]),\n  ('normal control 8', [[6060, 6300], 240], [60, 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-night-shift-threshold","generated_at":"2026-09-29T14:52:00.632231+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 classification comparison is strict.","sha256":"cfbfdb35e27fe4721a4370580e5607f4694f9524640fd819dcd4a4d4ae431ae7","title":"Exactly-threshold night minutes not classified as a night shift · 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":37.501,"exit_code":1,"observations":[{"actual":[180,false],"check":"regression: night shift threshold 1","expected":[180,true],"passed":false},{"actual":[240,false],"check":"regression variant: night shift threshold 2","expected":[240,true],"passed":false},{"actual":[420,false],"check":"partial repair guard 3","expected":[420,true],"passed":false},{"actual":[179,false],"check":"boundary control 4","expected":[179,false],"passed":true},{"actual":[420,false],"check":"boundary control 5","expected":[420,true],"passed":false},{"actual":[30,false],"check":"normal control 6","expected":[30,false],"passed":true},{"actual":[120,false],"check":"normal control 7","expected":[120,true],"passed":false},{"actual":[120,false],"check":"normal control 8","expected":[120,false],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: night shift threshold 1\", \"actual\": [180, false], \"expected\": [180, true], \"passed\": false}, {\"check\": \"regression variant: night shift threshold 2\", \"actual\": [240, false], \"expected\": [240, true], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [420, false], \"expected\": [420, true], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [179, false], \"expected\": [179, false], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [420, false], \"expected\": [420, true], \"passed\": false}, {\"check\": \"normal control 6\", \"actual\": [30, false], \"expected\": [30, false], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [120, false], \"expected\": [120, true], \"passed\": false}, {\"check\": \"normal control 8\", \"actual\": [120, false], \"expected\": [120, false], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.048,"exit_code":1,"observations":[{"actual":[180,false],"check":"regression: night shift threshold 1","expected":[180,true],"passed":false},{"actual":[240,false],"check":"regression variant: night shift threshold 2","expected":[240,true],"passed":false},{"actual":[420,true],"check":"partial repair guard 3","expected":[420,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":[30,false],"check":"normal control 6","expected":[30,false],"passed":true},{"actual":[120,false],"check":"normal control 7","expected":[120,true],"passed":false},{"actual":[120,false],"check":"normal control 8","expected":[120,false],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: night shift threshold 1\", \"actual\": [180, false], \"expected\": [180, true], \"passed\": false}, {\"check\": \"regression variant: night shift threshold 2\", \"actual\": [240, false], \"expected\": [240, true], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [420, true], \"expected\": [420, 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\": [30, false], \"expected\": [30, false], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [120, false], \"expected\": [120, true], \"passed\": false}, {\"check\": \"normal control 8\", \"actual\": [120, false], \"expected\": [120, false], \"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."}}