{"abstract":"A 30/40/31 split is accepted and silently renormalized.","category":"Recipe scaling and nutrition","checks":8,"contract":"split = [protein%, carb%, fat%] must sum to 100 else \"error: split\". protein_g = max(half-up kcal*p/400, ceiling(1.6*weight_kg)). Remaining kcal = kcal - 4*protein_g is divided between carb and fat in the ratio c:f; fat_g = half-up(rem*f/(c+f)/9); carb_g = half-up((rem - 9*fat_g)/4). Return [protein_g, carb_g, fat_g].","evaluation_group":"w2-recipe_scaling_and_nutrition-macro-split","failed_approach":"A one-point tolerance still accepts a 101% split.","family":"w2-recipe_scaling_and_nutrition-macro-split-split-validation","id":"FA-97266","implementations":{"attempt":{"sha256":"d4def7757f69bfa5f29741871a65e031d847abc09c8644fd572b49d78b5b184a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(kcal, weight_kg, split):\n    p, c, f = split\n    if abs(p + c + f - 100) > 1:\n        return 'error: split'\n    def r(x):\n        return math.floor(x + Fraction(1, 2))\n    protein_g = max(r(Fraction(kcal * p, 400)), math.ceil(Fraction(16, 10) * weight_kg))\n    rem = kcal - 4 * protein_g\n    fat_g = r(Fraction(rem * f, c + f) / 9)\n    carb_g = r(Fraction(rem - 9 * fat_g, 4))\n    return [protein_g, carb_g, fat_g]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['balanced', [2000, 70, [30, 40, 30]], [150, 199, 67]],\n  ['protein floor binds', [1500, 120, [15, 55, 30]], [192, 118, 29]],\n  ['bad split', [2000, 70, [30, 40, 31]], 'error: split'],\n  ['regression: split validation', [3000, 100, [30, 40, 29]], 'error: split'],\n  ['repair check: split validation', [3000, 91, [30, 40, 31]], 'error: split'],\n  ['generated control 1', [2500, 72, [20, 50, 30]], [125, 313, 83]],\n  ['generated control 2', [2000, 120, [15, 55, 30]], [192, 200, 48]],\n  ['generated control 3', [3000, 100, [15, 55, 30]], [160, 381, 93]]],\n [['protein floor binds', [1500, 120, [15, 55, 30]], [192, 118, 29]],\n  ['bad split', [2000, 70, [30, 40, 31]], 'error: split'],\n  ['split under 100', [2000, 70, [30, 40, 20]], 'error: split'],\n  ['regression: split validation', [1800, 50, [20, 50, 25]], 'error: split'],\n  ['repair check: split validation', [2500, 60, [30, 40, 29]], 'error: split'],\n  ['generated control 1', [2200, 60, [30, 40, 30]], [165, 221, 73]],\n  ['generated control 2', [1800, 118, [15, 55, 30]], [189, 169, 41]],\n  ['generated control 3', [2000, 120, [25, 45, 30]], [192, 184, 55]]],\n [['bad split', [2000, 70, [30, 40, 31]], 'error: split'],\n  ['split under 100', [2000, 70, [30, 40, 20]], 'error: split'],\n  ['fractional floor', [1200, 83, [20, 50, 30]], [133, 104, 28]],\n  ['regression: split validation', [3000, 50, [20, 50, 25]], 'error: split'],\n  ['repair check: split validation', [1500, 91, [30, 40, 29]], 'error: split'],\n  ['generated control 1', [1500, 72, [30, 40, 30]], [116, 149, 49]],\n  ['generated control 2', [2000, 72, [15, 55, 30]], [116, 249, 60]],\n  ['generated control 3', [1500, 50, [20, 50, 30]], [80, 185, 49]]],\n [['split under 100', [2000, 70, [30, 40, 20]], 'error: split'],\n  ['fractional floor', [1200, 83, [20, 50, 30]], [133, 104, 28]],\n  ['balanced', [2000, 70, [30, 40, 30]], [150, 199, 67]],\n  ['regression: split validation', [1500, 72, [30, 40, 29]], 'error: split'],\n  ['repair check: split validation', [3000, 72, [30, 40, 29]], 'error: split'],\n  ['generated control 1', [2000, 60, [30, 40, 30]], [150, 199, 67]],\n  ['generated control 2', [1800, 83, [20, 50, 30]], [133, 198, 53]],\n  ['generated control 3', [2500, 50, [30, 40, 30]], [188, 250, 83]]],\n [['fractional floor', [1200, 83, [20, 50, 30]], [133, 104, 28]],\n  ['balanced', [2000, 70, [30, 40, 30]], [150, 199, 67]],\n  ['protein floor binds', [1500, 120, [15, 55, 30]], [192, 118, 29]],\n  ['regression: split validation', [2000, 72, [30, 40, 29]], 'error: split'],\n  ['repair check: split validation', [2000, 60, [30, 40, 31]], 'error: split'],\n  ['generated control 1', [3000, 118, [25, 45, 30]], [189, 336, 100]],\n  ['generated control 2', [2200, 72, [30, 40, 29]], 'error: split'],\n  ['generated control 3', [2500, 50, [30, 40, 31]], 'error: split']]]\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":"b2ea3b9ed8a5b6c62600ccdfbce02799ea4079bec93f23b8ea7e9c8979f8a0f3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(kcal, weight_kg, split):\n    p, c, f = split\n    if p + c + f > 100:\n        return 'error: split'\n    def r(x):\n        return math.floor(x + Fraction(1, 2))\n    protein_g = max(r(Fraction(kcal * p, 400)), math.ceil(Fraction(16, 10) * weight_kg))\n    rem = kcal - 4 * protein_g\n    fat_g = r(Fraction(rem * f, c + f) / 9)\n    carb_g = r(Fraction(rem - 9 * fat_g, 4))\n    return [protein_g, carb_g, fat_g]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['balanced', [2000, 70, [30, 40, 30]], [150, 199, 67]],\n  ['protein floor binds', [1500, 120, [15, 55, 30]], [192, 118, 29]],\n  ['bad split', [2000, 70, [30, 40, 31]], 'error: split'],\n  ['regression: split validation', [3000, 100, [30, 40, 29]], 'error: split'],\n  ['repair check: split validation', [3000, 91, [30, 40, 31]], 'error: split'],\n  ['generated control 1', [2500, 72, [20, 50, 30]], [125, 313, 83]],\n  ['generated control 2', [2000, 120, [15, 55, 30]], [192, 200, 48]],\n  ['generated control 3', [3000, 100, [15, 55, 30]], [160, 381, 93]]],\n [['protein floor binds', [1500, 120, [15, 55, 30]], [192, 118, 29]],\n  ['bad split', [2000, 70, [30, 40, 31]], 'error: split'],\n  ['split under 100', [2000, 70, [30, 40, 20]], 'error: split'],\n  ['regression: split validation', [1800, 50, [20, 50, 25]], 'error: split'],\n  ['repair check: split validation', [2500, 60, [30, 40, 29]], 'error: split'],\n  ['generated control 1', [2200, 60, [30, 40, 30]], [165, 221, 73]],\n  ['generated control 2', [1800, 118, [15, 55, 30]], [189, 169, 41]],\n  ['generated control 3', [2000, 120, [25, 45, 30]], [192, 184, 55]]],\n [['bad split', [2000, 70, [30, 40, 31]], 'error: split'],\n  ['split under 100', [2000, 70, [30, 40, 20]], 'error: split'],\n  ['fractional floor', [1200, 83, [20, 50, 30]], [133, 104, 28]],\n  ['regression: split validation', [3000, 50, [20, 50, 25]], 'error: split'],\n  ['repair check: split validation', [1500, 91, [30, 40, 29]], 'error: split'],\n  ['generated control 1', [1500, 72, [30, 40, 30]], [116, 149, 49]],\n  ['generated control 2', [2000, 72, [15, 55, 30]], [116, 249, 60]],\n  ['generated control 3', [1500, 50, [20, 50, 30]], [80, 185, 49]]],\n [['split under 100', [2000, 70, [30, 40, 20]], 'error: split'],\n  ['fractional floor', [1200, 83, [20, 50, 30]], [133, 104, 28]],\n  ['balanced', [2000, 70, [30, 40, 30]], [150, 199, 67]],\n  ['regression: split validation', [1500, 72, [30, 40, 29]], 'error: split'],\n  ['repair check: split validation', [3000, 72, [30, 40, 29]], 'error: split'],\n  ['generated control 1', [2000, 60, [30, 40, 30]], [150, 199, 67]],\n  ['generated control 2', [1800, 83, [20, 50, 30]], [133, 198, 53]],\n  ['generated control 3', [2500, 50, [30, 40, 30]], [188, 250, 83]]],\n [['fractional floor', [1200, 83, [20, 50, 30]], [133, 104, 28]],\n  ['balanced', [2000, 70, [30, 40, 30]], [150, 199, 67]],\n  ['protein floor binds', [1500, 120, [15, 55, 30]], [192, 118, 29]],\n  ['regression: split validation', [2000, 72, [30, 40, 29]], 'error: split'],\n  ['repair check: split validation', [2000, 60, [30, 40, 31]], 'error: split'],\n  ['generated control 1', [3000, 118, [25, 45, 30]], [189, 336, 100]],\n  ['generated control 2', [2200, 72, [30, 40, 29]], 'error: split'],\n  ['generated control 3', [2500, 50, [30, 40, 31]], 'error: split']]]\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":"eda74b5ed7d9de162b91e73d6caced73c2c7ee02a6d53ea78eb9df487e8707da","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(kcal, weight_kg, split):\n    p, c, f = split\n    if p + c + f != 100:\n        return 'error: split'\n    def r(x):\n        return math.floor(x + Fraction(1, 2))\n    protein_g = max(r(Fraction(kcal * p, 400)), math.ceil(Fraction(16, 10) * weight_kg))\n    rem = kcal - 4 * protein_g\n    fat_g = r(Fraction(rem * f, c + f) / 9)\n    carb_g = r(Fraction(rem - 9 * fat_g, 4))\n    return [protein_g, carb_g, fat_g]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['balanced', [2000, 70, [30, 40, 30]], [150, 199, 67]],\n  ['protein floor binds', [1500, 120, [15, 55, 30]], [192, 118, 29]],\n  ['bad split', [2000, 70, [30, 40, 31]], 'error: split'],\n  ['regression: split validation', [3000, 100, [30, 40, 29]], 'error: split'],\n  ['repair check: split validation', [3000, 91, [30, 40, 31]], 'error: split'],\n  ['generated control 1', [2500, 72, [20, 50, 30]], [125, 313, 83]],\n  ['generated control 2', [2000, 120, [15, 55, 30]], [192, 200, 48]],\n  ['generated control 3', [3000, 100, [15, 55, 30]], [160, 381, 93]]],\n [['protein floor binds', [1500, 120, [15, 55, 30]], [192, 118, 29]],\n  ['bad split', [2000, 70, [30, 40, 31]], 'error: split'],\n  ['split under 100', [2000, 70, [30, 40, 20]], 'error: split'],\n  ['regression: split validation', [1800, 50, [20, 50, 25]], 'error: split'],\n  ['repair check: split validation', [2500, 60, [30, 40, 29]], 'error: split'],\n  ['generated control 1', [2200, 60, [30, 40, 30]], [165, 221, 73]],\n  ['generated control 2', [1800, 118, [15, 55, 30]], [189, 169, 41]],\n  ['generated control 3', [2000, 120, [25, 45, 30]], [192, 184, 55]]],\n [['bad split', [2000, 70, [30, 40, 31]], 'error: split'],\n  ['split under 100', [2000, 70, [30, 40, 20]], 'error: split'],\n  ['fractional floor', [1200, 83, [20, 50, 30]], [133, 104, 28]],\n  ['regression: split validation', [3000, 50, [20, 50, 25]], 'error: split'],\n  ['repair check: split validation', [1500, 91, [30, 40, 29]], 'error: split'],\n  ['generated control 1', [1500, 72, [30, 40, 30]], [116, 149, 49]],\n  ['generated control 2', [2000, 72, [15, 55, 30]], [116, 249, 60]],\n  ['generated control 3', [1500, 50, [20, 50, 30]], [80, 185, 49]]],\n [['split under 100', [2000, 70, [30, 40, 20]], 'error: split'],\n  ['fractional floor', [1200, 83, [20, 50, 30]], [133, 104, 28]],\n  ['balanced', [2000, 70, [30, 40, 30]], [150, 199, 67]],\n  ['regression: split validation', [1500, 72, [30, 40, 29]], 'error: split'],\n  ['repair check: split validation', [3000, 72, [30, 40, 29]], 'error: split'],\n  ['generated control 1', [2000, 60, [30, 40, 30]], [150, 199, 67]],\n  ['generated control 2', [1800, 83, [20, 50, 30]], [133, 198, 53]],\n  ['generated control 3', [2500, 50, [30, 40, 30]], [188, 250, 83]]],\n [['fractional floor', [1200, 83, [20, 50, 30]], [133, 104, 28]],\n  ['balanced', [2000, 70, [30, 40, 30]], [150, 199, 67]],\n  ['protein floor binds', [1500, 120, [15, 55, 30]], [192, 118, 29]],\n  ['regression: split validation', [2000, 72, [30, 40, 29]], 'error: split'],\n  ['repair check: split validation', [2000, 60, [30, 40, 31]], 'error: split'],\n  ['generated control 1', [3000, 118, [25, 45, 30]], [189, 336, 100]],\n  ['generated control 2', [2200, 72, [30, 40, 29]], 'error: split'],\n  ['generated control 3', [2500, 50, [30, 40, 31]], 'error: split']]]\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-macro-split-split-validation","generated_at":"2026-09-29T14:52:30.485930+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Meal-plan generators turn calorie targets into gram targets with a protein floor by body weight.","repair":"Reject any split not summing to exactly 100.","root_cause":"Only splits above 100% are rejected, so splits summing under 100 pass.","sha256":"14fae6529746b5f758cce59efacb8d539d0baa9083b97f42b378d88ad5daad75","title":"Macronutrient target splitter: split validation · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.653,"exit_code":1,"observations":[{"actual":[150,199,67],"check":"balanced","expected":[150,199,67],"passed":true},{"actual":[192,118,29],"check":"protein floor binds","expected":[192,118,29],"passed":true},{"actual":[150,197,68],"check":"bad split","expected":"error: split","passed":false},{"actual":[225,305,98],"check":"regression: split validation","expected":"error: split","passed":false},{"actual":[225,296,102],"check":"repair check: split validation","expected":"error: split","passed":false},{"actual":[125,313,83],"check":"generated control 1","expected":[125,313,83],"passed":true},{"actual":[192,200,48],"check":"generated control 2","expected":[192,200,48],"passed":true},{"actual":[160,381,93],"check":"generated control 3","expected":[160,381,93],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"balanced\", \"actual\": [150, 199, 67], \"expected\": [150, 199, 67], \"passed\": true}, {\"check\": \"protein floor binds\", \"actual\": [192, 118, 29], \"expected\": [192, 118, 29], \"passed\": true}, {\"check\": \"bad split\", \"actual\": [150, 197, 68], \"expected\": \"error: split\", \"passed\": false}, {\"check\": \"regression: split validation\", \"actual\": [225, 305, 98], \"expected\": \"error: split\", \"passed\": false}, {\"check\": \"repair check: split validation\", \"actual\": [225, 296, 102], \"expected\": \"error: split\", \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": [125, 313, 83], \"expected\": [125, 313, 83], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [192, 200, 48], \"expected\": [192, 200, 48], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [160, 381, 93], \"expected\": [160, 381, 93], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.264,"exit_code":1,"observations":[{"actual":[150,199,67],"check":"balanced","expected":[150,199,67],"passed":true},{"actual":[192,118,29],"check":"protein floor binds","expected":[192,118,29],"passed":true},{"actual":"error: split","check":"bad split","expected":"error: split","passed":true},{"actual":[225,305,98],"check":"regression: split validation","expected":"error: split","passed":false},{"actual":"error: split","check":"repair check: split validation","expected":"error: split","passed":true},{"actual":[125,313,83],"check":"generated control 1","expected":[125,313,83],"passed":true},{"actual":[192,200,48],"check":"generated control 2","expected":[192,200,48],"passed":true},{"actual":[160,381,93],"check":"generated control 3","expected":[160,381,93],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"balanced\", \"actual\": [150, 199, 67], \"expected\": [150, 199, 67], \"passed\": true}, {\"check\": \"protein floor binds\", \"actual\": [192, 118, 29], \"expected\": [192, 118, 29], \"passed\": true}, {\"check\": \"bad split\", \"actual\": \"error: split\", \"expected\": \"error: split\", \"passed\": true}, {\"check\": \"regression: split validation\", \"actual\": [225, 305, 98], \"expected\": \"error: split\", \"passed\": false}, {\"check\": \"repair check: split validation\", \"actual\": \"error: split\", \"expected\": \"error: split\", \"passed\": true}, {\"check\": \"generated control 1\", \"actual\": [125, 313, 83], \"expected\": [125, 313, 83], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [192, 200, 48], \"expected\": [192, 200, 48], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [160, 381, 93], \"expected\": [160, 381, 93], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.466,"exit_code":0,"observations":[{"actual":[150,199,67],"check":"balanced","expected":[150,199,67],"passed":true},{"actual":[192,118,29],"check":"protein floor binds","expected":[192,118,29],"passed":true},{"actual":"error: split","check":"bad split","expected":"error: split","passed":true},{"actual":"error: split","check":"regression: split validation","expected":"error: split","passed":true},{"actual":"error: split","check":"repair check: split validation","expected":"error: split","passed":true},{"actual":[125,313,83],"check":"generated control 1","expected":[125,313,83],"passed":true},{"actual":[192,200,48],"check":"generated control 2","expected":[192,200,48],"passed":true},{"actual":[160,381,93],"check":"generated control 3","expected":[160,381,93],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"balanced\", \"actual\": [150, 199, 67], \"expected\": [150, 199, 67], \"passed\": true}, {\"check\": \"protein floor binds\", \"actual\": [192, 118, 29], \"expected\": [192, 118, 29], \"passed\": true}, {\"check\": \"bad split\", \"actual\": \"error: split\", \"expected\": \"error: split\", \"passed\": true}, {\"check\": \"regression: split validation\", \"actual\": \"error: split\", \"expected\": \"error: split\", \"passed\": true}, {\"check\": \"repair check: split validation\", \"actual\": \"error: split\", \"expected\": \"error: split\", \"passed\": true}, {\"check\": \"generated control 1\", \"actual\": [125, 313, 83], \"expected\": [125, 313, 83], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [192, 200, 48], \"expected\": [192, 200, 48], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [160, 381, 93], \"expected\": [160, 381, 93], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}