{"abstract":"A zero-durability rare item returns guaranteed components instead of scrap.","category":"Game economy crafting balance","checks":8,"contract":"Return rate: common 50%, rare 70%, epic 90%. Condition d/mx with d clamped to mx; max_durability 0 means indestructible (full condition). Durability <= 0 yields {\"scrap\": 1}. Each component amount = floor(count*pct*d/(100*mx)) computed once; rare and epic items return at least 1 of each component; zero amounts are omitted.","evaluation_group":"w2-game-economy-crafting-balance-salvage-return","failed_approach":"Restricting the scrap rule to common items lets broken rare and epic gear keep its guarantee.","family":"w2-game-economy-crafting-balance-salvage-return-broken-item-gate","id":"FA-85896","implementations":{"attempt":{"sha256":"d3800bc5c5d1f516941a3b1a7056592776e5ade267bde27a4973d253636d94d5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(item, components):\n    pct = {'common': 50, 'rare': 70, 'epic': 90}[item['rarity']]\n    mx = item['max_durability']\n    if mx == 0:\n        d, mx = 1, 1\n    else:\n        d = min(item['durability'], mx)\n    if d <= 0 and item['rarity'] == 'common':\n        return {'scrap': 1}\n    out = {}\n    for name, count in components.items():\n        amt = count * pct * d // (100 * mx)\n        if item['rarity'] != 'common' and amt < 1:\n            amt = 1\n        if amt:\n            out[name] = amt\n    return dict(sorted(out.items()))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('regression broken item gate #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}],\n   {'scrap': 1}),\n  ('fault site broken item gate #1',\n   [{'rarity': 'common', 'durability': 0, 'max_durability': 100}, {'cloth': 6, 'thread': 1}],\n   {'scrap': 1}),\n  ('regression broken item gate #2',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'cloth': 6}],\n   {'scrap': 1}),\n  ('regression broken item gate #3',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'ingot': 5, 'thread': 3}],\n   {'scrap': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('fault site broken item gate #1',\n   [{'rarity': 'common', 'durability': 0, 'max_durability': 100}, {'cloth': 6, 'thread': 1}],\n   {'scrap': 1}),\n  ('fault site broken item gate #2',\n   [{'rarity': 'common', 'durability': 0, 'max_durability': 10}, {'thread': 3}],\n   {'scrap': 1}),\n  ('regression broken item gate #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'cloth': 6}],\n   {'scrap': 1}),\n  ('regression broken item gate #2',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'ingot': 5, 'thread': 3}],\n   {'scrap': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('regression broken item gate #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'cloth': 6}],\n   {'scrap': 1}),\n  ('regression broken item gate #2',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'ingot': 5, 'thread': 3}],\n   {'scrap': 1}),\n  ('regression broken item gate #3',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 7}, {'cloth': 5, 'shard': 5, 'ingot': 1}],\n   {'scrap': 1}),\n  ('regression broken item gate #4',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 20}, {'cloth': 6, 'thread': 2, 'shard': 3}],\n   {'scrap': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('fault site broken item gate #1',\n   [{'rarity': 'common', 'durability': 0, 'max_durability': 7}, {'thread': 4, 'cloth': 5}],\n   {'scrap': 1}),\n  ('regression broken item gate #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 7}, {'cloth': 5, 'shard': 5, 'ingot': 1}],\n   {'scrap': 1}),\n  ('regression broken item gate #2',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 2, 'ingot': 4, 'thread': 1}],\n   {'scrap': 1}),\n  ('regression broken item gate #3',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'ingot': 2, 'shard': 5, 'cloth': 5}],\n   {'scrap': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('control #1',\n   [{'rarity': 'rare', 'durability': 1, 'max_durability': 0}, {'cloth': 5, 'ingot': 4, 'shard': 1}],\n   {'cloth': 3, 'ingot': 2, 'shard': 1})],\n [('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('fault site broken item gate #1',\n   [{'rarity': 'common', 'durability': 0, 'max_durability': 7}, {'cloth': 6, 'ingot': 4, 'shard': 2}],\n   {'scrap': 1}),\n  ('regression broken item gate #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 20}, {'cloth': 6, 'thread': 2, 'shard': 3}],\n   {'scrap': 1}),\n  ('regression broken item gate #2',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 7}, {'shard': 1, 'thread': 2, 'ingot': 2}],\n   {'scrap': 1}),\n  ('regression broken item gate #3',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 7}, {'ingot': 6}],\n   {'scrap': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 1, 'max_durability': 0}, {'shard': 2, 'ingot': 2, 'thread': 6}],\n   {'ingot': 1, 'shard': 1, 'thread': 3})]]\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":"21ff6ccba3b99269083c0266c44302b242d17baed09906e5fa671657942659d0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(item, components):\n    pct = {'common': 50, 'rare': 70, 'epic': 90}[item['rarity']]\n    mx = item['max_durability']\n    if mx == 0:\n        d, mx = 1, 1\n    else:\n        d = min(item['durability'], mx)\n    if d < 0:\n        return {'scrap': 1}\n    out = {}\n    for name, count in components.items():\n        amt = count * pct * d // (100 * mx)\n        if item['rarity'] != 'common' and amt < 1:\n            amt = 1\n        if amt:\n            out[name] = amt\n    return dict(sorted(out.items()))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('regression broken item gate #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}],\n   {'scrap': 1}),\n  ('fault site broken item gate #1',\n   [{'rarity': 'common', 'durability': 0, 'max_durability': 100}, {'cloth': 6, 'thread': 1}],\n   {'scrap': 1}),\n  ('regression broken item gate #2',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'cloth': 6}],\n   {'scrap': 1}),\n  ('regression broken item gate #3',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'ingot': 5, 'thread': 3}],\n   {'scrap': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('fault site broken item gate #1',\n   [{'rarity': 'common', 'durability': 0, 'max_durability': 100}, {'cloth': 6, 'thread': 1}],\n   {'scrap': 1}),\n  ('fault site broken item gate #2',\n   [{'rarity': 'common', 'durability': 0, 'max_durability': 10}, {'thread': 3}],\n   {'scrap': 1}),\n  ('regression broken item gate #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'cloth': 6}],\n   {'scrap': 1}),\n  ('regression broken item gate #2',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'ingot': 5, 'thread': 3}],\n   {'scrap': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('regression broken item gate #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'cloth': 6}],\n   {'scrap': 1}),\n  ('regression broken item gate #2',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'ingot': 5, 'thread': 3}],\n   {'scrap': 1}),\n  ('regression broken item gate #3',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 7}, {'cloth': 5, 'shard': 5, 'ingot': 1}],\n   {'scrap': 1}),\n  ('regression broken item gate #4',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 20}, {'cloth': 6, 'thread': 2, 'shard': 3}],\n   {'scrap': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('fault site broken item gate #1',\n   [{'rarity': 'common', 'durability': 0, 'max_durability': 7}, {'thread': 4, 'cloth': 5}],\n   {'scrap': 1}),\n  ('regression broken item gate #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 7}, {'cloth': 5, 'shard': 5, 'ingot': 1}],\n   {'scrap': 1}),\n  ('regression broken item gate #2',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 2, 'ingot': 4, 'thread': 1}],\n   {'scrap': 1}),\n  ('regression broken item gate #3',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'ingot': 2, 'shard': 5, 'cloth': 5}],\n   {'scrap': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('control #1',\n   [{'rarity': 'rare', 'durability': 1, 'max_durability': 0}, {'cloth': 5, 'ingot': 4, 'shard': 1}],\n   {'cloth': 3, 'ingot': 2, 'shard': 1})],\n [('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('fault site broken item gate #1',\n   [{'rarity': 'common', 'durability': 0, 'max_durability': 7}, {'cloth': 6, 'ingot': 4, 'shard': 2}],\n   {'scrap': 1}),\n  ('regression broken item gate #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 20}, {'cloth': 6, 'thread': 2, 'shard': 3}],\n   {'scrap': 1}),\n  ('regression broken item gate #2',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 7}, {'shard': 1, 'thread': 2, 'ingot': 2}],\n   {'scrap': 1}),\n  ('regression broken item gate #3',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 7}, {'ingot': 6}],\n   {'scrap': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 1, 'max_durability': 0}, {'shard': 2, 'ingot': 2, 'thread': 6}],\n   {'ingot': 1, 'shard': 1, 'thread': 3})]]\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"},"fixed":{"sha256":"82c9536a83b3b4fb83ddcc7ee6b2648b98cad38d9e2cbefd4ce88e804f9758fa","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(item, components):\n    pct = {'common': 50, 'rare': 70, 'epic': 90}[item['rarity']]\n    mx = item['max_durability']\n    if mx == 0:\n        d, mx = 1, 1\n    else:\n        d = min(item['durability'], mx)\n    if d <= 0:\n        return {'scrap': 1}\n    out = {}\n    for name, count in components.items():\n        amt = count * pct * d // (100 * mx)\n        if item['rarity'] != 'common' and amt < 1:\n            amt = 1\n        if amt:\n            out[name] = amt\n    return dict(sorted(out.items()))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('regression broken item gate #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}],\n   {'scrap': 1}),\n  ('fault site broken item gate #1',\n   [{'rarity': 'common', 'durability': 0, 'max_durability': 100}, {'cloth': 6, 'thread': 1}],\n   {'scrap': 1}),\n  ('regression broken item gate #2',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'cloth': 6}],\n   {'scrap': 1}),\n  ('regression broken item gate #3',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'ingot': 5, 'thread': 3}],\n   {'scrap': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('fault site broken item gate #1',\n   [{'rarity': 'common', 'durability': 0, 'max_durability': 100}, {'cloth': 6, 'thread': 1}],\n   {'scrap': 1}),\n  ('fault site broken item gate #2',\n   [{'rarity': 'common', 'durability': 0, 'max_durability': 10}, {'thread': 3}],\n   {'scrap': 1}),\n  ('regression broken item gate #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'cloth': 6}],\n   {'scrap': 1}),\n  ('regression broken item gate #2',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'ingot': 5, 'thread': 3}],\n   {'scrap': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('regression broken item gate #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'cloth': 6}],\n   {'scrap': 1}),\n  ('regression broken item gate #2',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 10}, {'ingot': 5, 'thread': 3}],\n   {'scrap': 1}),\n  ('regression broken item gate #3',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 7}, {'cloth': 5, 'shard': 5, 'ingot': 1}],\n   {'scrap': 1}),\n  ('regression broken item gate #4',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 20}, {'cloth': 6, 'thread': 2, 'shard': 3}],\n   {'scrap': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('fault site broken item gate #1',\n   [{'rarity': 'common', 'durability': 0, 'max_durability': 7}, {'thread': 4, 'cloth': 5}],\n   {'scrap': 1}),\n  ('regression broken item gate #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 7}, {'cloth': 5, 'shard': 5, 'ingot': 1}],\n   {'scrap': 1}),\n  ('regression broken item gate #2',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 2, 'ingot': 4, 'thread': 1}],\n   {'scrap': 1}),\n  ('regression broken item gate #3',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'ingot': 2, 'shard': 5, 'cloth': 5}],\n   {'scrap': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('control #1',\n   [{'rarity': 'rare', 'durability': 1, 'max_durability': 0}, {'cloth': 5, 'ingot': 4, 'shard': 1}],\n   {'cloth': 3, 'ingot': 2, 'shard': 1})],\n [('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('fault site broken item gate #1',\n   [{'rarity': 'common', 'durability': 0, 'max_durability': 7}, {'cloth': 6, 'ingot': 4, 'shard': 2}],\n   {'scrap': 1}),\n  ('regression broken item gate #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 20}, {'cloth': 6, 'thread': 2, 'shard': 3}],\n   {'scrap': 1}),\n  ('regression broken item gate #2',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 7}, {'shard': 1, 'thread': 2, 'ingot': 2}],\n   {'scrap': 1}),\n  ('regression broken item gate #3',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 7}, {'ingot': 6}],\n   {'scrap': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 1, 'max_durability': 0}, {'shard': 2, 'ingot': 2, 'thread': 6}],\n   {'ingot': 1, 'shard': 1, 'thread': 3})]]\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-salvage-return-broken-item-gate","generated_at":"2026-09-29T14:50:44.521753+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.","repair":"Restore `if d <= 0:` at the broken item gate step.","root_cause":"The broken check is strict, so durability exactly zero proceeds into the component loop.","sha256":"bc3ec2bdf2c7332b00d6aa720e5f2ab1dc76d68cae97713de2e999d86e6e61bc","title":"Salvage component return: Broken items return components · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.04,"exit_code":1,"observations":[{"actual":{"thread":1},"check":"broken rare #1","expected":{"scrap":1},"passed":false},{"actual":{"shard":1},"check":"regression broken item gate #1","expected":{"scrap":1},"passed":false},{"actual":{"scrap":1},"check":"fault site broken item gate #1","expected":{"scrap":1},"passed":true},{"actual":{"cloth":1},"check":"regression broken item gate #2","expected":{"scrap":1},"passed":false},{"actual":{"ingot":1,"thread":1},"check":"regression broken item gate #3","expected":{"scrap":1},"passed":false},{"actual":{"shard":4},"check":"indestructible relic #1","expected":{"shard":4},"passed":true},{"actual":{"cloth":1,"ingot":2},"check":"over-repaired common #1","expected":{"cloth":1,"ingot":2},"passed":true},{"actual":{},"check":"control #1","expected":{},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"broken rare #1\", \"actual\": {\"thread\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": false}, {\"check\": \"regression broken item gate #1\", \"actual\": {\"shard\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": false}, {\"check\": \"fault site broken item gate #1\", \"actual\": {\"scrap\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": true}, {\"check\": \"regression broken item gate #2\", \"actual\": {\"cloth\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": false}, {\"check\": \"regression broken item gate #3\", \"actual\": {\"ingot\": 1, \"thread\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": false}, {\"check\": \"indestructible relic #1\", \"actual\": {\"shard\": 4}, \"expected\": {\"shard\": 4}, \"passed\": true}, {\"check\": \"over-repaired common #1\", \"actual\": {\"cloth\": 1, \"ingot\": 2}, \"expected\": {\"cloth\": 1, \"ingot\": 2}, \"passed\": true}, {\"check\": \"control #1\", \"actual\": {}, \"expected\": {}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.647,"exit_code":1,"observations":[{"actual":{"thread":1},"check":"broken rare #1","expected":{"scrap":1},"passed":false},{"actual":{"shard":1},"check":"regression broken item gate #1","expected":{"scrap":1},"passed":false},{"actual":{},"check":"fault site broken item gate #1","expected":{"scrap":1},"passed":false},{"actual":{"cloth":1},"check":"regression broken item gate #2","expected":{"scrap":1},"passed":false},{"actual":{"ingot":1,"thread":1},"check":"regression broken item gate #3","expected":{"scrap":1},"passed":false},{"actual":{"shard":4},"check":"indestructible relic #1","expected":{"shard":4},"passed":true},{"actual":{"cloth":1,"ingot":2},"check":"over-repaired common #1","expected":{"cloth":1,"ingot":2},"passed":true},{"actual":{},"check":"control #1","expected":{},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"broken rare #1\", \"actual\": {\"thread\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": false}, {\"check\": \"regression broken item gate #1\", \"actual\": {\"shard\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": false}, {\"check\": \"fault site broken item gate #1\", \"actual\": {}, \"expected\": {\"scrap\": 1}, \"passed\": false}, {\"check\": \"regression broken item gate #2\", \"actual\": {\"cloth\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": false}, {\"check\": \"regression broken item gate #3\", \"actual\": {\"ingot\": 1, \"thread\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": false}, {\"check\": \"indestructible relic #1\", \"actual\": {\"shard\": 4}, \"expected\": {\"shard\": 4}, \"passed\": true}, {\"check\": \"over-repaired common #1\", \"actual\": {\"cloth\": 1, \"ingot\": 2}, \"expected\": {\"cloth\": 1, \"ingot\": 2}, \"passed\": true}, {\"check\": \"control #1\", \"actual\": {}, \"expected\": {}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.152,"exit_code":0,"observations":[{"actual":{"scrap":1},"check":"broken rare #1","expected":{"scrap":1},"passed":true},{"actual":{"scrap":1},"check":"regression broken item gate #1","expected":{"scrap":1},"passed":true},{"actual":{"scrap":1},"check":"fault site broken item gate #1","expected":{"scrap":1},"passed":true},{"actual":{"scrap":1},"check":"regression broken item gate #2","expected":{"scrap":1},"passed":true},{"actual":{"scrap":1},"check":"regression broken item gate #3","expected":{"scrap":1},"passed":true},{"actual":{"shard":4},"check":"indestructible relic #1","expected":{"shard":4},"passed":true},{"actual":{"cloth":1,"ingot":2},"check":"over-repaired common #1","expected":{"cloth":1,"ingot":2},"passed":true},{"actual":{},"check":"control #1","expected":{},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"broken rare #1\", \"actual\": {\"scrap\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": true}, {\"check\": \"regression broken item gate #1\", \"actual\": {\"scrap\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": true}, {\"check\": \"fault site broken item gate #1\", \"actual\": {\"scrap\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": true}, {\"check\": \"regression broken item gate #2\", \"actual\": {\"scrap\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": true}, {\"check\": \"regression broken item gate #3\", \"actual\": {\"scrap\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": true}, {\"check\": \"indestructible relic #1\", \"actual\": {\"shard\": 4}, \"expected\": {\"shard\": 4}, \"passed\": true}, {\"check\": \"over-repaired common #1\", \"actual\": {\"cloth\": 1, \"ingot\": 2}, \"expected\": {\"cloth\": 1, \"ingot\": 2}, \"passed\": true}, {\"check\": \"control #1\", \"actual\": {}, \"expected\": {}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}