FA-56406 / Auction allocation rules / Open access
Amendment priority: remaining recalculation · case 01
Replacement remaining quantity ignores already executed units.
ROOT CAUSE
Replacement remaining quantity ignores already executed units.
VERIFIED REPAIR
Subtract cumulative fills from the replacement total.
Unsuccessful approach: The attempted repair uses max(0,x["total"]-x["filled"]); the explicit regression cases demonstrate that this still violates the stipulated auction rule.
Case contract
A single auction order amendment tracks filled units, original queue stamp and an incoming replacement. Price change or size increase loses queue priority; reducing total size cannot erase existing fills. A cancel acknowledgment terminates remaining quantity. Integer stamps and quantities are nonnegative. Named decision remaining-recalculation: Subtract cumulative fills from the replacement total.
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["now"] if x["new_total"]>x["total"] else x["stamp"]
v1 = x["now"] if x["new_price"]!=x["old_price"] else x["stamp"]
v2 = max(x["filled"],x["new_total"])
v3 = x["new_total"]
v4 = 0 if x["cancel"] and x["ack"] else max(0,x["total"]-x["filled"])
v5 = x["expected"]==x["revision"]
v6 = x["old_lot"]==x["new_lot"]
v7 = x["old_owner"]==x["new_owner"]
v8 = not x["frozen"] or (x["new_price"]==x["old_price"] and x["new_total"]<=x["total"])
v9 = x["revision"] if x["request_id"]==x["last_id"] else x["revision"]+1
return {'increase-priority':v0,'price-priority':v1,'filled-floor':v2,'remaining-recalculation':v3,'cancel-ack-gate':v4,'revision-compare':v5,'lot-immutability':v6,'owner-immutability':v7,'freeze-restriction':v8,'request-replay':v9}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('lower price', {'old_price': 10, 'new_price': 8, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('unrelated acknowledgment', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': True, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('future revision', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 3, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('no collateral held', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 0, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('price replacement', {'old_price': 10, 'new_price': 12, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('size increase', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 12, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [9, 18, 27, 36, 45]), ('below executed size', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 2, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [0, 0, 0, 0, 0]), ('acknowledged cancel', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': True, 'ack': True, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15])]
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))['remaining-recalculation'], 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 | 6 | 3 | Failed |
| lower price | 6 | 3 | Failed |
| unrelated acknowledgment | 6 | 3 | Failed |
| future revision | 6 | 3 | Failed |
| no collateral held | 6 | 3 | Failed |
| price replacement | 6 | 3 | Failed |
| size increase | 12 | 9 | Failed |
| below executed size | 2 | 0 | Failed |
| acknowledged cancel | 6 | 3 | Failed |
SHA-256 / a57c26e99b90bd137f0dabbc1c13f9f5870893b93d3d6a41ddebfceee3496fda
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
v0 = x["now"] if x["new_total"]>x["total"] else x["stamp"]
v1 = x["now"] if x["new_price"]!=x["old_price"] else x["stamp"]
v2 = max(x["filled"],x["new_total"])
v3 = max(0,x["total"]-x["filled"])
v4 = 0 if x["cancel"] and x["ack"] else max(0,x["total"]-x["filled"])
v5 = x["expected"]==x["revision"]
v6 = x["old_lot"]==x["new_lot"]
v7 = x["old_owner"]==x["new_owner"]
v8 = not x["frozen"] or (x["new_price"]==x["old_price"] and x["new_total"]<=x["total"])
v9 = x["revision"] if x["request_id"]==x["last_id"] else x["revision"]+1
return {'increase-priority':v0,'price-priority':v1,'filled-floor':v2,'remaining-recalculation':v3,'cancel-ack-gate':v4,'revision-compare':v5,'lot-immutability':v6,'owner-immutability':v7,'freeze-restriction':v8,'request-replay':v9}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('lower price', {'old_price': 10, 'new_price': 8, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('unrelated acknowledgment', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': True, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('future revision', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 3, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('no collateral held', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 0, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('price replacement', {'old_price': 10, 'new_price': 12, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('size increase', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 12, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [9, 18, 27, 36, 45]), ('below executed size', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 2, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [0, 0, 0, 0, 0]), ('acknowledged cancel', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': True, 'ack': True, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15])]
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))['remaining-recalculation'], 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 | 3 | Failed |
| lower price | 5 | 3 | Failed |
| unrelated acknowledgment | 5 | 3 | Failed |
| future revision | 5 | 3 | Failed |
| no collateral held | 5 | 3 | Failed |
| price replacement | 5 | 3 | Failed |
| size increase | 5 | 9 | Failed |
| below executed size | 5 | 0 | Failed |
| acknowledged cancel | 5 | 3 | Failed |
SHA-256 / 7a6d86dc03e5e8f187b689627896e9be038ad570362570661f0e98a638fc51d2
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
v0 = x["now"] if x["new_total"]>x["total"] else x["stamp"]
v1 = x["now"] if x["new_price"]!=x["old_price"] else x["stamp"]
v2 = max(x["filled"],x["new_total"])
v3 = max(0,x["new_total"]-x["filled"])
v4 = 0 if x["cancel"] and x["ack"] else max(0,x["total"]-x["filled"])
v5 = x["expected"]==x["revision"]
v6 = x["old_lot"]==x["new_lot"]
v7 = x["old_owner"]==x["new_owner"]
v8 = not x["frozen"] or (x["new_price"]==x["old_price"] and x["new_total"]<=x["total"])
v9 = x["revision"] if x["request_id"]==x["last_id"] else x["revision"]+1
return {'increase-priority':v0,'price-priority':v1,'filled-floor':v2,'remaining-recalculation':v3,'cancel-ack-gate':v4,'revision-compare':v5,'lot-immutability':v6,'owner-immutability':v7,'freeze-restriction':v8,'request-replay':v9}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [('normal contract', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('lower price', {'old_price': 10, 'new_price': 8, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('unrelated acknowledgment', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': True, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('future revision', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 3, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('no collateral held', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 0, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('price replacement', {'old_price': 10, 'new_price': 12, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15]), ('size increase', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 12, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [9, 18, 27, 36, 45]), ('below executed size', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 2, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': False, 'ack': False, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [0, 0, 0, 0, 0]), ('acknowledged cancel', {'old_price': 10, 'new_price': 10, 'total': 8, 'new_total': 6, 'filled': 3, 'stamp': 1, 'now': 8, 'cancel': True, 'ack': True, 'revision': 2, 'expected': 2, 'old_lot': 'A', 'new_lot': 'A', 'old_owner': 'a', 'new_owner': 'a', 'frozen': False, 'held': 8, 'request_id': 'r2', 'last_id': 'r1'}, [3, 6, 9, 12, 15])]
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))['remaining-recalculation'], 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 | 3 | 3 | Passed |
| lower price | 3 | 3 | Passed |
| unrelated acknowledgment | 3 | 3 | Passed |
| future revision | 3 | 3 | Passed |
| no collateral held | 3 | 3 | Passed |
| price replacement | 3 | 3 | Passed |
| size increase | 9 | 9 | Passed |
| below executed size | 0 | 0 | Passed |
| acknowledged cancel | 3 | 3 | Passed |
SHA-256 / 566b6f02edf045f1768eda4cecb07e65303ed976a4969eb0b2fa0f3e16e16d26
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:06.874153+00:00.
Case digest / 974adaf92bba47e2b07ffd382a48c21e36d641a63bb46da9e397639f97d95d30