{"abstract":"Split days with long unpaid gaps never reach the spread premium.","category":"Shift rostering labor rules","checks":8,"contract":"Worked segments [start, end] of one workday (unordered, possibly overlapping) and a minimum wage in cents. Overlapping or touching segments merge. Spread is last end minus first start. Each gap longer than 60 minutes is a split. A spread over 600 minutes earns one hour of minimum wage and replaces any split premium; otherwise each split earns min_wage // 2, for at most two splits. Return [spread, splits, premium].","contract_signature":"segments, min_wage","evaluation_group":"w2-shift-rostering-labor-rules-spread-of-hours-split-premium","failed_approach":"Measuring from the end of the first segment drops the first segment from the span.","family":"w2-shift-rostering-labor-rules-spread-of-hours-split-premium-spread-measured-as-worked-time","id":"FA-93896","implementations":{"attempt":{"sha256":"7395d6769549913b4b87a877a39914f12ded424bfe60ce9d0acfbb123e442823","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(segments, min_wage):\n    seg = sorted(segments)\n    merged = []\n    for s, e in seg:\n        if merged and s <= merged[-1][1]:\n            merged[-1][1] = max(merged[-1][1], e)\n        else:\n            merged.append([s, e])\n    spread = merged[-1][1] - merged[0][1]\n    splits = sum(1 for a, b in zip(merged, merged[1:]) if b[0] - a[1] > 60)\n    if spread > 600:\n        premium = min_wage\n    else:\n        premium = (min_wage // 2) * min(splits, 2)\n    return [spread, splits, premium]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: spread measured as worked time 1', [[[480, 720], [780, 1080]], 1600], [600, 0, 0]),\n  ('regression variant: spread measured as worked time 2',\n   [[[610, 620], [1259, 1319], [900, 1200], [600, 720]], 1520], [719, 1, 1520]),\n  ('partial repair guard 3', [[[900, 1000], [420, 600], [700, 800]], 1520], [580, 2, 1520]),\n  ('boundary control 4', [[[420, 1020]], 1600], [600, 0, 0]),\n  ('boundary control 5', [[[420, 480], [550, 600], [700, 760], [840, 900], [980, 1010]], 1655],\n   [590, 4, 1654]),\n  ('normal control 6', [[[420, 720], [840, 900], [1201, 1321], [1080, 1140]], 1520], [901, 3, 1520]),\n  ('normal control 7', [[[570, 750], [420, 540], [580, 590]], 1701], [330, 0, 0]),\n  ('normal control 8', [[[1081, 1261], [420, 720], [781, 901], [430, 440], [1381, 1501]], 1520],\n   [1081, 3, 1520])],\n [('regression: spread measured as worked time 1', [[[480, 720], [781, 1080]], 1600], [600, 1, 800]),\n  ('regression variant: spread measured as worked time 2',\n   [[[600, 840], [1501, 1561], [900, 960], [1021, 1261]], 1600], [961, 2, 1600]),\n  ('partial repair guard 3', [[[1079, 1319], [1378, 1618], [720, 1020], [600, 660]], 1701], [1018, 0, 1701]),\n  ('boundary control 4', [[[900, 1000], [420, 600], [700, 800]], 1520], [580, 2, 1520]),\n  ('normal control 5', [[[1380, 1680], [600, 840], [1090, 1100], [1080, 1140], [870, 1050]], 1655],\n   [1080, 1, 1655]),\n  ('normal control 6', [[[420, 540], [510, 810], [1050, 1170]], 1655], [750, 1, 1655]),\n  ('normal control 7', [[[910, 920], [600, 660], [1380, 1680], [900, 1200]], 1520], [1080, 2, 1520]),\n  ('normal control 8', [[[420, 480]], 1520], [60, 0, 0])],\n [('regression: spread measured as worked time 1', [[[420, 600], [660, 780], [840, 1020]], 1701],\n   [600, 0, 0]),\n  ('regression variant: spread measured as worked time 2', [[[841, 1141], [1141, 1441], [600, 780]], 1600],\n   [841, 1, 1600]),\n  ('partial repair guard 3', [[[600, 780]], 1520], [180, 0, 0]),\n  ('boundary control 4', [[[600, 630], [700, 730], [800, 830], [900, 930]], 1701], [330, 3, 1700]),\n  ('boundary control 5', [[[420, 1021]], 1600], [601, 0, 1600]),\n  ('normal control 6', [[[600, 780], [900, 1080], [1200, 1440]], 1600], [840, 2, 1600]),\n  ('normal control 7', [[[660, 960], [370, 380], [360, 600]], 1600], [600, 0, 0]),\n  ('normal control 8', [[[630, 750], [640, 650], [420, 540]], 1701], [330, 1, 850])],\n [('regression: spread measured as worked time 1', [[[600, 900], [610, 620], [1000, 1100]], 1655],\n   [500, 1, 827]),\n  ('regression variant: spread measured as worked time 2',\n   [[[1001, 1011], [480, 660], [630, 930], [991, 1051]], 1600], [571, 1, 800]),\n  ('partial repair guard 3', [[[600, 840], [1501, 1561], [900, 960], [1021, 1261]], 1600], [961, 2, 1600]),\n  ('boundary control 4', [[[420, 600], [660, 780], [840, 1020]], 1701], [600, 0, 0]),\n  ('boundary control 5', [[[420, 450], [520, 550], [620, 650], [720, 750]], 1600], [330, 3, 1600]),\n  ('normal control 6', [[[600, 660]], 1600], [60, 0, 0]),\n  ('normal control 7', [[[1680, 1860], [960, 1200], [1260, 1560], [600, 720]], 1600], [1260, 2, 1600]),\n  ('normal control 8', [[[420, 720], [1019, 1139], [1139, 1319], [720, 960]], 1600], [899, 0, 1600])],\n [('regression: spread measured as worked time 1', [[[900, 1000], [420, 600], [700, 800]], 1520],\n   [580, 2, 1520]),\n  ('regression variant: spread measured as worked time 2', [[[900, 1140], [360, 420], [600, 780]], 1600],\n   [780, 2, 1600]),\n  ('partial repair guard 3', [[[610, 620], [360, 540], [600, 900]], 1655], [540, 0, 0]),\n  ('boundary control 4', [[[600, 900], [610, 620], [1000, 1100]], 1655], [500, 1, 827]),\n  ('boundary control 5', [[[480, 720], [780, 1080]], 1600], [600, 0, 0]),\n  ('normal control 6', [[[600, 840], [1501, 1561], [900, 960], [1021, 1261]], 1600], [961, 2, 1600]),\n  ('normal control 7', [[[480, 660]], 1600], [180, 0, 0]),\n  ('normal control 8', [[[630, 930], [480, 540]], 1655], [450, 1, 827])]]\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":"b66862ee3ef0908cea1f8f11b9ca507c45853317c10b0943316c0aea9871af3b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(segments, min_wage):\n    seg = sorted(segments)\n    merged = []\n    for s, e in seg:\n        if merged and s <= merged[-1][1]:\n            merged[-1][1] = max(merged[-1][1], e)\n        else:\n            merged.append([s, e])\n    spread = sum(e - s for s, e in merged)\n    splits = sum(1 for a, b in zip(merged, merged[1:]) if b[0] - a[1] > 60)\n    if spread > 600:\n        premium = min_wage\n    else:\n        premium = (min_wage // 2) * min(splits, 2)\n    return [spread, splits, premium]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: spread measured as worked time 1', [[[480, 720], [780, 1080]], 1600], [600, 0, 0]),\n  ('regression variant: spread measured as worked time 2',\n   [[[610, 620], [1259, 1319], [900, 1200], [600, 720]], 1520], [719, 1, 1520]),\n  ('partial repair guard 3', [[[900, 1000], [420, 600], [700, 800]], 1520], [580, 2, 1520]),\n  ('boundary control 4', [[[420, 1020]], 1600], [600, 0, 0]),\n  ('boundary control 5', [[[420, 480], [550, 600], [700, 760], [840, 900], [980, 1010]], 1655],\n   [590, 4, 1654]),\n  ('normal control 6', [[[420, 720], [840, 900], [1201, 1321], [1080, 1140]], 1520], [901, 3, 1520]),\n  ('normal control 7', [[[570, 750], [420, 540], [580, 590]], 1701], [330, 0, 0]),\n  ('normal control 8', [[[1081, 1261], [420, 720], [781, 901], [430, 440], [1381, 1501]], 1520],\n   [1081, 3, 1520])],\n [('regression: spread measured as worked time 1', [[[480, 720], [781, 1080]], 1600], [600, 1, 800]),\n  ('regression variant: spread measured as worked time 2',\n   [[[600, 840], [1501, 1561], [900, 960], [1021, 1261]], 1600], [961, 2, 1600]),\n  ('partial repair guard 3', [[[1079, 1319], [1378, 1618], [720, 1020], [600, 660]], 1701], [1018, 0, 1701]),\n  ('boundary control 4', [[[900, 1000], [420, 600], [700, 800]], 1520], [580, 2, 1520]),\n  ('normal control 5', [[[1380, 1680], [600, 840], [1090, 1100], [1080, 1140], [870, 1050]], 1655],\n   [1080, 1, 1655]),\n  ('normal control 6', [[[420, 540], [510, 810], [1050, 1170]], 1655], [750, 1, 1655]),\n  ('normal control 7', [[[910, 920], [600, 660], [1380, 1680], [900, 1200]], 1520], [1080, 2, 1520]),\n  ('normal control 8', [[[420, 480]], 1520], [60, 0, 0])],\n [('regression: spread measured as worked time 1', [[[420, 600], [660, 780], [840, 1020]], 1701],\n   [600, 0, 0]),\n  ('regression variant: spread measured as worked time 2', [[[841, 1141], [1141, 1441], [600, 780]], 1600],\n   [841, 1, 1600]),\n  ('partial repair guard 3', [[[600, 780]], 1520], [180, 0, 0]),\n  ('boundary control 4', [[[600, 630], [700, 730], [800, 830], [900, 930]], 1701], [330, 3, 1700]),\n  ('boundary control 5', [[[420, 1021]], 1600], [601, 0, 1600]),\n  ('normal control 6', [[[600, 780], [900, 1080], [1200, 1440]], 1600], [840, 2, 1600]),\n  ('normal control 7', [[[660, 960], [370, 380], [360, 600]], 1600], [600, 0, 0]),\n  ('normal control 8', [[[630, 750], [640, 650], [420, 540]], 1701], [330, 1, 850])],\n [('regression: spread measured as worked time 1', [[[600, 900], [610, 620], [1000, 1100]], 1655],\n   [500, 1, 827]),\n  ('regression variant: spread measured as worked time 2',\n   [[[1001, 1011], [480, 660], [630, 930], [991, 1051]], 1600], [571, 1, 800]),\n  ('partial repair guard 3', [[[600, 840], [1501, 1561], [900, 960], [1021, 1261]], 1600], [961, 2, 1600]),\n  ('boundary control 4', [[[420, 600], [660, 780], [840, 1020]], 1701], [600, 0, 0]),\n  ('boundary control 5', [[[420, 450], [520, 550], [620, 650], [720, 750]], 1600], [330, 3, 1600]),\n  ('normal control 6', [[[600, 660]], 1600], [60, 0, 0]),\n  ('normal control 7', [[[1680, 1860], [960, 1200], [1260, 1560], [600, 720]], 1600], [1260, 2, 1600]),\n  ('normal control 8', [[[420, 720], [1019, 1139], [1139, 1319], [720, 960]], 1600], [899, 0, 1600])],\n [('regression: spread measured as worked time 1', [[[900, 1000], [420, 600], [700, 800]], 1520],\n   [580, 2, 1520]),\n  ('regression variant: spread measured as worked time 2', [[[900, 1140], [360, 420], [600, 780]], 1600],\n   [780, 2, 1600]),\n  ('partial repair guard 3', [[[610, 620], [360, 540], [600, 900]], 1655], [540, 0, 0]),\n  ('boundary control 4', [[[600, 900], [610, 620], [1000, 1100]], 1655], [500, 1, 827]),\n  ('boundary control 5', [[[480, 720], [780, 1080]], 1600], [600, 0, 0]),\n  ('normal control 6', [[[600, 840], [1501, 1561], [900, 960], [1021, 1261]], 1600], [961, 2, 1600]),\n  ('normal control 7', [[[480, 660]], 1600], [180, 0, 0]),\n  ('normal control 8', [[[630, 930], [480, 540]], 1655], [450, 1, 827])]]\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-spread-of-hours-split-premium-spread-measured-as-worked-time","generated_at":"2026-09-29T14:51:59.388573+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Spread-of-hours and split-shift premiums are frequent roster-pay rules that depend on correct interval handling.","root_cause":"Spread sums the worked segment lengths rather than spanning first start to last end.","sha256":"11778c4e7e553137f097a2a0d3ea407883d1a8c8962229f3d9de8d45cff63c6d","title":"Spread of hours computed from worked minutes instead of first-to-last span · 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":43.741,"exit_code":1,"observations":[{"actual":[360,0,0],"check":"regression: spread measured as worked time 1","expected":[600,0,0],"passed":false},{"actual":[599,1,760],"check":"regression variant: spread measured as worked time 2","expected":[719,1,1520],"passed":false},{"actual":[400,2,1520],"check":"partial repair guard 3","expected":[580,2,1520],"passed":false},{"actual":[0,0,0],"check":"boundary control 4","expected":[600,0,0],"passed":false},{"actual":[530,4,1654],"check":"boundary control 5","expected":[590,4,1654],"passed":false},{"actual":[601,3,1520],"check":"normal control 6","expected":[901,3,1520],"passed":false},{"actual":[210,0,0],"check":"normal control 7","expected":[330,0,0],"passed":false},{"actual":[781,3,1520],"check":"normal control 8","expected":[1081,3,1520],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: spread measured as worked time 1\", \"actual\": [360, 0, 0], \"expected\": [600, 0, 0], \"passed\": false}, {\"check\": \"regression variant: spread measured as worked time 2\", \"actual\": [599, 1, 760], \"expected\": [719, 1, 1520], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [400, 2, 1520], \"expected\": [580, 2, 1520], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [0, 0, 0], \"expected\": [600, 0, 0], \"passed\": false}, {\"check\": \"boundary control 5\", \"actual\": [530, 4, 1654], \"expected\": [590, 4, 1654], \"passed\": false}, {\"check\": \"normal control 6\", \"actual\": [601, 3, 1520], \"expected\": [901, 3, 1520], \"passed\": false}, {\"check\": \"normal control 7\", \"actual\": [210, 0, 0], \"expected\": [330, 0, 0], \"passed\": false}, {\"check\": \"normal control 8\", \"actual\": [781, 3, 1520], \"expected\": [1081, 3, 1520], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.874,"exit_code":1,"observations":[{"actual":[540,0,0],"check":"regression: spread measured as worked time 1","expected":[600,0,0],"passed":false},{"actual":[480,1,760],"check":"regression variant: spread measured as worked time 2","expected":[719,1,1520],"passed":false},{"actual":[380,2,1520],"check":"partial repair guard 3","expected":[580,2,1520],"passed":false},{"actual":[600,0,0],"check":"boundary control 4","expected":[600,0,0],"passed":true},{"actual":[260,4,1654],"check":"boundary control 5","expected":[590,4,1654],"passed":false},{"actual":[540,3,1520],"check":"normal control 6","expected":[901,3,1520],"passed":false},{"actual":[300,0,0],"check":"normal control 7","expected":[330,0,0],"passed":false},{"actual":[720,3,1520],"check":"normal control 8","expected":[1081,3,1520],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: spread measured as worked time 1\", \"actual\": [540, 0, 0], \"expected\": [600, 0, 0], \"passed\": false}, {\"check\": \"regression variant: spread measured as worked time 2\", \"actual\": [480, 1, 760], \"expected\": [719, 1, 1520], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [380, 2, 1520], \"expected\": [580, 2, 1520], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [600, 0, 0], \"expected\": [600, 0, 0], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [260, 4, 1654], \"expected\": [590, 4, 1654], \"passed\": false}, {\"check\": \"normal control 6\", \"actual\": [540, 3, 1520], \"expected\": [901, 3, 1520], \"passed\": false}, {\"check\": \"normal control 7\", \"actual\": [300, 0, 0], \"expected\": [330, 0, 0], \"passed\": false}, {\"check\": \"normal control 8\", \"actual\": [720, 3, 1520], \"expected\": [1081, 3, 1520], \"passed\": false}], \"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."}}