{"abstract":"Scaling one egg for eight down to one serving lists 0 eggs.","category":"Recipe scaling and nutrition","checks":8,"contract":"Scale [name, qty, unit, kind] rows from base to target servings. Factor f=target/base (both must be positive, else an error string). Seasoning rows scale by 1+(f-1)*3/4 (damped); other rows by f. Unit \"each\" rounds half-up to an integer with a floor of 1. Other units round half-up to the nearest 1/8 and print as reduced kitchen fractions (\"1 1/2\", \"3/4\", \"2\"); a zero result prints \"pinch\".","contract_signature":"items, base, target","evaluation_group":"w2-recipe_scaling_and_nutrition-servings-scaler","failed_approach":"Clamping only rows that started at one or more still prints 0 for a half lime scaled down.","family":"w2-recipe_scaling_and_nutrition-servings-scaler-countable-floor-of-one","id":"FA-96856","implementations":{"attempt":{"sha256":"1949c8e4be9c7db792281cfe7bcabdd8cbd42ba57227618e4ac1eadc57634ae7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(items, base, target):\n    if base <= 0 or target <= 0:\n        return 'error: servings must be positive'\n    f = Fraction(target, base)\n    def fmt(e):\n        if e == 0:\n            return 'pinch'\n        whole, rem = divmod(e, 8)\n        if rem == 0:\n            return str(whole)\n        g = math.gcd(rem, 8)\n        frac = '%d/%d' % (rem // g, 8 // g)\n        return frac if whole == 0 else '%d %s' % (whole, frac)\n    out = []\n    for name, qty, unit, kind in items:\n        q = Fraction(qty)\n        if kind == 'seasoning':\n            s = q * (1 + (f - 1) * Fraction(3, 4))\n        else:\n            s = q * f\n        if unit == 'each':\n            n = int(s) + (1 if s - int(s) >= Fraction(1, 2) else 0)\n            out.append([name, str(max(1, n) if q >= 1 else n), unit])\n        else:\n            e = int(s * 8 + Fraction(1, 2))\n            out.append([name, fmt(e), unit])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['identity scaling control', [[['egg', '2', 'each', 'base'], ['flour', '3/2', 'cup', 'base']], 4, 4],\n   [['egg', '2', 'each'], ['flour', '1 1/2', 'cup']]],\n  ['zero servings rejected', [[['egg', '2', 'each', 'base']], 0, 4], 'error: servings must be positive'],\n  ['double batch with seasoning', [[['salt', '1', 'tsp', 'seasoning'], ['egg', '3', 'each', 'base']], 4, 8],\n   [['salt', '1 3/4', 'tsp'], ['egg', '6', 'each']]],\n  ['regression: countable floor of one',\n   [[['pepper', '1', 'tsp', 'seasoning'], ['egg', '4', 'each', 'base'], ['lime', '1', 'each', 'base'],\n     ['milk', '1/2', 'cup', 'base']],\n    8, 1],\n   [['pepper', '3/8', 'tsp'], ['egg', '1', 'each'], ['lime', '1', 'each'], ['milk', '1/8', 'cup']]],\n  ['repair check: countable floor of one',\n   [[['cumin', '5/2', 'tsp', 'seasoning'], ['lime', '1/2', 'each', 'base']], 6, 2],\n   [['cumin', '1 1/4', 'tsp'], ['lime', '1', 'each']]],\n  ['generated control 1',\n   [[['egg', '5', 'each', 'base'], ['milk', '3/2', 'cup', 'base'], ['cumin', '1/2', 'tsp', 'seasoning']], 6,\n    3],\n   [['egg', '3', 'each'], ['milk', '3/4', 'cup'], ['cumin', '3/8', 'tsp']]],\n  ['generated control 2',\n   [[['pepper', '3', 'tsp', 'seasoning'], ['salt', '3/2', 'tsp', 'seasoning'],\n     ['garlic clove', '3', 'each', 'base'], ['butter', '2/3', 'tbsp', 'base'], ['milk', '3', 'cup', 'base']],\n    6, 4],\n   [['pepper', '2 1/4', 'tsp'], ['salt', '1 1/8', 'tsp'], ['garlic clove', '2', 'each'],\n    ['butter', '1/2', 'tbsp'], ['milk', '2', 'cup']]],\n  ['generated control 3',\n   [[['lime', '5', 'each', 'base'], ['pepper', '1/8', 'tsp', 'seasoning'], ['butter', '1/2', 'tbsp', 'base'],\n     ['cumin', '1/3', 'tsp', 'seasoning']],\n    6, 1],\n   [['lime', '1', 'each'], ['pepper', 'pinch', 'tsp'], ['butter', '1/8', 'tbsp'], ['cumin', '1/8', 'tsp']]]],\n [['zero servings rejected', [[['egg', '2', 'each', 'base']], 0, 4], 'error: servings must be positive'],\n  ['double batch with seasoning', [[['salt', '1', 'tsp', 'seasoning'], ['egg', '3', 'each', 'base']], 4, 8],\n   [['salt', '1 3/4', 'tsp'], ['egg', '6', 'each']]],\n  ['tiny scale-down to pinch', [[['cumin', '1/8', 'tsp', 'base'], ['egg', '1', 'each', 'base']], 8, 1],\n   [['cumin', 'pinch', 'tsp'], ['egg', '1', 'each']]],\n  ['regression: countable floor of one',\n   [[['cumin', '1/8', 'tsp', 'seasoning'], ['pepper', '1/8', 'tsp', 'seasoning'],\n     ['lime', '1/2', 'each', 'base'], ['milk', '2/3', 'cup', 'base'], ['garlic clove', '1', 'each', 'base']],\n    4, 3],\n   [['cumin', '1/8', 'tsp'], ['pepper', '1/8', 'tsp'], ['lime', '1', 'each'], ['milk', '1/2', 'cup'],\n    ['garlic clove', '1', 'each']]],\n  ['repair check: countable floor of one',\n   [[['lime', '1/2', 'each', 'base'], ['egg', '1', 'each', 'base'], ['garlic clove', '4', 'each', 'base']], 6,\n    5],\n   [['lime', '1', 'each'], ['egg', '1', 'each'], ['garlic clove', '3', 'each']]],\n  ['generated control 1',\n   [[['egg', '3', 'each', 'base'], ['flour', '1/3', 'cup', 'base'], ['butter', '3/2', 'tbsp', 'base']], 8, 4],\n   [['egg', '2', 'each'], ['flour', '1/8', 'cup'], ['butter', '3/4', 'tbsp']]],\n  ['generated control 2', [[['flour', '9/4', 'cup', 'base'], ['pepper', '9/4', 'tsp', 'seasoning']], 4, 10],\n   [['flour', '5 5/8', 'cup'], ['pepper', '4 3/4', 'tsp']]],\n  ['generated control 3', [[['egg', '3', 'each', 'base'], ['salt', '1/8', 'tsp', 'seasoning']], 7, 4],\n   [['egg', '2', 'each'], ['salt', '1/8', 'tsp']]]],\n [['double batch with seasoning', [[['salt', '1', 'tsp', 'seasoning'], ['egg', '3', 'each', 'base']], 4, 8],\n   [['salt', '1 3/4', 'tsp'], ['egg', '6', 'each']]],\n  ['tiny scale-down to pinch', [[['cumin', '1/8', 'tsp', 'base'], ['egg', '1', 'each', 'base']], 8, 1],\n   [['cumin', 'pinch', 'tsp'], ['egg', '1', 'each']]],\n  ['half egg rounds up', [[['egg', '3', 'each', 'base'], ['milk', '1/2', 'cup', 'base']], 4, 6],\n   [['egg', '5', 'each'], ['milk', '3/4', 'cup']]],\n  ['regression: countable floor of one',\n   [[['garlic clove', '2', 'each', 'base'], ['pepper', '2', 'tsp', 'seasoning'],\n     ['lime', '5', 'each', 'base'], ['egg', '1/2', 'each', 'base']],\n    6, 1],\n   [['garlic clove', '1', 'each'], ['pepper', '3/4', 'tsp'], ['lime', '1', 'each'], ['egg', '1', 'each']]],\n  ['repair check: countable floor of one',\n   [[['garlic clove', '2', 'each', 'base'], ['salt', '3', 'tsp', 'seasoning'], ['egg', '1', 'each', 'base'],\n     ['lime', '1/2', 'each', 'base'], ['flour', '1/4', 'cup', 'base']],\n    7, 6],\n   [['garlic clove', '2', 'each'], ['salt', '2 5/8', 'tsp'], ['egg', '1', 'each'], ['lime', '1', 'each'],\n    ['flour', '1/4', 'cup']]],\n  ['generated control 1',\n   [[['pepper', '1', 'tsp', 'seasoning'], ['flour', '3/2', 'cup', 'base'], ['milk', '2/3', 'cup', 'base'],\n     ['salt', '3/4', 'tsp', 'seasoning'], ['garlic clove', '2', 'each', 'base']],\n    6, 6],\n   [['pepper', '1', 'tsp'], ['flour', '1 1/2', 'cup'], ['milk', '5/8', 'cup'], ['salt', '3/4', 'tsp'],\n    ['garlic clove', '2', 'each']]],\n  ['generated control 2',\n   [[['salt', '1/8', 'tsp', 'seasoning'], ['pepper', '1/8', 'tsp', 'seasoning'],\n     ['flour', '1/3', 'cup', 'base']],\n    5, 2],\n   [['salt', '1/8', 'tsp'], ['pepper', '1/8', 'tsp'], ['flour', '1/8', 'cup']]],\n  ['generated control 3',\n   [[['salt', '1/8', 'tsp', 'seasoning'], ['cumin', '1', 'tsp', 'seasoning'], ['milk', '5/2', 'cup', 'base'],\n     ['garlic clove', '1', 'each', 'base']],\n    3, 9],\n   [['salt', '3/8', 'tsp'], ['cumin', '2 1/2', 'tsp'], ['milk', '7 1/2', 'cup'],\n    ['garlic clove', '3', 'each']]]],\n [['tiny scale-down to pinch', [[['cumin', '1/8', 'tsp', 'base'], ['egg', '1', 'each', 'base']], 8, 1],\n   [['cumin', 'pinch', 'tsp'], ['egg', '1', 'each']]],\n  ['half egg rounds up', [[['egg', '3', 'each', 'base'], ['milk', '1/2', 'cup', 'base']], 4, 6],\n   [['egg', '5', 'each'], ['milk', '3/4', 'cup']]],\n  ['identity scaling control', [[['egg', '2', 'each', 'base'], ['flour', '3/2', 'cup', 'base']], 4, 4],\n   [['egg', '2', 'each'], ['flour', '1 1/2', 'cup']]],\n  ['regression: countable floor of one',\n   [[['garlic clove', '1/2', 'each', 'base'], ['butter', '3/2', 'tbsp', 'base'],\n     ['salt', '9/4', 'tsp', 'seasoning'], ['cumin', '2', 'tsp', 'seasoning']],\n    6, 2],\n   [['garlic clove', '1', 'each'], ['butter', '1/2', 'tbsp'], ['salt', '1 1/8', 'tsp'],\n    ['cumin', '1', 'tsp']]],\n  ['repair check: countable floor of one',\n   [[['egg', '1/2', 'each', 'base'], ['salt', '3/2', 'tsp', 'seasoning'],\n     ['pepper', '5/2', 'tsp', 'seasoning']],\n    4, 3],\n   [['egg', '1', 'each'], ['salt', '1 1/4', 'tsp'], ['pepper', '2', 'tsp']]],\n  ['generated control 1',\n   [[['salt', '2/3', 'tsp', 'seasoning'], ['lime', '1', 'each', 'base'], ['milk', '2/3', 'cup', 'base'],\n     ['egg', '4', 'each', 'base'], ['flour', '3/4', 'cup', 'base']],\n    6, 3],\n   [['salt', '3/8', 'tsp'], ['lime', '1', 'each'], ['milk', '3/8', 'cup'], ['egg', '2', 'each'],\n    ['flour', '3/8', 'cup']]],\n  ['generated control 2', [[['butter', '5/2', 'tbsp', 'base'], ['egg', '1/2', 'each', 'base']], 7, 9],\n   [['butter', '3 1/4', 'tbsp'], ['egg', '1', 'each']]],\n  ['generated control 3', [[['salt', '1', 'tsp', 'seasoning'], ['garlic clove', '2', 'each', 'base']], 6, 7],\n   [['salt', '1 1/8', 'tsp'], ['garlic clove', '2', 'each']]]],\n [['half egg rounds up', [[['egg', '3', 'each', 'base'], ['milk', '1/2', 'cup', 'base']], 4, 6],\n   [['egg', '5', 'each'], ['milk', '3/4', 'cup']]],\n  ['identity scaling control', [[['egg', '2', 'each', 'base'], ['flour', '3/2', 'cup', 'base']], 4, 4],\n   [['egg', '2', 'each'], ['flour', '1 1/2', 'cup']]],\n  ['zero servings rejected', [[['egg', '2', 'each', 'base']], 0, 4], 'error: servings must be positive'],\n  ['regression: countable floor of one',\n   [[['garlic clove', '1', 'each', 'base'], ['milk', '5/2', 'cup', 'base'], ['flour', '3', 'cup', 'base'],\n     ['cumin', '1', 'tsp', 'seasoning'], ['salt', '3', 'tsp', 'seasoning']],\n    4, 1],\n   [['garlic clove', '1', 'each'], ['milk', '5/8', 'cup'], ['flour', '3/4', 'cup'], ['cumin', '1/2', 'tsp'],\n    ['salt', '1 3/8', 'tsp']]],\n  ['repair check: countable floor of one',\n   [[['egg', '1/2', 'each', 'base'], ['garlic clove', '4', 'each', 'base'],\n     ['salt', '1/3', 'tsp', 'seasoning']],\n    5, 3],\n   [['egg', '1', 'each'], ['garlic clove', '2', 'each'], ['salt', '1/4', 'tsp']]],\n  ['generated control 1',\n   [[['butter', '3/4', 'tbsp', 'base'], ['egg', '4', 'each', 'base'], ['pepper', '1/3', 'tsp', 'seasoning']],\n    8, 11],\n   [['butter', '1', 'tbsp'], ['egg', '6', 'each'], ['pepper', '3/8', 'tsp']]],\n  ['generated control 2', [[['lime', '5', 'each', 'base'], ['cumin', '1', 'tsp', 'seasoning']], 3, 8],\n   [['lime', '13', 'each'], ['cumin', '2 1/4', 'tsp']]],\n  ['generated control 3',\n   [[['pepper', '9/4', 'tsp', 'seasoning'], ['egg', '1/2', 'each', 'base'], ['flour', '3/2', 'cup', 'base']],\n    2, 6],\n   [['pepper', '5 5/8', 'tsp'], ['egg', '2', 'each'], ['flour', '4 1/2', 'cup']]]]]\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":"0cdd1be11c3f05719588f96b5ffcf7a8c721e9512c6d57c983b1e982f99a901b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(items, base, target):\n    if base <= 0 or target <= 0:\n        return 'error: servings must be positive'\n    f = Fraction(target, base)\n    def fmt(e):\n        if e == 0:\n            return 'pinch'\n        whole, rem = divmod(e, 8)\n        if rem == 0:\n            return str(whole)\n        g = math.gcd(rem, 8)\n        frac = '%d/%d' % (rem // g, 8 // g)\n        return frac if whole == 0 else '%d %s' % (whole, frac)\n    out = []\n    for name, qty, unit, kind in items:\n        q = Fraction(qty)\n        if kind == 'seasoning':\n            s = q * (1 + (f - 1) * Fraction(3, 4))\n        else:\n            s = q * f\n        if unit == 'each':\n            n = int(s) + (1 if s - int(s) >= Fraction(1, 2) else 0)\n            out.append([name, str(n), unit])\n        else:\n            e = int(s * 8 + Fraction(1, 2))\n            out.append([name, fmt(e), unit])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['identity scaling control', [[['egg', '2', 'each', 'base'], ['flour', '3/2', 'cup', 'base']], 4, 4],\n   [['egg', '2', 'each'], ['flour', '1 1/2', 'cup']]],\n  ['zero servings rejected', [[['egg', '2', 'each', 'base']], 0, 4], 'error: servings must be positive'],\n  ['double batch with seasoning', [[['salt', '1', 'tsp', 'seasoning'], ['egg', '3', 'each', 'base']], 4, 8],\n   [['salt', '1 3/4', 'tsp'], ['egg', '6', 'each']]],\n  ['regression: countable floor of one',\n   [[['pepper', '1', 'tsp', 'seasoning'], ['egg', '4', 'each', 'base'], ['lime', '1', 'each', 'base'],\n     ['milk', '1/2', 'cup', 'base']],\n    8, 1],\n   [['pepper', '3/8', 'tsp'], ['egg', '1', 'each'], ['lime', '1', 'each'], ['milk', '1/8', 'cup']]],\n  ['repair check: countable floor of one',\n   [[['cumin', '5/2', 'tsp', 'seasoning'], ['lime', '1/2', 'each', 'base']], 6, 2],\n   [['cumin', '1 1/4', 'tsp'], ['lime', '1', 'each']]],\n  ['generated control 1',\n   [[['egg', '5', 'each', 'base'], ['milk', '3/2', 'cup', 'base'], ['cumin', '1/2', 'tsp', 'seasoning']], 6,\n    3],\n   [['egg', '3', 'each'], ['milk', '3/4', 'cup'], ['cumin', '3/8', 'tsp']]],\n  ['generated control 2',\n   [[['pepper', '3', 'tsp', 'seasoning'], ['salt', '3/2', 'tsp', 'seasoning'],\n     ['garlic clove', '3', 'each', 'base'], ['butter', '2/3', 'tbsp', 'base'], ['milk', '3', 'cup', 'base']],\n    6, 4],\n   [['pepper', '2 1/4', 'tsp'], ['salt', '1 1/8', 'tsp'], ['garlic clove', '2', 'each'],\n    ['butter', '1/2', 'tbsp'], ['milk', '2', 'cup']]],\n  ['generated control 3',\n   [[['lime', '5', 'each', 'base'], ['pepper', '1/8', 'tsp', 'seasoning'], ['butter', '1/2', 'tbsp', 'base'],\n     ['cumin', '1/3', 'tsp', 'seasoning']],\n    6, 1],\n   [['lime', '1', 'each'], ['pepper', 'pinch', 'tsp'], ['butter', '1/8', 'tbsp'], ['cumin', '1/8', 'tsp']]]],\n [['zero servings rejected', [[['egg', '2', 'each', 'base']], 0, 4], 'error: servings must be positive'],\n  ['double batch with seasoning', [[['salt', '1', 'tsp', 'seasoning'], ['egg', '3', 'each', 'base']], 4, 8],\n   [['salt', '1 3/4', 'tsp'], ['egg', '6', 'each']]],\n  ['tiny scale-down to pinch', [[['cumin', '1/8', 'tsp', 'base'], ['egg', '1', 'each', 'base']], 8, 1],\n   [['cumin', 'pinch', 'tsp'], ['egg', '1', 'each']]],\n  ['regression: countable floor of one',\n   [[['cumin', '1/8', 'tsp', 'seasoning'], ['pepper', '1/8', 'tsp', 'seasoning'],\n     ['lime', '1/2', 'each', 'base'], ['milk', '2/3', 'cup', 'base'], ['garlic clove', '1', 'each', 'base']],\n    4, 3],\n   [['cumin', '1/8', 'tsp'], ['pepper', '1/8', 'tsp'], ['lime', '1', 'each'], ['milk', '1/2', 'cup'],\n    ['garlic clove', '1', 'each']]],\n  ['repair check: countable floor of one',\n   [[['lime', '1/2', 'each', 'base'], ['egg', '1', 'each', 'base'], ['garlic clove', '4', 'each', 'base']], 6,\n    5],\n   [['lime', '1', 'each'], ['egg', '1', 'each'], ['garlic clove', '3', 'each']]],\n  ['generated control 1',\n   [[['egg', '3', 'each', 'base'], ['flour', '1/3', 'cup', 'base'], ['butter', '3/2', 'tbsp', 'base']], 8, 4],\n   [['egg', '2', 'each'], ['flour', '1/8', 'cup'], ['butter', '3/4', 'tbsp']]],\n  ['generated control 2', [[['flour', '9/4', 'cup', 'base'], ['pepper', '9/4', 'tsp', 'seasoning']], 4, 10],\n   [['flour', '5 5/8', 'cup'], ['pepper', '4 3/4', 'tsp']]],\n  ['generated control 3', [[['egg', '3', 'each', 'base'], ['salt', '1/8', 'tsp', 'seasoning']], 7, 4],\n   [['egg', '2', 'each'], ['salt', '1/8', 'tsp']]]],\n [['double batch with seasoning', [[['salt', '1', 'tsp', 'seasoning'], ['egg', '3', 'each', 'base']], 4, 8],\n   [['salt', '1 3/4', 'tsp'], ['egg', '6', 'each']]],\n  ['tiny scale-down to pinch', [[['cumin', '1/8', 'tsp', 'base'], ['egg', '1', 'each', 'base']], 8, 1],\n   [['cumin', 'pinch', 'tsp'], ['egg', '1', 'each']]],\n  ['half egg rounds up', [[['egg', '3', 'each', 'base'], ['milk', '1/2', 'cup', 'base']], 4, 6],\n   [['egg', '5', 'each'], ['milk', '3/4', 'cup']]],\n  ['regression: countable floor of one',\n   [[['garlic clove', '2', 'each', 'base'], ['pepper', '2', 'tsp', 'seasoning'],\n     ['lime', '5', 'each', 'base'], ['egg', '1/2', 'each', 'base']],\n    6, 1],\n   [['garlic clove', '1', 'each'], ['pepper', '3/4', 'tsp'], ['lime', '1', 'each'], ['egg', '1', 'each']]],\n  ['repair check: countable floor of one',\n   [[['garlic clove', '2', 'each', 'base'], ['salt', '3', 'tsp', 'seasoning'], ['egg', '1', 'each', 'base'],\n     ['lime', '1/2', 'each', 'base'], ['flour', '1/4', 'cup', 'base']],\n    7, 6],\n   [['garlic clove', '2', 'each'], ['salt', '2 5/8', 'tsp'], ['egg', '1', 'each'], ['lime', '1', 'each'],\n    ['flour', '1/4', 'cup']]],\n  ['generated control 1',\n   [[['pepper', '1', 'tsp', 'seasoning'], ['flour', '3/2', 'cup', 'base'], ['milk', '2/3', 'cup', 'base'],\n     ['salt', '3/4', 'tsp', 'seasoning'], ['garlic clove', '2', 'each', 'base']],\n    6, 6],\n   [['pepper', '1', 'tsp'], ['flour', '1 1/2', 'cup'], ['milk', '5/8', 'cup'], ['salt', '3/4', 'tsp'],\n    ['garlic clove', '2', 'each']]],\n  ['generated control 2',\n   [[['salt', '1/8', 'tsp', 'seasoning'], ['pepper', '1/8', 'tsp', 'seasoning'],\n     ['flour', '1/3', 'cup', 'base']],\n    5, 2],\n   [['salt', '1/8', 'tsp'], ['pepper', '1/8', 'tsp'], ['flour', '1/8', 'cup']]],\n  ['generated control 3',\n   [[['salt', '1/8', 'tsp', 'seasoning'], ['cumin', '1', 'tsp', 'seasoning'], ['milk', '5/2', 'cup', 'base'],\n     ['garlic clove', '1', 'each', 'base']],\n    3, 9],\n   [['salt', '3/8', 'tsp'], ['cumin', '2 1/2', 'tsp'], ['milk', '7 1/2', 'cup'],\n    ['garlic clove', '3', 'each']]]],\n [['tiny scale-down to pinch', [[['cumin', '1/8', 'tsp', 'base'], ['egg', '1', 'each', 'base']], 8, 1],\n   [['cumin', 'pinch', 'tsp'], ['egg', '1', 'each']]],\n  ['half egg rounds up', [[['egg', '3', 'each', 'base'], ['milk', '1/2', 'cup', 'base']], 4, 6],\n   [['egg', '5', 'each'], ['milk', '3/4', 'cup']]],\n  ['identity scaling control', [[['egg', '2', 'each', 'base'], ['flour', '3/2', 'cup', 'base']], 4, 4],\n   [['egg', '2', 'each'], ['flour', '1 1/2', 'cup']]],\n  ['regression: countable floor of one',\n   [[['garlic clove', '1/2', 'each', 'base'], ['butter', '3/2', 'tbsp', 'base'],\n     ['salt', '9/4', 'tsp', 'seasoning'], ['cumin', '2', 'tsp', 'seasoning']],\n    6, 2],\n   [['garlic clove', '1', 'each'], ['butter', '1/2', 'tbsp'], ['salt', '1 1/8', 'tsp'],\n    ['cumin', '1', 'tsp']]],\n  ['repair check: countable floor of one',\n   [[['egg', '1/2', 'each', 'base'], ['salt', '3/2', 'tsp', 'seasoning'],\n     ['pepper', '5/2', 'tsp', 'seasoning']],\n    4, 3],\n   [['egg', '1', 'each'], ['salt', '1 1/4', 'tsp'], ['pepper', '2', 'tsp']]],\n  ['generated control 1',\n   [[['salt', '2/3', 'tsp', 'seasoning'], ['lime', '1', 'each', 'base'], ['milk', '2/3', 'cup', 'base'],\n     ['egg', '4', 'each', 'base'], ['flour', '3/4', 'cup', 'base']],\n    6, 3],\n   [['salt', '3/8', 'tsp'], ['lime', '1', 'each'], ['milk', '3/8', 'cup'], ['egg', '2', 'each'],\n    ['flour', '3/8', 'cup']]],\n  ['generated control 2', [[['butter', '5/2', 'tbsp', 'base'], ['egg', '1/2', 'each', 'base']], 7, 9],\n   [['butter', '3 1/4', 'tbsp'], ['egg', '1', 'each']]],\n  ['generated control 3', [[['salt', '1', 'tsp', 'seasoning'], ['garlic clove', '2', 'each', 'base']], 6, 7],\n   [['salt', '1 1/8', 'tsp'], ['garlic clove', '2', 'each']]]],\n [['half egg rounds up', [[['egg', '3', 'each', 'base'], ['milk', '1/2', 'cup', 'base']], 4, 6],\n   [['egg', '5', 'each'], ['milk', '3/4', 'cup']]],\n  ['identity scaling control', [[['egg', '2', 'each', 'base'], ['flour', '3/2', 'cup', 'base']], 4, 4],\n   [['egg', '2', 'each'], ['flour', '1 1/2', 'cup']]],\n  ['zero servings rejected', [[['egg', '2', 'each', 'base']], 0, 4], 'error: servings must be positive'],\n  ['regression: countable floor of one',\n   [[['garlic clove', '1', 'each', 'base'], ['milk', '5/2', 'cup', 'base'], ['flour', '3', 'cup', 'base'],\n     ['cumin', '1', 'tsp', 'seasoning'], ['salt', '3', 'tsp', 'seasoning']],\n    4, 1],\n   [['garlic clove', '1', 'each'], ['milk', '5/8', 'cup'], ['flour', '3/4', 'cup'], ['cumin', '1/2', 'tsp'],\n    ['salt', '1 3/8', 'tsp']]],\n  ['repair check: countable floor of one',\n   [[['egg', '1/2', 'each', 'base'], ['garlic clove', '4', 'each', 'base'],\n     ['salt', '1/3', 'tsp', 'seasoning']],\n    5, 3],\n   [['egg', '1', 'each'], ['garlic clove', '2', 'each'], ['salt', '1/4', 'tsp']]],\n  ['generated control 1',\n   [[['butter', '3/4', 'tbsp', 'base'], ['egg', '4', 'each', 'base'], ['pepper', '1/3', 'tsp', 'seasoning']],\n    8, 11],\n   [['butter', '1', 'tbsp'], ['egg', '6', 'each'], ['pepper', '3/8', 'tsp']]],\n  ['generated control 2', [[['lime', '5', 'each', 'base'], ['cumin', '1', 'tsp', 'seasoning']], 3, 8],\n   [['lime', '13', 'each'], ['cumin', '2 1/4', 'tsp']]],\n  ['generated control 3',\n   [[['pepper', '9/4', 'tsp', 'seasoning'], ['egg', '1/2', 'each', 'base'], ['flour', '3/2', 'cup', 'base']],\n    2, 6],\n   [['pepper', '5 5/8', 'tsp'], ['egg', '2', 'each'], ['flour', '4 1/2', 'cup']]]]]\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-servings-scaler-countable-floor-of-one","generated_at":"2026-09-29T14:52:26.504963+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Home and commercial recipe scalers must keep countable items whole and print measurable fractions cooks can actually portion.","root_cause":"The rounded count is emitted without the minimum of one whole item.","sha256":"aaa942300c311ca27b4eea24f6308c3f1ac484ab37778e57ffebbac68781855a","title":"Servings scaler: countable floor of one · 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.643,"exit_code":1,"observations":[{"actual":[["egg","2","each"],["flour","1 1/2","cup"]],"check":"identity scaling control","expected":[["egg","2","each"],["flour","1 1/2","cup"]],"passed":true},{"actual":"error: servings must be positive","check":"zero servings rejected","expected":"error: servings must be positive","passed":true},{"actual":[["salt","1 3/4","tsp"],["egg","6","each"]],"check":"double batch with seasoning","expected":[["salt","1 3/4","tsp"],["egg","6","each"]],"passed":true},{"actual":[["pepper","3/8","tsp"],["egg","1","each"],["lime","1","each"],["milk","1/8","cup"]],"check":"regression: countable floor of one","expected":[["pepper","3/8","tsp"],["egg","1","each"],["lime","1","each"],["milk","1/8","cup"]],"passed":true},{"actual":[["cumin","1 1/4","tsp"],["lime","0","each"]],"check":"repair check: countable floor of one","expected":[["cumin","1 1/4","tsp"],["lime","1","each"]],"passed":false},{"actual":[["egg","3","each"],["milk","3/4","cup"],["cumin","3/8","tsp"]],"check":"generated control 1","expected":[["egg","3","each"],["milk","3/4","cup"],["cumin","3/8","tsp"]],"passed":true},{"actual":[["pepper","2 1/4","tsp"],["salt","1 1/8","tsp"],["garlic clove","2","each"],["butter","1/2","tbsp"],["milk","2","cup"]],"check":"generated control 2","expected":[["pepper","2 1/4","tsp"],["salt","1 1/8","tsp"],["garlic clove","2","each"],["butter","1/2","tbsp"],["milk","2","cup"]],"passed":true},{"actual":[["lime","1","each"],["pepper","pinch","tsp"],["butter","1/8","tbsp"],["cumin","1/8","tsp"]],"check":"generated control 3","expected":[["lime","1","each"],["pepper","pinch","tsp"],["butter","1/8","tbsp"],["cumin","1/8","tsp"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"identity scaling control\", \"actual\": [[\"egg\", \"2\", \"each\"], [\"flour\", \"1 1/2\", \"cup\"]], \"expected\": [[\"egg\", \"2\", \"each\"], [\"flour\", \"1 1/2\", \"cup\"]], \"passed\": true}, {\"check\": \"zero servings rejected\", \"actual\": \"error: servings must be positive\", \"expected\": \"error: servings must be positive\", \"passed\": true}, {\"check\": \"double batch with seasoning\", \"actual\": [[\"salt\", \"1 3/4\", \"tsp\"], [\"egg\", \"6\", \"each\"]], \"expected\": [[\"salt\", \"1 3/4\", \"tsp\"], [\"egg\", \"6\", \"each\"]], \"passed\": true}, {\"check\": \"regression: countable floor of one\", \"actual\": [[\"pepper\", \"3/8\", \"tsp\"], [\"egg\", \"1\", \"each\"], [\"lime\", \"1\", \"each\"], [\"milk\", \"1/8\", \"cup\"]], \"expected\": [[\"pepper\", \"3/8\", \"tsp\"], [\"egg\", \"1\", \"each\"], [\"lime\", \"1\", \"each\"], [\"milk\", \"1/8\", \"cup\"]], \"passed\": true}, {\"check\": \"repair check: countable floor of one\", \"actual\": [[\"cumin\", \"1 1/4\", \"tsp\"], [\"lime\", \"0\", \"each\"]], \"expected\": [[\"cumin\", \"1 1/4\", \"tsp\"], [\"lime\", \"1\", \"each\"]], \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": [[\"egg\", \"3\", \"each\"], [\"milk\", \"3/4\", \"cup\"], [\"cumin\", \"3/8\", \"tsp\"]], \"expected\": [[\"egg\", \"3\", \"each\"], [\"milk\", \"3/4\", \"cup\"], [\"cumin\", \"3/8\", \"tsp\"]], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [[\"pepper\", \"2 1/4\", \"tsp\"], [\"salt\", \"1 1/8\", \"tsp\"], [\"garlic clove\", \"2\", \"each\"], [\"butter\", \"1/2\", \"tbsp\"], [\"milk\", \"2\", \"cup\"]], \"expected\": [[\"pepper\", \"2 1/4\", \"tsp\"], [\"salt\", \"1 1/8\", \"tsp\"], [\"garlic clove\", \"2\", \"each\"], [\"butter\", \"1/2\", \"tbsp\"], [\"milk\", \"2\", \"cup\"]], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [[\"lime\", \"1\", \"each\"], [\"pepper\", \"pinch\", \"tsp\"], [\"butter\", \"1/8\", \"tbsp\"], [\"cumin\", \"1/8\", \"tsp\"]], \"expected\": [[\"lime\", \"1\", \"each\"], [\"pepper\", \"pinch\", \"tsp\"], [\"butter\", \"1/8\", \"tbsp\"], [\"cumin\", \"1/8\", \"tsp\"]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.071,"exit_code":1,"observations":[{"actual":[["egg","2","each"],["flour","1 1/2","cup"]],"check":"identity scaling control","expected":[["egg","2","each"],["flour","1 1/2","cup"]],"passed":true},{"actual":"error: servings must be positive","check":"zero servings rejected","expected":"error: servings must be positive","passed":true},{"actual":[["salt","1 3/4","tsp"],["egg","6","each"]],"check":"double batch with seasoning","expected":[["salt","1 3/4","tsp"],["egg","6","each"]],"passed":true},{"actual":[["pepper","3/8","tsp"],["egg","1","each"],["lime","0","each"],["milk","1/8","cup"]],"check":"regression: countable floor of one","expected":[["pepper","3/8","tsp"],["egg","1","each"],["lime","1","each"],["milk","1/8","cup"]],"passed":false},{"actual":[["cumin","1 1/4","tsp"],["lime","0","each"]],"check":"repair check: countable floor of one","expected":[["cumin","1 1/4","tsp"],["lime","1","each"]],"passed":false},{"actual":[["egg","3","each"],["milk","3/4","cup"],["cumin","3/8","tsp"]],"check":"generated control 1","expected":[["egg","3","each"],["milk","3/4","cup"],["cumin","3/8","tsp"]],"passed":true},{"actual":[["pepper","2 1/4","tsp"],["salt","1 1/8","tsp"],["garlic clove","2","each"],["butter","1/2","tbsp"],["milk","2","cup"]],"check":"generated control 2","expected":[["pepper","2 1/4","tsp"],["salt","1 1/8","tsp"],["garlic clove","2","each"],["butter","1/2","tbsp"],["milk","2","cup"]],"passed":true},{"actual":[["lime","1","each"],["pepper","pinch","tsp"],["butter","1/8","tbsp"],["cumin","1/8","tsp"]],"check":"generated control 3","expected":[["lime","1","each"],["pepper","pinch","tsp"],["butter","1/8","tbsp"],["cumin","1/8","tsp"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"identity scaling control\", \"actual\": [[\"egg\", \"2\", \"each\"], [\"flour\", \"1 1/2\", \"cup\"]], \"expected\": [[\"egg\", \"2\", \"each\"], [\"flour\", \"1 1/2\", \"cup\"]], \"passed\": true}, {\"check\": \"zero servings rejected\", \"actual\": \"error: servings must be positive\", \"expected\": \"error: servings must be positive\", \"passed\": true}, {\"check\": \"double batch with seasoning\", \"actual\": [[\"salt\", \"1 3/4\", \"tsp\"], [\"egg\", \"6\", \"each\"]], \"expected\": [[\"salt\", \"1 3/4\", \"tsp\"], [\"egg\", \"6\", \"each\"]], \"passed\": true}, {\"check\": \"regression: countable floor of one\", \"actual\": [[\"pepper\", \"3/8\", \"tsp\"], [\"egg\", \"1\", \"each\"], [\"lime\", \"0\", \"each\"], [\"milk\", \"1/8\", \"cup\"]], \"expected\": [[\"pepper\", \"3/8\", \"tsp\"], [\"egg\", \"1\", \"each\"], [\"lime\", \"1\", \"each\"], [\"milk\", \"1/8\", \"cup\"]], \"passed\": false}, {\"check\": \"repair check: countable floor of one\", \"actual\": [[\"cumin\", \"1 1/4\", \"tsp\"], [\"lime\", \"0\", \"each\"]], \"expected\": [[\"cumin\", \"1 1/4\", \"tsp\"], [\"lime\", \"1\", \"each\"]], \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": [[\"egg\", \"3\", \"each\"], [\"milk\", \"3/4\", \"cup\"], [\"cumin\", \"3/8\", \"tsp\"]], \"expected\": [[\"egg\", \"3\", \"each\"], [\"milk\", \"3/4\", \"cup\"], [\"cumin\", \"3/8\", \"tsp\"]], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [[\"pepper\", \"2 1/4\", \"tsp\"], [\"salt\", \"1 1/8\", \"tsp\"], [\"garlic clove\", \"2\", \"each\"], [\"butter\", \"1/2\", \"tbsp\"], [\"milk\", \"2\", \"cup\"]], \"expected\": [[\"pepper\", \"2 1/4\", \"tsp\"], [\"salt\", \"1 1/8\", \"tsp\"], [\"garlic clove\", \"2\", \"each\"], [\"butter\", \"1/2\", \"tbsp\"], [\"milk\", \"2\", \"cup\"]], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [[\"lime\", \"1\", \"each\"], [\"pepper\", \"pinch\", \"tsp\"], [\"butter\", \"1/8\", \"tbsp\"], [\"cumin\", \"1/8\", \"tsp\"]], \"expected\": [[\"lime\", \"1\", \"each\"], [\"pepper\", \"pinch\", \"tsp\"], [\"butter\", \"1/8\", \"tbsp\"], [\"cumin\", \"1/8\", \"tsp\"]], \"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."}}