{"abstract":"Balances go negative and no unapproved minutes are reported.","category":"Shift rostering labor rules","checks":8,"contract":"Per pay period [worked minutes, leave minutes requested]. Accrual is worked * rate_bp / 10000 minutes with the fractional remainder (in 1/10000 minutes) carried to later periods. After accrual the balance is capped (excess forfeited), then the request is approved up to the balance; unapproved minutes accumulate. Return [balance, forfeited, unapproved].","contract_signature":"periods, rate_bp, cap","evaluation_group":"w2-shift-rostering-labor-rules-leave-accrual-ledger","failed_approach":"Limiting by the cap still approves more than the balance.","family":"w2-shift-rostering-labor-rules-leave-accrual-ledger-negative-balance","id":"FA-94141","implementations":{"attempt":{"sha256":"03ab7337062a2566c1e0d47658cb39ba3b054fe47af388f922eb3413f53ad3d6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(periods, rate_bp, cap):\n    bal = carry = forfeit = unappr = 0\n    for worked, used in periods:\n        num = worked * rate_bp + carry\n        bal += num // 10000\n        carry = num % 10000\n        if bal > cap:\n            forfeit += bal - cap\n            bal = cap\n        take = min(used, cap)\n        unappr += used - take\n        bal -= take\n    return [bal, forfeit, unappr]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: negative balance 1', [[[2400, 0], [2400, 500]], 1207, 400], [0, 179, 100]),\n  ('regression variant: negative balance 2',\n   [[[0, 480], [2400, 900], [2280, 0], [0, 900], [2700, 0], [0, 900], [1200, 0], [0, 0]], 769, 400],\n   [92, 0, 2613]),\n  ('partial repair guard 3', [[[1040, 0], [2700, 2000], [0, 480]], 833, 400], [0, 0, 2169]),\n  ('boundary control 4', [[[99, 0], [99, 0], [2, 0]], 5000, 100], [100, 0, 0]),\n  ('boundary control 5', [[[2400, 0], [2400, 0], [2400, 0]], 1207, 11200], [869, 0, 0]),\n  ('normal control 6', [[[0, 480], [2280, 0], [0, 2000], [2400, 0]], 769, 1200], [184, 0, 2305]),\n  ('normal control 7', [[[1956, 2000], [2400, 240], [2400, 0], [2400, 240]], 1000, 600], [240, 0, 1805]),\n  ('normal control 8', [[[2700, 900], [2280, 0], [0, 0], [1674, 0]], 1207, 1200], [478, 0, 575])],\n [('regression: negative balance 1', [[[2400, 400], [0, 400]], 1207, 11200], [0, 0, 511]),\n  ('regression variant: negative balance 2', [[[2280, 2000], [1070, 240], [1200, 0]], 833, 600],\n   [100, 0, 1961]),\n  ('partial repair guard 3', [[[2280, 240], [2280, 240]], 1000, 600], [0, 0, 24]),\n  ('boundary control 4', [[[99, 0], [99, 0], [2, 0]], 5000, 100], [100, 0, 0]),\n  ('normal control 5', [[[1200, 2000], [2700, 0], [2280, 240], [0, 0], [2700, 0]], 833, 600], [400, 0, 1901]),\n  ('normal control 6', [[[2400, 900], [2700, 900], [1200, 900], [2280, 480]], 769, 400], [0, 0, 2521]),\n  ('normal control 7', [[[0, 2000], [0, 2000], [0, 900], [2415, 0], [134, 0], [0, 0], [2400, 0]], 769, 1200],\n   [380, 0, 4900]),\n  ('normal control 8', [[[2700, 0], [2700, 2000]], 833, 1200], [0, 0, 1551])],\n [('regression: negative balance 1',\n   [[[2406, 240], [0, 0], [2700, 2000], [129, 0], [2280, 0], [0, 480], [2700, 0], [2700, 0]], 1000, 600],\n   [540, 0, 1969]),\n  ('regression variant: negative balance 2', [[[1248, 0], [2280, 900], [2700, 0]], 1000, 400], [270, 0, 548]),\n  ('partial repair guard 3', [[[2280, 2000], [1070, 240], [1200, 0]], 833, 600], [100, 0, 1961]),\n  ('boundary control 4', [[[2400, 0], [2400, 500]], 1207, 400], [0, 179, 100]),\n  ('boundary control 5', [[[2400, 400], [0, 400]], 1207, 11200], [0, 0, 511]),\n  ('normal control 6', [[[2700, 900], [1720, 900], [2400, 480], [2700, 0], [1200, 900], [0, 900]], 769, 1200],\n   [0, 0, 3256]),\n  ('normal control 7', [[[2280, 0], [2280, 480], [2280, 2000]], 769, 600], [0, 0, 1955]),\n  ('normal control 8', [[[2400, 2000], [2491, 0]], 1207, 11200], [301, 0, 1711])],\n [('regression: negative balance 1', [[[0, 2000], [0, 0], [2597, 0], [2280, 2000], [2400, 0]], 1207, 400],\n   [290, 188, 3600]),\n  ('regression variant: negative balance 2',\n   [[[1040, 900], [2280, 240], [2400, 240], [2400, 0], [0, 900], [2280, 900], [1200, 240]], 1207, 400],\n   [0, 0, 2020]),\n  ('partial repair guard 3',\n   [[[307, 2000], [1200, 480], [2700, 900], [2700, 2000], [1040, 240], [2400, 0], [2280, 480]], 833, 11200],\n   [0, 0, 5049]),\n  ('boundary control 4', [[[2400, 0], [2400, 0], [2400, 0]], 1207, 11200], [869, 0, 0]),\n  ('boundary control 5', [[[2400, 0], [2400, 500]], 1207, 400], [0, 179, 100]),\n  ('normal control 6', [[[2700, 900], [712, 0], [1717, 0], [2280, 0]], 769, 1200], [362, 0, 693]),\n  ('normal control 7', [[[0, 0], [2400, 0], [337, 900]], 1207, 400], [0, 0, 570]),\n  ('normal control 8', [[[197, 900], [2700, 900]], 1207, 600], [0, 0, 1451])],\n [('regression: negative balance 1',\n   [[[0, 480], [2280, 240], [344, 0], [2700, 240], [2700, 2000]], 833, 1200], [0, 0, 2292]),\n  ('regression variant: negative balance 2', [[[0, 0], [0, 240]], 769, 400], [0, 0, 240]),\n  ('partial repair guard 3', [[[2400, 2000], [2726, 0]], 769, 1200], [210, 0, 1816]),\n  ('boundary control 4', [[[99, 0], [99, 0], [2, 0]], 5000, 100], [100, 0, 0]),\n  ('boundary control 5', [[[2400, 0], [2400, 0], [2400, 0]], 1207, 11200], [869, 0, 0]),\n  ('normal control 6', [[[2700, 0], [1200, 0], [0, 240]], 769, 600], [59, 0, 0]),\n  ('normal control 7', [[[1200, 0], [2400, 0], [0, 240], [2400, 0]], 769, 1200], [221, 0, 0]),\n  ('normal control 8', [[[1200, 2000], [2700, 0], [0, 480], [2400, 480]], 1000, 11200], [0, 0, 2330])]]\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":"03eb3843ccea7307f72080d0871a4c442676d0030b5c3b39134a63b7582fa7ad","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(periods, rate_bp, cap):\n    bal = carry = forfeit = unappr = 0\n    for worked, used in periods:\n        num = worked * rate_bp + carry\n        bal += num // 10000\n        carry = num % 10000\n        if bal > cap:\n            forfeit += bal - cap\n            bal = cap\n        take = used\n        unappr += used - take\n        bal -= take\n    return [bal, forfeit, unappr]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: negative balance 1', [[[2400, 0], [2400, 500]], 1207, 400], [0, 179, 100]),\n  ('regression variant: negative balance 2',\n   [[[0, 480], [2400, 900], [2280, 0], [0, 900], [2700, 0], [0, 900], [1200, 0], [0, 0]], 769, 400],\n   [92, 0, 2613]),\n  ('partial repair guard 3', [[[1040, 0], [2700, 2000], [0, 480]], 833, 400], [0, 0, 2169]),\n  ('boundary control 4', [[[99, 0], [99, 0], [2, 0]], 5000, 100], [100, 0, 0]),\n  ('boundary control 5', [[[2400, 0], [2400, 0], [2400, 0]], 1207, 11200], [869, 0, 0]),\n  ('normal control 6', [[[0, 480], [2280, 0], [0, 2000], [2400, 0]], 769, 1200], [184, 0, 2305]),\n  ('normal control 7', [[[1956, 2000], [2400, 240], [2400, 0], [2400, 240]], 1000, 600], [240, 0, 1805]),\n  ('normal control 8', [[[2700, 900], [2280, 0], [0, 0], [1674, 0]], 1207, 1200], [478, 0, 575])],\n [('regression: negative balance 1', [[[2400, 400], [0, 400]], 1207, 11200], [0, 0, 511]),\n  ('regression variant: negative balance 2', [[[2280, 2000], [1070, 240], [1200, 0]], 833, 600],\n   [100, 0, 1961]),\n  ('partial repair guard 3', [[[2280, 240], [2280, 240]], 1000, 600], [0, 0, 24]),\n  ('boundary control 4', [[[99, 0], [99, 0], [2, 0]], 5000, 100], [100, 0, 0]),\n  ('normal control 5', [[[1200, 2000], [2700, 0], [2280, 240], [0, 0], [2700, 0]], 833, 600], [400, 0, 1901]),\n  ('normal control 6', [[[2400, 900], [2700, 900], [1200, 900], [2280, 480]], 769, 400], [0, 0, 2521]),\n  ('normal control 7', [[[0, 2000], [0, 2000], [0, 900], [2415, 0], [134, 0], [0, 0], [2400, 0]], 769, 1200],\n   [380, 0, 4900]),\n  ('normal control 8', [[[2700, 0], [2700, 2000]], 833, 1200], [0, 0, 1551])],\n [('regression: negative balance 1',\n   [[[2406, 240], [0, 0], [2700, 2000], [129, 0], [2280, 0], [0, 480], [2700, 0], [2700, 0]], 1000, 600],\n   [540, 0, 1969]),\n  ('regression variant: negative balance 2', [[[1248, 0], [2280, 900], [2700, 0]], 1000, 400], [270, 0, 548]),\n  ('partial repair guard 3', [[[2280, 2000], [1070, 240], [1200, 0]], 833, 600], [100, 0, 1961]),\n  ('boundary control 4', [[[2400, 0], [2400, 500]], 1207, 400], [0, 179, 100]),\n  ('boundary control 5', [[[2400, 400], [0, 400]], 1207, 11200], [0, 0, 511]),\n  ('normal control 6', [[[2700, 900], [1720, 900], [2400, 480], [2700, 0], [1200, 900], [0, 900]], 769, 1200],\n   [0, 0, 3256]),\n  ('normal control 7', [[[2280, 0], [2280, 480], [2280, 2000]], 769, 600], [0, 0, 1955]),\n  ('normal control 8', [[[2400, 2000], [2491, 0]], 1207, 11200], [301, 0, 1711])],\n [('regression: negative balance 1', [[[0, 2000], [0, 0], [2597, 0], [2280, 2000], [2400, 0]], 1207, 400],\n   [290, 188, 3600]),\n  ('regression variant: negative balance 2',\n   [[[1040, 900], [2280, 240], [2400, 240], [2400, 0], [0, 900], [2280, 900], [1200, 240]], 1207, 400],\n   [0, 0, 2020]),\n  ('partial repair guard 3',\n   [[[307, 2000], [1200, 480], [2700, 900], [2700, 2000], [1040, 240], [2400, 0], [2280, 480]], 833, 11200],\n   [0, 0, 5049]),\n  ('boundary control 4', [[[2400, 0], [2400, 0], [2400, 0]], 1207, 11200], [869, 0, 0]),\n  ('boundary control 5', [[[2400, 0], [2400, 500]], 1207, 400], [0, 179, 100]),\n  ('normal control 6', [[[2700, 900], [712, 0], [1717, 0], [2280, 0]], 769, 1200], [362, 0, 693]),\n  ('normal control 7', [[[0, 0], [2400, 0], [337, 900]], 1207, 400], [0, 0, 570]),\n  ('normal control 8', [[[197, 900], [2700, 900]], 1207, 600], [0, 0, 1451])],\n [('regression: negative balance 1',\n   [[[0, 480], [2280, 240], [344, 0], [2700, 240], [2700, 2000]], 833, 1200], [0, 0, 2292]),\n  ('regression variant: negative balance 2', [[[0, 0], [0, 240]], 769, 400], [0, 0, 240]),\n  ('partial repair guard 3', [[[2400, 2000], [2726, 0]], 769, 1200], [210, 0, 1816]),\n  ('boundary control 4', [[[99, 0], [99, 0], [2, 0]], 5000, 100], [100, 0, 0]),\n  ('boundary control 5', [[[2400, 0], [2400, 0], [2400, 0]], 1207, 11200], [869, 0, 0]),\n  ('normal control 6', [[[2700, 0], [1200, 0], [0, 240]], 769, 600], [59, 0, 0]),\n  ('normal control 7', [[[1200, 0], [2400, 0], [0, 240], [2400, 0]], 769, 1200], [221, 0, 0]),\n  ('normal control 8', [[[1200, 2000], [2700, 0], [0, 480], [2400, 480]], 1000, 11200], [0, 0, 2330])]]\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-leave-accrual-ledger-negative-balance","generated_at":"2026-09-29T14:52:01.537444+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Leave accrual ledgers attached to rosters must carry fractions and apply caps in the right order.","root_cause":"Requests are approved in full.","sha256":"2614bf33e5f9a4a85ae241d44526c49ceebb1dfcfc531817a9d3134c4ad3eb76","title":"Leave approved beyond the available balance · 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":42.067,"exit_code":1,"observations":[{"actual":[0,179,100],"check":"regression: negative balance 1","expected":[0,179,100],"passed":true},{"actual":[-941,0,1580],"check":"regression variant: negative balance 2","expected":[92,0,2613],"passed":false},{"actual":[-489,0,1680],"check":"partial repair guard 3","expected":[0,0,2169],"passed":false},{"actual":[100,0,0],"check":"boundary control 4","expected":[100,0,0],"passed":true},{"actual":[869,0,0],"check":"boundary control 5","expected":[869,0,0],"passed":true},{"actual":[-1321,0,800],"check":"normal control 6","expected":[184,0,2305],"passed":false},{"actual":[-165,0,1400],"check":"normal control 7","expected":[240,0,1805],"passed":false},{"actual":[-97,0,0],"check":"normal control 8","expected":[478,0,575],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: negative balance 1\", \"actual\": [0, 179, 100], \"expected\": [0, 179, 100], \"passed\": true}, {\"check\": \"regression variant: negative balance 2\", \"actual\": [-941, 0, 1580], \"expected\": [92, 0, 2613], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [-489, 0, 1680], \"expected\": [0, 0, 2169], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [100, 0, 0], \"expected\": [100, 0, 0], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [869, 0, 0], \"expected\": [869, 0, 0], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [-1321, 0, 800], \"expected\": [184, 0, 2305], \"passed\": false}, {\"check\": \"normal control 7\", \"actual\": [-165, 0, 1400], \"expected\": [240, 0, 1805], \"passed\": false}, {\"check\": \"normal control 8\", \"actual\": [-97, 0, 0], \"expected\": [478, 0, 575], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.928,"exit_code":1,"observations":[{"actual":[-100,179,0],"check":"regression: negative balance 1","expected":[0,179,100],"passed":false},{"actual":[-2521,0,0],"check":"regression variant: negative balance 2","expected":[92,0,2613],"passed":false},{"actual":[-2169,0,0],"check":"partial repair guard 3","expected":[0,0,2169],"passed":false},{"actual":[100,0,0],"check":"boundary control 4","expected":[100,0,0],"passed":true},{"actual":[869,0,0],"check":"boundary control 5","expected":[869,0,0],"passed":true},{"actual":[-2121,0,0],"check":"normal control 6","expected":[184,0,2305],"passed":false},{"actual":[-1565,0,0],"check":"normal control 7","expected":[240,0,1805],"passed":false},{"actual":[-97,0,0],"check":"normal control 8","expected":[478,0,575],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: negative balance 1\", \"actual\": [-100, 179, 0], \"expected\": [0, 179, 100], \"passed\": false}, {\"check\": \"regression variant: negative balance 2\", \"actual\": [-2521, 0, 0], \"expected\": [92, 0, 2613], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [-2169, 0, 0], \"expected\": [0, 0, 2169], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [100, 0, 0], \"expected\": [100, 0, 0], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [869, 0, 0], \"expected\": [869, 0, 0], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [-2121, 0, 0], \"expected\": [184, 0, 2305], \"passed\": false}, {\"check\": \"normal control 7\", \"actual\": [-1565, 0, 0], \"expected\": [240, 0, 1805], \"passed\": false}, {\"check\": \"normal control 8\", \"actual\": [-97, 0, 0], \"expected\": [478, 0, 575], \"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."}}