FAILURE MAP
← Case archive

FA-56441 / Auction allocation rules / Open access

Escrow reservation: replace credit · case 01

Replacement affordability double-counts its own existing hold.

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

ROOT CAUSE

Replacement affordability double-counts its own existing hold.

VERIFIED REPAIR

Exclude the replaced hold but retain other auction holds.

Unsuccessful approach: The attempted repair uses x["balance"]>=x["new_hold"]; the explicit regression cases demonstrate that this still violates the stipulated auction rule.

Case contract

A toy per-auction escrow account distinguishes available funds, reserved collateral, captured fill payments and pending releases. Reservation replaces an old hold atomically; a failed replacement retains the old hold. Separate auction holds must remain unavailable. Named decision replace-credit: Exclude the replaced hold but retain other auction holds.

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["balance"]-x["other_hold"]-x["old_hold"] >= x["new_hold"]
    v1 = x["new_hold"] if x["replace_ok"] else x["old_hold"]
    v2 = max(0,x["old_hold"]-x["fill_cost"])
    v3 = x["balance"]-x["old_hold"]-x["other_hold"]+(x["pending"] if x["confirmed"] else 0)
    v4 = min(x["refund"],x["captured"])
    v5 = x["old_hold"]+x["bond"]
    v6 = max(0,x["old_hold"]-x["fill_cost"]) if x["closed"] else 0
    v7 = min(x["release"],max(0,x["old_hold"]-x["fill_cost"]))
    v8 = max(0,x["fill_cost"]-x["fee"])
    v9 = x["balance"]-x["other_hold"]-x["new_hold"] >= x["fee"]
    return {'replace-credit':v0,'atomic-replacement':v1,'capture-release':v2,'pending-release-availability':v3,'refund-ceiling':v4,'bond-separation':v5,'close-release':v6,'release-clamp':v7,'seller-net-remittance':v8,'unreserved-fee-check':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('reuse existing collateral', {'balance': 100, 'old_hold': 30, 'new_hold': 70, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('reuse existing collateral / confirmed release', {'balance': 100, 'old_hold': 30, 'new_hold': 70, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': True, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('other auction limits credit', {'balance': 100, 'old_hold': 30, 'new_hold': 90, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [False, False, False, False, False]), ('reuse existing collateral / other auction limits credit', {'balance': 100, 'old_hold': 30, 'new_hold': 90, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [False, False, False, False, False]), ('normal contract', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('insufficient replacement', {'balance': 100, 'old_hold': 30, 'new_hold': 200, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': False, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [False, False, False, False, False]), ('old hold larger', {'balance': 100, 'old_hold': 30, 'new_hold': 15, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('confirmed release', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': True, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('fully captured', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 30, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('zero reservation', {'balance': 100, 'old_hold': 0, 'new_hold': 0, 'other_hold': 0, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('closed auction', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': True}, [True, True, True, True, True])]
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))['replace-credit'], 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
reuse existing collateralFalseTrueFailed
reuse existing collateral / confirmed releaseFalseTrueFailed
other auction limits creditFalseFalsePassed
reuse existing collateral / other auction limits creditFalseFalsePassed
normal contractTrueTruePassed
insufficient replacementFalseFalsePassed
old hold largerTrueTruePassed
confirmed releaseTrueTruePassed
fully capturedTrueTruePassed
zero reservationTrueTruePassed
closed auctionTrueTruePassed

SHA-256 / c0a4700ec446bf079fc549efae4ec334840c3b2862456e50f854b6567f3dbb74

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    v0 = x["balance"]>=x["new_hold"]
    v1 = x["new_hold"] if x["replace_ok"] else x["old_hold"]
    v2 = max(0,x["old_hold"]-x["fill_cost"])
    v3 = x["balance"]-x["old_hold"]-x["other_hold"]+(x["pending"] if x["confirmed"] else 0)
    v4 = min(x["refund"],x["captured"])
    v5 = x["old_hold"]+x["bond"]
    v6 = max(0,x["old_hold"]-x["fill_cost"]) if x["closed"] else 0
    v7 = min(x["release"],max(0,x["old_hold"]-x["fill_cost"]))
    v8 = max(0,x["fill_cost"]-x["fee"])
    v9 = x["balance"]-x["other_hold"]-x["new_hold"] >= x["fee"]
    return {'replace-credit':v0,'atomic-replacement':v1,'capture-release':v2,'pending-release-availability':v3,'refund-ceiling':v4,'bond-separation':v5,'close-release':v6,'release-clamp':v7,'seller-net-remittance':v8,'unreserved-fee-check':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('reuse existing collateral', {'balance': 100, 'old_hold': 30, 'new_hold': 70, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('reuse existing collateral / confirmed release', {'balance': 100, 'old_hold': 30, 'new_hold': 70, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': True, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('other auction limits credit', {'balance': 100, 'old_hold': 30, 'new_hold': 90, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [False, False, False, False, False]), ('reuse existing collateral / other auction limits credit', {'balance': 100, 'old_hold': 30, 'new_hold': 90, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [False, False, False, False, False]), ('normal contract', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('insufficient replacement', {'balance': 100, 'old_hold': 30, 'new_hold': 200, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': False, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [False, False, False, False, False]), ('old hold larger', {'balance': 100, 'old_hold': 30, 'new_hold': 15, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('confirmed release', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': True, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('fully captured', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 30, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('zero reservation', {'balance': 100, 'old_hold': 0, 'new_hold': 0, 'other_hold': 0, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('closed auction', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': True}, [True, True, True, True, True])]
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))['replace-credit'], 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
reuse existing collateralTrueTruePassed
reuse existing collateral / confirmed releaseTrueTruePassed
other auction limits creditTrueFalseFailed
reuse existing collateral / other auction limits creditTrueFalseFailed
normal contractTrueTruePassed
insufficient replacementFalseFalsePassed
old hold largerTrueTruePassed
confirmed releaseTrueTruePassed
fully capturedTrueTruePassed
zero reservationTrueTruePassed
closed auctionTrueTruePassed

SHA-256 / a07847dd1e7547b8a757a8671372ddeca38a79e66f04f780e44548cabac99af5

3 / The verified repair

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

N = 1
observations = []
def solve(x):
    v0 = x["balance"]-x["other_hold"] >= x["new_hold"]
    v1 = x["new_hold"] if x["replace_ok"] else x["old_hold"]
    v2 = max(0,x["old_hold"]-x["fill_cost"])
    v3 = x["balance"]-x["old_hold"]-x["other_hold"]+(x["pending"] if x["confirmed"] else 0)
    v4 = min(x["refund"],x["captured"])
    v5 = x["old_hold"]+x["bond"]
    v6 = max(0,x["old_hold"]-x["fill_cost"]) if x["closed"] else 0
    v7 = min(x["release"],max(0,x["old_hold"]-x["fill_cost"]))
    v8 = max(0,x["fill_cost"]-x["fee"])
    v9 = x["balance"]-x["other_hold"]-x["new_hold"] >= x["fee"]
    return {'replace-credit':v0,'atomic-replacement':v1,'capture-release':v2,'pending-release-availability':v3,'refund-ceiling':v4,'bond-separation':v5,'close-release':v6,'release-clamp':v7,'seller-net-remittance':v8,'unreserved-fee-check':v9}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('reuse existing collateral', {'balance': 100, 'old_hold': 30, 'new_hold': 70, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('reuse existing collateral / confirmed release', {'balance': 100, 'old_hold': 30, 'new_hold': 70, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': True, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('other auction limits credit', {'balance': 100, 'old_hold': 30, 'new_hold': 90, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [False, False, False, False, False]), ('reuse existing collateral / other auction limits credit', {'balance': 100, 'old_hold': 30, 'new_hold': 90, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [False, False, False, False, False]), ('normal contract', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('insufficient replacement', {'balance': 100, 'old_hold': 30, 'new_hold': 200, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': False, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [False, False, False, False, False]), ('old hold larger', {'balance': 100, 'old_hold': 30, 'new_hold': 15, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('confirmed release', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': True, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('fully captured', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 30, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('zero reservation', {'balance': 100, 'old_hold': 0, 'new_hold': 0, 'other_hold': 0, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': False}, [True, True, True, True, True]), ('closed auction', {'balance': 100, 'old_hold': 30, 'new_hold': 50, 'other_hold': 20, 'fill_cost': 12, 'release': 5, 'pending': 7, 'confirmed': False, 'replace_ok': True, 'captured': 10, 'refund': 4, 'fee': 3, 'bond': 8, 'closed': True}, [True, True, True, True, True])]
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))['replace-credit'], 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
reuse existing collateralTrueTruePassed
reuse existing collateral / confirmed releaseTrueTruePassed
other auction limits creditFalseFalsePassed
reuse existing collateral / other auction limits creditFalseFalsePassed
normal contractTrueTruePassed
insufficient replacementFalseFalsePassed
old hold largerTrueTruePassed
confirmed releaseTrueTruePassed
fully capturedTrueTruePassed
zero reservationTrueTruePassed
closed auctionTrueTruePassed

SHA-256 / 51a551ec9aa1995cc0839d2bf7dff37c9f5f2fd6bcbb2bd46ff2b43961a8551d

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

Case digest / cbf5999359fa7989557f1e4d5ef3215ae00997871e32c66acba05fb0b8c44343