{"abstract":"Buying 30 g of bulk herbs costs the price of 30 packs.","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":"Dividing by 100 converts cents to dollars inside a cents total.","family":"w2-recipe_scaling_and_nutrition-recipe-costing-bulk-proportional-price","id":"FA-97216","implementations":{"attempt":{"sha256":"0c0bf75d3ef3c6b50f72c08d0f6d9472f6e27fd68e9ebbee04b3cf440e103cd0","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.ceil(ap / size)\n            packs[name] = n\n            total += n * price\n        else:\n            total += ap / size * price / 100\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: bulk proportional price',\n   [[['lemon', 50, 450, 500, 100, 'bulk'], ['herbs', 50, 450, 100, 90, 'whole']], 4],\n   {'packs': {'herbs': 1}, 'per_serving_cents': 124, 'total_cents': 495}],\n  ['repair check: bulk proportional price',\n   [[['cream', 100, 450, 12, 80, 'bulk'], ['eggs', 300, 1200, 1000, 75, 'bulk']], 3],\n   {'packs': {}, 'per_serving_cents': 1723, 'total_cents': 5168}],\n  ['generated control 1', [[['lemon', 6, 1200, 6, 75, 'bulk'], ['herbs', 900, 450, 12, 100, 'bulk']], 8],\n   {'packs': {}, 'per_serving_cents': 4419, 'total_cents': 35350}],\n  ['generated control 2', [[['lemon', 3, 99, 500, 80, 'whole']], 3],\n   {'packs': {'lemon': 1}, 'per_serving_cents': 33, 'total_cents': 99}],\n  ['generated control 3',\n   [[['herbs', 300, 1200, 250, 80, 'whole'], ['cream', 100, 99, 1000, 75, 'whole'],\n     ['onion', 250, 99, 500, 80, 'bulk'], ['lemon', 6, 249, 12, 80, 'whole']],\n    3],\n   {'packs': {'cream': 1, 'herbs': 2, 'lemon': 1}, 'per_serving_cents': 937, 'total_cents': 2810}]],\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: bulk proportional price', [[['beef', 6, 99, 12, 80, 'bulk']], 6],\n   {'packs': {}, 'per_serving_cents': 11, 'total_cents': 62}],\n  ['repair check: bulk proportional price',\n   [[['eggs', 100, 1200, 250, 90, 'whole'], ['herbs', 300, 1200, 12, 90, 'bulk']], 5],\n   {'packs': {'eggs': 1}, 'per_serving_cents': 6907, 'total_cents': 34533}],\n  ['generated control 1',\n   [[['beef', 300, 1200, 100, 100, 'bulk'], ['cream', 400, 450, 250, 100, 'bulk'],\n     ['herbs', 100, 249, 6, 50, 'bulk'], ['lemon', 100, 1200, 500, 50, 'bulk']],\n    5],\n   {'packs': {}, 'per_serving_cents': 2620, 'total_cents': 13100}],\n  ['generated control 2',\n   [[['cream', 300, 249, 100, 80, 'whole'], ['eggs', 900, 1200, 1000, 85, 'bulk'],\n     ['herbs', 250, 249, 250, 90, 'whole'], ['beef', 250, 450, 6, 85, 'whole']],\n    6],\n   {'packs': {'beef': 50, 'cream': 4, 'herbs': 2}, 'per_serving_cents': 4211, 'total_cents': 25265}],\n  ['generated control 3',\n   [[['cream', 50, 450, 1000, 50, 'whole'], ['lemon', 100, 450, 12, 80, 'bulk'],\n     ['eggs', 3, 249, 250, 100, 'whole'], ['herbs', 250, 450, 1000, 85, 'whole']],\n    1],\n   {'packs': {'cream': 1, 'eggs': 1, 'herbs': 1}, 'per_serving_cents': 5837, 'total_cents': 5837}]],\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: bulk proportional price',\n   [[['beef', 900, 249, 12, 100, 'bulk'], ['cream', 400, 249, 250, 100, 'bulk']], 3],\n   {'packs': {}, 'per_serving_cents': 6358, 'total_cents': 19073}],\n  ['repair check: bulk proportional price',\n   [[['lemon', 250, 99, 1000, 50, 'bulk'], ['herbs', 6, 99, 250, 75, 'whole'],\n     ['onion', 3, 450, 100, 80, 'bulk'], ['cream', 3, 249, 6, 50, 'whole']],\n    2],\n   {'packs': {'cream': 1, 'herbs': 1}, 'per_serving_cents': 208, 'total_cents': 414}],\n  ['generated control 1',\n   [[['onion', 3, 249, 6, 75, 'whole'], ['lemon', 900, 249, 12, 85, 'whole'],\n     ['cream', 250, 1200, 12, 50, 'whole']],\n    4],\n   {'packs': {'cream': 42, 'lemon': 89, 'onion': 1}, 'per_serving_cents': 18203, 'total_cents': 72810}],\n  ['generated control 2', [[['beef', 3, 249, 250, 80, 'whole']], 4],\n   {'packs': {'beef': 1}, 'per_serving_cents': 63, 'total_cents': 249}],\n  ['generated control 3',\n   [[['onion', 300, 1200, 6, 80, 'whole'], ['eggs', 3, 99, 1000, 75, 'bulk'],\n     ['lemon', 3, 249, 6, 100, 'whole'], ['beef', 900, 99, 1000, 75, 'bulk']],\n    8],\n   {'packs': {'lemon': 1, 'onion': 63}, 'per_serving_cents': 9497, 'total_cents': 75968}]],\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: bulk proportional price', [[['beef', 250, 99, 6, 90, 'bulk']], 2],\n   {'packs': {}, 'per_serving_cents': 2292, 'total_cents': 4583}],\n  ['repair check: bulk proportional price',\n   [[['eggs', 6, 99, 100, 75, 'bulk'], ['lemon', 3, 1200, 100, 90, 'whole'],\n     ['cream', 900, 1200, 6, 100, 'bulk'], ['onion', 400, 450, 100, 85, 'whole']],\n    1],\n   {'packs': {'lemon': 1, 'onion': 5}, 'per_serving_cents': 183458, 'total_cents': 183458}],\n  ['generated control 1', [[['onion', 900, 99, 6, 100, 'whole']], 5],\n   {'packs': {'onion': 150}, 'per_serving_cents': 2970, 'total_cents': 14850}],\n  ['generated control 2',\n   [[['cream', 250, 450, 250, 75, 'bulk'], ['beef', 250, 99, 250, 75, 'whole'],\n     ['eggs', 3, 450, 250, 50, 'whole'], ['onion', 6, 249, 12, 50, 'whole']],\n    4],\n   {'packs': {'beef': 2, 'eggs': 1, 'onion': 1}, 'per_serving_cents': 375, 'total_cents': 1497}],\n  ['generated control 3', [[['herbs', 6, 1200, 100, 100, 'whole']], 3],\n   {'packs': {'herbs': 1}, 'per_serving_cents': 400, '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  ['exact whole pack', [[['beef', 500, 1200, 500, 100, 'whole']], 4],\n   {'packs': {'beef': 1}, 'per_serving_cents': 300, 'total_cents': 1200}],\n  ['regression: bulk proportional price',\n   [[['herbs', 3, 1200, 500, 75, 'bulk'], ['eggs', 300, 1200, 100, 50, 'bulk'],\n     ['lemon', 400, 249, 1000, 90, 'bulk'], ['onion', 900, 1200, 250, 100, 'whole']],\n    7],\n   {'packs': {'onion': 4}, 'per_serving_cents': 1732, 'total_cents': 12120}],\n  ['repair check: bulk proportional price',\n   [[['lemon', 50, 249, 6, 90, 'whole'], ['onion', 3, 450, 12, 75, 'bulk'],\n     ['eggs', 400, 450, 6, 75, 'whole'], ['beef', 50, 99, 100, 100, 'bulk']],\n    5],\n   {'packs': {'eggs': 89, 'lemon': 10}, 'per_serving_cents': 8548, 'total_cents': 42740}],\n  ['generated control 1', [[['lemon', 250, 450, 1000, 85, 'whole']], 6],\n   {'packs': {'lemon': 1}, 'per_serving_cents': 75, 'total_cents': 450}],\n  ['generated control 2', [[['herbs', 3, 1200, 12, 75, 'bulk'], ['cream', 900, 1200, 12, 100, 'bulk']], 7],\n   {'packs': {}, 'per_serving_cents': 12915, 'total_cents': 90400}],\n  ['generated control 3',\n   [[['beef', 100, 450, 250, 100, 'whole'], ['eggs', 300, 1200, 12, 85, 'bulk'],\n     ['onion', 50, 450, 100, 85, 'bulk']],\n    8],\n   {'packs': {'beef': 1}, 'per_serving_cents': 4502, 'total_cents': 36009}]]]\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":"7c32c6846c1b26f94f77a04433f4f83895e102eb4de841daea00b89c9a2c3dc7","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.ceil(ap / size)\n            packs[name] = n\n            total += n * price\n        else:\n            total += ap * 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: bulk proportional price',\n   [[['lemon', 50, 450, 500, 100, 'bulk'], ['herbs', 50, 450, 100, 90, 'whole']], 4],\n   {'packs': {'herbs': 1}, 'per_serving_cents': 124, 'total_cents': 495}],\n  ['repair check: bulk proportional price',\n   [[['cream', 100, 450, 12, 80, 'bulk'], ['eggs', 300, 1200, 1000, 75, 'bulk']], 3],\n   {'packs': {}, 'per_serving_cents': 1723, 'total_cents': 5168}],\n  ['generated control 1', [[['lemon', 6, 1200, 6, 75, 'bulk'], ['herbs', 900, 450, 12, 100, 'bulk']], 8],\n   {'packs': {}, 'per_serving_cents': 4419, 'total_cents': 35350}],\n  ['generated control 2', [[['lemon', 3, 99, 500, 80, 'whole']], 3],\n   {'packs': {'lemon': 1}, 'per_serving_cents': 33, 'total_cents': 99}],\n  ['generated control 3',\n   [[['herbs', 300, 1200, 250, 80, 'whole'], ['cream', 100, 99, 1000, 75, 'whole'],\n     ['onion', 250, 99, 500, 80, 'bulk'], ['lemon', 6, 249, 12, 80, 'whole']],\n    3],\n   {'packs': {'cream': 1, 'herbs': 2, 'lemon': 1}, 'per_serving_cents': 937, 'total_cents': 2810}]],\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: bulk proportional price', [[['beef', 6, 99, 12, 80, 'bulk']], 6],\n   {'packs': {}, 'per_serving_cents': 11, 'total_cents': 62}],\n  ['repair check: bulk proportional price',\n   [[['eggs', 100, 1200, 250, 90, 'whole'], ['herbs', 300, 1200, 12, 90, 'bulk']], 5],\n   {'packs': {'eggs': 1}, 'per_serving_cents': 6907, 'total_cents': 34533}],\n  ['generated control 1',\n   [[['beef', 300, 1200, 100, 100, 'bulk'], ['cream', 400, 450, 250, 100, 'bulk'],\n     ['herbs', 100, 249, 6, 50, 'bulk'], ['lemon', 100, 1200, 500, 50, 'bulk']],\n    5],\n   {'packs': {}, 'per_serving_cents': 2620, 'total_cents': 13100}],\n  ['generated control 2',\n   [[['cream', 300, 249, 100, 80, 'whole'], ['eggs', 900, 1200, 1000, 85, 'bulk'],\n     ['herbs', 250, 249, 250, 90, 'whole'], ['beef', 250, 450, 6, 85, 'whole']],\n    6],\n   {'packs': {'beef': 50, 'cream': 4, 'herbs': 2}, 'per_serving_cents': 4211, 'total_cents': 25265}],\n  ['generated control 3',\n   [[['cream', 50, 450, 1000, 50, 'whole'], ['lemon', 100, 450, 12, 80, 'bulk'],\n     ['eggs', 3, 249, 250, 100, 'whole'], ['herbs', 250, 450, 1000, 85, 'whole']],\n    1],\n   {'packs': {'cream': 1, 'eggs': 1, 'herbs': 1}, 'per_serving_cents': 5837, 'total_cents': 5837}]],\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: bulk proportional price',\n   [[['beef', 900, 249, 12, 100, 'bulk'], ['cream', 400, 249, 250, 100, 'bulk']], 3],\n   {'packs': {}, 'per_serving_cents': 6358, 'total_cents': 19073}],\n  ['repair check: bulk proportional price',\n   [[['lemon', 250, 99, 1000, 50, 'bulk'], ['herbs', 6, 99, 250, 75, 'whole'],\n     ['onion', 3, 450, 100, 80, 'bulk'], ['cream', 3, 249, 6, 50, 'whole']],\n    2],\n   {'packs': {'cream': 1, 'herbs': 1}, 'per_serving_cents': 208, 'total_cents': 414}],\n  ['generated control 1',\n   [[['onion', 3, 249, 6, 75, 'whole'], ['lemon', 900, 249, 12, 85, 'whole'],\n     ['cream', 250, 1200, 12, 50, 'whole']],\n    4],\n   {'packs': {'cream': 42, 'lemon': 89, 'onion': 1}, 'per_serving_cents': 18203, 'total_cents': 72810}],\n  ['generated control 2', [[['beef', 3, 249, 250, 80, 'whole']], 4],\n   {'packs': {'beef': 1}, 'per_serving_cents': 63, 'total_cents': 249}],\n  ['generated control 3',\n   [[['onion', 300, 1200, 6, 80, 'whole'], ['eggs', 3, 99, 1000, 75, 'bulk'],\n     ['lemon', 3, 249, 6, 100, 'whole'], ['beef', 900, 99, 1000, 75, 'bulk']],\n    8],\n   {'packs': {'lemon': 1, 'onion': 63}, 'per_serving_cents': 9497, 'total_cents': 75968}]],\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: bulk proportional price', [[['beef', 250, 99, 6, 90, 'bulk']], 2],\n   {'packs': {}, 'per_serving_cents': 2292, 'total_cents': 4583}],\n  ['repair check: bulk proportional price',\n   [[['eggs', 6, 99, 100, 75, 'bulk'], ['lemon', 3, 1200, 100, 90, 'whole'],\n     ['cream', 900, 1200, 6, 100, 'bulk'], ['onion', 400, 450, 100, 85, 'whole']],\n    1],\n   {'packs': {'lemon': 1, 'onion': 5}, 'per_serving_cents': 183458, 'total_cents': 183458}],\n  ['generated control 1', [[['onion', 900, 99, 6, 100, 'whole']], 5],\n   {'packs': {'onion': 150}, 'per_serving_cents': 2970, 'total_cents': 14850}],\n  ['generated control 2',\n   [[['cream', 250, 450, 250, 75, 'bulk'], ['beef', 250, 99, 250, 75, 'whole'],\n     ['eggs', 3, 450, 250, 50, 'whole'], ['onion', 6, 249, 12, 50, 'whole']],\n    4],\n   {'packs': {'beef': 2, 'eggs': 1, 'onion': 1}, 'per_serving_cents': 375, 'total_cents': 1497}],\n  ['generated control 3', [[['herbs', 6, 1200, 100, 100, 'whole']], 3],\n   {'packs': {'herbs': 1}, 'per_serving_cents': 400, '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  ['exact whole pack', [[['beef', 500, 1200, 500, 100, 'whole']], 4],\n   {'packs': {'beef': 1}, 'per_serving_cents': 300, 'total_cents': 1200}],\n  ['regression: bulk proportional price',\n   [[['herbs', 3, 1200, 500, 75, 'bulk'], ['eggs', 300, 1200, 100, 50, 'bulk'],\n     ['lemon', 400, 249, 1000, 90, 'bulk'], ['onion', 900, 1200, 250, 100, 'whole']],\n    7],\n   {'packs': {'onion': 4}, 'per_serving_cents': 1732, 'total_cents': 12120}],\n  ['repair check: bulk proportional price',\n   [[['lemon', 50, 249, 6, 90, 'whole'], ['onion', 3, 450, 12, 75, 'bulk'],\n     ['eggs', 400, 450, 6, 75, 'whole'], ['beef', 50, 99, 100, 100, 'bulk']],\n    5],\n   {'packs': {'eggs': 89, 'lemon': 10}, 'per_serving_cents': 8548, 'total_cents': 42740}],\n  ['generated control 1', [[['lemon', 250, 450, 1000, 85, 'whole']], 6],\n   {'packs': {'lemon': 1}, 'per_serving_cents': 75, 'total_cents': 450}],\n  ['generated control 2', [[['herbs', 3, 1200, 12, 75, 'bulk'], ['cream', 900, 1200, 12, 100, 'bulk']], 7],\n   {'packs': {}, 'per_serving_cents': 12915, 'total_cents': 90400}],\n  ['generated control 3',\n   [[['beef', 100, 450, 250, 100, 'whole'], ['eggs', 300, 1200, 12, 85, 'bulk'],\n     ['onion', 50, 450, 100, 85, 'bulk']],\n    8],\n   {'packs': {'beef': 1}, 'per_serving_cents': 4502, 'total_cents': 36009}]]]\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-bulk-proportional-price","generated_at":"2026-09-29T14:52:30.033648+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":"Bulk cost multiplies quantity by the pack price as if it were a unit price.","sha256":"26206364f8ab0b90f72b31c1ae052db8b2ddb972f3447813f6b95fee3b960e51","title":"Recipe cost per serving: bulk proportional price · 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":46.31,"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":1,"total_cents":1},"check":"trim loss","expected":{"packs":{},"per_serving_cents":99,"total_cents":99},"passed":false},{"actual":{"packs":{},"per_serving_cents":1,"total_cents":2},"check":"bulk herbs","expected":{"packs":{},"per_serving_cents":60,"total_cents":180},"passed":false},{"actual":{"packs":{"herbs":1},"per_serving_cents":113,"total_cents":450},"check":"regression: bulk proportional price","expected":{"packs":{"herbs":1},"per_serving_cents":124,"total_cents":495},"passed":false},{"actual":{"packs":{},"per_serving_cents":18,"total_cents":52},"check":"repair check: bulk proportional price","expected":{"packs":{},"per_serving_cents":1723,"total_cents":5168},"passed":false},{"actual":{"packs":{},"per_serving_cents":45,"total_cents":354},"check":"generated control 1","expected":{"packs":{},"per_serving_cents":4419,"total_cents":35350},"passed":false},{"actual":{"packs":{"lemon":1},"per_serving_cents":33,"total_cents":99},"check":"generated control 2","expected":{"packs":{"lemon":1},"per_serving_cents":33,"total_cents":99},"passed":true},{"actual":{"packs":{"cream":1,"herbs":2,"lemon":1},"per_serving_cents":917,"total_cents":2749},"check":"generated control 3","expected":{"packs":{"cream":1,"herbs":2,"lemon":1},"per_serving_cents":937,"total_cents":2810},"passed":false}],"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\": 1, \"per_serving_cents\": 1, \"packs\": {}}, \"expected\": {\"packs\": {}, \"per_serving_cents\": 99, \"total_cents\": 99}, \"passed\": false}, {\"check\": \"bulk herbs\", \"actual\": {\"total_cents\": 2, \"per_serving_cents\": 1, \"packs\": {}}, \"expected\": {\"packs\": {}, \"per_serving_cents\": 60, \"total_cents\": 180}, \"passed\": false}, {\"check\": \"regression: bulk proportional price\", \"actual\": {\"total_cents\": 450, \"per_serving_cents\": 113, \"packs\": {\"herbs\": 1}}, \"expected\": {\"packs\": {\"herbs\": 1}, \"per_serving_cents\": 124, \"total_cents\": 495}, \"passed\": false}, {\"check\": \"repair check: bulk proportional price\", \"actual\": {\"total_cents\": 52, \"per_serving_cents\": 18, \"packs\": {}}, \"expected\": {\"packs\": {}, \"per_serving_cents\": 1723, \"total_cents\": 5168}, \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": {\"total_cents\": 354, \"per_serving_cents\": 45, \"packs\": {}}, \"expected\": {\"packs\": {}, \"per_serving_cents\": 4419, \"total_cents\": 35350}, \"passed\": false}, {\"check\": \"generated control 2\", \"actual\": {\"total_cents\": 99, \"per_serving_cents\": 33, \"packs\": {\"lemon\": 1}}, \"expected\": {\"packs\": {\"lemon\": 1}, \"per_serving_cents\": 33, \"total_cents\": 99}, \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": {\"total_cents\": 2749, \"per_serving_cents\": 917, \"packs\": {\"herbs\": 2, \"cream\": 1, \"lemon\": 1}}, \"expected\": {\"packs\": {\"cream\": 1, \"herbs\": 2, \"lemon\": 1}, \"per_serving_cents\": 937, \"total_cents\": 2810}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":47.289,"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":9900,"total_cents":9900},"check":"trim loss","expected":{"packs":{},"per_serving_cents":99,"total_cents":99},"passed":false},{"actual":{"packs":{},"per_serving_cents":6000,"total_cents":18000},"check":"bulk herbs","expected":{"packs":{},"per_serving_cents":60,"total_cents":180},"passed":false},{"actual":{"packs":{"herbs":1},"per_serving_cents":5738,"total_cents":22950},"check":"regression: bulk proportional price","expected":{"packs":{"herbs":1},"per_serving_cents":124,"total_cents":495},"passed":false},{"actual":{"packs":{},"per_serving_cents":178750,"total_cents":536250},"check":"repair check: bulk proportional price","expected":{"packs":{},"per_serving_cents":1723,"total_cents":5168},"passed":false},{"actual":{"packs":{},"per_serving_cents":51825,"total_cents":414600},"check":"generated control 1","expected":{"packs":{},"per_serving_cents":4419,"total_cents":35350},"passed":false},{"actual":{"packs":{"lemon":1},"per_serving_cents":33,"total_cents":99},"check":"generated control 2","expected":{"packs":{"lemon":1},"per_serving_cents":33,"total_cents":99},"passed":true},{"actual":{"packs":{"cream":1,"herbs":2,"lemon":1},"per_serving_cents":11229,"total_cents":33686},"check":"generated control 3","expected":{"packs":{"cream":1,"herbs":2,"lemon":1},"per_serving_cents":937,"total_cents":2810},"passed":false}],"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\": 9900, \"per_serving_cents\": 9900, \"packs\": {}}, \"expected\": {\"packs\": {}, \"per_serving_cents\": 99, \"total_cents\": 99}, \"passed\": false}, {\"check\": \"bulk herbs\", \"actual\": {\"total_cents\": 18000, \"per_serving_cents\": 6000, \"packs\": {}}, \"expected\": {\"packs\": {}, \"per_serving_cents\": 60, \"total_cents\": 180}, \"passed\": false}, {\"check\": \"regression: bulk proportional price\", \"actual\": {\"total_cents\": 22950, \"per_serving_cents\": 5738, \"packs\": {\"herbs\": 1}}, \"expected\": {\"packs\": {\"herbs\": 1}, \"per_serving_cents\": 124, \"total_cents\": 495}, \"passed\": false}, {\"check\": \"repair check: bulk proportional price\", \"actual\": {\"total_cents\": 536250, \"per_serving_cents\": 178750, \"packs\": {}}, \"expected\": {\"packs\": {}, \"per_serving_cents\": 1723, \"total_cents\": 5168}, \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": {\"total_cents\": 414600, \"per_serving_cents\": 51825, \"packs\": {}}, \"expected\": {\"packs\": {}, \"per_serving_cents\": 4419, \"total_cents\": 35350}, \"passed\": false}, {\"check\": \"generated control 2\", \"actual\": {\"total_cents\": 99, \"per_serving_cents\": 33, \"packs\": {\"lemon\": 1}}, \"expected\": {\"packs\": {\"lemon\": 1}, \"per_serving_cents\": 33, \"total_cents\": 99}, \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": {\"total_cents\": 33686, \"per_serving_cents\": 11229, \"packs\": {\"herbs\": 2, \"cream\": 1, \"lemon\": 1}}, \"expected\": {\"packs\": {\"cream\": 1, \"herbs\": 2, \"lemon\": 1}, \"per_serving_cents\": 937, \"total_cents\": 2810}, \"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."}}