FA-56766 / Auction allocation rules / Open access
Withdrawal liability: paid liability credit · case 01
Collected liability is credited on the wrong side of the liability cap.
ROOT CAUSE
Collected liability is credited on the wrong side of the liability cap.
VERIFIED REPAIR
For paid liability credit, apply the stipulated decision max(0,min(x["cap"],max(0,x["bid"]-x["resale"])+x["fee"])-x["already_paid"]).
Unsuccessful approach: The attempted repair uses min(x["cap"],max(0,x["bid"]-x["resale"]-x["already_paid"])+x["fee"]); 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 paid-liability-credit: For paid liability credit, apply the stipulated decision max(0,min(x["cap"],max(0,x["bid"]-x["resale"])+x["fee"])-x["already_paid"]).
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,x["bid"]-x["resale"])+x["fee"]
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']]}, [13, 26, 39, 52, 65]), ('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']]}, [13, 26, 39, 52, 65]), ('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']]}, [1, 2, 3, 4, 5]), ('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']]}, [0, 0, 0, 0, 0]), ('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']]}, [13, 26, 39, 52, 65]), ('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']]}, [13, 26, 39, 52, 65]), ('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']]}, [13, 26, 39, 52, 65]), ('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']]}, [13, 26, 39, 52, 65]), ('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']]}, [13, 26, 39, 52, 65])]
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))['paid-liability-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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal contract | 15 | 13 | Failed |
| notice order retained | 15 | 13 | Failed |
| resale surplus | 3 | 1 | Failed |
| liability already paid | 15 | 0 | Failed |
| excused default | 15 | 13 | Failed |
| before award | 15 | 13 | Failed |
| timely notice | 15 | 13 | Failed |
| exact notice cutoff | 15 | 13 | Failed |
| bond released | 15 | 13 | Failed |
SHA-256 / ae31262ed4e7e1dbfa5912398639f75e6ca7e7c20b76cbe370a49a15ed8feb4d
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 = min(x["cap"],max(0,x["bid"]-x["resale"]-x["already_paid"])+x["fee"])
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']]}, [13, 26, 39, 52, 65]), ('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']]}, [13, 26, 39, 52, 65]), ('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']]}, [1, 2, 3, 4, 5]), ('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']]}, [0, 0, 0, 0, 0]), ('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']]}, [13, 26, 39, 52, 65]), ('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']]}, [13, 26, 39, 52, 65]), ('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']]}, [13, 26, 39, 52, 65]), ('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']]}, [13, 26, 39, 52, 65]), ('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']]}, [13, 26, 39, 52, 65])]
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))['paid-liability-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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal contract | 13 | 13 | Passed |
| notice order retained | 13 | 13 | Passed |
| resale surplus | 3 | 1 | Failed |
| liability already paid | 3 | 0 | Failed |
| excused default | 13 | 13 | Passed |
| before award | 13 | 13 | Passed |
| timely notice | 13 | 13 | Passed |
| exact notice cutoff | 13 | 13 | Passed |
| bond released | 13 | 13 | Passed |
SHA-256 / 8f4f8bb0b6c809e4959a4cf7e7575b4a7cbb0ab11de14de758393584994e9030
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']]}, [13, 26, 39, 52, 65]), ('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']]}, [13, 26, 39, 52, 65]), ('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']]}, [1, 2, 3, 4, 5]), ('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']]}, [0, 0, 0, 0, 0]), ('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']]}, [13, 26, 39, 52, 65]), ('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']]}, [13, 26, 39, 52, 65]), ('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']]}, [13, 26, 39, 52, 65]), ('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']]}, [13, 26, 39, 52, 65]), ('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']]}, [13, 26, 39, 52, 65])]
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))['paid-liability-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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal contract | 13 | 13 | Passed |
| notice order retained | 13 | 13 | Passed |
| resale surplus | 1 | 1 | Passed |
| liability already paid | 0 | 0 | Passed |
| excused default | 13 | 13 | Passed |
| before award | 13 | 13 | Passed |
| timely notice | 13 | 13 | Passed |
| exact notice cutoff | 13 | 13 | Passed |
| bond released | 13 | 13 | Passed |
SHA-256 / 2b5b8fb757438d8845c33f0ec260bb42397731d5f5e77b658826c5c8cef26c6a
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.265156+00:00.
Case digest / 73574366d65e983077b59a53232e06d2c3b8b40cb6bdfc1054f8356dd212db7b