FA-85901 / Game economy crafting balance / Open access
Salvage component return: Rare items lose their minimum return · case 01
Worn rare items can return zero of a component.
ROOT CAUSE
The minimum-one guarantee is applied only to epic items instead of all non-common rarities.
VERIFIED REPAIR
Restore `item['rarity'] != 'common'` at the rarity guarantee scope step.
Unsuccessful approach: Limiting the guarantee to multi-count components still drops single components of rare gear.
Case 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.
Why this case matters
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.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(item, components):
pct = {'common': 50, 'rare': 70, 'epic': 90}[item['rarity']]
mx = item['max_durability']
if mx == 0:
d, mx = 1, 1
else:
d = min(item['durability'], mx)
if d <= 0:
return {'scrap': 1}
out = {}
for name, count in components.items():
amt = count * pct * d // (100 * mx)
if item['rarity'] == 'epic' and amt < 1:
amt = 1
if amt:
out[name] = amt
return dict(sorted(out.items()))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 0}, {'cloth': 5, 'ingot': 4, 'shard': 1}],
{'cloth': 3, 'ingot': 2, 'shard': 1}),
('fault site rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 50}, {'ingot': 4, 'shard': 3}],
{'ingot': 1, 'shard': 1}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 1, 'max_durability': 50}, {'cloth': 1}],
{'cloth': 1}),
('partial repair boundary #2',
[{'rarity': 'epic', 'durability': 1, 'max_durability': 100}, {'cloth': 6, 'ingot': 1, 'thread': 3}],
{'cloth': 1, 'ingot': 1, 'thread': 1}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('control #1',
[{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],
{})],
[('fault site rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 20}, {'ingot': 3, 'shard': 3, 'thread': 5}],
{'ingot': 1, 'shard': 1, 'thread': 1}),
('fault site rarity guarantee scope #2',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 100}, {'cloth': 4}],
{'cloth': 1}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 1, 'max_durability': 100}, {'cloth': 6, 'ingot': 1, 'thread': 3}],
{'cloth': 1, 'ingot': 1, 'thread': 1}),
('regression rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 7, 'max_durability': 7}, {'ingot': 2, 'cloth': 3, 'thread': 1}],
{'cloth': 2, 'ingot': 1, 'thread': 1}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('control #1',
[{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],
{}),
('control #2', [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}], {'scrap': 1})],
[('fault site rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 2, 'max_durability': 7}, {'shard': 2, 'thread': 4, 'cloth': 2}],
{'cloth': 1, 'shard': 1, 'thread': 1}),
('regression rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 7, 'max_durability': 7}, {'ingot': 2, 'cloth': 3, 'thread': 1}],
{'cloth': 2, 'ingot': 1, 'thread': 1}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 7, 'max_durability': 7}, {'thread': 2, 'ingot': 1, 'cloth': 1}],
{'cloth': 1, 'ingot': 1, 'thread': 1}),
('regression rarity guarantee scope #2',
[{'rarity': 'rare', 'durability': 5, 'max_durability': 20}, {'cloth': 2, 'thread': 1}],
{'cloth': 1, 'thread': 1}),
('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('control #1', [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}], {'scrap': 1}),
('control #2',
[{'rarity': 'common', 'durability': 0, 'max_durability': 100}, {'cloth': 6, 'thread': 1}],
{'scrap': 1})],
[('regression rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 5, 'max_durability': 20}, {'cloth': 2, 'thread': 1}],
{'cloth': 1, 'thread': 1}),
('fault site rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 5, 'max_durability': 20}, {'cloth': 2, 'ingot': 4}],
{'cloth': 1, 'ingot': 1}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 31, 'max_durability': 100}, {'thread': 1, 'cloth': 4, 'shard': 6}],
{'cloth': 1, 'shard': 1, 'thread': 1}),
('regression rarity guarantee scope #2',
[{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'ingot': 5, 'thread': 2, 'shard': 1}],
{'ingot': 3, 'shard': 1, 'thread': 1}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('control #1',
[{'rarity': 'common', 'durability': 1, 'max_durability': 0}, {'shard': 2, 'ingot': 2, 'thread': 6}],
{'ingot': 1, 'shard': 1, 'thread': 3}),
('control #2',
[{'rarity': 'common', 'durability': 50, 'max_durability': 50}, {'thread': 1, 'ingot': 1}],
{})],
[('fault site rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 50}, {'cloth': 6}],
{'cloth': 1}),
('fault site rarity guarantee scope #2',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 7}, {'cloth': 2, 'ingot': 4, 'shard': 6}],
{'cloth': 1, 'ingot': 1, 'shard': 1}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 1, 'max_durability': 20}, {'ingot': 1, 'thread': 1}],
{'ingot': 1, 'thread': 1}),
('partial repair boundary #2',
[{'rarity': 'epic', 'durability': 3, 'max_durability': 50}, {'thread': 4, 'shard': 2, 'cloth': 1}],
{'cloth': 1, 'shard': 1, 'thread': 1}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('control #1', [{'rarity': 'epic', 'durability': 12, 'max_durability': 7}, {'ingot': 5}], {'ingot': 4}),
('control #2', [{'rarity': 'common', 'durability': 0, 'max_durability': 10}, {'thread': 3}], {'scrap': 1})]]
for label, args, expected in cases[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression rarity guarantee scope #1 | {'cloth': 3, 'ingot': 2} | {'cloth': 3, 'ingot': 2, 'shard': 1} | Failed |
| fault site rarity guarantee scope #1 | {} | {'ingot': 1, 'shard': 1} | Failed |
| partial repair boundary #1 | {'cloth': 1} | {'cloth': 1} | Passed |
| partial repair boundary #2 | {'cloth': 1, 'ingot': 1, 'thread': 1} | {'cloth': 1, 'ingot': 1, 'thread': 1} | Passed |
| indestructible relic #1 | {'shard': 4} | {'shard': 4} | Passed |
| over-repaired common #1 | {'cloth': 1, 'ingot': 2} | {'cloth': 1, 'ingot': 2} | Passed |
| broken rare #1 | {'scrap': 1} | {'scrap': 1} | Passed |
| control #1 | {} | {} | Passed |
SHA-256 / 8f642626113b4d2ddb7e11fb5b735cd23ea2fd649daeb94fca2926702c56e905
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(item, components):
pct = {'common': 50, 'rare': 70, 'epic': 90}[item['rarity']]
mx = item['max_durability']
if mx == 0:
d, mx = 1, 1
else:
d = min(item['durability'], mx)
if d <= 0:
return {'scrap': 1}
out = {}
for name, count in components.items():
amt = count * pct * d // (100 * mx)
if item['rarity'] != 'common' and count > 1 and amt < 1:
amt = 1
if amt:
out[name] = amt
return dict(sorted(out.items()))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 0}, {'cloth': 5, 'ingot': 4, 'shard': 1}],
{'cloth': 3, 'ingot': 2, 'shard': 1}),
('fault site rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 50}, {'ingot': 4, 'shard': 3}],
{'ingot': 1, 'shard': 1}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 1, 'max_durability': 50}, {'cloth': 1}],
{'cloth': 1}),
('partial repair boundary #2',
[{'rarity': 'epic', 'durability': 1, 'max_durability': 100}, {'cloth': 6, 'ingot': 1, 'thread': 3}],
{'cloth': 1, 'ingot': 1, 'thread': 1}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('control #1',
[{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],
{})],
[('fault site rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 20}, {'ingot': 3, 'shard': 3, 'thread': 5}],
{'ingot': 1, 'shard': 1, 'thread': 1}),
('fault site rarity guarantee scope #2',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 100}, {'cloth': 4}],
{'cloth': 1}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 1, 'max_durability': 100}, {'cloth': 6, 'ingot': 1, 'thread': 3}],
{'cloth': 1, 'ingot': 1, 'thread': 1}),
('regression rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 7, 'max_durability': 7}, {'ingot': 2, 'cloth': 3, 'thread': 1}],
{'cloth': 2, 'ingot': 1, 'thread': 1}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('control #1',
[{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],
{}),
('control #2', [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}], {'scrap': 1})],
[('fault site rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 2, 'max_durability': 7}, {'shard': 2, 'thread': 4, 'cloth': 2}],
{'cloth': 1, 'shard': 1, 'thread': 1}),
('regression rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 7, 'max_durability': 7}, {'ingot': 2, 'cloth': 3, 'thread': 1}],
{'cloth': 2, 'ingot': 1, 'thread': 1}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 7, 'max_durability': 7}, {'thread': 2, 'ingot': 1, 'cloth': 1}],
{'cloth': 1, 'ingot': 1, 'thread': 1}),
('regression rarity guarantee scope #2',
[{'rarity': 'rare', 'durability': 5, 'max_durability': 20}, {'cloth': 2, 'thread': 1}],
{'cloth': 1, 'thread': 1}),
('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('control #1', [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}], {'scrap': 1}),
('control #2',
[{'rarity': 'common', 'durability': 0, 'max_durability': 100}, {'cloth': 6, 'thread': 1}],
{'scrap': 1})],
[('regression rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 5, 'max_durability': 20}, {'cloth': 2, 'thread': 1}],
{'cloth': 1, 'thread': 1}),
('fault site rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 5, 'max_durability': 20}, {'cloth': 2, 'ingot': 4}],
{'cloth': 1, 'ingot': 1}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 31, 'max_durability': 100}, {'thread': 1, 'cloth': 4, 'shard': 6}],
{'cloth': 1, 'shard': 1, 'thread': 1}),
('regression rarity guarantee scope #2',
[{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'ingot': 5, 'thread': 2, 'shard': 1}],
{'ingot': 3, 'shard': 1, 'thread': 1}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('control #1',
[{'rarity': 'common', 'durability': 1, 'max_durability': 0}, {'shard': 2, 'ingot': 2, 'thread': 6}],
{'ingot': 1, 'shard': 1, 'thread': 3}),
('control #2',
[{'rarity': 'common', 'durability': 50, 'max_durability': 50}, {'thread': 1, 'ingot': 1}],
{})],
[('fault site rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 50}, {'cloth': 6}],
{'cloth': 1}),
('fault site rarity guarantee scope #2',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 7}, {'cloth': 2, 'ingot': 4, 'shard': 6}],
{'cloth': 1, 'ingot': 1, 'shard': 1}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 1, 'max_durability': 20}, {'ingot': 1, 'thread': 1}],
{'ingot': 1, 'thread': 1}),
('partial repair boundary #2',
[{'rarity': 'epic', 'durability': 3, 'max_durability': 50}, {'thread': 4, 'shard': 2, 'cloth': 1}],
{'cloth': 1, 'shard': 1, 'thread': 1}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('control #1', [{'rarity': 'epic', 'durability': 12, 'max_durability': 7}, {'ingot': 5}], {'ingot': 4}),
('control #2', [{'rarity': 'common', 'durability': 0, 'max_durability': 10}, {'thread': 3}], {'scrap': 1})]]
for label, args, expected in cases[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression rarity guarantee scope #1 | {'cloth': 3, 'ingot': 2} | {'cloth': 3, 'ingot': 2, 'shard': 1} | Failed |
| fault site rarity guarantee scope #1 | {'ingot': 1, 'shard': 1} | {'ingot': 1, 'shard': 1} | Passed |
| partial repair boundary #1 | {} | {'cloth': 1} | Failed |
| partial repair boundary #2 | {'cloth': 1, 'thread': 1} | {'cloth': 1, 'ingot': 1, 'thread': 1} | Failed |
| indestructible relic #1 | {'shard': 4} | {'shard': 4} | Passed |
| over-repaired common #1 | {'cloth': 1, 'ingot': 2} | {'cloth': 1, 'ingot': 2} | Passed |
| broken rare #1 | {'scrap': 1} | {'scrap': 1} | Passed |
| control #1 | {} | {} | Passed |
SHA-256 / aed086031eb93deb9dfb0b39ac1e05b0a77abb7033899190a5f8c2e7187209aa
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(item, components):
pct = {'common': 50, 'rare': 70, 'epic': 90}[item['rarity']]
mx = item['max_durability']
if mx == 0:
d, mx = 1, 1
else:
d = min(item['durability'], mx)
if d <= 0:
return {'scrap': 1}
out = {}
for name, count in components.items():
amt = count * pct * d // (100 * mx)
if item['rarity'] != 'common' and amt < 1:
amt = 1
if amt:
out[name] = amt
return dict(sorted(out.items()))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 0}, {'cloth': 5, 'ingot': 4, 'shard': 1}],
{'cloth': 3, 'ingot': 2, 'shard': 1}),
('fault site rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 50}, {'ingot': 4, 'shard': 3}],
{'ingot': 1, 'shard': 1}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 1, 'max_durability': 50}, {'cloth': 1}],
{'cloth': 1}),
('partial repair boundary #2',
[{'rarity': 'epic', 'durability': 1, 'max_durability': 100}, {'cloth': 6, 'ingot': 1, 'thread': 3}],
{'cloth': 1, 'ingot': 1, 'thread': 1}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('control #1',
[{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],
{})],
[('fault site rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 20}, {'ingot': 3, 'shard': 3, 'thread': 5}],
{'ingot': 1, 'shard': 1, 'thread': 1}),
('fault site rarity guarantee scope #2',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 100}, {'cloth': 4}],
{'cloth': 1}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 1, 'max_durability': 100}, {'cloth': 6, 'ingot': 1, 'thread': 3}],
{'cloth': 1, 'ingot': 1, 'thread': 1}),
('regression rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 7, 'max_durability': 7}, {'ingot': 2, 'cloth': 3, 'thread': 1}],
{'cloth': 2, 'ingot': 1, 'thread': 1}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('control #1',
[{'rarity': 'common', 'durability': 3, 'max_durability': 10}, {'thread': 4, 'cloth': 5}],
{}),
('control #2', [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}], {'scrap': 1})],
[('fault site rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 2, 'max_durability': 7}, {'shard': 2, 'thread': 4, 'cloth': 2}],
{'cloth': 1, 'shard': 1, 'thread': 1}),
('regression rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 7, 'max_durability': 7}, {'ingot': 2, 'cloth': 3, 'thread': 1}],
{'cloth': 2, 'ingot': 1, 'thread': 1}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 7, 'max_durability': 7}, {'thread': 2, 'ingot': 1, 'cloth': 1}],
{'cloth': 1, 'ingot': 1, 'thread': 1}),
('regression rarity guarantee scope #2',
[{'rarity': 'rare', 'durability': 5, 'max_durability': 20}, {'cloth': 2, 'thread': 1}],
{'cloth': 1, 'thread': 1}),
('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('control #1', [{'rarity': 'rare', 'durability': 0, 'max_durability': 100}, {'shard': 5}], {'scrap': 1}),
('control #2',
[{'rarity': 'common', 'durability': 0, 'max_durability': 100}, {'cloth': 6, 'thread': 1}],
{'scrap': 1})],
[('regression rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 5, 'max_durability': 20}, {'cloth': 2, 'thread': 1}],
{'cloth': 1, 'thread': 1}),
('fault site rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 5, 'max_durability': 20}, {'cloth': 2, 'ingot': 4}],
{'cloth': 1, 'ingot': 1}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 31, 'max_durability': 100}, {'thread': 1, 'cloth': 4, 'shard': 6}],
{'cloth': 1, 'shard': 1, 'thread': 1}),
('regression rarity guarantee scope #2',
[{'rarity': 'rare', 'durability': 25, 'max_durability': 20}, {'ingot': 5, 'thread': 2, 'shard': 1}],
{'ingot': 3, 'shard': 1, 'thread': 1}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('over-repaired common #1',
[{'rarity': 'common', 'durability': 30, 'max_durability': 20}, {'ingot': 4, 'cloth': 3}],
{'cloth': 1, 'ingot': 2}),
('control #1',
[{'rarity': 'common', 'durability': 1, 'max_durability': 0}, {'shard': 2, 'ingot': 2, 'thread': 6}],
{'ingot': 1, 'shard': 1, 'thread': 3}),
('control #2',
[{'rarity': 'common', 'durability': 50, 'max_durability': 50}, {'thread': 1, 'ingot': 1}],
{})],
[('fault site rarity guarantee scope #1',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 50}, {'cloth': 6}],
{'cloth': 1}),
('fault site rarity guarantee scope #2',
[{'rarity': 'rare', 'durability': 1, 'max_durability': 7}, {'cloth': 2, 'ingot': 4, 'shard': 6}],
{'cloth': 1, 'ingot': 1, 'shard': 1}),
('partial repair boundary #1',
[{'rarity': 'epic', 'durability': 1, 'max_durability': 20}, {'ingot': 1, 'thread': 1}],
{'ingot': 1, 'thread': 1}),
('partial repair boundary #2',
[{'rarity': 'epic', 'durability': 3, 'max_durability': 50}, {'thread': 4, 'shard': 2, 'cloth': 1}],
{'cloth': 1, 'shard': 1, 'thread': 1}),
('broken rare #1',
[{'rarity': 'rare', 'durability': 0, 'max_durability': 40}, {'thread': 2}],
{'scrap': 1}),
('indestructible relic #1',
[{'rarity': 'epic', 'durability': 0, 'max_durability': 0}, {'shard': 5}],
{'shard': 4}),
('control #1', [{'rarity': 'epic', 'durability': 12, 'max_durability': 7}, {'ingot': 5}], {'ingot': 4}),
('control #2', [{'rarity': 'common', 'durability': 0, 'max_durability': 10}, {'thread': 3}], {'scrap': 1})]]
for label, args, expected in cases[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression rarity guarantee scope #1 | {'cloth': 3, 'ingot': 2, 'shard': 1} | {'cloth': 3, 'ingot': 2, 'shard': 1} | Passed |
| fault site rarity guarantee scope #1 | {'ingot': 1, 'shard': 1} | {'ingot': 1, 'shard': 1} | Passed |
| partial repair boundary #1 | {'cloth': 1} | {'cloth': 1} | Passed |
| partial repair boundary #2 | {'cloth': 1, 'ingot': 1, 'thread': 1} | {'cloth': 1, 'ingot': 1, 'thread': 1} | Passed |
| indestructible relic #1 | {'shard': 4} | {'shard': 4} | Passed |
| over-repaired common #1 | {'cloth': 1, 'ingot': 2} | {'cloth': 1, 'ingot': 2} | Passed |
| broken rare #1 | {'scrap': 1} | {'scrap': 1} | Passed |
| control #1 | {} | {} | Passed |
SHA-256 / e69edd8103e4ea614fc4d776fee4d603c503e014e5a96ac3d1248262ae55e78e
Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:50:44.732447+00:00.
Case digest / dd8711c3f86d7192733a515aca2f793d45474cc447780f5cc95165360daa1861