{"abstract":"Short records understate the average when fewer weeks are available.","category":"Shift rostering labor rules","checks":8,"contract":"Weeks [worked minutes, excluded leave/sick days]. The reference period needs ref counted weeks: weeks with any excluded day are skipped and replaced by following weeks. If fewer weeks are available, average the counted weeks. Return [counted weeks, floor average, average > limit] or [0, 0, False] when none count.","contract_signature":"weeks, ref, limit","evaluation_group":"w2-shift-rostering-labor-rules-reference-period-average-hours","failed_approach":"Dividing by all supplied weeks includes skipped and unused weeks.","family":"w2-shift-rostering-labor-rules-reference-period-average-hours-average-divisor","id":"FA-94261","implementations":{"attempt":{"sha256":"d7f2b2c6abe1136349526970bc9e1e7128611893112037b66b3770a29c76f270","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(weeks, ref, limit):\n    counted = []\n    for m, ex in weeks:\n        if len(counted) == ref:\n            break\n        if ex == 0:\n            counted.append(m)\n    if not counted:\n        return [0, 0, False]\n    avg = sum(counted) // len(weeks)\n    return [len(counted), avg, avg > limit]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: average divisor 1', [[[2000, 1], [3000, 0]], 3, 2880], [1, 3000, True]),\n  ('regression variant: average divisor 2', [[[0, 0], [2400, 0], [0, 1], [2881, 3]], 5, 2880],\n   [2, 1200, False]),\n  ('partial repair guard 3',\n   [[[3300, 0], [3000, 5], [3300, 0], [0, 7], [0, 3], [1800, 0], [2400, 0], [0, 0], [2400, 7]], 3, 2880],\n   [3, 2800, False]),\n  ('boundary control 4', [[[2880, 0], [2880, 0], [2880, 0]], 3, 2880], [3, 2880, False]),\n  ('normal control 5',\n   [[[2400, 0], [3300, 0], [1800, 1], [2400, 5], [1800, 5], [2400, 5], [0, 0], [0, 5], [3000, 0]], 5, 2880],\n   [4, 2175, False]),\n  ('normal control 6',\n   [[[0, 7], [1800, 5], [1800, 0], [2400, 0], [2400, 7], [2881, 0], [2881, 0], [2400, 7], [2880, 0]], 5,\n    2880],\n   [5, 2568, False]),\n  ('normal control 7', [[[1800, 3], [2880, 0], [2880, 0], [2400, 7]], 3, 2880], [2, 2880, False]),\n  ('normal control 8', [[[2881, 0], [3300, 0], [0, 0]], 3, 2880], [3, 2060, False])],\n [('regression: average divisor 1', [[[2881, 3], [3300, 3], [3000, 0], [3000, 3], [2400, 7]], 4, 2880],\n   [1, 3000, True]),\n  ('regression variant: average divisor 2',\n   [[[2880, 5], [3000, 0], [2400, 0], [2880, 5], [3300, 5], [0, 0], [2881, 0]], 5, 2880], [4, 2070, False]),\n  ('partial repair guard 3',\n   [[[3300, 3], [0, 3], [0, 0], [2880, 5], [3000, 5], [1800, 3], [1800, 0], [2400, 0], [1800, 7]], 4, 2880],\n   [3, 1400, False]),\n  ('boundary control 4', [[[3000, 0], [1000, 2], [3000, 0], [3000, 0]], 3, 2880], [3, 3000, True]),\n  ('boundary control 5', [[[2000, 1], [3000, 0]], 3, 2880], [1, 3000, True]),\n  ('normal control 6', [[[2881, 5], [1800, 0], [2880, 0], [2880, 1], [3300, 0], [1800, 0]], 4, 2880],\n   [4, 2445, False]),\n  ('normal control 7', [[[3000, 0], [2880, 1], [2881, 3], [0, 0]], 5, 2880], [2, 1500, False]),\n  ('normal control 8', [[[3300, 0], [1800, 3], [3000, 3]], 4, 2880], [1, 3300, True])],\n [('regression: average divisor 1',\n   [[[2881, 0], [2880, 3], [3000, 3], [1800, 1], [0, 7], [1800, 0]], 4, 2880], [2, 2340, False]),\n  ('regression variant: average divisor 2',\n   [[[0, 7], [3300, 0], [2881, 3], [2881, 3], [2881, 0], [1800, 3], [0, 7], [0, 5]], 5, 2880],\n   [2, 3090, True]),\n  ('partial repair guard 3',\n   [[[0, 1], [2880, 0], [2880, 0], [0, 5], [1800, 3], [2400, 7], [3000, 1], [2881, 7], [2880, 5]], 3, 2880],\n   [2, 2880, False]),\n  ('boundary control 4', [[[3000, 0], [0, 7], [2800, 0], [2900, 0]], 3, 2880], [3, 2900, True]),\n  ('boundary control 5', [[[3000, 0], [1000, 2], [3000, 0], [3000, 0]], 3, 2880], [3, 3000, True]),\n  ('normal control 6', [[[3000, 5], [0, 0], [2400, 0], [2881, 7], [2881, 1], [1800, 3]], 5, 2880],\n   [2, 1200, False]),\n  ('normal control 7', [[[3300, 3], [0, 0], [0, 0], [2880, 7]], 4, 2880], [2, 0, False]),\n  ('normal control 8', [[[1800, 0], [0, 0], [3000, 0]], 3, 2880], [3, 1600, False])],\n [('regression: average divisor 1', [[[1800, 0], [2881, 0], [2881, 1], [0, 1], [2400, 0]], 4, 2880],\n   [3, 2360, False]),\n  ('regression variant: average divisor 2', [[[3300, 0], [0, 0], [2881, 0]], 5, 2880], [3, 2060, False]),\n  ('partial repair guard 3', [[[3300, 5], [2400, 5], [2400, 0], [2881, 5], [3000, 7], [2881, 0]], 4, 2880],\n   [2, 2640, False]),\n  ('boundary control 4', [[[2880, 0], [2880, 0], [2880, 0]], 3, 2880], [3, 2880, False]),\n  ('boundary control 5', [[[3000, 0], [0, 7], [2800, 0], [2900, 0]], 3, 2880], [3, 2900, True]),\n  ('normal control 6', [[[2880, 1], [2400, 1], [1800, 3], [2881, 0], [3000, 0], [0, 5]], 5, 2880],\n   [2, 2940, True]),\n  ('normal control 7', [[[3000, 5], [0, 0], [2400, 0], [2881, 7], [2881, 1], [1800, 3]], 5, 2880],\n   [2, 1200, False]),\n  ('normal control 8', [[[1800, 0], [1800, 7], [2400, 0], [0, 0], [2400, 7], [2400, 0], [2881, 0]], 5, 2880],\n   [5, 1896, False])],\n [('regression: average divisor 1',\n   [[[0, 1], [0, 3], [3300, 0], [3000, 5], [2880, 0], [3300, 3], [3300, 1]], 3, 2880], [2, 3090, True]),\n  ('regression variant: average divisor 2',\n   [[[2881, 5], [1800, 0], [2881, 7], [1800, 1], [3000, 0]], 5, 2880], [2, 2400, False]),\n  ('partial repair guard 3', [[[2881, 0], [3300, 7], [2880, 0]], 5, 2880], [2, 2880, False]),\n  ('boundary control 4', [[[2000, 1], [3000, 0]], 3, 2880], [1, 3000, True]),\n  ('boundary control 5', [[[2880, 0], [2880, 0], [2880, 0]], 3, 2880], [3, 2880, False]),\n  ('normal control 6', [[[1800, 1], [3300, 0], [2881, 0]], 3, 2880], [2, 3090, True]),\n  ('normal control 7', [[[0, 0], [2880, 0], [3000, 3], [3300, 0]], 3, 2880], [3, 2060, False]),\n  ('normal control 8', [[[3300, 5], [2400, 5], [2400, 0], [2881, 5], [3000, 7], [2881, 0]], 4, 2880],\n   [2, 2640, False])]]\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":"429733cd993f672a38aad78de05481191cd7714117763aeb3f7aad9f41ec37ba","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(weeks, ref, limit):\n    counted = []\n    for m, ex in weeks:\n        if len(counted) == ref:\n            break\n        if ex == 0:\n            counted.append(m)\n    if not counted:\n        return [0, 0, False]\n    avg = sum(counted) // ref\n    return [len(counted), avg, avg > limit]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: average divisor 1', [[[2000, 1], [3000, 0]], 3, 2880], [1, 3000, True]),\n  ('regression variant: average divisor 2', [[[0, 0], [2400, 0], [0, 1], [2881, 3]], 5, 2880],\n   [2, 1200, False]),\n  ('partial repair guard 3',\n   [[[3300, 0], [3000, 5], [3300, 0], [0, 7], [0, 3], [1800, 0], [2400, 0], [0, 0], [2400, 7]], 3, 2880],\n   [3, 2800, False]),\n  ('boundary control 4', [[[2880, 0], [2880, 0], [2880, 0]], 3, 2880], [3, 2880, False]),\n  ('normal control 5',\n   [[[2400, 0], [3300, 0], [1800, 1], [2400, 5], [1800, 5], [2400, 5], [0, 0], [0, 5], [3000, 0]], 5, 2880],\n   [4, 2175, False]),\n  ('normal control 6',\n   [[[0, 7], [1800, 5], [1800, 0], [2400, 0], [2400, 7], [2881, 0], [2881, 0], [2400, 7], [2880, 0]], 5,\n    2880],\n   [5, 2568, False]),\n  ('normal control 7', [[[1800, 3], [2880, 0], [2880, 0], [2400, 7]], 3, 2880], [2, 2880, False]),\n  ('normal control 8', [[[2881, 0], [3300, 0], [0, 0]], 3, 2880], [3, 2060, False])],\n [('regression: average divisor 1', [[[2881, 3], [3300, 3], [3000, 0], [3000, 3], [2400, 7]], 4, 2880],\n   [1, 3000, True]),\n  ('regression variant: average divisor 2',\n   [[[2880, 5], [3000, 0], [2400, 0], [2880, 5], [3300, 5], [0, 0], [2881, 0]], 5, 2880], [4, 2070, False]),\n  ('partial repair guard 3',\n   [[[3300, 3], [0, 3], [0, 0], [2880, 5], [3000, 5], [1800, 3], [1800, 0], [2400, 0], [1800, 7]], 4, 2880],\n   [3, 1400, False]),\n  ('boundary control 4', [[[3000, 0], [1000, 2], [3000, 0], [3000, 0]], 3, 2880], [3, 3000, True]),\n  ('boundary control 5', [[[2000, 1], [3000, 0]], 3, 2880], [1, 3000, True]),\n  ('normal control 6', [[[2881, 5], [1800, 0], [2880, 0], [2880, 1], [3300, 0], [1800, 0]], 4, 2880],\n   [4, 2445, False]),\n  ('normal control 7', [[[3000, 0], [2880, 1], [2881, 3], [0, 0]], 5, 2880], [2, 1500, False]),\n  ('normal control 8', [[[3300, 0], [1800, 3], [3000, 3]], 4, 2880], [1, 3300, True])],\n [('regression: average divisor 1',\n   [[[2881, 0], [2880, 3], [3000, 3], [1800, 1], [0, 7], [1800, 0]], 4, 2880], [2, 2340, False]),\n  ('regression variant: average divisor 2',\n   [[[0, 7], [3300, 0], [2881, 3], [2881, 3], [2881, 0], [1800, 3], [0, 7], [0, 5]], 5, 2880],\n   [2, 3090, True]),\n  ('partial repair guard 3',\n   [[[0, 1], [2880, 0], [2880, 0], [0, 5], [1800, 3], [2400, 7], [3000, 1], [2881, 7], [2880, 5]], 3, 2880],\n   [2, 2880, False]),\n  ('boundary control 4', [[[3000, 0], [0, 7], [2800, 0], [2900, 0]], 3, 2880], [3, 2900, True]),\n  ('boundary control 5', [[[3000, 0], [1000, 2], [3000, 0], [3000, 0]], 3, 2880], [3, 3000, True]),\n  ('normal control 6', [[[3000, 5], [0, 0], [2400, 0], [2881, 7], [2881, 1], [1800, 3]], 5, 2880],\n   [2, 1200, False]),\n  ('normal control 7', [[[3300, 3], [0, 0], [0, 0], [2880, 7]], 4, 2880], [2, 0, False]),\n  ('normal control 8', [[[1800, 0], [0, 0], [3000, 0]], 3, 2880], [3, 1600, False])],\n [('regression: average divisor 1', [[[1800, 0], [2881, 0], [2881, 1], [0, 1], [2400, 0]], 4, 2880],\n   [3, 2360, False]),\n  ('regression variant: average divisor 2', [[[3300, 0], [0, 0], [2881, 0]], 5, 2880], [3, 2060, False]),\n  ('partial repair guard 3', [[[3300, 5], [2400, 5], [2400, 0], [2881, 5], [3000, 7], [2881, 0]], 4, 2880],\n   [2, 2640, False]),\n  ('boundary control 4', [[[2880, 0], [2880, 0], [2880, 0]], 3, 2880], [3, 2880, False]),\n  ('boundary control 5', [[[3000, 0], [0, 7], [2800, 0], [2900, 0]], 3, 2880], [3, 2900, True]),\n  ('normal control 6', [[[2880, 1], [2400, 1], [1800, 3], [2881, 0], [3000, 0], [0, 5]], 5, 2880],\n   [2, 2940, True]),\n  ('normal control 7', [[[3000, 5], [0, 0], [2400, 0], [2881, 7], [2881, 1], [1800, 3]], 5, 2880],\n   [2, 1200, False]),\n  ('normal control 8', [[[1800, 0], [1800, 7], [2400, 0], [0, 0], [2400, 7], [2400, 0], [2881, 0]], 5, 2880],\n   [5, 1896, False])],\n [('regression: average divisor 1',\n   [[[0, 1], [0, 3], [3300, 0], [3000, 5], [2880, 0], [3300, 3], [3300, 1]], 3, 2880], [2, 3090, True]),\n  ('regression variant: average divisor 2',\n   [[[2881, 5], [1800, 0], [2881, 7], [1800, 1], [3000, 0]], 5, 2880], [2, 2400, False]),\n  ('partial repair guard 3', [[[2881, 0], [3300, 7], [2880, 0]], 5, 2880], [2, 2880, False]),\n  ('boundary control 4', [[[2000, 1], [3000, 0]], 3, 2880], [1, 3000, True]),\n  ('boundary control 5', [[[2880, 0], [2880, 0], [2880, 0]], 3, 2880], [3, 2880, False]),\n  ('normal control 6', [[[1800, 1], [3300, 0], [2881, 0]], 3, 2880], [2, 3090, True]),\n  ('normal control 7', [[[0, 0], [2880, 0], [3000, 3], [3300, 0]], 3, 2880], [3, 2060, False]),\n  ('normal control 8', [[[3300, 5], [2400, 5], [2400, 0], [2881, 5], [3000, 7], [2881, 0]], 4, 2880],\n   [2, 2640, False])]]\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-reference-period-average-hours-average-divisor","generated_at":"2026-09-29T14:52:02.667364+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Averaged weekly-hours limits require excluding leave weeks and extending the reference period.","root_cause":"The divisor is ref rather than the number of counted weeks.","sha256":"f5cead5fcc0da001159e8d4a504098b3bc13d60731546d7b64bbd2b0c366ec22","title":"Average divides by the nominal reference length · 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.416,"exit_code":1,"observations":[{"actual":[1,1500,false],"check":"regression: average divisor 1","expected":[1,3000,true],"passed":false},{"actual":[2,600,false],"check":"regression variant: average divisor 2","expected":[2,1200,false],"passed":false},{"actual":[3,933,false],"check":"partial repair guard 3","expected":[3,2800,false],"passed":false},{"actual":[3,2880,false],"check":"boundary control 4","expected":[3,2880,false],"passed":true},{"actual":[4,966,false],"check":"normal control 5","expected":[4,2175,false],"passed":false},{"actual":[5,1426,false],"check":"normal control 6","expected":[5,2568,false],"passed":false},{"actual":[2,1440,false],"check":"normal control 7","expected":[2,2880,false],"passed":false},{"actual":[3,2060,false],"check":"normal control 8","expected":[3,2060,false],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: average divisor 1\", \"actual\": [1, 1500, false], \"expected\": [1, 3000, true], \"passed\": false}, {\"check\": \"regression variant: average divisor 2\", \"actual\": [2, 600, false], \"expected\": [2, 1200, false], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [3, 933, false], \"expected\": [3, 2800, false], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [3, 2880, false], \"expected\": [3, 2880, false], \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": [4, 966, false], \"expected\": [4, 2175, false], \"passed\": false}, {\"check\": \"normal control 6\", \"actual\": [5, 1426, false], \"expected\": [5, 2568, false], \"passed\": false}, {\"check\": \"normal control 7\", \"actual\": [2, 1440, false], \"expected\": [2, 2880, false], \"passed\": false}, {\"check\": \"normal control 8\", \"actual\": [3, 2060, false], \"expected\": [3, 2060, false], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.397,"exit_code":1,"observations":[{"actual":[1,1000,false],"check":"regression: average divisor 1","expected":[1,3000,true],"passed":false},{"actual":[2,480,false],"check":"regression variant: average divisor 2","expected":[2,1200,false],"passed":false},{"actual":[3,2800,false],"check":"partial repair guard 3","expected":[3,2800,false],"passed":true},{"actual":[3,2880,false],"check":"boundary control 4","expected":[3,2880,false],"passed":true},{"actual":[4,1740,false],"check":"normal control 5","expected":[4,2175,false],"passed":false},{"actual":[5,2568,false],"check":"normal control 6","expected":[5,2568,false],"passed":true},{"actual":[2,1920,false],"check":"normal control 7","expected":[2,2880,false],"passed":false},{"actual":[3,2060,false],"check":"normal control 8","expected":[3,2060,false],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: average divisor 1\", \"actual\": [1, 1000, false], \"expected\": [1, 3000, true], \"passed\": false}, {\"check\": \"regression variant: average divisor 2\", \"actual\": [2, 480, false], \"expected\": [2, 1200, false], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [3, 2800, false], \"expected\": [3, 2800, false], \"passed\": true}, {\"check\": \"boundary control 4\", \"actual\": [3, 2880, false], \"expected\": [3, 2880, false], \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": [4, 1740, false], \"expected\": [4, 2175, false], \"passed\": false}, {\"check\": \"normal control 6\", \"actual\": [5, 2568, false], \"expected\": [5, 2568, false], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [2, 1920, false], \"expected\": [2, 2880, false], \"passed\": false}, {\"check\": \"normal control 8\", \"actual\": [3, 2060, false], \"expected\": [3, 2060, false], \"passed\": true}], \"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."}}