{"abstract":"Items without a sales target keep out-of-band prices.","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":"Applying only the ceiling leaves prices under the floor.","family":"w2-game-economy-crafting-balance-market-rebalance-untargeted-clamp","id":"FA-86276","implementations":{"attempt":{"sha256":"d85f3caf6a1f7210923d80d1a1854569683e70a082efb34dd54e8804432a90e5","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(price, 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(max(new, floor), ceiling)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('fault site untargeted clamp #1', [1000, 0, 0, 7, 47], 47),\n  ('fault site untargeted clamp #2', [1000, 0, 0, 22, 503], 503),\n  ('regression untargeted clamp #1', [1, 71, 0, 40, 55], 40),\n  ('regression untargeted clamp #2', [9, 1, 0, 18, 1291], 18),\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 [('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('fault site untargeted clamp #1', [1000, 0, 0, 22, 503], 503),\n  ('fault site untargeted clamp #2', [1817, 170, 0, 27, 1161], 1161),\n  ('regression untargeted clamp #1', [9, 1, 0, 18, 1291], 18),\n  ('regression untargeted clamp #2', [3, 0, 0, 46, 987], 46),\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 [('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('regression untargeted clamp #1', [1, 71, 0, 40, 55], 40),\n  ('regression untargeted clamp #2', [9, 1, 0, 18, 1291], 18),\n  ('regression untargeted clamp #3', [1, 0, 0, 31, 1106], 31),\n  ('regression untargeted clamp #4', [1, 2, 0, 50, 1234], 50),\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 [('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('fault site untargeted clamp #1', [1000, 109, 0, 3, 331], 331),\n  ('regression untargeted clamp #1', [3, 0, 0, 46, 987], 46),\n  ('regression untargeted clamp #2', [1, 2, 0, 47, 1435], 47),\n  ('regression untargeted clamp #3', [9, 0, 0, 22, 719], 22),\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', [9, 0, 1, 47, 499], 47)],\n [('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('regression untargeted clamp #1', [1, 0, 0, 31, 1106], 31),\n  ('fault site untargeted clamp #1', [1000, 0, 0, 15, 739], 739),\n  ('regression untargeted clamp #2', [1, 0, 0, 4, 964], 4),\n  ('regression untargeted clamp #3', [1, 0, 0, 16, 930], 16),\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', [736, 68, 66, 28, 100], 100)]]\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":"f125ff6a8d5c0b29b7cd5aa41330d282d3feff87d57c118df5328be8c7161e94","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 price\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(max(new, floor), ceiling)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('fault site untargeted clamp #1', [1000, 0, 0, 7, 47], 47),\n  ('fault site untargeted clamp #2', [1000, 0, 0, 22, 503], 503),\n  ('regression untargeted clamp #1', [1, 71, 0, 40, 55], 40),\n  ('regression untargeted clamp #2', [9, 1, 0, 18, 1291], 18),\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 [('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('fault site untargeted clamp #1', [1000, 0, 0, 22, 503], 503),\n  ('fault site untargeted clamp #2', [1817, 170, 0, 27, 1161], 1161),\n  ('regression untargeted clamp #1', [9, 1, 0, 18, 1291], 18),\n  ('regression untargeted clamp #2', [3, 0, 0, 46, 987], 46),\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 [('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('regression untargeted clamp #1', [1, 71, 0, 40, 55], 40),\n  ('regression untargeted clamp #2', [9, 1, 0, 18, 1291], 18),\n  ('regression untargeted clamp #3', [1, 0, 0, 31, 1106], 31),\n  ('regression untargeted clamp #4', [1, 2, 0, 50, 1234], 50),\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 [('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('fault site untargeted clamp #1', [1000, 109, 0, 3, 331], 331),\n  ('regression untargeted clamp #1', [3, 0, 0, 46, 987], 46),\n  ('regression untargeted clamp #2', [1, 2, 0, 47, 1435], 47),\n  ('regression untargeted clamp #3', [9, 0, 0, 22, 719], 22),\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', [9, 0, 1, 47, 499], 47)],\n [('no target listed #1', [5, 3, 0, 10, 50], 10),\n  ('regression untargeted clamp #1', [1, 0, 0, 31, 1106], 31),\n  ('fault site untargeted clamp #1', [1000, 0, 0, 15, 739], 739),\n  ('regression untargeted clamp #2', [1, 0, 0, 4, 964], 4),\n  ('regression untargeted clamp #3', [1, 0, 0, 16, 930], 16),\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', [736, 68, 66, 28, 100], 100)]]\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-untargeted-clamp","generated_at":"2026-09-29T14:50:48.058766+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 no-target path returns the raw price.","sha256":"6d588088463f15c9528e879da6d7d8f2690e166bc942958c8d8850095f0a6498","title":"Daily market rebalance: Untargeted items skip the band · 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":40.034,"exit_code":1,"observations":[{"actual":5,"check":"no target listed #1","expected":10,"passed":false},{"actual":47,"check":"fault site untargeted clamp #1","expected":47,"passed":true},{"actual":503,"check":"fault site untargeted clamp #2","expected":503,"passed":true},{"actual":1,"check":"regression untargeted clamp #1","expected":40,"passed":false},{"actual":9,"check":"regression untargeted clamp #2","expected":18,"passed":false},{"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\": \"no target listed #1\", \"actual\": 5, \"expected\": 10, \"passed\": false}, {\"check\": \"fault site untargeted clamp #1\", \"actual\": 47, \"expected\": 47, \"passed\": true}, {\"check\": \"fault site untargeted clamp #2\", \"actual\": 503, \"expected\": 503, \"passed\": true}, {\"check\": \"regression untargeted clamp #1\", \"actual\": 1, \"expected\": 40, \"passed\": false}, {\"check\": \"regression untargeted clamp #2\", \"actual\": 9, \"expected\": 18, \"passed\": false}, {\"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.314,"exit_code":1,"observations":[{"actual":5,"check":"no target listed #1","expected":10,"passed":false},{"actual":1000,"check":"fault site untargeted clamp #1","expected":47,"passed":false},{"actual":1000,"check":"fault site untargeted clamp #2","expected":503,"passed":false},{"actual":1,"check":"regression untargeted clamp #1","expected":40,"passed":false},{"actual":9,"check":"regression untargeted clamp #2","expected":18,"passed":false},{"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\": \"no target listed #1\", \"actual\": 5, \"expected\": 10, \"passed\": false}, {\"check\": \"fault site untargeted clamp #1\", \"actual\": 1000, \"expected\": 47, \"passed\": false}, {\"check\": \"fault site untargeted clamp #2\", \"actual\": 1000, \"expected\": 503, \"passed\": false}, {\"check\": \"regression untargeted clamp #1\", \"actual\": 1, \"expected\": 40, \"passed\": false}, {\"check\": \"regression untargeted clamp #2\", \"actual\": 9, \"expected\": 18, \"passed\": false}, {\"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."}}