{"abstract":"Allocated tips add up to more than the establishment shortfall.","category":"Payroll withholding rules","checks":8,"contract":"Input {receipts, staff: [[name, hours, reported_tips]]} with positive total hours. Target = 8% of receipts. Shortfall = target - total reported; none -> {}. Each employee's share = target*hours/total_hours; employees reporting less than their share get deficit = share - reported. Shortfall is allocated in proportion to deficits, each rounded half-up. Return {name: cents}.","contract_signature":"x","evaluation_group":"w2-payroll-withholding-tip-shortfall-allocation","failed_approach":"The attempt divides the shortfall equally, ignoring the size of each employee's deficit.","family":"w2-payroll-withholding-tip-shortfall-allocation-proportional-allocation","id":"FA-59296","implementations":{"attempt":{"sha256":"60816200022c4f6e7a0d3c63a8c85b44e083f40ed04b7b53ef43c904e19bcdd8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    target = Fraction(x['receipts'] * 8, 100)\n    reported = sum(e[2] for e in x['staff'])\n    short = target - reported\n    if short <= 0:\n        return {}\n    hours_total = sum(e[1] for e in x['staff'])\n    deficits = {}\n    for name, hrs, rep in x['staff']:\n        share = target * hrs / hours_total\n        if rep < share:\n            deficits[name] = share - rep\n    dsum = sum(deficits.values())\n    out = {}\n    for name, d in deficits.items():\n        out[name] = math.floor(short / len(deficits) + Fraction(1, 2))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression', {'receipts': 377533, 'staff': [['ben', 14, 0], ['eli', 20, 18063], ['dee', 33, 0]]}, {'ben': 3616, 'dee': 8524}), ('regression', {'receipts': 1565828, 'staff': [['eli', 40, 65745], ['cy', 29, 58626]]}, {'eli': 895}), ('partial-repair probe', {'receipts': 1926229, 'staff': [['dee', 20, 0], ['eli', 23, 0], ['ben', 15, 23516], ['ana', 9, 0]]}, {'dee': 45999, 'eli': 52899, 'ben': 10984, 'ana': 20700}), ('partial-repair probe', {'receipts': 580998, 'staff': [['ana', 8, 0], ['ben', 25, 18228]]}, {'ana': 11268, 'ben': 16984}), ('normal control', {'receipts': 296732, 'staff': [['cy', 31, 25635], ['ben', 23, 0], ['ana', 23, 0]]}, {}), ('normal control', {'receipts': 550244, 'staff': [['cy', 19, 57024]]}, {}), ('normal control', {'receipts': 831709, 'staff': [['eli', 25, 0], ['dee', 27, 33872], ['cy', 8, 38931], ['ben', 2, 0]]}, {}), ('normal control', {'receipts': 1484874, 'staff': [['cy', 38, 0], ['dee', 4, 11025], ['eli', 23, 61900], ['ana', 1, 55590]]}, {})], [('regression', {'receipts': 860512, 'staff': [['ben', 24, 0], ['cy', 32, 35203], ['dee', 34, 0]]}, {'ben': 13919, 'dee': 19719}), ('regression', {'receipts': 2631747, 'staff': [['eli', 6, 73067], ['ana', 26, 49452], ['cy', 10, 52106]]}, {'ana': 35915}), ('partial-repair probe', {'receipts': 2678857, 'staff': [['ana', 8, 35721], ['ben', 20, 0]]}, {'ana': 25510, 'ben': 153078}), ('partial-repair probe', {'receipts': 213918, 'staff': [['ben', 40, 0], ['dee', 37, 0]]}, {'ben': 8890, 'dee': 8223}), ('normal control', {'receipts': 414394, 'staff': [['ben', 30, 72971], ['dee', 11, 50779], ['cy', 12, 57744], ['ana', 33, 0], ['eli', 37, 0]]}, {}), ('normal control', {'receipts': 15877, 'staff': [['dee', 2, 0], ['ben', 29, 36864], ['cy', 36, 367]]}, {}), ('normal control', {'receipts': 1019554, 'staff': [['dee', 11, 0]]}, {'dee': 81564}), ('normal control', {'receipts': 325470, 'staff': [['ana', 24, 0], ['dee', 18, 39572]]}, {})], [('regression', {'receipts': 1413750, 'staff': [['cy', 38, 0], ['ben', 3, 12688], ['dee', 7, 0], ['eli', 19, 4470], ['ana', 16, 16347]]}, {'cy': 46731, 'dee': 8608, 'eli': 19332, 'ana': 4923}), ('regression', {'receipts': 377533, 'staff': [['ben', 14, 0], ['eli', 20, 18063], ['dee', 33, 0]]}, {'ben': 3616, 'dee': 8524}), ('partial-repair probe', {'receipts': 789350, 'staff': [['dee', 24, 0], ['ben', 32, 0], ['cy', 33, 0], ['ana', 25, 0]]}, {'dee': 13294, 'ben': 17726, 'cy': 18280, 'ana': 13848}), ('partial-repair probe', {'receipts': 2458851, 'staff': [['cy', 31, 15683], ['ben', 27, 76376]]}, {'cy': 89454, 'ben': 15195}), ('normal control', {'receipts': 1844273, 'staff': [['ben', 6, 9908], ['cy', 2, 35253], ['dee', 0, 47647], ['eli', 24, 54448], ['ana', 19, 60962]]}, {}), ('normal control', {'receipts': 985969, 'staff': [['dee', 16, 0]]}, {'dee': 78878}), ('normal control', {'receipts': 2260421, 'staff': [['cy', 25, 0]]}, {'cy': 180834}), ('normal control', {'receipts': 305915, 'staff': [['ben', 17, 0], ['cy', 35, 49832], ['dee', 14, 0]]}, {})], [('regression', {'receipts': 1211299, 'staff': [['dee', 24, 0], ['cy', 25, 0], ['ana', 31, 56167], ['ben', 39, 0]]}, {'dee': 11110, 'cy': 11573, 'ben': 18054}), ('regression', {'receipts': 2589131, 'staff': [['cy', 0, 9383], ['ana', 9, 74166], ['dee', 1, 54844]]}, {'ana': 68737}), ('partial-repair probe', {'receipts': 2458851, 'staff': [['cy', 31, 15683], ['ben', 27, 76376]]}, {'cy': 89454, 'ben': 15195}), ('partial-repair probe', {'receipts': 1043666, 'staff': [['dee', 21, 0], ['eli', 31, 46444]]}, {'dee': 33718, 'eli': 3331}), ('normal control', {'receipts': 97470, 'staff': [['ana', 8, 0], ['eli', 19, 14113], ['dee', 6, 49117], ['ben', 0, 0], ['cy', 33, 9103]]}, {}), ('normal control', {'receipts': 1562647, 'staff': [['dee', 25, 0], ['ana', 2, 45159], ['ben', 28, 79991], ['eli', 7, 0], ['cy', 29, 0]]}, {}), ('normal control', {'receipts': 498706, 'staff': [['dee', 17, 44639], ['ana', 25, 0], ['cy', 9, 0]]}, {}), ('normal control', {'receipts': 937562, 'staff': [['eli', 3, 44205], ['ana', 5, 63945], ['dee', 2, 72206], ['cy', 27, 6437]]}, {})], [('regression', {'receipts': 936885, 'staff': [['ben', 3, 24165], ['dee', 13, 0], ['cy', 5, 0]]}, {'dee': 36679, 'cy': 14107}), ('regression', {'receipts': 2640630, 'staff': [['eli', 21, 16955], ['dee', 0, 76011]]}, {'eli': 118284}), ('partial-repair probe', {'receipts': 2921186, 'staff': [['cy', 25, 21684], ['dee', 15, 2874], ['eli', 3, 0], ['ana', 20, 0]]}, {'cy': 71052, 'dee': 52768, 'eli': 11128, 'ana': 74189}), ('partial-repair probe', {'receipts': 588846, 'staff': [['ana', 19, 0], ['cy', 28, 19233], ['eli', 8, 0]]}, {'ana': 16274, 'cy': 4749, 'eli': 6852}), ('normal control', {'receipts': 404460, 'staff': [['ben', 32, 0], ['cy', 0, 0]]}, {'ben': 32357}), ('normal control', {'receipts': 2072929, 'staff': [['dee', 16, 65338]]}, {'dee': 100496}), ('normal control', {'receipts': 2549094, 'staff': [['ben', 25, 0]]}, {'ben': 203928}), ('normal control', {'receipts': 207036, 'staff': [['ben', 34, 0], ['ana', 23, 0], ['dee', 36, 46201], ['cy', 28, 10127], ['eli', 18, 74356]]}, {})]]\nfor i, (label, args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (label, i), 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":"58a71c1191d37b5a817af4090878f1540ecb148c78a05993a1c0b815bd56101a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    target = Fraction(x['receipts'] * 8, 100)\n    reported = sum(e[2] for e in x['staff'])\n    short = target - reported\n    if short <= 0:\n        return {}\n    hours_total = sum(e[1] for e in x['staff'])\n    deficits = {}\n    for name, hrs, rep in x['staff']:\n        share = target * hrs / hours_total\n        if rep < share:\n            deficits[name] = share - rep\n    dsum = sum(deficits.values())\n    out = {}\n    for name, d in deficits.items():\n        out[name] = math.floor(d + Fraction(1, 2))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression', {'receipts': 377533, 'staff': [['ben', 14, 0], ['eli', 20, 18063], ['dee', 33, 0]]}, {'ben': 3616, 'dee': 8524}), ('regression', {'receipts': 1565828, 'staff': [['eli', 40, 65745], ['cy', 29, 58626]]}, {'eli': 895}), ('partial-repair probe', {'receipts': 1926229, 'staff': [['dee', 20, 0], ['eli', 23, 0], ['ben', 15, 23516], ['ana', 9, 0]]}, {'dee': 45999, 'eli': 52899, 'ben': 10984, 'ana': 20700}), ('partial-repair probe', {'receipts': 580998, 'staff': [['ana', 8, 0], ['ben', 25, 18228]]}, {'ana': 11268, 'ben': 16984}), ('normal control', {'receipts': 296732, 'staff': [['cy', 31, 25635], ['ben', 23, 0], ['ana', 23, 0]]}, {}), ('normal control', {'receipts': 550244, 'staff': [['cy', 19, 57024]]}, {}), ('normal control', {'receipts': 831709, 'staff': [['eli', 25, 0], ['dee', 27, 33872], ['cy', 8, 38931], ['ben', 2, 0]]}, {}), ('normal control', {'receipts': 1484874, 'staff': [['cy', 38, 0], ['dee', 4, 11025], ['eli', 23, 61900], ['ana', 1, 55590]]}, {})], [('regression', {'receipts': 860512, 'staff': [['ben', 24, 0], ['cy', 32, 35203], ['dee', 34, 0]]}, {'ben': 13919, 'dee': 19719}), ('regression', {'receipts': 2631747, 'staff': [['eli', 6, 73067], ['ana', 26, 49452], ['cy', 10, 52106]]}, {'ana': 35915}), ('partial-repair probe', {'receipts': 2678857, 'staff': [['ana', 8, 35721], ['ben', 20, 0]]}, {'ana': 25510, 'ben': 153078}), ('partial-repair probe', {'receipts': 213918, 'staff': [['ben', 40, 0], ['dee', 37, 0]]}, {'ben': 8890, 'dee': 8223}), ('normal control', {'receipts': 414394, 'staff': [['ben', 30, 72971], ['dee', 11, 50779], ['cy', 12, 57744], ['ana', 33, 0], ['eli', 37, 0]]}, {}), ('normal control', {'receipts': 15877, 'staff': [['dee', 2, 0], ['ben', 29, 36864], ['cy', 36, 367]]}, {}), ('normal control', {'receipts': 1019554, 'staff': [['dee', 11, 0]]}, {'dee': 81564}), ('normal control', {'receipts': 325470, 'staff': [['ana', 24, 0], ['dee', 18, 39572]]}, {})], [('regression', {'receipts': 1413750, 'staff': [['cy', 38, 0], ['ben', 3, 12688], ['dee', 7, 0], ['eli', 19, 4470], ['ana', 16, 16347]]}, {'cy': 46731, 'dee': 8608, 'eli': 19332, 'ana': 4923}), ('regression', {'receipts': 377533, 'staff': [['ben', 14, 0], ['eli', 20, 18063], ['dee', 33, 0]]}, {'ben': 3616, 'dee': 8524}), ('partial-repair probe', {'receipts': 789350, 'staff': [['dee', 24, 0], ['ben', 32, 0], ['cy', 33, 0], ['ana', 25, 0]]}, {'dee': 13294, 'ben': 17726, 'cy': 18280, 'ana': 13848}), ('partial-repair probe', {'receipts': 2458851, 'staff': [['cy', 31, 15683], ['ben', 27, 76376]]}, {'cy': 89454, 'ben': 15195}), ('normal control', {'receipts': 1844273, 'staff': [['ben', 6, 9908], ['cy', 2, 35253], ['dee', 0, 47647], ['eli', 24, 54448], ['ana', 19, 60962]]}, {}), ('normal control', {'receipts': 985969, 'staff': [['dee', 16, 0]]}, {'dee': 78878}), ('normal control', {'receipts': 2260421, 'staff': [['cy', 25, 0]]}, {'cy': 180834}), ('normal control', {'receipts': 305915, 'staff': [['ben', 17, 0], ['cy', 35, 49832], ['dee', 14, 0]]}, {})], [('regression', {'receipts': 1211299, 'staff': [['dee', 24, 0], ['cy', 25, 0], ['ana', 31, 56167], ['ben', 39, 0]]}, {'dee': 11110, 'cy': 11573, 'ben': 18054}), ('regression', {'receipts': 2589131, 'staff': [['cy', 0, 9383], ['ana', 9, 74166], ['dee', 1, 54844]]}, {'ana': 68737}), ('partial-repair probe', {'receipts': 2458851, 'staff': [['cy', 31, 15683], ['ben', 27, 76376]]}, {'cy': 89454, 'ben': 15195}), ('partial-repair probe', {'receipts': 1043666, 'staff': [['dee', 21, 0], ['eli', 31, 46444]]}, {'dee': 33718, 'eli': 3331}), ('normal control', {'receipts': 97470, 'staff': [['ana', 8, 0], ['eli', 19, 14113], ['dee', 6, 49117], ['ben', 0, 0], ['cy', 33, 9103]]}, {}), ('normal control', {'receipts': 1562647, 'staff': [['dee', 25, 0], ['ana', 2, 45159], ['ben', 28, 79991], ['eli', 7, 0], ['cy', 29, 0]]}, {}), ('normal control', {'receipts': 498706, 'staff': [['dee', 17, 44639], ['ana', 25, 0], ['cy', 9, 0]]}, {}), ('normal control', {'receipts': 937562, 'staff': [['eli', 3, 44205], ['ana', 5, 63945], ['dee', 2, 72206], ['cy', 27, 6437]]}, {})], [('regression', {'receipts': 936885, 'staff': [['ben', 3, 24165], ['dee', 13, 0], ['cy', 5, 0]]}, {'dee': 36679, 'cy': 14107}), ('regression', {'receipts': 2640630, 'staff': [['eli', 21, 16955], ['dee', 0, 76011]]}, {'eli': 118284}), ('partial-repair probe', {'receipts': 2921186, 'staff': [['cy', 25, 21684], ['dee', 15, 2874], ['eli', 3, 0], ['ana', 20, 0]]}, {'cy': 71052, 'dee': 52768, 'eli': 11128, 'ana': 74189}), ('partial-repair probe', {'receipts': 588846, 'staff': [['ana', 19, 0], ['cy', 28, 19233], ['eli', 8, 0]]}, {'ana': 16274, 'cy': 4749, 'eli': 6852}), ('normal control', {'receipts': 404460, 'staff': [['ben', 32, 0], ['cy', 0, 0]]}, {'ben': 32357}), ('normal control', {'receipts': 2072929, 'staff': [['dee', 16, 65338]]}, {'dee': 100496}), ('normal control', {'receipts': 2549094, 'staff': [['ben', 25, 0]]}, {'ben': 203928}), ('normal control', {'receipts': 207036, 'staff': [['ben', 34, 0], ['ana', 23, 0], ['dee', 36, 46201], ['cy', 28, 10127], ['eli', 18, 74356]]}, {})]]\nfor i, (label, args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (label, i), 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":"A deterministic teaching model of a stipulated payroll rule with toy thresholds and rates. It makes no claim of conformance to any tax authority, statute or jurisdiction and is not payroll software. 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-payroll-withholding-tip-shortfall-allocation-proportional-allocation","generated_at":"2026-09-29T14:46:34.889581+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Tip allocation assigns reported income on W-2s, and only employees under-reporting their share receive allocations.","root_cause":"Each employee is allocated the full deficit rather than a share of the shortfall.","sha256":"63ee96da7f101cd9dc05b0e50552f1bafb33cc7bb123971736019c1732a8cdf8","title":"Tip shortfall allocation by hours: proportional allocation · 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":44.58,"exit_code":1,"observations":[{"actual":{"ben":6070,"dee":6070},"check":"regression 0","expected":{"ben":3616,"dee":8524},"passed":false},{"actual":{"eli":895},"check":"regression 1","expected":{"eli":895},"passed":true},{"actual":{"ana":32646,"ben":32646,"dee":32646,"eli":32646},"check":"partial-repair probe 2","expected":{"ana":20700,"ben":10984,"dee":45999,"eli":52899},"passed":false},{"actual":{"ana":14126,"ben":14126},"check":"partial-repair probe 3","expected":{"ana":11268,"ben":16984},"passed":false},{"actual":{},"check":"normal control 4","expected":{},"passed":true},{"actual":{},"check":"normal control 5","expected":{},"passed":true},{"actual":{},"check":"normal control 6","expected":{},"passed":true},{"actual":{},"check":"normal control 7","expected":{},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 0\", \"actual\": {\"ben\": 6070, \"dee\": 6070}, \"expected\": {\"ben\": 3616, \"dee\": 8524}, \"passed\": false}, {\"check\": \"regression 1\", \"actual\": {\"eli\": 895}, \"expected\": {\"eli\": 895}, \"passed\": true}, {\"check\": \"partial-repair probe 2\", \"actual\": {\"dee\": 32646, \"eli\": 32646, \"ben\": 32646, \"ana\": 32646}, \"expected\": {\"dee\": 45999, \"eli\": 52899, \"ben\": 10984, \"ana\": 20700}, \"passed\": false}, {\"check\": \"partial-repair probe 3\", \"actual\": {\"ana\": 14126, \"ben\": 14126}, \"expected\": {\"ana\": 11268, \"ben\": 16984}, \"passed\": false}, {\"check\": \"normal control 4\", \"actual\": {}, \"expected\": {}, \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": {}, \"expected\": {}, \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": {}, \"expected\": {}, \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": {}, \"expected\": {}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.055,"exit_code":1,"observations":[{"actual":{"ben":6311,"dee":14876},"check":"regression 0","expected":{"ben":3616,"dee":8524},"passed":false},{"actual":{"eli":6873},"check":"regression 1","expected":{"eli":895},"passed":false},{"actual":{"ana":20700,"ben":10984,"dee":45999,"eli":52899},"check":"partial-repair probe 2","expected":{"ana":20700,"ben":10984,"dee":45999,"eli":52899},"passed":true},{"actual":{"ana":11268,"ben":16984},"check":"partial-repair probe 3","expected":{"ana":11268,"ben":16984},"passed":true},{"actual":{},"check":"normal control 4","expected":{},"passed":true},{"actual":{},"check":"normal control 5","expected":{},"passed":true},{"actual":{},"check":"normal control 6","expected":{},"passed":true},{"actual":{},"check":"normal control 7","expected":{},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 0\", \"actual\": {\"ben\": 6311, \"dee\": 14876}, \"expected\": {\"ben\": 3616, \"dee\": 8524}, \"passed\": false}, {\"check\": \"regression 1\", \"actual\": {\"eli\": 6873}, \"expected\": {\"eli\": 895}, \"passed\": false}, {\"check\": \"partial-repair probe 2\", \"actual\": {\"dee\": 45999, \"eli\": 52899, \"ben\": 10984, \"ana\": 20700}, \"expected\": {\"dee\": 45999, \"eli\": 52899, \"ben\": 10984, \"ana\": 20700}, \"passed\": true}, {\"check\": \"partial-repair probe 3\", \"actual\": {\"ana\": 11268, \"ben\": 16984}, \"expected\": {\"ana\": 11268, \"ben\": 16984}, \"passed\": true}, {\"check\": \"normal control 4\", \"actual\": {}, \"expected\": {}, \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": {}, \"expected\": {}, \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": {}, \"expected\": {}, \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": {}, \"expected\": {}, \"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."}}