{"abstract":"Popular items climb past the configured ceiling.","category":"Game economy crafting balance","checks":8,"contract":"If target <= 0 the price is only clamped to [floor, ceiling]. If sold > target: pct = min(20, floor((sold-target)*100/target)), step = floor(price*pct/100) but at least 1 when pct > 0, new = price + step. If sold < target: pct = min(15, floor((target-sold)*100/target)), new = price - floor(price*pct/100). Otherwise unchanged. Result clamped to [floor, ceiling].","contract_signature":"price, sold, target, floor, ceiling","evaluation_group":"w2-game-economy-crafting-balance-market-rebalance","failed_approach":"Clamping only to the ceiling lets crashes pass below the floor.","family":"w2-game-economy-crafting-balance-market-rebalance-band-clamp","id":"FA-86271","implementations":{"attempt":{"sha256":"8a84b75d78367eb013acc7a458e91c647223ae670502aa287e1ff0831fcb4a4a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(price, sold, target, floor, ceiling):\n    if target <= 0:\n        return min(max(price, floor), ceiling)\n    if sold > target:\n        pct = min(20, (sold - target) * 100 // target)\n        step = price * pct // 100\n        if pct > 0:\n            step = max(step, 1)\n        new = price + step\n    elif sold < target:\n        pct = min(15, (target - sold) * 100 // target)\n        new = price - price * pct // 100\n    else:\n        new = price\n    return min(new, ceiling)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('fault site band clamp #1', [736, 68, 66, 28, 100], 100),\n  ('fault site band clamp #2', [1833, 42, 40, 20, 549], 549),\n  ('partial repair boundary #1', [9, 0, 1, 47, 499], 47),\n  ('partial repair boundary #2', [3, 75, 76, 12, 1170], 12),\n  ('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('cheap item rises one #1', [3, 13, 10, 1, 100], 4),\n  ('crash capped at 15 #1', [1000, 0, 40, 1, 5000], 850),\n  ('control #1', [99, 1188, 396, 6, 782], 118)],\n [('fault site band clamp #1', [1449, 42, 40, 8, 680], 680),\n  ('fault site band clamp #2', [508, 144, 365, 8, 95], 95),\n  ('partial repair boundary #1', [3, 0, 10, 26, 481], 26),\n  ('partial repair boundary #2', [1, 0, 40, 29, 801], 29),\n  ('crash capped at 15 #1', [1000, 0, 40, 1, 5000], 850),\n  ('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('control #1', [99, 1188, 396, 6, 782], 118),\n  ('control #2', [1000, 0, 0, 7, 47], 47)],\n [('fault site band clamp #1', [50, 16, 1, 43, 49], 49),\n  ('fault site band clamp #2', [1000, 30, 10, 17, 816], 816),\n  ('partial repair boundary #1', [1, 672, 671, 16, 40], 16),\n  ('partial repair boundary #2', [9, 581, 582, 29, 801], 29),\n  ('cheap item rises one #1', [3, 13, 10, 1, 100], 4),\n  ('crash capped at 15 #1', [1000, 0, 40, 1, 5000], 850),\n  ('control #1', [1000, 0, 0, 7, 47], 47),\n  ('control #2', [1000, 5, 5, 37, 1007], 1000)],\n [('fault site band clamp #1', [1369, 46, 45, 46, 340], 340),\n  ('fault site band clamp #2', [1314, 55, 55, 10, 1281], 1281),\n  ('partial repair boundary #1', [50, 0, 1, 48, 402], 48),\n  ('partial repair boundary #2', [1, 85, 84, 28, 1011], 28),\n  ('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('cheap item rises one #1', [3, 13, 10, 1, 100], 4),\n  ('control #1', [50, 11, 10, 38, 410], 55),\n  ('control #2', [99, 5, 5, 44, 212], 99)],\n [('fault site band clamp #1', [1167, 2, 1, 43, 172], 172),\n  ('fault site band clamp #2', [1000, 96, 95, 44, 489], 489),\n  ('partial repair boundary #1', [3, 40, 40, 47, 590], 47),\n  ('partial repair boundary #2', [9, 53, 53, 21, 719], 21),\n  ('crash capped at 15 #1', [1000, 0, 40, 1, 5000], 850),\n  ('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('control #1', [99, -1, 0, 37, 260], 99),\n  ('control #2', [50, 42, 70, 38, 107], 43)]]\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":"e5fd280ef009877dce45bed48a1dd3adcec36cd38479ef6e560ec1c42b076c3a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(price, sold, target, floor, ceiling):\n    if target <= 0:\n        return min(max(price, floor), ceiling)\n    if sold > target:\n        pct = min(20, (sold - target) * 100 // target)\n        step = price * pct // 100\n        if pct > 0:\n            step = max(step, 1)\n        new = price + step\n    elif sold < target:\n        pct = min(15, (target - sold) * 100 // target)\n        new = price - price * pct // 100\n    else:\n        new = price\n    return max(new, floor)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('fault site band clamp #1', [736, 68, 66, 28, 100], 100),\n  ('fault site band clamp #2', [1833, 42, 40, 20, 549], 549),\n  ('partial repair boundary #1', [9, 0, 1, 47, 499], 47),\n  ('partial repair boundary #2', [3, 75, 76, 12, 1170], 12),\n  ('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('cheap item rises one #1', [3, 13, 10, 1, 100], 4),\n  ('crash capped at 15 #1', [1000, 0, 40, 1, 5000], 850),\n  ('control #1', [99, 1188, 396, 6, 782], 118)],\n [('fault site band clamp #1', [1449, 42, 40, 8, 680], 680),\n  ('fault site band clamp #2', [508, 144, 365, 8, 95], 95),\n  ('partial repair boundary #1', [3, 0, 10, 26, 481], 26),\n  ('partial repair boundary #2', [1, 0, 40, 29, 801], 29),\n  ('crash capped at 15 #1', [1000, 0, 40, 1, 5000], 850),\n  ('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('control #1', [99, 1188, 396, 6, 782], 118),\n  ('control #2', [1000, 0, 0, 7, 47], 47)],\n [('fault site band clamp #1', [50, 16, 1, 43, 49], 49),\n  ('fault site band clamp #2', [1000, 30, 10, 17, 816], 816),\n  ('partial repair boundary #1', [1, 672, 671, 16, 40], 16),\n  ('partial repair boundary #2', [9, 581, 582, 29, 801], 29),\n  ('cheap item rises one #1', [3, 13, 10, 1, 100], 4),\n  ('crash capped at 15 #1', [1000, 0, 40, 1, 5000], 850),\n  ('control #1', [1000, 0, 0, 7, 47], 47),\n  ('control #2', [1000, 5, 5, 37, 1007], 1000)],\n [('fault site band clamp #1', [1369, 46, 45, 46, 340], 340),\n  ('fault site band clamp #2', [1314, 55, 55, 10, 1281], 1281),\n  ('partial repair boundary #1', [50, 0, 1, 48, 402], 48),\n  ('partial repair boundary #2', [1, 85, 84, 28, 1011], 28),\n  ('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('cheap item rises one #1', [3, 13, 10, 1, 100], 4),\n  ('control #1', [50, 11, 10, 38, 410], 55),\n  ('control #2', [99, 5, 5, 44, 212], 99)],\n [('fault site band clamp #1', [1167, 2, 1, 43, 172], 172),\n  ('fault site band clamp #2', [1000, 96, 95, 44, 489], 489),\n  ('partial repair boundary #1', [3, 40, 40, 47, 590], 47),\n  ('partial repair boundary #2', [9, 53, 53, 21, 719], 21),\n  ('crash capped at 15 #1', [1000, 0, 40, 1, 5000], 850),\n  ('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('control #1', [99, -1, 0, 37, 260], 99),\n  ('control #2', [50, 42, 70, 38, 107], 43)]]\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-market-rebalance-band-clamp","generated_at":"2026-09-29T14:50:48.056418+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 final clamp only applies the floor.","sha256":"d8906adf13e8fdbc105f6f7ef9c49ceb2ba9ffd2d5bcab30ff56758f95701369","title":"Daily market rebalance: Rebalanced price ignores the ceiling · 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.69,"exit_code":1,"observations":[{"actual":100,"check":"fault site band clamp #1","expected":100,"passed":true},{"actual":549,"check":"fault site band clamp #2","expected":549,"passed":true},{"actual":8,"check":"partial repair boundary #1","expected":47,"passed":false},{"actual":3,"check":"partial repair boundary #2","expected":12,"passed":false},{"actual":10,"check":"no target listed #1","expected":10,"passed":true},{"actual":4,"check":"cheap item rises one #1","expected":4,"passed":true},{"actual":850,"check":"crash capped at 15 #1","expected":850,"passed":true},{"actual":118,"check":"control #1","expected":118,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fault site band clamp #1\", \"actual\": 100, \"expected\": 100, \"passed\": true}, {\"check\": \"fault site band clamp #2\", \"actual\": 549, \"expected\": 549, \"passed\": true}, {\"check\": \"partial repair boundary #1\", \"actual\": 8, \"expected\": 47, \"passed\": false}, {\"check\": \"partial repair boundary #2\", \"actual\": 3, \"expected\": 12, \"passed\": false}, {\"check\": \"no target listed #1\", \"actual\": 10, \"expected\": 10, \"passed\": true}, {\"check\": \"cheap item rises one #1\", \"actual\": 4, \"expected\": 4, \"passed\": true}, {\"check\": \"crash capped at 15 #1\", \"actual\": 850, \"expected\": 850, \"passed\": true}, {\"check\": \"control #1\", \"actual\": 118, \"expected\": 118, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.057,"exit_code":1,"observations":[{"actual":758,"check":"fault site band clamp #1","expected":100,"passed":false},{"actual":1924,"check":"fault site band clamp #2","expected":549,"passed":false},{"actual":47,"check":"partial repair boundary #1","expected":47,"passed":true},{"actual":12,"check":"partial repair boundary #2","expected":12,"passed":true},{"actual":10,"check":"no target listed #1","expected":10,"passed":true},{"actual":4,"check":"cheap item rises one #1","expected":4,"passed":true},{"actual":850,"check":"crash capped at 15 #1","expected":850,"passed":true},{"actual":118,"check":"control #1","expected":118,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fault site band clamp #1\", \"actual\": 758, \"expected\": 100, \"passed\": false}, {\"check\": \"fault site band clamp #2\", \"actual\": 1924, \"expected\": 549, \"passed\": false}, {\"check\": \"partial repair boundary #1\", \"actual\": 47, \"expected\": 47, \"passed\": true}, {\"check\": \"partial repair boundary #2\", \"actual\": 12, \"expected\": 12, \"passed\": true}, {\"check\": \"no target listed #1\", \"actual\": 10, \"expected\": 10, \"passed\": true}, {\"check\": \"cheap item rises one #1\", \"actual\": 4, \"expected\": 4, \"passed\": true}, {\"check\": \"crash capped at 15 #1\", \"actual\": 850, \"expected\": 850, \"passed\": true}, {\"check\": \"control #1\", \"actual\": 118, \"expected\": 118, \"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."}}