{"abstract":"A single sell-out day multiplies the price.","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":"Measuring excess against sales understates moderate rises.","family":"w2-game-economy-crafting-balance-market-rebalance-rise-cap","id":"FA-86256","implementations":{"attempt":{"sha256":"d636b51c08f9a19cff388868ac718e4618e0202aab6ff048b1114b04953f6775","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 // sold)\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 = [[('fault site rise cap #1', [99, 1188, 396, 6, 782], 118),\n  ('fault site rise cap #2', [50, 15, 5, 43, 185], 60),\n  ('partial repair boundary #1', [50, 11, 10, 38, 410], 55),\n  ('partial repair boundary #2', [99, 42, 40, 39, 750], 103),\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', [9, 0, 1, 47, 499], 47)],\n [('fault site rise cap #1', [99, 267, 89, 48, 886], 118),\n  ('fault site rise cap #2', [99, 3, 1, 22, 530], 118),\n  ('partial repair boundary #1', [1000, 6, 5, 49, 1369], 1200),\n  ('partial repair boundary #2', [99, 11, 10, 44, 1070], 108),\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', [9, 0, 1, 47, 499], 47),\n  ('control #2', [1000, 0, 0, 7, 47], 47)],\n [('fault site rise cap #1', [1000, 75, 40, 44, 1496], 1200),\n  ('fault site rise cap #2', [328, 7, 5, 6, 879], 393),\n  ('partial repair boundary #1', [50, 11, 10, 1, 1404], 55),\n  ('partial repair boundary #2', [99, 6, 5, 12, 1409], 118),\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', [736, 68, 66, 28, 100], 100)],\n [('fault site rise cap #1', [99, 3, 1, 49, 695], 118),\n  ('fault site rise cap #2', [50, 1524, 508, 24, 1269], 60),\n  ('partial repair boundary #1', [1000, 11, 10, 18, 1162], 1100),\n  ('partial repair boundary #2', [50, 100, 87, 39, 122], 57),\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', [3, 75, 76, 12, 1170], 12),\n  ('control #2', [1000, 5, 5, 37, 1007], 1000)],\n [('fault site rise cap #1', [99, 210, 70, 40, 1422], 118),\n  ('fault site rise cap #2', [99, 191, 5, 22, 1290], 118),\n  ('partial repair boundary #1', [99, 6, 5, 33, 381], 118),\n  ('partial repair boundary #2', [620, 11, 10, 41, 806], 682),\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, 5, 5, 44, 212], 99),\n  ('control #2', [99, -1, 0, 37, 260], 99)]]\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":"22759f5c8d57adb239bdbf014200380a7dee813e3991c44b9f1bfcdd340d3187","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 = (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 = [[('fault site rise cap #1', [99, 1188, 396, 6, 782], 118),\n  ('fault site rise cap #2', [50, 15, 5, 43, 185], 60),\n  ('partial repair boundary #1', [50, 11, 10, 38, 410], 55),\n  ('partial repair boundary #2', [99, 42, 40, 39, 750], 103),\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', [9, 0, 1, 47, 499], 47)],\n [('fault site rise cap #1', [99, 267, 89, 48, 886], 118),\n  ('fault site rise cap #2', [99, 3, 1, 22, 530], 118),\n  ('partial repair boundary #1', [1000, 6, 5, 49, 1369], 1200),\n  ('partial repair boundary #2', [99, 11, 10, 44, 1070], 108),\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', [9, 0, 1, 47, 499], 47),\n  ('control #2', [1000, 0, 0, 7, 47], 47)],\n [('fault site rise cap #1', [1000, 75, 40, 44, 1496], 1200),\n  ('fault site rise cap #2', [328, 7, 5, 6, 879], 393),\n  ('partial repair boundary #1', [50, 11, 10, 1, 1404], 55),\n  ('partial repair boundary #2', [99, 6, 5, 12, 1409], 118),\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', [736, 68, 66, 28, 100], 100)],\n [('fault site rise cap #1', [99, 3, 1, 49, 695], 118),\n  ('fault site rise cap #2', [50, 1524, 508, 24, 1269], 60),\n  ('partial repair boundary #1', [1000, 11, 10, 18, 1162], 1100),\n  ('partial repair boundary #2', [50, 100, 87, 39, 122], 57),\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', [3, 75, 76, 12, 1170], 12),\n  ('control #2', [1000, 5, 5, 37, 1007], 1000)],\n [('fault site rise cap #1', [99, 210, 70, 40, 1422], 118),\n  ('fault site rise cap #2', [99, 191, 5, 22, 1290], 118),\n  ('partial repair boundary #1', [99, 6, 5, 33, 381], 118),\n  ('partial repair boundary #2', [620, 11, 10, 41, 806], 682),\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, 5, 5, 44, 212], 99),\n  ('control #2', [99, -1, 0, 37, 260], 99)]]\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-rise-cap","generated_at":"2026-09-29T14:50:47.977138+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 daily rise percentage has no 20% cap.","sha256":"f25c3d4fe0740960fc4a92cf284441945570668021046a34f79ece01da08ee3b","title":"Daily market rebalance: Price spikes are uncapped · 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":43.479,"exit_code":1,"observations":[{"actual":118,"check":"fault site rise cap #1","expected":118,"passed":true},{"actual":60,"check":"fault site rise cap #2","expected":60,"passed":true},{"actual":54,"check":"partial repair boundary #1","expected":55,"passed":false},{"actual":102,"check":"partial repair boundary #2","expected":103,"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":47,"check":"control #1","expected":47,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fault site rise cap #1\", \"actual\": 118, \"expected\": 118, \"passed\": true}, {\"check\": \"fault site rise cap #2\", \"actual\": 60, \"expected\": 60, \"passed\": true}, {\"check\": \"partial repair boundary #1\", \"actual\": 54, \"expected\": 55, \"passed\": false}, {\"check\": \"partial repair boundary #2\", \"actual\": 102, \"expected\": 103, \"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\": 47, \"expected\": 47, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.201,"exit_code":1,"observations":[{"actual":297,"check":"fault site rise cap #1","expected":118,"passed":false},{"actual":150,"check":"fault site rise cap #2","expected":60,"passed":false},{"actual":55,"check":"partial repair boundary #1","expected":55,"passed":true},{"actual":103,"check":"partial repair boundary #2","expected":103,"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":47,"check":"control #1","expected":47,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fault site rise cap #1\", \"actual\": 297, \"expected\": 118, \"passed\": false}, {\"check\": \"fault site rise cap #2\", \"actual\": 150, \"expected\": 60, \"passed\": false}, {\"check\": \"partial repair boundary #1\", \"actual\": 55, \"expected\": 55, \"passed\": true}, {\"check\": \"partial repair boundary #2\", \"actual\": 103, \"expected\": 103, \"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\": 47, \"expected\": 47, \"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."}}