FAILURE MAP
← Case archive

FA-86066 / Game economy crafting balance / Open access

Crafted quality tier: Novices can critically craft · case 01

Crafters below skill 25 still get critical upgrades.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The critical upgrade ignores the minimum skill requirement.

VERIFIED REPAIR

Restore `skill >= 25 and crit_roll < 5` at the critical skill gate step.

Unsuccessful approach: A strict skill comparison excludes crafters at exactly 25.

Case contract

materials = [[quality, weight], ...]. If total weight <= 0 the craft fails (score 0, tier "failed"). score = floor(sum(q*w)/sum(w)) + skill//10, capped at 100. Tier index = number of cutoffs [40, 65, 85] with score >= cutoff over [common, fine, superior, masterwork]. A critical craft (skill >= 25 and crit_roll < 5) raises the tier by one, never above masterwork.

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(materials, skill, crit_roll):
    tiers = ['common', 'fine', 'superior', 'masterwork']
    cuts = [40, 65, 85]
    total_w = sum(w for q, w in materials)
    if total_w <= 0:
        return {'score': 0, 'tier': 'failed'}
    score = sum(q * w for q, w in materials) // total_w + skill // 10
    score = min(100, score)
    t = sum(1 for c in cuts if score >= c)
    if crit_roll < 5:
        t = min(t + 1, len(tiers) - 1)
    return {'score': score, 'tier': tiers[t]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('fault site critical skill gate #1', [[[58, 0], [40, 0], [58, 1]], 9, 0], {'score': 58, 'tier': 'fine'}),
  ('fault site critical skill gate #2', [[[0, 0], [64, 3]], 0, 0], {'score': 64, 'tier': 'fine'}),
  ('partial repair boundary #1', [[[0, 1], [0, 3], [40, 0]], 25, 0], {'score': 2, 'tier': 'fine'}),
  ('partial repair boundary #2', [[[65, 3], [39, 0]], 25, 4], {'score': 67, 'tier': 'masterwork'}),
  ('heavy rare material #1', [[[90, 3], [30, 1]], 0, 50], {'score': 75, 'tier': 'superior'}),
  ('score exactly fine cutoff #1', [[[40, 1]], 0, 99], {'score': 40, 'tier': 'fine'}),
  ('masterwork crit #1', [[[100, 2]], 50, 0], {'score': 100, 'tier': 'masterwork'}),
  ('control #1', [[[39, 1]], 10, 50], {'score': 40, 'tier': 'fine'})],
 [('fault site critical skill gate #1', [[[30, 1], [0, 1], [84, 1]], 10, 4], {'score': 39, 'tier': 'common'}),
  ('fault site critical skill gate #2',
   [[[64, 2], [69, 2], [65, 2], [89, 1]], 9, 4],
   {'score': 69, 'tier': 'superior'}),
  ('partial repair boundary #1', [[[85, 0], [84, 2], [39, 1]], 25, 0], {'score': 71, 'tier': 'masterwork'}),
  ('partial repair boundary #2', [[[0, 3], [39, 1]], 25, 0], {'score': 11, 'tier': 'fine'}),
  ('masterwork crit #1', [[[100, 2]], 50, 0], {'score': 100, 'tier': 'masterwork'}),
  ('heavy rare material #1', [[[90, 3], [30, 1]], 0, 50], {'score': 75, 'tier': 'superior'}),
  ('control #1', [[[39, 1]], 10, 50], {'score': 40, 'tier': 'fine'}),
  ('control #2', [[[39, 1], [100, 3], [85, 1]], 26, 5], {'score': 86, 'tier': 'masterwork'})],
 [('fault site critical skill gate #1',
   [[[91, 0], [100, 1], [85, 1], [39, 3]], 10, 0],
   {'score': 61, 'tier': 'fine'}),
  ('fault site critical skill gate #2', [[[40, 2], [84, 1]], 24, 0], {'score': 56, 'tier': 'fine'}),
  ('partial repair boundary #1', [[[64, 1], [100, 0], [79, 1]], 25, 0], {'score': 73, 'tier': 'masterwork'}),
  ('partial repair boundary #2', [[[84, 1], [65, 2]], 25, 0], {'score': 73, 'tier': 'masterwork'}),
  ('score exactly fine cutoff #1', [[[40, 1]], 0, 99], {'score': 40, 'tier': 'fine'}),
  ('masterwork crit #1', [[[100, 2]], 50, 0], {'score': 100, 'tier': 'masterwork'}),
  ('control #1', [[[39, 1], [100, 3], [85, 1]], 26, 5], {'score': 86, 'tier': 'masterwork'}),
  ('control #2', [[[39, 3], [85, 0]], 52, 0], {'score': 44, 'tier': 'superior'})],
 [('fault site critical skill gate #1', [[[64, 3]], 24, 4], {'score': 66, 'tier': 'superior'}),
  ('fault site critical skill gate #2', [[[85, 0], [39, 2], [39, 3]], 0, 4], {'score': 39, 'tier': 'common'}),
  ('partial repair boundary #1', [[[100, 1], [85, 0], [65, 3]], 25, 4], {'score': 75, 'tier': 'masterwork'}),
  ('partial repair boundary #2', [[[0, 2]], 25, 0], {'score': 2, 'tier': 'fine'}),
  ('heavy rare material #1', [[[90, 3], [30, 1]], 0, 50], {'score': 75, 'tier': 'superior'}),
  ('score exactly fine cutoff #1', [[[40, 1]], 0, 99], {'score': 40, 'tier': 'fine'}),
  ('control #1', [[[39, 1]], 25, 5], {'score': 41, 'tier': 'fine'}),
  ('control #2', [[[39, 0]], 24, 28], {'score': 0, 'tier': 'failed'})],
 [('fault site critical skill gate #1',
   [[[39, 3], [40, 1], [84, 1], [85, 1]], 24, 0],
   {'score': 56, 'tier': 'fine'}),
  ('fault site critical skill gate #2', [[[65, 1]], 0, 0], {'score': 65, 'tier': 'superior'}),
  ('partial repair boundary #1',
   [[[64, 1], [84, 0], [100, 1], [65, 1]], 25, 0],
   {'score': 78, 'tier': 'masterwork'}),
  ('partial repair boundary #2', [[[64, 1], [65, 0], [0, 3], [64, 0]], 25, 0], {'score': 18, 'tier': 'fine'}),
  ('masterwork crit #1', [[[100, 2]], 50, 0], {'score': 100, 'tier': 'masterwork'}),
  ('heavy rare material #1', [[[90, 3], [30, 1]], 0, 50], {'score': 75, 'tier': 'superior'}),
  ('control #1', [[[0, 3]], 25, 5], {'score': 2, 'tier': 'common'}),
  ('control #2', [[[100, 1], [65, 3], [40, 1], [39, 1]], 99, 4], {'score': 71, 'tier': 'masterwork'})]]
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 fixtureActualExpectedOutcome
fault site critical skill gate #1{'score': 58, 'tier': 'superior'}{'score': 58, 'tier': 'fine'}Failed
fault site critical skill gate #2{'score': 64, 'tier': 'superior'}{'score': 64, 'tier': 'fine'}Failed
partial repair boundary #1{'score': 2, 'tier': 'fine'}{'score': 2, 'tier': 'fine'}Passed
partial repair boundary #2{'score': 67, 'tier': 'masterwork'}{'score': 67, 'tier': 'masterwork'}Passed
heavy rare material #1{'score': 75, 'tier': 'superior'}{'score': 75, 'tier': 'superior'}Passed
score exactly fine cutoff #1{'score': 40, 'tier': 'fine'}{'score': 40, 'tier': 'fine'}Passed
masterwork crit #1{'score': 100, 'tier': 'masterwork'}{'score': 100, 'tier': 'masterwork'}Passed
control #1{'score': 40, 'tier': 'fine'}{'score': 40, 'tier': 'fine'}Passed

SHA-256 / d0ac2e5698adad1171ba3cf0a5d712f8f04ac962ece72205719271723b82eb40

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(materials, skill, crit_roll):
    tiers = ['common', 'fine', 'superior', 'masterwork']
    cuts = [40, 65, 85]
    total_w = sum(w for q, w in materials)
    if total_w <= 0:
        return {'score': 0, 'tier': 'failed'}
    score = sum(q * w for q, w in materials) // total_w + skill // 10
    score = min(100, score)
    t = sum(1 for c in cuts if score >= c)
    if skill > 25 and crit_roll < 5:
        t = min(t + 1, len(tiers) - 1)
    return {'score': score, 'tier': tiers[t]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('fault site critical skill gate #1', [[[58, 0], [40, 0], [58, 1]], 9, 0], {'score': 58, 'tier': 'fine'}),
  ('fault site critical skill gate #2', [[[0, 0], [64, 3]], 0, 0], {'score': 64, 'tier': 'fine'}),
  ('partial repair boundary #1', [[[0, 1], [0, 3], [40, 0]], 25, 0], {'score': 2, 'tier': 'fine'}),
  ('partial repair boundary #2', [[[65, 3], [39, 0]], 25, 4], {'score': 67, 'tier': 'masterwork'}),
  ('heavy rare material #1', [[[90, 3], [30, 1]], 0, 50], {'score': 75, 'tier': 'superior'}),
  ('score exactly fine cutoff #1', [[[40, 1]], 0, 99], {'score': 40, 'tier': 'fine'}),
  ('masterwork crit #1', [[[100, 2]], 50, 0], {'score': 100, 'tier': 'masterwork'}),
  ('control #1', [[[39, 1]], 10, 50], {'score': 40, 'tier': 'fine'})],
 [('fault site critical skill gate #1', [[[30, 1], [0, 1], [84, 1]], 10, 4], {'score': 39, 'tier': 'common'}),
  ('fault site critical skill gate #2',
   [[[64, 2], [69, 2], [65, 2], [89, 1]], 9, 4],
   {'score': 69, 'tier': 'superior'}),
  ('partial repair boundary #1', [[[85, 0], [84, 2], [39, 1]], 25, 0], {'score': 71, 'tier': 'masterwork'}),
  ('partial repair boundary #2', [[[0, 3], [39, 1]], 25, 0], {'score': 11, 'tier': 'fine'}),
  ('masterwork crit #1', [[[100, 2]], 50, 0], {'score': 100, 'tier': 'masterwork'}),
  ('heavy rare material #1', [[[90, 3], [30, 1]], 0, 50], {'score': 75, 'tier': 'superior'}),
  ('control #1', [[[39, 1]], 10, 50], {'score': 40, 'tier': 'fine'}),
  ('control #2', [[[39, 1], [100, 3], [85, 1]], 26, 5], {'score': 86, 'tier': 'masterwork'})],
 [('fault site critical skill gate #1',
   [[[91, 0], [100, 1], [85, 1], [39, 3]], 10, 0],
   {'score': 61, 'tier': 'fine'}),
  ('fault site critical skill gate #2', [[[40, 2], [84, 1]], 24, 0], {'score': 56, 'tier': 'fine'}),
  ('partial repair boundary #1', [[[64, 1], [100, 0], [79, 1]], 25, 0], {'score': 73, 'tier': 'masterwork'}),
  ('partial repair boundary #2', [[[84, 1], [65, 2]], 25, 0], {'score': 73, 'tier': 'masterwork'}),
  ('score exactly fine cutoff #1', [[[40, 1]], 0, 99], {'score': 40, 'tier': 'fine'}),
  ('masterwork crit #1', [[[100, 2]], 50, 0], {'score': 100, 'tier': 'masterwork'}),
  ('control #1', [[[39, 1], [100, 3], [85, 1]], 26, 5], {'score': 86, 'tier': 'masterwork'}),
  ('control #2', [[[39, 3], [85, 0]], 52, 0], {'score': 44, 'tier': 'superior'})],
 [('fault site critical skill gate #1', [[[64, 3]], 24, 4], {'score': 66, 'tier': 'superior'}),
  ('fault site critical skill gate #2', [[[85, 0], [39, 2], [39, 3]], 0, 4], {'score': 39, 'tier': 'common'}),
  ('partial repair boundary #1', [[[100, 1], [85, 0], [65, 3]], 25, 4], {'score': 75, 'tier': 'masterwork'}),
  ('partial repair boundary #2', [[[0, 2]], 25, 0], {'score': 2, 'tier': 'fine'}),
  ('heavy rare material #1', [[[90, 3], [30, 1]], 0, 50], {'score': 75, 'tier': 'superior'}),
  ('score exactly fine cutoff #1', [[[40, 1]], 0, 99], {'score': 40, 'tier': 'fine'}),
  ('control #1', [[[39, 1]], 25, 5], {'score': 41, 'tier': 'fine'}),
  ('control #2', [[[39, 0]], 24, 28], {'score': 0, 'tier': 'failed'})],
 [('fault site critical skill gate #1',
   [[[39, 3], [40, 1], [84, 1], [85, 1]], 24, 0],
   {'score': 56, 'tier': 'fine'}),
  ('fault site critical skill gate #2', [[[65, 1]], 0, 0], {'score': 65, 'tier': 'superior'}),
  ('partial repair boundary #1',
   [[[64, 1], [84, 0], [100, 1], [65, 1]], 25, 0],
   {'score': 78, 'tier': 'masterwork'}),
  ('partial repair boundary #2', [[[64, 1], [65, 0], [0, 3], [64, 0]], 25, 0], {'score': 18, 'tier': 'fine'}),
  ('masterwork crit #1', [[[100, 2]], 50, 0], {'score': 100, 'tier': 'masterwork'}),
  ('heavy rare material #1', [[[90, 3], [30, 1]], 0, 50], {'score': 75, 'tier': 'superior'}),
  ('control #1', [[[0, 3]], 25, 5], {'score': 2, 'tier': 'common'}),
  ('control #2', [[[100, 1], [65, 3], [40, 1], [39, 1]], 99, 4], {'score': 71, 'tier': 'masterwork'})]]
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 fixtureActualExpectedOutcome
fault site critical skill gate #1{'score': 58, 'tier': 'fine'}{'score': 58, 'tier': 'fine'}Passed
fault site critical skill gate #2{'score': 64, 'tier': 'fine'}{'score': 64, 'tier': 'fine'}Passed
partial repair boundary #1{'score': 2, 'tier': 'common'}{'score': 2, 'tier': 'fine'}Failed
partial repair boundary #2{'score': 67, 'tier': 'superior'}{'score': 67, 'tier': 'masterwork'}Failed
heavy rare material #1{'score': 75, 'tier': 'superior'}{'score': 75, 'tier': 'superior'}Passed
score exactly fine cutoff #1{'score': 40, 'tier': 'fine'}{'score': 40, 'tier': 'fine'}Passed
masterwork crit #1{'score': 100, 'tier': 'masterwork'}{'score': 100, 'tier': 'masterwork'}Passed
control #1{'score': 40, 'tier': 'fine'}{'score': 40, 'tier': 'fine'}Passed

SHA-256 / fcd938310c18cdccafd3aab04359c87e92b8d373fcb19c443cf0294d07823624

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(materials, skill, crit_roll):
    tiers = ['common', 'fine', 'superior', 'masterwork']
    cuts = [40, 65, 85]
    total_w = sum(w for q, w in materials)
    if total_w <= 0:
        return {'score': 0, 'tier': 'failed'}
    score = sum(q * w for q, w in materials) // total_w + skill // 10
    score = min(100, score)
    t = sum(1 for c in cuts if score >= c)
    if skill >= 25 and crit_roll < 5:
        t = min(t + 1, len(tiers) - 1)
    return {'score': score, 'tier': tiers[t]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('fault site critical skill gate #1', [[[58, 0], [40, 0], [58, 1]], 9, 0], {'score': 58, 'tier': 'fine'}),
  ('fault site critical skill gate #2', [[[0, 0], [64, 3]], 0, 0], {'score': 64, 'tier': 'fine'}),
  ('partial repair boundary #1', [[[0, 1], [0, 3], [40, 0]], 25, 0], {'score': 2, 'tier': 'fine'}),
  ('partial repair boundary #2', [[[65, 3], [39, 0]], 25, 4], {'score': 67, 'tier': 'masterwork'}),
  ('heavy rare material #1', [[[90, 3], [30, 1]], 0, 50], {'score': 75, 'tier': 'superior'}),
  ('score exactly fine cutoff #1', [[[40, 1]], 0, 99], {'score': 40, 'tier': 'fine'}),
  ('masterwork crit #1', [[[100, 2]], 50, 0], {'score': 100, 'tier': 'masterwork'}),
  ('control #1', [[[39, 1]], 10, 50], {'score': 40, 'tier': 'fine'})],
 [('fault site critical skill gate #1', [[[30, 1], [0, 1], [84, 1]], 10, 4], {'score': 39, 'tier': 'common'}),
  ('fault site critical skill gate #2',
   [[[64, 2], [69, 2], [65, 2], [89, 1]], 9, 4],
   {'score': 69, 'tier': 'superior'}),
  ('partial repair boundary #1', [[[85, 0], [84, 2], [39, 1]], 25, 0], {'score': 71, 'tier': 'masterwork'}),
  ('partial repair boundary #2', [[[0, 3], [39, 1]], 25, 0], {'score': 11, 'tier': 'fine'}),
  ('masterwork crit #1', [[[100, 2]], 50, 0], {'score': 100, 'tier': 'masterwork'}),
  ('heavy rare material #1', [[[90, 3], [30, 1]], 0, 50], {'score': 75, 'tier': 'superior'}),
  ('control #1', [[[39, 1]], 10, 50], {'score': 40, 'tier': 'fine'}),
  ('control #2', [[[39, 1], [100, 3], [85, 1]], 26, 5], {'score': 86, 'tier': 'masterwork'})],
 [('fault site critical skill gate #1',
   [[[91, 0], [100, 1], [85, 1], [39, 3]], 10, 0],
   {'score': 61, 'tier': 'fine'}),
  ('fault site critical skill gate #2', [[[40, 2], [84, 1]], 24, 0], {'score': 56, 'tier': 'fine'}),
  ('partial repair boundary #1', [[[64, 1], [100, 0], [79, 1]], 25, 0], {'score': 73, 'tier': 'masterwork'}),
  ('partial repair boundary #2', [[[84, 1], [65, 2]], 25, 0], {'score': 73, 'tier': 'masterwork'}),
  ('score exactly fine cutoff #1', [[[40, 1]], 0, 99], {'score': 40, 'tier': 'fine'}),
  ('masterwork crit #1', [[[100, 2]], 50, 0], {'score': 100, 'tier': 'masterwork'}),
  ('control #1', [[[39, 1], [100, 3], [85, 1]], 26, 5], {'score': 86, 'tier': 'masterwork'}),
  ('control #2', [[[39, 3], [85, 0]], 52, 0], {'score': 44, 'tier': 'superior'})],
 [('fault site critical skill gate #1', [[[64, 3]], 24, 4], {'score': 66, 'tier': 'superior'}),
  ('fault site critical skill gate #2', [[[85, 0], [39, 2], [39, 3]], 0, 4], {'score': 39, 'tier': 'common'}),
  ('partial repair boundary #1', [[[100, 1], [85, 0], [65, 3]], 25, 4], {'score': 75, 'tier': 'masterwork'}),
  ('partial repair boundary #2', [[[0, 2]], 25, 0], {'score': 2, 'tier': 'fine'}),
  ('heavy rare material #1', [[[90, 3], [30, 1]], 0, 50], {'score': 75, 'tier': 'superior'}),
  ('score exactly fine cutoff #1', [[[40, 1]], 0, 99], {'score': 40, 'tier': 'fine'}),
  ('control #1', [[[39, 1]], 25, 5], {'score': 41, 'tier': 'fine'}),
  ('control #2', [[[39, 0]], 24, 28], {'score': 0, 'tier': 'failed'})],
 [('fault site critical skill gate #1',
   [[[39, 3], [40, 1], [84, 1], [85, 1]], 24, 0],
   {'score': 56, 'tier': 'fine'}),
  ('fault site critical skill gate #2', [[[65, 1]], 0, 0], {'score': 65, 'tier': 'superior'}),
  ('partial repair boundary #1',
   [[[64, 1], [84, 0], [100, 1], [65, 1]], 25, 0],
   {'score': 78, 'tier': 'masterwork'}),
  ('partial repair boundary #2', [[[64, 1], [65, 0], [0, 3], [64, 0]], 25, 0], {'score': 18, 'tier': 'fine'}),
  ('masterwork crit #1', [[[100, 2]], 50, 0], {'score': 100, 'tier': 'masterwork'}),
  ('heavy rare material #1', [[[90, 3], [30, 1]], 0, 50], {'score': 75, 'tier': 'superior'}),
  ('control #1', [[[0, 3]], 25, 5], {'score': 2, 'tier': 'common'}),
  ('control #2', [[[100, 1], [65, 3], [40, 1], [39, 1]], 99, 4], {'score': 71, 'tier': 'masterwork'})]]
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 fixtureActualExpectedOutcome
fault site critical skill gate #1{'score': 58, 'tier': 'fine'}{'score': 58, 'tier': 'fine'}Passed
fault site critical skill gate #2{'score': 64, 'tier': 'fine'}{'score': 64, 'tier': 'fine'}Passed
partial repair boundary #1{'score': 2, 'tier': 'fine'}{'score': 2, 'tier': 'fine'}Passed
partial repair boundary #2{'score': 67, 'tier': 'masterwork'}{'score': 67, 'tier': 'masterwork'}Passed
heavy rare material #1{'score': 75, 'tier': 'superior'}{'score': 75, 'tier': 'superior'}Passed
score exactly fine cutoff #1{'score': 40, 'tier': 'fine'}{'score': 40, 'tier': 'fine'}Passed
masterwork crit #1{'score': 100, 'tier': 'masterwork'}{'score': 100, 'tier': 'masterwork'}Passed
control #1{'score': 40, 'tier': 'fine'}{'score': 40, 'tier': 'fine'}Passed

SHA-256 / 737443f71acee11150233f26a54fe1af4dacc301724c899afda7b8b8ef050da2

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:46.127026+00:00.

Case digest / 1176406c1875141a7e5f37fed28d0dfe7b21a2bd6be5dff8ff3fd4c8e1b1771d