{"abstract":"Needing 1.3 packs buys one pack.","category":"Recipe scaling and nutrition","checks":8,"contract":"Rows [name, ep_qty, pack_price_cents, pack_size, yield_pct, mode]. Edible portion needs as-purchased ap = ep/(yield/100). mode \"whole\" buys ceil(ap/pack_size) packs at full price; \"bulk\" pays ap/pack_size*price. total_cents = half-up integer of the exact total; per_serving_cents = ceiling of exact total/servings; packs lists whole-pack counts by name.","contract_signature":"items, servings","evaluation_group":"w2-recipe_scaling_and_nutrition-recipe-costing","failed_approach":"int()+1 buys an extra pack when the need is an exact multiple.","family":"w2-recipe_scaling_and_nutrition-recipe-costing-whole-pack-count","id":"FA-97211","implementations":{"attempt":{"sha256":"6d45f51cac4176900e5239e6195aa6ffbc86711235b8cc4a9c391e415547ad1e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(items, servings):\n    total = Fraction(0)\n    packs = {}\n    for name, ep, price, size, y, mode in items:\n        ap = Fraction(ep) / Fraction(y, 100)\n        if mode == 'whole':\n            n = int(ap / size) + 1\n            packs[name] = n\n            total += n * price\n        else:\n            total += ap / size * price\n    return {'total_cents': math.floor(total + Fraction(1, 2)), 'per_serving_cents': math.ceil(total / servings),\n            'packs': packs}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['exact whole pack', [[['beef', 500, 1200, 500, 100, 'whole']], 4],\n   {'packs': {'beef': 1}, 'per_serving_cents': 300, 'total_cents': 1200}],\n  ['trim loss', [[['onion', 90, 99, 100, 90, 'bulk']], 1],\n   {'packs': {}, 'per_serving_cents': 99, 'total_cents': 99}],\n  ['bulk herbs', [[['herbs', 30, 450, 100, 75, 'bulk']], 3],\n   {'packs': {}, 'per_serving_cents': 60, 'total_cents': 180}],\n  ['regression: whole pack count',\n   [[['beef', 3, 249, 6, 50, 'bulk'], ['cream', 100, 249, 500, 50, 'whole'],\n     ['herbs', 900, 1200, 250, 90, 'bulk'], ['lemon', 6, 99, 250, 90, 'whole']],\n    1],\n   {'packs': {'cream': 1, 'lemon': 1}, 'per_serving_cents': 5397, 'total_cents': 5397}],\n  ['repair check: whole pack count',\n   [[['lemon', 400, 99, 500, 80, 'whole'], ['beef', 250, 450, 1000, 85, 'bulk']], 1],\n   {'packs': {'lemon': 1}, 'per_serving_cents': 232, 'total_cents': 231}],\n  ['generated control 1',\n   [[['lemon', 6, 450, 12, 90, 'whole'], ['eggs', 3, 99, 6, 80, 'bulk'], ['cream', 3, 1200, 12, 75, 'bulk']],\n    7],\n   {'packs': {'lemon': 1}, 'per_serving_cents': 131, 'total_cents': 912}],\n  ['generated control 2', [[['beef', 300, 99, 250, 100, 'whole'], ['herbs', 400, 249, 500, 90, 'whole']], 8],\n   {'packs': {'beef': 2, 'herbs': 1}, 'per_serving_cents': 56, 'total_cents': 447}],\n  ['generated control 3', [[['onion', 400, 249, 100, 100, 'bulk'], ['lemon', 300, 1200, 6, 80, 'whole']], 5],\n   {'packs': {'lemon': 63}, 'per_serving_cents': 15320, 'total_cents': 76596}]],\n [['trim loss', [[['onion', 90, 99, 100, 90, 'bulk']], 1],\n   {'packs': {}, 'per_serving_cents': 99, 'total_cents': 99}],\n  ['bulk herbs', [[['herbs', 30, 450, 100, 75, 'bulk']], 3],\n   {'packs': {}, 'per_serving_cents': 60, 'total_cents': 180}],\n  ['exact whole pack', [[['beef', 500, 1200, 500, 100, 'whole']], 4],\n   {'packs': {'beef': 1}, 'per_serving_cents': 300, 'total_cents': 1200}],\n  ['regression: whole pack count',\n   [[['onion', 300, 1200, 1000, 100, 'whole'], ['eggs', 100, 1200, 100, 50, 'whole']], 6],\n   {'packs': {'eggs': 2, 'onion': 1}, 'per_serving_cents': 600, 'total_cents': 3600}],\n  ['repair check: whole pack count',\n   [[['herbs', 900, 249, 6, 85, 'bulk'], ['beef', 50, 1200, 12, 85, 'whole'],\n     ['onion', 300, 450, 1000, 90, 'bulk'], ['lemon', 300, 1200, 6, 100, 'whole']],\n    6],\n   {'packs': {'beef': 5, 'lemon': 50}, 'per_serving_cents': 18349, 'total_cents': 110091}],\n  ['generated control 1',\n   [[['herbs', 6, 450, 12, 80, 'bulk'], ['onion', 100, 249, 12, 75, 'whole'],\n     ['lemon', 3, 450, 1000, 85, 'bulk']],\n    6],\n   {'packs': {'onion': 12}, 'per_serving_cents': 546, 'total_cents': 3271}],\n  ['generated control 2', [[['eggs', 250, 450, 12, 50, 'bulk'], ['cream', 900, 249, 12, 80, 'bulk']], 6],\n   {'packs': {}, 'per_serving_cents': 7016, 'total_cents': 42094}],\n  ['generated control 3', [[['eggs', 100, 99, 500, 100, 'whole'], ['onion', 100, 1200, 100, 50, 'bulk']], 4],\n   {'packs': {'eggs': 1}, 'per_serving_cents': 625, 'total_cents': 2499}]],\n [['bulk herbs', [[['herbs', 30, 450, 100, 75, 'bulk']], 3],\n   {'packs': {}, 'per_serving_cents': 60, 'total_cents': 180}],\n  ['exact whole pack', [[['beef', 500, 1200, 500, 100, 'whole']], 4],\n   {'packs': {'beef': 1}, 'per_serving_cents': 300, 'total_cents': 1200}],\n  ['trim loss', [[['onion', 90, 99, 100, 90, 'bulk']], 1],\n   {'packs': {}, 'per_serving_cents': 99, 'total_cents': 99}],\n  ['regression: whole pack count',\n   [[['herbs', 6, 1200, 250, 80, 'whole'], ['beef', 100, 1200, 1000, 85, 'bulk'],\n     ['cream', 6, 450, 100, 50, 'whole']],\n    2],\n   {'packs': {'cream': 1, 'herbs': 1}, 'per_serving_cents': 896, 'total_cents': 1791}],\n  ['repair check: whole pack count',\n   [[['cream', 900, 249, 12, 100, 'whole'], ['lemon', 50, 99, 1000, 85, 'bulk'],\n     ['herbs', 250, 450, 500, 90, 'whole']],\n    7],\n   {'packs': {'cream': 75, 'herbs': 1}, 'per_serving_cents': 2733, 'total_cents': 19131}],\n  ['generated control 1',\n   [[['eggs', 900, 450, 500, 85, 'whole'], ['herbs', 900, 249, 100, 85, 'bulk'],\n     ['onion', 250, 1200, 250, 85, 'bulk'], ['beef', 6, 450, 12, 100, 'whole']],\n    7],\n   {'packs': {'beef': 1, 'eggs': 3}, 'per_serving_cents': 836, 'total_cents': 5848}],\n  ['generated control 2',\n   [[['beef', 250, 1200, 12, 90, 'bulk'], ['eggs', 400, 450, 500, 50, 'whole'],\n     ['cream', 6, 249, 6, 90, 'bulk']],\n    8],\n   {'packs': {'eggs': 2}, 'per_serving_cents': 3620, 'total_cents': 28954}],\n  ['generated control 3', [[['onion', 900, 99, 100, 80, 'bulk']], 6],\n   {'packs': {}, 'per_serving_cents': 186, 'total_cents': 1114}]],\n [['exact whole pack', [[['beef', 500, 1200, 500, 100, 'whole']], 4],\n   {'packs': {'beef': 1}, 'per_serving_cents': 300, 'total_cents': 1200}],\n  ['trim loss', [[['onion', 90, 99, 100, 90, 'bulk']], 1],\n   {'packs': {}, 'per_serving_cents': 99, 'total_cents': 99}],\n  ['bulk herbs', [[['herbs', 30, 450, 100, 75, 'bulk']], 3],\n   {'packs': {}, 'per_serving_cents': 60, 'total_cents': 180}],\n  ['regression: whole pack count',\n   [[['beef', 100, 1200, 500, 80, 'whole'], ['herbs', 400, 99, 100, 75, 'whole'],\n     ['lemon', 3, 99, 12, 100, 'bulk']],\n    1],\n   {'packs': {'beef': 1, 'herbs': 6}, 'per_serving_cents': 1819, 'total_cents': 1819}],\n  ['repair check: whole pack count',\n   [[['lemon', 250, 99, 6, 50, 'whole'], ['cream', 300, 99, 1000, 50, 'bulk'],\n     ['beef', 250, 249, 100, 50, 'whole'], ['herbs', 6, 450, 100, 75, 'whole']],\n    4],\n   {'packs': {'beef': 5, 'herbs': 1, 'lemon': 84}, 'per_serving_cents': 2518, 'total_cents': 10070}],\n  ['generated control 1', [[['lemon', 250, 1200, 12, 75, 'bulk'], ['cream', 400, 450, 100, 90, 'bulk']], 7],\n   {'packs': {}, 'per_serving_cents': 5048, 'total_cents': 35333}],\n  ['generated control 2', [[['herbs', 3, 1200, 100, 80, 'bulk'], ['eggs', 250, 249, 500, 50, 'bulk']], 3],\n   {'packs': {}, 'per_serving_cents': 98, 'total_cents': 294}],\n  ['generated control 3',\n   [[['herbs', 6, 450, 12, 50, 'bulk'], ['lemon', 6, 450, 100, 50, 'bulk'],\n     ['eggs', 100, 99, 500, 100, 'bulk']],\n    5],\n   {'packs': {}, 'per_serving_cents': 105, 'total_cents': 524}]],\n [['trim loss', [[['onion', 90, 99, 100, 90, 'bulk']], 1],\n   {'packs': {}, 'per_serving_cents': 99, 'total_cents': 99}],\n  ['bulk herbs', [[['herbs', 30, 450, 100, 75, 'bulk']], 3],\n   {'packs': {}, 'per_serving_cents': 60, 'total_cents': 180}],\n  ['exact whole pack', [[['beef', 500, 1200, 500, 100, 'whole']], 4],\n   {'packs': {'beef': 1}, 'per_serving_cents': 300, 'total_cents': 1200}],\n  ['regression: whole pack count',\n   [[['cream', 50, 99, 1000, 100, 'whole'], ['eggs', 400, 249, 6, 100, 'whole'],\n     ['onion', 100, 450, 6, 85, 'bulk']],\n    1],\n   {'packs': {'cream': 1, 'eggs': 67}, 'per_serving_cents': 25606, 'total_cents': 25606}],\n  ['repair check: whole pack count',\n   [[['cream', 250, 450, 500, 90, 'whole'], ['eggs', 3, 450, 500, 50, 'whole'],\n     ['onion', 50, 99, 100, 50, 'whole']],\n    3],\n   {'packs': {'cream': 1, 'eggs': 1, 'onion': 1}, 'per_serving_cents': 333, 'total_cents': 999}],\n  ['generated control 1', [[['herbs', 300, 249, 100, 90, 'bulk']], 8],\n   {'packs': {}, 'per_serving_cents': 104, 'total_cents': 830}],\n  ['generated control 2', [[['onion', 6, 99, 12, 75, 'bulk'], ['cream', 6, 450, 1000, 75, 'bulk']], 2],\n   {'packs': {}, 'per_serving_cents': 35, 'total_cents': 70}],\n  ['generated control 3',\n   [[['lemon', 400, 1200, 250, 80, 'bulk'], ['onion', 50, 99, 500, 50, 'bulk'],\n     ['beef', 900, 249, 250, 90, 'bulk']],\n    2],\n   {'packs': {}, 'per_serving_cents': 1708, 'total_cents': 3416}]]]\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":"696abcf5be3a4752f0324ea6939c61e329764647064bc20a7b5dea068b3d4108","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(items, servings):\n    total = Fraction(0)\n    packs = {}\n    for name, ep, price, size, y, mode in items:\n        ap = Fraction(ep) / Fraction(y, 100)\n        if mode == 'whole':\n            n = math.floor(ap / size + Fraction(1, 2))\n            packs[name] = n\n            total += n * price\n        else:\n            total += ap / size * price\n    return {'total_cents': math.floor(total + Fraction(1, 2)), 'per_serving_cents': math.ceil(total / servings),\n            'packs': packs}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['exact whole pack', [[['beef', 500, 1200, 500, 100, 'whole']], 4],\n   {'packs': {'beef': 1}, 'per_serving_cents': 300, 'total_cents': 1200}],\n  ['trim loss', [[['onion', 90, 99, 100, 90, 'bulk']], 1],\n   {'packs': {}, 'per_serving_cents': 99, 'total_cents': 99}],\n  ['bulk herbs', [[['herbs', 30, 450, 100, 75, 'bulk']], 3],\n   {'packs': {}, 'per_serving_cents': 60, 'total_cents': 180}],\n  ['regression: whole pack count',\n   [[['beef', 3, 249, 6, 50, 'bulk'], ['cream', 100, 249, 500, 50, 'whole'],\n     ['herbs', 900, 1200, 250, 90, 'bulk'], ['lemon', 6, 99, 250, 90, 'whole']],\n    1],\n   {'packs': {'cream': 1, 'lemon': 1}, 'per_serving_cents': 5397, 'total_cents': 5397}],\n  ['repair check: whole pack count',\n   [[['lemon', 400, 99, 500, 80, 'whole'], ['beef', 250, 450, 1000, 85, 'bulk']], 1],\n   {'packs': {'lemon': 1}, 'per_serving_cents': 232, 'total_cents': 231}],\n  ['generated control 1',\n   [[['lemon', 6, 450, 12, 90, 'whole'], ['eggs', 3, 99, 6, 80, 'bulk'], ['cream', 3, 1200, 12, 75, 'bulk']],\n    7],\n   {'packs': {'lemon': 1}, 'per_serving_cents': 131, 'total_cents': 912}],\n  ['generated control 2', [[['beef', 300, 99, 250, 100, 'whole'], ['herbs', 400, 249, 500, 90, 'whole']], 8],\n   {'packs': {'beef': 2, 'herbs': 1}, 'per_serving_cents': 56, 'total_cents': 447}],\n  ['generated control 3', [[['onion', 400, 249, 100, 100, 'bulk'], ['lemon', 300, 1200, 6, 80, 'whole']], 5],\n   {'packs': {'lemon': 63}, 'per_serving_cents': 15320, 'total_cents': 76596}]],\n [['trim loss', [[['onion', 90, 99, 100, 90, 'bulk']], 1],\n   {'packs': {}, 'per_serving_cents': 99, 'total_cents': 99}],\n  ['bulk herbs', [[['herbs', 30, 450, 100, 75, 'bulk']], 3],\n   {'packs': {}, 'per_serving_cents': 60, 'total_cents': 180}],\n  ['exact whole pack', [[['beef', 500, 1200, 500, 100, 'whole']], 4],\n   {'packs': {'beef': 1}, 'per_serving_cents': 300, 'total_cents': 1200}],\n  ['regression: whole pack count',\n   [[['onion', 300, 1200, 1000, 100, 'whole'], ['eggs', 100, 1200, 100, 50, 'whole']], 6],\n   {'packs': {'eggs': 2, 'onion': 1}, 'per_serving_cents': 600, 'total_cents': 3600}],\n  ['repair check: whole pack count',\n   [[['herbs', 900, 249, 6, 85, 'bulk'], ['beef', 50, 1200, 12, 85, 'whole'],\n     ['onion', 300, 450, 1000, 90, 'bulk'], ['lemon', 300, 1200, 6, 100, 'whole']],\n    6],\n   {'packs': {'beef': 5, 'lemon': 50}, 'per_serving_cents': 18349, 'total_cents': 110091}],\n  ['generated control 1',\n   [[['herbs', 6, 450, 12, 80, 'bulk'], ['onion', 100, 249, 12, 75, 'whole'],\n     ['lemon', 3, 450, 1000, 85, 'bulk']],\n    6],\n   {'packs': {'onion': 12}, 'per_serving_cents': 546, 'total_cents': 3271}],\n  ['generated control 2', [[['eggs', 250, 450, 12, 50, 'bulk'], ['cream', 900, 249, 12, 80, 'bulk']], 6],\n   {'packs': {}, 'per_serving_cents': 7016, 'total_cents': 42094}],\n  ['generated control 3', [[['eggs', 100, 99, 500, 100, 'whole'], ['onion', 100, 1200, 100, 50, 'bulk']], 4],\n   {'packs': {'eggs': 1}, 'per_serving_cents': 625, 'total_cents': 2499}]],\n [['bulk herbs', [[['herbs', 30, 450, 100, 75, 'bulk']], 3],\n   {'packs': {}, 'per_serving_cents': 60, 'total_cents': 180}],\n  ['exact whole pack', [[['beef', 500, 1200, 500, 100, 'whole']], 4],\n   {'packs': {'beef': 1}, 'per_serving_cents': 300, 'total_cents': 1200}],\n  ['trim loss', [[['onion', 90, 99, 100, 90, 'bulk']], 1],\n   {'packs': {}, 'per_serving_cents': 99, 'total_cents': 99}],\n  ['regression: whole pack count',\n   [[['herbs', 6, 1200, 250, 80, 'whole'], ['beef', 100, 1200, 1000, 85, 'bulk'],\n     ['cream', 6, 450, 100, 50, 'whole']],\n    2],\n   {'packs': {'cream': 1, 'herbs': 1}, 'per_serving_cents': 896, 'total_cents': 1791}],\n  ['repair check: whole pack count',\n   [[['cream', 900, 249, 12, 100, 'whole'], ['lemon', 50, 99, 1000, 85, 'bulk'],\n     ['herbs', 250, 450, 500, 90, 'whole']],\n    7],\n   {'packs': {'cream': 75, 'herbs': 1}, 'per_serving_cents': 2733, 'total_cents': 19131}],\n  ['generated control 1',\n   [[['eggs', 900, 450, 500, 85, 'whole'], ['herbs', 900, 249, 100, 85, 'bulk'],\n     ['onion', 250, 1200, 250, 85, 'bulk'], ['beef', 6, 450, 12, 100, 'whole']],\n    7],\n   {'packs': {'beef': 1, 'eggs': 3}, 'per_serving_cents': 836, 'total_cents': 5848}],\n  ['generated control 2',\n   [[['beef', 250, 1200, 12, 90, 'bulk'], ['eggs', 400, 450, 500, 50, 'whole'],\n     ['cream', 6, 249, 6, 90, 'bulk']],\n    8],\n   {'packs': {'eggs': 2}, 'per_serving_cents': 3620, 'total_cents': 28954}],\n  ['generated control 3', [[['onion', 900, 99, 100, 80, 'bulk']], 6],\n   {'packs': {}, 'per_serving_cents': 186, 'total_cents': 1114}]],\n [['exact whole pack', [[['beef', 500, 1200, 500, 100, 'whole']], 4],\n   {'packs': {'beef': 1}, 'per_serving_cents': 300, 'total_cents': 1200}],\n  ['trim loss', [[['onion', 90, 99, 100, 90, 'bulk']], 1],\n   {'packs': {}, 'per_serving_cents': 99, 'total_cents': 99}],\n  ['bulk herbs', [[['herbs', 30, 450, 100, 75, 'bulk']], 3],\n   {'packs': {}, 'per_serving_cents': 60, 'total_cents': 180}],\n  ['regression: whole pack count',\n   [[['beef', 100, 1200, 500, 80, 'whole'], ['herbs', 400, 99, 100, 75, 'whole'],\n     ['lemon', 3, 99, 12, 100, 'bulk']],\n    1],\n   {'packs': {'beef': 1, 'herbs': 6}, 'per_serving_cents': 1819, 'total_cents': 1819}],\n  ['repair check: whole pack count',\n   [[['lemon', 250, 99, 6, 50, 'whole'], ['cream', 300, 99, 1000, 50, 'bulk'],\n     ['beef', 250, 249, 100, 50, 'whole'], ['herbs', 6, 450, 100, 75, 'whole']],\n    4],\n   {'packs': {'beef': 5, 'herbs': 1, 'lemon': 84}, 'per_serving_cents': 2518, 'total_cents': 10070}],\n  ['generated control 1', [[['lemon', 250, 1200, 12, 75, 'bulk'], ['cream', 400, 450, 100, 90, 'bulk']], 7],\n   {'packs': {}, 'per_serving_cents': 5048, 'total_cents': 35333}],\n  ['generated control 2', [[['herbs', 3, 1200, 100, 80, 'bulk'], ['eggs', 250, 249, 500, 50, 'bulk']], 3],\n   {'packs': {}, 'per_serving_cents': 98, 'total_cents': 294}],\n  ['generated control 3',\n   [[['herbs', 6, 450, 12, 50, 'bulk'], ['lemon', 6, 450, 100, 50, 'bulk'],\n     ['eggs', 100, 99, 500, 100, 'bulk']],\n    5],\n   {'packs': {}, 'per_serving_cents': 105, 'total_cents': 524}]],\n [['trim loss', [[['onion', 90, 99, 100, 90, 'bulk']], 1],\n   {'packs': {}, 'per_serving_cents': 99, 'total_cents': 99}],\n  ['bulk herbs', [[['herbs', 30, 450, 100, 75, 'bulk']], 3],\n   {'packs': {}, 'per_serving_cents': 60, 'total_cents': 180}],\n  ['exact whole pack', [[['beef', 500, 1200, 500, 100, 'whole']], 4],\n   {'packs': {'beef': 1}, 'per_serving_cents': 300, 'total_cents': 1200}],\n  ['regression: whole pack count',\n   [[['cream', 50, 99, 1000, 100, 'whole'], ['eggs', 400, 249, 6, 100, 'whole'],\n     ['onion', 100, 450, 6, 85, 'bulk']],\n    1],\n   {'packs': {'cream': 1, 'eggs': 67}, 'per_serving_cents': 25606, 'total_cents': 25606}],\n  ['repair check: whole pack count',\n   [[['cream', 250, 450, 500, 90, 'whole'], ['eggs', 3, 450, 500, 50, 'whole'],\n     ['onion', 50, 99, 100, 50, 'whole']],\n    3],\n   {'packs': {'cream': 1, 'eggs': 1, 'onion': 1}, 'per_serving_cents': 333, 'total_cents': 999}],\n  ['generated control 1', [[['herbs', 300, 249, 100, 90, 'bulk']], 8],\n   {'packs': {}, 'per_serving_cents': 104, 'total_cents': 830}],\n  ['generated control 2', [[['onion', 6, 99, 12, 75, 'bulk'], ['cream', 6, 450, 1000, 75, 'bulk']], 2],\n   {'packs': {}, 'per_serving_cents': 35, 'total_cents': 70}],\n  ['generated control 3',\n   [[['lemon', 400, 1200, 250, 80, 'bulk'], ['onion', 50, 99, 500, 50, 'bulk'],\n     ['beef', 900, 249, 250, 90, 'bulk']],\n    2],\n   {'packs': {}, 'per_serving_cents': 1708, 'total_cents': 3416}]]]\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":"A deterministic toy contract stated in full here; it is a bounded teaching model, not an authoritative reference or standards implementation. 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-recipe_scaling_and_nutrition-recipe-costing-whole-pack-count","generated_at":"2026-09-29T14:52:29.993817+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Menu costing converts trimmed edible quantities to purchase quantities and rounds purchases to packs.","root_cause":"Pack counts are rounded to nearest instead of up.","sha256":"683a986c1de7fe4f2aeb6d9909aba53f078a0a01dcc472098d26b98249d1a81d","title":"Recipe cost per serving: whole pack count · 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":49.132,"exit_code":1,"observations":[{"actual":{"packs":{"beef":2},"per_serving_cents":600,"total_cents":2400},"check":"exact whole pack","expected":{"packs":{"beef":1},"per_serving_cents":300,"total_cents":1200},"passed":false},{"actual":{"packs":{},"per_serving_cents":99,"total_cents":99},"check":"trim loss","expected":{"packs":{},"per_serving_cents":99,"total_cents":99},"passed":true},{"actual":{"packs":{},"per_serving_cents":60,"total_cents":180},"check":"bulk herbs","expected":{"packs":{},"per_serving_cents":60,"total_cents":180},"passed":true},{"actual":{"packs":{"cream":1,"lemon":1},"per_serving_cents":5397,"total_cents":5397},"check":"regression: whole pack count","expected":{"packs":{"cream":1,"lemon":1},"per_serving_cents":5397,"total_cents":5397},"passed":true},{"actual":{"packs":{"lemon":2},"per_serving_cents":331,"total_cents":330},"check":"repair check: whole pack count","expected":{"packs":{"lemon":1},"per_serving_cents":232,"total_cents":231},"passed":false},{"actual":{"packs":{"lemon":1},"per_serving_cents":131,"total_cents":912},"check":"generated control 1","expected":{"packs":{"lemon":1},"per_serving_cents":131,"total_cents":912},"passed":true},{"actual":{"packs":{"beef":2,"herbs":1},"per_serving_cents":56,"total_cents":447},"check":"generated control 2","expected":{"packs":{"beef":2,"herbs":1},"per_serving_cents":56,"total_cents":447},"passed":true},{"actual":{"packs":{"lemon":63},"per_serving_cents":15320,"total_cents":76596},"check":"generated control 3","expected":{"packs":{"lemon":63},"per_serving_cents":15320,"total_cents":76596},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"exact whole pack\", \"actual\": {\"total_cents\": 2400, \"per_serving_cents\": 600, \"packs\": {\"beef\": 2}}, \"expected\": {\"packs\": {\"beef\": 1}, \"per_serving_cents\": 300, \"total_cents\": 1200}, \"passed\": false}, {\"check\": \"trim loss\", \"actual\": {\"total_cents\": 99, \"per_serving_cents\": 99, \"packs\": {}}, \"expected\": {\"packs\": {}, \"per_serving_cents\": 99, \"total_cents\": 99}, \"passed\": true}, {\"check\": \"bulk herbs\", \"actual\": {\"total_cents\": 180, \"per_serving_cents\": 60, \"packs\": {}}, \"expected\": {\"packs\": {}, \"per_serving_cents\": 60, \"total_cents\": 180}, \"passed\": true}, {\"check\": \"regression: whole pack count\", \"actual\": {\"total_cents\": 5397, \"per_serving_cents\": 5397, \"packs\": {\"cream\": 1, \"lemon\": 1}}, \"expected\": {\"packs\": {\"cream\": 1, \"lemon\": 1}, \"per_serving_cents\": 5397, \"total_cents\": 5397}, \"passed\": true}, {\"check\": \"repair check: whole pack count\", \"actual\": {\"total_cents\": 330, \"per_serving_cents\": 331, \"packs\": {\"lemon\": 2}}, \"expected\": {\"packs\": {\"lemon\": 1}, \"per_serving_cents\": 232, \"total_cents\": 231}, \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": {\"total_cents\": 912, \"per_serving_cents\": 131, \"packs\": {\"lemon\": 1}}, \"expected\": {\"packs\": {\"lemon\": 1}, \"per_serving_cents\": 131, \"total_cents\": 912}, \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": {\"total_cents\": 447, \"per_serving_cents\": 56, \"packs\": {\"beef\": 2, \"herbs\": 1}}, \"expected\": {\"packs\": {\"beef\": 2, \"herbs\": 1}, \"per_serving_cents\": 56, \"total_cents\": 447}, \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": {\"total_cents\": 76596, \"per_serving_cents\": 15320, \"packs\": {\"lemon\": 63}}, \"expected\": {\"packs\": {\"lemon\": 63}, \"per_serving_cents\": 15320, \"total_cents\": 76596}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":47.555,"exit_code":1,"observations":[{"actual":{"packs":{"beef":1},"per_serving_cents":300,"total_cents":1200},"check":"exact whole pack","expected":{"packs":{"beef":1},"per_serving_cents":300,"total_cents":1200},"passed":true},{"actual":{"packs":{},"per_serving_cents":99,"total_cents":99},"check":"trim loss","expected":{"packs":{},"per_serving_cents":99,"total_cents":99},"passed":true},{"actual":{"packs":{},"per_serving_cents":60,"total_cents":180},"check":"bulk herbs","expected":{"packs":{},"per_serving_cents":60,"total_cents":180},"passed":true},{"actual":{"packs":{"cream":0,"lemon":0},"per_serving_cents":5049,"total_cents":5049},"check":"regression: whole pack count","expected":{"packs":{"cream":1,"lemon":1},"per_serving_cents":5397,"total_cents":5397},"passed":false},{"actual":{"packs":{"lemon":1},"per_serving_cents":232,"total_cents":231},"check":"repair check: whole pack count","expected":{"packs":{"lemon":1},"per_serving_cents":232,"total_cents":231},"passed":true},{"actual":{"packs":{"lemon":1},"per_serving_cents":131,"total_cents":912},"check":"generated control 1","expected":{"packs":{"lemon":1},"per_serving_cents":131,"total_cents":912},"passed":true},{"actual":{"packs":{"beef":1,"herbs":1},"per_serving_cents":44,"total_cents":348},"check":"generated control 2","expected":{"packs":{"beef":2,"herbs":1},"per_serving_cents":56,"total_cents":447},"passed":false},{"actual":{"packs":{"lemon":63},"per_serving_cents":15320,"total_cents":76596},"check":"generated control 3","expected":{"packs":{"lemon":63},"per_serving_cents":15320,"total_cents":76596},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"exact whole pack\", \"actual\": {\"total_cents\": 1200, \"per_serving_cents\": 300, \"packs\": {\"beef\": 1}}, \"expected\": {\"packs\": {\"beef\": 1}, \"per_serving_cents\": 300, \"total_cents\": 1200}, \"passed\": true}, {\"check\": \"trim loss\", \"actual\": {\"total_cents\": 99, \"per_serving_cents\": 99, \"packs\": {}}, \"expected\": {\"packs\": {}, \"per_serving_cents\": 99, \"total_cents\": 99}, \"passed\": true}, {\"check\": \"bulk herbs\", \"actual\": {\"total_cents\": 180, \"per_serving_cents\": 60, \"packs\": {}}, \"expected\": {\"packs\": {}, \"per_serving_cents\": 60, \"total_cents\": 180}, \"passed\": true}, {\"check\": \"regression: whole pack count\", \"actual\": {\"total_cents\": 5049, \"per_serving_cents\": 5049, \"packs\": {\"cream\": 0, \"lemon\": 0}}, \"expected\": {\"packs\": {\"cream\": 1, \"lemon\": 1}, \"per_serving_cents\": 5397, \"total_cents\": 5397}, \"passed\": false}, {\"check\": \"repair check: whole pack count\", \"actual\": {\"total_cents\": 231, \"per_serving_cents\": 232, \"packs\": {\"lemon\": 1}}, \"expected\": {\"packs\": {\"lemon\": 1}, \"per_serving_cents\": 232, \"total_cents\": 231}, \"passed\": true}, {\"check\": \"generated control 1\", \"actual\": {\"total_cents\": 912, \"per_serving_cents\": 131, \"packs\": {\"lemon\": 1}}, \"expected\": {\"packs\": {\"lemon\": 1}, \"per_serving_cents\": 131, \"total_cents\": 912}, \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": {\"total_cents\": 348, \"per_serving_cents\": 44, \"packs\": {\"beef\": 1, \"herbs\": 1}}, \"expected\": {\"packs\": {\"beef\": 2, \"herbs\": 1}, \"per_serving_cents\": 56, \"total_cents\": 447}, \"passed\": false}, {\"check\": \"generated control 3\", \"actual\": {\"total_cents\": 76596, \"per_serving_cents\": 15320, \"packs\": {\"lemon\": 63}}, \"expected\": {\"packs\": {\"lemon\": 63}, \"per_serving_cents\": 15320, \"total_cents\": 76596}, \"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."}}