{"abstract":"A meal of mostly lentils and a slice of bread reports the plain average of their GIs.","category":"Recipe scaling and nutrition","checks":8,"contract":"Rows [name, gi, carbs, fiber, grams_eaten, per_grams] where carbs and fiber are per per_grams. Available carb = (carbs-fiber)*eaten/per. Meal GI = sum(gi*avail)/sum(avail) half-up integer (None if no available carb). GL = sum(gi*avail)/100 half-up to 0.1. Class from the exact GL: <=10 low, <20 medium, else high.","evaluation_group":"w2-recipe_scaling_and_nutrition-glycemic-load","failed_approach":"Weighting by grams eaten ignores how much carbohydrate each food supplies.","family":"w2-recipe_scaling_and_nutrition-glycemic-load-meal-gi-weighting","id":"FA-97231","implementations":{"attempt":{"sha256":"ba0f496e2dfc01e258e199025d3da5b6b9f549888a53d3eba37e594e50fdd322","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(foods):\n    tot = Fraction(0)\n    w = Fraction(0)\n    for name, gi, carbs, fiber, eaten, per in foods:\n        avail = (Fraction(str(carbs)) - Fraction(str(fiber))) * Fraction(eaten, per)\n        tot += avail\n        w += gi * avail\n    gi_meal = math.floor(sum(f[1] * f[4] for f in foods) / Fraction(sum(f[4] for f in foods)) + Fraction(1, 2)) if tot else None\n    gl = w / 100\n    cls = 'low' if gl <= 10 else 'medium' if gl < 20 else 'high'\n    return {'gi': gi_meal, 'gl': math.floor(gl * 10 + Fraction(1, 2)) / 10, 'class': cls}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['single food', [[['rice', 73, 28, 0.4, 150, 100]]], {'class': 'high', 'gi': 73, 'gl': 30.2}],\n  ['load exactly ten', [[['juice', 50, 10, 0, 200, 100]]], {'class': 'low', 'gi': 50, 'gl': 10.0}],\n  ['no carbs', [[['egg', 0, 0, 0, 50, 100]]], {'class': 'low', 'gi': None, 'gl': 0.0}],\n  ['regression: meal GI weighting', [[['lentils', 32, 20, 8, 80, 100], ['rice', 73, 28, 0.4, 30, 100]]],\n   {'class': 'low', 'gi': 51, 'gl': 9.1}],\n  ['repair check: meal GI weighting',\n   [[['rice', 73, 28, 0.4, 150, 100], ['banana', 51, 23, 2.6, 30, 100], ['lentils', 32, 20, 8, 50, 50]]],\n   {'class': 'high', 'gi': 62, 'gl': 37.2}],\n  ['generated control 1', [[['apple', 36, 14, 2.4, 120, 50]]], {'class': 'medium', 'gi': 36, 'gl': 10.0}],\n  ['generated control 2',\n   [[['rice', 73, 28, 0.4, 120, 100], ['juice', 50, 10, 0, 50, 50], ['apple', 36, 14, 2.4, 80, 100],\n     ['banana', 51, 23, 2.6, 80, 100]]],\n   {'class': 'high', 'gi': 59, 'gl': 40.8}],\n  ['generated control 3',\n   [[['juice', 50, 10, 0, 150, 50], ['lentils', 32, 20, 8, 80, 100], ['apple', 36, 14, 2.4, 150, 100],\n     ['banana', 51, 23, 2.6, 30, 100]]],\n   {'class': 'high', 'gi': 44, 'gl': 27.5}]],\n [['load exactly ten', [[['juice', 50, 10, 0, 200, 100]]], {'class': 'low', 'gi': 50, 'gl': 10.0}],\n  ['no carbs', [[['egg', 0, 0, 0, 50, 100]]], {'class': 'low', 'gi': None, 'gl': 0.0}],\n  ['mixed meal', [[['lentils', 32, 20, 8, 200, 100], ['bread', 75, 49, 2.7, 50, 100]]],\n   {'class': 'high', 'gi': 53, 'gl': 25.0}],\n  ['regression: meal GI weighting',\n   [[['oats', 55, 60, 10, 50, 50], ['banana', 51, 23, 2.6, 50, 100], ['apple', 36, 14, 2.4, 150, 100]]],\n   {'class': 'high', 'gi': 50, 'gl': 39.0}],\n  ['repair check: meal GI weighting',\n   [[['juice', 50, 10, 0, 200, 50], ['bread', 75, 49, 2.7, 200, 50], ['banana', 51, 23, 2.6, 150, 100]]],\n   {'class': 'high', 'gi': 68, 'gl': 174.5}],\n  ['generated control 1', [[['bread', 75, 49, 2.7, 150, 50], ['oats', 55, 60, 10, 150, 100]]],\n   {'class': 'high', 'gi': 68, 'gl': 145.4}],\n  ['generated control 2',\n   [[['juice', 50, 10, 0, 120, 100], ['lentils', 32, 20, 8, 50, 100], ['bread', 75, 49, 2.7, 150, 50]]],\n   {'class': 'high', 'gi': 71, 'gl': 112.1}],\n  ['generated control 3',\n   [[['bread', 75, 49, 2.7, 50, 100], ['rice', 73, 28, 0.4, 200, 50], ['lentils', 32, 20, 8, 80, 100]]],\n   {'class': 'high', 'gi': 71, 'gl': 101.0}]],\n [['no carbs', [[['egg', 0, 0, 0, 50, 100]]], {'class': 'low', 'gi': None, 'gl': 0.0}],\n  ['mixed meal', [[['lentils', 32, 20, 8, 200, 100], ['bread', 75, 49, 2.7, 50, 100]]],\n   {'class': 'high', 'gi': 53, 'gl': 25.0}],\n  ['single food', [[['rice', 73, 28, 0.4, 150, 100]]], {'class': 'high', 'gi': 73, 'gl': 30.2}],\n  ['regression: meal GI weighting', [[['bread', 75, 49, 2.7, 200, 100], ['juice', 50, 10, 0, 50, 50]]],\n   {'class': 'high', 'gi': 73, 'gl': 74.5}],\n  ['repair check: meal GI weighting',\n   [[['bread', 75, 49, 2.7, 120, 50], ['banana', 51, 23, 2.6, 30, 100], ['lentils', 32, 20, 8, 50, 100],\n     ['juice', 50, 10, 0, 200, 100]]],\n   {'class': 'high', 'gi': 69, 'gl': 98.4}],\n  ['generated control 1',\n   [[['lentils', 32, 20, 8, 50, 50], ['oats', 55, 60, 10, 200, 100], ['banana', 51, 23, 2.6, 80, 100]]],\n   {'class': 'high', 'gi': 52, 'gl': 67.2}],\n  ['generated control 2',\n   [[['bread', 75, 49, 2.7, 120, 100], ['oats', 55, 60, 10, 150, 50], ['lentils', 32, 20, 8, 30, 50]]],\n   {'class': 'high', 'gi': 59, 'gl': 126.5}],\n  ['generated control 3', [[['bread', 75, 49, 2.7, 200, 50]]], {'class': 'high', 'gi': 75, 'gl': 138.9}]],\n [['mixed meal', [[['lentils', 32, 20, 8, 200, 100], ['bread', 75, 49, 2.7, 50, 100]]],\n   {'class': 'high', 'gi': 53, 'gl': 25.0}],\n  ['single food', [[['rice', 73, 28, 0.4, 150, 100]]], {'class': 'high', 'gi': 73, 'gl': 30.2}],\n  ['load exactly ten', [[['juice', 50, 10, 0, 200, 100]]], {'class': 'low', 'gi': 50, 'gl': 10.0}],\n  ['regression: meal GI weighting',\n   [[['rice', 73, 28, 0.4, 80, 100], ['juice', 50, 10, 0, 200, 50], ['bread', 75, 49, 2.7, 80, 100]]],\n   {'class': 'high', 'gi': 64, 'gl': 63.9}],\n  ['repair check: meal GI weighting',\n   [[['banana', 51, 23, 2.6, 150, 100], ['juice', 50, 10, 0, 150, 50], ['lentils', 32, 20, 8, 50, 50]]],\n   {'class': 'high', 'gi': 47, 'gl': 34.4}],\n  ['generated control 1', [[['bread', 75, 49, 2.7, 30, 100], ['rice', 73, 28, 0.4, 80, 100]]],\n   {'class': 'high', 'gi': 74, 'gl': 26.5}],\n  ['generated control 2',\n   [[['oats', 55, 60, 10, 30, 100], ['rice', 73, 28, 0.4, 200, 50], ['banana', 51, 23, 2.6, 30, 100]]],\n   {'class': 'high', 'gi': 70, 'gl': 92.0}],\n  ['generated control 3', [[['bread', 75, 49, 2.7, 150, 100], ['lentils', 32, 20, 8, 120, 50]]],\n   {'class': 'high', 'gi': 62, 'gl': 61.3}]],\n [['single food', [[['rice', 73, 28, 0.4, 150, 100]]], {'class': 'high', 'gi': 73, 'gl': 30.2}],\n  ['load exactly ten', [[['juice', 50, 10, 0, 200, 100]]], {'class': 'low', 'gi': 50, 'gl': 10.0}],\n  ['no carbs', [[['egg', 0, 0, 0, 50, 100]]], {'class': 'low', 'gi': None, 'gl': 0.0}],\n  ['regression: meal GI weighting',\n   [[['banana', 51, 23, 2.6, 30, 100], ['oats', 55, 60, 10, 120, 50], ['apple', 36, 14, 2.4, 50, 100],\n     ['juice', 50, 10, 0, 150, 100]]],\n   {'class': 'high', 'gi': 54, 'gl': 78.7}],\n  ['repair check: meal GI weighting',\n   [[['oats', 55, 60, 10, 200, 100], ['lentils', 32, 20, 8, 120, 100], ['banana', 51, 23, 2.6, 200, 50]]],\n   {'class': 'high', 'gi': 52, 'gl': 101.2}],\n  ['generated control 1', [[['bread', 75, 49, 2.7, 200, 100]]], {'class': 'high', 'gi': 75, 'gl': 69.5}],\n  ['generated control 2',\n   [[['lentils', 32, 20, 8, 50, 100], ['rice', 73, 28, 0.4, 120, 100], ['banana', 51, 23, 2.6, 200, 100]]],\n   {'class': 'high', 'gi': 59, 'gl': 46.9}],\n  ['generated control 3', [[['bread', 75, 49, 2.7, 80, 50], ['lentils', 32, 20, 8, 80, 100]]],\n   {'class': 'high', 'gi': 70, 'gl': 58.6}]]]\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":"27bae2be8630cfea505517a0ae875fc8785e379f553e6fb2d6efe7b2799b05c0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(foods):\n    tot = Fraction(0)\n    w = Fraction(0)\n    for name, gi, carbs, fiber, eaten, per in foods:\n        avail = (Fraction(str(carbs)) - Fraction(str(fiber))) * Fraction(eaten, per)\n        tot += avail\n        w += gi * avail\n    gi_meal = math.floor(Fraction(sum(f[1] for f in foods), len(foods)) + Fraction(1, 2)) if tot else None\n    gl = w / 100\n    cls = 'low' if gl <= 10 else 'medium' if gl < 20 else 'high'\n    return {'gi': gi_meal, 'gl': math.floor(gl * 10 + Fraction(1, 2)) / 10, 'class': cls}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['single food', [[['rice', 73, 28, 0.4, 150, 100]]], {'class': 'high', 'gi': 73, 'gl': 30.2}],\n  ['load exactly ten', [[['juice', 50, 10, 0, 200, 100]]], {'class': 'low', 'gi': 50, 'gl': 10.0}],\n  ['no carbs', [[['egg', 0, 0, 0, 50, 100]]], {'class': 'low', 'gi': None, 'gl': 0.0}],\n  ['regression: meal GI weighting', [[['lentils', 32, 20, 8, 80, 100], ['rice', 73, 28, 0.4, 30, 100]]],\n   {'class': 'low', 'gi': 51, 'gl': 9.1}],\n  ['repair check: meal GI weighting',\n   [[['rice', 73, 28, 0.4, 150, 100], ['banana', 51, 23, 2.6, 30, 100], ['lentils', 32, 20, 8, 50, 50]]],\n   {'class': 'high', 'gi': 62, 'gl': 37.2}],\n  ['generated control 1', [[['apple', 36, 14, 2.4, 120, 50]]], {'class': 'medium', 'gi': 36, 'gl': 10.0}],\n  ['generated control 2',\n   [[['rice', 73, 28, 0.4, 120, 100], ['juice', 50, 10, 0, 50, 50], ['apple', 36, 14, 2.4, 80, 100],\n     ['banana', 51, 23, 2.6, 80, 100]]],\n   {'class': 'high', 'gi': 59, 'gl': 40.8}],\n  ['generated control 3',\n   [[['juice', 50, 10, 0, 150, 50], ['lentils', 32, 20, 8, 80, 100], ['apple', 36, 14, 2.4, 150, 100],\n     ['banana', 51, 23, 2.6, 30, 100]]],\n   {'class': 'high', 'gi': 44, 'gl': 27.5}]],\n [['load exactly ten', [[['juice', 50, 10, 0, 200, 100]]], {'class': 'low', 'gi': 50, 'gl': 10.0}],\n  ['no carbs', [[['egg', 0, 0, 0, 50, 100]]], {'class': 'low', 'gi': None, 'gl': 0.0}],\n  ['mixed meal', [[['lentils', 32, 20, 8, 200, 100], ['bread', 75, 49, 2.7, 50, 100]]],\n   {'class': 'high', 'gi': 53, 'gl': 25.0}],\n  ['regression: meal GI weighting',\n   [[['oats', 55, 60, 10, 50, 50], ['banana', 51, 23, 2.6, 50, 100], ['apple', 36, 14, 2.4, 150, 100]]],\n   {'class': 'high', 'gi': 50, 'gl': 39.0}],\n  ['repair check: meal GI weighting',\n   [[['juice', 50, 10, 0, 200, 50], ['bread', 75, 49, 2.7, 200, 50], ['banana', 51, 23, 2.6, 150, 100]]],\n   {'class': 'high', 'gi': 68, 'gl': 174.5}],\n  ['generated control 1', [[['bread', 75, 49, 2.7, 150, 50], ['oats', 55, 60, 10, 150, 100]]],\n   {'class': 'high', 'gi': 68, 'gl': 145.4}],\n  ['generated control 2',\n   [[['juice', 50, 10, 0, 120, 100], ['lentils', 32, 20, 8, 50, 100], ['bread', 75, 49, 2.7, 150, 50]]],\n   {'class': 'high', 'gi': 71, 'gl': 112.1}],\n  ['generated control 3',\n   [[['bread', 75, 49, 2.7, 50, 100], ['rice', 73, 28, 0.4, 200, 50], ['lentils', 32, 20, 8, 80, 100]]],\n   {'class': 'high', 'gi': 71, 'gl': 101.0}]],\n [['no carbs', [[['egg', 0, 0, 0, 50, 100]]], {'class': 'low', 'gi': None, 'gl': 0.0}],\n  ['mixed meal', [[['lentils', 32, 20, 8, 200, 100], ['bread', 75, 49, 2.7, 50, 100]]],\n   {'class': 'high', 'gi': 53, 'gl': 25.0}],\n  ['single food', [[['rice', 73, 28, 0.4, 150, 100]]], {'class': 'high', 'gi': 73, 'gl': 30.2}],\n  ['regression: meal GI weighting', [[['bread', 75, 49, 2.7, 200, 100], ['juice', 50, 10, 0, 50, 50]]],\n   {'class': 'high', 'gi': 73, 'gl': 74.5}],\n  ['repair check: meal GI weighting',\n   [[['bread', 75, 49, 2.7, 120, 50], ['banana', 51, 23, 2.6, 30, 100], ['lentils', 32, 20, 8, 50, 100],\n     ['juice', 50, 10, 0, 200, 100]]],\n   {'class': 'high', 'gi': 69, 'gl': 98.4}],\n  ['generated control 1',\n   [[['lentils', 32, 20, 8, 50, 50], ['oats', 55, 60, 10, 200, 100], ['banana', 51, 23, 2.6, 80, 100]]],\n   {'class': 'high', 'gi': 52, 'gl': 67.2}],\n  ['generated control 2',\n   [[['bread', 75, 49, 2.7, 120, 100], ['oats', 55, 60, 10, 150, 50], ['lentils', 32, 20, 8, 30, 50]]],\n   {'class': 'high', 'gi': 59, 'gl': 126.5}],\n  ['generated control 3', [[['bread', 75, 49, 2.7, 200, 50]]], {'class': 'high', 'gi': 75, 'gl': 138.9}]],\n [['mixed meal', [[['lentils', 32, 20, 8, 200, 100], ['bread', 75, 49, 2.7, 50, 100]]],\n   {'class': 'high', 'gi': 53, 'gl': 25.0}],\n  ['single food', [[['rice', 73, 28, 0.4, 150, 100]]], {'class': 'high', 'gi': 73, 'gl': 30.2}],\n  ['load exactly ten', [[['juice', 50, 10, 0, 200, 100]]], {'class': 'low', 'gi': 50, 'gl': 10.0}],\n  ['regression: meal GI weighting',\n   [[['rice', 73, 28, 0.4, 80, 100], ['juice', 50, 10, 0, 200, 50], ['bread', 75, 49, 2.7, 80, 100]]],\n   {'class': 'high', 'gi': 64, 'gl': 63.9}],\n  ['repair check: meal GI weighting',\n   [[['banana', 51, 23, 2.6, 150, 100], ['juice', 50, 10, 0, 150, 50], ['lentils', 32, 20, 8, 50, 50]]],\n   {'class': 'high', 'gi': 47, 'gl': 34.4}],\n  ['generated control 1', [[['bread', 75, 49, 2.7, 30, 100], ['rice', 73, 28, 0.4, 80, 100]]],\n   {'class': 'high', 'gi': 74, 'gl': 26.5}],\n  ['generated control 2',\n   [[['oats', 55, 60, 10, 30, 100], ['rice', 73, 28, 0.4, 200, 50], ['banana', 51, 23, 2.6, 30, 100]]],\n   {'class': 'high', 'gi': 70, 'gl': 92.0}],\n  ['generated control 3', [[['bread', 75, 49, 2.7, 150, 100], ['lentils', 32, 20, 8, 120, 50]]],\n   {'class': 'high', 'gi': 62, 'gl': 61.3}]],\n [['single food', [[['rice', 73, 28, 0.4, 150, 100]]], {'class': 'high', 'gi': 73, 'gl': 30.2}],\n  ['load exactly ten', [[['juice', 50, 10, 0, 200, 100]]], {'class': 'low', 'gi': 50, 'gl': 10.0}],\n  ['no carbs', [[['egg', 0, 0, 0, 50, 100]]], {'class': 'low', 'gi': None, 'gl': 0.0}],\n  ['regression: meal GI weighting',\n   [[['banana', 51, 23, 2.6, 30, 100], ['oats', 55, 60, 10, 120, 50], ['apple', 36, 14, 2.4, 50, 100],\n     ['juice', 50, 10, 0, 150, 100]]],\n   {'class': 'high', 'gi': 54, 'gl': 78.7}],\n  ['repair check: meal GI weighting',\n   [[['oats', 55, 60, 10, 200, 100], ['lentils', 32, 20, 8, 120, 100], ['banana', 51, 23, 2.6, 200, 50]]],\n   {'class': 'high', 'gi': 52, 'gl': 101.2}],\n  ['generated control 1', [[['bread', 75, 49, 2.7, 200, 100]]], {'class': 'high', 'gi': 75, 'gl': 69.5}],\n  ['generated control 2',\n   [[['lentils', 32, 20, 8, 50, 100], ['rice', 73, 28, 0.4, 120, 100], ['banana', 51, 23, 2.6, 200, 100]]],\n   {'class': 'high', 'gi': 59, 'gl': 46.9}],\n  ['generated control 3', [[['bread', 75, 49, 2.7, 80, 50], ['lentils', 32, 20, 8, 80, 100]]],\n   {'class': 'high', 'gi': 70, 'gl': 58.6}]]]\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"},"fixed":{"sha256":"666a3de519f38eb792edab18bc99f9e7d8b924da0e5b9803637064457ae53772","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(foods):\n    tot = Fraction(0)\n    w = Fraction(0)\n    for name, gi, carbs, fiber, eaten, per in foods:\n        avail = (Fraction(str(carbs)) - Fraction(str(fiber))) * Fraction(eaten, per)\n        tot += avail\n        w += gi * avail\n    gi_meal = math.floor(w / tot + Fraction(1, 2)) if tot else None\n    gl = w / 100\n    cls = 'low' if gl <= 10 else 'medium' if gl < 20 else 'high'\n    return {'gi': gi_meal, 'gl': math.floor(gl * 10 + Fraction(1, 2)) / 10, 'class': cls}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['single food', [[['rice', 73, 28, 0.4, 150, 100]]], {'class': 'high', 'gi': 73, 'gl': 30.2}],\n  ['load exactly ten', [[['juice', 50, 10, 0, 200, 100]]], {'class': 'low', 'gi': 50, 'gl': 10.0}],\n  ['no carbs', [[['egg', 0, 0, 0, 50, 100]]], {'class': 'low', 'gi': None, 'gl': 0.0}],\n  ['regression: meal GI weighting', [[['lentils', 32, 20, 8, 80, 100], ['rice', 73, 28, 0.4, 30, 100]]],\n   {'class': 'low', 'gi': 51, 'gl': 9.1}],\n  ['repair check: meal GI weighting',\n   [[['rice', 73, 28, 0.4, 150, 100], ['banana', 51, 23, 2.6, 30, 100], ['lentils', 32, 20, 8, 50, 50]]],\n   {'class': 'high', 'gi': 62, 'gl': 37.2}],\n  ['generated control 1', [[['apple', 36, 14, 2.4, 120, 50]]], {'class': 'medium', 'gi': 36, 'gl': 10.0}],\n  ['generated control 2',\n   [[['rice', 73, 28, 0.4, 120, 100], ['juice', 50, 10, 0, 50, 50], ['apple', 36, 14, 2.4, 80, 100],\n     ['banana', 51, 23, 2.6, 80, 100]]],\n   {'class': 'high', 'gi': 59, 'gl': 40.8}],\n  ['generated control 3',\n   [[['juice', 50, 10, 0, 150, 50], ['lentils', 32, 20, 8, 80, 100], ['apple', 36, 14, 2.4, 150, 100],\n     ['banana', 51, 23, 2.6, 30, 100]]],\n   {'class': 'high', 'gi': 44, 'gl': 27.5}]],\n [['load exactly ten', [[['juice', 50, 10, 0, 200, 100]]], {'class': 'low', 'gi': 50, 'gl': 10.0}],\n  ['no carbs', [[['egg', 0, 0, 0, 50, 100]]], {'class': 'low', 'gi': None, 'gl': 0.0}],\n  ['mixed meal', [[['lentils', 32, 20, 8, 200, 100], ['bread', 75, 49, 2.7, 50, 100]]],\n   {'class': 'high', 'gi': 53, 'gl': 25.0}],\n  ['regression: meal GI weighting',\n   [[['oats', 55, 60, 10, 50, 50], ['banana', 51, 23, 2.6, 50, 100], ['apple', 36, 14, 2.4, 150, 100]]],\n   {'class': 'high', 'gi': 50, 'gl': 39.0}],\n  ['repair check: meal GI weighting',\n   [[['juice', 50, 10, 0, 200, 50], ['bread', 75, 49, 2.7, 200, 50], ['banana', 51, 23, 2.6, 150, 100]]],\n   {'class': 'high', 'gi': 68, 'gl': 174.5}],\n  ['generated control 1', [[['bread', 75, 49, 2.7, 150, 50], ['oats', 55, 60, 10, 150, 100]]],\n   {'class': 'high', 'gi': 68, 'gl': 145.4}],\n  ['generated control 2',\n   [[['juice', 50, 10, 0, 120, 100], ['lentils', 32, 20, 8, 50, 100], ['bread', 75, 49, 2.7, 150, 50]]],\n   {'class': 'high', 'gi': 71, 'gl': 112.1}],\n  ['generated control 3',\n   [[['bread', 75, 49, 2.7, 50, 100], ['rice', 73, 28, 0.4, 200, 50], ['lentils', 32, 20, 8, 80, 100]]],\n   {'class': 'high', 'gi': 71, 'gl': 101.0}]],\n [['no carbs', [[['egg', 0, 0, 0, 50, 100]]], {'class': 'low', 'gi': None, 'gl': 0.0}],\n  ['mixed meal', [[['lentils', 32, 20, 8, 200, 100], ['bread', 75, 49, 2.7, 50, 100]]],\n   {'class': 'high', 'gi': 53, 'gl': 25.0}],\n  ['single food', [[['rice', 73, 28, 0.4, 150, 100]]], {'class': 'high', 'gi': 73, 'gl': 30.2}],\n  ['regression: meal GI weighting', [[['bread', 75, 49, 2.7, 200, 100], ['juice', 50, 10, 0, 50, 50]]],\n   {'class': 'high', 'gi': 73, 'gl': 74.5}],\n  ['repair check: meal GI weighting',\n   [[['bread', 75, 49, 2.7, 120, 50], ['banana', 51, 23, 2.6, 30, 100], ['lentils', 32, 20, 8, 50, 100],\n     ['juice', 50, 10, 0, 200, 100]]],\n   {'class': 'high', 'gi': 69, 'gl': 98.4}],\n  ['generated control 1',\n   [[['lentils', 32, 20, 8, 50, 50], ['oats', 55, 60, 10, 200, 100], ['banana', 51, 23, 2.6, 80, 100]]],\n   {'class': 'high', 'gi': 52, 'gl': 67.2}],\n  ['generated control 2',\n   [[['bread', 75, 49, 2.7, 120, 100], ['oats', 55, 60, 10, 150, 50], ['lentils', 32, 20, 8, 30, 50]]],\n   {'class': 'high', 'gi': 59, 'gl': 126.5}],\n  ['generated control 3', [[['bread', 75, 49, 2.7, 200, 50]]], {'class': 'high', 'gi': 75, 'gl': 138.9}]],\n [['mixed meal', [[['lentils', 32, 20, 8, 200, 100], ['bread', 75, 49, 2.7, 50, 100]]],\n   {'class': 'high', 'gi': 53, 'gl': 25.0}],\n  ['single food', [[['rice', 73, 28, 0.4, 150, 100]]], {'class': 'high', 'gi': 73, 'gl': 30.2}],\n  ['load exactly ten', [[['juice', 50, 10, 0, 200, 100]]], {'class': 'low', 'gi': 50, 'gl': 10.0}],\n  ['regression: meal GI weighting',\n   [[['rice', 73, 28, 0.4, 80, 100], ['juice', 50, 10, 0, 200, 50], ['bread', 75, 49, 2.7, 80, 100]]],\n   {'class': 'high', 'gi': 64, 'gl': 63.9}],\n  ['repair check: meal GI weighting',\n   [[['banana', 51, 23, 2.6, 150, 100], ['juice', 50, 10, 0, 150, 50], ['lentils', 32, 20, 8, 50, 50]]],\n   {'class': 'high', 'gi': 47, 'gl': 34.4}],\n  ['generated control 1', [[['bread', 75, 49, 2.7, 30, 100], ['rice', 73, 28, 0.4, 80, 100]]],\n   {'class': 'high', 'gi': 74, 'gl': 26.5}],\n  ['generated control 2',\n   [[['oats', 55, 60, 10, 30, 100], ['rice', 73, 28, 0.4, 200, 50], ['banana', 51, 23, 2.6, 30, 100]]],\n   {'class': 'high', 'gi': 70, 'gl': 92.0}],\n  ['generated control 3', [[['bread', 75, 49, 2.7, 150, 100], ['lentils', 32, 20, 8, 120, 50]]],\n   {'class': 'high', 'gi': 62, 'gl': 61.3}]],\n [['single food', [[['rice', 73, 28, 0.4, 150, 100]]], {'class': 'high', 'gi': 73, 'gl': 30.2}],\n  ['load exactly ten', [[['juice', 50, 10, 0, 200, 100]]], {'class': 'low', 'gi': 50, 'gl': 10.0}],\n  ['no carbs', [[['egg', 0, 0, 0, 50, 100]]], {'class': 'low', 'gi': None, 'gl': 0.0}],\n  ['regression: meal GI weighting',\n   [[['banana', 51, 23, 2.6, 30, 100], ['oats', 55, 60, 10, 120, 50], ['apple', 36, 14, 2.4, 50, 100],\n     ['juice', 50, 10, 0, 150, 100]]],\n   {'class': 'high', 'gi': 54, 'gl': 78.7}],\n  ['repair check: meal GI weighting',\n   [[['oats', 55, 60, 10, 200, 100], ['lentils', 32, 20, 8, 120, 100], ['banana', 51, 23, 2.6, 200, 50]]],\n   {'class': 'high', 'gi': 52, 'gl': 101.2}],\n  ['generated control 1', [[['bread', 75, 49, 2.7, 200, 100]]], {'class': 'high', 'gi': 75, 'gl': 69.5}],\n  ['generated control 2',\n   [[['lentils', 32, 20, 8, 50, 100], ['rice', 73, 28, 0.4, 120, 100], ['banana', 51, 23, 2.6, 200, 100]]],\n   {'class': 'high', 'gi': 59, 'gl': 46.9}],\n  ['generated control 3', [[['bread', 75, 49, 2.7, 80, 50], ['lentils', 32, 20, 8, 80, 100]]],\n   {'class': 'high', 'gi': 70, 'gl': 58.6}]]]\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-glycemic-load-meal-gi-weighting","generated_at":"2026-09-29T14:52:30.202544+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Diabetes-friendly meal planners estimate combined glycemic load from mixed foods.","repair":"Weight each GI by its available carbohydrate.","root_cause":"Meal GI is an unweighted mean instead of weighted by available carbohydrate.","sha256":"a8559c3cf6fc6c4486c4864d34a1654be9a26f9ef200178e1b634ecfa67d5c59","title":"Meal glycemic load: meal GI weighting · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":45.766,"exit_code":1,"observations":[{"actual":{"class":"high","gi":73,"gl":30.2},"check":"single food","expected":{"class":"high","gi":73,"gl":30.2},"passed":true},{"actual":{"class":"low","gi":50,"gl":10.0},"check":"load exactly ten","expected":{"class":"low","gi":50,"gl":10.0},"passed":true},{"actual":{"class":"low","gi":null,"gl":0.0},"check":"no carbs","expected":{"class":"low","gi":null,"gl":0.0},"passed":true},{"actual":{"class":"low","gi":43,"gl":9.1},"check":"regression: meal GI weighting","expected":{"class":"low","gi":51,"gl":9.1},"passed":false},{"actual":{"class":"high","gi":61,"gl":37.2},"check":"repair check: meal GI weighting","expected":{"class":"high","gi":62,"gl":37.2},"passed":false},{"actual":{"class":"medium","gi":36,"gl":10.0},"check":"generated control 1","expected":{"class":"medium","gi":36,"gl":10.0},"passed":true},{"actual":{"class":"high","gi":55,"gl":40.8},"check":"generated control 2","expected":{"class":"high","gi":59,"gl":40.8},"passed":false},{"actual":{"class":"high","gi":41,"gl":27.5},"check":"generated control 3","expected":{"class":"high","gi":44,"gl":27.5},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"single food\", \"actual\": {\"gi\": 73, \"gl\": 30.2, \"class\": \"high\"}, \"expected\": {\"class\": \"high\", \"gi\": 73, \"gl\": 30.2}, \"passed\": true}, {\"check\": \"load exactly ten\", \"actual\": {\"gi\": 50, \"gl\": 10.0, \"class\": \"low\"}, \"expected\": {\"class\": \"low\", \"gi\": 50, \"gl\": 10.0}, \"passed\": true}, {\"check\": \"no carbs\", \"actual\": {\"gi\": null, \"gl\": 0.0, \"class\": \"low\"}, \"expected\": {\"class\": \"low\", \"gi\": null, \"gl\": 0.0}, \"passed\": true}, {\"check\": \"regression: meal GI weighting\", \"actual\": {\"gi\": 43, \"gl\": 9.1, \"class\": \"low\"}, \"expected\": {\"class\": \"low\", \"gi\": 51, \"gl\": 9.1}, \"passed\": false}, {\"check\": \"repair check: meal GI weighting\", \"actual\": {\"gi\": 61, \"gl\": 37.2, \"class\": \"high\"}, \"expected\": {\"class\": \"high\", \"gi\": 62, \"gl\": 37.2}, \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": {\"gi\": 36, \"gl\": 10.0, \"class\": \"medium\"}, \"expected\": {\"class\": \"medium\", \"gi\": 36, \"gl\": 10.0}, \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": {\"gi\": 55, \"gl\": 40.8, \"class\": \"high\"}, \"expected\": {\"class\": \"high\", \"gi\": 59, \"gl\": 40.8}, \"passed\": false}, {\"check\": \"generated control 3\", \"actual\": {\"gi\": 41, \"gl\": 27.5, \"class\": \"high\"}, \"expected\": {\"class\": \"high\", \"gi\": 44, \"gl\": 27.5}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.866,"exit_code":1,"observations":[{"actual":{"class":"high","gi":73,"gl":30.2},"check":"single food","expected":{"class":"high","gi":73,"gl":30.2},"passed":true},{"actual":{"class":"low","gi":50,"gl":10.0},"check":"load exactly ten","expected":{"class":"low","gi":50,"gl":10.0},"passed":true},{"actual":{"class":"low","gi":null,"gl":0.0},"check":"no carbs","expected":{"class":"low","gi":null,"gl":0.0},"passed":true},{"actual":{"class":"low","gi":53,"gl":9.1},"check":"regression: meal GI weighting","expected":{"class":"low","gi":51,"gl":9.1},"passed":false},{"actual":{"class":"high","gi":52,"gl":37.2},"check":"repair check: meal GI weighting","expected":{"class":"high","gi":62,"gl":37.2},"passed":false},{"actual":{"class":"medium","gi":36,"gl":10.0},"check":"generated control 1","expected":{"class":"medium","gi":36,"gl":10.0},"passed":true},{"actual":{"class":"high","gi":53,"gl":40.8},"check":"generated control 2","expected":{"class":"high","gi":59,"gl":40.8},"passed":false},{"actual":{"class":"high","gi":42,"gl":27.5},"check":"generated control 3","expected":{"class":"high","gi":44,"gl":27.5},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"single food\", \"actual\": {\"gi\": 73, \"gl\": 30.2, \"class\": \"high\"}, \"expected\": {\"class\": \"high\", \"gi\": 73, \"gl\": 30.2}, \"passed\": true}, {\"check\": \"load exactly ten\", \"actual\": {\"gi\": 50, \"gl\": 10.0, \"class\": \"low\"}, \"expected\": {\"class\": \"low\", \"gi\": 50, \"gl\": 10.0}, \"passed\": true}, {\"check\": \"no carbs\", \"actual\": {\"gi\": null, \"gl\": 0.0, \"class\": \"low\"}, \"expected\": {\"class\": \"low\", \"gi\": null, \"gl\": 0.0}, \"passed\": true}, {\"check\": \"regression: meal GI weighting\", \"actual\": {\"gi\": 53, \"gl\": 9.1, \"class\": \"low\"}, \"expected\": {\"class\": \"low\", \"gi\": 51, \"gl\": 9.1}, \"passed\": false}, {\"check\": \"repair check: meal GI weighting\", \"actual\": {\"gi\": 52, \"gl\": 37.2, \"class\": \"high\"}, \"expected\": {\"class\": \"high\", \"gi\": 62, \"gl\": 37.2}, \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": {\"gi\": 36, \"gl\": 10.0, \"class\": \"medium\"}, \"expected\": {\"class\": \"medium\", \"gi\": 36, \"gl\": 10.0}, \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": {\"gi\": 53, \"gl\": 40.8, \"class\": \"high\"}, \"expected\": {\"class\": \"high\", \"gi\": 59, \"gl\": 40.8}, \"passed\": false}, {\"check\": \"generated control 3\", \"actual\": {\"gi\": 42, \"gl\": 27.5, \"class\": \"high\"}, \"expected\": {\"class\": \"high\", \"gi\": 44, \"gl\": 27.5}, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.588,"exit_code":0,"observations":[{"actual":{"class":"high","gi":73,"gl":30.2},"check":"single food","expected":{"class":"high","gi":73,"gl":30.2},"passed":true},{"actual":{"class":"low","gi":50,"gl":10.0},"check":"load exactly ten","expected":{"class":"low","gi":50,"gl":10.0},"passed":true},{"actual":{"class":"low","gi":null,"gl":0.0},"check":"no carbs","expected":{"class":"low","gi":null,"gl":0.0},"passed":true},{"actual":{"class":"low","gi":51,"gl":9.1},"check":"regression: meal GI weighting","expected":{"class":"low","gi":51,"gl":9.1},"passed":true},{"actual":{"class":"high","gi":62,"gl":37.2},"check":"repair check: meal GI weighting","expected":{"class":"high","gi":62,"gl":37.2},"passed":true},{"actual":{"class":"medium","gi":36,"gl":10.0},"check":"generated control 1","expected":{"class":"medium","gi":36,"gl":10.0},"passed":true},{"actual":{"class":"high","gi":59,"gl":40.8},"check":"generated control 2","expected":{"class":"high","gi":59,"gl":40.8},"passed":true},{"actual":{"class":"high","gi":44,"gl":27.5},"check":"generated control 3","expected":{"class":"high","gi":44,"gl":27.5},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"single food\", \"actual\": {\"gi\": 73, \"gl\": 30.2, \"class\": \"high\"}, \"expected\": {\"class\": \"high\", \"gi\": 73, \"gl\": 30.2}, \"passed\": true}, {\"check\": \"load exactly ten\", \"actual\": {\"gi\": 50, \"gl\": 10.0, \"class\": \"low\"}, \"expected\": {\"class\": \"low\", \"gi\": 50, \"gl\": 10.0}, \"passed\": true}, {\"check\": \"no carbs\", \"actual\": {\"gi\": null, \"gl\": 0.0, \"class\": \"low\"}, \"expected\": {\"class\": \"low\", \"gi\": null, \"gl\": 0.0}, \"passed\": true}, {\"check\": \"regression: meal GI weighting\", \"actual\": {\"gi\": 51, \"gl\": 9.1, \"class\": \"low\"}, \"expected\": {\"class\": \"low\", \"gi\": 51, \"gl\": 9.1}, \"passed\": true}, {\"check\": \"repair check: meal GI weighting\", \"actual\": {\"gi\": 62, \"gl\": 37.2, \"class\": \"high\"}, \"expected\": {\"class\": \"high\", \"gi\": 62, \"gl\": 37.2}, \"passed\": true}, {\"check\": \"generated control 1\", \"actual\": {\"gi\": 36, \"gl\": 10.0, \"class\": \"medium\"}, \"expected\": {\"class\": \"medium\", \"gi\": 36, \"gl\": 10.0}, \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": {\"gi\": 59, \"gl\": 40.8, \"class\": \"high\"}, \"expected\": {\"class\": \"high\", \"gi\": 59, \"gl\": 40.8}, \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": {\"gi\": 44, \"gl\": 27.5, \"class\": \"high\"}, \"expected\": {\"class\": \"high\", \"gi\": 44, \"gl\": 27.5}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}