{"abstract":"A Friday night shift running into Saturday gets no weekend premium, and a Sunday night shift is paid weekend rates into Monday.","category":"Shift rostering labor rules","checks":8,"contract":"Shift [start, end] in minutes from Monday 00:00 and a base rate in cents per hour. Each minute earns base * (100 + pct) / 6000 cents where pct is 10 for 15:00-23:00, 15 for 23:00-07:00, else 0; on Saturday and Sunday (days 5 and 6) pct is the larger of that value and 12 (differentials do not stack). The exact total is rounded half up to a cent once.","evaluation_group":"w2-shift-rostering-labor-rules-shift-differential-pay","failed_approach":"Using the shift end day just moves the error to the other side of midnight.","family":"w2-shift-rostering-labor-rules-shift-differential-pay-weekend-by-shift-start","id":"FA-94056","implementations":{"attempt":{"sha256":"0ee42dd82af0066e597de510ac3fdd32ac69e7e6d7a9ef397e1a7e3cf611066a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(shift, base):\n    s, e = shift\n    total = 0\n    for t in range(s, e):\n        day = (e // 1440) % 7\n        m = t % 1440\n        pct = 0\n        if 900 <= m < 1380:\n            pct = 10\n        if m >= 1380 or m < 420:\n            pct = 15\n        if day >= 5:\n            pct = max(pct, 12)\n        total += base * (100 + pct)\n    return (total + 3000) // 6000\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: weekend by shift start 1', [[7080, 7680], 90], 1028),\n  ('regression variant: weekend by shift start 2', [[7080, 7800], 60], 820),\n  ('partial repair guard 3', [[9600, 10320], 1999], 27166),\n  ('boundary control 4', [[8580, 8700], 2000], 4600), ('boundary control 5', [[900, 960], 1800], 1980),\n  ('normal control 6', [[2400, 2880], 60], 531), ('normal control 7', [[4200, 4680], 60], 549),\n  ('normal control 8', [[1860, 2340], 1999], 15992)],\n [('regression: weekend by shift start 1', [[7140, 7860], 1999], 27346),\n  ('regression variant: weekend by shift start 2', [[10020, 10740], 60], 792),\n  ('partial repair guard 3', [[9480, 10200], 60], 812), ('boundary control 4', [[0, 3], 10], 1),\n  ('boundary control 5', [[8580, 8700], 2000], 4600), ('normal control 6', [[1380, 2100], 60], 792),\n  ('normal control 7', [[1860, 2580], 2000], 24800), ('normal control 8', [[1800, 2280], 2000], 16300)],\n [('regression: weekend by shift start 1', [[10020, 10740], 2150], 28380),\n  ('partial repair guard 2', [[6660, 7380], 2150], 28810),\n  ('boundary control 3', [[6600, 7260], 2000], 24200), ('boundary control 4', [[0, 3], 10], 1),\n  ('normal control 5', [[360, 600], 60], 249), ('normal control 6', [[3240, 3300], 60], 69),\n  ('normal control 7', [[9600, 10200], 2000], 22580), ('normal control 8', [[0, 720], 60], 783)],\n [('regression: weekend by shift start 1', [[7140, 7740], 90], 1030),\n  ('regression variant: weekend by shift start 2', [[7116, 7716], 1999], 22853),\n  ('partial repair guard 3', [[9540, 10140], 1800], 20268), ('boundary control 4', [[1320, 1500], 60], 204),\n  ('boundary control 5', [[6600, 7260], 2000], 24200), ('normal control 6', [[360, 840], 90], 734),\n  ('normal control 7', [[360, 420], 90], 104), ('normal control 8', [[4740, 5460], 2000], 24800)],\n [('regression: weekend by shift start 1', [[7140, 7860], 1800], 24624),\n  ('regression variant: weekend by shift start 2', [[10020, 10740], 90], 1188),\n  ('partial repair guard 3', [[7080, 7800], 60], 820), ('boundary control 4', [[480, 960], 1999], 16192),\n  ('boundary control 5', [[1320, 1500], 60], 204), ('normal control 6', [[7140, 7740], 90], 1030),\n  ('normal control 7', [[9600, 9660], 2000], 2240), ('normal control 8', [[10020, 10058], 2150], 1566)]]\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":"c02602e3e5831f76f01dc4c25e14d0539c269b3fc279d912ba3e64c4d23e3115","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(shift, base):\n    s, e = shift\n    total = 0\n    for t in range(s, e):\n        day = (s // 1440) % 7\n        m = t % 1440\n        pct = 0\n        if 900 <= m < 1380:\n            pct = 10\n        if m >= 1380 or m < 420:\n            pct = 15\n        if day >= 5:\n            pct = max(pct, 12)\n        total += base * (100 + pct)\n    return (total + 3000) // 6000\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: weekend by shift start 1', [[7080, 7680], 90], 1028),\n  ('regression variant: weekend by shift start 2', [[7080, 7800], 60], 820),\n  ('partial repair guard 3', [[9600, 10320], 1999], 27166),\n  ('boundary control 4', [[8580, 8700], 2000], 4600), ('boundary control 5', [[900, 960], 1800], 1980),\n  ('normal control 6', [[2400, 2880], 60], 531), ('normal control 7', [[4200, 4680], 60], 549),\n  ('normal control 8', [[1860, 2340], 1999], 15992)],\n [('regression: weekend by shift start 1', [[7140, 7860], 1999], 27346),\n  ('regression variant: weekend by shift start 2', [[10020, 10740], 60], 792),\n  ('partial repair guard 3', [[9480, 10200], 60], 812), ('boundary control 4', [[0, 3], 10], 1),\n  ('boundary control 5', [[8580, 8700], 2000], 4600), ('normal control 6', [[1380, 2100], 60], 792),\n  ('normal control 7', [[1860, 2580], 2000], 24800), ('normal control 8', [[1800, 2280], 2000], 16300)],\n [('regression: weekend by shift start 1', [[10020, 10740], 2150], 28380),\n  ('partial repair guard 2', [[6660, 7380], 2150], 28810),\n  ('boundary control 3', [[6600, 7260], 2000], 24200), ('boundary control 4', [[0, 3], 10], 1),\n  ('normal control 5', [[360, 600], 60], 249), ('normal control 6', [[3240, 3300], 60], 69),\n  ('normal control 7', [[9600, 10200], 2000], 22580), ('normal control 8', [[0, 720], 60], 783)],\n [('regression: weekend by shift start 1', [[7140, 7740], 90], 1030),\n  ('regression variant: weekend by shift start 2', [[7116, 7716], 1999], 22853),\n  ('partial repair guard 3', [[9540, 10140], 1800], 20268), ('boundary control 4', [[1320, 1500], 60], 204),\n  ('boundary control 5', [[6600, 7260], 2000], 24200), ('normal control 6', [[360, 840], 90], 734),\n  ('normal control 7', [[360, 420], 90], 104), ('normal control 8', [[4740, 5460], 2000], 24800)],\n [('regression: weekend by shift start 1', [[7140, 7860], 1800], 24624),\n  ('regression variant: weekend by shift start 2', [[10020, 10740], 90], 1188),\n  ('partial repair guard 3', [[7080, 7800], 60], 820), ('boundary control 4', [[480, 960], 1999], 16192),\n  ('boundary control 5', [[1320, 1500], 60], 204), ('normal control 6', [[7140, 7740], 90], 1030),\n  ('normal control 7', [[9600, 9660], 2000], 2240), ('normal control 8', [[10020, 10058], 2150], 1566)]]\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":"050a6f1922f3f88b226400f3f04fdd3273987c8c9e78be154f2e12cbc568c26d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(shift, base):\n    s, e = shift\n    total = 0\n    for t in range(s, e):\n        day = (t // 1440) % 7\n        m = t % 1440\n        pct = 0\n        if 900 <= m < 1380:\n            pct = 10\n        if m >= 1380 or m < 420:\n            pct = 15\n        if day >= 5:\n            pct = max(pct, 12)\n        total += base * (100 + pct)\n    return (total + 3000) // 6000\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: weekend by shift start 1', [[7080, 7680], 90], 1028),\n  ('regression variant: weekend by shift start 2', [[7080, 7800], 60], 820),\n  ('partial repair guard 3', [[9600, 10320], 1999], 27166),\n  ('boundary control 4', [[8580, 8700], 2000], 4600), ('boundary control 5', [[900, 960], 1800], 1980),\n  ('normal control 6', [[2400, 2880], 60], 531), ('normal control 7', [[4200, 4680], 60], 549),\n  ('normal control 8', [[1860, 2340], 1999], 15992)],\n [('regression: weekend by shift start 1', [[7140, 7860], 1999], 27346),\n  ('regression variant: weekend by shift start 2', [[10020, 10740], 60], 792),\n  ('partial repair guard 3', [[9480, 10200], 60], 812), ('boundary control 4', [[0, 3], 10], 1),\n  ('boundary control 5', [[8580, 8700], 2000], 4600), ('normal control 6', [[1380, 2100], 60], 792),\n  ('normal control 7', [[1860, 2580], 2000], 24800), ('normal control 8', [[1800, 2280], 2000], 16300)],\n [('regression: weekend by shift start 1', [[10020, 10740], 2150], 28380),\n  ('partial repair guard 2', [[6660, 7380], 2150], 28810),\n  ('boundary control 3', [[6600, 7260], 2000], 24200), ('boundary control 4', [[0, 3], 10], 1),\n  ('normal control 5', [[360, 600], 60], 249), ('normal control 6', [[3240, 3300], 60], 69),\n  ('normal control 7', [[9600, 10200], 2000], 22580), ('normal control 8', [[0, 720], 60], 783)],\n [('regression: weekend by shift start 1', [[7140, 7740], 90], 1030),\n  ('regression variant: weekend by shift start 2', [[7116, 7716], 1999], 22853),\n  ('partial repair guard 3', [[9540, 10140], 1800], 20268), ('boundary control 4', [[1320, 1500], 60], 204),\n  ('boundary control 5', [[6600, 7260], 2000], 24200), ('normal control 6', [[360, 840], 90], 734),\n  ('normal control 7', [[360, 420], 90], 104), ('normal control 8', [[4740, 5460], 2000], 24800)],\n [('regression: weekend by shift start 1', [[7140, 7860], 1800], 24624),\n  ('regression variant: weekend by shift start 2', [[10020, 10740], 90], 1188),\n  ('partial repair guard 3', [[7080, 7800], 60], 820), ('boundary control 4', [[480, 960], 1999], 16192),\n  ('boundary control 5', [[1320, 1500], 60], 204), ('normal control 6', [[7140, 7740], 90], 1030),\n  ('normal control 7', [[9600, 9660], 2000], 2240), ('normal control 8', [[10020, 10058], 2150], 1566)]]\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-shift-differential-pay-weekend-by-shift-start","generated_at":"2026-09-29T14:52:00.754074+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Shift differential calculations are where roster data meets payroll; stacking and day attribution errors are common.","repair":"Determine the weekday of each minute worked.","root_cause":"The weekend check uses the day of the shift start for every minute.","sha256":"5fe7015cc47ea6bf7e8043532ec8685153f4d250cd713fd46dfdeec97a89bb11","title":"Weekend premium attributed by shift start day · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.322,"exit_code":1,"observations":[{"actual":1030,"check":"regression: weekend by shift start 1","expected":1028,"passed":false},{"actual":821,"check":"regression variant: weekend by shift start 2","expected":820,"passed":false},{"actual":26887,"check":"partial repair guard 3","expected":27166,"passed":false},{"actual":4600,"check":"boundary control 4","expected":4600,"passed":true},{"actual":1980,"check":"boundary control 5","expected":1980,"passed":true},{"actual":531,"check":"normal control 6","expected":531,"passed":true},{"actual":549,"check":"normal control 7","expected":549,"passed":true},{"actual":15992,"check":"normal control 8","expected":15992,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: weekend by shift start 1\", \"actual\": 1030, \"expected\": 1028, \"passed\": false}, {\"check\": \"regression variant: weekend by shift start 2\", \"actual\": 821, \"expected\": 820, \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": 26887, \"expected\": 27166, \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": 4600, \"expected\": 4600, \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": 1980, \"expected\": 1980, \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": 531, \"expected\": 531, \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": 549, \"expected\": 549, \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": 15992, \"expected\": 15992, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.448,"exit_code":1,"observations":[{"actual":1017,"check":"regression: weekend by shift start 1","expected":1028,"passed":false},{"actual":798,"check":"regression variant: weekend by shift start 2","expected":820,"passed":false},{"actual":27166,"check":"partial repair guard 3","expected":27166,"passed":true},{"actual":4600,"check":"boundary control 4","expected":4600,"passed":true},{"actual":1980,"check":"boundary control 5","expected":1980,"passed":true},{"actual":531,"check":"normal control 6","expected":531,"passed":true},{"actual":549,"check":"normal control 7","expected":549,"passed":true},{"actual":15992,"check":"normal control 8","expected":15992,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: weekend by shift start 1\", \"actual\": 1017, \"expected\": 1028, \"passed\": false}, {\"check\": \"regression variant: weekend by shift start 2\", \"actual\": 798, \"expected\": 820, \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": 27166, \"expected\": 27166, \"passed\": true}, {\"check\": \"boundary control 4\", \"actual\": 4600, \"expected\": 4600, \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": 1980, \"expected\": 1980, \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": 531, \"expected\": 531, \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": 549, \"expected\": 549, \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": 15992, \"expected\": 15992, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.953,"exit_code":0,"observations":[{"actual":1028,"check":"regression: weekend by shift start 1","expected":1028,"passed":true},{"actual":820,"check":"regression variant: weekend by shift start 2","expected":820,"passed":true},{"actual":27166,"check":"partial repair guard 3","expected":27166,"passed":true},{"actual":4600,"check":"boundary control 4","expected":4600,"passed":true},{"actual":1980,"check":"boundary control 5","expected":1980,"passed":true},{"actual":531,"check":"normal control 6","expected":531,"passed":true},{"actual":549,"check":"normal control 7","expected":549,"passed":true},{"actual":15992,"check":"normal control 8","expected":15992,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: weekend by shift start 1\", \"actual\": 1028, \"expected\": 1028, \"passed\": true}, {\"check\": \"regression variant: weekend by shift start 2\", \"actual\": 820, \"expected\": 820, \"passed\": true}, {\"check\": \"partial repair guard 3\", \"actual\": 27166, \"expected\": 27166, \"passed\": true}, {\"check\": \"boundary control 4\", \"actual\": 4600, \"expected\": 4600, \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": 1980, \"expected\": 1980, \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": 531, \"expected\": 531, \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": 549, \"expected\": 549, \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": 15992, \"expected\": 15992, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}