FA-56776 / Auction allocation rules / Open access
Withdrawal liability: unreturned award units · case 01
Return accounting subtracts from withdrawn quantity rather than the outstanding award.
ROOT CAUSE
Return accounting subtracts from withdrawn quantity rather than the outstanding award.
VERIFIED REPAIR
For unreturned award units, apply the stipulated decision max(0,x["awarded_units"]-x["returned_units"]).
Unsuccessful approach: The attempted repair uses max(0,x["withdrawn_units"]-x["returned_units"]); the explicit regression cases demonstrate that this still violates the stipulated auction rule.
Case contract
A toy auction withdrawal policy distinguishes voluntary withdrawal before award, excused withdrawal, replacement proceeds, paid deposits and caps on liquidated liability. Nonnegative integer credits are used; no legal or financial interpretation is intended. Named decision unreturned-award-units: For unreturned award units, apply the stipulated decision max(0,x["awarded_units"]-x["returned_units"]).
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 = max(0,x["bid"]-x["resale"])
v1 = 0 if x["excused"] else x["fee"]
v2 = max(0,x["bid"]-x["resale"]) if x["awarded"] else 0
v3 = 0 if x["notice"]<=x["cutoff"] else x["deposit"]
v4 = max(0,x["bid"]-x["resale"]-x["deposit"])
v5 = max(0,min(x["cap"],max(0,x["bid"]-x["resale"])+x["fee"])-x["already_paid"])
v6 = x["bond"] if x["forfeit"] and not x["released"] else 0
v7 = x["awarded_units"]
v8 = min(x["withdrawn_units"],max(0,x["awarded_units"]-x["returned_units"]))
v9 = [b for b in dict.fromkeys(b for op,b in x["events"]) if [op for op,c in x["events"] if c==b][-1]=="withdraw"]
return {'resale-shortfall':v0,'excused-fee-waiver':v1,'award-liability-gate':v2,'notice-penalty':v3,'deposit-offset':v4,'paid-liability-credit':v5,'released-bond-exclusion':v6,'unreturned-award-units':v7,'withdrawal-unit-cap':v8,'reinstatement-after-withdrawal':v9}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('notice order retained', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['b', 'a', 'b'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('resale surplus', {'bid': 30, 'resale': 40, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('excused default', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': True, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('before award', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': False, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('timely notice', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 3, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('exact notice cutoff', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 4, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('liability already paid', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 40, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('bond released', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': True, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20])]
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))['unreturned-award-units'], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal contract | 5 | 4 | Failed |
| notice order retained | 5 | 4 | Failed |
| resale surplus | 5 | 4 | Failed |
| excused default | 5 | 4 | Failed |
| before award | 5 | 4 | Failed |
| timely notice | 5 | 4 | Failed |
| exact notice cutoff | 5 | 4 | Failed |
| liability already paid | 5 | 4 | Failed |
| bond released | 5 | 4 | Failed |
SHA-256 / 680da57a7ad0f69be0c75d2af800af9b72968956a7f6aa86bd0e2b0250e44e31
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
v0 = max(0,x["bid"]-x["resale"])
v1 = 0 if x["excused"] else x["fee"]
v2 = max(0,x["bid"]-x["resale"]) if x["awarded"] else 0
v3 = 0 if x["notice"]<=x["cutoff"] else x["deposit"]
v4 = max(0,x["bid"]-x["resale"]-x["deposit"])
v5 = max(0,min(x["cap"],max(0,x["bid"]-x["resale"])+x["fee"])-x["already_paid"])
v6 = x["bond"] if x["forfeit"] and not x["released"] else 0
v7 = max(0,x["withdrawn_units"]-x["returned_units"])
v8 = min(x["withdrawn_units"],max(0,x["awarded_units"]-x["returned_units"]))
v9 = [b for b in dict.fromkeys(b for op,b in x["events"]) if [op for op,c in x["events"] if c==b][-1]=="withdraw"]
return {'resale-shortfall':v0,'excused-fee-waiver':v1,'award-liability-gate':v2,'notice-penalty':v3,'deposit-offset':v4,'paid-liability-credit':v5,'released-bond-exclusion':v6,'unreturned-award-units':v7,'withdrawal-unit-cap':v8,'reinstatement-after-withdrawal':v9}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('notice order retained', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['b', 'a', 'b'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('resale surplus', {'bid': 30, 'resale': 40, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('excused default', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': True, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('before award', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': False, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('timely notice', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 3, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('exact notice cutoff', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 4, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('liability already paid', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 40, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('bond released', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': True, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20])]
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))['unreturned-award-units'], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal contract | 1 | 4 | Failed |
| notice order retained | 1 | 4 | Failed |
| resale surplus | 1 | 4 | Failed |
| excused default | 1 | 4 | Failed |
| before award | 1 | 4 | Failed |
| timely notice | 1 | 4 | Failed |
| exact notice cutoff | 1 | 4 | Failed |
| liability already paid | 1 | 4 | Failed |
| bond released | 1 | 4 | Failed |
SHA-256 / 6db2b7fa2a10154301934b8f02ffdd4b15f4a39a908563b7fbcbb6827ede80e8
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
v0 = max(0,x["bid"]-x["resale"])
v1 = 0 if x["excused"] else x["fee"]
v2 = max(0,x["bid"]-x["resale"]) if x["awarded"] else 0
v3 = 0 if x["notice"]<=x["cutoff"] else x["deposit"]
v4 = max(0,x["bid"]-x["resale"]-x["deposit"])
v5 = max(0,min(x["cap"],max(0,x["bid"]-x["resale"])+x["fee"])-x["already_paid"])
v6 = x["bond"] if x["forfeit"] and not x["released"] else 0
v7 = max(0,x["awarded_units"]-x["returned_units"])
v8 = min(x["withdrawn_units"],max(0,x["awarded_units"]-x["returned_units"]))
v9 = [b for b in dict.fromkeys(b for op,b in x["events"]) if [op for op,c in x["events"] if c==b][-1]=="withdraw"]
return {'resale-shortfall':v0,'excused-fee-waiver':v1,'award-liability-gate':v2,'notice-penalty':v3,'deposit-offset':v4,'paid-liability-credit':v5,'released-bond-exclusion':v6,'unreturned-award-units':v7,'withdrawal-unit-cap':v8,'reinstatement-after-withdrawal':v9}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('notice order retained', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['b', 'a', 'b'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('resale surplus', {'bid': 30, 'resale': 40, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('excused default', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': True, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('before award', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': False, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('timely notice', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 3, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('exact notice cutoff', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 4, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('liability already paid', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 40, 'cap': 20, 'released': False, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20]), ('bond released', {'bid': 30, 'resale': 18, 'deposit': 8, 'fee': 3, 'excused': False, 'awarded': True, 'notice': 5, 'cutoff': 4, 'already_paid': 2, 'cap': 20, 'released': True, 'withdrawn_units': 2, 'awarded_units': 5, 'returned_units': 1, 'bond': 6, 'forfeit': True, 'withdrawals': ['a', 'b', 'a'], 'events': [['withdraw', 'a'], ['reinstate', 'a'], ['withdraw', 'b']]}, [4, 8, 12, 16, 20])]
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))['unreturned-award-units'], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal contract | 4 | 4 | Passed |
| notice order retained | 4 | 4 | Passed |
| resale surplus | 4 | 4 | Passed |
| excused default | 4 | 4 | Passed |
| before award | 4 | 4 | Passed |
| timely notice | 4 | 4 | Passed |
| exact notice cutoff | 4 | 4 | Passed |
| liability already paid | 4 | 4 | Passed |
| bond released | 4 | 4 | Passed |
SHA-256 / b9ee64f0c9dfaf7984248dc044a7313dc70c8bed976ebde64909afba9137d61e
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:10.310882+00:00.
Case digest / ac1306291173628c435807307195548fa7c3564c39d713411f93ab1f16701197