{"abstract":"A crafter at exactly the bonus skill receives no bonus items.","category":"Game economy crafting balance","checks":8,"contract":"recipe = {inputs:{material:qty}, output, yield, stack}. Crafts = min(requested, floor(have/qty) per input), 0 when requested <= 0. With skill in [50, inf) every 5th craft adds one bonus item (bonus = crafts//5). made = crafts*yield + bonus, split into full stacks of size stack plus one partial stack. left = whole inventory (all materials) after consuming crafts*qty of each input, sorted by name.","contract_signature":"recipe, inventory, requested, skill","evaluation_group":"w2-game-economy-crafting-balance-batch-craft","failed_approach":"The patched gate also stops granting the bonus to grandmasters at skill 100 and above.","family":"w2-game-economy-crafting-balance-batch-craft-bonus-skill-gate","id":"FA-85846","implementations":{"attempt":{"sha256":"49275180a725049c3c903a193ff75e7260e5f0794d2a295db11cefbb195a7a5f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(recipe, inventory, requested, skill):\n    if requested <= 0:\n        crafts = 0\n    else:\n        crafts = requested\n        for mat, qty in recipe['inputs'].items():\n            crafts = min(crafts, inventory.get(mat, 0) // qty)\n    bonus = crafts // 5 if skill > 49 and skill < 100 else 0\n    made = crafts * recipe['yield'] + bonus\n    cap = recipe['stack']\n    stacks = [cap] * (made // cap)\n    if made % cap:\n        stacks.append(made % cap)\n    left = dict(inventory)\n    for mat, qty in recipe['inputs'].items():\n        left[mat] = left.get(mat, 0) - crafts * qty\n    return {'crafts': crafts, 'made': made, 'stacks': stacks, 'left': dict(sorted(left.items()))}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('exact material multiple #1',\n   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],\n   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),\n  ('fault site bonus skill gate #1',\n   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],\n   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),\n  ('fault site bonus skill gate #2',\n   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},\n    {'gem': 19, 'ore': 25},\n    9,\n    50],\n   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),\n  ('partial repair boundary #1',\n   [{'inputs': {'hide': 1, 'gem': 2, 'wood': 1}, 'output': 'blade', 'yield': 3, 'stack': 10},\n    {'hide': 28, 'gem': 10, 'wood': 23, 'herb': 6},\n    8,\n    120],\n   {'crafts': 5, 'made': 16, 'stacks': [10, 6], 'left': {'gem': 0, 'herb': 6, 'hide': 23, 'wood': 18}}),\n  ('partial repair boundary #2',\n   [{'inputs': {'gem': 1}, 'output': 'blade', 'yield': 3, 'stack': 6}, {'gem': 27, 'herb': 8}, 7, 101],\n   {'crafts': 7, 'made': 22, 'stacks': [6, 6, 6, 4], 'left': {'gem': 20, 'herb': 8}}),\n  ('one short of a batch #1',\n   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},\n    {'ore': 14, 'wood': 9, 'herb': 2},\n    9,\n    10],\n   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),\n  ('zero request #1',\n   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],\n   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),\n  ('control #1',\n   [{'inputs': {'ore': 4}, 'output': 'blade', 'yield': 3, 'stack': 10}, {'ore': 6}, 2, 51],\n   {'crafts': 1, 'made': 3, 'stacks': [3], 'left': {'ore': 2}})],\n [('exact material multiple #1',\n   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],\n   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),\n  ('fault site bonus skill gate #1',\n   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},\n    {'gem': 19, 'ore': 25},\n    9,\n    50],\n   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),\n  ('fault site bonus skill gate #2',\n   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],\n   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),\n  ('partial repair boundary #1',\n   [{'inputs': {'ore': 2}, 'output': 'blade', 'yield': 2, 'stack': 8}, {'ore': 28}, 5, 100],\n   {'crafts': 5, 'made': 11, 'stacks': [8, 3], 'left': {'ore': 18}}),\n  ('partial repair boundary #2',\n   [{'inputs': {'wood': 1}, 'output': 'blade', 'yield': 3, 'stack': 7}, {'wood': 7}, 12, 120],\n   {'crafts': 7, 'made': 22, 'stacks': [7, 7, 7, 1], 'left': {'wood': 0}}),\n  ('one short of a batch #1',\n   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},\n    {'ore': 14, 'wood': 9, 'herb': 2},\n    9,\n    10],\n   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),\n  ('zero request #1',\n   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],\n   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),\n  ('control #1',\n   [{'inputs': {'ore': 4}, 'output': 'blade', 'yield': 3, 'stack': 10}, {'ore': 6}, 2, 51],\n   {'crafts': 1, 'made': 3, 'stacks': [3], 'left': {'ore': 2}})],\n [('exact material multiple #1',\n   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],\n   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),\n  ('fault site bonus skill gate #1',\n   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],\n   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),\n  ('fault site bonus skill gate #2',\n   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},\n    {'gem': 19, 'ore': 25},\n    9,\n    50],\n   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),\n  ('partial repair boundary #1',\n   [{'inputs': {'hide': 3}, 'output': 'blade', 'yield': 1, 'stack': 6}, {'hide': 22}, 8, 100],\n   {'crafts': 7, 'made': 8, 'stacks': [6, 2], 'left': {'hide': 1}}),\n  ('partial repair boundary #2',\n   [{'inputs': {'gem': 4, 'hide': 1, 'ore': 1}, 'output': 'blade', 'yield': 2, 'stack': 9},\n    {'gem': 29, 'hide': 25, 'ore': 26},\n    8,\n    120],\n   {'crafts': 7, 'made': 15, 'stacks': [9, 6], 'left': {'gem': 1, 'hide': 18, 'ore': 19}}),\n  ('one short of a batch #1',\n   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},\n    {'ore': 14, 'wood': 9, 'herb': 2},\n    9,\n    10],\n   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),\n  ('zero request #1',\n   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],\n   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),\n  ('control #1',\n   [{'inputs': {'ore': 4}, 'output': 'blade', 'yield': 3, 'stack': 10}, {'ore': 6}, 2, 51],\n   {'crafts': 1, 'made': 3, 'stacks': [3], 'left': {'ore': 2}})],\n [('exact material multiple #1',\n   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],\n   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),\n  ('fault site bonus skill gate #1',\n   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],\n   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),\n  ('fault site bonus skill gate #2',\n   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},\n    {'gem': 19, 'ore': 25},\n    9,\n    50],\n   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),\n  ('partial repair boundary #1',\n   [{'inputs': {'hide': 3, 'wood': 2}, 'output': 'blade', 'yield': 2, 'stack': 10},\n    {'hide': 29, 'wood': 21, 'herb': 6},\n    7,\n    101],\n   {'crafts': 7, 'made': 15, 'stacks': [10, 5], 'left': {'herb': 6, 'hide': 8, 'wood': 7}}),\n  ('partial repair boundary #2',\n   [{'inputs': {'gem': 2, 'wood': 3}, 'output': 'blade', 'yield': 1, 'stack': 3},\n    {'gem': 30, 'wood': 19},\n    10,\n    101],\n   {'crafts': 6, 'made': 7, 'stacks': [3, 3, 1], 'left': {'gem': 18, 'wood': 1}}),\n  ('one short of a batch #1',\n   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},\n    {'ore': 14, 'wood': 9, 'herb': 2},\n    9,\n    10],\n   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),\n  ('zero request #1',\n   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],\n   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),\n  ('control #1',\n   [{'inputs': {'hide': 3, 'ore': 1}, 'output': 'blade', 'yield': 1, 'stack': 5},\n    {'hide': 21, 'ore': 5},\n    3,\n    99],\n   {'crafts': 3, 'made': 3, 'stacks': [3], 'left': {'hide': 12, 'ore': 2}})],\n [('exact material multiple #1',\n   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],\n   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),\n  ('fault site bonus skill gate #1',\n   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},\n    {'gem': 19, 'ore': 25},\n    9,\n    50],\n   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),\n  ('fault site bonus skill gate #2',\n   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],\n   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),\n  ('partial repair boundary #1',\n   [{'inputs': {'hide': 3}, 'output': 'blade', 'yield': 3, 'stack': 6}, {'hide': 25}, 12, 100],\n   {'crafts': 8, 'made': 25, 'stacks': [6, 6, 6, 6, 1], 'left': {'hide': 1}}),\n  ('partial repair boundary #2',\n   [{'inputs': {'hide': 2, 'ore': 1, 'gem': 3}, 'output': 'blade', 'yield': 2, 'stack': 7},\n    {'hide': 23, 'ore': 8, 'gem': 26, 'herb': 2},\n    8,\n    120],\n   {'crafts': 8, 'made': 17, 'stacks': [7, 7, 3], 'left': {'gem': 2, 'herb': 2, 'hide': 7, 'ore': 0}}),\n  ('one short of a batch #1',\n   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},\n    {'ore': 14, 'wood': 9, 'herb': 2},\n    9,\n    10],\n   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),\n  ('zero request #1',\n   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],\n   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),\n  ('control #1',\n   [{'inputs': {'wood': 2, 'hide': 3, 'gem': 3}, 'output': 'blade', 'yield': 3, 'stack': 7},\n    {'wood': 12, 'hide': 23, 'gem': 11},\n    4,\n    51],\n   {'crafts': 3, 'made': 9, 'stacks': [7, 2], 'left': {'gem': 2, 'hide': 14, 'wood': 6}})]]\nfor label, args, expected in cases[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":"fbd32a9290807dd0f90b0abba6d1296c51240ed3f8444f07bd0e3cd9795d50dc","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(recipe, inventory, requested, skill):\n    if requested <= 0:\n        crafts = 0\n    else:\n        crafts = requested\n        for mat, qty in recipe['inputs'].items():\n            crafts = min(crafts, inventory.get(mat, 0) // qty)\n    bonus = crafts // 5 if skill > 50 else 0\n    made = crafts * recipe['yield'] + bonus\n    cap = recipe['stack']\n    stacks = [cap] * (made // cap)\n    if made % cap:\n        stacks.append(made % cap)\n    left = dict(inventory)\n    for mat, qty in recipe['inputs'].items():\n        left[mat] = left.get(mat, 0) - crafts * qty\n    return {'crafts': crafts, 'made': made, 'stacks': stacks, 'left': dict(sorted(left.items()))}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('exact material multiple #1',\n   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],\n   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),\n  ('fault site bonus skill gate #1',\n   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],\n   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),\n  ('fault site bonus skill gate #2',\n   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},\n    {'gem': 19, 'ore': 25},\n    9,\n    50],\n   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),\n  ('partial repair boundary #1',\n   [{'inputs': {'hide': 1, 'gem': 2, 'wood': 1}, 'output': 'blade', 'yield': 3, 'stack': 10},\n    {'hide': 28, 'gem': 10, 'wood': 23, 'herb': 6},\n    8,\n    120],\n   {'crafts': 5, 'made': 16, 'stacks': [10, 6], 'left': {'gem': 0, 'herb': 6, 'hide': 23, 'wood': 18}}),\n  ('partial repair boundary #2',\n   [{'inputs': {'gem': 1}, 'output': 'blade', 'yield': 3, 'stack': 6}, {'gem': 27, 'herb': 8}, 7, 101],\n   {'crafts': 7, 'made': 22, 'stacks': [6, 6, 6, 4], 'left': {'gem': 20, 'herb': 8}}),\n  ('one short of a batch #1',\n   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},\n    {'ore': 14, 'wood': 9, 'herb': 2},\n    9,\n    10],\n   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),\n  ('zero request #1',\n   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],\n   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),\n  ('control #1',\n   [{'inputs': {'ore': 4}, 'output': 'blade', 'yield': 3, 'stack': 10}, {'ore': 6}, 2, 51],\n   {'crafts': 1, 'made': 3, 'stacks': [3], 'left': {'ore': 2}})],\n [('exact material multiple #1',\n   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],\n   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),\n  ('fault site bonus skill gate #1',\n   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},\n    {'gem': 19, 'ore': 25},\n    9,\n    50],\n   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),\n  ('fault site bonus skill gate #2',\n   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],\n   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),\n  ('partial repair boundary #1',\n   [{'inputs': {'ore': 2}, 'output': 'blade', 'yield': 2, 'stack': 8}, {'ore': 28}, 5, 100],\n   {'crafts': 5, 'made': 11, 'stacks': [8, 3], 'left': {'ore': 18}}),\n  ('partial repair boundary #2',\n   [{'inputs': {'wood': 1}, 'output': 'blade', 'yield': 3, 'stack': 7}, {'wood': 7}, 12, 120],\n   {'crafts': 7, 'made': 22, 'stacks': [7, 7, 7, 1], 'left': {'wood': 0}}),\n  ('one short of a batch #1',\n   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},\n    {'ore': 14, 'wood': 9, 'herb': 2},\n    9,\n    10],\n   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),\n  ('zero request #1',\n   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],\n   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),\n  ('control #1',\n   [{'inputs': {'ore': 4}, 'output': 'blade', 'yield': 3, 'stack': 10}, {'ore': 6}, 2, 51],\n   {'crafts': 1, 'made': 3, 'stacks': [3], 'left': {'ore': 2}})],\n [('exact material multiple #1',\n   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],\n   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),\n  ('fault site bonus skill gate #1',\n   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],\n   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),\n  ('fault site bonus skill gate #2',\n   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},\n    {'gem': 19, 'ore': 25},\n    9,\n    50],\n   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),\n  ('partial repair boundary #1',\n   [{'inputs': {'hide': 3}, 'output': 'blade', 'yield': 1, 'stack': 6}, {'hide': 22}, 8, 100],\n   {'crafts': 7, 'made': 8, 'stacks': [6, 2], 'left': {'hide': 1}}),\n  ('partial repair boundary #2',\n   [{'inputs': {'gem': 4, 'hide': 1, 'ore': 1}, 'output': 'blade', 'yield': 2, 'stack': 9},\n    {'gem': 29, 'hide': 25, 'ore': 26},\n    8,\n    120],\n   {'crafts': 7, 'made': 15, 'stacks': [9, 6], 'left': {'gem': 1, 'hide': 18, 'ore': 19}}),\n  ('one short of a batch #1',\n   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},\n    {'ore': 14, 'wood': 9, 'herb': 2},\n    9,\n    10],\n   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),\n  ('zero request #1',\n   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],\n   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),\n  ('control #1',\n   [{'inputs': {'ore': 4}, 'output': 'blade', 'yield': 3, 'stack': 10}, {'ore': 6}, 2, 51],\n   {'crafts': 1, 'made': 3, 'stacks': [3], 'left': {'ore': 2}})],\n [('exact material multiple #1',\n   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],\n   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),\n  ('fault site bonus skill gate #1',\n   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],\n   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),\n  ('fault site bonus skill gate #2',\n   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},\n    {'gem': 19, 'ore': 25},\n    9,\n    50],\n   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),\n  ('partial repair boundary #1',\n   [{'inputs': {'hide': 3, 'wood': 2}, 'output': 'blade', 'yield': 2, 'stack': 10},\n    {'hide': 29, 'wood': 21, 'herb': 6},\n    7,\n    101],\n   {'crafts': 7, 'made': 15, 'stacks': [10, 5], 'left': {'herb': 6, 'hide': 8, 'wood': 7}}),\n  ('partial repair boundary #2',\n   [{'inputs': {'gem': 2, 'wood': 3}, 'output': 'blade', 'yield': 1, 'stack': 3},\n    {'gem': 30, 'wood': 19},\n    10,\n    101],\n   {'crafts': 6, 'made': 7, 'stacks': [3, 3, 1], 'left': {'gem': 18, 'wood': 1}}),\n  ('one short of a batch #1',\n   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},\n    {'ore': 14, 'wood': 9, 'herb': 2},\n    9,\n    10],\n   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),\n  ('zero request #1',\n   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],\n   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),\n  ('control #1',\n   [{'inputs': {'hide': 3, 'ore': 1}, 'output': 'blade', 'yield': 1, 'stack': 5},\n    {'hide': 21, 'ore': 5},\n    3,\n    99],\n   {'crafts': 3, 'made': 3, 'stacks': [3], 'left': {'hide': 12, 'ore': 2}})],\n [('exact material multiple #1',\n   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],\n   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),\n  ('fault site bonus skill gate #1',\n   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},\n    {'gem': 19, 'ore': 25},\n    9,\n    50],\n   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),\n  ('fault site bonus skill gate #2',\n   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],\n   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),\n  ('partial repair boundary #1',\n   [{'inputs': {'hide': 3}, 'output': 'blade', 'yield': 3, 'stack': 6}, {'hide': 25}, 12, 100],\n   {'crafts': 8, 'made': 25, 'stacks': [6, 6, 6, 6, 1], 'left': {'hide': 1}}),\n  ('partial repair boundary #2',\n   [{'inputs': {'hide': 2, 'ore': 1, 'gem': 3}, 'output': 'blade', 'yield': 2, 'stack': 7},\n    {'hide': 23, 'ore': 8, 'gem': 26, 'herb': 2},\n    8,\n    120],\n   {'crafts': 8, 'made': 17, 'stacks': [7, 7, 3], 'left': {'gem': 2, 'herb': 2, 'hide': 7, 'ore': 0}}),\n  ('one short of a batch #1',\n   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},\n    {'ore': 14, 'wood': 9, 'herb': 2},\n    9,\n    10],\n   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),\n  ('zero request #1',\n   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],\n   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),\n  ('control #1',\n   [{'inputs': {'wood': 2, 'hide': 3, 'gem': 3}, 'output': 'blade', 'yield': 3, 'stack': 7},\n    {'wood': 12, 'hide': 23, 'gem': 11},\n    4,\n    51],\n   {'crafts': 3, 'made': 9, 'stacks': [7, 2], 'left': {'gem': 2, 'hide': 14, 'wood': 6}})]]\nfor label, args, expected in cases[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":"Deterministic toy contract stipulated for this model; integer or exact arithmetic only, not a reproduction of any specific game engine. 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-game-economy-crafting-balance-batch-craft-bonus-skill-gate","generated_at":"2026-09-29T14:50:44.183740+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Game economies leak or destroy currency when one crafting or pricing rule is off by one boundary, rounding stage or state update; the defect is observable in exact integer outcomes.","root_cause":"The skill gate for bonus items is a strict comparison, excluding the threshold value itself.","sha256":"3f48a1fe6408e3815c3d3bd7f72aff86f7674d427c20a865d0cc62df14ad4d16","title":"Batch crafting: Bonus yield gate excludes the qualifying skill · 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":39.847,"exit_code":1,"observations":[{"actual":{"crafts":5,"left":{"ore":0},"made":6,"stacks":[5,1]},"check":"exact material multiple #1","expected":{"crafts":5,"left":{"ore":0},"made":6,"stacks":[5,1]},"passed":true},{"actual":{"crafts":9,"left":{"hide":5},"made":28,"stacks":[8,8,8,4]},"check":"fault site bonus skill gate #1","expected":{"crafts":9,"left":{"hide":5},"made":28,"stacks":[8,8,8,4]},"passed":true},{"actual":{"crafts":8,"left":{"gem":3,"ore":1},"made":17,"stacks":[9,8]},"check":"fault site bonus skill gate #2","expected":{"crafts":8,"left":{"gem":3,"ore":1},"made":17,"stacks":[9,8]},"passed":true},{"actual":{"crafts":5,"left":{"gem":0,"herb":6,"hide":23,"wood":18},"made":15,"stacks":[10,5]},"check":"partial repair boundary #1","expected":{"crafts":5,"left":{"gem":0,"herb":6,"hide":23,"wood":18},"made":16,"stacks":[10,6]},"passed":false},{"actual":{"crafts":7,"left":{"gem":20,"herb":8},"made":21,"stacks":[6,6,6,3]},"check":"partial repair boundary #2","expected":{"crafts":7,"left":{"gem":20,"herb":8},"made":22,"stacks":[6,6,6,4]},"passed":false},{"actual":{"crafts":4,"left":{"herb":2,"ore":2,"wood":1},"made":8,"stacks":[4,4]},"check":"one short of a batch #1","expected":{"crafts":4,"left":{"herb":2,"ore":2,"wood":1},"made":8,"stacks":[4,4]},"passed":true},{"actual":{"crafts":0,"left":{"hide":8},"made":0,"stacks":[]},"check":"zero request #1","expected":{"crafts":0,"left":{"hide":8},"made":0,"stacks":[]},"passed":true},{"actual":{"crafts":1,"left":{"ore":2},"made":3,"stacks":[3]},"check":"control #1","expected":{"crafts":1,"left":{"ore":2},"made":3,"stacks":[3]},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"exact material multiple #1\", \"actual\": {\"crafts\": 5, \"made\": 6, \"stacks\": [5, 1], \"left\": {\"ore\": 0}}, \"expected\": {\"crafts\": 5, \"made\": 6, \"stacks\": [5, 1], \"left\": {\"ore\": 0}}, \"passed\": true}, {\"check\": \"fault site bonus skill gate #1\", \"actual\": {\"crafts\": 9, \"made\": 28, \"stacks\": [8, 8, 8, 4], \"left\": {\"hide\": 5}}, \"expected\": {\"crafts\": 9, \"made\": 28, \"stacks\": [8, 8, 8, 4], \"left\": {\"hide\": 5}}, \"passed\": true}, {\"check\": \"fault site bonus skill gate #2\", \"actual\": {\"crafts\": 8, \"made\": 17, \"stacks\": [9, 8], \"left\": {\"gem\": 3, \"ore\": 1}}, \"expected\": {\"crafts\": 8, \"made\": 17, \"stacks\": [9, 8], \"left\": {\"gem\": 3, \"ore\": 1}}, \"passed\": true}, {\"check\": \"partial repair boundary #1\", \"actual\": {\"crafts\": 5, \"made\": 15, \"stacks\": [10, 5], \"left\": {\"gem\": 0, \"herb\": 6, \"hide\": 23, \"wood\": 18}}, \"expected\": {\"crafts\": 5, \"made\": 16, \"stacks\": [10, 6], \"left\": {\"gem\": 0, \"herb\": 6, \"hide\": 23, \"wood\": 18}}, \"passed\": false}, {\"check\": \"partial repair boundary #2\", \"actual\": {\"crafts\": 7, \"made\": 21, \"stacks\": [6, 6, 6, 3], \"left\": {\"gem\": 20, \"herb\": 8}}, \"expected\": {\"crafts\": 7, \"made\": 22, \"stacks\": [6, 6, 6, 4], \"left\": {\"gem\": 20, \"herb\": 8}}, \"passed\": false}, {\"check\": \"one short of a batch #1\", \"actual\": {\"crafts\": 4, \"made\": 8, \"stacks\": [4, 4], \"left\": {\"herb\": 2, \"ore\": 2, \"wood\": 1}}, \"expected\": {\"crafts\": 4, \"made\": 8, \"stacks\": [4, 4], \"left\": {\"herb\": 2, \"ore\": 2, \"wood\": 1}}, \"passed\": true}, {\"check\": \"zero request #1\", \"actual\": {\"crafts\": 0, \"made\": 0, \"stacks\": [], \"left\": {\"hide\": 8}}, \"expected\": {\"crafts\": 0, \"made\": 0, \"stacks\": [], \"left\": {\"hide\": 8}}, \"passed\": true}, {\"check\": \"control #1\", \"actual\": {\"crafts\": 1, \"made\": 3, \"stacks\": [3], \"left\": {\"ore\": 2}}, \"expected\": {\"crafts\": 1, \"made\": 3, \"stacks\": [3], \"left\": {\"ore\": 2}}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.256,"exit_code":1,"observations":[{"actual":{"crafts":5,"left":{"ore":0},"made":5,"stacks":[5]},"check":"exact material multiple #1","expected":{"crafts":5,"left":{"ore":0},"made":6,"stacks":[5,1]},"passed":false},{"actual":{"crafts":9,"left":{"hide":5},"made":27,"stacks":[8,8,8,3]},"check":"fault site bonus skill gate #1","expected":{"crafts":9,"left":{"hide":5},"made":28,"stacks":[8,8,8,4]},"passed":false},{"actual":{"crafts":8,"left":{"gem":3,"ore":1},"made":16,"stacks":[9,7]},"check":"fault site bonus skill gate #2","expected":{"crafts":8,"left":{"gem":3,"ore":1},"made":17,"stacks":[9,8]},"passed":false},{"actual":{"crafts":5,"left":{"gem":0,"herb":6,"hide":23,"wood":18},"made":16,"stacks":[10,6]},"check":"partial repair boundary #1","expected":{"crafts":5,"left":{"gem":0,"herb":6,"hide":23,"wood":18},"made":16,"stacks":[10,6]},"passed":true},{"actual":{"crafts":7,"left":{"gem":20,"herb":8},"made":22,"stacks":[6,6,6,4]},"check":"partial repair boundary #2","expected":{"crafts":7,"left":{"gem":20,"herb":8},"made":22,"stacks":[6,6,6,4]},"passed":true},{"actual":{"crafts":4,"left":{"herb":2,"ore":2,"wood":1},"made":8,"stacks":[4,4]},"check":"one short of a batch #1","expected":{"crafts":4,"left":{"herb":2,"ore":2,"wood":1},"made":8,"stacks":[4,4]},"passed":true},{"actual":{"crafts":0,"left":{"hide":8},"made":0,"stacks":[]},"check":"zero request #1","expected":{"crafts":0,"left":{"hide":8},"made":0,"stacks":[]},"passed":true},{"actual":{"crafts":1,"left":{"ore":2},"made":3,"stacks":[3]},"check":"control #1","expected":{"crafts":1,"left":{"ore":2},"made":3,"stacks":[3]},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"exact material multiple #1\", \"actual\": {\"crafts\": 5, \"made\": 5, \"stacks\": [5], \"left\": {\"ore\": 0}}, \"expected\": {\"crafts\": 5, \"made\": 6, \"stacks\": [5, 1], \"left\": {\"ore\": 0}}, \"passed\": false}, {\"check\": \"fault site bonus skill gate #1\", \"actual\": {\"crafts\": 9, \"made\": 27, \"stacks\": [8, 8, 8, 3], \"left\": {\"hide\": 5}}, \"expected\": {\"crafts\": 9, \"made\": 28, \"stacks\": [8, 8, 8, 4], \"left\": {\"hide\": 5}}, \"passed\": false}, {\"check\": \"fault site bonus skill gate #2\", \"actual\": {\"crafts\": 8, \"made\": 16, \"stacks\": [9, 7], \"left\": {\"gem\": 3, \"ore\": 1}}, \"expected\": {\"crafts\": 8, \"made\": 17, \"stacks\": [9, 8], \"left\": {\"gem\": 3, \"ore\": 1}}, \"passed\": false}, {\"check\": \"partial repair boundary #1\", \"actual\": {\"crafts\": 5, \"made\": 16, \"stacks\": [10, 6], \"left\": {\"gem\": 0, \"herb\": 6, \"hide\": 23, \"wood\": 18}}, \"expected\": {\"crafts\": 5, \"made\": 16, \"stacks\": [10, 6], \"left\": {\"gem\": 0, \"herb\": 6, \"hide\": 23, \"wood\": 18}}, \"passed\": true}, {\"check\": \"partial repair boundary #2\", \"actual\": {\"crafts\": 7, \"made\": 22, \"stacks\": [6, 6, 6, 4], \"left\": {\"gem\": 20, \"herb\": 8}}, \"expected\": {\"crafts\": 7, \"made\": 22, \"stacks\": [6, 6, 6, 4], \"left\": {\"gem\": 20, \"herb\": 8}}, \"passed\": true}, {\"check\": \"one short of a batch #1\", \"actual\": {\"crafts\": 4, \"made\": 8, \"stacks\": [4, 4], \"left\": {\"herb\": 2, \"ore\": 2, \"wood\": 1}}, \"expected\": {\"crafts\": 4, \"made\": 8, \"stacks\": [4, 4], \"left\": {\"herb\": 2, \"ore\": 2, \"wood\": 1}}, \"passed\": true}, {\"check\": \"zero request #1\", \"actual\": {\"crafts\": 0, \"made\": 0, \"stacks\": [], \"left\": {\"hide\": 8}}, \"expected\": {\"crafts\": 0, \"made\": 0, \"stacks\": [], \"left\": {\"hide\": 8}}, \"passed\": true}, {\"check\": \"control #1\", \"actual\": {\"crafts\": 1, \"made\": 3, \"stacks\": [3], \"left\": {\"ore\": 2}}, \"expected\": {\"crafts\": 1, \"made\": 3, \"stacks\": [3], \"left\": {\"ore\": 2}}, \"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."}}