{"abstract":"The final guarantee window of the night is missing from paid minutes.","category":"Shift rostering labor rules","checks":8,"contract":"Callback work intervals [start, end] and a minimum guarantee in minutes. Sorted by start, each callback that does not start inside the current guarantee window opens a new window from its start to max(end, start + guarantee); a callback starting before the window end extends the window to its own end if later. Return [paid minutes as the sum of window lengths, window count].","contract_signature":"callbacks, guarantee","evaluation_group":"w2-shift-rostering-labor-rules-callback-minimum-guarantee","failed_approach":"Adding a flat guarantee for the last window underpays a callback longer than the guarantee.","family":"w2-shift-rostering-labor-rules-callback-minimum-guarantee-final-window-flush","id":"FA-93966","implementations":{"attempt":{"sha256":"16237e5e4191261cb16205800ebe2b57d86aba20b9361cdcec4b4cd2a131794f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(callbacks, guarantee):\n    paid = 0\n    windows = 0\n    win_start = win_end = None\n    for s, e in sorted(callbacks):\n        if win_end is not None and s < win_end:\n            win_end = max(win_end, e)\n        else:\n            if win_end is not None:\n                paid += win_end - win_start\n            win_start, win_end = s, max(e, s + guarantee)\n            windows += 1\n    if win_end is not None:\n        paid += guarantee\n    return [paid, windows]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: final window flush 1', [[[0, 30]], 180], [180, 1]),\n  ('regression variant: final window flush 2', [[[1580, 1595], [1760, 1960], [1400, 1460]], 120], [440, 3]),\n  ('partial repair guard 3', [[[100, 130], [130, 370]], 180], [270, 1]),\n  ('boundary control 4', [[[0, 240]], 180], [240, 1]),\n  ('boundary control 5', [[[0, 30], [180, 200]], 180], [360, 2]),\n  ('normal control 6', [[[0, 200], [181, 241]], 240], [241, 1]),\n  ('normal control 7', [[[639, 879], [100, 130], [460, 490], [279, 479]], 180], [630, 2]),\n  ('normal control 8', [[[0, 240], [779, 1019], [600, 800]], 180], [659, 2])],\n [('regression: final window flush 1', [[[0, 30], [180, 200]], 180], [360, 2]),\n  ('regression variant: final window flush 2', [[[100, 340]], 120], [240, 1]),\n  ('partial repair guard 3', [[[280, 295], [880, 1120], [100, 340]], 120], [480, 2]),\n  ('boundary control 4', [[], 180], [0, 0]), ('boundary control 5', [[[0, 30], [60, 400]], 180], [400, 1]),\n  ('normal control 6', [[[1940, 2180], [1400, 1460], [1700, 1940]], 180], [660, 3]),\n  ('normal control 7', [[[100, 130]], 180], [180, 1]),\n  ('normal control 8', [[[0, 15], [150, 270]], 240], [270, 1])],\n [('regression: final window flush 1', [[[0, 30], [179, 200]], 180], [200, 1]),\n  ('regression variant: final window flush 2', [[[160, 280], [760, 820], [130, 250], [100, 340]], 120],\n   [360, 2]),\n  ('partial repair guard 3', [[[0, 200], [869, 1109], [179, 379], [779, 979]], 180], [709, 2]),\n  ('boundary control 4', [[[0, 30]], 180], [180, 1]),\n  ('normal control 5', [[[371, 611], [100, 130], [190, 205]], 180], [420, 2]),\n  ('normal control 6', [[[490, 730], [279, 399], [309, 509], [100, 160]], 120], [571, 2]),\n  ('normal control 7', [[[370, 570], [100, 300], [340, 460]], 240], [480, 2]),\n  ('normal control 8', [[[100, 300], [281, 341], [762, 962], [581, 821]], 240], [622, 2])],\n [('regression: final window flush 1', [[[0, 240]], 180], [240, 1]),\n  ('regression variant: final window flush 2', [[[100, 340], [250, 450], [850, 865]], 240], [590, 2]),\n  ('partial repair guard 3', [[[100, 115], [279, 519]], 240], [419, 1]),\n  ('boundary control 4', [[[300, 330], [0, 30]], 180], [360, 2]),\n  ('normal control 5', [[[150, 390], [0, 30], [390, 630]], 240], [630, 2]),\n  ('normal control 6', [[[100, 115], [250, 310], [430, 550]], 240], [480, 2]),\n  ('normal control 7', [[[310, 510], [130, 190], [491, 731], [100, 115]], 240], [631, 1]),\n  ('normal control 8', [[[1400, 1460], [1640, 1670]], 180], [360, 2])],\n [('regression: final window flush 1', [[[0, 30], [60, 400]], 180], [400, 1]),\n  ('regression variant: final window flush 2', [[[180, 420], [0, 240], [480, 540]], 240], [660, 2]),\n  ('partial repair guard 3', [[[100, 130], [220, 340], [130, 250]], 120], [240, 1]),\n  ('boundary control 4', [[[0, 30], [180, 200]], 180], [360, 2]), ('boundary control 5', [[], 180], [0, 0]),\n  ('normal control 6', [[[370, 570], [100, 115], [130, 190]], 120], [320, 2]),\n  ('normal control 7', [[[310, 510], [130, 190], [491, 731], [100, 115]], 240], [631, 1]),\n  ('normal control 8', [[[360, 480], [0, 30], [179, 239]], 240], [480, 2])]]\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":"c9f6ddd058a3890af50da79a7ce95371404cfce82736ba251691f631044256e2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(callbacks, guarantee):\n    paid = 0\n    windows = 0\n    win_start = win_end = None\n    for s, e in sorted(callbacks):\n        if win_end is not None and s < win_end:\n            win_end = max(win_end, e)\n        else:\n            if win_end is not None:\n                paid += win_end - win_start\n            win_start, win_end = s, max(e, s + guarantee)\n            windows += 1\n    if win_end is not None:\n        pass\n    return [paid, windows]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: final window flush 1', [[[0, 30]], 180], [180, 1]),\n  ('regression variant: final window flush 2', [[[1580, 1595], [1760, 1960], [1400, 1460]], 120], [440, 3]),\n  ('partial repair guard 3', [[[100, 130], [130, 370]], 180], [270, 1]),\n  ('boundary control 4', [[[0, 240]], 180], [240, 1]),\n  ('boundary control 5', [[[0, 30], [180, 200]], 180], [360, 2]),\n  ('normal control 6', [[[0, 200], [181, 241]], 240], [241, 1]),\n  ('normal control 7', [[[639, 879], [100, 130], [460, 490], [279, 479]], 180], [630, 2]),\n  ('normal control 8', [[[0, 240], [779, 1019], [600, 800]], 180], [659, 2])],\n [('regression: final window flush 1', [[[0, 30], [180, 200]], 180], [360, 2]),\n  ('regression variant: final window flush 2', [[[100, 340]], 120], [240, 1]),\n  ('partial repair guard 3', [[[280, 295], [880, 1120], [100, 340]], 120], [480, 2]),\n  ('boundary control 4', [[], 180], [0, 0]), ('boundary control 5', [[[0, 30], [60, 400]], 180], [400, 1]),\n  ('normal control 6', [[[1940, 2180], [1400, 1460], [1700, 1940]], 180], [660, 3]),\n  ('normal control 7', [[[100, 130]], 180], [180, 1]),\n  ('normal control 8', [[[0, 15], [150, 270]], 240], [270, 1])],\n [('regression: final window flush 1', [[[0, 30], [179, 200]], 180], [200, 1]),\n  ('regression variant: final window flush 2', [[[160, 280], [760, 820], [130, 250], [100, 340]], 120],\n   [360, 2]),\n  ('partial repair guard 3', [[[0, 200], [869, 1109], [179, 379], [779, 979]], 180], [709, 2]),\n  ('boundary control 4', [[[0, 30]], 180], [180, 1]),\n  ('normal control 5', [[[371, 611], [100, 130], [190, 205]], 180], [420, 2]),\n  ('normal control 6', [[[490, 730], [279, 399], [309, 509], [100, 160]], 120], [571, 2]),\n  ('normal control 7', [[[370, 570], [100, 300], [340, 460]], 240], [480, 2]),\n  ('normal control 8', [[[100, 300], [281, 341], [762, 962], [581, 821]], 240], [622, 2])],\n [('regression: final window flush 1', [[[0, 240]], 180], [240, 1]),\n  ('regression variant: final window flush 2', [[[100, 340], [250, 450], [850, 865]], 240], [590, 2]),\n  ('partial repair guard 3', [[[100, 115], [279, 519]], 240], [419, 1]),\n  ('boundary control 4', [[[300, 330], [0, 30]], 180], [360, 2]),\n  ('normal control 5', [[[150, 390], [0, 30], [390, 630]], 240], [630, 2]),\n  ('normal control 6', [[[100, 115], [250, 310], [430, 550]], 240], [480, 2]),\n  ('normal control 7', [[[310, 510], [130, 190], [491, 731], [100, 115]], 240], [631, 1]),\n  ('normal control 8', [[[1400, 1460], [1640, 1670]], 180], [360, 2])],\n [('regression: final window flush 1', [[[0, 30], [60, 400]], 180], [400, 1]),\n  ('regression variant: final window flush 2', [[[180, 420], [0, 240], [480, 540]], 240], [660, 2]),\n  ('partial repair guard 3', [[[100, 130], [220, 340], [130, 250]], 120], [240, 1]),\n  ('boundary control 4', [[[0, 30], [180, 200]], 180], [360, 2]), ('boundary control 5', [[], 180], [0, 0]),\n  ('normal control 6', [[[370, 570], [100, 115], [130, 190]], 120], [320, 2]),\n  ('normal control 7', [[[310, 510], [130, 190], [491, 731], [100, 115]], 240], [631, 1]),\n  ('normal control 8', [[[360, 480], [0, 30], [179, 239]], 240], [480, 2])]]\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-callback-minimum-guarantee-final-window-flush","generated_at":"2026-09-29T14:52:00.030967+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Callback and show-up minimum-pay rules routinely double pay or underpay when callbacks cluster.","root_cause":"The open window is not flushed into the total after the loop.","sha256":"86a0ac98b84dc810d58caf2fd922fea7adf796fc0bb2484f810f79d83679779e","title":"Last callback window never paid · 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":41.34,"exit_code":1,"observations":[{"actual":[180,1],"check":"regression: final window flush 1","expected":[180,1],"passed":true},{"actual":[360,3],"check":"regression variant: final window flush 2","expected":[440,3],"passed":false},{"actual":[180,1],"check":"partial repair guard 3","expected":[270,1],"passed":false},{"actual":[180,1],"check":"boundary control 4","expected":[240,1],"passed":false},{"actual":[360,2],"check":"boundary control 5","expected":[360,2],"passed":true},{"actual":[240,1],"check":"normal control 6","expected":[241,1],"passed":false},{"actual":[570,2],"check":"normal control 7","expected":[630,2],"passed":false},{"actual":[420,2],"check":"normal control 8","expected":[659,2],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: final window flush 1\", \"actual\": [180, 1], \"expected\": [180, 1], \"passed\": true}, {\"check\": \"regression variant: final window flush 2\", \"actual\": [360, 3], \"expected\": [440, 3], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [180, 1], \"expected\": [270, 1], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [180, 1], \"expected\": [240, 1], \"passed\": false}, {\"check\": \"boundary control 5\", \"actual\": [360, 2], \"expected\": [360, 2], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [240, 1], \"expected\": [241, 1], \"passed\": false}, {\"check\": \"normal control 7\", \"actual\": [570, 2], \"expected\": [630, 2], \"passed\": false}, {\"check\": \"normal control 8\", \"actual\": [420, 2], \"expected\": [659, 2], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.807,"exit_code":1,"observations":[{"actual":[0,1],"check":"regression: final window flush 1","expected":[180,1],"passed":false},{"actual":[240,3],"check":"regression variant: final window flush 2","expected":[440,3],"passed":false},{"actual":[0,1],"check":"partial repair guard 3","expected":[270,1],"passed":false},{"actual":[0,1],"check":"boundary control 4","expected":[240,1],"passed":false},{"actual":[180,2],"check":"boundary control 5","expected":[360,2],"passed":false},{"actual":[0,1],"check":"normal control 6","expected":[241,1],"passed":false},{"actual":[390,2],"check":"normal control 7","expected":[630,2],"passed":false},{"actual":[240,2],"check":"normal control 8","expected":[659,2],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: final window flush 1\", \"actual\": [0, 1], \"expected\": [180, 1], \"passed\": false}, {\"check\": \"regression variant: final window flush 2\", \"actual\": [240, 3], \"expected\": [440, 3], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [0, 1], \"expected\": [270, 1], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [0, 1], \"expected\": [240, 1], \"passed\": false}, {\"check\": \"boundary control 5\", \"actual\": [180, 2], \"expected\": [360, 2], \"passed\": false}, {\"check\": \"normal control 6\", \"actual\": [0, 1], \"expected\": [241, 1], \"passed\": false}, {\"check\": \"normal control 7\", \"actual\": [390, 2], \"expected\": [630, 2], \"passed\": false}, {\"check\": \"normal control 8\", \"actual\": [240, 2], \"expected\": [659, 2], \"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."}}