{"abstract":"Items fully covered by the pantry still appear with quantity 0.","category":"Recipe scaling and nutrition","checks":8,"contract":"Rows [name, qty, unit]. Names normalize: trim, lower, \"-oes\" -> drop \"es\", \"-ies\" -> \"y\", other trailing \"s\" dropped unless \"ss\". Volume (tsp=1, tbsp=3, cup=48 tsp), mass (g, kg=1000 g) and other units aggregate separately per name. Pantry {name: [qty, unit]} subtracts from the same name and dimension, never below 0. Output sorted by (name, dimension) as [name, str(qty), unit], skipping zero totals; volume shows cup if >=12 tsp, else tbsp if >=3 tsp, else tsp; mass shows kg if >=1000 g.","contract_signature":"recipes, pantry","evaluation_group":"w2-recipe_scaling_and_nutrition-shopping-list","failed_approach":"Exempting count items still lists \"0\" eggs.","family":"w2-recipe_scaling_and_nutrition-shopping-list-zero-line-suppression","id":"FA-97151","implementations":{"attempt":{"sha256":"c4cdfe27068b19f6aee47eb1f5b2b2abca302075507ab1d91cb405684135cc01","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(recipes, pantry):\n    VOL = {'tsp': 1, 'tbsp': 3, 'cup': 48}\n    MASS = {'g': 1, 'kg': 1000}\n    def norm(n):\n        n = n.strip().lower()\n        if n.endswith('oes'):\n            return n[:-2]\n        if n.endswith('ies'):\n            return n[:-3] + 'y'\n        if n.endswith('s') and not n.endswith('ss'):\n            return n[:-1]\n        return n\n    def base(q, u):\n        if u in VOL:\n            return 'volume', Fraction(q) * VOL[u]\n        if u in MASS:\n            return 'mass', Fraction(q) * MASS[u]\n        return u, Fraction(q)\n    tot = {}\n    for recipe in recipes:\n        for name, q, u in recipe:\n            dim, v = base(q, u)\n            k = (norm(name), dim)\n            tot[k] = tot.get(k, 0) + v\n    for name, (q, u) in pantry.items():\n        dim, v = base(q, u)\n        pk = (norm(name), dim)\n        if pk in tot:\n            tot[pk] = max(Fraction(0), tot[pk] - v)\n    out = []\n    for (name, dim), v in sorted(tot.items()):\n        if v == 0 and dim != 'each':\n            continue\n        if dim == 'volume':\n            unit, v2 = ('cup', v / 48) if v >= 12 else ('tbsp', v / 3) if v >= 3 else ('tsp', v)\n        elif dim == 'mass':\n            unit, v2 = ('kg', v / 1000) if v >= 1000 else ('g', v)\n        else:\n            unit, v2 = dim, v\n        out.append([name, str(v2), unit])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['single recipe', [[[['flour', '1', 'cup']]], {}], [['flour', '1', 'cup']]],\n  ['merge plurals', [[[['tomatoes', '2', 'each']], [['Tomato', '1', 'each']]], {}],\n   [['tomato', '3', 'each']]],\n  ['pantry covers all', [[[['eggs', '2', 'each']]], {'egg': ['6', 'each']}], []],\n  ['regression: zero line suppression',\n   [[[['flour', '1', 'kg'], ['peas', '3/4', 'cup'], ['eggs', '1', 'kg'], ['flour', '1/4', 'tbsp']],\n     [['berries', '4', 'cup'], ['berries', '1', 'tbsp'], ['peas', '1/2', 'tbsp'], ['peas', '1/2', 'tbsp']],\n     [['flour', '1/4', 'tsp']]],\n    {'peas': ['1', 'cup']}],\n   [['berry', '65/16', 'cup'], ['egg', '1', 'kg'], ['flour', '1', 'kg'], ['flour', '1', 'tsp']]],\n  ['repair check: zero line suppression',\n   [[[['Tomato', '3/4', 'each'], ['flour', '3/4', 'tbsp']],\n     [['tomatoes', '3/4', 'g'], ['peas', '2', 'cup'], ['berry', '3', 'cup'], ['grape', '4', 'each']],\n     [['grapes', '4', 'tbsp'], ['egg', '1/3', 'cup'], ['eggs', '3', 'kg'], ['grape', '1/2', 'cup']]],\n    {'Tomato': ['3', 'each'], 'eggs': ['4', 'tbsp']}],\n   [['berry', '3', 'cup'], ['egg', '3', 'kg'], ['egg', '4/3', 'tbsp'], ['flour', '9/4', 'tsp'],\n    ['grape', '4', 'each'], ['grape', '3/4', 'cup'], ['pea', '2', 'cup'], ['tomato', '3/4', 'g']]],\n  ['generated control 1',\n   [[[['sugar ', '1', 'kg']],\n     [['Tomato', '4', 'g'], ['tomatoes', '1/4', 'cup'], ['eggs', '2', 'cup'], ['grape', '1/3', 'kg']],\n     [['egg', '3', 'g']]],\n    {}],\n   [['egg', '3', 'g'], ['egg', '2', 'cup'], ['grape', '1000/3', 'g'], ['sugar', '1', 'kg'],\n    ['tomato', '4', 'g'], ['tomato', '1/4', 'cup']]],\n  ['generated control 2',\n   [[[['grapes', '1/3', 'tbsp'], ['berries', '1/4', 'tsp'], ['grape', '1/4', 'kg'], ['sugar ', '1', 'kg']],\n     [['berries', '1/4', 'cup']], [['berries', '2', 'kg'], ['grape', '4', 'g'], ['peas', '1/2', 'kg']]],\n    {}],\n   [['berry', '2', 'kg'], ['berry', '49/192', 'cup'], ['grape', '254', 'g'], ['grape', '1', 'tsp'],\n    ['pea', '500', 'g'], ['sugar', '1', 'kg']]],\n  ['generated control 3',\n   [[[['berry', '2', 'cup'], ['watercress', '2', 'cup']], [['sugar ', '3/4', 'each']],\n     [['peas', '3', 'tsp'], ['watercress', '3', 'cup'], ['berry', '1', 'each']]],\n    {'eggs': ['1', 'tbsp']}],\n   [['berry', '1', 'each'], ['berry', '2', 'cup'], ['pea', '1', 'tbsp'], ['sugar', '3/4', 'each'],\n    ['watercress', '5', 'cup']]]],\n [['merge plurals', [[[['tomatoes', '2', 'each']], [['Tomato', '1', 'each']]], {}],\n   [['tomato', '3', 'each']]],\n  ['pantry covers all', [[[['eggs', '2', 'each']]], {'egg': ['6', 'each']}], []],\n  ['watercress keeps ss', [[[['watercress', '100', 'g']]], {}], [['watercress', '100', 'g']]],\n  ['regression: zero line suppression',\n   [[[['eggs', '1/3', 'each'], ['sugar ', '1/4', 'kg']], [['grape', '2', 'each']]],\n    {'sugar ': ['3/4', 'kg']}],\n   [['egg', '1/3', 'each'], ['grape', '2', 'each']]],\n  ['repair check: zero line suppression',\n   [[[['eggs', '3/4', 'g']], [['tomatoes', '1/3', 'each']]],\n    {'Tomato': ['4', 'each'], 'berries': ['3/4', 'g']}],\n   [['egg', '3/4', 'g']]],\n  ['generated control 1',\n   [[[['berries', '1', 'each'], ['berry', '1/4', 'g']],\n     [['peas', '4', 'tsp'], ['potatoes', '2', 'g'], ['berry', '3', 'cup'], ['tomatoes', '4', 'tsp']],\n     [['flour', '3/4', 'kg']]],\n    {'peas': ['3/4', 'tbsp'], 'tomatoes': ['1/3', 'tbsp']}],\n   [['berry', '1', 'each'], ['berry', '1/4', 'g'], ['berry', '3', 'cup'], ['flour', '750', 'g'],\n    ['pea', '7/4', 'tsp'], ['potato', '2', 'g'], ['tomato', '1', 'tbsp']]],\n  ['generated control 2',\n   [[[['sugar ', '3/4', 'each'], ['peas', '3/4', 'tsp']],\n     [['eggs', '1/4', 'tbsp'], ['peas', '1/2', 'each'], ['egg', '2', 'tsp']]],\n    {'watercress': ['4', 'tbsp']}],\n   [['egg', '11/4', 'tsp'], ['pea', '1/2', 'each'], ['pea', '3/4', 'tsp'], ['sugar', '3/4', 'each']]],\n  ['generated control 3',\n   [[[['peas', '1/4', 'cup']], [['Tomato', '1/3', 'kg']],\n     [['watercress', '1/2', 'g'], ['Tomato', '2', 'kg']]],\n    {'egg': ['1/4', 'kg']}],\n   [['pea', '1/4', 'cup'], ['tomato', '7/3', 'kg'], ['watercress', '1/2', 'g']]]],\n [['pantry covers all', [[[['eggs', '2', 'each']]], {'egg': ['6', 'each']}], []],\n  ['watercress keeps ss', [[[['watercress', '100', 'g']]], {}], [['watercress', '100', 'g']]],\n  ['single recipe', [[[['flour', '1', 'cup']]], {}], [['flour', '1', 'cup']]],\n  ['regression: zero line suppression',\n   [[[['grapes', '1', 'tbsp'], ['tomatoes', '2', 'tsp']], [['egg', '1/3', 'tsp']]],\n    {'Tomato': ['4', 'cup'], 'tomatoes': ['3/4', 'g']}],\n   [['egg', '1/3', 'tsp'], ['grape', '1', 'tbsp']]],\n  ['repair check: zero line suppression',\n   [[[['flour', '1/4', 'g'], ['grapes', '1/4', 'kg']], [['grapes', '1/2', 'each']]],\n    {'grape': ['4', 'each']}],\n   [['flour', '1/4', 'g'], ['grape', '250', 'g']]],\n  ['generated control 1',\n   [[[['eggs', '4', 'each'], ['Tomato', '1', 'cup'], ['eggs', '1/4', 'tbsp'], ['watercress', '1/3', 'cup']]],\n    {}],\n   [['egg', '4', 'each'], ['egg', '3/4', 'tsp'], ['tomato', '1', 'cup'], ['watercress', '1/3', 'cup']]],\n  ['generated control 2',\n   [[[['berry', '3', 'kg']], [['berry', '2', 'g'], ['egg', '2', 'kg']]],\n    {'berries': ['2', 'each'], 'grape': ['1/2', 'each']}],\n   [['berry', '1501/500', 'kg'], ['egg', '2', 'kg']]],\n  ['generated control 3',\n   [[[['Tomato', '1', 'g'], ['grape', '4', 'cup']],\n     [['berries', '1', 'each'], ['peas', '4', 'tsp'], ['grapes', '3', 'tsp']],\n     [['egg', '3/4', 'each'], ['sugar ', '3', 'each'], ['berry', '1/4', 'kg'], ['berries', '4', 'kg']]],\n    {'watercress': ['1/4', 'tbsp']}],\n   [['berry', '1', 'each'], ['berry', '17/4', 'kg'], ['egg', '3/4', 'each'], ['grape', '65/16', 'cup'],\n    ['pea', '4/3', 'tbsp'], ['sugar', '3', 'each'], ['tomato', '1', 'g']]]],\n [['watercress keeps ss', [[[['watercress', '100', 'g']]], {}], [['watercress', '100', 'g']]],\n  ['single recipe', [[[['flour', '1', 'cup']]], {}], [['flour', '1', 'cup']]],\n  ['merge plurals', [[[['tomatoes', '2', 'each']], [['Tomato', '1', 'each']]], {}],\n   [['tomato', '3', 'each']]],\n  ['regression: zero line suppression',\n   [[[['watercress', '4', 'g'], ['Tomato', '1/3', 'tbsp'], ['sugar ', '1', 'g']],\n     [['peas', '3', 'tbsp'], ['Tomato', '1', 'tsp'], ['watercress', '1/4', 'cup']],\n     [['tomatoes', '1/4', 'each']]],\n    {'grapes': ['1/3', 'tbsp'], 'peas': ['1/3', 'cup']}],\n   [['sugar', '1', 'g'], ['tomato', '1/4', 'each'], ['tomato', '2', 'tsp'], ['watercress', '4', 'g'],\n    ['watercress', '1/4', 'cup']]],\n  ['repair check: zero line suppression',\n   [[[['grape', '1', 'each']], [['watercress', '1/2', 'tbsp'], ['tomatoes', '2', 'g']],\n     [['peas', '2', 'kg'], ['potatoes', '3', 'tbsp']]],\n    {'grape': ['1', 'each'], 'potatoes': ['3/4', 'g']}],\n   [['pea', '2', 'kg'], ['potato', '3', 'tbsp'], ['tomato', '2', 'g'], ['watercress', '3/2', 'tsp']]],\n  ['generated control 1',\n   [[[['tomatoes', '1/3', 'g'], ['grape', '1/4', 'g'], ['berry', '3', 'each'], ['grape', '1', 'tbsp']],\n     [['grapes', '1', 'g']]],\n    {'egg': ['2', 'kg'], 'potatoes': ['1/3', 'kg']}],\n   [['berry', '3', 'each'], ['grape', '5/4', 'g'], ['grape', '1', 'tbsp'], ['tomato', '1/3', 'g']]],\n  ['generated control 2',\n   [[[['grape', '1/3', 'cup'], ['eggs', '3', 'tsp'], ['eggs', '4', 'each'], ['eggs', '1/3', 'g']],\n     [['grapes', '1', 'kg'], ['potatoes', '1/2', 'tsp'], ['peas', '1/3', 'tbsp']]],\n    {'watercress': ['4', 'each']}],\n   [['egg', '4', 'each'], ['egg', '1/3', 'g'], ['egg', '1', 'tbsp'], ['grape', '1', 'kg'],\n    ['grape', '1/3', 'cup'], ['pea', '1', 'tsp'], ['potato', '1/2', 'tsp']]],\n  ['generated control 3', [[[['peas', '1/2', 'g']]], {'Tomato': ['2', 'tsp'], 'eggs': ['1/2', 'cup']}],\n   [['pea', '1/2', 'g']]]],\n [['single recipe', [[[['flour', '1', 'cup']]], {}], [['flour', '1', 'cup']]],\n  ['merge plurals', [[[['tomatoes', '2', 'each']], [['Tomato', '1', 'each']]], {}],\n   [['tomato', '3', 'each']]],\n  ['pantry covers all', [[[['eggs', '2', 'each']]], {'egg': ['6', 'each']}], []],\n  ['regression: zero line suppression',\n   [[[['flour', '4', 'tsp'], ['Tomato', '3', 'tsp'], ['sugar ', '4', 'kg'], ['egg', '1/3', 'kg']]],\n    {'Tomato': ['3', 'tsp']}],\n   [['egg', '1000/3', 'g'], ['flour', '4/3', 'tbsp'], ['sugar', '4', 'kg']]],\n  ['repair check: zero line suppression',\n   [[[['sugar ', '1/3', 'cup'], ['berry', '1/2', 'kg'], ['berries', '3/4', 'each'], ['flour', '1/2', 'g']],\n     [['Tomato', '1/2', 'cup']], [['grape', '2', 'tbsp'], ['sugar ', '2', 'cup'], ['eggs', '3/4', 'each']]],\n    {'berries': ['2', 'each']}],\n   [['berry', '500', 'g'], ['egg', '3/4', 'each'], ['flour', '1/2', 'g'], ['grape', '2', 'tbsp'],\n    ['sugar', '7/3', 'cup'], ['tomato', '1/2', 'cup']]],\n  ['generated control 1',\n   [[[['watercress', '3', 'cup'], ['peas', '1/3', 'kg'], ['Tomato', '1/3', 'cup'], ['peas', '1/3', 'kg']],\n     [['Tomato', '1', 'cup'], ['flour', '3', 'each']]],\n    {}],\n   [['flour', '3', 'each'], ['pea', '2000/3', 'g'], ['tomato', '4/3', 'cup'], ['watercress', '3', 'cup']]],\n  ['generated control 2',\n   [[[['potatoes', '4', 'each'], ['eggs', '3', 'kg']]], {'berries': ['3/4', 'g'], 'eggs': ['1/2', 'cup']}],\n   [['egg', '3', 'kg'], ['potato', '4', 'each']]],\n  ['generated control 3',\n   [[[['berry', '2', 'tsp'], ['watercress', '1', 'kg']], [['potatoes', '2', 'each']],\n     [['flour', '1/4', 'g'], ['berries', '4', 'tbsp'], ['berry', '1/2', 'g'], ['peas', '1', 'g']]],\n    {'egg': ['1/3', 'g']}],\n   [['berry', '1/2', 'g'], ['berry', '7/24', 'cup'], ['flour', '1/4', 'g'], ['pea', '1', 'g'],\n    ['potato', '2', 'each'], ['watercress', '1', 'kg']]]]]\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":"f0c33a28598f913f78082f908d3eb947b0761f2b00e11418d172e5a32be5cd76","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(recipes, pantry):\n    VOL = {'tsp': 1, 'tbsp': 3, 'cup': 48}\n    MASS = {'g': 1, 'kg': 1000}\n    def norm(n):\n        n = n.strip().lower()\n        if n.endswith('oes'):\n            return n[:-2]\n        if n.endswith('ies'):\n            return n[:-3] + 'y'\n        if n.endswith('s') and not n.endswith('ss'):\n            return n[:-1]\n        return n\n    def base(q, u):\n        if u in VOL:\n            return 'volume', Fraction(q) * VOL[u]\n        if u in MASS:\n            return 'mass', Fraction(q) * MASS[u]\n        return u, Fraction(q)\n    tot = {}\n    for recipe in recipes:\n        for name, q, u in recipe:\n            dim, v = base(q, u)\n            k = (norm(name), dim)\n            tot[k] = tot.get(k, 0) + v\n    for name, (q, u) in pantry.items():\n        dim, v = base(q, u)\n        pk = (norm(name), dim)\n        if pk in tot:\n            tot[pk] = max(Fraction(0), tot[pk] - v)\n    out = []\n    for (name, dim), v in sorted(tot.items()):\n        if v < 0:\n            continue\n        if dim == 'volume':\n            unit, v2 = ('cup', v / 48) if v >= 12 else ('tbsp', v / 3) if v >= 3 else ('tsp', v)\n        elif dim == 'mass':\n            unit, v2 = ('kg', v / 1000) if v >= 1000 else ('g', v)\n        else:\n            unit, v2 = dim, v\n        out.append([name, str(v2), unit])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['single recipe', [[[['flour', '1', 'cup']]], {}], [['flour', '1', 'cup']]],\n  ['merge plurals', [[[['tomatoes', '2', 'each']], [['Tomato', '1', 'each']]], {}],\n   [['tomato', '3', 'each']]],\n  ['pantry covers all', [[[['eggs', '2', 'each']]], {'egg': ['6', 'each']}], []],\n  ['regression: zero line suppression',\n   [[[['flour', '1', 'kg'], ['peas', '3/4', 'cup'], ['eggs', '1', 'kg'], ['flour', '1/4', 'tbsp']],\n     [['berries', '4', 'cup'], ['berries', '1', 'tbsp'], ['peas', '1/2', 'tbsp'], ['peas', '1/2', 'tbsp']],\n     [['flour', '1/4', 'tsp']]],\n    {'peas': ['1', 'cup']}],\n   [['berry', '65/16', 'cup'], ['egg', '1', 'kg'], ['flour', '1', 'kg'], ['flour', '1', 'tsp']]],\n  ['repair check: zero line suppression',\n   [[[['Tomato', '3/4', 'each'], ['flour', '3/4', 'tbsp']],\n     [['tomatoes', '3/4', 'g'], ['peas', '2', 'cup'], ['berry', '3', 'cup'], ['grape', '4', 'each']],\n     [['grapes', '4', 'tbsp'], ['egg', '1/3', 'cup'], ['eggs', '3', 'kg'], ['grape', '1/2', 'cup']]],\n    {'Tomato': ['3', 'each'], 'eggs': ['4', 'tbsp']}],\n   [['berry', '3', 'cup'], ['egg', '3', 'kg'], ['egg', '4/3', 'tbsp'], ['flour', '9/4', 'tsp'],\n    ['grape', '4', 'each'], ['grape', '3/4', 'cup'], ['pea', '2', 'cup'], ['tomato', '3/4', 'g']]],\n  ['generated control 1',\n   [[[['sugar ', '1', 'kg']],\n     [['Tomato', '4', 'g'], ['tomatoes', '1/4', 'cup'], ['eggs', '2', 'cup'], ['grape', '1/3', 'kg']],\n     [['egg', '3', 'g']]],\n    {}],\n   [['egg', '3', 'g'], ['egg', '2', 'cup'], ['grape', '1000/3', 'g'], ['sugar', '1', 'kg'],\n    ['tomato', '4', 'g'], ['tomato', '1/4', 'cup']]],\n  ['generated control 2',\n   [[[['grapes', '1/3', 'tbsp'], ['berries', '1/4', 'tsp'], ['grape', '1/4', 'kg'], ['sugar ', '1', 'kg']],\n     [['berries', '1/4', 'cup']], [['berries', '2', 'kg'], ['grape', '4', 'g'], ['peas', '1/2', 'kg']]],\n    {}],\n   [['berry', '2', 'kg'], ['berry', '49/192', 'cup'], ['grape', '254', 'g'], ['grape', '1', 'tsp'],\n    ['pea', '500', 'g'], ['sugar', '1', 'kg']]],\n  ['generated control 3',\n   [[[['berry', '2', 'cup'], ['watercress', '2', 'cup']], [['sugar ', '3/4', 'each']],\n     [['peas', '3', 'tsp'], ['watercress', '3', 'cup'], ['berry', '1', 'each']]],\n    {'eggs': ['1', 'tbsp']}],\n   [['berry', '1', 'each'], ['berry', '2', 'cup'], ['pea', '1', 'tbsp'], ['sugar', '3/4', 'each'],\n    ['watercress', '5', 'cup']]]],\n [['merge plurals', [[[['tomatoes', '2', 'each']], [['Tomato', '1', 'each']]], {}],\n   [['tomato', '3', 'each']]],\n  ['pantry covers all', [[[['eggs', '2', 'each']]], {'egg': ['6', 'each']}], []],\n  ['watercress keeps ss', [[[['watercress', '100', 'g']]], {}], [['watercress', '100', 'g']]],\n  ['regression: zero line suppression',\n   [[[['eggs', '1/3', 'each'], ['sugar ', '1/4', 'kg']], [['grape', '2', 'each']]],\n    {'sugar ': ['3/4', 'kg']}],\n   [['egg', '1/3', 'each'], ['grape', '2', 'each']]],\n  ['repair check: zero line suppression',\n   [[[['eggs', '3/4', 'g']], [['tomatoes', '1/3', 'each']]],\n    {'Tomato': ['4', 'each'], 'berries': ['3/4', 'g']}],\n   [['egg', '3/4', 'g']]],\n  ['generated control 1',\n   [[[['berries', '1', 'each'], ['berry', '1/4', 'g']],\n     [['peas', '4', 'tsp'], ['potatoes', '2', 'g'], ['berry', '3', 'cup'], ['tomatoes', '4', 'tsp']],\n     [['flour', '3/4', 'kg']]],\n    {'peas': ['3/4', 'tbsp'], 'tomatoes': ['1/3', 'tbsp']}],\n   [['berry', '1', 'each'], ['berry', '1/4', 'g'], ['berry', '3', 'cup'], ['flour', '750', 'g'],\n    ['pea', '7/4', 'tsp'], ['potato', '2', 'g'], ['tomato', '1', 'tbsp']]],\n  ['generated control 2',\n   [[[['sugar ', '3/4', 'each'], ['peas', '3/4', 'tsp']],\n     [['eggs', '1/4', 'tbsp'], ['peas', '1/2', 'each'], ['egg', '2', 'tsp']]],\n    {'watercress': ['4', 'tbsp']}],\n   [['egg', '11/4', 'tsp'], ['pea', '1/2', 'each'], ['pea', '3/4', 'tsp'], ['sugar', '3/4', 'each']]],\n  ['generated control 3',\n   [[[['peas', '1/4', 'cup']], [['Tomato', '1/3', 'kg']],\n     [['watercress', '1/2', 'g'], ['Tomato', '2', 'kg']]],\n    {'egg': ['1/4', 'kg']}],\n   [['pea', '1/4', 'cup'], ['tomato', '7/3', 'kg'], ['watercress', '1/2', 'g']]]],\n [['pantry covers all', [[[['eggs', '2', 'each']]], {'egg': ['6', 'each']}], []],\n  ['watercress keeps ss', [[[['watercress', '100', 'g']]], {}], [['watercress', '100', 'g']]],\n  ['single recipe', [[[['flour', '1', 'cup']]], {}], [['flour', '1', 'cup']]],\n  ['regression: zero line suppression',\n   [[[['grapes', '1', 'tbsp'], ['tomatoes', '2', 'tsp']], [['egg', '1/3', 'tsp']]],\n    {'Tomato': ['4', 'cup'], 'tomatoes': ['3/4', 'g']}],\n   [['egg', '1/3', 'tsp'], ['grape', '1', 'tbsp']]],\n  ['repair check: zero line suppression',\n   [[[['flour', '1/4', 'g'], ['grapes', '1/4', 'kg']], [['grapes', '1/2', 'each']]],\n    {'grape': ['4', 'each']}],\n   [['flour', '1/4', 'g'], ['grape', '250', 'g']]],\n  ['generated control 1',\n   [[[['eggs', '4', 'each'], ['Tomato', '1', 'cup'], ['eggs', '1/4', 'tbsp'], ['watercress', '1/3', 'cup']]],\n    {}],\n   [['egg', '4', 'each'], ['egg', '3/4', 'tsp'], ['tomato', '1', 'cup'], ['watercress', '1/3', 'cup']]],\n  ['generated control 2',\n   [[[['berry', '3', 'kg']], [['berry', '2', 'g'], ['egg', '2', 'kg']]],\n    {'berries': ['2', 'each'], 'grape': ['1/2', 'each']}],\n   [['berry', '1501/500', 'kg'], ['egg', '2', 'kg']]],\n  ['generated control 3',\n   [[[['Tomato', '1', 'g'], ['grape', '4', 'cup']],\n     [['berries', '1', 'each'], ['peas', '4', 'tsp'], ['grapes', '3', 'tsp']],\n     [['egg', '3/4', 'each'], ['sugar ', '3', 'each'], ['berry', '1/4', 'kg'], ['berries', '4', 'kg']]],\n    {'watercress': ['1/4', 'tbsp']}],\n   [['berry', '1', 'each'], ['berry', '17/4', 'kg'], ['egg', '3/4', 'each'], ['grape', '65/16', 'cup'],\n    ['pea', '4/3', 'tbsp'], ['sugar', '3', 'each'], ['tomato', '1', 'g']]]],\n [['watercress keeps ss', [[[['watercress', '100', 'g']]], {}], [['watercress', '100', 'g']]],\n  ['single recipe', [[[['flour', '1', 'cup']]], {}], [['flour', '1', 'cup']]],\n  ['merge plurals', [[[['tomatoes', '2', 'each']], [['Tomato', '1', 'each']]], {}],\n   [['tomato', '3', 'each']]],\n  ['regression: zero line suppression',\n   [[[['watercress', '4', 'g'], ['Tomato', '1/3', 'tbsp'], ['sugar ', '1', 'g']],\n     [['peas', '3', 'tbsp'], ['Tomato', '1', 'tsp'], ['watercress', '1/4', 'cup']],\n     [['tomatoes', '1/4', 'each']]],\n    {'grapes': ['1/3', 'tbsp'], 'peas': ['1/3', 'cup']}],\n   [['sugar', '1', 'g'], ['tomato', '1/4', 'each'], ['tomato', '2', 'tsp'], ['watercress', '4', 'g'],\n    ['watercress', '1/4', 'cup']]],\n  ['repair check: zero line suppression',\n   [[[['grape', '1', 'each']], [['watercress', '1/2', 'tbsp'], ['tomatoes', '2', 'g']],\n     [['peas', '2', 'kg'], ['potatoes', '3', 'tbsp']]],\n    {'grape': ['1', 'each'], 'potatoes': ['3/4', 'g']}],\n   [['pea', '2', 'kg'], ['potato', '3', 'tbsp'], ['tomato', '2', 'g'], ['watercress', '3/2', 'tsp']]],\n  ['generated control 1',\n   [[[['tomatoes', '1/3', 'g'], ['grape', '1/4', 'g'], ['berry', '3', 'each'], ['grape', '1', 'tbsp']],\n     [['grapes', '1', 'g']]],\n    {'egg': ['2', 'kg'], 'potatoes': ['1/3', 'kg']}],\n   [['berry', '3', 'each'], ['grape', '5/4', 'g'], ['grape', '1', 'tbsp'], ['tomato', '1/3', 'g']]],\n  ['generated control 2',\n   [[[['grape', '1/3', 'cup'], ['eggs', '3', 'tsp'], ['eggs', '4', 'each'], ['eggs', '1/3', 'g']],\n     [['grapes', '1', 'kg'], ['potatoes', '1/2', 'tsp'], ['peas', '1/3', 'tbsp']]],\n    {'watercress': ['4', 'each']}],\n   [['egg', '4', 'each'], ['egg', '1/3', 'g'], ['egg', '1', 'tbsp'], ['grape', '1', 'kg'],\n    ['grape', '1/3', 'cup'], ['pea', '1', 'tsp'], ['potato', '1/2', 'tsp']]],\n  ['generated control 3', [[[['peas', '1/2', 'g']]], {'Tomato': ['2', 'tsp'], 'eggs': ['1/2', 'cup']}],\n   [['pea', '1/2', 'g']]]],\n [['single recipe', [[[['flour', '1', 'cup']]], {}], [['flour', '1', 'cup']]],\n  ['merge plurals', [[[['tomatoes', '2', 'each']], [['Tomato', '1', 'each']]], {}],\n   [['tomato', '3', 'each']]],\n  ['pantry covers all', [[[['eggs', '2', 'each']]], {'egg': ['6', 'each']}], []],\n  ['regression: zero line suppression',\n   [[[['flour', '4', 'tsp'], ['Tomato', '3', 'tsp'], ['sugar ', '4', 'kg'], ['egg', '1/3', 'kg']]],\n    {'Tomato': ['3', 'tsp']}],\n   [['egg', '1000/3', 'g'], ['flour', '4/3', 'tbsp'], ['sugar', '4', 'kg']]],\n  ['repair check: zero line suppression',\n   [[[['sugar ', '1/3', 'cup'], ['berry', '1/2', 'kg'], ['berries', '3/4', 'each'], ['flour', '1/2', 'g']],\n     [['Tomato', '1/2', 'cup']], [['grape', '2', 'tbsp'], ['sugar ', '2', 'cup'], ['eggs', '3/4', 'each']]],\n    {'berries': ['2', 'each']}],\n   [['berry', '500', 'g'], ['egg', '3/4', 'each'], ['flour', '1/2', 'g'], ['grape', '2', 'tbsp'],\n    ['sugar', '7/3', 'cup'], ['tomato', '1/2', 'cup']]],\n  ['generated control 1',\n   [[[['watercress', '3', 'cup'], ['peas', '1/3', 'kg'], ['Tomato', '1/3', 'cup'], ['peas', '1/3', 'kg']],\n     [['Tomato', '1', 'cup'], ['flour', '3', 'each']]],\n    {}],\n   [['flour', '3', 'each'], ['pea', '2000/3', 'g'], ['tomato', '4/3', 'cup'], ['watercress', '3', 'cup']]],\n  ['generated control 2',\n   [[[['potatoes', '4', 'each'], ['eggs', '3', 'kg']]], {'berries': ['3/4', 'g'], 'eggs': ['1/2', 'cup']}],\n   [['egg', '3', 'kg'], ['potato', '4', 'each']]],\n  ['generated control 3',\n   [[[['berry', '2', 'tsp'], ['watercress', '1', 'kg']], [['potatoes', '2', 'each']],\n     [['flour', '1/4', 'g'], ['berries', '4', 'tbsp'], ['berry', '1/2', 'g'], ['peas', '1', 'g']]],\n    {'egg': ['1/3', 'g']}],\n   [['berry', '1/2', 'g'], ['berry', '7/24', 'cup'], ['flour', '1/4', 'g'], ['pea', '1', 'g'],\n    ['potato', '2', 'each'], ['watercress', '1', 'kg']]]]]\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-shopping-list-zero-line-suppression","generated_at":"2026-09-29T14:52:29.359723+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Meal planners merge ingredient lists across recipes and subtract what is already in the pantry.","root_cause":"Zero totals are not skipped.","sha256":"e01b985aaede1030e00f81027f2094d4e6849a5422e9b7ff0a4f7e774c560153","title":"Shopping list aggregator: zero line suppression · 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":43.973,"exit_code":1,"observations":[{"actual":[["flour","1","cup"]],"check":"single recipe","expected":[["flour","1","cup"]],"passed":true},{"actual":[["tomato","3","each"]],"check":"merge plurals","expected":[["tomato","3","each"]],"passed":true},{"actual":[["egg","0","each"]],"check":"pantry covers all","expected":[],"passed":false},{"actual":[["berry","65/16","cup"],["egg","1","kg"],["flour","1","kg"],["flour","1","tsp"]],"check":"regression: zero line suppression","expected":[["berry","65/16","cup"],["egg","1","kg"],["flour","1","kg"],["flour","1","tsp"]],"passed":true},{"actual":[["berry","3","cup"],["egg","3","kg"],["egg","4/3","tbsp"],["flour","9/4","tsp"],["grape","4","each"],["grape","3/4","cup"],["pea","2","cup"],["tomato","0","each"],["tomato","3/4","g"]],"check":"repair check: zero line suppression","expected":[["berry","3","cup"],["egg","3","kg"],["egg","4/3","tbsp"],["flour","9/4","tsp"],["grape","4","each"],["grape","3/4","cup"],["pea","2","cup"],["tomato","3/4","g"]],"passed":false},{"actual":[["egg","3","g"],["egg","2","cup"],["grape","1000/3","g"],["sugar","1","kg"],["tomato","4","g"],["tomato","1/4","cup"]],"check":"generated control 1","expected":[["egg","3","g"],["egg","2","cup"],["grape","1000/3","g"],["sugar","1","kg"],["tomato","4","g"],["tomato","1/4","cup"]],"passed":true},{"actual":[["berry","2","kg"],["berry","49/192","cup"],["grape","254","g"],["grape","1","tsp"],["pea","500","g"],["sugar","1","kg"]],"check":"generated control 2","expected":[["berry","2","kg"],["berry","49/192","cup"],["grape","254","g"],["grape","1","tsp"],["pea","500","g"],["sugar","1","kg"]],"passed":true},{"actual":[["berry","1","each"],["berry","2","cup"],["pea","1","tbsp"],["sugar","3/4","each"],["watercress","5","cup"]],"check":"generated control 3","expected":[["berry","1","each"],["berry","2","cup"],["pea","1","tbsp"],["sugar","3/4","each"],["watercress","5","cup"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"single recipe\", \"actual\": [[\"flour\", \"1\", \"cup\"]], \"expected\": [[\"flour\", \"1\", \"cup\"]], \"passed\": true}, {\"check\": \"merge plurals\", \"actual\": [[\"tomato\", \"3\", \"each\"]], \"expected\": [[\"tomato\", \"3\", \"each\"]], \"passed\": true}, {\"check\": \"pantry covers all\", \"actual\": [[\"egg\", \"0\", \"each\"]], \"expected\": [], \"passed\": false}, {\"check\": \"regression: zero line suppression\", \"actual\": [[\"berry\", \"65/16\", \"cup\"], [\"egg\", \"1\", \"kg\"], [\"flour\", \"1\", \"kg\"], [\"flour\", \"1\", \"tsp\"]], \"expected\": [[\"berry\", \"65/16\", \"cup\"], [\"egg\", \"1\", \"kg\"], [\"flour\", \"1\", \"kg\"], [\"flour\", \"1\", \"tsp\"]], \"passed\": true}, {\"check\": \"repair check: zero line suppression\", \"actual\": [[\"berry\", \"3\", \"cup\"], [\"egg\", \"3\", \"kg\"], [\"egg\", \"4/3\", \"tbsp\"], [\"flour\", \"9/4\", \"tsp\"], [\"grape\", \"4\", \"each\"], [\"grape\", \"3/4\", \"cup\"], [\"pea\", \"2\", \"cup\"], [\"tomato\", \"0\", \"each\"], [\"tomato\", \"3/4\", \"g\"]], \"expected\": [[\"berry\", \"3\", \"cup\"], [\"egg\", \"3\", \"kg\"], [\"egg\", \"4/3\", \"tbsp\"], [\"flour\", \"9/4\", \"tsp\"], [\"grape\", \"4\", \"each\"], [\"grape\", \"3/4\", \"cup\"], [\"pea\", \"2\", \"cup\"], [\"tomato\", \"3/4\", \"g\"]], \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": [[\"egg\", \"3\", \"g\"], [\"egg\", \"2\", \"cup\"], [\"grape\", \"1000/3\", \"g\"], [\"sugar\", \"1\", \"kg\"], [\"tomato\", \"4\", \"g\"], [\"tomato\", \"1/4\", \"cup\"]], \"expected\": [[\"egg\", \"3\", \"g\"], [\"egg\", \"2\", \"cup\"], [\"grape\", \"1000/3\", \"g\"], [\"sugar\", \"1\", \"kg\"], [\"tomato\", \"4\", \"g\"], [\"tomato\", \"1/4\", \"cup\"]], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [[\"berry\", \"2\", \"kg\"], [\"berry\", \"49/192\", \"cup\"], [\"grape\", \"254\", \"g\"], [\"grape\", \"1\", \"tsp\"], [\"pea\", \"500\", \"g\"], [\"sugar\", \"1\", \"kg\"]], \"expected\": [[\"berry\", \"2\", \"kg\"], [\"berry\", \"49/192\", \"cup\"], [\"grape\", \"254\", \"g\"], [\"grape\", \"1\", \"tsp\"], [\"pea\", \"500\", \"g\"], [\"sugar\", \"1\", \"kg\"]], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [[\"berry\", \"1\", \"each\"], [\"berry\", \"2\", \"cup\"], [\"pea\", \"1\", \"tbsp\"], [\"sugar\", \"3/4\", \"each\"], [\"watercress\", \"5\", \"cup\"]], \"expected\": [[\"berry\", \"1\", \"each\"], [\"berry\", \"2\", \"cup\"], [\"pea\", \"1\", \"tbsp\"], [\"sugar\", \"3/4\", \"each\"], [\"watercress\", \"5\", \"cup\"]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.968,"exit_code":1,"observations":[{"actual":[["flour","1","cup"]],"check":"single recipe","expected":[["flour","1","cup"]],"passed":true},{"actual":[["tomato","3","each"]],"check":"merge plurals","expected":[["tomato","3","each"]],"passed":true},{"actual":[["egg","0","each"]],"check":"pantry covers all","expected":[],"passed":false},{"actual":[["berry","65/16","cup"],["egg","1","kg"],["flour","1","kg"],["flour","1","tsp"],["pea","0","tsp"]],"check":"regression: zero line suppression","expected":[["berry","65/16","cup"],["egg","1","kg"],["flour","1","kg"],["flour","1","tsp"]],"passed":false},{"actual":[["berry","3","cup"],["egg","3","kg"],["egg","4/3","tbsp"],["flour","9/4","tsp"],["grape","4","each"],["grape","3/4","cup"],["pea","2","cup"],["tomato","0","each"],["tomato","3/4","g"]],"check":"repair check: zero line suppression","expected":[["berry","3","cup"],["egg","3","kg"],["egg","4/3","tbsp"],["flour","9/4","tsp"],["grape","4","each"],["grape","3/4","cup"],["pea","2","cup"],["tomato","3/4","g"]],"passed":false},{"actual":[["egg","3","g"],["egg","2","cup"],["grape","1000/3","g"],["sugar","1","kg"],["tomato","4","g"],["tomato","1/4","cup"]],"check":"generated control 1","expected":[["egg","3","g"],["egg","2","cup"],["grape","1000/3","g"],["sugar","1","kg"],["tomato","4","g"],["tomato","1/4","cup"]],"passed":true},{"actual":[["berry","2","kg"],["berry","49/192","cup"],["grape","254","g"],["grape","1","tsp"],["pea","500","g"],["sugar","1","kg"]],"check":"generated control 2","expected":[["berry","2","kg"],["berry","49/192","cup"],["grape","254","g"],["grape","1","tsp"],["pea","500","g"],["sugar","1","kg"]],"passed":true},{"actual":[["berry","1","each"],["berry","2","cup"],["pea","1","tbsp"],["sugar","3/4","each"],["watercress","5","cup"]],"check":"generated control 3","expected":[["berry","1","each"],["berry","2","cup"],["pea","1","tbsp"],["sugar","3/4","each"],["watercress","5","cup"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"single recipe\", \"actual\": [[\"flour\", \"1\", \"cup\"]], \"expected\": [[\"flour\", \"1\", \"cup\"]], \"passed\": true}, {\"check\": \"merge plurals\", \"actual\": [[\"tomato\", \"3\", \"each\"]], \"expected\": [[\"tomato\", \"3\", \"each\"]], \"passed\": true}, {\"check\": \"pantry covers all\", \"actual\": [[\"egg\", \"0\", \"each\"]], \"expected\": [], \"passed\": false}, {\"check\": \"regression: zero line suppression\", \"actual\": [[\"berry\", \"65/16\", \"cup\"], [\"egg\", \"1\", \"kg\"], [\"flour\", \"1\", \"kg\"], [\"flour\", \"1\", \"tsp\"], [\"pea\", \"0\", \"tsp\"]], \"expected\": [[\"berry\", \"65/16\", \"cup\"], [\"egg\", \"1\", \"kg\"], [\"flour\", \"1\", \"kg\"], [\"flour\", \"1\", \"tsp\"]], \"passed\": false}, {\"check\": \"repair check: zero line suppression\", \"actual\": [[\"berry\", \"3\", \"cup\"], [\"egg\", \"3\", \"kg\"], [\"egg\", \"4/3\", \"tbsp\"], [\"flour\", \"9/4\", \"tsp\"], [\"grape\", \"4\", \"each\"], [\"grape\", \"3/4\", \"cup\"], [\"pea\", \"2\", \"cup\"], [\"tomato\", \"0\", \"each\"], [\"tomato\", \"3/4\", \"g\"]], \"expected\": [[\"berry\", \"3\", \"cup\"], [\"egg\", \"3\", \"kg\"], [\"egg\", \"4/3\", \"tbsp\"], [\"flour\", \"9/4\", \"tsp\"], [\"grape\", \"4\", \"each\"], [\"grape\", \"3/4\", \"cup\"], [\"pea\", \"2\", \"cup\"], [\"tomato\", \"3/4\", \"g\"]], \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": [[\"egg\", \"3\", \"g\"], [\"egg\", \"2\", \"cup\"], [\"grape\", \"1000/3\", \"g\"], [\"sugar\", \"1\", \"kg\"], [\"tomato\", \"4\", \"g\"], [\"tomato\", \"1/4\", \"cup\"]], \"expected\": [[\"egg\", \"3\", \"g\"], [\"egg\", \"2\", \"cup\"], [\"grape\", \"1000/3\", \"g\"], [\"sugar\", \"1\", \"kg\"], [\"tomato\", \"4\", \"g\"], [\"tomato\", \"1/4\", \"cup\"]], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [[\"berry\", \"2\", \"kg\"], [\"berry\", \"49/192\", \"cup\"], [\"grape\", \"254\", \"g\"], [\"grape\", \"1\", \"tsp\"], [\"pea\", \"500\", \"g\"], [\"sugar\", \"1\", \"kg\"]], \"expected\": [[\"berry\", \"2\", \"kg\"], [\"berry\", \"49/192\", \"cup\"], [\"grape\", \"254\", \"g\"], [\"grape\", \"1\", \"tsp\"], [\"pea\", \"500\", \"g\"], [\"sugar\", \"1\", \"kg\"]], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [[\"berry\", \"1\", \"each\"], [\"berry\", \"2\", \"cup\"], [\"pea\", \"1\", \"tbsp\"], [\"sugar\", \"3/4\", \"each\"], [\"watercress\", \"5\", \"cup\"]], \"expected\": [[\"berry\", \"1\", \"each\"], [\"berry\", \"2\", \"cup\"], [\"pea\", \"1\", \"tbsp\"], [\"sugar\", \"3/4\", \"each\"], [\"watercress\", \"5\", \"cup\"]], \"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."}}