FAILURE MAP
← Case archive

FA-56881 / Auction allocation rules / Open access

Deposit admission: topup posting · case 01

Topups restore an expired deposit or post before confirmation.

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

ROOT CAUSE

Topups restore an expired deposit or post before confirmation.

VERIFIED REPAIR

For topup posting, apply the stipulated decision 0 if x["expired"] else x["cleared"]+(x["topup"] if x["confirmed"] else 0).

Unsuccessful approach: The attempted repair uses x["cleared"]+(x["topup"] if x["confirmed"] else 0); the explicit regression cases demonstrate that this still violates the stipulated auction rule.

Case contract

Toy bidder deposits consist of cleared, pending and restricted tranches. Deposits are auction-scoped and denomination-specific. Admission capacity is per bidder; a waiver substitutes for a required deposit without turning a pending transfer into cash. Named decision topup-posting: For topup posting, apply the stipulated decision 0 if x["expired"] else x["cleared"]+(x["topup"] if x["confirmed"] else 0).

Why this case matters

Offline administrative auction model for software failure analysis.

1 / The failure

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

N = 1
observations = []
def solve(x):
    v0 = x["cleared"]>=x["required"]
    v1 = max(0,x["cleared"]-x["restricted"])
    v2 = x["waiver"] or x["cleared"]>=x["required"]
    v3 = x["auction"]==x["deposit_auction"]
    v4 = x["currency"]==x["deposit_currency"]
    v5 = max(0,x["cleared"]-x["chargeback"])
    v6 = max(0,x["cleared"]-x["locked"])
    v7 = x["owner"]==x["beneficiary"] and x["owner"] in x["owners"]
    v8 = x["cleared"]+x["topup"]
    v9 = min(x["refunded"],max(0,x["cleared"]-x["locked"]))
    return {'cleared-admission':v0,'restricted-tranche':v1,'deposit-waiver-admission':v2,'auction-scope':v3,'denomination-scope':v4,'chargeback-recovery':v5,'withdrawable-deposit':v6,'beneficial-owner':v7,'topup-posting':v8,'refund-available-ceiling':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('cleared sufficient', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 10, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('expired deposit', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': True, 'topup': 8, 'confirmed': False, 'refunded': 4}, [0, 0, 0, 0, 0]), ('cleared sufficient / expired deposit', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 10, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': True, 'topup': 8, 'confirmed': False, 'refunded': 4}, [0, 0, 0, 0, 0]), ('deposit waived', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': True, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('wrong auction', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'B', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('wrong denomination', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'ALT', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('topup confirmed', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': True, 'refunded': 4}, [28, 56, 84, 112, 140]), ('chargeback consumes balance', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 30, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('all locked', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 30, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['topup-posting'], expected[N-1])
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
normal contract2820Failed
cleared sufficient2820Failed
expired deposit280Failed
cleared sufficient / expired deposit280Failed
deposit waived2820Failed
wrong auction2820Failed
wrong denomination2820Failed
topup confirmed2828Passed
chargeback consumes balance2820Failed
all locked2820Failed

SHA-256 / a54628025207c6951efeaca9e5ac2137c684175c8cfea1937b3c786952f91758

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    v0 = x["cleared"]>=x["required"]
    v1 = max(0,x["cleared"]-x["restricted"])
    v2 = x["waiver"] or x["cleared"]>=x["required"]
    v3 = x["auction"]==x["deposit_auction"]
    v4 = x["currency"]==x["deposit_currency"]
    v5 = max(0,x["cleared"]-x["chargeback"])
    v6 = max(0,x["cleared"]-x["locked"])
    v7 = x["owner"]==x["beneficiary"] and x["owner"] in x["owners"]
    v8 = x["cleared"]+(x["topup"] if x["confirmed"] else 0)
    v9 = min(x["refunded"],max(0,x["cleared"]-x["locked"]))
    return {'cleared-admission':v0,'restricted-tranche':v1,'deposit-waiver-admission':v2,'auction-scope':v3,'denomination-scope':v4,'chargeback-recovery':v5,'withdrawable-deposit':v6,'beneficial-owner':v7,'topup-posting':v8,'refund-available-ceiling':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('cleared sufficient', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 10, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('expired deposit', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': True, 'topup': 8, 'confirmed': False, 'refunded': 4}, [0, 0, 0, 0, 0]), ('cleared sufficient / expired deposit', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 10, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': True, 'topup': 8, 'confirmed': False, 'refunded': 4}, [0, 0, 0, 0, 0]), ('deposit waived', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': True, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('wrong auction', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'B', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('wrong denomination', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'ALT', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('topup confirmed', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': True, 'refunded': 4}, [28, 56, 84, 112, 140]), ('chargeback consumes balance', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 30, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('all locked', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 30, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['topup-posting'], expected[N-1])
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
normal contract2020Passed
cleared sufficient2020Passed
expired deposit200Failed
cleared sufficient / expired deposit200Failed
deposit waived2020Passed
wrong auction2020Passed
wrong denomination2020Passed
topup confirmed2828Passed
chargeback consumes balance2020Passed
all locked2020Passed

SHA-256 / ded574a3e63faedc3b560f27901b8c95de94b8a52dab6d9cb818c05066c4507c

3 / The verified repair

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

N = 1
observations = []
def solve(x):
    v0 = x["cleared"]>=x["required"]
    v1 = max(0,x["cleared"]-x["restricted"])
    v2 = x["waiver"] or x["cleared"]>=x["required"]
    v3 = x["auction"]==x["deposit_auction"]
    v4 = x["currency"]==x["deposit_currency"]
    v5 = max(0,x["cleared"]-x["chargeback"])
    v6 = max(0,x["cleared"]-x["locked"])
    v7 = x["owner"]==x["beneficiary"] and x["owner"] in x["owners"]
    v8 = 0 if x["expired"] else x["cleared"]+(x["topup"] if x["confirmed"] else 0)
    v9 = min(x["refunded"],max(0,x["cleared"]-x["locked"]))
    return {'cleared-admission':v0,'restricted-tranche':v1,'deposit-waiver-admission':v2,'auction-scope':v3,'denomination-scope':v4,'chargeback-recovery':v5,'withdrawable-deposit':v6,'beneficial-owner':v7,'topup-posting':v8,'refund-available-ceiling':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('cleared sufficient', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 10, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('expired deposit', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': True, 'topup': 8, 'confirmed': False, 'refunded': 4}, [0, 0, 0, 0, 0]), ('cleared sufficient / expired deposit', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 10, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': True, 'topup': 8, 'confirmed': False, 'refunded': 4}, [0, 0, 0, 0, 0]), ('deposit waived', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': True, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('wrong auction', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'B', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('wrong denomination', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'ALT', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('topup confirmed', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': True, 'refunded': 4}, [28, 56, 84, 112, 140]), ('chargeback consumes balance', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 30, 'locked': 6, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100]), ('all locked', {'cleared': 20, 'pending': 15, 'restricted': 7, 'required': 25, 'waiver': False, 'auction': 'A', 'deposit_auction': 'A', 'currency': 'TOK', 'deposit_currency': 'TOK', 'chargeback': 3, 'locked': 30, 'owners': ['a', 'b'], 'owner': 'a', 'beneficiary': 'a', 'expired': False, 'topup': 8, 'confirmed': False, 'refunded': 4}, [20, 40, 60, 80, 100])]
def vary(value):
 if type(value) is int: return value*N
 if isinstance(value,list): return [vary(v) for v in value]
 if isinstance(value,dict): return {k:(v if k in ['count', 'delivery_index', 'disputed', 'maximum_set', 'minimum_set', 'stage', 'threshold', 'waived'] else vary(v)) for k,v in value.items()}
 return value
for label, request, expected in fixtures:
 check(label, solve(vary(request))['topup-posting'], expected[N-1])
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
normal contract2020Passed
cleared sufficient2020Passed
expired deposit00Passed
cleared sufficient / expired deposit00Passed
deposit waived2020Passed
wrong auction2020Passed
wrong denomination2020Passed
topup confirmed2828Passed
chargeback consumes balance2020Passed
all locked2020Passed

SHA-256 / 903773daff32059d6784f9f42c3bad04026f3c1f67bc3a20a844246d8332e4c1

Verification & scope

Stipulated toy auction rules, not a venue specification, financial advice, optimization claim, or live trading implementation. Nonnegative integer inputs and internally aligned list fields only. 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:46:11.339008+00:00.

Case digest / bf1cea6ae7e34a4e8183738d4c9bd05c0b88de878efce90619d9b0203a2f6fd3