FAILURE MAP
← Case archive

FA-86156 / Game economy crafting balance / Open access

Repeatable quest rewards: Gray penalty is shadowed by the green branch · case 01

Gray quests pay the 60% green reward.

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

ROOT CAUSE

The wider gap test comes first, so the gray branch is unreachable.

VERIFIED REPAIR

Restore `if player_level - quest_level >= 5: gap = 20 elif player_level - quest_level >= 3: gap = 60` at the gap tier ordering step.

Unsuccessful approach: Shifting the green threshold does not restore the 3-level rule.

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 >= 3:
        gap = 60
    elif player_level - quest_level >= 5:
        gap = 20
    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 = [[('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gap tier ordering #1', [1, 6, 7, 45, 37], [1, 1, 1, 1, 0, 0]),
  ('fault site gap tier ordering #2', [9, 5, 101, 15, 10], [10, 0, 0, 0, 0]),
  ('partial repair boundary #1', [3, 4, 101, 31, 28], [60, 60, 30, 30]),
  ('partial repair boundary #2', [3, 5, 3, 32, 29], [1, 1, 0, 0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('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])],
 [('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gap tier ordering #1', [9, 5, 101, 15, 10], [10, 0, 0, 0, 0]),
  ('fault site gap tier ordering #2', [6, 2, 364, 55, 48], [36, 36]),
  ('partial repair boundary #1', [5, 5, 273, 47, 44], [81, 81, 81, 81, 81]),
  ('partial repair boundary #2', [6, 6, 3, 49, 46], [0, 0, 0, 0, 0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('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])],
 [('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gap tier ordering #1', [8, 5, 101, 53, 48], [10, 10, 0, 0, 0]),
  ('fault site gap tier ordering #2', [8, 5, 99, 31, 25], [9, 9, 0, 0, 0]),
  ('partial repair boundary #1', [1, 2, 101, 59, 56], [60, 60]),
  ('partial repair boundary #2', [3, 6, 7, 49, 46], [4, 4, 2, 2, 2, 2]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('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])],
 [('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gap tier ordering #1', [0, 1, 99, 15, 8], [19]),
  ('fault site gap tier ordering #2', [3, 6, 469, 32, 26], [93, 93, 46, 46, 46, 46]),
  ('partial repair boundary #1', [2, 2, 1, 30, 27], [0, 0]),
  ('partial repair boundary #2', [2, 2, 1, 55, 52], [0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [8, 2, 1, 33, 25], [0, 0])],
 [('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gap tier ordering #1', [6, 6, 99, 40, 35], [9, 9, 9, 9, 0, 0]),
  ('fault site gap tier ordering #2', [9, 5, 99, 15, 7], [9, 0, 0, 0, 0]),
  ('partial repair boundary #1', [4, 5, 99, 41, 38], [59, 29, 29, 29, 29]),
  ('partial repair boundary #2', [0, 4, 3, 50, 47], [1, 1, 1, 1]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('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
gray quest #1[59, 59][19, 19]Failed
fault site gap tier ordering #1[4, 4, 4, 4, 2, 2][1, 1, 1, 1, 0, 0]Failed
fault site gap tier ordering #2[30, 0, 0, 0, 0][10, 0, 0, 0, 0]Failed
partial repair boundary #1[60, 60, 30, 30][60, 60, 30, 30]Passed
partial repair boundary #2[1, 1, 0, 0, 0][1, 1, 0, 0, 0]Passed
crossing into half tier #1[101, 101, 50, 50][101, 101, 50, 50]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 / 0f3f41f9d7bac306ca55ddf41e4516e45c1a9d19aa8e21bbce35765404af6c04

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 >= 4:
        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 = [[('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gap tier ordering #1', [1, 6, 7, 45, 37], [1, 1, 1, 1, 0, 0]),
  ('fault site gap tier ordering #2', [9, 5, 101, 15, 10], [10, 0, 0, 0, 0]),
  ('partial repair boundary #1', [3, 4, 101, 31, 28], [60, 60, 30, 30]),
  ('partial repair boundary #2', [3, 5, 3, 32, 29], [1, 1, 0, 0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('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])],
 [('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gap tier ordering #1', [9, 5, 101, 15, 10], [10, 0, 0, 0, 0]),
  ('fault site gap tier ordering #2', [6, 2, 364, 55, 48], [36, 36]),
  ('partial repair boundary #1', [5, 5, 273, 47, 44], [81, 81, 81, 81, 81]),
  ('partial repair boundary #2', [6, 6, 3, 49, 46], [0, 0, 0, 0, 0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('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])],
 [('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gap tier ordering #1', [8, 5, 101, 53, 48], [10, 10, 0, 0, 0]),
  ('fault site gap tier ordering #2', [8, 5, 99, 31, 25], [9, 9, 0, 0, 0]),
  ('partial repair boundary #1', [1, 2, 101, 59, 56], [60, 60]),
  ('partial repair boundary #2', [3, 6, 7, 49, 46], [4, 4, 2, 2, 2, 2]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('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])],
 [('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gap tier ordering #1', [0, 1, 99, 15, 8], [19]),
  ('fault site gap tier ordering #2', [3, 6, 469, 32, 26], [93, 93, 46, 46, 46, 46]),
  ('partial repair boundary #1', [2, 2, 1, 30, 27], [0, 0]),
  ('partial repair boundary #2', [2, 2, 1, 55, 52], [0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [8, 2, 1, 33, 25], [0, 0])],
 [('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gap tier ordering #1', [6, 6, 99, 40, 35], [9, 9, 9, 9, 0, 0]),
  ('fault site gap tier ordering #2', [9, 5, 99, 15, 7], [9, 0, 0, 0, 0]),
  ('partial repair boundary #1', [4, 5, 99, 41, 38], [59, 29, 29, 29, 29]),
  ('partial repair boundary #2', [0, 4, 3, 50, 47], [1, 1, 1, 1]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('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
gray quest #1[19, 19][19, 19]Passed
fault site gap tier ordering #1[1, 1, 1, 1, 0, 0][1, 1, 1, 1, 0, 0]Passed
fault site gap tier ordering #2[10, 0, 0, 0, 0][10, 0, 0, 0, 0]Passed
partial repair boundary #1[101, 101, 50, 50][60, 60, 30, 30]Failed
partial repair boundary #2[3, 3, 1, 1, 1][1, 1, 0, 0, 0]Failed
crossing into half tier #1[101, 101, 50, 50][101, 101, 50, 50]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 / cfca59d05409c1627b452ac0da288196c1fa46b66a8097670032a8e62c4c02ad

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 = [[('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gap tier ordering #1', [1, 6, 7, 45, 37], [1, 1, 1, 1, 0, 0]),
  ('fault site gap tier ordering #2', [9, 5, 101, 15, 10], [10, 0, 0, 0, 0]),
  ('partial repair boundary #1', [3, 4, 101, 31, 28], [60, 60, 30, 30]),
  ('partial repair boundary #2', [3, 5, 3, 32, 29], [1, 1, 0, 0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('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])],
 [('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gap tier ordering #1', [9, 5, 101, 15, 10], [10, 0, 0, 0, 0]),
  ('fault site gap tier ordering #2', [6, 2, 364, 55, 48], [36, 36]),
  ('partial repair boundary #1', [5, 5, 273, 47, 44], [81, 81, 81, 81, 81]),
  ('partial repair boundary #2', [6, 6, 3, 49, 46], [0, 0, 0, 0, 0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('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])],
 [('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gap tier ordering #1', [8, 5, 101, 53, 48], [10, 10, 0, 0, 0]),
  ('fault site gap tier ordering #2', [8, 5, 99, 31, 25], [9, 9, 0, 0, 0]),
  ('partial repair boundary #1', [1, 2, 101, 59, 56], [60, 60]),
  ('partial repair boundary #2', [3, 6, 7, 49, 46], [4, 4, 2, 2, 2, 2]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('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])],
 [('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gap tier ordering #1', [0, 1, 99, 15, 8], [19]),
  ('fault site gap tier ordering #2', [3, 6, 469, 32, 26], [93, 93, 46, 46, 46, 46]),
  ('partial repair boundary #1', [2, 2, 1, 30, 27], [0, 0]),
  ('partial repair boundary #2', [2, 2, 1, 55, 52], [0, 0]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('harder quest no penalty #1', [8, 3, 50, 10, 18], [25, 25, 0]),
  ('control #1', [8, 2, 1, 33, 25], [0, 0])],
 [('gray quest #1', [0, 2, 99, 30, 25], [19, 19]),
  ('fault site gap tier ordering #1', [6, 6, 99, 40, 35], [9, 9, 9, 9, 0, 0]),
  ('fault site gap tier ordering #2', [9, 5, 99, 15, 7], [9, 0, 0, 0, 0]),
  ('partial repair boundary #1', [4, 5, 99, 41, 38], [59, 29, 29, 29, 29]),
  ('partial repair boundary #2', [0, 4, 3, 50, 47], [1, 1, 1, 1]),
  ('crossing into half tier #1', [3, 4, 101, 20, 20], [101, 101, 50, 50]),
  ('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
gray quest #1[19, 19][19, 19]Passed
fault site gap tier ordering #1[1, 1, 1, 1, 0, 0][1, 1, 1, 1, 0, 0]Passed
fault site gap tier ordering #2[10, 0, 0, 0, 0][10, 0, 0, 0, 0]Passed
partial repair boundary #1[60, 60, 30, 30][60, 60, 30, 30]Passed
partial repair boundary #2[1, 1, 0, 0, 0][1, 1, 0, 0, 0]Passed
crossing into half tier #1[101, 101, 50, 50][101, 101, 50, 50]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 / 41c28b726d6c44bf6a59c0cf92aa035896232e0d0817a0d7df6b2aa618dc27f2

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

Case digest / eb9ae5fd44d5f3c518fb43319cf1ef39c2edbf1195bdfc2595395573cc311dc8