{"abstract":"A mis-keyed out punch earlier than the in punch deducts time from the week.","category":"Shift rostering labor rules","checks":8,"contract":"Scheduled [start, end] and raw punches in minutes. A punch in at most 7 minutes before the scheduled start is treated as the start; a punch out at most 7 minutes after the scheduled end is treated as the end. Then each time is rounded to the quarter hour: remainder 0-7 down, 8-14 up. Return [in, out, max(out - in, 0)].","evaluation_group":"w2-shift-rostering-labor-rules-punch-rounding-grace","failed_approach":"Taking the absolute value pays time for a reversed pair.","family":"w2-shift-rostering-labor-rules-punch-rounding-grace-negative-duration-clamp","id":"FA-94166","implementations":{"attempt":{"sha256":"13a5b9f66e53cf73e4862e323aa215f12388628d6ca7ea34d69716710cd82806","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(sched, punch_in, punch_out):\n    start, end = sched\n    def q(t):\n        r = t % 15\n        return t - r if r <= 7 else t + 15 - r\n    i = start if 0 < start - punch_in <= 7 else punch_in\n    o = end if 0 < punch_out - end <= 7 else punch_out\n    i, o = q(i), q(o)\n    return [i, o, abs(o - i)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: negative duration clamp 1', [[487, 967], 495, 474], [495, 480, 0]),\n  ('regression variant: negative duration clamp 2', [[420, 660], 413, 391], [420, 390, 0]),\n  ('partial repair guard 3', [[540, 780], 533, 508], [540, 510, 0]),\n  ('boundary control 4', [[480, 960], 488, 952], [495, 945, 450]),\n  ('boundary control 5', [[480, 960], 487, 953], [480, 960, 480]),\n  ('normal control 6', [[420, 900], 415, 396], [420, 390, 0]),\n  ('normal control 7', [[600, 840], 609, 847], [615, 840, 225]),\n  ('normal control 8', [[600, 840], 593, 565], [600, 570, 0])],\n [('regression: negative duration clamp 1', [[480, 720], 483, 454], [480, 450, 0]),\n  ('regression variant: negative duration clamp 2', [[420, 930], 427, 400], [420, 405, 0]),\n  ('partial repair guard 3', [[600, 1080], 595, 577], [600, 570, 0]),\n  ('boundary control 4', [[480, 960], 473, 967], [480, 960, 480]),\n  ('boundary control 5', [[480, 960], 500, 490], [495, 495, 0]),\n  ('normal control 6', [[540, 1050], 532, 527], [525, 525, 0]),\n  ('normal control 7', [[420, 660], 429, 659], [435, 660, 225]),\n  ('normal control 8', [[420, 930], 427, 929], [420, 930, 510])],\n [('regression: negative duration clamp 1', [[487, 727], 479, 464], [480, 465, 0]),\n  ('regression variant: negative duration clamp 2', [[487, 967], 482, 464], [480, 465, 0]),\n  ('partial repair guard 3', [[540, 1020], 539, 514], [540, 510, 0]),\n  ('boundary control 4', [[480, 960], 488, 952], [495, 945, 450]),\n  ('boundary control 5', [[480, 960], 487, 953], [480, 960, 480]),\n  ('normal control 6', [[480, 990], 487, 991], [480, 990, 510]),\n  ('normal control 7', [[540, 1050], 535, 1051], [540, 1050, 510]),\n  ('normal control 8', [[600, 840], 603, 852], [600, 855, 255])],\n [('regression: negative duration clamp 1', [[420, 900], 423, 402], [420, 405, 0]),\n  ('regression variant: negative duration clamp 2', [[540, 1020], 554, 524], [555, 525, 0]),\n  ('partial repair guard 3', [[480, 990], 480, 462], [480, 465, 0]),\n  ('boundary control 4', [[480, 960], 473, 967], [480, 960, 480]),\n  ('boundary control 5', [[480, 960], 500, 490], [495, 495, 0]),\n  ('normal control 6', [[600, 840], 603, 849], [600, 855, 255]),\n  ('normal control 7', [[487, 967], 482, 461], [480, 465, 0]),\n  ('normal control 8', [[540, 1020], 548, 1025], [555, 1020, 465])],\n [('regression: negative duration clamp 1', [[480, 960], 479, 450], [480, 450, 0]),\n  ('regression variant: negative duration clamp 2', [[480, 720], 483, 454], [480, 450, 0]),\n  ('partial repair guard 3', [[600, 1110], 607, 577], [600, 570, 0]),\n  ('boundary control 4', [[480, 960], 488, 952], [495, 945, 450]),\n  ('boundary control 5', [[480, 960], 487, 953], [480, 960, 480]),\n  ('normal control 6', [[420, 660], 413, 391], [420, 390, 0]),\n  ('normal control 7', [[540, 1020], 532, 1019], [525, 1020, 495]),\n  ('normal control 8', [[480, 990], 460, 438], [465, 435, 0])]]\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":"ef2a0defd33a7f821b5c82982297c66ccee86749ff2fe2b3b38f8fd9a39732db","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(sched, punch_in, punch_out):\n    start, end = sched\n    def q(t):\n        r = t % 15\n        return t - r if r <= 7 else t + 15 - r\n    i = start if 0 < start - punch_in <= 7 else punch_in\n    o = end if 0 < punch_out - end <= 7 else punch_out\n    i, o = q(i), q(o)\n    return [i, o, o - i]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: negative duration clamp 1', [[487, 967], 495, 474], [495, 480, 0]),\n  ('regression variant: negative duration clamp 2', [[420, 660], 413, 391], [420, 390, 0]),\n  ('partial repair guard 3', [[540, 780], 533, 508], [540, 510, 0]),\n  ('boundary control 4', [[480, 960], 488, 952], [495, 945, 450]),\n  ('boundary control 5', [[480, 960], 487, 953], [480, 960, 480]),\n  ('normal control 6', [[420, 900], 415, 396], [420, 390, 0]),\n  ('normal control 7', [[600, 840], 609, 847], [615, 840, 225]),\n  ('normal control 8', [[600, 840], 593, 565], [600, 570, 0])],\n [('regression: negative duration clamp 1', [[480, 720], 483, 454], [480, 450, 0]),\n  ('regression variant: negative duration clamp 2', [[420, 930], 427, 400], [420, 405, 0]),\n  ('partial repair guard 3', [[600, 1080], 595, 577], [600, 570, 0]),\n  ('boundary control 4', [[480, 960], 473, 967], [480, 960, 480]),\n  ('boundary control 5', [[480, 960], 500, 490], [495, 495, 0]),\n  ('normal control 6', [[540, 1050], 532, 527], [525, 525, 0]),\n  ('normal control 7', [[420, 660], 429, 659], [435, 660, 225]),\n  ('normal control 8', [[420, 930], 427, 929], [420, 930, 510])],\n [('regression: negative duration clamp 1', [[487, 727], 479, 464], [480, 465, 0]),\n  ('regression variant: negative duration clamp 2', [[487, 967], 482, 464], [480, 465, 0]),\n  ('partial repair guard 3', [[540, 1020], 539, 514], [540, 510, 0]),\n  ('boundary control 4', [[480, 960], 488, 952], [495, 945, 450]),\n  ('boundary control 5', [[480, 960], 487, 953], [480, 960, 480]),\n  ('normal control 6', [[480, 990], 487, 991], [480, 990, 510]),\n  ('normal control 7', [[540, 1050], 535, 1051], [540, 1050, 510]),\n  ('normal control 8', [[600, 840], 603, 852], [600, 855, 255])],\n [('regression: negative duration clamp 1', [[420, 900], 423, 402], [420, 405, 0]),\n  ('regression variant: negative duration clamp 2', [[540, 1020], 554, 524], [555, 525, 0]),\n  ('partial repair guard 3', [[480, 990], 480, 462], [480, 465, 0]),\n  ('boundary control 4', [[480, 960], 473, 967], [480, 960, 480]),\n  ('boundary control 5', [[480, 960], 500, 490], [495, 495, 0]),\n  ('normal control 6', [[600, 840], 603, 849], [600, 855, 255]),\n  ('normal control 7', [[487, 967], 482, 461], [480, 465, 0]),\n  ('normal control 8', [[540, 1020], 548, 1025], [555, 1020, 465])],\n [('regression: negative duration clamp 1', [[480, 960], 479, 450], [480, 450, 0]),\n  ('regression variant: negative duration clamp 2', [[480, 720], 483, 454], [480, 450, 0]),\n  ('partial repair guard 3', [[600, 1110], 607, 577], [600, 570, 0]),\n  ('boundary control 4', [[480, 960], 488, 952], [495, 945, 450]),\n  ('boundary control 5', [[480, 960], 487, 953], [480, 960, 480]),\n  ('normal control 6', [[420, 660], 413, 391], [420, 390, 0]),\n  ('normal control 7', [[540, 1020], 532, 1019], [525, 1020, 495]),\n  ('normal control 8', [[480, 990], 460, 438], [465, 435, 0])]]\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":"dc81baaabcefce9789aeba264e757618e03ff252607905e7ad4ddc3b1118f377","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(sched, punch_in, punch_out):\n    start, end = sched\n    def q(t):\n        r = t % 15\n        return t - r if r <= 7 else t + 15 - r\n    i = start if 0 < start - punch_in <= 7 else punch_in\n    o = end if 0 < punch_out - end <= 7 else punch_out\n    i, o = q(i), q(o)\n    return [i, o, max(o - i, 0)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: negative duration clamp 1', [[487, 967], 495, 474], [495, 480, 0]),\n  ('regression variant: negative duration clamp 2', [[420, 660], 413, 391], [420, 390, 0]),\n  ('partial repair guard 3', [[540, 780], 533, 508], [540, 510, 0]),\n  ('boundary control 4', [[480, 960], 488, 952], [495, 945, 450]),\n  ('boundary control 5', [[480, 960], 487, 953], [480, 960, 480]),\n  ('normal control 6', [[420, 900], 415, 396], [420, 390, 0]),\n  ('normal control 7', [[600, 840], 609, 847], [615, 840, 225]),\n  ('normal control 8', [[600, 840], 593, 565], [600, 570, 0])],\n [('regression: negative duration clamp 1', [[480, 720], 483, 454], [480, 450, 0]),\n  ('regression variant: negative duration clamp 2', [[420, 930], 427, 400], [420, 405, 0]),\n  ('partial repair guard 3', [[600, 1080], 595, 577], [600, 570, 0]),\n  ('boundary control 4', [[480, 960], 473, 967], [480, 960, 480]),\n  ('boundary control 5', [[480, 960], 500, 490], [495, 495, 0]),\n  ('normal control 6', [[540, 1050], 532, 527], [525, 525, 0]),\n  ('normal control 7', [[420, 660], 429, 659], [435, 660, 225]),\n  ('normal control 8', [[420, 930], 427, 929], [420, 930, 510])],\n [('regression: negative duration clamp 1', [[487, 727], 479, 464], [480, 465, 0]),\n  ('regression variant: negative duration clamp 2', [[487, 967], 482, 464], [480, 465, 0]),\n  ('partial repair guard 3', [[540, 1020], 539, 514], [540, 510, 0]),\n  ('boundary control 4', [[480, 960], 488, 952], [495, 945, 450]),\n  ('boundary control 5', [[480, 960], 487, 953], [480, 960, 480]),\n  ('normal control 6', [[480, 990], 487, 991], [480, 990, 510]),\n  ('normal control 7', [[540, 1050], 535, 1051], [540, 1050, 510]),\n  ('normal control 8', [[600, 840], 603, 852], [600, 855, 255])],\n [('regression: negative duration clamp 1', [[420, 900], 423, 402], [420, 405, 0]),\n  ('regression variant: negative duration clamp 2', [[540, 1020], 554, 524], [555, 525, 0]),\n  ('partial repair guard 3', [[480, 990], 480, 462], [480, 465, 0]),\n  ('boundary control 4', [[480, 960], 473, 967], [480, 960, 480]),\n  ('boundary control 5', [[480, 960], 500, 490], [495, 495, 0]),\n  ('normal control 6', [[600, 840], 603, 849], [600, 855, 255]),\n  ('normal control 7', [[487, 967], 482, 461], [480, 465, 0]),\n  ('normal control 8', [[540, 1020], 548, 1025], [555, 1020, 465])],\n [('regression: negative duration clamp 1', [[480, 960], 479, 450], [480, 450, 0]),\n  ('regression variant: negative duration clamp 2', [[480, 720], 483, 454], [480, 450, 0]),\n  ('partial repair guard 3', [[600, 1110], 607, 577], [600, 570, 0]),\n  ('boundary control 4', [[480, 960], 488, 952], [495, 945, 450]),\n  ('boundary control 5', [[480, 960], 487, 953], [480, 960, 480]),\n  ('normal control 6', [[420, 660], 413, 391], [420, 390, 0]),\n  ('normal control 7', [[540, 1020], 532, 1019], [525, 1020, 495]),\n  ('normal control 8', [[480, 990], 460, 438], [465, 435, 0])]]\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-punch-rounding-grace-negative-duration-clamp","generated_at":"2026-09-29T14:52:01.918899+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Punch rounding and grace periods must be neutral; asymmetric boundaries systematically underpay.","repair":"Clamp paid minutes at zero.","root_cause":"Paid minutes are not clamped at zero.","sha256":"32066c1dbbf2c1cef9bdfb8ed71c47f1860c2e019fc940174e3725e9b7887b64","title":"Reversed punch pair produces negative paid minutes · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.741,"exit_code":1,"observations":[{"actual":[495,480,15],"check":"regression: negative duration clamp 1","expected":[495,480,0],"passed":false},{"actual":[420,390,30],"check":"regression variant: negative duration clamp 2","expected":[420,390,0],"passed":false},{"actual":[540,510,30],"check":"partial repair guard 3","expected":[540,510,0],"passed":false},{"actual":[495,945,450],"check":"boundary control 4","expected":[495,945,450],"passed":true},{"actual":[480,960,480],"check":"boundary control 5","expected":[480,960,480],"passed":true},{"actual":[420,390,30],"check":"normal control 6","expected":[420,390,0],"passed":false},{"actual":[615,840,225],"check":"normal control 7","expected":[615,840,225],"passed":true},{"actual":[600,570,30],"check":"normal control 8","expected":[600,570,0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: negative duration clamp 1\", \"actual\": [495, 480, 15], \"expected\": [495, 480, 0], \"passed\": false}, {\"check\": \"regression variant: negative duration clamp 2\", \"actual\": [420, 390, 30], \"expected\": [420, 390, 0], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [540, 510, 30], \"expected\": [540, 510, 0], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [495, 945, 450], \"expected\": [495, 945, 450], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [480, 960, 480], \"expected\": [480, 960, 480], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [420, 390, 30], \"expected\": [420, 390, 0], \"passed\": false}, {\"check\": \"normal control 7\", \"actual\": [615, 840, 225], \"expected\": [615, 840, 225], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [600, 570, 30], \"expected\": [600, 570, 0], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.611,"exit_code":1,"observations":[{"actual":[495,480,-15],"check":"regression: negative duration clamp 1","expected":[495,480,0],"passed":false},{"actual":[420,390,-30],"check":"regression variant: negative duration clamp 2","expected":[420,390,0],"passed":false},{"actual":[540,510,-30],"check":"partial repair guard 3","expected":[540,510,0],"passed":false},{"actual":[495,945,450],"check":"boundary control 4","expected":[495,945,450],"passed":true},{"actual":[480,960,480],"check":"boundary control 5","expected":[480,960,480],"passed":true},{"actual":[420,390,-30],"check":"normal control 6","expected":[420,390,0],"passed":false},{"actual":[615,840,225],"check":"normal control 7","expected":[615,840,225],"passed":true},{"actual":[600,570,-30],"check":"normal control 8","expected":[600,570,0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: negative duration clamp 1\", \"actual\": [495, 480, -15], \"expected\": [495, 480, 0], \"passed\": false}, {\"check\": \"regression variant: negative duration clamp 2\", \"actual\": [420, 390, -30], \"expected\": [420, 390, 0], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [540, 510, -30], \"expected\": [540, 510, 0], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [495, 945, 450], \"expected\": [495, 945, 450], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [480, 960, 480], \"expected\": [480, 960, 480], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [420, 390, -30], \"expected\": [420, 390, 0], \"passed\": false}, {\"check\": \"normal control 7\", \"actual\": [615, 840, 225], \"expected\": [615, 840, 225], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [600, 570, -30], \"expected\": [600, 570, 0], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.127,"exit_code":0,"observations":[{"actual":[495,480,0],"check":"regression: negative duration clamp 1","expected":[495,480,0],"passed":true},{"actual":[420,390,0],"check":"regression variant: negative duration clamp 2","expected":[420,390,0],"passed":true},{"actual":[540,510,0],"check":"partial repair guard 3","expected":[540,510,0],"passed":true},{"actual":[495,945,450],"check":"boundary control 4","expected":[495,945,450],"passed":true},{"actual":[480,960,480],"check":"boundary control 5","expected":[480,960,480],"passed":true},{"actual":[420,390,0],"check":"normal control 6","expected":[420,390,0],"passed":true},{"actual":[615,840,225],"check":"normal control 7","expected":[615,840,225],"passed":true},{"actual":[600,570,0],"check":"normal control 8","expected":[600,570,0],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: negative duration clamp 1\", \"actual\": [495, 480, 0], \"expected\": [495, 480, 0], \"passed\": true}, {\"check\": \"regression variant: negative duration clamp 2\", \"actual\": [420, 390, 0], \"expected\": [420, 390, 0], \"passed\": true}, {\"check\": \"partial repair guard 3\", \"actual\": [540, 510, 0], \"expected\": [540, 510, 0], \"passed\": true}, {\"check\": \"boundary control 4\", \"actual\": [495, 945, 450], \"expected\": [495, 945, 450], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [480, 960, 480], \"expected\": [480, 960, 480], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [420, 390, 0], \"expected\": [420, 390, 0], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [615, 840, 225], \"expected\": [615, 840, 225], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [600, 570, 0], \"expected\": [600, 570, 0], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}