{"abstract":"A shift starting at 01:00 is credited night minutes from 23:00.","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":"Taking the earlier of the two starts overcounts the same way.","family":"w2-shift-rostering-labor-rules-night-work-minutes-intersection-start-clip","id":"FA-94026","implementations":{"attempt":{"sha256":"b0a9f18e7c821980c0d4b670488dc879b7f839105ceeba1053d10f8003399913","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) - min(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: intersection start clip 1', [[120, 480], 180], [240, True]),\n  ('regression variant: intersection start clip 2', [[3780, 4068], 120], [0, False]),\n  ('partial repair guard 3', [[1800, 2400], 180], [0, False]),\n  ('boundary control 4', [[1380, 1559], 180], [179, False]),\n  ('boundary control 5', [[1320, 1800], 180], [420, True]),\n  ('normal control 6', [[3960, 4560], 120], [300, True]),\n  ('normal control 7', [[20, 200], 240], [180, False]),\n  ('normal control 8', [[360, 1160], 120], [0, False])],\n [('regression: intersection start clip 1', [[1320, 1800], 180], [420, True]),\n  ('regression variant: intersection start clip 2', [[4200, 4380], 180], [120, False]),\n  ('partial repair guard 3', [[4680, 5400], 180], [0, False]),\n  ('boundary control 4', [[1800, 2400], 180], [0, False]),\n  ('boundary control 5', [[900, 1410], 180], [30, False]),\n  ('normal control 6', [[1010, 1040], 180], [0, False]),\n  ('normal control 7', [[4200, 4920], 120], [420, True]),\n  ('normal control 8', [[5880, 6360], 120], [240, True])],\n [('regression: intersection start clip 1', [[1380, 1560], 180], [180, True]),\n  ('regression variant: intersection start clip 2', [[4200, 4230], 120], [0, False]),\n  ('partial repair guard 3', [[1560, 2040], 120], [240, True]),\n  ('boundary control 4', [[120, 480], 180], [240, True]),\n  ('normal control 5', [[360, 1222], 180], [0, False]), ('normal control 6', [[3240, 3540], 120], [0, False]),\n  ('normal control 7', [[4680, 4710], 180], [0, False]),\n  ('normal control 8', [[2700, 3055], 180], [235, True])],\n [('regression: intersection start clip 1', [[1380, 1559], 180], [179, False]),\n  ('regression variant: intersection start clip 2', [[8051, 8771], 180], [191, True]),\n  ('partial repair guard 3', [[3000, 3600], 240], [240, True]),\n  ('boundary control 4', [[2940, 3300], 240], [300, True]),\n  ('normal control 5', [[3780, 4380], 180], [120, False]),\n  ('normal control 6', [[3960, 4140], 240], [0, False]), ('normal control 7', [[414, 594], 240], [0, False]),\n  ('normal control 8', [[3808, 3838], 240], [0, False])],\n [('regression: intersection start clip 1', [[900, 1410], 180], [30, False]),\n  ('regression variant: intersection start clip 2', [[1400, 2000], 120], [400, True]),\n  ('partial repair guard 3', [[2840, 3020], 240], [180, False]),\n  ('boundary control 4', [[1320, 1800], 180], [420, True]),\n  ('boundary control 5', [[1800, 2400], 180], [0, False]),\n  ('normal control 6', [[4740, 4980], 180], [0, False]),\n  ('normal control 7', [[1260, 2159], 240], [420, True]),\n  ('normal control 8', [[7320, 8040], 180], [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":"05aa144924f8dd0f0b45d6975390b71cb7202883240864e4b8eea93a0383b76d","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) - 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: intersection start clip 1', [[120, 480], 180], [240, True]),\n  ('regression variant: intersection start clip 2', [[3780, 4068], 120], [0, False]),\n  ('partial repair guard 3', [[1800, 2400], 180], [0, False]),\n  ('boundary control 4', [[1380, 1559], 180], [179, False]),\n  ('boundary control 5', [[1320, 1800], 180], [420, True]),\n  ('normal control 6', [[3960, 4560], 120], [300, True]),\n  ('normal control 7', [[20, 200], 240], [180, False]),\n  ('normal control 8', [[360, 1160], 120], [0, False])],\n [('regression: intersection start clip 1', [[1320, 1800], 180], [420, True]),\n  ('regression variant: intersection start clip 2', [[4200, 4380], 180], [120, False]),\n  ('partial repair guard 3', [[4680, 5400], 180], [0, False]),\n  ('boundary control 4', [[1800, 2400], 180], [0, False]),\n  ('boundary control 5', [[900, 1410], 180], [30, False]),\n  ('normal control 6', [[1010, 1040], 180], [0, False]),\n  ('normal control 7', [[4200, 4920], 120], [420, True]),\n  ('normal control 8', [[5880, 6360], 120], [240, True])],\n [('regression: intersection start clip 1', [[1380, 1560], 180], [180, True]),\n  ('regression variant: intersection start clip 2', [[4200, 4230], 120], [0, False]),\n  ('partial repair guard 3', [[1560, 2040], 120], [240, True]),\n  ('boundary control 4', [[120, 480], 180], [240, True]),\n  ('normal control 5', [[360, 1222], 180], [0, False]), ('normal control 6', [[3240, 3540], 120], [0, False]),\n  ('normal control 7', [[4680, 4710], 180], [0, False]),\n  ('normal control 8', [[2700, 3055], 180], [235, True])],\n [('regression: intersection start clip 1', [[1380, 1559], 180], [179, False]),\n  ('regression variant: intersection start clip 2', [[8051, 8771], 180], [191, True]),\n  ('partial repair guard 3', [[3000, 3600], 240], [240, True]),\n  ('boundary control 4', [[2940, 3300], 240], [300, True]),\n  ('normal control 5', [[3780, 4380], 180], [120, False]),\n  ('normal control 6', [[3960, 4140], 240], [0, False]), ('normal control 7', [[414, 594], 240], [0, False]),\n  ('normal control 8', [[3808, 3838], 240], [0, False])],\n [('regression: intersection start clip 1', [[900, 1410], 180], [30, False]),\n  ('regression variant: intersection start clip 2', [[1400, 2000], 120], [400, True]),\n  ('partial repair guard 3', [[2840, 3020], 240], [180, False]),\n  ('boundary control 4', [[1320, 1800], 180], [420, True]),\n  ('boundary control 5', [[1800, 2400], 180], [0, False]),\n  ('normal control 6', [[4740, 4980], 180], [0, False]),\n  ('normal control 7', [[1260, 2159], 240], [420, True]),\n  ('normal control 8', [[7320, 8040], 180], [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"},"fixed":{"sha256":"4166933d680e631201cc455bddeef1f8795e981b29207aae5e6ce01d37ea1004","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: intersection start clip 1', [[120, 480], 180], [240, True]),\n  ('regression variant: intersection start clip 2', [[3780, 4068], 120], [0, False]),\n  ('partial repair guard 3', [[1800, 2400], 180], [0, False]),\n  ('boundary control 4', [[1380, 1559], 180], [179, False]),\n  ('boundary control 5', [[1320, 1800], 180], [420, True]),\n  ('normal control 6', [[3960, 4560], 120], [300, True]),\n  ('normal control 7', [[20, 200], 240], [180, False]),\n  ('normal control 8', [[360, 1160], 120], [0, False])],\n [('regression: intersection start clip 1', [[1320, 1800], 180], [420, True]),\n  ('regression variant: intersection start clip 2', [[4200, 4380], 180], [120, False]),\n  ('partial repair guard 3', [[4680, 5400], 180], [0, False]),\n  ('boundary control 4', [[1800, 2400], 180], [0, False]),\n  ('boundary control 5', [[900, 1410], 180], [30, False]),\n  ('normal control 6', [[1010, 1040], 180], [0, False]),\n  ('normal control 7', [[4200, 4920], 120], [420, True]),\n  ('normal control 8', [[5880, 6360], 120], [240, True])],\n [('regression: intersection start clip 1', [[1380, 1560], 180], [180, True]),\n  ('regression variant: intersection start clip 2', [[4200, 4230], 120], [0, False]),\n  ('partial repair guard 3', [[1560, 2040], 120], [240, True]),\n  ('boundary control 4', [[120, 480], 180], [240, True]),\n  ('normal control 5', [[360, 1222], 180], [0, False]), ('normal control 6', [[3240, 3540], 120], [0, False]),\n  ('normal control 7', [[4680, 4710], 180], [0, False]),\n  ('normal control 8', [[2700, 3055], 180], [235, True])],\n [('regression: intersection start clip 1', [[1380, 1559], 180], [179, False]),\n  ('regression variant: intersection start clip 2', [[8051, 8771], 180], [191, True]),\n  ('partial repair guard 3', [[3000, 3600], 240], [240, True]),\n  ('boundary control 4', [[2940, 3300], 240], [300, True]),\n  ('normal control 5', [[3780, 4380], 180], [120, False]),\n  ('normal control 6', [[3960, 4140], 240], [0, False]), ('normal control 7', [[414, 594], 240], [0, False]),\n  ('normal control 8', [[3808, 3838], 240], [0, False])],\n [('regression: intersection start clip 1', [[900, 1410], 180], [30, False]),\n  ('regression variant: intersection start clip 2', [[1400, 2000], 120], [400, True]),\n  ('partial repair guard 3', [[2840, 3020], 240], [180, False]),\n  ('boundary control 4', [[1320, 1800], 180], [420, True]),\n  ('boundary control 5', [[1800, 2400], 180], [0, False]),\n  ('normal control 6', [[4740, 4980], 180], [0, False]),\n  ('normal control 7', [[1260, 2159], 240], [420, True]),\n  ('normal control 8', [[7320, 8040], 180], [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-intersection-start-clip","generated_at":"2026-09-29T14:52:00.632911+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":"Intersection starts at the later of shift start and window start.","root_cause":"The intersection start ignores the shift start.","sha256":"b84a917c426633094f518e6ff19af81671bd26232a3bdbe4210c2fccc8cbea02","title":"Night overlap counted from window start even when the shift starts later · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.988,"exit_code":1,"observations":[{"actual":[780,true],"check":"regression: intersection start clip 1","expected":[240,true],"passed":false},{"actual":[708,true],"check":"regression variant: intersection start clip 2","expected":[0,false],"passed":false},{"actual":[1020,true],"check":"partial repair guard 3","expected":[0,false],"passed":false},{"actual":[778,true],"check":"boundary control 4","expected":[179,false],"passed":false},{"actual":[1380,true],"check":"boundary control 5","expected":[420,true],"passed":false},{"actual":[1620,true],"check":"normal control 6","expected":[300,true],"passed":false},{"actual":[440,true],"check":"normal control 7","expected":[180,false],"passed":false},{"actual":[1220,true],"check":"normal control 8","expected":[0,false],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: intersection start clip 1\", \"actual\": [780, true], \"expected\": [240, true], \"passed\": false}, {\"check\": \"regression variant: intersection start clip 2\", \"actual\": [708, true], \"expected\": [0, false], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [1020, true], \"expected\": [0, false], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [778, true], \"expected\": [179, false], \"passed\": false}, {\"check\": \"boundary control 5\", \"actual\": [1380, true], \"expected\": [420, true], \"passed\": false}, {\"check\": \"normal control 6\", \"actual\": [1620, true], \"expected\": [300, true], \"passed\": false}, {\"check\": \"normal control 7\", \"actual\": [440, true], \"expected\": [180, false], \"passed\": false}, {\"check\": \"normal control 8\", \"actual\": [1220, true], \"expected\": [0, false], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.003,"exit_code":1,"observations":[{"actual":[420,true],"check":"regression: intersection start clip 1","expected":[240,true],"passed":false},{"actual":[420,true],"check":"regression variant: intersection start clip 2","expected":[0,false],"passed":false},{"actual":[420,true],"check":"partial repair guard 3","expected":[0,false],"passed":false},{"actual":[599,true],"check":"boundary control 4","expected":[179,false],"passed":false},{"actual":[840,true],"check":"boundary control 5","expected":[420,true],"passed":false},{"actual":[720,true],"check":"normal control 6","expected":[300,true],"passed":false},{"actual":[260,true],"check":"normal control 7","expected":[180,false],"passed":false},{"actual":[420,true],"check":"normal control 8","expected":[0,false],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: intersection start clip 1\", \"actual\": [420, true], \"expected\": [240, true], \"passed\": false}, {\"check\": \"regression variant: intersection start clip 2\", \"actual\": [420, true], \"expected\": [0, false], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [420, true], \"expected\": [0, false], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [599, true], \"expected\": [179, false], \"passed\": false}, {\"check\": \"boundary control 5\", \"actual\": [840, true], \"expected\": [420, true], \"passed\": false}, {\"check\": \"normal control 6\", \"actual\": [720, true], \"expected\": [300, true], \"passed\": false}, {\"check\": \"normal control 7\", \"actual\": [260, true], \"expected\": [180, false], \"passed\": false}, {\"check\": \"normal control 8\", \"actual\": [420, true], \"expected\": [0, false], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.4,"exit_code":0,"observations":[{"actual":[240,true],"check":"regression: intersection start clip 1","expected":[240,true],"passed":true},{"actual":[0,false],"check":"regression variant: intersection start clip 2","expected":[0,false],"passed":true},{"actual":[0,false],"check":"partial repair guard 3","expected":[0,false],"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":[300,true],"check":"normal control 6","expected":[300,true],"passed":true},{"actual":[180,false],"check":"normal control 7","expected":[180,false],"passed":true},{"actual":[0,false],"check":"normal control 8","expected":[0,false],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: intersection start clip 1\", \"actual\": [240, true], \"expected\": [240, true], \"passed\": true}, {\"check\": \"regression variant: intersection start clip 2\", \"actual\": [0, false], \"expected\": [0, false], \"passed\": true}, {\"check\": \"partial repair guard 3\", \"actual\": [0, false], \"expected\": [0, false], \"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\": [300, true], \"expected\": [300, true], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [180, false], \"expected\": [180, false], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [0, false], \"expected\": [0, false], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}