FAILURE MAP
← Case archive

FA-86141 / Game economy crafting balance / Open access

Repeatable quest rewards: Sixth completion pays full · case 01

The first diminished completion pays full reward.

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

ROOT CAUSE

The full-reward tier comparison is inclusive.

VERIFIED REPAIR

Restore `if k < 5:` at the full tier boundary step.

Unsuccessful approach: Shifting the index by one cuts the fifth completion to half.

Case contract

Completion k (0-based across the day, starting at done_today) pays tier 100% for k < 5, 50% for 5 <= k < 10, 0 after. Gap = player_level - quest_level: >= 5 pays 20%, >= 3 pays 60%, otherwise 100% (higher level quests are never penalized). Each reward = floor(base*tier*gap/10000). Returns the list of the next count rewards.

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(done_today, count, base, player_level, quest_level):
    if player_level - quest_level >= 5:
        gap = 20
    elif player_level - quest_level >= 3:
        gap = 60
    else:
        gap = 100
    out = []
    for k in range(done_today, done_today + count):
        if k <= 5:
            tier = 100
        elif k < 10:
            tier = 50
        else:
            tier = 0
        out.append(base * tier * gap // 10000)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('regression full tier boundary #1', [3, 4, 101, 31, 28], [60, 60, 30, 30]),
  ('regression full tier boundary #2', [3, 6, 99, 59, 64], [99, 99, 49, 49, 49, 49]),
  ('regression full tier boundary #3', [1, 6, 7, 45, 37], [1, 1, 1, 1, 0, 0]),
  ('regression full tier boundary #4', [2, 6, 99, 10, 9], [99, 99, 99, 49, 49, 49]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [6, 6, 215, 11, 12], [107, 107, 107, 107, 0, 0])],
 [('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('regression full tier boundary #1', [3, 6, 99, 59, 64], [99, 99, 49, 49, 49, 49]),
  ('regression full tier boundary #2', [1, 6, 7, 45, 37], [1, 1, 1, 1, 0, 0]),
  ('regression full tier boundary #3', [2, 6, 99, 10, 9], [99, 99, 99, 49, 49, 49]),
  ('regression full tier boundary #4', [2, 5, 7, 22, 25], [7, 7, 7, 3, 3]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [6, 6, 215, 11, 12], [107, 107, 107, 107, 0, 0])],
 [('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('regression full tier boundary #1', [2, 6, 99, 10, 9], [99, 99, 99, 49, 49, 49]),
  ('regression full tier boundary #2', [2, 5, 7, 22, 25], [7, 7, 7, 3, 3]),
  ('regression full tier boundary #3', [2, 6, 19, 24, 32], [19, 19, 19, 9, 9, 9]),
  ('partial repair boundary #1', [3, 2, 1, 60, 66], [1, 1]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [6, 6, 215, 11, 12], [107, 107, 107, 107, 0, 0])],
 [('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('regression full tier boundary #1', [2, 6, 19, 24, 32], [19, 19, 19, 9, 9, 9]),
  ('fault site full tier boundary #1', [5, 4, 99, 57, 56], [49, 49, 49, 49]),
  ('partial repair boundary #1', [3, 2, 1, 60, 66], [1, 1]),
  ('regression full tier boundary #2', [4, 6, 1, 4, 9], [1, 0, 0, 0, 0, 0]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [8, 2, 1, 33, 25], [0, 0])],
 [('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('regression full tier boundary #1', [4, 6, 1, 4, 9], [1, 0, 0, 0, 0, 0]),
  ('regression full tier boundary #2', [2, 4, 7, 16, 12], [4, 4, 4, 2]),
  ('regression full tier boundary #3', [3, 3, 3, 2, 5], [3, 3, 1]),
  ('regression full tier boundary #4', [2, 5, 7, 20, 16], [4, 4, 4, 2, 2]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [9, 4, 3, 24, 23], [1, 0, 0, 0])]]
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
crossing into half tier #1[101, 101, 101, 50][101, 101, 50, 50]Failed
regression full tier boundary #1[60, 60, 60, 30][60, 60, 30, 30]Failed
regression full tier boundary #2[99, 99, 99, 49, 49, 49][99, 99, 49, 49, 49, 49]Failed
regression full tier boundary #3[1, 1, 1, 1, 1, 0][1, 1, 1, 1, 0, 0]Failed
regression full tier boundary #4[99, 99, 99, 99, 49, 49][99, 99, 99, 49, 49, 49]Failed
gray quest #1[19, 19][19, 19]Passed
harder quest no penalty #1[25, 25, 0][25, 25, 0]Passed
control #1[107, 107, 107, 107, 0, 0][107, 107, 107, 107, 0, 0]Passed

SHA-256 / e7dea85d7b7e400f749af9a7265ff33dca0b4c84d63d9d0481773dcf178c0107

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(done_today, count, base, player_level, quest_level):
    if player_level - quest_level >= 5:
        gap = 20
    elif player_level - quest_level >= 3:
        gap = 60
    else:
        gap = 100
    out = []
    for k in range(done_today, done_today + count):
        if k + 1 < 5:
            tier = 100
        elif k < 10:
            tier = 50
        else:
            tier = 0
        out.append(base * tier * gap // 10000)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('regression full tier boundary #1', [3, 4, 101, 31, 28], [60, 60, 30, 30]),
  ('regression full tier boundary #2', [3, 6, 99, 59, 64], [99, 99, 49, 49, 49, 49]),
  ('regression full tier boundary #3', [1, 6, 7, 45, 37], [1, 1, 1, 1, 0, 0]),
  ('regression full tier boundary #4', [2, 6, 99, 10, 9], [99, 99, 99, 49, 49, 49]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [6, 6, 215, 11, 12], [107, 107, 107, 107, 0, 0])],
 [('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('regression full tier boundary #1', [3, 6, 99, 59, 64], [99, 99, 49, 49, 49, 49]),
  ('regression full tier boundary #2', [1, 6, 7, 45, 37], [1, 1, 1, 1, 0, 0]),
  ('regression full tier boundary #3', [2, 6, 99, 10, 9], [99, 99, 99, 49, 49, 49]),
  ('regression full tier boundary #4', [2, 5, 7, 22, 25], [7, 7, 7, 3, 3]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [6, 6, 215, 11, 12], [107, 107, 107, 107, 0, 0])],
 [('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('regression full tier boundary #1', [2, 6, 99, 10, 9], [99, 99, 99, 49, 49, 49]),
  ('regression full tier boundary #2', [2, 5, 7, 22, 25], [7, 7, 7, 3, 3]),
  ('regression full tier boundary #3', [2, 6, 19, 24, 32], [19, 19, 19, 9, 9, 9]),
  ('partial repair boundary #1', [3, 2, 1, 60, 66], [1, 1]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [6, 6, 215, 11, 12], [107, 107, 107, 107, 0, 0])],
 [('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('regression full tier boundary #1', [2, 6, 19, 24, 32], [19, 19, 19, 9, 9, 9]),
  ('fault site full tier boundary #1', [5, 4, 99, 57, 56], [49, 49, 49, 49]),
  ('partial repair boundary #1', [3, 2, 1, 60, 66], [1, 1]),
  ('regression full tier boundary #2', [4, 6, 1, 4, 9], [1, 0, 0, 0, 0, 0]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [8, 2, 1, 33, 25], [0, 0])],
 [('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('regression full tier boundary #1', [4, 6, 1, 4, 9], [1, 0, 0, 0, 0, 0]),
  ('regression full tier boundary #2', [2, 4, 7, 16, 12], [4, 4, 4, 2]),
  ('regression full tier boundary #3', [3, 3, 3, 2, 5], [3, 3, 1]),
  ('regression full tier boundary #4', [2, 5, 7, 20, 16], [4, 4, 4, 2, 2]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [9, 4, 3, 24, 23], [1, 0, 0, 0])]]
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
crossing into half tier #1[101, 50, 50, 50][101, 101, 50, 50]Failed
regression full tier boundary #1[60, 30, 30, 30][60, 60, 30, 30]Failed
regression full tier boundary #2[99, 49, 49, 49, 49, 49][99, 99, 49, 49, 49, 49]Failed
regression full tier boundary #3[1, 1, 1, 0, 0, 0][1, 1, 1, 1, 0, 0]Failed
regression full tier boundary #4[99, 99, 49, 49, 49, 49][99, 99, 99, 49, 49, 49]Failed
gray quest #1[19, 19][19, 19]Passed
harder quest no penalty #1[25, 25, 0][25, 25, 0]Passed
control #1[107, 107, 107, 107, 0, 0][107, 107, 107, 107, 0, 0]Passed

SHA-256 / ffa8975d51cd2a30d3d6d07ced48dd04558486fcbbe44a960e578f847551ba78

3 / The verified repair

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

N = 1
observations = []
def solve(done_today, count, base, player_level, quest_level):
    if player_level - quest_level >= 5:
        gap = 20
    elif player_level - quest_level >= 3:
        gap = 60
    else:
        gap = 100
    out = []
    for k in range(done_today, done_today + count):
        if k < 5:
            tier = 100
        elif k < 10:
            tier = 50
        else:
            tier = 0
        out.append(base * tier * gap // 10000)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('regression full tier boundary #1', [3, 4, 101, 31, 28], [60, 60, 30, 30]),
  ('regression full tier boundary #2', [3, 6, 99, 59, 64], [99, 99, 49, 49, 49, 49]),
  ('regression full tier boundary #3', [1, 6, 7, 45, 37], [1, 1, 1, 1, 0, 0]),
  ('regression full tier boundary #4', [2, 6, 99, 10, 9], [99, 99, 99, 49, 49, 49]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [6, 6, 215, 11, 12], [107, 107, 107, 107, 0, 0])],
 [('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('regression full tier boundary #1', [3, 6, 99, 59, 64], [99, 99, 49, 49, 49, 49]),
  ('regression full tier boundary #2', [1, 6, 7, 45, 37], [1, 1, 1, 1, 0, 0]),
  ('regression full tier boundary #3', [2, 6, 99, 10, 9], [99, 99, 99, 49, 49, 49]),
  ('regression full tier boundary #4', [2, 5, 7, 22, 25], [7, 7, 7, 3, 3]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [6, 6, 215, 11, 12], [107, 107, 107, 107, 0, 0])],
 [('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('regression full tier boundary #1', [2, 6, 99, 10, 9], [99, 99, 99, 49, 49, 49]),
  ('regression full tier boundary #2', [2, 5, 7, 22, 25], [7, 7, 7, 3, 3]),
  ('regression full tier boundary #3', [2, 6, 19, 24, 32], [19, 19, 19, 9, 9, 9]),
  ('partial repair boundary #1', [3, 2, 1, 60, 66], [1, 1]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [6, 6, 215, 11, 12], [107, 107, 107, 107, 0, 0])],
 [('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('regression full tier boundary #1', [2, 6, 19, 24, 32], [19, 19, 19, 9, 9, 9]),
  ('fault site full tier boundary #1', [5, 4, 99, 57, 56], [49, 49, 49, 49]),
  ('partial repair boundary #1', [3, 2, 1, 60, 66], [1, 1]),
  ('regression full tier boundary #2', [4, 6, 1, 4, 9], [1, 0, 0, 0, 0, 0]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [8, 2, 1, 33, 25], [0, 0])],
 [('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('regression full tier boundary #1', [4, 6, 1, 4, 9], [1, 0, 0, 0, 0, 0]),
  ('regression full tier boundary #2', [2, 4, 7, 16, 12], [4, 4, 4, 2]),
  ('regression full tier boundary #3', [3, 3, 3, 2, 5], [3, 3, 1]),
  ('regression full tier boundary #4', [2, 5, 7, 20, 16], [4, 4, 4, 2, 2]),
  ('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [9, 4, 3, 24, 23], [1, 0, 0, 0])]]
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
crossing into half tier #1[101, 101, 50, 50][101, 101, 50, 50]Passed
regression full tier boundary #1[60, 60, 30, 30][60, 60, 30, 30]Passed
regression full tier boundary #2[99, 99, 49, 49, 49, 49][99, 99, 49, 49, 49, 49]Passed
regression full tier boundary #3[1, 1, 1, 1, 0, 0][1, 1, 1, 1, 0, 0]Passed
regression full tier boundary #4[99, 99, 99, 49, 49, 49][99, 99, 99, 49, 49, 49]Passed
gray quest #1[19, 19][19, 19]Passed
harder quest no penalty #1[25, 25, 0][25, 25, 0]Passed
control #1[107, 107, 107, 107, 0, 0][107, 107, 107, 107, 0, 0]Passed

SHA-256 / 670720e7784a84dac4f0cabfdb430f8796fe1a44aef64f2a270205c747e5e1ec

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

Case digest / 0718f90b9987290693dbff695d263faf6682246b50de8f7cea28c847625358fd