{"abstract":"Items repaired past maximum durability return more than 100% condition.","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":"Clamping to a fixed 100 only works for items whose maximum durability is 100.","family":"w2-game-economy-crafting-balance-salvage-return-over-repair-clamp","id":"FA-85891","implementations":{"attempt":{"sha256":"7921b45635c10b2a446924dd7fb0f95a6fa2c0c24001e888eff0b9cc7550a385","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'], 100)\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 = [[('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('regression over-repair clamp #1',\n   [{'rarity': 'epic', 'durability': 12, 'max_durability': 7}, {'ingot': 5}],\n   {'ingot': 4}),\n  ('regression over-repair clamp #2',\n   [{'rarity': 'rare', 'durability': 12, 'max_durability': 7}, {'cloth': 3}],\n   {'cloth': 2}),\n  ('regression over-repair clamp #3',\n   [{'rarity': 'epic', 'durability': 12, 'max_durability': 7}, {'thread': 4, 'ingot': 5}],\n   {'ingot': 4, 'thread': 3}),\n  ('regression over-repair clamp #4',\n   [{'rarity': 'rare', 'durability': 15, 'max_durability': 10}, {'thread': 2, 'ingot': 3, 'shard': 2}],\n   {'ingot': 2, 'shard': 1, 'thread': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('regression over-repair clamp #1',\n   [{'rarity': 'rare', 'durability': 12, 'max_durability': 7}, {'cloth': 3}],\n   {'cloth': 2}),\n  ('regression over-repair clamp #2',\n   [{'rarity': 'epic', 'durability': 12, 'max_durability': 7}, {'thread': 4, 'ingot': 5}],\n   {'ingot': 4, 'thread': 3}),\n  ('regression over-repair clamp #3',\n   [{'rarity': 'rare', 'durability': 15, 'max_durability': 10}, {'thread': 2, 'ingot': 3, 'shard': 2}],\n   {'ingot': 2, 'shard': 1, 'thread': 1}),\n  ('regression over-repair clamp #4',\n   [{'rarity': 'epic', 'durability': 25, 'max_durability': 20}, {'ingot': 6}],\n   {'ingot': 5}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('regression over-repair clamp #1',\n   [{'rarity': 'rare', 'durability': 15, 'max_durability': 10}, {'thread': 2, 'ingot': 3, 'shard': 2}],\n   {'ingot': 2, 'shard': 1, 'thread': 1}),\n  ('regression over-repair clamp #2',\n   [{'rarity': 'epic', 'durability': 25, 'max_durability': 20}, {'ingot': 6}],\n   {'ingot': 5}),\n  ('regression over-repair clamp #3',\n   [{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'ingot': 5, 'thread': 2, 'shard': 1}],\n   {'ingot': 3, 'shard': 1, 'thread': 1}),\n  ('regression over-repair clamp #4',\n   [{'rarity': 'epic', 'durability': 15, 'max_durability': 10}, {'shard': 6}],\n   {'shard': 5}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('regression over-repair clamp #1',\n   [{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'ingot': 5, 'thread': 2, 'shard': 1}],\n   {'ingot': 3, 'shard': 1, 'thread': 1}),\n  ('regression over-repair clamp #2',\n   [{'rarity': 'epic', 'durability': 15, 'max_durability': 10}, {'shard': 6}],\n   {'shard': 5}),\n  ('regression over-repair clamp #3',\n   [{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'shard': 4, 'thread': 2, 'ingot': 1}],\n   {'ingot': 1, 'shard': 2, 'thread': 1}),\n  ('regression over-repair clamp #4',\n   [{'rarity': 'epic', 'durability': 25, 'max_durability': 20}, {'shard': 5, 'cloth': 3}],\n   {'cloth': 2, 'shard': 4}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('control #1', [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}], {'scrap': 1})],\n [('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('regression over-repair clamp #1',\n   [{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'shard': 4, 'thread': 2, 'ingot': 1}],\n   {'ingot': 1, 'shard': 2, 'thread': 1}),\n  ('regression over-repair clamp #2',\n   [{'rarity': 'epic', 'durability': 25, 'max_durability': 20}, {'shard': 5, 'cloth': 3}],\n   {'cloth': 2, 'shard': 4}),\n  ('regression over-repair clamp #3',\n   [{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'ingot': 6, 'cloth': 3}],\n   {'cloth': 2, 'ingot': 4}),\n  ('regression over-repair clamp #4',\n   [{'rarity': 'common', 'durability': 12, 'max_durability': 7}, {'shard': 6, 'cloth': 6}],\n   {'cloth': 3, 'shard': 3}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('control #1',\n   [{'rarity': 'rare', 'durability': 1, 'max_durability': 0}, {'cloth': 5, 'ingot': 4, 'shard': 1}],\n   {'cloth': 3, 'ingot': 2, 'shard': 1})]]\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":"114e81946b3af153ce78008f8455af25b48050a1b850d877228cf752feb0c972","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 = item['durability']\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 = [[('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('regression over-repair clamp #1',\n   [{'rarity': 'epic', 'durability': 12, 'max_durability': 7}, {'ingot': 5}],\n   {'ingot': 4}),\n  ('regression over-repair clamp #2',\n   [{'rarity': 'rare', 'durability': 12, 'max_durability': 7}, {'cloth': 3}],\n   {'cloth': 2}),\n  ('regression over-repair clamp #3',\n   [{'rarity': 'epic', 'durability': 12, 'max_durability': 7}, {'thread': 4, 'ingot': 5}],\n   {'ingot': 4, 'thread': 3}),\n  ('regression over-repair clamp #4',\n   [{'rarity': 'rare', 'durability': 15, 'max_durability': 10}, {'thread': 2, 'ingot': 3, 'shard': 2}],\n   {'ingot': 2, 'shard': 1, 'thread': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('regression over-repair clamp #1',\n   [{'rarity': 'rare', 'durability': 12, 'max_durability': 7}, {'cloth': 3}],\n   {'cloth': 2}),\n  ('regression over-repair clamp #2',\n   [{'rarity': 'epic', 'durability': 12, 'max_durability': 7}, {'thread': 4, 'ingot': 5}],\n   {'ingot': 4, 'thread': 3}),\n  ('regression over-repair clamp #3',\n   [{'rarity': 'rare', 'durability': 15, 'max_durability': 10}, {'thread': 2, 'ingot': 3, 'shard': 2}],\n   {'ingot': 2, 'shard': 1, 'thread': 1}),\n  ('regression over-repair clamp #4',\n   [{'rarity': 'epic', 'durability': 25, 'max_durability': 20}, {'ingot': 6}],\n   {'ingot': 5}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('regression over-repair clamp #1',\n   [{'rarity': 'rare', 'durability': 15, 'max_durability': 10}, {'thread': 2, 'ingot': 3, 'shard': 2}],\n   {'ingot': 2, 'shard': 1, 'thread': 1}),\n  ('regression over-repair clamp #2',\n   [{'rarity': 'epic', 'durability': 25, 'max_durability': 20}, {'ingot': 6}],\n   {'ingot': 5}),\n  ('regression over-repair clamp #3',\n   [{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'ingot': 5, 'thread': 2, 'shard': 1}],\n   {'ingot': 3, 'shard': 1, 'thread': 1}),\n  ('regression over-repair clamp #4',\n   [{'rarity': 'epic', 'durability': 15, 'max_durability': 10}, {'shard': 6}],\n   {'shard': 5}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('regression over-repair clamp #1',\n   [{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'ingot': 5, 'thread': 2, 'shard': 1}],\n   {'ingot': 3, 'shard': 1, 'thread': 1}),\n  ('regression over-repair clamp #2',\n   [{'rarity': 'epic', 'durability': 15, 'max_durability': 10}, {'shard': 6}],\n   {'shard': 5}),\n  ('regression over-repair clamp #3',\n   [{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'shard': 4, 'thread': 2, 'ingot': 1}],\n   {'ingot': 1, 'shard': 2, 'thread': 1}),\n  ('regression over-repair clamp #4',\n   [{'rarity': 'epic', 'durability': 25, 'max_durability': 20}, {'shard': 5, 'cloth': 3}],\n   {'cloth': 2, 'shard': 4}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('control #1', [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}], {'scrap': 1})],\n [('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('regression over-repair clamp #1',\n   [{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'shard': 4, 'thread': 2, 'ingot': 1}],\n   {'ingot': 1, 'shard': 2, 'thread': 1}),\n  ('regression over-repair clamp #2',\n   [{'rarity': 'epic', 'durability': 25, 'max_durability': 20}, {'shard': 5, 'cloth': 3}],\n   {'cloth': 2, 'shard': 4}),\n  ('regression over-repair clamp #3',\n   [{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'ingot': 6, 'cloth': 3}],\n   {'cloth': 2, 'ingot': 4}),\n  ('regression over-repair clamp #4',\n   [{'rarity': 'common', 'durability': 12, 'max_durability': 7}, {'shard': 6, 'cloth': 6}],\n   {'cloth': 3, 'shard': 3}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('control #1',\n   [{'rarity': 'rare', 'durability': 1, 'max_durability': 0}, {'cloth': 5, 'ingot': 4, 'shard': 1}],\n   {'cloth': 3, 'ingot': 2, 'shard': 1})]]\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":"50ea256fa37a12f7297a5e50536887dd0256732fa27a5419a2ffdc844e9f7d1a","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 = [[('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('regression over-repair clamp #1',\n   [{'rarity': 'epic', 'durability': 12, 'max_durability': 7}, {'ingot': 5}],\n   {'ingot': 4}),\n  ('regression over-repair clamp #2',\n   [{'rarity': 'rare', 'durability': 12, 'max_durability': 7}, {'cloth': 3}],\n   {'cloth': 2}),\n  ('regression over-repair clamp #3',\n   [{'rarity': 'epic', 'durability': 12, 'max_durability': 7}, {'thread': 4, 'ingot': 5}],\n   {'ingot': 4, 'thread': 3}),\n  ('regression over-repair clamp #4',\n   [{'rarity': 'rare', 'durability': 15, 'max_durability': 10}, {'thread': 2, 'ingot': 3, 'shard': 2}],\n   {'ingot': 2, 'shard': 1, 'thread': 1}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('regression over-repair clamp #1',\n   [{'rarity': 'rare', 'durability': 12, 'max_durability': 7}, {'cloth': 3}],\n   {'cloth': 2}),\n  ('regression over-repair clamp #2',\n   [{'rarity': 'epic', 'durability': 12, 'max_durability': 7}, {'thread': 4, 'ingot': 5}],\n   {'ingot': 4, 'thread': 3}),\n  ('regression over-repair clamp #3',\n   [{'rarity': 'rare', 'durability': 15, 'max_durability': 10}, {'thread': 2, 'ingot': 3, 'shard': 2}],\n   {'ingot': 2, 'shard': 1, 'thread': 1}),\n  ('regression over-repair clamp #4',\n   [{'rarity': 'epic', 'durability': 25, 'max_durability': 20}, {'ingot': 6}],\n   {'ingot': 5}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('regression over-repair clamp #1',\n   [{'rarity': 'rare', 'durability': 15, 'max_durability': 10}, {'thread': 2, 'ingot': 3, 'shard': 2}],\n   {'ingot': 2, 'shard': 1, 'thread': 1}),\n  ('regression over-repair clamp #2',\n   [{'rarity': 'epic', 'durability': 25, 'max_durability': 20}, {'ingot': 6}],\n   {'ingot': 5}),\n  ('regression over-repair clamp #3',\n   [{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'ingot': 5, 'thread': 2, 'shard': 1}],\n   {'ingot': 3, 'shard': 1, 'thread': 1}),\n  ('regression over-repair clamp #4',\n   [{'rarity': 'epic', 'durability': 15, 'max_durability': 10}, {'shard': 6}],\n   {'shard': 5}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('control #1',\n   [{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],\n   {})],\n [('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('regression over-repair clamp #1',\n   [{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'ingot': 5, 'thread': 2, 'shard': 1}],\n   {'ingot': 3, 'shard': 1, 'thread': 1}),\n  ('regression over-repair clamp #2',\n   [{'rarity': 'epic', 'durability': 15, 'max_durability': 10}, {'shard': 6}],\n   {'shard': 5}),\n  ('regression over-repair clamp #3',\n   [{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'shard': 4, 'thread': 2, 'ingot': 1}],\n   {'ingot': 1, 'shard': 2, 'thread': 1}),\n  ('regression over-repair clamp #4',\n   [{'rarity': 'epic', 'durability': 25, 'max_durability': 20}, {'shard': 5, 'cloth': 3}],\n   {'cloth': 2, 'shard': 4}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('control #1', [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}], {'scrap': 1})],\n [('over-repaired common #1',\n   [{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],\n   {'cloth': 1, 'ingot': 2}),\n  ('regression over-repair clamp #1',\n   [{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'shard': 4, 'thread': 2, 'ingot': 1}],\n   {'ingot': 1, 'shard': 2, 'thread': 1}),\n  ('regression over-repair clamp #2',\n   [{'rarity': 'epic', 'durability': 25, 'max_durability': 20}, {'shard': 5, 'cloth': 3}],\n   {'cloth': 2, 'shard': 4}),\n  ('regression over-repair clamp #3',\n   [{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'ingot': 6, 'cloth': 3}],\n   {'cloth': 2, 'ingot': 4}),\n  ('regression over-repair clamp #4',\n   [{'rarity': 'common', 'durability': 12, 'max_durability': 7}, {'shard': 6, 'cloth': 6}],\n   {'cloth': 3, 'shard': 3}),\n  ('indestructible relic #1',\n   [{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],\n   {'shard': 4}),\n  ('broken rare #1',\n   [{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],\n   {'scrap': 1}),\n  ('control #1',\n   [{'rarity': 'rare', 'durability': 1, 'max_durability': 0}, {'cloth': 5, 'ingot': 4, 'shard': 1}],\n   {'cloth': 3, 'ingot': 2, 'shard': 1})]]\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-over-repair-clamp","generated_at":"2026-09-29T14:50:44.479165+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 `d = min(item['durability'], mx)` at the over-repair clamp step.","root_cause":"Current durability is not clamped to maximum before computing condition.","sha256":"4caf0c56219c26a486e585177d5e2228318579468980514467c0188ffb4542c5","title":"Salvage component return: Over-repaired items salvage above full value · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.779,"exit_code":1,"observations":[{"actual":{"cloth":2,"ingot":3},"check":"over-repaired common #1","expected":{"cloth":1,"ingot":2},"passed":false},{"actual":{"ingot":7},"check":"regression over-repair clamp #1","expected":{"ingot":4},"passed":false},{"actual":{"cloth":3},"check":"regression over-repair clamp #2","expected":{"cloth":2},"passed":false},{"actual":{"ingot":7,"thread":6},"check":"regression over-repair clamp #3","expected":{"ingot":4,"thread":3},"passed":false},{"actual":{"ingot":3,"shard":2,"thread":2},"check":"regression over-repair clamp #4","expected":{"ingot":2,"shard":1,"thread":1},"passed":false},{"actual":{"shard":4},"check":"indestructible relic #1","expected":{"shard":4},"passed":true},{"actual":{"scrap":1},"check":"broken rare #1","expected":{"scrap":1},"passed":true},{"actual":{},"check":"control #1","expected":{},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"over-repaired common #1\", \"actual\": {\"cloth\": 2, \"ingot\": 3}, \"expected\": {\"cloth\": 1, \"ingot\": 2}, \"passed\": false}, {\"check\": \"regression over-repair clamp #1\", \"actual\": {\"ingot\": 7}, \"expected\": {\"ingot\": 4}, \"passed\": false}, {\"check\": \"regression over-repair clamp #2\", \"actual\": {\"cloth\": 3}, \"expected\": {\"cloth\": 2}, \"passed\": false}, {\"check\": \"regression over-repair clamp #3\", \"actual\": {\"ingot\": 7, \"thread\": 6}, \"expected\": {\"ingot\": 4, \"thread\": 3}, \"passed\": false}, {\"check\": \"regression over-repair clamp #4\", \"actual\": {\"ingot\": 3, \"shard\": 2, \"thread\": 2}, \"expected\": {\"ingot\": 2, \"shard\": 1, \"thread\": 1}, \"passed\": false}, {\"check\": \"indestructible relic #1\", \"actual\": {\"shard\": 4}, \"expected\": {\"shard\": 4}, \"passed\": true}, {\"check\": \"broken rare #1\", \"actual\": {\"scrap\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": true}, {\"check\": \"control #1\", \"actual\": {}, \"expected\": {}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.404,"exit_code":1,"observations":[{"actual":{"cloth":2,"ingot":3},"check":"over-repaired common #1","expected":{"cloth":1,"ingot":2},"passed":false},{"actual":{"ingot":7},"check":"regression over-repair clamp #1","expected":{"ingot":4},"passed":false},{"actual":{"cloth":3},"check":"regression over-repair clamp #2","expected":{"cloth":2},"passed":false},{"actual":{"ingot":7,"thread":6},"check":"regression over-repair clamp #3","expected":{"ingot":4,"thread":3},"passed":false},{"actual":{"ingot":3,"shard":2,"thread":2},"check":"regression over-repair clamp #4","expected":{"ingot":2,"shard":1,"thread":1},"passed":false},{"actual":{"shard":4},"check":"indestructible relic #1","expected":{"shard":4},"passed":true},{"actual":{"scrap":1},"check":"broken rare #1","expected":{"scrap":1},"passed":true},{"actual":{},"check":"control #1","expected":{},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"over-repaired common #1\", \"actual\": {\"cloth\": 2, \"ingot\": 3}, \"expected\": {\"cloth\": 1, \"ingot\": 2}, \"passed\": false}, {\"check\": \"regression over-repair clamp #1\", \"actual\": {\"ingot\": 7}, \"expected\": {\"ingot\": 4}, \"passed\": false}, {\"check\": \"regression over-repair clamp #2\", \"actual\": {\"cloth\": 3}, \"expected\": {\"cloth\": 2}, \"passed\": false}, {\"check\": \"regression over-repair clamp #3\", \"actual\": {\"ingot\": 7, \"thread\": 6}, \"expected\": {\"ingot\": 4, \"thread\": 3}, \"passed\": false}, {\"check\": \"regression over-repair clamp #4\", \"actual\": {\"ingot\": 3, \"shard\": 2, \"thread\": 2}, \"expected\": {\"ingot\": 2, \"shard\": 1, \"thread\": 1}, \"passed\": false}, {\"check\": \"indestructible relic #1\", \"actual\": {\"shard\": 4}, \"expected\": {\"shard\": 4}, \"passed\": true}, {\"check\": \"broken rare #1\", \"actual\": {\"scrap\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": true}, {\"check\": \"control #1\", \"actual\": {}, \"expected\": {}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.231,"exit_code":0,"observations":[{"actual":{"cloth":1,"ingot":2},"check":"over-repaired common #1","expected":{"cloth":1,"ingot":2},"passed":true},{"actual":{"ingot":4},"check":"regression over-repair clamp #1","expected":{"ingot":4},"passed":true},{"actual":{"cloth":2},"check":"regression over-repair clamp #2","expected":{"cloth":2},"passed":true},{"actual":{"ingot":4,"thread":3},"check":"regression over-repair clamp #3","expected":{"ingot":4,"thread":3},"passed":true},{"actual":{"ingot":2,"shard":1,"thread":1},"check":"regression over-repair clamp #4","expected":{"ingot":2,"shard":1,"thread":1},"passed":true},{"actual":{"shard":4},"check":"indestructible relic #1","expected":{"shard":4},"passed":true},{"actual":{"scrap":1},"check":"broken rare #1","expected":{"scrap":1},"passed":true},{"actual":{},"check":"control #1","expected":{},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"over-repaired common #1\", \"actual\": {\"cloth\": 1, \"ingot\": 2}, \"expected\": {\"cloth\": 1, \"ingot\": 2}, \"passed\": true}, {\"check\": \"regression over-repair clamp #1\", \"actual\": {\"ingot\": 4}, \"expected\": {\"ingot\": 4}, \"passed\": true}, {\"check\": \"regression over-repair clamp #2\", \"actual\": {\"cloth\": 2}, \"expected\": {\"cloth\": 2}, \"passed\": true}, {\"check\": \"regression over-repair clamp #3\", \"actual\": {\"ingot\": 4, \"thread\": 3}, \"expected\": {\"ingot\": 4, \"thread\": 3}, \"passed\": true}, {\"check\": \"regression over-repair clamp #4\", \"actual\": {\"ingot\": 2, \"shard\": 1, \"thread\": 1}, \"expected\": {\"ingot\": 2, \"shard\": 1, \"thread\": 1}, \"passed\": true}, {\"check\": \"indestructible relic #1\", \"actual\": {\"shard\": 4}, \"expected\": {\"shard\": 4}, \"passed\": true}, {\"check\": \"broken rare #1\", \"actual\": {\"scrap\": 1}, \"expected\": {\"scrap\": 1}, \"passed\": true}, {\"check\": \"control #1\", \"actual\": {}, \"expected\": {}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}