{"abstract":"A worker with meals but no rest breaks is reported as having rests.","category":"Shift rostering labor rules","checks":8,"contract":"Shift [start, end] and breaks [start, end, kind]. Meals required: one if the shift exceeds 300 minutes, two if it exceeds 600. A meal counts if it lasts at least 30 minutes and lies inside the shift; the k-th counted meal (by start) is late if it starts after shift start + 300*k. Rest breaks required: none under 210 minutes, else (L + 120) // 240 (one per four hours or major fraction); a rest counts if kind is rest and it lasts at least 10 minutes. Return required meals, late meal ordinals, missing meals and missing rests.","evaluation_group":"w2-shift-rostering-labor-rules-meal-and-rest-break-entitlement","failed_approach":"Counting short meals as rests still credits breaks that were not rest periods.","family":"w2-shift-rostering-labor-rules-meal-and-rest-break-entitlement-meal-counted-as-rest","id":"FA-93956","implementations":{"attempt":{"sha256":"708850ff4d195ae08f65ab9909b283afec5353d8971610035c9c02512ab34a4d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(shift, breaks):\n    s, e = shift\n    L = e - s\n    need_meal = (L > 300) + (L > 600)\n    meals = sorted(b[0] for b in breaks if b[2] == 'meal' and b[1] - b[0] >= 30 and b[0] >= s and b[1] <= e)\n    late = [k + 1 for k, start in enumerate(meals[:need_meal]) if start > s + 300 * (k + 1)]\n    need_rest = 0 if L < 210 else (L + 120) // 240\n    rests = sum(1 for b in breaks if (b[2] == 'rest' or b[1] - b[0] < 30) and b[1] - b[0] >= 10)\n    return {'meals_required': need_meal, 'late': late, 'missing_meal': max(need_meal - len(meals), 0),\n            'missing_rest': max(need_rest - rests, 0)}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: meal counted as rest 1', [[420, 721], [[700, 730, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1}),\n  ('regression variant: meal counted as rest 2', [[0, 700], [[400, 430, 'meal'], [200, 230, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 0, 'missing_rest': 3}),\n  ('partial repair guard 3', [[0, 330], [[270, 315, 'meal'], [200, 215, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('boundary control 4', [[420, 1021], [[600, 630, 'meal'], [1000, 1021, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 1, 'missing_rest': 3}),\n  ('boundary control 5', [[0, 600], [[-40, -10, 'meal'], [330, 360, 'meal']]],\n   {'meals_required': 1, 'late': [1], 'missing_meal': 0, 'missing_rest': 3}),\n  ('normal control 6', [[1320, 2040], [[1590, 1621, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 1, 'missing_rest': 3}),\n  ('normal control 7', [[0, 480], []],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 2}),\n  ('normal control 8', [[360, 660], []],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1})],\n [('regression: meal counted as rest 1', [[420, 1020], [[720, 750, 'meal'], [900, 930, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 3}),\n  ('regression variant: meal counted as rest 2',\n   [[0, 330], [[301, 316, 'meal'], [290, 299, 'rest'], [310, 355, 'meal'], [200, 231, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('partial repair guard 3', [[0, 720], [[270, 299, 'meal'], [301, 310, 'meal'], [200, 209, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 2, 'missing_rest': 3}),\n  ('boundary control 4', [[0, 210], [[100, 110, 'rest']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 0}),\n  ('boundary control 5', [[60, 720], [[200, 230, 'meal'], [500, 530, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 0, 'missing_rest': 3}),\n  ('normal control 6', [[1320, 1679], []],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1}),\n  ('normal control 7',\n   [[0, 180], [[330, 375, 'meal'], [300, 309, 'meal'], [175, 185, 'meal'], [600, 609, 'rest']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 0}),\n  ('normal control 8', [[420, 721], [[721, 730, 'meal'], [480, 525, 'meal'], [721, 741, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 1})],\n [('regression: meal counted as rest 1', [[420, 1021], [[600, 630, 'meal'], [1000, 1021, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 1, 'missing_rest': 3}),\n  ('regression variant: meal counted as rest 2', [[1320, 1680], [[1380, 1389, 'meal'], [1621, 1651, 'meal']]],\n   {'meals_required': 1, 'late': [1], 'missing_meal': 0, 'missing_rest': 2}),\n  ('partial repair guard 3',\n   [[1320, 1800], [[1880, 1909, 'meal'], [1380, 1389, 'meal'], [1621, 1650, 'meal'], [1780, 1811, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 2}),\n  ('boundary control 4', [[0, 480], [[310, 340, 'meal'], [100, 109, 'rest']]],\n   {'meals_required': 1, 'late': [1], 'missing_meal': 0, 'missing_rest': 2}),\n  ('boundary control 5', [[100, 800], [[600, 630, 'meal'], [300, 330, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 0, 'missing_rest': 3}),\n  ('normal control 6', [[0, 359], [[560, 570, 'meal'], [120, 130, 'meal'], [600, 645, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1}),\n  ('normal control 7', [[420, 750], [[540, 555, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1}),\n  ('normal control 8', [[420, 750], [[750, 759, 'meal'], [750, 770, 'meal'], [710, 719, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1})],\n [('regression: meal counted as rest 1', [[1320, 1920], [[1600, 1629, 'meal'], [1450, 1460, 'rest']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 2}),\n  ('regression variant: meal counted as rest 2', [[0, 300], [[300, 330, 'meal']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('partial repair guard 3',\n   [[360, 960], [[560, 569, 'meal'], [650, 659, 'rest'], [955, 975, 'meal'], [661, 670, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 3}),\n  ('boundary control 4', [[0, 660], [[250, 280, 'meal'], [590, 620, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 0, 'missing_rest': 3}),\n  ('boundary control 5', [[420, 721], [[700, 730, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1}),\n  ('normal control 6', [[420, 660], [[640, 685, 'meal'], [380, 390, 'meal']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('normal control 7', [[1320, 1560], [[1610, 1639, 'meal'], [1621, 1641, 'meal'], [1590, 1621, 'meal']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('normal control 8', [[0, 720], [[560, 589, 'meal'], [330, 345, 'meal'], [60, 105, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 1, 'missing_rest': 3})],\n [('regression: meal counted as rest 1',\n   [[0, 360], [[200, 230, 'meal'], [100, 110, 'rest'], [300, 310, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('regression variant: meal counted as rest 2', [[1320, 1620], [[1620, 1650, 'meal'], [1650, 1679, 'meal']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('partial repair guard 3', [[420, 660], [[620, 629, 'rest'], [750, 765, 'meal'], [620, 629, 'meal']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('boundary control 4', [[0, 650], [[550, 580, 'rest'], [500, 530, 'meal'], [250, 280, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 0, 'missing_rest': 2}),\n  ('boundary control 5', [[1320, 1920], [[1600, 1629, 'meal'], [1450, 1460, 'rest']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 2}),\n  ('normal control 6', [[360, 600], []],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('normal control 7', [[0, 359], [[300, 310, 'rest'], [290, 299, 'rest'], [200, 230, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 0}),\n  ('normal control 8', [[0, 660], [[-40, -9, 'meal'], [330, 359, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 2, 'missing_rest': 3})]]\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":"5ac6917cddce4980cd8334ff3a70c2656f6c1c024dd89386bfb6c578beecefe1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(shift, breaks):\n    s, e = shift\n    L = e - s\n    need_meal = (L > 300) + (L > 600)\n    meals = sorted(b[0] for b in breaks if b[2] == 'meal' and b[1] - b[0] >= 30 and b[0] >= s and b[1] <= e)\n    late = [k + 1 for k, start in enumerate(meals[:need_meal]) if start > s + 300 * (k + 1)]\n    need_rest = 0 if L < 210 else (L + 120) // 240\n    rests = sum(1 for b in breaks if b[2] in ('rest', 'meal') and b[1] - b[0] >= 10)\n    return {'meals_required': need_meal, 'late': late, 'missing_meal': max(need_meal - len(meals), 0),\n            'missing_rest': max(need_rest - rests, 0)}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: meal counted as rest 1', [[420, 721], [[700, 730, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1}),\n  ('regression variant: meal counted as rest 2', [[0, 700], [[400, 430, 'meal'], [200, 230, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 0, 'missing_rest': 3}),\n  ('partial repair guard 3', [[0, 330], [[270, 315, 'meal'], [200, 215, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('boundary control 4', [[420, 1021], [[600, 630, 'meal'], [1000, 1021, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 1, 'missing_rest': 3}),\n  ('boundary control 5', [[0, 600], [[-40, -10, 'meal'], [330, 360, 'meal']]],\n   {'meals_required': 1, 'late': [1], 'missing_meal': 0, 'missing_rest': 3}),\n  ('normal control 6', [[1320, 2040], [[1590, 1621, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 1, 'missing_rest': 3}),\n  ('normal control 7', [[0, 480], []],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 2}),\n  ('normal control 8', [[360, 660], []],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1})],\n [('regression: meal counted as rest 1', [[420, 1020], [[720, 750, 'meal'], [900, 930, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 3}),\n  ('regression variant: meal counted as rest 2',\n   [[0, 330], [[301, 316, 'meal'], [290, 299, 'rest'], [310, 355, 'meal'], [200, 231, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('partial repair guard 3', [[0, 720], [[270, 299, 'meal'], [301, 310, 'meal'], [200, 209, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 2, 'missing_rest': 3}),\n  ('boundary control 4', [[0, 210], [[100, 110, 'rest']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 0}),\n  ('boundary control 5', [[60, 720], [[200, 230, 'meal'], [500, 530, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 0, 'missing_rest': 3}),\n  ('normal control 6', [[1320, 1679], []],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1}),\n  ('normal control 7',\n   [[0, 180], [[330, 375, 'meal'], [300, 309, 'meal'], [175, 185, 'meal'], [600, 609, 'rest']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 0}),\n  ('normal control 8', [[420, 721], [[721, 730, 'meal'], [480, 525, 'meal'], [721, 741, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 1})],\n [('regression: meal counted as rest 1', [[420, 1021], [[600, 630, 'meal'], [1000, 1021, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 1, 'missing_rest': 3}),\n  ('regression variant: meal counted as rest 2', [[1320, 1680], [[1380, 1389, 'meal'], [1621, 1651, 'meal']]],\n   {'meals_required': 1, 'late': [1], 'missing_meal': 0, 'missing_rest': 2}),\n  ('partial repair guard 3',\n   [[1320, 1800], [[1880, 1909, 'meal'], [1380, 1389, 'meal'], [1621, 1650, 'meal'], [1780, 1811, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 2}),\n  ('boundary control 4', [[0, 480], [[310, 340, 'meal'], [100, 109, 'rest']]],\n   {'meals_required': 1, 'late': [1], 'missing_meal': 0, 'missing_rest': 2}),\n  ('boundary control 5', [[100, 800], [[600, 630, 'meal'], [300, 330, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 0, 'missing_rest': 3}),\n  ('normal control 6', [[0, 359], [[560, 570, 'meal'], [120, 130, 'meal'], [600, 645, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1}),\n  ('normal control 7', [[420, 750], [[540, 555, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1}),\n  ('normal control 8', [[420, 750], [[750, 759, 'meal'], [750, 770, 'meal'], [710, 719, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1})],\n [('regression: meal counted as rest 1', [[1320, 1920], [[1600, 1629, 'meal'], [1450, 1460, 'rest']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 2}),\n  ('regression variant: meal counted as rest 2', [[0, 300], [[300, 330, 'meal']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('partial repair guard 3',\n   [[360, 960], [[560, 569, 'meal'], [650, 659, 'rest'], [955, 975, 'meal'], [661, 670, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 3}),\n  ('boundary control 4', [[0, 660], [[250, 280, 'meal'], [590, 620, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 0, 'missing_rest': 3}),\n  ('boundary control 5', [[420, 721], [[700, 730, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1}),\n  ('normal control 6', [[420, 660], [[640, 685, 'meal'], [380, 390, 'meal']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('normal control 7', [[1320, 1560], [[1610, 1639, 'meal'], [1621, 1641, 'meal'], [1590, 1621, 'meal']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('normal control 8', [[0, 720], [[560, 589, 'meal'], [330, 345, 'meal'], [60, 105, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 1, 'missing_rest': 3})],\n [('regression: meal counted as rest 1',\n   [[0, 360], [[200, 230, 'meal'], [100, 110, 'rest'], [300, 310, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('regression variant: meal counted as rest 2', [[1320, 1620], [[1620, 1650, 'meal'], [1650, 1679, 'meal']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('partial repair guard 3', [[420, 660], [[620, 629, 'rest'], [750, 765, 'meal'], [620, 629, 'meal']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('boundary control 4', [[0, 650], [[550, 580, 'rest'], [500, 530, 'meal'], [250, 280, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 0, 'missing_rest': 2}),\n  ('boundary control 5', [[1320, 1920], [[1600, 1629, 'meal'], [1450, 1460, 'rest']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 2}),\n  ('normal control 6', [[360, 600], []],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('normal control 7', [[0, 359], [[300, 310, 'rest'], [290, 299, 'rest'], [200, 230, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 0}),\n  ('normal control 8', [[0, 660], [[-40, -9, 'meal'], [330, 359, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 2, 'missing_rest': 3})]]\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":"d6823a4e2b86774f051c29569a539749d296e5b8a14177d0fba1c54d324587ec","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(shift, breaks):\n    s, e = shift\n    L = e - s\n    need_meal = (L > 300) + (L > 600)\n    meals = sorted(b[0] for b in breaks if b[2] == 'meal' and b[1] - b[0] >= 30 and b[0] >= s and b[1] <= e)\n    late = [k + 1 for k, start in enumerate(meals[:need_meal]) if start > s + 300 * (k + 1)]\n    need_rest = 0 if L < 210 else (L + 120) // 240\n    rests = sum(1 for b in breaks if b[2] == 'rest' and b[1] - b[0] >= 10)\n    return {'meals_required': need_meal, 'late': late, 'missing_meal': max(need_meal - len(meals), 0),\n            'missing_rest': max(need_rest - rests, 0)}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: meal counted as rest 1', [[420, 721], [[700, 730, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1}),\n  ('regression variant: meal counted as rest 2', [[0, 700], [[400, 430, 'meal'], [200, 230, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 0, 'missing_rest': 3}),\n  ('partial repair guard 3', [[0, 330], [[270, 315, 'meal'], [200, 215, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('boundary control 4', [[420, 1021], [[600, 630, 'meal'], [1000, 1021, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 1, 'missing_rest': 3}),\n  ('boundary control 5', [[0, 600], [[-40, -10, 'meal'], [330, 360, 'meal']]],\n   {'meals_required': 1, 'late': [1], 'missing_meal': 0, 'missing_rest': 3}),\n  ('normal control 6', [[1320, 2040], [[1590, 1621, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 1, 'missing_rest': 3}),\n  ('normal control 7', [[0, 480], []],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 2}),\n  ('normal control 8', [[360, 660], []],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1})],\n [('regression: meal counted as rest 1', [[420, 1020], [[720, 750, 'meal'], [900, 930, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 3}),\n  ('regression variant: meal counted as rest 2',\n   [[0, 330], [[301, 316, 'meal'], [290, 299, 'rest'], [310, 355, 'meal'], [200, 231, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('partial repair guard 3', [[0, 720], [[270, 299, 'meal'], [301, 310, 'meal'], [200, 209, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 2, 'missing_rest': 3}),\n  ('boundary control 4', [[0, 210], [[100, 110, 'rest']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 0}),\n  ('boundary control 5', [[60, 720], [[200, 230, 'meal'], [500, 530, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 0, 'missing_rest': 3}),\n  ('normal control 6', [[1320, 1679], []],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1}),\n  ('normal control 7',\n   [[0, 180], [[330, 375, 'meal'], [300, 309, 'meal'], [175, 185, 'meal'], [600, 609, 'rest']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 0}),\n  ('normal control 8', [[420, 721], [[721, 730, 'meal'], [480, 525, 'meal'], [721, 741, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 1})],\n [('regression: meal counted as rest 1', [[420, 1021], [[600, 630, 'meal'], [1000, 1021, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 1, 'missing_rest': 3}),\n  ('regression variant: meal counted as rest 2', [[1320, 1680], [[1380, 1389, 'meal'], [1621, 1651, 'meal']]],\n   {'meals_required': 1, 'late': [1], 'missing_meal': 0, 'missing_rest': 2}),\n  ('partial repair guard 3',\n   [[1320, 1800], [[1880, 1909, 'meal'], [1380, 1389, 'meal'], [1621, 1650, 'meal'], [1780, 1811, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 2}),\n  ('boundary control 4', [[0, 480], [[310, 340, 'meal'], [100, 109, 'rest']]],\n   {'meals_required': 1, 'late': [1], 'missing_meal': 0, 'missing_rest': 2}),\n  ('boundary control 5', [[100, 800], [[600, 630, 'meal'], [300, 330, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 0, 'missing_rest': 3}),\n  ('normal control 6', [[0, 359], [[560, 570, 'meal'], [120, 130, 'meal'], [600, 645, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1}),\n  ('normal control 7', [[420, 750], [[540, 555, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1}),\n  ('normal control 8', [[420, 750], [[750, 759, 'meal'], [750, 770, 'meal'], [710, 719, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1})],\n [('regression: meal counted as rest 1', [[1320, 1920], [[1600, 1629, 'meal'], [1450, 1460, 'rest']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 2}),\n  ('regression variant: meal counted as rest 2', [[0, 300], [[300, 330, 'meal']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('partial repair guard 3',\n   [[360, 960], [[560, 569, 'meal'], [650, 659, 'rest'], [955, 975, 'meal'], [661, 670, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 3}),\n  ('boundary control 4', [[0, 660], [[250, 280, 'meal'], [590, 620, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 0, 'missing_rest': 3}),\n  ('boundary control 5', [[420, 721], [[700, 730, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 1}),\n  ('normal control 6', [[420, 660], [[640, 685, 'meal'], [380, 390, 'meal']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('normal control 7', [[1320, 1560], [[1610, 1639, 'meal'], [1621, 1641, 'meal'], [1590, 1621, 'meal']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('normal control 8', [[0, 720], [[560, 589, 'meal'], [330, 345, 'meal'], [60, 105, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 1, 'missing_rest': 3})],\n [('regression: meal counted as rest 1',\n   [[0, 360], [[200, 230, 'meal'], [100, 110, 'rest'], [300, 310, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('regression variant: meal counted as rest 2', [[1320, 1620], [[1620, 1650, 'meal'], [1650, 1679, 'meal']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('partial repair guard 3', [[420, 660], [[620, 629, 'rest'], [750, 765, 'meal'], [620, 629, 'meal']]],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('boundary control 4', [[0, 650], [[550, 580, 'rest'], [500, 530, 'meal'], [250, 280, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 0, 'missing_rest': 2}),\n  ('boundary control 5', [[1320, 1920], [[1600, 1629, 'meal'], [1450, 1460, 'rest']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 1, 'missing_rest': 2}),\n  ('normal control 6', [[360, 600], []],\n   {'meals_required': 0, 'late': [], 'missing_meal': 0, 'missing_rest': 1}),\n  ('normal control 7', [[0, 359], [[300, 310, 'rest'], [290, 299, 'rest'], [200, 230, 'meal']]],\n   {'meals_required': 1, 'late': [], 'missing_meal': 0, 'missing_rest': 0}),\n  ('normal control 8', [[0, 660], [[-40, -9, 'meal'], [330, 359, 'meal']]],\n   {'meals_required': 2, 'late': [], 'missing_meal': 2, 'missing_rest': 3})]]\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-meal-and-rest-break-entitlement-meal-counted-as-rest","generated_at":"2026-09-29T14:51:59.988944+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Break-entitlement checks gate roster publication and trigger premium pay; every boundary here is a distinct audit finding.","repair":"Count only breaks of kind rest toward the rest entitlement.","root_cause":"The rest counter accepts meal breaks.","sha256":"8a90f01463c754a3d95833cdef20f12809facd69888369433a3c8aea4d131ab4","title":"Meal periods double-count as paid rest breaks · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.556,"exit_code":1,"observations":[{"actual":{"late":[],"meals_required":1,"missing_meal":1,"missing_rest":1},"check":"regression: meal counted as rest 1","expected":{"late":[],"meals_required":1,"missing_meal":1,"missing_rest":1},"passed":true},{"actual":{"late":[],"meals_required":2,"missing_meal":0,"missing_rest":3},"check":"regression variant: meal counted as rest 2","expected":{"late":[],"meals_required":2,"missing_meal":0,"missing_rest":3},"passed":true},{"actual":{"late":[],"meals_required":1,"missing_meal":0,"missing_rest":0},"check":"partial repair guard 3","expected":{"late":[],"meals_required":1,"missing_meal":0,"missing_rest":1},"passed":false},{"actual":{"late":[],"meals_required":2,"missing_meal":1,"missing_rest":2},"check":"boundary control 4","expected":{"late":[],"meals_required":2,"missing_meal":1,"missing_rest":3},"passed":false},{"actual":{"late":[1],"meals_required":1,"missing_meal":0,"missing_rest":3},"check":"boundary control 5","expected":{"late":[1],"meals_required":1,"missing_meal":0,"missing_rest":3},"passed":true},{"actual":{"late":[],"meals_required":2,"missing_meal":1,"missing_rest":3},"check":"normal control 6","expected":{"late":[],"meals_required":2,"missing_meal":1,"missing_rest":3},"passed":true},{"actual":{"late":[],"meals_required":1,"missing_meal":1,"missing_rest":2},"check":"normal control 7","expected":{"late":[],"meals_required":1,"missing_meal":1,"missing_rest":2},"passed":true},{"actual":{"late":[],"meals_required":0,"missing_meal":0,"missing_rest":1},"check":"normal control 8","expected":{"late":[],"meals_required":0,"missing_meal":0,"missing_rest":1},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: meal counted as rest 1\", \"actual\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 1}, \"expected\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 1}, \"passed\": true}, {\"check\": \"regression variant: meal counted as rest 2\", \"actual\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 3}, \"expected\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 3}, \"passed\": true}, {\"check\": \"partial repair guard 3\", \"actual\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 0}, \"expected\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 1}, \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 2}, \"expected\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 3}, \"passed\": false}, {\"check\": \"boundary control 5\", \"actual\": {\"meals_required\": 1, \"late\": [1], \"missing_meal\": 0, \"missing_rest\": 3}, \"expected\": {\"meals_required\": 1, \"late\": [1], \"missing_meal\": 0, \"missing_rest\": 3}, \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 3}, \"expected\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 3}, \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 2}, \"expected\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 2}, \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": {\"meals_required\": 0, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 1}, \"expected\": {\"meals_required\": 0, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 1}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.946,"exit_code":1,"observations":[{"actual":{"late":[],"meals_required":1,"missing_meal":1,"missing_rest":0},"check":"regression: meal counted as rest 1","expected":{"late":[],"meals_required":1,"missing_meal":1,"missing_rest":1},"passed":false},{"actual":{"late":[],"meals_required":2,"missing_meal":0,"missing_rest":1},"check":"regression variant: meal counted as rest 2","expected":{"late":[],"meals_required":2,"missing_meal":0,"missing_rest":3},"passed":false},{"actual":{"late":[],"meals_required":1,"missing_meal":0,"missing_rest":0},"check":"partial repair guard 3","expected":{"late":[],"meals_required":1,"missing_meal":0,"missing_rest":1},"passed":false},{"actual":{"late":[],"meals_required":2,"missing_meal":1,"missing_rest":1},"check":"boundary control 4","expected":{"late":[],"meals_required":2,"missing_meal":1,"missing_rest":3},"passed":false},{"actual":{"late":[1],"meals_required":1,"missing_meal":0,"missing_rest":1},"check":"boundary control 5","expected":{"late":[1],"meals_required":1,"missing_meal":0,"missing_rest":3},"passed":false},{"actual":{"late":[],"meals_required":2,"missing_meal":1,"missing_rest":2},"check":"normal control 6","expected":{"late":[],"meals_required":2,"missing_meal":1,"missing_rest":3},"passed":false},{"actual":{"late":[],"meals_required":1,"missing_meal":1,"missing_rest":2},"check":"normal control 7","expected":{"late":[],"meals_required":1,"missing_meal":1,"missing_rest":2},"passed":true},{"actual":{"late":[],"meals_required":0,"missing_meal":0,"missing_rest":1},"check":"normal control 8","expected":{"late":[],"meals_required":0,"missing_meal":0,"missing_rest":1},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: meal counted as rest 1\", \"actual\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 0}, \"expected\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 1}, \"passed\": false}, {\"check\": \"regression variant: meal counted as rest 2\", \"actual\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 1}, \"expected\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 3}, \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 0}, \"expected\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 1}, \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 1}, \"expected\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 3}, \"passed\": false}, {\"check\": \"boundary control 5\", \"actual\": {\"meals_required\": 1, \"late\": [1], \"missing_meal\": 0, \"missing_rest\": 1}, \"expected\": {\"meals_required\": 1, \"late\": [1], \"missing_meal\": 0, \"missing_rest\": 3}, \"passed\": false}, {\"check\": \"normal control 6\", \"actual\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 2}, \"expected\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 3}, \"passed\": false}, {\"check\": \"normal control 7\", \"actual\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 2}, \"expected\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 2}, \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": {\"meals_required\": 0, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 1}, \"expected\": {\"meals_required\": 0, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 1}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.027,"exit_code":0,"observations":[{"actual":{"late":[],"meals_required":1,"missing_meal":1,"missing_rest":1},"check":"regression: meal counted as rest 1","expected":{"late":[],"meals_required":1,"missing_meal":1,"missing_rest":1},"passed":true},{"actual":{"late":[],"meals_required":2,"missing_meal":0,"missing_rest":3},"check":"regression variant: meal counted as rest 2","expected":{"late":[],"meals_required":2,"missing_meal":0,"missing_rest":3},"passed":true},{"actual":{"late":[],"meals_required":1,"missing_meal":0,"missing_rest":1},"check":"partial repair guard 3","expected":{"late":[],"meals_required":1,"missing_meal":0,"missing_rest":1},"passed":true},{"actual":{"late":[],"meals_required":2,"missing_meal":1,"missing_rest":3},"check":"boundary control 4","expected":{"late":[],"meals_required":2,"missing_meal":1,"missing_rest":3},"passed":true},{"actual":{"late":[1],"meals_required":1,"missing_meal":0,"missing_rest":3},"check":"boundary control 5","expected":{"late":[1],"meals_required":1,"missing_meal":0,"missing_rest":3},"passed":true},{"actual":{"late":[],"meals_required":2,"missing_meal":1,"missing_rest":3},"check":"normal control 6","expected":{"late":[],"meals_required":2,"missing_meal":1,"missing_rest":3},"passed":true},{"actual":{"late":[],"meals_required":1,"missing_meal":1,"missing_rest":2},"check":"normal control 7","expected":{"late":[],"meals_required":1,"missing_meal":1,"missing_rest":2},"passed":true},{"actual":{"late":[],"meals_required":0,"missing_meal":0,"missing_rest":1},"check":"normal control 8","expected":{"late":[],"meals_required":0,"missing_meal":0,"missing_rest":1},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: meal counted as rest 1\", \"actual\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 1}, \"expected\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 1}, \"passed\": true}, {\"check\": \"regression variant: meal counted as rest 2\", \"actual\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 3}, \"expected\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 3}, \"passed\": true}, {\"check\": \"partial repair guard 3\", \"actual\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 1}, \"expected\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 1}, \"passed\": true}, {\"check\": \"boundary control 4\", \"actual\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 3}, \"expected\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 3}, \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": {\"meals_required\": 1, \"late\": [1], \"missing_meal\": 0, \"missing_rest\": 3}, \"expected\": {\"meals_required\": 1, \"late\": [1], \"missing_meal\": 0, \"missing_rest\": 3}, \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 3}, \"expected\": {\"meals_required\": 2, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 3}, \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 2}, \"expected\": {\"meals_required\": 1, \"late\": [], \"missing_meal\": 1, \"missing_rest\": 2}, \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": {\"meals_required\": 0, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 1}, \"expected\": {\"meals_required\": 0, \"late\": [], \"missing_meal\": 0, \"missing_rest\": 1}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}